/* Novelith design tokens and components. Brand values from the «Brand e logo» page. */

:root {
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --font-text: "Literata", Georgia, serif;

  --bg: #FAF8F4;
  --sidebar: #F4F1EB;
  --surface: #FFFFFF;
  --sunken: #EFEBE4;
  --line: #E6E1D8;
  --line-2: #D7D1C6;
  --ink: #1E2329;
  --ink-2: #4B545E;
  --ink-3: #636B74;
  --accent: #E2B04A;
  --accent-ink: #8A6212;
  --accent-soft: #F6ECD6;
  --danger: #A8432C;
  --danger-soft: #F7E6E0;
  --ok: #3D6A4C;
  --ok-soft: #E3EFE6;
  --stone-1: #717A83;
  --stone-2: #4B545E;
  --stone-3: #272D34;
  --pl-1: #C9952E;
  --pl-2: #5B7A99;
  --pl-3: #6F8F72;
  --pl-4: #B26B4E;
  --knob: #FFFFFF;
  --icon-bg: #EEE9E0;
  --shadow-s: 0 1px 2px rgb(30 35 41 / .05);
  --shadow: 0 1px 2px rgb(30 35 41 / .04), 0 10px 30px rgb(30 35 41 / .07);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171B; --sidebar: #101317; --surface: #1B1F24; --sunken: #22272D;
    --line: #2A3037; --line-2: #3A414A;
    --ink: #E9E4DA; --ink-2: #B8B3A9; --ink-3: #8E949B;
    --accent: #EDBE58; --accent-ink: #EDBE58; --accent-soft: #2C2617;
    --danger: #E8907A; --danger-soft: #35201B; --ok: #8CC39E; --ok-soft: #1B2B21;
    --stone-1: #9AA1A8; --stone-2: #6E7680; --stone-3: #48505A;
    --pl-1: #EDBE58; --pl-2: #86A5C4; --pl-3: #93B396; --pl-4: #D68E70;
    --knob: #B8B3A9; --icon-bg: #1C2026;
    --shadow-s: 0 1px 2px rgb(0 0 0 / .3);
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 30px rgb(0 0 0 / .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14171B; --sidebar: #101317; --surface: #1B1F24; --sunken: #22272D;
  --line: #2A3037; --line-2: #3A414A;
  --ink: #E9E4DA; --ink-2: #B8B3A9; --ink-3: #8E949B;
  --accent: #EDBE58; --accent-ink: #EDBE58; --accent-soft: #2C2617;
  --danger: #E8907A; --danger-soft: #35201B; --ok: #8CC39E; --ok-soft: #1B2B21;
  --stone-1: #9AA1A8; --stone-2: #6E7680; --stone-3: #48505A;
  --pl-1: #EDBE58; --pl-2: #86A5C4; --pl-3: #93B396; --pl-4: #D68E70;
  --knob: #B8B3A9; --icon-bg: #1C2026;
  --shadow-s: 0 1px 2px rgb(0 0 0 / .3);
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 30px rgb(0 0 0 / .35);
  color-scheme: dark;
}

/* Base */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 13.5px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11";
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p, figure { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.i { width: 16px; height: 16px; flex: none; }
.i-s { width: 12px; height: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Type */
.display { font-family: var(--font-display); font-weight: 500; font-optical-sizing: auto; letter-spacing: -0.012em; }
.h1 { font-size: 32px; line-height: 1.15; }
.h2 { font-size: 20px; line-height: 1.25; }
.h3 { font-size: 16px; line-height: 1.3; }
.eyebrow { font: 600 11px/1.2 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.spacer { flex: 1; }

/* App shell */
.app { display: flex; height: 100vh; }
.sidebar {
  width: 252px; flex: none; display: flex; flex-direction: column;
  background: var(--sidebar); border-right: 1px solid var(--line); overflow: auto;
}
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.toolbar {
  height: 52px; flex: none; display: flex; align-items: center; gap: 8px;
  padding: 0 16px 0 24px; border-bottom: 1px solid var(--line);
}
.toolbar-title { font-weight: 600; font-size: 14px; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 13px; }
.crumbs b { color: var(--ink); font-weight: 500; }
.body { flex: 1; min-height: 0; display: flex; }
.content { flex: 1; min-width: 0; overflow: auto; }
.inspector { width: 300px; flex: none; border-left: 1px solid var(--line); overflow: auto; }
.statusbar {
  height: 32px; flex: none; display: flex; align-items: center; gap: 18px;
  padding: 0 24px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3);
}
.statusbar .i { width: 14px; height: 14px; }
.statusbar span { display: inline-flex; align-items: center; gap: 6px; }

/* Sidebar */
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 16px; }
.logo { width: 28px; height: 28px; flex: none; }
.wordmark { height: 16px; width: 69px; color: var(--ink); flex: none; }
.sb-head { padding: 16px 18px 14px; }
.sb-back {
  display: inline-flex; align-items: center; gap: 2px; margin-left: -4px; margin-bottom: 10px;
  color: var(--ink-3); font-size: 12px; text-decoration: none;
}
.sb-back:hover { color: var(--ink); }
.sb-back .i { width: 14px; height: 14px; }
.sb-title { font-size: 18px; line-height: 1.25; }
.sb-meta { margin-top: 3px; font-size: 12px; color: var(--ink-3); }
.sb-nav { display: flex; flex-direction: column; gap: 1px; padding: 4px 10px 8px; }
.sb-link {
  display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px;
  border-radius: 7px; color: var(--ink-2); text-decoration: none; font-size: 13px;
}
.sb-link:hover { background: var(--sunken); color: var(--ink); }
.sb-link[aria-current] { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: 0 0 0 1px var(--line), var(--shadow-s); }
.sb-link .count, .sb-link .badge { margin-left: auto; }
.sb-link .count { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.sb-label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 6px; font: 600 11px/1.2 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
}
.sb-label .icon-btn { width: 24px; height: 24px; margin-right: -6px; }
.sb-foot { margin-top: auto; padding: 14px 16px 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.goal-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.goal-row b { color: var(--ink); font-weight: 600; }
.sb-foot-row { display: flex; align-items: center; gap: 2px; }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); margin-right: auto; }
.sync .i { width: 14px; height: 14px; }

/* Binder tree */
.tree { display: flex; flex-direction: column; gap: 1px; padding: 0 10px 12px; }
.tree a {
  display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 10px;
  border-radius: 6px; color: var(--ink-2); text-decoration: none; font-size: 13px;
}
.tree a:hover { background: var(--sunken); }
.tree .ch { color: var(--ink); }
.tree .ch .i-s { color: var(--ink-3); margin-left: -2px; }
.tree .n { color: var(--ink-3); width: 16px; font-variant-numeric: tabular-nums; font-size: 12px; }
.tree .sc { padding-left: 46px; }
.tree [aria-current] { background: var(--accent-soft); color: var(--ink); }
.tree .wc { margin-left: auto; font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* Controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font-weight: 500; font-size: 13px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn-primary { background: var(--ink); color: var(--bg); border-color: transparent; }
.btn-primary:hover { border-color: transparent; opacity: .9; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--sunken); border-color: transparent; color: var(--ink); }
.icon-btn { width: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; height: 32px; border-radius: 8px; cursor: pointer; flex: none; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.divider-v { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }

.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--sunken); border-radius: 9px; }
.seg button {
  height: 28px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent;
  color: var(--ink-2); font-size: 12.5px; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.seg button:hover { color: var(--ink); }
.seg [aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line), var(--shadow-s); }
.seg .n { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2);
  background: transparent; color: var(--ink-2); font-size: 12px; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.input, .textarea, .select {
  width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--surface); color: var(--ink); font-size: 13px;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--ink-3); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { height: auto; padding: 8px 10px; line-height: 1.5; resize: vertical; }
.select { appearance: none; padding-right: 30px; cursor: pointer; }
.select-wrap { position: relative; display: inline-flex; }
.select-wrap .i { position: absolute; right: 9px; top: 50%; margin-top: -6px; width: 12px; height: 12px; pointer-events: none; color: var(--ink-3); }
.search { position: relative; }
.search .i { position: absolute; left: 10px; top: 50%; margin-top: -7px; width: 14px; height: 14px; color: var(--ink-3); }
.search .input { padding-left: 32px; background: var(--sunken); border-color: transparent; }
.search .input:focus { background: var(--surface); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12px; font-weight: 500; color: var(--ink-2); }

.switch {
  appearance: none; width: 34px; height: 20px; margin: 0; flex: none; border-radius: 10px;
  background: var(--line-2); position: relative; cursor: pointer; transition: background .15s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--knob); box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: transform .15s;
}
.switch:checked { background: var(--ink); }
.switch:checked::after { transform: translateX(14px); background: var(--surface); }
input[type="checkbox"]:not(.switch), input[type="radio"] { accent-color: var(--ink); width: 15px; height: 15px; margin: 0; }

.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  border-radius: 999px; background: var(--sunken); color: var(--ink-2); font-size: 12px; white-space: nowrap;
}
.tag-accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger-soft); color: var(--danger); font-size: 11px; font-weight: 600;
}
.kbd {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; font-size: 11px; color: var(--ink-2);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); flex: none; display: inline-block; }
.dot.draft { background: var(--accent); }
.dot.done { background: var(--ok); }
.dot.pl-1 { background: var(--pl-1); } .dot.pl-2 { background: var(--pl-2); }
.dot.pl-3 { background: var(--pl-3); } .dot.pl-4 { background: var(--pl-4); }
.meter { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 2px; background: var(--accent); }

.mono {
  width: 26px; height: 26px; flex: none; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--sunken); color: var(--ink-2); font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
}
.mono.place { border-radius: 7px; }
.mono.thing { border-radius: 4px; transform: rotate(45deg) scale(.86); }
.mono.thing > span { transform: rotate(-45deg); }
.mono.lg { width: 72px; height: 72px; font: 500 26px var(--font-display); background: var(--accent-soft); color: var(--accent-ink); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }

/* Lists (cards, notes, snapshots) */
.listcol { width: 300px; flex: none; display: flex; flex-direction: column; border-right: 1px solid var(--line); overflow: auto; }
.listcol-head { display: flex; flex-direction: column; gap: 10px; padding: 14px 14px 12px; border-bottom: 1px solid var(--line); }
.list { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px 16px; }
.list-label { padding: 14px 10px 6px; }
.item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  text-decoration: none; color: var(--ink);
}
.item:hover { background: var(--sunken); }
.item[aria-current] { background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow-s); }
.item .t { display: block; font-size: 13px; font-weight: 500; }
.item .s { display: block; font-size: 12px; color: var(--ink-3); }
.item .end { margin-left: auto; color: var(--ink-3); }

/* Detail pages */
.detail { flex: 1; min-width: 0; overflow: auto; }
.detail-inner { max-width: 780px; margin: 0 auto; padding: 44px 48px 96px; }
.section { margin-top: 44px; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 10px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.section-h h2 { font-family: var(--font-display); font-weight: 500; font-size: 19px; }
.kv { display: grid; grid-template-columns: 128px 1fr; gap: 10px 16px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
.kv-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.prose-ui { font-size: 14px; line-height: 1.65; color: var(--ink-2); max-width: 62ch; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--ink-3); padding: 8px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr.is-now td { background: var(--accent-soft); }
.table tr.is-now td:first-child { border-radius: 8px 0 0 8px; }
.table tr.is-now td:last-child { border-radius: 0 8px 8px 0; }
.table tr.is-past td { color: var(--ink-3); }

/* Inspector */
.insp-section { padding: 20px 22px; border-bottom: 1px solid var(--line); }
.insp-section:last-child { border-bottom: 0; }
.insp-section > .eyebrow { margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.insp-section .kv { grid-template-columns: 96px 1fr; font-size: 13px; gap: 9px 12px; }
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 13px; }
.row .end { margin-left: auto; font-size: 12px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 4px; }
.row .end .i { width: 14px; height: 14px; }
.proposal { margin-top: 4px; padding: 12px; border-radius: 10px; border: 1px dashed var(--line-2); }
.proposal p { font-size: 12.5px; color: var(--ink-2); margin: 6px 0 10px; }

/* Manuscript */
.page { max-width: 700px; margin: 0 auto; padding: 72px 56px 160px; }
.chapter-head { margin-bottom: 44px; }
.chapter-head .eyebrow { margin-bottom: 12px; }
.chapter-head h1 { font-size: 40px; line-height: 1.1; }
.scene-title { margin: 0 0 22px; font: 500 12px var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: 10px; }
.scene-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.prose p { font: 400 19px/1.75 var(--font-text); color: var(--ink); margin: 0; hanging-punctuation: first; }
.prose p + p { text-indent: 1.5em; }
.prose p.no-indent { text-indent: 0; }
.scene-break { text-align: center; color: var(--ink-3); letter-spacing: .6em; margin: 28px 0; font-size: 14px; }
.m { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 75%, transparent); text-decoration-thickness: 1.5px; text-underline-offset: 5px; }
.m:hover { background: var(--accent-soft); text-decoration-color: var(--accent); }
.m-proposed { text-decoration-style: dashed; text-decoration-color: var(--ink-3); }

/* Focus mode */
.focus { min-height: 100vh; display: flex; flex-direction: column; }
.focus-top, .focus-bottom { display: flex; justify-content: space-between; align-items: center; padding: 18px 28px; font-size: 12px; color: var(--ink-3); }
.focus-top a { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.focus-top a:hover { color: var(--ink); }
.focus-page { flex: 1; width: 100%; max-width: 680px; margin: 0 auto; padding: 22vh 32px 30vh; }
.focus-page .prose p { transition: opacity .3s; }
.focus-page .prose p.dim { opacity: .28; }
.caret { display: inline-block; width: 2px; height: 1.15em; margin-left: 1px; vertical-align: -0.18em; background: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } }

/* Library */
.lib { max-width: 1180px; margin: 0 auto; padding: 44px 48px 96px; }
.lib-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 8px; }
.today { width: 280px; padding: 14px 16px; }
.today .goal-row { margin-bottom: 8px; }
.lib-group { margin-top: 48px; }
.lib-group > header { display: flex; align-items: baseline; gap: 10px; padding-bottom: 12px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.lib-group > header h2 { font-family: var(--font-display); font-weight: 500; font-size: 22px; }
.genres { display: flex; flex-wrap: wrap; gap: 32px 56px; }
.genre .eyebrow { margin-bottom: 14px; }
.works { display: flex; flex-wrap: wrap; gap: 32px 28px; }
.works > * { width: 168px; }
.work { text-decoration: none; display: flex; flex-direction: column; gap: 4px; }
.work:hover .cover { transform: translateY(-2px); box-shadow: var(--shadow); }
.work-title { margin-top: 10px; font-weight: 500; font-size: 13.5px; }
.work-meta { font-size: 12px; color: var(--ink-3); }
.cover {
  --c0: #22282F; --c1: #3A424B; --c2: #4F5862; --c3: #6A737D; --t: #F1ECE3;
  position: relative; aspect-ratio: 2 / 3; border-radius: 4px 8px 8px 4px; overflow: hidden;
  padding: 16px 16px; color: var(--t); display: flex; flex-direction: column; gap: 6px;
  background: linear-gradient(to bottom, var(--c0) 0 58%, var(--c1) 58% 72%, var(--c2) 72% 86%, var(--c3) 86%);
  box-shadow: var(--shadow-s), inset 3px 0 0 rgb(0 0 0 / .12);
  transition: transform .2s, box-shadow .2s;
}
.cover-kind { font: 600 9px var(--font-ui); letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.cover-title { font: 500 19px/1.12 var(--font-display); letter-spacing: -0.01em; }
.cover svg { position: absolute; left: 0; bottom: 0; width: 100%; height: 42%; }
.cover svg path { fill: none; stroke: #E2B04A; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.cover.sand { --c0: #E9E3D7; --c1: #D6CDBD; --c2: #BFB39E; --c3: #A39780; --t: #2A2722; }
.cover.sage { --c0: #2B3833; --c1: #3D4E47; --c2: #53665D; --c3: #6C8075; }
.cover.umber { --c0: #3A2F2B; --c1: #52423C; --c2: #6B5750; --c3: #877067; }
.work-new {
  aspect-ratio: 2 / 3; border-radius: 8px; border: 1.5px dashed var(--line-2); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; color: var(--ink-3); text-decoration: none; font-size: 13px;
}
.work-new:hover { color: var(--ink); border-color: var(--ink-3); }

/* Corkboard */
.board { padding: 32px 32px 80px; }
.board-ch { margin-bottom: 40px; }
.board-ch > header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.board-ch > header h2 { font: 500 19px var(--font-display); }
.cork { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.icard {
  display: flex; flex-direction: column; gap: 8px; min-height: 184px; padding: 16px 16px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-s);
  text-decoration: none;
}
.icard:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.icard .no { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.icard h3 { font: 500 16px/1.3 var(--font-display); }
.icard p { font-size: 13px; line-height: 1.5; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.icard footer { margin-top: auto; padding-top: 10px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); }
.icard footer .mono { width: 20px; height: 20px; font-size: 9px; }
.icard-add { border-style: dashed; box-shadow: none; background: transparent; align-items: center; justify-content: center; color: var(--ink-3); font-size: 13px; }

/* Plot grid */
.pg-wrap { overflow: auto; flex: 1; }
.pg { display: grid; grid-template-columns: 200px repeat(8, minmax(172px, 1fr)); min-width: max-content; }
.pg > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px; min-height: 104px; display: flex; flex-direction: column; gap: 8px; }
.pg .pg-head { min-height: 0; padding: 12px; position: sticky; top: 0; z-index: 1; background: var(--bg); gap: 2px; }
.pg-head b { font-size: 11.5px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pg-head span { font-size: 13px; font-weight: 500; }
.pg .pg-row { position: sticky; left: 0; z-index: 1; background: var(--bg); flex-direction: row; align-items: flex-start; gap: 10px; padding: 14px 16px; font-weight: 500; }
.pg .pg-row .dot { margin-top: 6px; }
.pg .pg-row small { display: block; font-weight: 400; font-size: 12px; color: var(--ink-3); }
.pg .pg-corner { z-index: 2; left: 0; }
.pg-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; line-height: 1.45; box-shadow: var(--shadow-s); }
.pg-card b { display: block; font-weight: 500; margin-bottom: 2px; }
.pg-card span { color: var(--ink-3); }

/* Timeline */
.tl-wrap { overflow: auto; flex: 1; }
.tl { min-width: 1240px; }
.tl-axis, .tl-lane { display: grid; grid-template-columns: 184px 1fr; }
.tl-axis { position: sticky; top: 0; z-index: 2; background: var(--bg); border-bottom: 1px solid var(--line); }
.tl-ticks { display: grid; grid-template-columns: repeat(7, 1fr); }
.tl-ticks span { padding: 12px 10px 10px; font-size: 12px; color: var(--ink-3); border-left: 1px solid var(--line); }
.tl-ticks span b { display: block; color: var(--ink); font-weight: 500; font-size: 12.5px; }
.tl-ticks .gap { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--sunken) 6px 7px); }
.tl-lane { border-bottom: 1px solid var(--line); }
.tl-label { padding: 0 16px 0 24px; display: flex; align-items: center; gap: 10px; font-weight: 500; min-height: 84px; }
.tl-label small { display: block; font-weight: 400; font-size: 12px; color: var(--ink-3); }
.tl-track { position: relative; min-height: 84px; background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); background-size: calc(100% / 7) 100%; }
.ev {
  position: absolute; top: 20px; height: 44px; padding: 0 12px; border-radius: 9px;
  border: 1px solid var(--line-2); background: var(--surface); box-shadow: var(--shadow-s);
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 1px;
  text-align: left; cursor: pointer; white-space: nowrap; width: max-content; font-size: 12.5px; font-weight: 500;
}
.ev small { font-size: 11px; font-weight: 400; color: var(--ink-3); display: flex; gap: 6px; align-items: center; }
.ev[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ev.flashback { border-style: dashed; }
.ev .rd { font-variant-numeric: tabular-nums; }

/* Continuity */
.issues { max-width: 820px; margin: 0 auto; padding: 40px 48px 96px; display: flex; flex-direction: column; gap: 16px; }
.issue { display: grid; grid-template-columns: 32px 1fr; gap: 0 16px; padding: 22px 24px; }
.issue-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--danger-soft); color: var(--danger); }
.issue .kind { margin-bottom: 6px; }
.issue h3 { font-size: 15px; font-weight: 600; line-height: 1.4; }
.issue .why { margin-top: 4px; font-size: 13px; color: var(--ink-2); }
.evidence { margin-top: 14px; display: grid; gap: 8px; }
.evidence blockquote { margin: 0; padding: 12px 16px; border-radius: 10px; background: var(--sunken); font: italic 15px/1.6 var(--font-text); color: var(--ink-2); }
.evidence cite { display: block; margin-top: 6px; font: normal 12px var(--font-ui); color: var(--ink-3); }
.issue-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* Diff (snapshots, conflicts) */
.diff { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.diff-col { padding: 28px 40px 48px; min-width: 0; }
.diff-col + .diff-col { border-left: 1px solid var(--line); }
.diff-col > header { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; font-size: 12.5px; color: var(--ink-3); }
.diff-col > header b { color: var(--ink); font-weight: 500; }
.diff-col p { font: 17px/1.72 var(--font-text); margin: 0 0 1em; }
del { background: var(--danger-soft); color: var(--danger); text-decoration: line-through; text-decoration-thickness: 1px; border-radius: 3px; padding: 1px 2px; }
ins { background: var(--ok-soft); color: var(--ok); text-decoration: none; border-radius: 3px; padding: 1px 2px; }

/* Export */
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
.choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice input { margin-top: 2px; }
.choice b { display: block; font-weight: 500; }
.choice span { font-size: 12px; color: var(--ink-3); }
.checks { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.checks label { display: flex; align-items: center; gap: 10px; }
.checks .faint { margin-left: auto; font-size: 12px; }
.preview { flex: 1; overflow: auto; background: var(--sunken); display: flex; justify-content: center; align-items: flex-start; gap: 32px; padding: 56px 40px; }
.paper {
  width: 300px; flex: none; aspect-ratio: 1 / 1.414; background: #FFFFFF; color: #1E2329;
  box-shadow: 0 1px 3px rgb(0 0 0 / .08), 0 16px 40px rgb(0 0 0 / .1);
  padding: 40px 34px; font: 8.6px/1.65 var(--font-text); display: flex; flex-direction: column;
}
.paper p + p { text-indent: 1.5em; }

/* Settings */
.settings { max-width: 760px; margin: 0 auto; padding: 44px 48px 120px; }
.set-section { padding: 36px 0 12px; scroll-margin-top: 24px; }
.set-section + .set-section { border-top: 1px solid var(--line); }
.set-section > h2 { font: 500 20px var(--font-display); margin-bottom: 8px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 16px 0; }
.set-row + .set-row { border-top: 1px solid var(--line); }
.set-row .lbl b { display: block; font-weight: 500; font-size: 13.5px; }
.set-row .lbl span { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.set-row .ctl { flex: none; display: flex; align-items: center; gap: 8px; }
.days { display: flex; gap: 4px; }
.days button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; font-size: 12px; cursor: pointer; color: var(--ink-2); }
.days [aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.license { padding: 20px; display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }

/* Modal (sync conflict) */
.scrim { position: fixed; inset: 0; background: rgb(20 23 27 / .38); display: grid; place-items: center; padding: 32px; }
.sheet { width: min(1040px, 100%); max-height: calc(100vh - 64px); overflow: auto; background: var(--bg); border-radius: 16px; box-shadow: 0 30px 80px rgb(0 0 0 / .3); border: 1px solid var(--line); }
.sheet-head { padding: 28px 40px 20px; border-bottom: 1px solid var(--line); }
.sheet-foot { display: flex; align-items: center; gap: 8px; padding: 16px 24px 16px 40px; border-top: 1px solid var(--line); }

/* Gallery (index) */
.gallery { max-width: 1080px; margin: 0 auto; padding: 56px 48px 96px; }
.gallery-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.gallery-group { margin-top: 48px; }
.gallery-group > h2 { margin-bottom: 14px; }
.screens { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.screen { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; text-decoration: none; }
.screen:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.screen-ic { width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--sunken); display: grid; place-items: center; color: var(--ink-2); }
.screen b { display: block; font-weight: 600; }
.screen span { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.swatch { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); font-size: 12px; }
.swatch i { display: block; height: 56px; }
.swatch div { padding: 8px 10px; }
.swatch code { display: block; color: var(--ink-3); font-size: 11px; }
.specimen { display: grid; grid-template-columns: 140px 1fr; gap: 18px 24px; align-items: baseline; }

/* Desktop app mockups; below tablet width the shell simply stacks. */
@media (max-width: 860px) {
  .app { flex-direction: column; height: auto; min-height: 100vh; }
  .sidebar { width: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .body { flex-direction: column; }
  .listcol, .inspector { width: auto; border: 0; border-bottom: 1px solid var(--line); }
  .diff { grid-template-columns: 1fr; }
  .diff-col + .diff-col { border-left: 0; border-top: 1px solid var(--line); }
  .page, .detail-inner, .lib, .settings, .issues, .gallery { padding-left: 16px; padding-right: 16px; }
  .lib-head { flex-direction: column; align-items: stretch; }
  .today { width: auto; }
  .toolbar { flex-wrap: wrap; height: auto; min-height: 52px; padding: 8px 16px; }
}
