/* 用户飞轮 2.0 · design system
   Canvas #f7f8fc slate-blue, cobalt #5374d7 (交付循环), emerald #1f8a6b (学习循环).
   Evidence grades carry their own colour language across every surface. */

:root {
  --canvas: #f7f8fc;
  --canvas-2: #eff2f9;
  --surface: #ffffff;
  --ink: #131a2b;
  --ink-2: #485267;
  --ink-3: #8790a4;
  --ink-4: #b4bbca;
  --line: #e3e7f0;
  --line-2: #edf0f6;
  --cobalt: #5374d7;
  --cobalt-ink: #3553b5;
  --cobalt-soft: #eaf0ff;
  --cobalt-tint: #f3f6ff;
  --emerald: #1f8a6b;
  --emerald-ink: #146650;
  --emerald-soft: #e3f4ee;
  --amber: #b9821b;
  --amber-soft: #fbf2df;
  --red: #c2453d;
  --red-soft: #fbe9e7;
  --gA: #1f8a6b; --gA-soft: #e3f4ee;
  --gB: #2a7f9e; --gB-soft: #e2f1f7;
  --gC: #b9821b; --gC-soft: #fbf2df;
  --gD: #7466b0; --gD-soft: #eeebf8;
  --gH: #8790a4; --gH-soft: #eef0f5;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 14px;
  --r-sm: 9px;
  --shadow: 0 1px 2px rgba(19, 26, 43, .04), 0 6px 24px -12px rgba(19, 26, 43, .10);
  --shadow-lg: 0 24px 60px -24px rgba(19, 26, 43, .28);
  --rail: 236px;
  --side: 324px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--canvas); color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--cobalt-soft); }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; border-radius: 6px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; padding: 22px 14px 18px; border-right: 1px solid var(--line); background: rgba(247, 248, 252, .9); display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; }
.brand svg { width: 34px; height: 20px; flex: none; }
.brand b { font-family: var(--serif); font-size: 18px; letter-spacing: .02em; font-weight: 700; }
.brand small { display: block; font-size: 10.5px; letter-spacing: .14em; color: var(--ink-3); text-transform: uppercase; margin-top: -2px; }
.nav-sec { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--ink-2); font-size: 13.5px; transition: background .15s, color .15s; }
.nav a:hover { background: var(--canvas-2); color: var(--ink); }
.nav a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }
.nav a .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); flex: none; }
.nav a.loop-d .dot { background: var(--cobalt); }
.nav a.loop-l .dot { background: var(--emerald); }
.nav a .ct { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.nav a .ct.hot { color: #fff; background: var(--cobalt); padding: 0 6px; border-radius: 99px; line-height: 18px; }
.rail-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--cobalt-ink); background: var(--cobalt-soft); flex: none; }
.rail-foot .who { font-size: 13px; line-height: 1.3; min-width: 0; }
.rail-foot .who small { display: block; color: var(--ink-3); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-foot button { margin-left: auto; }

.main { min-width: 0; padding: 30px 40px 80px; }
.work { display: grid; grid-template-columns: minmax(0, 1fr) var(--side); gap: 28px; align-items: start; }
.work.single { grid-template-columns: minmax(0, 1fr); }
.side { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 16px; }

/* ---------- type ---------- */
.eyebrow { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.eyebrow.d { color: var(--cobalt); }
.eyebrow.l { color: var(--emerald); }
.eyebrow i { width: 18px; height: 1px; background: currentColor; display: inline-block; }
h1.title { font-family: var(--serif); font-size: 36px; line-height: 1.2; font-weight: 700; letter-spacing: .01em; margin: 8px 0 8px; }
h1.title.sm { font-size: 28px; }
.lede { color: var(--ink-2); font-size: 14.5px; max-width: 640px; margin: 0; }
h2.h { font-size: 15px; font-weight: 650; margin: 0; letter-spacing: .01em; }
h3.h { font-size: 13px; font-weight: 650; margin: 0; color: var(--ink-2); }
.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.crumbs { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.crumbs a:hover { color: var(--cobalt); }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.pad { padding: 20px 22px; }
.pad-sm { padding: 14px 16px; }
.sec { margin-top: 28px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--line-2); }
.panel-title h2 { font-size: 13px; font-weight: 650; margin: 0; }
.panel-body { padding: 6px 8px 8px; }
.empty { padding: 26px 18px; text-align: center; color: var(--ink-3); font-size: 13px; }
.empty b { display: block; color: var(--ink-2); font-weight: 600; margin-bottom: 4px; font-size: 13.5px; }
.divider { height: 1px; background: var(--line-2); margin: 16px 0; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 13.5px; font-weight: 550; cursor: pointer; transition: transform .12s var(--ease), background .15s, border-color .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { border-color: var(--ink-4); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #222b40; }
.btn.cobalt { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.btn.cobalt:hover { background: var(--cobalt-ink); }
.btn.emerald { background: var(--emerald); border-color: var(--emerald); color: #fff; }
.btn.emerald:hover { background: var(--emerald-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--canvas-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.danger { color: var(--red); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn .spin { width: 13px; height: 13px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- badges ---------- */
.g { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-family: var(--mono); font-size: 12px; font-weight: 700; flex: none; }
.g-A { background: var(--gA-soft); color: var(--gA); }
.g-B { background: var(--gB-soft); color: var(--gB); }
.g-C { background: var(--gC-soft); color: var(--gC); }
.g-D { background: var(--gD-soft); color: var(--gD); }
.g-H { background: var(--gH-soft); color: var(--gH); }
.g-none { background: var(--canvas-2); color: var(--ink-4); }
.g.ghost { background: transparent; border: 1px dashed currentColor; }
.mat { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.mat::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.mat-lead { background: var(--amber-soft); color: var(--amber); }
.mat-initial { background: var(--cobalt-soft); color: var(--cobalt-ink); }
.mat-replicated { background: var(--emerald-soft); color: var(--emerald-ink); }
.mat-refuted { background: var(--red-soft); color: var(--red); text-decoration: line-through; }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 550; background: var(--canvas-2); color: var(--ink-2); white-space: nowrap; }
.pill.cobalt { background: var(--cobalt-soft); color: var(--cobalt-ink); }
.pill.emerald { background: var(--emerald-soft); color: var(--emerald-ink); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.line { background: transparent; border: 1px solid var(--line); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ---------- hero: double loop ---------- */
.hero { position: relative; padding: 26px 26px 18px; overflow: hidden; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.hero-kpis { display: flex; gap: 26px; }
.kpi b { display: block; font-family: var(--mono); font-size: 26px; font-weight: 600; line-height: 1.1; letter-spacing: -.02em; }
.kpi span { font-size: 11.5px; color: var(--ink-3); }
.loop-wrap { position: relative; margin: 6px -6px 0; }
.loop-svg { width: 100%; height: auto; display: block; overflow: visible; }
.loop-svg .track { fill: none; stroke-width: 2; }
.loop-svg .track.d { stroke: var(--cobalt); }
.loop-svg .track.l { stroke: var(--emerald); }
.loop-svg .halo { fill: none; stroke-width: 22; opacity: .07; }
.loop-svg .halo.d { stroke: var(--cobalt); }
.loop-svg .halo.l { stroke: var(--emerald); stroke-width: 30; opacity: .1; }
.loop-svg .flow { fill: var(--ink); }
.loop-svg .node circle.o { fill: var(--surface); stroke-width: 2; }
.loop-svg .node.d circle.o { stroke: var(--cobalt); }
.loop-svg .node.l circle.o { stroke: var(--emerald); }
.loop-svg .node.j circle.o { stroke: var(--ink); fill: var(--ink); }
.loop-svg .node circle.i { fill: var(--cobalt); }
.loop-svg .node.l circle.i { fill: var(--emerald); }
.loop-svg .node.zero circle.i { fill: var(--line); }
.loop-svg .node.alert circle.o { stroke: var(--red); }
.loop-svg .node text.lb { font-family: var(--sans); font-size: 13px; font-weight: 600; fill: var(--ink); }
.loop-svg .node text.ct { font-family: var(--mono); font-size: 18px; font-weight: 600; fill: var(--ink); }
.loop-svg .node text.sub { font-family: var(--sans); font-size: 11px; fill: var(--ink-3); }
.loop-svg .node.zero text.ct { fill: var(--ink-4); }
.loop-svg .node.alert text.ct { fill: var(--red); }
.loop-svg a.node { cursor: pointer; }
.loop-svg a.node:hover circle.o { stroke-width: 3; }
.loop-svg .cap { font-family: var(--sans); font-size: 11px; letter-spacing: .18em; font-weight: 600; }
.loop-svg .cap.d { fill: var(--cobalt); }
.loop-svg .cap.l { fill: var(--emerald); }
.loop-svg .capsub { font-family: var(--serif); font-size: 15px; fill: var(--ink); font-weight: 700; }
.loop-legend { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--ink-3); padding: 4px 4px 0; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { .loop-svg .flow { display: none; } }

/* ---------- direction cards ---------- */
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.dir { display: block; padding: 18px 20px 16px; transition: transform .18s var(--ease), box-shadow .18s; position: relative; }
.dir:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.dir h3 { font-size: 15.5px; font-weight: 650; margin: 0 0 4px; line-height: 1.4; }
.dir .goal { color: var(--ink-2); font-size: 12.5px; margin: 0 0 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.step-now { background: var(--cobalt-tint); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; }
.step-now .k { font-size: 10.5px; letter-spacing: .14em; color: var(--cobalt); text-transform: uppercase; font-weight: 600; }
.step-now p { margin: 2px 0 0; color: var(--ink); }
.dir-foot { display: flex; gap: 14px; margin-top: 12px; font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }
.dir-foot b { font-family: var(--mono); color: var(--ink); font-weight: 600; margin-right: 3px; }

/* ---------- stage track (5-stage) ---------- */
.track5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 12px 0 2px; }
.track5 .s { height: 4px; border-radius: 99px; background: var(--line); }
.track5 .s.on { background: var(--cobalt); }
.track5 .s.now { background: linear-gradient(90deg, var(--cobalt) 50%, var(--line) 50%); }
.track5 .s.l.on { background: var(--emerald); }
.track5-labels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; font-size: 11px; color: var(--ink-3); }
.track5-labels span.on { color: var(--ink); font-weight: 600; }
.stage-big { padding: 18px 22px; }
.stage-big .track5 .s { height: 6px; }

/* ---------- queue / lists ---------- */
.qi { display: flex; gap: 10px; padding: 10px 8px; border-radius: 10px; align-items: flex-start; transition: background .15s; }
.qi:hover { background: var(--canvas); }
.qi .ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 700; }
.qi .ic.q { background: var(--emerald-soft); color: var(--emerald); }
.qi .ic.c { background: var(--cobalt-soft); color: var(--cobalt); }
.qi .ic.b { background: var(--red-soft); color: var(--red); }
.qi .ic.d { background: var(--amber-soft); color: var(--amber); }
.qi .t { font-size: 13px; line-height: 1.45; min-width: 0; }
.qi .t small { display: block; color: var(--ink-3); font-size: 11.5px; margin-top: 2px; }
.ev { display: flex; gap: 10px; padding: 7px 8px; font-size: 12.5px; color: var(--ink-2); }
.ev time { font-family: var(--mono); font-size: 11px; color: var(--ink-3); flex: none; width: 54px; padding-top: 1px; }
.ev b { color: var(--ink); font-weight: 600; }

.rows { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line-2); transition: background .12s; }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--cobalt-tint); }
.row .main-t { font-size: 13.5px; font-weight: 550; line-height: 1.45; }
.row .meta { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row .end { display: flex; gap: 8px; align-items: center; }

.meter { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.meter .bar { width: 54px; height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.meter .bar i { display: block; height: 100%; background: var(--emerald); border-radius: 99px; }
.meter.low .bar i { background: var(--amber); }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 18px; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.fgrid .full { grid-column: 1 / -1; }
.field label { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field label small { font-weight: 400; color: var(--ink-3); }
.field label .req { color: var(--cobalt); }
.inp { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 12px; font-size: 13.5px; outline: none; transition: border-color .15s, box-shadow .15s; }
.inp:focus { border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-soft); }
textarea.inp { min-height: 84px; resize: vertical; line-height: 1.6; }
select.inp { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.inp.ai-filled { background: var(--emerald-soft); border-color: #b8e0d2; }
.hint { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }
.form-group { padding: 20px 22px; }
.form-group + .form-group { border-top: 1px solid var(--line-2); }
.form-group .gh { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.form-group .gh .n { font-family: var(--mono); font-size: 11px; color: var(--cobalt); }
.form-group .gh h2 { font-size: 14px; margin: 0; font-weight: 650; }
.form-group .gh p { margin: 0; font-size: 12px; color: var(--ink-3); }
.sticky-actions { position: sticky; bottom: 0; padding: 14px 22px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border-top: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.grade-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.grade-pick button { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 6px 10px 6px 6px; cursor: pointer; font-size: 12px; color: var(--ink-2); text-align: left; transition: border-color .15s, background .15s; }
.grade-pick button.on { border-color: var(--ink); background: var(--canvas); color: var(--ink); }
.grade-pick button .sug { font-size: 10px; color: var(--emerald); font-weight: 600; }
.mrow { display: grid; grid-template-columns: 1.3fr .8fr 1fr 1fr 28px; gap: 6px; margin-bottom: 6px; }
.cprow { display: grid; grid-template-columns: 1fr .7fr 1.6fr 28px; gap: 6px; margin-bottom: 8px; align-items: start; }
.cprow textarea.inp { min-height: 40px; height: 62px; padding-top: 8px; }
.x { width: 28px; height: 36px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; border-radius: 8px; font-size: 16px; }
.x:hover { background: var(--red-soft); color: var(--red); }

/* composer (learning intake) */
.composer { padding: 22px; position: relative; overflow: hidden; }
.composer::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--emerald); }
.composer textarea { border: 0; outline: 0; width: 100%; resize: none; min-height: 96px; font-size: 15px; line-height: 1.7; background: transparent; padding: 0; }
.composer textarea::placeholder { color: var(--ink-4); }
.composer .bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.composer .bar .muted { font-size: 12px; }
.composer .dirpick { min-width: 0; flex: 0 1 300px; }
.composer .dirpick select { width: 100%; max-width: 100%; }
.ai-preview { border-top: 1px dashed var(--line); margin-top: 18px; padding-top: 18px; animation: rise .35s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--ink-3); font-size: 12px; padding-top: 1px; }
.kv dd { margin: 0; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.kv dd.na { color: var(--ink-4); }

/* question thread */
.qa { padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.qa:last-child { border-bottom: 0; }
.qa .q { display: flex; gap: 10px; font-size: 13.5px; font-weight: 550; }
.qa .q .src { font-size: 10px; letter-spacing: .1em; color: var(--emerald); font-weight: 700; flex: none; padding-top: 3px; width: 26px; }
.qa .a { margin: 8px 0 0 36px; font-size: 13px; color: var(--ink-2); white-space: pre-wrap; }
.qa .a.cannot { color: var(--ink-3); font-style: italic; }
.qa .ans { margin: 10px 0 0 36px; display: flex; flex-direction: column; gap: 8px; }
.qa .ans textarea { min-height: 60px; }
.qa .rate { margin: 8px 0 0 36px; display: flex; gap: 6px; align-items: center; font-size: 11.5px; color: var(--ink-3); }
.qa .rate button { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; height: 24px; padding: 0 10px; font-size: 11.5px; cursor: pointer; color: var(--ink-2); }
.qa .rate button.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* metrics table */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 11.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl td.num { font-family: var(--mono); font-weight: 600; }
.tbl tr:last-child td { border-bottom: 0; }

/* knowledge */
.search-hero { padding: 6px; display: flex; align-items: center; gap: 6px; border-radius: 14px; }
.search-hero input { border: 0; outline: 0; flex: 1; font-size: 16px; padding: 10px 12px; background: transparent; min-width: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 0; }
.chip { height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; cursor: pointer; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.kcard { display: grid; grid-template-columns: 4px minmax(0, 1fr); gap: 0; overflow: hidden; transition: box-shadow .15s, transform .15s var(--ease); }
.kcard:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.kcard .spine { background: var(--gH); }
.kcard .spine.A { background: var(--gA); } .kcard .spine.B { background: var(--gB); } .kcard .spine.C { background: var(--gC); } .kcard .spine.D { background: var(--gD); }
.kcard .body { padding: 16px 18px; }
.kcard .concl { font-family: var(--serif); font-size: 16.5px; line-height: 1.55; font-weight: 700; margin: 8px 0 6px; }
.kcard .sub { font-size: 12.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kcard .foot { display: flex; gap: 12px; margin-top: 10px; font-size: 11.5px; color: var(--ink-3); flex-wrap: wrap; }
.klist { display: flex; flex-direction: column; gap: 10px; }
.quote { font-family: var(--serif); font-size: 22px; line-height: 1.5; font-weight: 700; margin: 10px 0 0; }

/* grade legend */
.legend { display: flex; flex-direction: column; gap: 9px; }
.legend .li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; font-size: 12.5px; align-items: start; }
.legend .li b { font-weight: 600; }
.legend .li span { color: var(--ink-3); display: block; font-size: 11.5px; }

/* acceptance */
.acc { display: grid; grid-template-columns: 40px minmax(0, 1fr) 160px; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line-2); align-items: start; }
.acc:last-child { border-bottom: 0; }
.acc .no { font-family: var(--mono); font-size: 20px; color: var(--ink-4); font-weight: 600; line-height: 1.2; }
.acc.pass .no { color: var(--emerald); }
.acc h3 { margin: 0; font-size: 14.5px; font-weight: 650; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.acc p { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-2); }
.acc .det { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.acc .val { text-align: right; }
.acc .val b { font-family: var(--mono); font-size: 13px; display: block; }
.acc .pbar { height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 8px; }
.acc .pbar i { display: block; height: 100%; background: var(--cobalt); border-radius: 99px; transition: width .6s var(--ease); }
.acc.pass .pbar i { background: var(--emerald); }
.ring { width: 120px; height: 120px; }
.ring circle { fill: none; stroke-width: 9; }
.ring .bg { stroke: var(--line); }
.ring .fg { stroke: var(--emerald); stroke-linecap: round; transition: stroke-dashoffset .8s var(--ease); }
.health { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.health div { background: var(--canvas); border-radius: 10px; padding: 10px 12px; }
.health b { font-family: var(--mono); font-size: 18px; display: block; }
.health span { font-size: 11.5px; color: var(--ink-3); }

/* rubric prose */
.prose { font-size: 14px; line-height: 1.8; color: var(--ink); }
.prose h1, .prose h2 { font-family: var(--serif); font-weight: 700; margin: 26px 0 8px; line-height: 1.35; }
.prose h1 { font-size: 22px; } .prose h2 { font-size: 18px; }
.prose h3 { font-size: 14.5px; margin: 18px 0 6px; }
.prose p { margin: 8px 0; }
.prose ul, .prose ol { padding-left: 20px; margin: 8px 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 13px; margin: 12px 0; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { color: var(--ink-3); font-weight: 600; font-size: 12px; }
.prose code { font-family: var(--mono); font-size: 12.5px; background: var(--canvas-2); padding: 1px 5px; border-radius: 5px; }
.prose > :first-child { margin-top: 0; }

/* modal + toast */
.scrim { position: fixed; inset: 0; background: rgba(19, 26, 43, .32); display: grid; place-items: center; z-index: 50; padding: 20px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); animation: rise .25s var(--ease); }
.modal .mh { padding: 20px 22px 6px; }
.modal .mh h2 { font-family: var(--serif); font-size: 20px; margin: 0; }
.modal .mb { padding: 10px 22px 18px; }
.modal .mf { padding: 14px 22px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 8px; }
#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--ease); z-index: 60; max-width: calc(100vw - 40px); }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.err { background: var(--red); }
.secret { font-family: var(--mono); font-size: 20px; letter-spacing: .06em; background: var(--canvas); border: 1px dashed var(--ink-4); border-radius: 12px; padding: 14px; text-align: center; user-select: all; }

/* note blocks */
.note { border-radius: 12px; padding: 12px 14px; font-size: 12.5px; line-height: 1.6; background: var(--canvas-2); color: var(--ink-2); }
.note.cobalt { background: var(--cobalt-tint); color: var(--cobalt-ink); }
.note.emerald { background: var(--emerald-soft); color: var(--emerald-ink); }
.note.amber { background: var(--amber-soft); color: #8a5f10; }
.note.red { background: var(--red-soft); color: var(--red); }
.note b { font-weight: 650; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: transparent; padding: 10px 12px; font-size: 13px; color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.tabs button .mono { font-size: 11px; margin-left: 4px; }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.login .art { position: relative; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; background: var(--ink); color: #fff; overflow: hidden; }
.login .art .loop-svg .track.d { stroke: #8ea6f0; } .login .art .loop-svg .track.l { stroke: #5cc3a4; }
.login .art .loop-svg .halo { opacity: .12; }
.login .art .loop-svg .flow { fill: #fff; }
.login .art h1 { font-family: var(--serif); font-size: 40px; line-height: 1.3; margin: 0; font-weight: 700; }
.login .art p { color: #aab3c8; max-width: 440px; font-size: 14px; }
.login .art .eyebrow { color: #8ea6f0; }
.login .form-side { display: grid; place-items: center; padding: 40px 28px; }
.login form { width: min(360px, 100%); display: flex; flex-direction: column; gap: 16px; }
.login form h2 { font-family: var(--serif); font-size: 26px; margin: 0 0 4px; }

/* topbar (mobile) */
.topbar { display: none; }
.tabbar { display: none; }

.loading { padding: 80px 0; display: grid; place-items: center; color: var(--ink-3); font-size: 13px; }
.loading .spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--cobalt); animation: spin .8s linear infinite; margin-bottom: 10px; }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .work { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .main { padding: 12px 16px calc(96px + env(safe-area-inset-bottom)); }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 14px; }
  .topbar .brand { padding: 0; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: var(--ink-3); padding: 4px 0; position: relative; }
  .tabbar a svg { width: 21px; height: 21px; }
  .tabbar a.on { color: var(--ink); font-weight: 600; }
  .tabbar a .badge { position: absolute; top: 0; left: 55%; background: var(--cobalt); color: #fff; font-size: 9.5px; font-family: var(--mono); border-radius: 99px; padding: 0 5px; line-height: 15px; }
  h1.title { font-size: 27px; }
  h1.title.sm { font-size: 23px; }
  .page-head { margin-bottom: 18px; }
  .hero { padding: 18px 14px 12px; }
  .hero-kpis { gap: 18px; }
  .kpi b { font-size: 21px; }
  .dir-grid { grid-template-columns: minmax(0, 1fr); }
  .fgrid { grid-template-columns: minmax(0, 1fr); }
  .form-group { padding: 16px; }
  .sticky-actions { padding: 12px 16px; bottom: calc(62px + env(safe-area-inset-bottom)); }
  .acc { grid-template-columns: 28px minmax(0, 1fr); }
  .acc .val { grid-column: 2; text-align: left; }
  .mrow { grid-template-columns: 1fr 1fr; }
  .mrow .x { grid-column: 2; justify-self: end; }
  .cprow { grid-template-columns: 1fr 1fr; }
  .cprow textarea, .cprow .w { grid-column: 1 / -1; }
  .kv { grid-template-columns: 78px minmax(0, 1fr); }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login .art { padding: 28px 22px 22px; min-height: 0; }
  .login .art h1 { font-size: 27px; }
  .row { padding: 12px; grid-template-columns: 22px minmax(0, 1fr); }
  .row .end { grid-column: 2; }
  .pad { padding: 16px; }
  .composer .dirpick { flex: 1 1 100%; }
  .quote { font-size: 19px; }
}
