/* Layout: a manuscript column with a marginal "批注" column beside it, the
   way a supervisor annotates a draft. Ink blue for the product, red pen only
   for things that must change. */
:root {
  --paper: #f4f6f9;
  --surface: #ffffff;
  --margin: #eef1f6;
  --ink: #17202c;
  --muted: #5a6575;
  --line: #d9dee6;
  --accent: #2c4a8c;
  --accent-soft: #e5ebf6;
  --pen: #b3261e;
  --pen-soft: #fbe9e7;
  --warn: #8a5a00;
  --warn-soft: #fbf0d9;
  --ok: #1d7049;
  --ok-soft: #e2f3ea;
  --focus: #2c4a8c;

  --display: "Newsreader", "Iowan Old Style", Georgia, "Songti SC", serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --r: 6px;
  --step--1: 0.8125rem;
  --step-0: 0.9375rem;
  --step-1: 1.125rem;
  --step-2: 1.5rem;
  --step-4: clamp(2.25rem, 5vw + 1rem, 3.75rem);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #11151c; --surface: #19202a; --margin: #151b24; --ink: #e5e9ef; --muted: #98a3b3; --line: #2b3441;
    --accent: #93aef0; --accent-soft: #1e2a45; --pen: #f28b80; --pen-soft: #3b1f1d; --warn: #e3b35a; --warn-soft: #382c13;
    --ok: #6fcb9c; --ok-soft: #163227; --focus: #93aef0; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #11151c; --surface: #19202a; --margin: #151b24; --ink: #e5e9ef; --muted: #98a3b3; --line: #2b3441;
  --accent: #93aef0; --accent-soft: #1e2a45; --pen: #f28b80; --pen-soft: #3b1f1d; --warn: #e3b35a; --warn-soft: #382c13;
  --ok: #6fcb9c; --ok-soft: #163227; --focus: #93aef0; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--body);
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface); }
h1, h2, h3, h4 { text-wrap: balance; margin: 0; }
p { margin: 0; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap {
  max-width: 1240px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* top bar */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; gap: 20px; padding-block: 10px; }
.brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--ink); }
.brand-mark { font: 600 1.5rem/1 var(--display); letter-spacing: -0.01em; }
.brand-sub { font: 500 var(--step--1)/1 var(--mono); color: var(--muted); letter-spacing: 0.08em; }
.top-nav { display: flex; gap: 4px; }
.top-nav a { padding: 4px 10px; border-radius: var(--r); text-decoration: none; color: var(--muted); }
.top-nav a.active { color: var(--ink); background: var(--margin); }
.redline-chip {
  margin-left: auto; font-size: var(--step--1); color: var(--pen); border: 1px solid currentColor;
  padding: 1px 8px; border-radius: 999px; white-space: nowrap;
}

/* buttons and inputs */
.btn {
  font: 500 var(--step-0)/1.2 var(--body); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); padding: 9px 16px; cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.btn.danger { background: var(--pen); border-color: var(--pen); color: var(--surface); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.icon-btn { font: inherit; font-size: var(--step--1); color: var(--muted); background: none; border: 0; cursor: pointer; padding: 4px; }
.icon-btn:hover { color: var(--pen); }
textarea, input:not([type=checkbox]), select {
  font: 400 var(--step-0)/1.65 var(--body); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; width: 100%;
}
textarea { resize: vertical; }
textarea:focus, input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
select { width: auto; }
.mono { font-family: var(--mono); font-size: var(--step--1); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); flex: none; margin: 3px 0 0; }

/* home */
.hero { padding-block: 72px 48px; display: grid; gap: 20px; }
.eyebrow { font-size: var(--step--1); color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.hero h1 { font: 600 var(--step-4)/1.08 var(--display); letter-spacing: -0.015em; }
.lede { font-size: var(--step-1); color: var(--muted); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.fine { font-size: var(--step--1); color: var(--muted); }
.modules-list, .redline, .roadmap { padding-block: 32px; display: grid; gap: 20px; }
.modules-list h2, .redline h2, .roadmap h2 { font: 600 var(--step-2)/1.3 var(--display); }
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.flow li { background: var(--surface); padding: 20px; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; }
.flow h3 { font: 600 var(--step-1)/1.4 var(--display); margin-bottom: 6px; }
.flow p { color: var(--muted); }
.pain { font-size: var(--step--1); color: var(--accent); }
.redline-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.redline-grid h3 { font-size: var(--step-0); margin-bottom: 8px; color: var(--ok); }
.redline-grid .no h3 { color: var(--pen); }
.redline-grid ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.redline-grid .no li { text-decoration: line-through; text-decoration-color: var(--pen); text-decoration-thickness: 1.5px; }
.roadmap p { color: var(--muted); max-width: 46em; }
.roadmap { padding-bottom: 72px; }

/* workspace */
.workspace { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; padding-block: 28px 64px; }
.side { display: flex; flex-direction: column; gap: 2px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 72px); align-self: start; }
.side a { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: var(--r); text-decoration: none; color: var(--muted); }
.side a:hover { background: var(--margin); color: var(--ink); }
.side a[aria-current] { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: inset 0 0 0 1px var(--line); }
.side b { font: 500 0.75rem/1 var(--mono); color: var(--pen); background: var(--pen-soft); padding: 3px 6px; border-radius: 999px; }
.module { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.module-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.module-head h1 { font: 700 var(--step-2)/1.3 var(--display); }
.module-head p { color: var(--muted); font-size: var(--step--1); }
.module-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.editor { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; }
.editor > label { font-weight: 500; margin-bottom: -8px; }
.intro { color: var(--muted); max-width: 42em; }
.empty { color: var(--muted); padding: 24px; border: 1px dashed var(--line); border-radius: var(--r); text-align: center; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* notes margin */
.notes { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 72px); max-height: calc(100vh - 96px); overflow-y: auto; background: var(--margin); border-radius: var(--r); padding: 18px; display: grid; gap: 12px; }
.notes-head { display: flex; justify-content: space-between; align-items: baseline; }
.notes-head h3 { font: 600 var(--step-1)/1.3 var(--display); color: var(--pen); }
.count { font-size: var(--step--1); color: var(--muted); }
.notes-rule { font-size: var(--step--1); color: var(--muted); }
.notes-list { display: grid; }
.note { padding-block: 14px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.note header { display: flex; gap: 8px; align-items: center; }
.note-tag { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tone); }
.note-field { font: inherit; font-size: 0.75rem; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; cursor: pointer; }
.note-field:hover { color: var(--accent); border-color: var(--accent); }
.note h4 { font-size: var(--step-0); font-weight: 700; line-height: 1.5; }
.note p { font-size: var(--step--1); line-height: 1.7; }
.note-why { color: var(--muted); }
.note-how b, .note-ask b { display: inline-block; margin-right: 6px; color: var(--ink); }
.note-ask { color: var(--accent); }
.note-example summary, .pattern summary { font-size: var(--step--1); color: var(--accent); cursor: pointer; }
.note-example p, .pattern p { margin-top: 6px; padding: 8px 10px; background: var(--surface); border-radius: var(--r); color: var(--muted); font-size: var(--step--1); }
.tone-pen { --tone: var(--pen); --tone-soft: var(--pen-soft); }
.tone-warn { --tone: var(--warn); --tone-soft: var(--warn-soft); }
.tone-ok { --tone: var(--ok); --tone-soft: var(--ok-soft); }
.tone-accent { --tone: var(--accent); --tone-soft: var(--accent-soft); }
.pill { display: inline-block; font-size: 0.75rem; font-weight: 500; line-height: 1.5; padding: 1px 8px; border-radius: 999px; color: var(--tone); background: var(--tone-soft); white-space: nowrap; }

/* overview */
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.title-input { font: 600 var(--step-1)/1.4 var(--display) !important; flex: 1 1 280px; }
.sample-chip { font-size: var(--step--1); color: var(--warn); background: var(--warn-soft); padding: 2px 10px; border-radius: 999px; }
.status-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.status-card { display: grid; gap: 6px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink); align-content: start; }
.status-card:hover { border-color: var(--accent); }
.status-card .pill { justify-self: start; }
.status-name { font-weight: 700; }
.status-value { font: 500 var(--step--1)/1.5 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.status-pain { font-size: var(--step--1); color: var(--muted); }
.project-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; background: var(--pen-soft); border-radius: var(--r); }
.confirm span { flex: 1 1 200px; }

/* outline */
.thread { display: grid; gap: 0; counter-reset: node; }
.node { position: relative; display: grid; gap: 6px; padding: 0 0 22px 30px; }
.node::before { counter-increment: node; content: counter(node); position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--surface); font: 500 0.75rem/20px var(--mono); text-align: center; }
.node::after { content: ""; position: absolute; left: 9.5px; top: 24px; bottom: 2px; width: 1px; background: var(--line); }
.node:last-child::after { display: none; }
.node label { font-weight: 700; }
.hint { font-size: var(--step--1); color: var(--muted); }

/* matrix */
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.matrix { border-collapse: collapse; width: 100%; min-width: 900px; }
.matrix th { text-align: left; font-size: var(--step--1); font-weight: 500; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); background: var(--margin); }
.matrix td { padding: 4px; vertical-align: top; border-bottom: 1px solid var(--line); }
.matrix tr:last-child td { border-bottom: 0; }
.matrix textarea { border-color: transparent; font-size: var(--step--1); padding: 6px; min-width: 120px; }
.matrix textarea:hover { border-color: var(--line); }
.matrix select { font-size: var(--step--1); }

/* citations */
.ref-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ref { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; gap: 8px; }
.ref-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ref-head code { font: var(--step--1)/1.4 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.ref-raw { font-size: var(--step--1); overflow-wrap: anywhere; }
.ref-issues { margin: 0; padding-left: 1.2em; color: var(--pen); font-size: var(--step--1); }
.ref-note { font-size: var(--step--1); color: var(--pen); }
.ref-fixed { font-size: var(--step--1); padding: 8px 10px; background: var(--ok-soft); border-radius: var(--r); overflow-wrap: anywhere; }
.ref-fixed span { display: block; font-size: 0.75rem; font-weight: 700; color: var(--ok); }
.copy-fallback { font-family: var(--mono); font-size: var(--step--1); min-height: 120px; margin-bottom: 10px; }

/* consistency */
.readonly { display: grid; gap: 4px; padding: 12px 14px; background: var(--margin); border-radius: var(--r); }
.readonly span { font-size: var(--step--1); color: var(--muted); }
.readonly a { font-size: var(--step--1); justify-self: start; }
.flagged h3 { font-size: var(--step-0); margin-bottom: 8px; color: var(--pen); }
.flagged ol { margin: 0; padding-left: 1.4em; display: grid; gap: 10px; }
.flagged q { display: block; quotes: none; text-decoration: underline wavy var(--pen); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.flagged li span { font-size: var(--step--1); color: var(--pen); }

/* review */
.reviewer { font: 600 var(--step-0)/1.4 var(--display); margin-top: 8px; }
.task { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; gap: 8px; }
.task.done { opacity: 0.65; }
.task.done .task-text { text-decoration: line-through; }
.task-top { display: flex; gap: 10px; align-items: flex-start; }
.task-text { font-weight: 500; }
.task-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-left: 28px; }
.task-meta select { font-size: var(--step--1); padding: 2px 6px; }
.task-vague { font-size: var(--step--1); color: var(--warn); background: var(--warn-soft); padding: 8px 10px; border-radius: var(--r); }
.small { font-size: var(--step--1); color: var(--muted); margin-bottom: -4px; }
.guide { background: var(--surface); border-radius: var(--r); padding: 12px 14px; font-size: var(--step--1); }
.guide summary { font-weight: 700; cursor: pointer; }
.guide ol { padding-left: 1.3em; margin: 8px 0; display: grid; gap: 4px; }
.guide-example { color: var(--muted); }

/* checklist */
.checks { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 6px 16px 10px; margin: 0; }
.checks legend { font: 600 var(--step-0)/1 var(--display); padding: 0 6px; }
.check-item { display: flex; gap: 10px; padding-block: 8px; border-bottom: 1px solid var(--line); }
.check-item:last-child { border-bottom: 0; }
.check-item label { display: grid; cursor: pointer; }
.check-item small { color: var(--muted); font-size: var(--step--1); }
.check-item input:checked + label { color: var(--muted); }

#toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px);
  background: var(--ink); color: var(--paper); padding: 8px 16px; border-radius: var(--r); font-size: var(--step--1);
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 20;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1020px) {
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .module-body { grid-template-columns: minmax(0, 1fr); }
  .notes { position: static; max-height: none; }
}
@media (max-width: 760px) {
  .flow { grid-template-columns: minmax(0, 1fr); }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-block: 16px 48px; }
  .side { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .side a { white-space: nowrap; gap: 6px; padding: 6px 10px; }
  .hero { padding-block: 40px 24px; }
  .redline-chip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* AI feedback box inside the notes margin */
.ai-box { background: var(--surface); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 6px; }
.ai-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ai-head h4 { font-size: var(--step-0); }
.small-btn { padding: 5px 10px; font-size: var(--step--1); }
.ai-rule, .ai-status { font-size: var(--step--1); color: var(--muted); }
.ai-status.error { color: var(--pen); }
.ai-box .note:first-of-type { border-top: 0; }

/* account */
.account { padding-block: 40px 72px; display: grid; gap: 16px; max-width: 640px; }
.account h1 { font: 600 var(--step-2)/1.3 var(--display); }
.account h2 { font: 600 var(--step-1)/1.3 var(--display); }
.acct-form { display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.acct-form .btn { justify-self: start; margin-top: 6px; }
.acct-msg { font-size: var(--step--1); padding: 8px 12px; border-radius: var(--r); background: var(--ok-soft); color: var(--ok); }
.acct-msg.error { background: var(--pen-soft); color: var(--pen); }
.link-btn { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.acct-switch, .cloud-line { font-size: var(--step--1); color: var(--muted); }
.proj-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.proj-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.proj-list li div { display: grid; min-width: 0; }
.proj-list small { color: var(--muted); font-size: var(--step--1); }
.proj-list li > span { display: flex; gap: 8px; align-items: center; }

/* legal pages and footer */
.legal { max-width: 760px; padding-block: 40px 64px; display: grid; gap: 12px; }
.legal h1 { font: 600 var(--step-2)/1.3 var(--display); }
.legal h2 { font: 600 var(--step-1)/1.3 var(--display); margin-top: 16px; }
.legal ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.legal-date { color: var(--muted); font-size: var(--step--1); }
.legal-draft { font-size: var(--step--1); padding: 8px 12px; border-radius: var(--r); background: var(--warn-soft); color: var(--warn); }
.legal-table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: var(--step--1); }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.legal-table th { background: var(--margin); font-weight: 500; }
.foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot .wrap { display: flex; gap: 16px; padding-block: 16px; font-size: var(--step--1); color: var(--muted); }
.foot a { color: var(--muted); }

/* discover */
.search-bar { display: flex; gap: 8px; }
.search-bar input { flex: 1 1 auto; min-width: 0; }
.inline-check { display: inline-flex; gap: 6px; align-items: center; font-size: var(--step--1); }
.inline-check input { margin: 0; }
.paper-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.paper { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; gap: 8px; transition: box-shadow 0.3s; }
.paper.flash { box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent); }
.paper-top { display: flex; gap: 10px; }
.paper-n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--margin); color: var(--muted); font: 500 0.75rem/24px var(--mono); text-align: center; }
.paper-main { min-width: 0; display: grid; gap: 2px; }
.paper-title { font-weight: 500; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.paper-title:hover { color: var(--accent); text-decoration: underline; }
.paper-meta, .paper-noabs { font-size: var(--step--1); color: var(--muted); }
.paper-abs summary { font-size: var(--step--1); color: var(--accent); cursor: pointer; }
.paper-abs p { margin-top: 6px; font-size: var(--step--1); color: var(--muted); }
.paper-links { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: var(--step--1); padding-left: 34px; }
.note-refs { font-size: var(--step--1); color: var(--muted); margin-top: -8px; padding-bottom: 8px; }
.note-refs a { margin-right: 6px; }

/* next steps */
.next-card { display: grid; gap: 4px; padding: 16px; border-radius: var(--r); background: var(--accent-soft); color: var(--ink); text-decoration: none; border: 1px solid var(--accent); }
.next-card b { font: 600 var(--step-1)/1.3 var(--display); }
.next-card span:last-child { color: var(--muted); font-size: var(--step--1); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.steps li div { display: grid; min-width: 0; }
.steps li a { color: var(--ink); font-weight: 500; }
.steps li.done a { color: var(--muted); text-decoration: line-through; }
.steps small { color: var(--muted); font-size: var(--step--1); }
.step-mark { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line); color: var(--surface); font-size: 0.75rem; line-height: 18px; text-align: center; margin-top: 2px; }
.steps li.done .step-mark { background: var(--ok); border-color: var(--ok); }
.sub { font: 600 var(--step-1)/1.3 var(--display); margin-top: 12px; }

/* papers in the matrix */
.paper-open { display: block; font: inherit; font-size: var(--step--1); font-weight: 500; text-align: left; color: var(--accent); background: none; border: 0; padding: 4px 6px 2px; cursor: pointer; text-decoration: underline; max-width: 220px; }
.ai-chip { display: inline-block; font-size: 0.6875rem; font-weight: 500; color: var(--warn); background: var(--warn-soft); border-radius: 999px; padding: 0 7px; margin: 2px 4px 0; }
.paper-h { font: 600 var(--step-2)/1.25 var(--display); }
.paper-abs-full { color: var(--muted); max-width: 46em; }
.editor .paper-links { padding-left: 0; }

/* threads between modules */
.cited { display: grid; gap: 6px; padding: 8px 0; border-top: 1px solid var(--line); font-size: var(--step--1); }
.cited .btn { justify-self: start; }
.cand { display: grid; gap: 2px; padding: 6px 8px; background: var(--margin); border-radius: var(--r); }
.cand small { color: var(--muted); }
.cand .btn { margin-top: 4px; }
.journal-chip { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 10px 14px; background: var(--accent-soft); border-radius: var(--r); font-size: var(--step--1); }
.journal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.journal-list li { display: flex; gap: 10px; align-items: baseline; }
.journal-list small { color: var(--muted); font-size: var(--step--1); }

/* consistency tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 2px 4px; padding-bottom: 2px; border-bottom: 1px solid var(--line); }
.tab { flex: none; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: var(--step--1); color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 10px; cursor: pointer; }
.tab.on { color: var(--ink); font-weight: 500; border-bottom-color: var(--accent); }
.tab-n { width: 18px; height: 18px; border-radius: 50%; background: var(--margin); font: 500 0.6875rem/18px var(--mono); text-align: center; }
.tab.on .tab-n { background: var(--accent); color: var(--surface); }
.tab b { font: 500 0.6875rem/1 var(--mono); color: var(--pen); background: var(--pen-soft); padding: 3px 6px; border-radius: 999px; }
.tab-ok { font-style: normal; color: var(--ok); }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.guide-grid .guide h4 { font-size: var(--step-0); margin-bottom: 6px; }
.guide-grid .guide ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.pattern-line { font-family: var(--mono); font-size: var(--step--1); color: var(--accent); margin-bottom: 8px; }
.tab-nav { display: flex; justify-content: space-between; gap: 10px; }

/* adaptive checklist */
.auto-mark { flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--ok); color: var(--surface); font-size: 0.6875rem; line-height: 18px; text-align: center; margin-top: 3px; }
.auto-chip { font-style: normal; font-size: 0.6875rem; font-weight: 500; color: var(--ok); background: var(--ok-soft); border-radius: 999px; padding: 0 7px; margin-left: 6px; }
.auto-chip.warn { color: var(--warn); background: var(--warn-soft); }
.check-item.is-done > label { color: var(--muted); }
