/* ══════════════════════════════════════════════════════════════════
   Focused Reading Lab — "annotation kit" design system
   Paper surfaces, highlighter marks, margin tabs, sticky notes.
   ══════════════════════════════════════════════════════════════════ */

:root {
  /* paper + ink */
  --paper:      #faf6ec;
  --paper-2:    #fffdf7;
  --paper-3:    #f2ece0;
  --ink:        #1c1a16;
  --ink-soft:   #4a4740;
  --muted:      #726d61;
  --rule:       #e2d9c6;

  /* pen colors */
  --pen:        #23477e;   /* ballpoint blue — links, actives */
  --pen-soft:   #e5ecf8;
  --red-pen:    #b4342c;   /* corrections, alerts */

  /* highlighter tray */
  --hl-yellow:  #ffd54a;
  --hl-green:   #8fdca0;
  --hl-pink:    #ff9db4;
  --hl-blue:    #8cc9f0;
  --hl-orange:  #ffb46b;
  --hl-purple:  #c3a6f2;
  --hl-teal:    #79d6c9;

  --shadow-sm: 0 2px 0 rgba(28, 26, 22, .06), 0 6px 18px rgba(28, 26, 22, .06);
  --shadow-md: 0 3px 0 rgba(28, 26, 22, .07), 0 18px 40px rgba(28, 26, 22, .10);
  --shadow-pop: 0 20px 60px rgba(28, 26, 22, .22);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;

  --reader-size: 1.24rem;
  --reader-width: 44rem;

  --sans: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}

body.dark {
  --paper:      #16161a;
  --paper-2:    #1e1e23;
  --paper-3:    #26262c;
  --ink:        #f4f1e8;
  --ink-soft:   #d6d2c6;
  --muted:      #a4a094;
  --rule:       #34343c;
  --pen:        #9db9ea;
  --pen-soft:   #23293a;
  --red-pen:    #f08b82;
  --shadow-sm: 0 2px 0 rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.3);
  --shadow-md: 0 3px 0 rgba(0,0,0,.35), 0 18px 40px rgba(0,0,0,.4);
  --shadow-pop: 0 20px 60px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% 18%, color-mix(in srgb, var(--hl-yellow) 9%, transparent) 0, transparent 42%),
    radial-gradient(circle at 88% 8%, color-mix(in srgb, var(--hl-blue) 9%, transparent) 0, transparent 38%);
  background-attachment: fixed;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { max-width: 100%; }
a { color: var(--pen); }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; line-height: 1.12; }
p { margin: 0; }
q { quotes: "“" "”"; }
.hidden { display: none !important; }
[hidden] { display: none !important; }   /* .drawer/.scrim set display, which would beat the UA rule */
.sprite { position: absolute; width: 0; height: 0; }
svg use { stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.masthead svg, .btn svg, .icon-button svg, .rail-btn svg, .tool-icon, .head-icon, .drawer-empty svg { width: 22px; height: 22px; flex: none; }
.btn-icon { width: 18px; height: 18px; vertical-align: -3px; }
.flip { transform: rotate(180deg); }
:focus-visible { outline: 3px solid var(--pen); outline-offset: 2px; }

/* ─────────────── Masthead + notebook tabs ─────────────── */

.masthead {
  position: sticky; top: 0; z-index: 40;
  display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 24px;
  padding: 16px clamp(18px, 4vw, 44px) 0;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 2px solid var(--ink);
}
.brand { display: flex; align-items: center; gap: 11px; padding-bottom: 14px; color: var(--ink); text-decoration: none; }
.brand span { display: flex; flex-direction: column; line-height: 1.05; }
.brand strong { font-size: 1.02rem; letter-spacing: -.02em; }
.brand small { margin-top: 3px; font-size: .68rem; font-weight: 800; letter-spacing: .22em; color: var(--pen); }

.tabs { display: flex; align-items: end; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; display: flex; align-items: center; gap: 9px; white-space: nowrap;
  padding: 11px 18px; margin-bottom: -2px;
  border: 2px solid transparent; border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: transparent; color: var(--muted);
  font-size: .98rem; font-weight: 650;
}
.tab:hover { color: var(--ink); background: color-mix(in srgb, var(--paper-3) 70%, transparent); }
.tab.active {
  color: var(--ink); background: var(--paper-2);
  border-color: var(--ink); border-bottom: 2px solid var(--paper-2);
  font-weight: 750;
}
.tab-count {
  min-width: 24px; padding: 2px 7px; border-radius: 999px;
  background: var(--hl-yellow); color: #1c1a16; font-size: .74rem; font-weight: 800; text-align: center;
}
.icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; margin-bottom: 10px;
  border: 2px solid var(--rule); border-radius: 12px;
  background: var(--paper-2); color: var(--ink);
}
.icon-button:hover { border-color: var(--ink); }

/* ─────────────── Sheet + views ─────────────── */

.sheet { max-width: 1440px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 44px); }
.view { display: none; padding: 40px 0 96px; }
.view.active { display: block; animation: rise .28s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.eyebrow {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  color: var(--pen); font-size: .84rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
}
.eyebrow-rule { width: 34px; height: 3px; border-radius: 2px; background: var(--hl-yellow); }
h1 { font-size: clamp(2.4rem, 4.6vw, 3.9rem); }
/* Highlighter stroke that survives line wraps (an absolute ::after would only
   cover the first line fragment). */
h1 em {
  font-style: normal; padding: 0 .06em;
  background: linear-gradient(to top, color-mix(in srgb, var(--hl-yellow) 82%, transparent) 0 .34em, transparent .34em);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
.lede { margin-top: 18px; max-width: 62ch; font-size: 1.16rem; color: var(--ink-soft); line-height: 1.6; }
.fine-print { color: var(--muted); font-size: .92rem; }
.num {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin-right: 10px;
  border: 2px solid var(--ink); border-radius: 50%; background: var(--hl-yellow); color: #1c1a16;
  font-size: .95rem; font-weight: 800; flex: none;
}
.count-pill {
  display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 26px; padding: 0 9px;
  border-radius: 999px; background: var(--pen-soft); color: var(--pen); font-size: .85rem; font-weight: 800;
}

/* ─────────────── Discover ─────────────── */

.discover-head { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(240px, .75fr); align-items: center; gap: 36px; }
.discover-art { width: min(100%, 430px); justify-self: end; }

.search-slab {
  margin-top: 34px; padding: 20px;
  border: 2px solid var(--ink); border-radius: var(--r-lg);
  background: var(--paper-2); box-shadow: var(--shadow-md);
}
.search-field {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  padding: 8px 8px 8px 16px; border: 2px solid var(--rule); border-radius: var(--r-md); background: var(--paper);
}
.search-field:focus-within { border-color: var(--ink); }
.field-icon { width: 24px; height: 24px; color: var(--muted); }
.search-field input { min-width: 0; padding: 12px 0; border: 0; background: transparent; font-size: 1.1rem; outline: 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip-row button {
  padding: 9px 14px; border: 2px solid var(--rule); border-radius: 999px;
  background: var(--paper); color: var(--ink-soft); font-size: .95rem; font-weight: 600;
}
.chip-row button:hover { border-color: var(--ink); background: var(--paper-3); }
.search-slab .fine-print { margin-top: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 20px; border: 2px solid var(--ink); border-radius: var(--r-md);
  font-size: 1rem; font-weight: 700; transition: transform .14s ease, background .14s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-ink { background: var(--ink); color: var(--paper-2); }
.btn-quiet { background: var(--paper-2); color: var(--ink); border-color: var(--rule); }
.btn-quiet:hover { border-color: var(--ink); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn.wide { width: 100%; margin-top: 18px; }

.filter-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 20px; margin-top: 34px; }
.section-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.section-chip {
  padding: 10px 15px; border: 2px solid transparent; border-radius: 999px;
  background: var(--paper-3); color: var(--ink-soft); font-size: .96rem; font-weight: 650;
}
.section-chip:hover { border-color: var(--rule); }
.section-chip.active { background: var(--ink); color: var(--paper-2); }
.selects { display: flex; gap: 14px; }
.selects label { display: grid; gap: 6px; color: var(--muted); font-size: .82rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.selects select {
  padding: 10px 12px; border: 2px solid var(--rule); border-radius: var(--r-sm);
  background: var(--paper-2); font-size: .98rem; font-weight: 600; letter-spacing: 0; text-transform: none;
}

.results-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 14px; margin: 40px 0 18px; }
.results-head h2 { display: flex; align-items: center; gap: 10px; }
.results-head p { color: var(--muted); font-size: .96rem; }

/* Index-card source cards, with a paper tab on top */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 20px; }
.card {
  position: relative; display: flex; flex-direction: column; min-height: 290px;
  padding: 26px 22px 20px; border: 2px solid var(--rule); border-radius: var(--r-md);
  background: var(--paper-2); box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--ink); box-shadow: var(--shadow-md); }
.card::before {
  content: ''; position: absolute; top: -2px; left: 22px; width: 74px; height: 8px;
  border-radius: 0 0 6px 6px; background: var(--tab-color, var(--hl-yellow));
}
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-section { font-size: .82rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.card-date { color: var(--muted); font-size: .88rem; }
.card h3 { font-size: 1.32rem; line-height: 1.22; }
.card-byline { margin-top: 8px; color: var(--muted); font-size: .92rem; }
.card-deck { margin-top: 14px; color: var(--ink-soft); font-size: 1rem; line-height: 1.5; }
.card-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 16px; color: var(--muted); font-size: .88rem; }
.card-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.card-actions .btn { padding: 10px 16px; font-size: .96rem; }
.save-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border: 2px solid var(--rule); border-radius: var(--r-sm); background: var(--paper); color: var(--muted);
}
.save-btn[aria-pressed="true"] { background: var(--hl-yellow); border-color: var(--ink); color: #1c1a16; }
.card-original { margin-left: auto; color: var(--muted); font-size: .9rem; text-decoration: none; }
.card-original:hover { color: var(--pen); text-decoration: underline; }
.card.skeleton { border-style: dashed; background: linear-gradient(100deg, var(--paper-2) 30%, var(--paper-3) 50%, var(--paper-2) 70%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 130% 0 } to { background-position: -30% 0 } }
.empty-message {
  grid-column: 1 / -1; padding: 40px; border: 2px dashed var(--rule); border-radius: var(--r-md);
  color: var(--muted); text-align: center; font-size: 1.02rem; line-height: 1.6;
}
.empty-message.error { border-color: var(--red-pen); color: var(--red-pen); }
.empty-message .btn { margin-top: 16px; }
.grid-footer { display: flex; justify-content: center; margin-top: 24px; }
.shelf { margin-top: 56px; padding-top: 8px; border-top: 2px dashed var(--rule); }
.source-note { margin-top: 44px; padding-top: 20px; border-top: 2px solid var(--rule); color: var(--muted); font-size: .95rem; line-height: 1.6; }

/* ─────────────── Reader ─────────────── */

.reader-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.reader-tools { display: flex; flex-wrap: wrap; gap: 10px; }
.tool-group {
  display: flex; align-items: center; gap: 4px; padding: 4px;
  border: 2px solid var(--rule); border-radius: var(--r-md); background: var(--paper-2);
}
.tool-group .icon-button { width: 36px; height: 36px; margin: 0; border: 0; background: transparent; }
.tool-group .icon-button:hover { background: var(--paper-3); }
.tool-icon { margin: 0 6px 0 8px; color: var(--muted); }
.tool-label { min-width: 34px; text-align: center; font-size: .95rem; font-weight: 700; color: var(--muted); }
.width-step { min-width: 38px; padding: 8px 6px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font-size: .92rem; font-weight: 750; }
.width-step:hover { background: var(--paper-3); color: var(--ink); }
.width-step.active { background: var(--ink); color: var(--paper-2); }
#serifToggle { padding: 10px 16px; }

.page {
  position: relative; max-width: calc(var(--reader-width) + 22rem); margin: 0 auto;
  padding: clamp(28px, 4vw, 56px) clamp(20px, 4vw, 60px) 40px;
  border: 2px solid var(--ink); border-radius: var(--r-lg);
  background: var(--paper-2); box-shadow: var(--shadow-md);
}
.page::before {
  /* margin rule, like a legal pad */
  content: ''; position: absolute; top: 0; bottom: 0; left: clamp(56px, 7%, 120px); width: 2px;
  background: color-mix(in srgb, var(--red-pen) 20%, transparent);
}
.page-head, .prose, .rights { max-width: var(--reader-width); margin-left: auto; margin-right: auto; }
.kicker { color: var(--pen); font-size: .92rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.page-head h1 { margin-top: 14px; font-family: var(--serif); font-size: clamp(2.1rem, 3.6vw, 3.05rem); line-height: 1.1; letter-spacing: -.015em; }
.standfirst { margin-top: 16px; color: var(--ink-soft); font-size: 1.18rem; line-height: 1.55; }
.byline-row { margin-top: 16px; min-height: 1px; }
.byline-row a { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; }
.byline-row a:hover { text-decoration: underline; }
.pace { display: flex; align-items: center; gap: 14px; margin-top: 24px; color: var(--muted); font-size: .95rem; }
.pace-track { flex: 1; max-width: 240px; height: 9px; border-radius: 999px; background: var(--paper-3); overflow: hidden; }
.pace-track i { display: block; width: 0; height: 100%; background: var(--hl-green); transition: width .25s ease; }
.how-to {
  display: flex; align-items: flex-start; gap: 12px; margin-top: 26px; padding: 16px 18px;
  border: 2px dashed var(--rule); border-radius: var(--r-md); background: var(--paper);
  color: var(--ink-soft); font-size: 1rem; line-height: 1.5;
}
.how-to .btn-icon { flex: none; margin-top: 3px; color: var(--pen); }

.prose {
  margin-top: 36px;
  font-family: var(--serif); font-size: var(--reader-size); line-height: 1.78; color: var(--ink);
}
body.sans-reader .prose { font-family: var(--sans); line-height: 1.72; }
.prose p { margin: 0 0 1.15em; }
.prose .reading-subhead { margin: 1.8em 0 .6em; font-family: var(--sans); font-size: .92em; font-weight: 800; }
.prose .block-quote { padding: 6px 0 6px 22px; border-left: 4px solid var(--hl-yellow); font-style: italic; color: var(--ink-soft); }
.prose .block-item { position: relative; padding-left: 24px; }
.prose .block-item::before { content: ''; position: absolute; left: 4px; top: .8em; width: 8px; height: 2px; background: var(--muted); }
.prose::selection, .prose *::selection { background: color-mix(in srgb, var(--hl-yellow) 60%, transparent); }

/* highlighter strokes */
.fr-mark {
  padding: 2px 1px; border-radius: 3px; cursor: pointer; color: inherit;
  background: color-mix(in srgb, var(--mark) 52%, transparent);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--mark) 85%, transparent);
}
.fr-mark:hover, .fr-mark:focus-visible { background: color-mix(in srgb, var(--mark) 80%, transparent); }
body.dark .fr-mark { background: color-mix(in srgb, var(--mark) 32%, transparent); }
body.dark .fr-mark:hover { background: color-mix(in srgb, var(--mark) 60%, transparent); color: #16161a; }

/* numbered tabs down the margin */
.margin-rail { position: absolute; inset: 0; pointer-events: none; }
.mark-tab {
  position: absolute; left: 14px; display: flex; align-items: center; gap: 6px;
  padding: 4px 9px 4px 7px; border: 2px solid var(--ink); border-radius: 4px 10px 10px 4px;
  background: var(--tab, var(--hl-yellow)); color: #1c1a16;
  font-size: .8rem; font-weight: 800; pointer-events: auto; cursor: pointer;
  box-shadow: 2px 2px 0 rgba(28,26,22,.12);
  transition: transform .14s ease;
}
.mark-tab:hover { transform: translateX(3px); }
.rights { margin-top: 44px; padding-top: 20px; border-top: 2px solid var(--rule); color: var(--muted); font-size: .92rem; line-height: 1.6; }
.rights a { color: var(--pen); }

/* ─────────────── Highlighter tray (selection popover) ─────────────── */

.tray {
  position: absolute; z-index: 60; width: min(430px, calc(100vw - 24px));
  padding: 16px; border: 2px solid var(--ink); border-radius: var(--r-md);
  background: var(--paper-2); box-shadow: var(--shadow-pop);
  animation: rise .16s ease-out;
}
.tray-quote { max-height: 4.4em; overflow: hidden; margin-bottom: 12px; color: var(--ink-soft); font-family: var(--serif); font-size: .98rem; line-height: 1.45; }
.tray-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 12px; border: 2px solid var(--rule); border-radius: 999px;
  background: var(--paper); color: var(--ink-soft); font-size: .95rem; font-weight: 650;
}
.swatch i { width: 14px; height: 14px; border-radius: 4px; background: var(--chip); border: 1px solid rgba(0,0,0,.15); }
.swatch:hover { border-color: var(--ink); }
.swatch.active { border-color: var(--ink); background: color-mix(in srgb, var(--chip) 34%, var(--paper-2)); color: var(--ink); }
.tray-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.tray-actions .btn { padding: 10px 16px; font-size: .95rem; }

/* ─────────────── Rail + drawers ─────────────── */

.rail { position: fixed; z-index: 45; right: 0; top: 50%; transform: translateY(-50%); display: grid; gap: 10px; }
.rail-btn {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px 14px 14px;
  border: 2px solid var(--ink); border-right: 0; border-radius: 14px 0 0 14px;
  background: var(--paper-2); color: var(--ink); font-size: .96rem; font-weight: 700;
  box-shadow: var(--shadow-md); transition: transform .16s ease;
}
.rail-btn:hover { transform: translateX(-4px); }
.rail-btn b { min-width: 24px; padding: 2px 7px; border-radius: 999px; background: var(--hl-yellow); color: #1c1a16; font-size: .8rem; }

.scrim { position: fixed; inset: 0; z-index: 48; background: rgba(20,18,14,.35); backdrop-filter: blur(2px); }

/* On wide screens the drawer pushes the page aside instead of covering the reading. */
@media (min-width: 1101px) {
  .sheet { transition: padding-right .22s ease; }
  body.drawer-open .sheet { padding-right: calc(440px + clamp(18px, 4vw, 44px)); }
}
body.drawer-open .rail { display: none; }

.drawer {
  position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; width: min(440px, 100vw);
  display: flex; flex-direction: column;
  border-left: 2px solid var(--ink); background: var(--paper-2); box-shadow: var(--shadow-pop);
  animation: slide-in .22s ease-out;
}
@keyframes slide-in { from { transform: translateX(24px); opacity: .4 } to { transform: none; opacity: 1 } }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 20px 20px 16px; border-bottom: 2px solid var(--rule); }
.drawer-head .eyebrow { margin-bottom: 6px; font-size: .78rem; }
.drawer-head .icon-button { margin: 0; }
.drawer-filter { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 20px; border-bottom: 2px dashed var(--rule); }
.filter-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border: 2px solid var(--rule); border-radius: 999px;
  background: var(--paper); font-size: .86rem; font-weight: 700; color: var(--muted);
}
.filter-pill i { width: 10px; height: 10px; border-radius: 3px; background: var(--chip); }
.filter-pill.active { border-color: var(--ink); color: var(--ink); background: color-mix(in srgb, var(--chip, var(--hl-yellow)) 40%, var(--paper-2)); }
.drawer-note { padding: 14px 20px 0; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 28px; display: grid; gap: 16px; align-content: start; }
.drawer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 2px solid var(--rule); color: var(--muted); font-size: .88rem; }
.drawer-foot .btn { padding: 9px 14px; font-size: .92rem; }

/* sticky-note annotation cards */
.note {
  position: relative; padding: 20px 16px 14px; border-radius: 3px;
  background: color-mix(in srgb, var(--chip) 30%, var(--paper-2));
  border: 1px solid color-mix(in srgb, var(--chip) 60%, transparent);
  box-shadow: var(--shadow-sm);
  transform: rotate(var(--tilt, -.35deg));
  transition: transform .16s ease;
}
.note:nth-child(even) { --tilt: .45deg; }
.note:hover { transform: rotate(0deg) translateY(-2px); }
.note::before {
  content: ''; position: absolute; top: -7px; left: 50%; width: 62px; height: 15px; transform: translateX(-50%) rotate(-1.5deg);
  background: color-mix(in srgb, var(--paper-3) 90%, transparent); border: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
}
.note-num { position: absolute; top: 12px; right: 14px; font-size: .82rem; font-weight: 800; color: color-mix(in srgb, var(--ink) 45%, transparent); }
.note q { display: block; padding-right: 26px; font-family: var(--serif); font-size: 1.02rem; line-height: 1.45; }
.note-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--chip) 55%, var(--paper-2)); border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  font-size: .82rem; font-weight: 750;
}
.note-prompt { margin-top: 10px; color: var(--ink-soft); font-size: .88rem; font-style: italic; line-height: 1.4; }
.note textarea {
  width: 100%; margin-top: 10px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  border-radius: var(--r-sm); background: color-mix(in srgb, var(--paper-2) 88%, transparent);
  font-size: .96rem; line-height: 1.45; resize: vertical;
}
.note-actions { display: flex; gap: 8px; margin-top: 10px; }
.note-actions button {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 0; border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--paper-2) 70%, transparent); color: var(--ink-soft); font-size: .85rem; font-weight: 650;
}
.note-actions button:hover { background: var(--paper-2); }
.note-actions .danger:hover { color: var(--red-pen); }
.drawer-empty { padding: 44px 12px; text-align: center; color: var(--muted); line-height: 1.55; }
.drawer-empty svg { width: 44px; height: 44px; margin-bottom: 12px; color: var(--rule); }

/* compact source cards inside the related drawer */
.mini { padding: 14px 16px; border: 2px solid var(--rule); border-radius: var(--r-md); background: var(--paper); }
.mini:hover { border-color: var(--ink); }
.mini-section { color: var(--muted); font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.mini h4 { margin: 8px 0 0; font-size: 1.05rem; line-height: 1.28; }
.mini p { margin-top: 8px; color: var(--ink-soft); font-size: .92rem; line-height: 1.45; }
.mini-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.mini-actions .btn { padding: 8px 13px; font-size: .9rem; }
.mini-actions a { margin-left: auto; color: var(--muted); font-size: .88rem; text-decoration: none; }
.mini-actions a:hover { color: var(--pen); text-decoration: underline; }

/* ─────────────── Investigate / Synthesize / About ─────────────── */

.step-head { margin-bottom: 34px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.two-col.wide-left { grid-template-columns: 1.4fr .6fr; }
.slab {
  padding: 26px; border: 2px solid var(--rule); border-radius: var(--r-lg);
  background: var(--paper-2); box-shadow: var(--shadow-sm);
}
.two-col + .slab, .slab + .slab { margin-top: 20px; }
.slab h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }

.moment-list { display: grid; gap: 10px; }
.moment {
  width: 100%; padding: 15px 16px; border: 2px solid var(--rule); border-radius: var(--r-md);
  background: var(--paper); text-align: left; color: var(--ink);
}
.moment q { display: block; font-family: var(--serif); font-size: 1.02rem; line-height: 1.45; }
.moment small { display: block; margin-top: 8px; color: var(--muted); font-size: .88rem; }
.moment.active { border-color: var(--ink); background: color-mix(in srgb, var(--hl-yellow) 22%, var(--paper-2)); }
.move-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.move { padding: 16px; border: 2px solid var(--rule); border-radius: var(--r-md); background: var(--paper); text-align: left; color: var(--ink); }
.move b { display: block; font-size: 1.02rem; }
.move span { display: block; margin-top: 6px; color: var(--muted); font-size: .92rem; line-height: 1.4; }
.move.active { border-color: var(--ink); background: var(--ink); color: var(--paper-2); }
.move.active span { color: color-mix(in srgb, var(--paper-2) 72%, transparent); }
.query-slab { margin-top: 20px; padding: 18px; border: 2px dashed var(--rule); border-radius: var(--r-md); background: var(--paper); }
.query-slab h3 { display: flex; align-items: center; margin-bottom: 12px; font-size: 1.05rem; }
.query-terms { color: var(--ink-soft); font-size: 1rem; line-height: 1.55; }
.query-terms strong { background: color-mix(in srgb, var(--hl-yellow) 60%, transparent); padding: 0 3px; border-radius: 3px; }
.query-edit { display: block; margin-top: 14px; color: var(--muted); font-size: .82rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.query-edit input {
  width: 100%; margin-top: 8px; padding: 12px 14px; border: 2px solid var(--rule); border-radius: var(--r-sm);
  background: var(--paper-2); font-size: 1rem; font-weight: 500; letter-spacing: 0; text-transform: none;
}
.related-block { margin-top: 36px; }

.tally { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.tally-card { padding: 20px; border: 2px solid var(--rule); border-radius: var(--r-lg); background: var(--paper-2); box-shadow: var(--shadow-sm); }
.tally-card span, .tally-card small { display: block; color: var(--muted); font-size: .92rem; }
.tally-card strong { display: block; margin: 6px 0 4px; font-size: 2.6rem; letter-spacing: -.04em; line-height: 1; }
.bars { display: grid; gap: 14px; }
.bar { display: grid; grid-template-columns: 160px 1fr 32px; gap: 12px; align-items: center; font-size: .98rem; font-weight: 600; }
.bar-label { display: flex; align-items: center; gap: 8px; }
.bar-label i { width: 13px; height: 13px; border-radius: 4px; background: var(--chip); border: 1px solid rgba(0,0,0,.12); flex: none; }
.bar-track { height: 14px; border-radius: 999px; background: var(--paper-3); overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: inherit; }
.bar strong { text-align: right; }
.pattern-note { margin-top: 20px; padding-top: 16px; border-top: 2px dashed var(--rule); color: var(--ink-soft); font-size: 1rem; line-height: 1.6; }
.timeline { display: grid; }
.timeline-item { position: relative; padding: 0 0 20px 26px; border-left: 2px solid var(--rule); color: var(--muted); font-size: .94rem; }
.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-item::before { content: ''; position: absolute; left: -8px; top: 3px; width: 14px; height: 14px; border: 2px solid var(--ink); border-radius: 50%; background: var(--hl-green); }
.timeline-item strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 1rem; }
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.note-grid .note { transform: none; }
.note-grid .note:hover { transform: translateY(-2px); }
.note-src { display: block; margin-top: 10px; color: color-mix(in srgb, var(--ink) 55%, transparent); font-size: .85rem; }

.reflect-slab {
  display: grid; grid-template-columns: .8fr 1.2fr; gap: 30px;
  margin-top: 20px; padding: clamp(24px, 4vw, 40px);
  border: 2px solid var(--ink); border-radius: var(--r-lg); background: var(--ink); color: var(--paper);
}
body.dark .reflect-slab { background: var(--paper-3); color: var(--ink); }
.reflect-slab .eyebrow { color: var(--hl-yellow); }
.reflect-slab > div > p { margin-top: 12px; color: color-mix(in srgb, var(--paper) 70%, transparent); line-height: 1.55; }
body.dark .reflect-slab > div > p { color: var(--muted); }
.reflect-fields { display: grid; gap: 16px; }
.field { display: block; font-size: 1rem; font-weight: 650; }
.field input, .field textarea {
  width: 100%; margin-top: 8px; padding: 12px 14px; border-radius: var(--r-sm); resize: vertical;
  border: 2px solid color-mix(in srgb, var(--paper) 24%, transparent);
  background: color-mix(in srgb, var(--paper) 10%, transparent); color: var(--paper);
  font-size: 1rem; font-weight: 400;
}
body.dark .field input, body.dark .field textarea { border-color: var(--rule); background: var(--paper-2); color: var(--ink); }
.reflect-intro .field { margin-top: 22px; }
.export-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; }
.reflect-slab .btn-ink { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.reflect-slab .btn-quiet { background: transparent; color: var(--paper); border-color: color-mix(in srgb, var(--paper) 35%, transparent); }
body.dark .reflect-slab .btn-ink { background: var(--ink); color: var(--paper-2); border-color: var(--ink); }
body.dark .reflect-slab .btn-quiet { color: var(--ink); border-color: var(--rule); background: var(--paper-2); }
#exportStatus { color: color-mix(in srgb, var(--paper) 70%, transparent); font-size: .92rem; }
body.dark #exportStatus { color: var(--muted); }
.reset-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 26px; }
.reset-row small { color: var(--muted); font-size: .92rem; }

.about-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.about-grid .slab h2 { margin: 0 0 16px; }
.prose-list { display: grid; gap: 14px; margin: 0; padding-left: 20px; color: var(--ink-soft); font-size: 1.02rem; line-height: 1.6; }
.prose-list strong { color: var(--ink); }

.toast {
  position: fixed; z-index: 70; right: 24px; bottom: 24px; max-width: 340px;
  padding: 14px 18px; border: 2px solid var(--ink); border-radius: var(--r-md);
  background: var(--ink); color: var(--paper); font-size: .98rem; line-height: 1.45;
  opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s ease;
}
body.dark .toast { background: var(--paper-3); color: var(--ink); }
.toast.show { opacity: 1; transform: none; }

/* dark-mode inversions for ink-on-paper buttons */
body.dark .btn-ink, body.dark .section-chip.active, body.dark .width-step.active, body.dark .move.active { color: #16161a; }
body.dark .move.active span { color: rgba(22,22,26,.72); }

/* ─────────────── Responsive ─────────────── */

@media (max-width: 1100px) {
  .two-col, .two-col.wide-left, .about-grid { grid-template-columns: 1fr; }
  .tally { grid-template-columns: repeat(2, 1fr); }
  .reflect-slab { grid-template-columns: 1fr; }
  .discover-head { grid-template-columns: 1fr; }
  .discover-art { justify-self: start; width: min(60%, 320px); }
  .page::before { left: 34px; }
  .mark-tab { left: 2px; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .masthead { grid-template-columns: 1fr auto; gap: 10px; padding-top: 12px; }
  .masthead .icon-button { grid-column: 2; grid-row: 1; margin-bottom: 0; align-self: center; }
  .tabs { grid-column: 1 / -1; grid-row: 2; }
  .tab { padding: 10px 13px; font-size: .92rem; }
  .tab span { display: none; }
  .tab.active span { display: inline; }
  .view { padding: 28px 0 80px; }
  .card-grid { grid-template-columns: 1fr; }
  .selects { width: 100%; }
  .selects label { flex: 1; }
  .move-grid { grid-template-columns: 1fr; }
  .tally { grid-template-columns: 1fr; }
  .bar { grid-template-columns: 130px 1fr 28px; font-size: .92rem; }
  .page { padding: 24px 18px 32px; border-radius: var(--r-md); }
  .page::before { display: none; }
  .margin-rail { display: none; }
  .rail { top: auto; bottom: 16px; right: 12px; grid-auto-flow: column; }
  .rail-btn { border-right: 2px solid var(--ink); border-radius: 12px; padding: 12px 14px; }
  .rail-btn span { display: none; }
  .drawer { width: 100vw; border-left: 0; }
  .toast { left: 12px; right: 12px; bottom: 84px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}

/* ─────────────── Voice notes ─────────────── */

.head-actions { margin-top: 22px; }
.slab-lede { margin: -6px 0 20px; color: var(--ink-soft); font-size: 1rem; line-height: 1.55; max-width: 70ch; }
.opt-flag {
  margin-left: 6px; padding: 3px 9px; border-radius: 999px; background: var(--paper-3);
  color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}

.mic-btn { position: relative; }
.mic-btn.recording { background: var(--red-pen); color: #fff; }
.mic-btn.recording svg { color: #fff; }
.note-actions .mic-btn.recording { background: var(--red-pen); color: #fff; }
.rec-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #fff;
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .25 } }

.mic-live {
  margin-top: 8px; padding: 9px 11px; border: 1px dashed var(--red-pen); border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--red-pen) 8%, transparent);
  color: var(--ink-soft); font-size: .88rem; line-height: 1.45; min-height: 2.4em;
}
.mic-live em { color: var(--muted); font-style: italic; }
.audio-chip {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 10px;
  padding: 6px 11px; border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent); border-radius: 999px;
  background: color-mix(in srgb, var(--paper-2) 80%, transparent); font-size: .84rem; font-weight: 650;
}
.audio-chip audio { height: 30px; max-width: 190px; }

.field-row { position: relative; display: block; }
.field-row .mic-btn {
  position: absolute; right: 10px; bottom: 12px;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border: 2px solid color-mix(in srgb, var(--paper) 30%, transparent); border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 14%, transparent); color: var(--paper);
  font-size: .84rem; font-weight: 700;
}
body.dark .field-row .mic-btn { border-color: var(--rule); background: var(--paper-3); color: var(--ink); }
.field-row .mic-btn svg { width: 17px; height: 17px; }
.field-row textarea { padding-bottom: 46px; }

/* screen walkthrough */
.rec-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.rec-status { color: var(--muted); font-size: .95rem; }
.rec-status.live { color: var(--red-pen); font-weight: 700; }
.field.spaced { margin-top: 20px; }
#walkthroughSlab .field textarea {
  border: 2px solid var(--rule); background: var(--paper); color: var(--ink);
}

/* ─────────────── Synthesis matrix ─────────────── */

.matrix-wrap { overflow-x: auto; }
.matrix { width: 100%; border-collapse: separate; border-spacing: 4px; min-width: 620px; }
.matrix th { font-size: .86rem; font-weight: 750; color: var(--ink-soft); text-align: left; vertical-align: bottom; }
.matrix thead th { padding-bottom: 8px; }
.matrix .m-type { text-align: center; }
.matrix .m-type i { display: block; width: 100%; height: 6px; border-radius: 3px; background: var(--chip); margin-bottom: 7px; }
.matrix .m-type span { display: block; font-size: .78rem; line-height: 1.2; }
.matrix .m-src { width: 34%; min-width: 190px; padding-right: 10px; font-weight: 650; }
.matrix .m-src small { display: block; margin-top: 3px; color: var(--muted); font-size: .78rem; font-weight: 500; }
.m-cell {
  width: 100%; min-height: 46px; padding: 10px 4px; border: 2px solid var(--rule); border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--chip) calc(var(--heat) * 90%), var(--paper));
  color: var(--ink); font-size: 1.02rem; font-weight: 800; text-align: center;
}
body.dark .m-cell { background: color-mix(in srgb, var(--chip) calc(var(--heat) * 62%), var(--paper)); }
.m-cell[data-count="0"] { color: color-mix(in srgb, var(--muted) 55%, transparent); font-weight: 500; }
.m-cell:hover { border-color: var(--ink); }
.m-cell.active { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--chip) 45%, transparent); }
.m-total { color: var(--muted); font-weight: 800; text-align: center; font-size: .95rem; }
.matrix tfoot th { padding-top: 8px; color: var(--muted); font-size: .82rem; font-weight: 700; text-align: center; }
.matrix-detail {
  margin-top: 18px; padding: 18px; border: 2px dashed var(--rule); border-radius: var(--r-md); background: var(--paper);
}
.matrix-detail h3 { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; font-size: 1.02rem; }
.matrix-detail h3 i { width: 13px; height: 13px; border-radius: 4px; background: var(--chip); }
.matrix-detail ul { display: grid; gap: 12px; margin: 0; padding-left: 18px; }
.matrix-detail q { font-family: var(--serif); font-size: 1rem; line-height: 1.5; }
.matrix-detail p { margin-top: 6px; color: var(--ink-soft); font-size: .92rem; line-height: 1.5; }
.matrix-empty { padding: 30px; border: 2px dashed var(--rule); border-radius: var(--r-md); color: var(--muted); text-align: center; }

/* ─────────────── Guide ─────────────── */

.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 5px; margin-bottom: 26px; border: 2px solid var(--rule); border-radius: 999px; background: var(--paper-2); }
.seg { padding: 10px 18px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: .98rem; font-weight: 700; }
.seg:hover { color: var(--ink); background: var(--paper-3); }
.seg.active { background: var(--ink); color: var(--paper-2); }
body.dark .seg.active { color: #16161a; }
.guide-panel { display: none; }
.guide-panel.active { display: block; animation: rise .25s ease-out; }
.guide-panel .slab + .two-col, .guide-panel .two-col + .slab, .guide-panel .slab + .slab { margin-top: 20px; }

.workflow-art { display: block; width: 100%; margin-top: 4px; }

.worked { display: grid; gap: 20px; margin: 0; padding: 0; list-style: none; counter-reset: none; }
.worked li { padding-left: 0; }
.worked h3 { font-size: 1.05rem; margin-bottom: 6px; }
.worked p { color: var(--ink-soft); font-size: 1rem; line-height: 1.55; }
.worked q { font-family: var(--serif); }
.worked code, .prose-list code {
  padding: 2px 7px; border-radius: 5px; background: var(--paper-3); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em;
}
.ex-tag { padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--chip) 55%, var(--paper-2)); border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent); font-size: .86em; }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.compare-col { padding: 16px; border: 2px solid var(--rule); border-radius: var(--r-md); background: var(--paper); }
.compare-col.strong { border-color: var(--ink); background: color-mix(in srgb, var(--hl-green) 14%, var(--paper-2)); }
.compare-label { font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.compare-col.strong .compare-label { color: var(--ink); }
.compare-col q { display: block; margin: 10px 0 8px; font-size: .86rem; font-weight: 800; }
.compare-note { font-family: var(--serif); font-size: 1rem; line-height: 1.5; }
.compare-why { margin-top: 10px; color: var(--muted); font-size: .9rem; line-height: 1.45; }
.mt { margin-top: 24px; margin-bottom: 12px; }

.checklist { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.checklist li { position: relative; padding-left: 34px; color: var(--ink-soft); font-size: 1.02rem; line-height: 1.5; }
.checklist li::before {
  content: ''; position: absolute; left: 0; top: 1px; width: 21px; height: 21px;
  border: 2px solid var(--ink); border-radius: 5px; background: var(--paper-2);
}
.checklist li::after {
  content: ''; position: absolute; left: 5px; top: 6px; width: 11px; height: 6px;
  border-left: 2.5px solid var(--pen); border-bottom: 2.5px solid var(--pen); transform: rotate(-45deg);
}

.callout { margin-top: 18px; padding: 18px 20px; border-left: 5px solid var(--hl-yellow); border-radius: 0 var(--r-md) var(--r-md) 0; background: var(--paper); }
.callout p { color: var(--ink-soft); font-size: 1rem; line-height: 1.6; }

.run-card { padding: 16px 18px; border: 2px solid var(--rule); border-radius: var(--r-md); background: var(--paper); }
.run-card + .run-card { margin-top: 12px; }
.run-when { font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--pen); }
.run-card h3 { margin: 6px 0 8px; }
.run-card p { color: var(--ink-soft); font-size: .98rem; line-height: 1.55; }

.prompt-card { padding: 16px 18px; border: 2px dashed var(--rule); border-radius: var(--r-md); background: var(--paper); }
.prompt-card + .prompt-card { margin-top: 12px; }
.prompt-label { font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--pen); margin-bottom: 8px; }
.prompt-card p:not(.prompt-label) { color: var(--ink-soft); font-size: .98rem; line-height: 1.55; }
.copy-prompt { margin-top: 12px; padding: 8px 14px; font-size: .9rem; }

.table-wrap { overflow-x: auto; }
.rubric { width: 100%; min-width: 700px; border-collapse: collapse; font-size: .95rem; }
.rubric th, .rubric td { padding: 12px 14px; border: 1px solid var(--rule); text-align: left; vertical-align: top; line-height: 1.45; }
.rubric thead th { background: var(--paper-3); font-size: .82rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.rubric tbody th { width: 150px; background: color-mix(in srgb, var(--paper-3) 55%, transparent); font-weight: 750; }
.rubric td { color: var(--ink-soft); }
.rubric tbody tr:last-child td, .rubric tbody tr:last-child th { border-bottom-color: var(--ink); }
.rubric td:last-child { background: color-mix(in srgb, var(--hl-green) 10%, transparent); }

@media (max-width: 1100px) {
  .compare { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .segmented { display: grid; grid-template-columns: 1fr; border-radius: var(--r-md); width: 100%; }
  .seg { border-radius: var(--r-sm); }
  .matrix { min-width: 560px; }
}

/* ─────────────── Citations ─────────────── */

.cite-picker {
  display: inline-flex; align-items: center; gap: 10px; margin-right: auto;
  color: color-mix(in srgb, var(--paper) 78%, transparent); font-size: .92rem; font-weight: 700;
}
body.dark .cite-picker { color: var(--muted); }
.cite-picker select {
  padding: 9px 12px; border: 2px solid color-mix(in srgb, var(--paper) 30%, transparent); border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--paper) 12%, transparent); color: var(--paper); font-size: .95rem; font-weight: 650;
}
body.dark .cite-picker select { border-color: var(--rule); background: var(--paper-2); color: var(--ink); }

/* ─────────────── Process log + nudges ─────────────── */

.process-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.process-row {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px;
  border: 2px solid var(--rule); border-radius: var(--r-md); background: var(--paper);
}
.process-row span { color: var(--muted); font-size: .86rem; }
.process-row strong { font-size: 1.14rem; letter-spacing: -.01em; }
.process-note {
  margin-top: 16px; padding: 14px 16px; border-left: 5px solid var(--pen); border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--pen-soft); color: var(--ink-soft); font-size: .98rem; line-height: 1.55;
}
body.dark .process-note { background: var(--paper-3); }

.note-flags { display: inline-flex; gap: 6px; }
.flag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--paper-2) 85%, transparent); border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
.flag svg { width: 13px; height: 13px; }
.flag.paste { color: var(--red-pen); border-color: color-mix(in srgb, var(--red-pen) 35%, transparent); }

.slow-note {
  margin-top: 10px; padding: 13px 15px; border: 2px dashed var(--pen); border-radius: var(--r-md);
  background: var(--pen-soft); color: var(--ink-soft); font-size: .92rem; line-height: 1.5;
}
body.dark .slow-note { background: var(--paper-3); }
.slow-note strong { display: block; margin-bottom: 4px; color: var(--ink); }
.slow-dismiss {
  margin-top: 10px; padding: 6px 14px; border: 2px solid var(--pen); border-radius: 999px;
  background: transparent; color: var(--pen); font-size: .86rem; font-weight: 750;
}
.slow-dismiss:hover { background: var(--pen); color: var(--paper-2); }
.field-row .slow-note { margin-top: 8px; }

.two-col.tight { gap: 26px; margin-top: 4px; }
.two-col.tight h3 { margin-bottom: 12px; }

@media (max-width: 760px) {
  .cite-picker { width: 100%; justify-content: space-between; margin-right: 0; }
}
