.workspace {
  background: var(--canvas);
}
.nav-icon,
.lock-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  width: 21px;
  height: 21px;
}
.brand-leaf {
  width: 28px;
  height: 36px;
  transform: none;
  flex: none;
}
.brand {
  gap: 5px;
  padding-inline: 4px;
}
.side-art {
  background-image: url(/assets/landscape.png);
  background-size: 100% auto;
  min-height: 390px;
}
.field input {
  min-width: 0;
}
.detail-card > .entry-tags {
  justify-content: flex-start;
  max-width: none;
  margin-bottom: 18px;
}
.entry-title {
  font-size: 16px;
}
.entry-preview {
  font-size: 14px;
  line-height: 1.6;
}
.nav-item {
  font-size: 15px;
}
.entry-time,
.day-meta {
  font-size: 13px;
}
.day-heading h2 {
  font-size: 18px;
}
.brand {
  font-size: 13px;
}
.composer textarea {
  font-size: 16px;
}
.field input,
.field select {
  font-size: 13px;
}
.tag-chip {
  font-size: 12px;
}
.tag-chip {
  border: 0;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.tag-chip:hover {
  background: #d6eafd;
}
.timeline-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #8290a1;
  font-size: 12px;
  margin-bottom: 8px;
}
.selected-tag {
  background: #167eca !important;
  color: #fff !important;
}
.selected-tag .tag-count {
  color: #dbeeff;
}
.result-date {
  white-space: pre-line;
}
button:disabled {
  opacity: .48;
  cursor: default;
}
[hidden] {
  display: none !important;
}
.editor-body {
  font-family:
    "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
}
.entry-card:focus-visible,
.result-card:focus-visible {
  outline: 3px solid #75b8f2;
  outline-offset: 2px;
}
.storage-note {
  white-space: pre-line;
}
.theme-dark .tag-chip {
  background: #294761;
  color: #b4d8f3;
}
.theme-dark .markdown-body pre,
.theme-dark .markdown-body code {
  background: #23384b;
}
.theme-dark .markdown-body blockquote {
  background: #21394f;
}
.theme-dark .dialog {
  background: #1d2938;
  color: #e1e9f3;
}
@media (max-width: 650px) {
  .toast {
    bottom: 78px;
    max-width: 90%;
    width: max-content;
  }
  .topbar {
    gap: 5px;
  }
  .global-search {
    width: 140px;
  }
  .private-state {
    display: none;
  }
  .mobile-brand {
    font-size: 11px;
  }
  .timeline-toolbar > span {
    display: none;
  }
  .nav-item {
    font-size: 11px;
  }
  .entry-title {
    font-size: 14px;
  }
  .entry-preview {
    font-size: 13px;
  }
  .entry-time {
    font-size: 11px;
  }
  .day-meta {
    font-size: 11px;
  }
  .day-heading h2 {
    font-size: 15px;
  }
}
.version-panel { margin-top: 24px; border-top: 1px solid var(--border, #e4e9ef); padding-top: 18px; }
.version-panel summary { cursor: pointer; color: var(--blue, #0865ad); }
.version-item { margin-top: 14px; padding: 14px; border: 1px solid var(--border, #e4e9ef); border-radius: 8px; }
.recovery-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border, #e4e9ef); }
.recovery-row span { overflow-wrap: anywhere; }
.storage-note, .privacy-copy { overflow-wrap: anywhere; }
.page-loader { display: flex; justify-content: center; align-items: center; gap: 18px; padding: 20px 0 30px; }
.image-upload-status { color: #718096; font-size: 12px; }
.image-drop-active { outline: 2px dashed #579bd3; outline-offset: 4px; background: rgba(87, 155, 211, .06); }
.quick-image-tools { display: flex; align-items: center; gap: 8px; margin: -2px 0 14px; }
.markdown-body img { display: block; max-width: min(100%, 720px); max-height: 620px; object-fit: contain; border-radius: 10px; margin: 12px 0; cursor: zoom-in; box-shadow: 0 3px 14px rgba(22, 44, 66, .12); }
.markdown-body img:focus-visible { outline: 3px solid #75b8f2; outline-offset: 3px; }
.image-load-error { display: inline-block; padding: 10px 14px; border: 1px solid #d9a4a4; border-radius: 8px; color: #8f3d3d; background: #fff5f5; font-size: 13px; }
.theme-dark .image-load-error { border-color: #805858; color: #ffc1c1; background: #392b31; }
.image-dialog { position: fixed; inset: 0; width: min(94vw, 1200px); height: min(92vh, 900px); max-width: none; max-height: none; margin: auto; padding: 48px 18px 18px; border: 1px solid rgba(255,255,255,.35); border-radius: 14px; background: rgba(18, 27, 39, .97); color: white; }
.image-dialog::backdrop { background: rgba(8, 14, 22, .78); backdrop-filter: blur(3px); }
.image-dialog-close { position: absolute; top: 10px; right: 12px; }
.image-dialog-content { display: block; width: 100%; height: 100%; object-fit: contain; }
.theme-dark .image-upload-status { color: #a8b8ca; }
@media (max-width: 650px) { .image-dialog { width: 100vw; height: 100dvh; border: 0; border-radius: 0; } }

.editor-tools { height: auto; min-height: 44px; padding-block: 6px; flex-wrap: wrap; }
.editor-tools button { flex-shrink: 0; white-space: nowrap; }
.editor-tools .image-upload-status:empty { display: none; }
.editor-tools .image-upload-status { flex-basis: 100%; order: 2; padding: 0 6px; }
@media (max-width: 650px) {
  .editor-tools { gap: 3px; }
  .editor-tools button { min-width: 30px; }
  .editor-tools .tool-spacer { display: none; }
}

/* Journal reading workspace */
@media (min-width: 900px) {
  .app-shell { grid-template-columns: 176px minmax(0, 1fr); }
  .sidebar { width: 176px; padding-inline: 8px; }
  .brand { font-size: 12px; }
  .main-content { width: 100%; max-width: none; padding: 0; }
  .workspace { min-height: 100vh; }
  .topbar { display: none; }
}
.journal-columns { display: grid; grid-template-columns: minmax(280px, 35%) minmax(0, 1fr); min-height: calc(100vh - 1px); background: #fff; }
.records-pane { min-width: 0; border-right: 1px solid #e5ebf0; background: #fbfcfd; display: flex; flex-direction: column; max-height: 100vh; }
.records-pane-head { padding: 22px 20px 14px; border-bottom: 1px solid #e5ebf0; }
.records-pane-head h2 { margin: 0; font-size: 19px; }
.records-pane-head p { margin: 7px 0 0; color: #73849a; font-size: 13px; }
.records-pane-list { min-height: 0; overflow: auto; padding: 8px 12px 30px; }
.records-pane-list .result-heading { padding: 8px 8px 14px; }
.records-pane-list .result-list { display: grid; gap: 4px; }
.records-pane-list .result-card, .records-pane-list .entry-card { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: 9px; border: 1px solid transparent; cursor: pointer; }
.records-pane-list .result-card:hover, .records-pane-list .entry-card:hover { background: #f1f7fc; }
.records-pane-list .entry-main { min-width: 0; flex: 1; }
.records-pane-list .entry-title { margin: 1px 0 6px; color: #193452; }
.records-pane-list .entry-preview { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; color: #718095; }
.records-pane-list .entry-tags { margin: 7px 0 0; }
.entry-thumb { width: 76px; height: 76px; flex: none; object-fit: cover; border-radius: 7px; background: #e9eef2; }
.reading-pane { min-width: 0; padding: 30px clamp(24px, 4vw, 64px) 54px; overflow: auto; max-height: 100vh; }
.reading-pane .detail-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.reading-pane .detail-card { max-width: 850px; margin: auto; padding: 0; border: 0; box-shadow: none; }
.reading-pane .detail-title { font-size: clamp(28px, 3vw, 40px); margin-bottom: 16px; }
.reading-pane .detail-meta { align-items: center; }
.reading-pane .markdown-body { font-size: 17px; line-height: 1.9; }
.pane-empty { padding: 14px; color: #75849a; }
.background-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.background-status { display: grid; gap: 8px; }
.background-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.background-row strong { min-width: 72px; color: var(--ink); }
@media (max-width: 899px) {
  .journal-columns { display: block; min-height: 0; }
  .records-pane { max-height: 36vh; border-right: 0; border-bottom: 1px solid #e5ebf0; }
  .records-pane-list { padding: 6px 10px; }
  .reading-pane { max-height: none; padding: 20px 18px 100px; }
  .reading-pane .detail-top { margin-bottom: 16px; }
  .reading-pane .detail-title { font-size: 27px; }
  .records-pane-head { padding: 14px 16px 10px; }
  .records-pane-head h2 { font-size: 16px; }
}
@media (max-width: 650px) {
  .records-pane { max-height: 30vh; }
  .records-pane-list .entry-thumb { width: 54px; height: 54px; }
  .reading-pane .detail-meta { align-items: flex-start; }
}

.records-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.records-pane-list .is-selected { background: #e9f3fc; border-color: #d4e7f7; }
.reader-welcome { min-height: 70vh; display: grid; place-items: center; color: #8796a7; font-family: Georgia, "Songti SC", serif; font-size: 20px; }
@media (max-width: 899px) { .reader-welcome { min-height: 28vh; font-size: 16px; } }

.sync-conflicts-list { display: grid; gap: 12px; }
.sync-conflict { padding: 14px 0; border-bottom: 1px solid var(--line); }
.sync-conflict h3 { margin: 0 0 10px; font-size: 15px; }
.sync-conflict-versions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sync-conflict-version { min-width: 0; padding: 12px; background: var(--canvas); border-radius: 7px; }
.sync-conflict-version strong { font-size: 12px; }
.sync-conflict-version p { margin: 6px 0 0; color: var(--muted); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sync-conflict-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
@media (max-width: 650px) { .sync-conflict-versions { grid-template-columns: 1fr; } }

.records-pane .page-loader { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 16px; margin: 0; font-size: 11px; }
.records-pane .page-loader .button { width: 100%; }

.draft-status { min-height: 20px; color: #68809a; font-size: 12px; }
.composer .draft-status { margin-right: auto; align-self: center; }
.draft-stale-warning { margin: 0; padding: 10px 12px; border-left: 3px solid #c08a33; background: #fff8e9; color: #76571f; font-size: 13px; line-height: 1.6; }
.draft-recovery { display: grid; gap: 8px; padding: 12px clamp(16px, 3vw, 32px); border-bottom: 1px solid #dbe8f2; background: #f4f9fd; }
.draft-recovery-intro { display: flex; align-items: baseline; gap: 10px; color: #52677e; font-size: 13px; }
.draft-recovery-intro strong { color: #203b56; }
.draft-recovery-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; }
.draft-recovery-copy { display: grid; gap: 3px; min-width: 0; flex: 1; }
.draft-recovery-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-recovery-copy span { color: #7b8b9d; font-size: 12px; }
@media (max-width: 650px) { .draft-recovery-row { align-items: flex-start; flex-wrap: wrap; } .draft-recovery-copy { flex-basis: 100%; } }
