/* 纸墨风色板：组件只引用变量（对比度见 docs/FRONTEND_INTERACTION_DESIGN.md 第 5 节） */
:root {
  --paper: #FAF9F6;
  --surface: #FFFFFF;
  --rule: #E8E5DF;
  --rule-strong: #C8C3B8;
  --ink: #1C1917;
  --ink-2: #57534E;
  --ink-3: #78716C;
  --ink-4: #A8A29E;
  --case: #1E3A5F;
  --case-bg: #EEF3F8;
  --statute: #8A4B1A;
  --statute-bg: #FBF3EB;
  --alert: #9B2C2C;
  --warn-rule: #B4691E;
  --warn-bg: #FCF9F2;
  --blocked-bg: #F2F0EC;
  --mark: #F6E7B4;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  --main-w: 760px;
  --drawer-w: 42vw;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.6; }
body { font-variant-numeric: tabular-nums; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--case); outline-offset: 2px;
}
.link { color: var(--ink-2); }
.link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.small { font-size: 12px; }
.meta { font-size: 11px; color: var(--ink-3); }
.serif { font-family: var(--serif); font-weight: 500; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------ 顶栏 */
#topbar {
  position: sticky; top: 0; z-index: 20; height: 48px; display: flex; align-items: center; gap: 16px;
  padding: 0 20px; background: var(--paper); border-bottom: 1px solid var(--rule);
}
#topbar .title { flex: 1; text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-family: var(--serif); font-weight: 500; }
#topbar .title button:hover { text-decoration: underline; text-underline-offset: 4px; }
#topbar .actions { display: flex; gap: 16px; }
#topbar.empty-mode { border-bottom-color: transparent; }

/* ------------------------------------------------ 空态 */
#empty { max-width: 680px; margin: 0 auto; padding: 18vh 20px 40px; }
#empty h1 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 0 0 18px; text-align: center; }
.composer { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px 10px; }
.composer:focus-within { border-color: var(--rule-strong); }
.composer textarea {
  width: 100%; min-height: 96px; resize: vertical; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 16px; line-height: 1.7; color: var(--ink);
}
.composer textarea::placeholder { color: var(--ink-3); }
.composer .row { display: flex; align-items: center; gap: 10px; }
.btn-primary { background: var(--case); color: #fff; border-radius: 6px; padding: 5px 14px; font-size: 13px; }
.btn-primary:hover { background: #16304F; }
.btn-primary[aria-busy="true"] { opacity: .7; cursor: progress; }
.filters { margin-top: 8px; font-size: 12px; color: var(--ink-2); }
.filters .chip { color: var(--ink-2); }
.filters .chip:hover { color: var(--ink); }
.filters form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 16px; margin-top: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); }
.filters label.check { flex-direction: row; align-items: center; gap: 6px; }
.filters input[type="text"], .filters input[type="number"], .filters select {
  font: inherit; font-size: 13px; padding: 4px 8px; border: 1px solid var(--rule); border-radius: 5px; background: var(--paper); color: var(--ink);
}
.error { color: var(--alert); font-size: 13px; margin-top: 6px; }
.examples { margin-top: 26px; display: flex; flex-direction: column; gap: 8px; }
.examples button { text-align: left; font-size: 14px; color: var(--ink-2); }
.examples button::before { content: "例　"; color: var(--ink-3); font-size: 12px; }
.examples button:hover { color: var(--ink); }

/* ------------------------------------------------ 工作区：主栏 + 抽屉 */
#workspace { display: flex; justify-content: center; }
#brief { width: 100%; max-width: var(--main-w); padding: 14px 24px 80px; transition: margin .2s ease; }
body.drawer-open #brief { margin-right: var(--drawer-w); }
@media (max-width: 1279px) { body.drawer-open #brief { margin-right: 0; } }

.section { margin-top: 22px; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.section-head .label { font-size: 12px; color: var(--ink-2); }
.section-head .rule { flex: 1; border-top: 1px solid var(--rule); }
.section-head h2 { font-family: var(--serif); font-weight: 500; font-size: 16px; margin: 0; }

/* 状态条 */
.status { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-2); min-height: 26px; }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--case); animation: pulse 1.6s ease-in-out infinite; }
.status.done { color: var(--ink-3); font-size: 12px; }
.status.done .dot, .status.failed .dot, .status.cancelled .dot { display: none; }
.status.failed { color: var(--alert); }
.status .spacer { flex: 1; }
.status .typical { color: var(--ink-3); }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .status .dot { animation: none; } }
.steps { margin-top: 6px; border-top: 1px solid var(--rule); }
.step { display: grid; grid-template-columns: 18px 76px 54px 1fr auto; gap: 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 13px; }
.step .icon { color: var(--ink-3); text-align: center; }
.step.done .icon { color: var(--ink-2); }
.step.running .icon { color: var(--case); }
.step.failed { color: var(--alert); }
.step.failed .icon { color: var(--alert); }
.step .t { color: var(--ink-3); }
.step .s { color: var(--ink-2); overflow-wrap: anywhere; }
.step.pending { color: var(--ink-3); }
.flash { color: var(--case); font-size: 12px; }

/* 证据速览 */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 640px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 8px 10px; text-align: left;
  font-size: 12px; line-height: 1.55; color: var(--ink-2); min-height: 68px;
}
.card:hover { border-color: var(--rule-strong); }
.card.tier0 { border-color: var(--statute); }
.card.active { border-color: var(--case); }
.card .no { color: var(--ink); display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card .no b { font-weight: 500; color: var(--case); margin-right: 6px; }
.card .overturn { color: var(--alert); }
.card.more { display: flex; align-items: center; justify-content: center; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-statute { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; color: var(--statute); background: var(--statute-bg); border: 1px solid transparent; border-radius: 4px; padding: 2px 8px; }
.chip-statute:hover { border-color: var(--rule-strong); }
.chip-statute.uncited { color: var(--ink-2); background: var(--surface); border-color: var(--rule); }
.chip-statute.uncited:hover { color: var(--statute); border-color: var(--statute); }
.chip-statute .st { color: var(--ink-3); }
.chip-more { font-size: 12px; color: var(--ink-3); padding: 2px 4px; }

/* 修法提示 callout */
.callout { background: var(--warn-bg); border-left: 3px solid var(--warn-rule); border-radius: 0; padding: 10px 14px; font-size: 13px; line-height: 1.75; }
.callout .head { display: flex; align-items: center; margin-bottom: 2px; }
.callout .head .serif { font-size: 13px; }
.callout .head .spacer { flex: 1; }
.callout ul { margin: 0; padding: 0; list-style: none; }
.callout .confirmed { font-size: 11px; color: var(--ink-3); margin-left: 8px; }

/* 正文 */
.answer { font-size: 16px; line-height: 1.75; color: var(--ink); }
.answer p { margin: 0 0 .9em; }
.answer h3, .answer h4 { font-family: var(--serif); font-weight: 500; margin: 1.2em 0 .5em; }
.answer h3 { font-size: 17px; }
.answer h4 { font-size: 16px; }
.answer ul, .answer ol { margin: 0 0 .9em; padding-left: 1.4em; }
.answer li { margin: .2em 0; }
.answer blockquote { margin: 0 0 .9em; padding-left: 12px; border-left: 2px solid var(--rule-strong); border-radius: 0; color: var(--ink-2); }
.answer .plain { white-space: pre-wrap; font-size: 14px; color: var(--ink-2); }
.answer .blocked { background: var(--blocked-bg); color: var(--ink-2); padding: 8px 12px; border-radius: 4px; font-size: 13px; }
sup.ref { font-size: 10.5px; line-height: 1; padding: 1px 4px; border-radius: 3px; margin: 0 1px; vertical-align: super; cursor: pointer; font-family: var(--sans); }
sup.ref.case { color: var(--case); background: var(--case-bg); }
sup.ref.statute { color: var(--statute); background: var(--statute-bg); }
sup.ref.pending { color: var(--ink-3); background: var(--blocked-bg); cursor: default; }
sup.ref.dropped { color: var(--ink-4); background: none; text-decoration: line-through; cursor: help; }
sup.ref.flash-on { outline: 2px solid var(--case); outline-offset: 1px; }
.skeleton { display: flex; flex-direction: column; gap: 10px; }
.skeleton i { display: block; height: 12px; border-radius: 3px; background: var(--rule); }
.skeleton i:nth-child(2) { width: 92%; }
.skeleton i:nth-child(3) { width: 64%; }
.skeleton.short i { height: 10px; }
.skeleton.cards-sk { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.skeleton.cards-sk i { height: 68px; width: auto; }

/* 图示 */
.figure { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 10px 14px 8px; }
.figure .switch { display: flex; justify-content: flex-end; gap: 4px; font-size: 12px; color: var(--ink-3); }
.figure .switch button { color: var(--ink-3); padding: 0 4px; }
.figure .switch button[aria-pressed="true"] { color: var(--ink); }
.figure .switch .sep { color: var(--ink-4); }
.figure .canvas { overflow-x: auto; padding: 8px 0; min-height: 60px; }
.figure .canvas svg { max-width: 100%; height: auto; }
.figure .canvas .node.clickable { cursor: pointer; }
.figure .canvas .node.clickable:hover rect, .figure .canvas .node.clickable:hover polygon { stroke-width: 2px; }
.figure .foot { display: flex; justify-content: space-between; }

/* T2 原生时间轴 */
.tl-law { margin: 6px 0 14px; }
.tl-law .name { font-size: 13px; font-family: var(--serif); font-weight: 500; margin-bottom: 4px; }
.tl-track { position: relative; display: flex; gap: 0; padding-top: 14px; }
.tl-track::before { content: ""; position: absolute; top: 18px; left: 6px; right: 6px; border-top: 1px solid var(--rule-strong); }
.tl-ev { position: relative; flex: 1; min-width: 0; padding: 0 6px; text-align: left; font-size: 11.5px; line-height: 1.45; color: var(--ink-2); }
.tl-ev .pin { position: relative; display: block; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 1px solid var(--ink-3); margin-bottom: 6px; }
.tl-ev.cited .pin { background: var(--statute); border-color: var(--statute); }
.tl-ev.cited .lbl { color: var(--statute); }
.tl-ev.abolished .pin, .tl-ev.superseded .pin { border-color: var(--alert); }
.tl-ev.abolished .lbl, .tl-ev.superseded .lbl { color: var(--alert); }
.tl-ev .d { color: var(--ink-3); display: block; }
.tl-ev.clickable { cursor: pointer; }
.tl-ev.clickable:hover .lbl { text-decoration: underline; text-underline-offset: 3px; }

/* 附录 */
.baseline .cause select { font: inherit; font-size: 12px; color: var(--ink); border: 0; border-bottom: 1px dashed var(--rule-strong); background: transparent; padding: 0 2px; }
.baseline svg { width: 100%; height: auto; display: block; margin: 8px 0 4px; }
.baseline svg .bar { fill: var(--ink-2); }
.baseline svg .bar:hover { fill: var(--ink); }
.baseline svg .lake { fill: none; stroke: var(--statute); stroke-width: 1.2; }
.baseline svg text { font-size: 10px; fill: var(--ink-3); font-family: var(--sans); }
.baseline .legend { display: flex; gap: 16px; font-size: 11px; color: var(--ink-3); }
.baseline .legend i { display: inline-block; width: 10px; height: 8px; margin-right: 4px; vertical-align: 0; }
.baseline details { margin-top: 8px; font-size: 12px; color: var(--ink-2); }
.baseline details summary { cursor: pointer; color: var(--ink-2); }
.baseline table { border-collapse: collapse; margin-top: 8px; width: 100%; }
.baseline th, .baseline td { text-align: right; padding: 3px 8px; border-bottom: 1px solid var(--rule); font-weight: 400; }
.baseline th:first-child, .baseline td:first-child { text-align: left; }
.baseline th { color: var(--ink-3); }

/* ------------------------------------------------ 抽屉 */
#drawer {
  position: fixed; top: 48px; right: 0; bottom: 0; width: var(--drawer-w); min-width: 360px; max-width: 760px;
  background: var(--surface); border-left: 1px solid var(--rule); transform: translateX(100%);
  transition: transform .2s ease; display: flex; flex-direction: column; z-index: 15;
}
body.drawer-open #drawer { transform: none; }
@media (max-width: 1279px) { #drawer { width: min(560px, 92vw); } }
@media (prefers-reduced-motion: reduce) { #drawer, #brief { transition: none; } }
#drawer .bar { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--rule); font-size: 12px; color: var(--ink-3); }
#drawer .bar .spacer { flex: 1; }
#drawer .body { flex: 1; overflow-y: auto; padding: 14px 20px 40px; }
#drawer h3 { font-family: var(--serif); font-weight: 500; font-size: 17px; margin: 0 0 2px; }
#drawer .sub { font-size: 12px; color: var(--ink-2); }
#drawer .flags { font-size: 11px; margin-top: 4px; display: flex; gap: 10px; }
#drawer .flags .tier0 { color: var(--statute); }
#drawer .flags .alert { color: var(--alert); }
.tabs { display: flex; gap: 14px; font-size: 12px; margin: 14px 0 10px; border-bottom: 1px solid var(--rule); }
.tabs button { padding-bottom: 6px; color: var(--ink-3); border-bottom: 1.5px solid transparent; border-radius: 0; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.doc-text { white-space: pre-wrap; font-size: 14px; line-height: 1.85; color: var(--ink); overflow-wrap: anywhere; }
.doc-text mark { background: var(--mark); color: var(--ink); padding: 0; }
.drawer-foot { align-items: flex-start; margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--ink-2); }
.law-text { font-family: var(--serif); font-size: 15px; line-height: 1.9; white-space: pre-wrap; margin: 12px 0; padding: 12px 14px; background: var(--paper); border-radius: 4px; }
.notices { margin: 10px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); }
.notices li { padding: 4px 0 4px 10px; border-left: 2px solid var(--warn-rule); border-radius: 0; margin-bottom: 6px; }
.list-group { font-size: 11px; color: var(--ink-3); margin: 14px 0 4px; padding-bottom: 4px; border-bottom: 1px solid var(--rule); letter-spacing: .02em; }
.list-group.first { margin-top: 10px; }
.list-row { display: block; width: 100%; text-align: left; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 13px; }
.list-row:hover .t1 { text-decoration: underline; text-underline-offset: 3px; }
.list-row .t1 { color: var(--ink); }
.list-row .t2 { color: var(--ink-2); font-size: 12px; }
.list-row .t3 { color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.inline-ref { color: var(--case); }
.inline-ref.statute { color: var(--statute); }

/* ------------------------------------------------ 历史浮层与悬停卡 */
#history {
  position: fixed; top: 48px; left: 12px; width: 360px; max-height: 70vh; overflow-y: auto; z-index: 30;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px;
}
#history input { width: 100%; font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--rule); border-radius: 5px; background: var(--paper); margin-bottom: 6px; }
#history .group { font-size: 11px; color: var(--ink-3); margin: 10px 0 2px; }
#history .item { display: block; width: 100%; text-align: left; padding: 6px 0; font-size: 13px; border-bottom: 1px solid var(--rule); }
#history .item:hover .q { text-decoration: underline; text-underline-offset: 3px; }
#history .item .m { font-size: 11px; color: var(--ink-3); }
#tip {
  position: absolute; z-index: 40; max-width: 320px; background: var(--surface); border: 1px solid var(--rule-strong);
  border-radius: 6px; padding: 6px 10px; font-size: 12px; line-height: 1.55; color: var(--ink-2); pointer-events: none;
}
#tip b { color: var(--ink); font-weight: 500; }

/* ---------- 调整样本 ---------- */
.filters fieldset.levels { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 16px; border: 0; padding: 0; margin: 0; }
.filters fieldset.levels legend { font-size: 12px; color: var(--ink-2); padding: 0; margin-bottom: 4px; width: 100%; }
.section-head .adjust { margin-left: auto; }
.card .origin, .list-row .origin { color: var(--statute); }
.list-row .origin { font-size: 11px; margin-left: 8px; border: 1px solid var(--statute); border-radius: 3px; padding: 0 4px; }
.callout.refine { background: var(--case-bg); border-left-color: var(--case); margin-bottom: 12px; }
.callout.refine a { color: var(--case); text-decoration: none; }
.callout.refine a:hover { text-decoration: underline; }
.list-head { display: flex; align-items: baseline; gap: 8px; }
.list-head .spacer { flex: 1; }
.edit-hint { margin: 6px 0 2px; }
.list-row.editable { display: flex; gap: 10px; align-items: flex-start; }
.list-row.editable .pick { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--ink-3); padding-top: 2px; cursor: pointer; }
.list-row.editable .row-main { flex: 1; text-align: left; }
.list-row.editable .row-main:hover .t1 { text-decoration: underline; text-underline-offset: 3px; }
.list-row.editable:hover .t1 { text-decoration: none; }
.list-row.out .row-main { opacity: .45; }
.list-row.out .row-main .t1 { text-decoration: line-through; }
.list-row .warn { color: var(--warn-rule); }
.refine-panel { position: sticky; bottom: -40px; background: var(--paper); border-top: 1px solid var(--rule-strong); padding: 12px 0 46px; margin-bottom: -40px; margin-top: 8px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.refine-panel .levels { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.refine-panel .levels .meta { width: 100%; }
.refine-panel label.check { display: inline-flex; gap: 6px; align-items: center; }
.refine-panel .row { display: flex; align-items: center; gap: 8px; }
.refine-panel .spacer { flex: 1; }
.refine-panel .btn-primary[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- 基线：占比 / 低覆盖 ---------- */
.baseline .switch { display: flex; gap: 4px; margin: 6px 0 0; font-size: 12px; color: var(--ink-3); }
.baseline .switch button { color: var(--ink-3); padding: 0 4px; }
.baseline .switch button:first-of-type { padding-left: 0; }
.baseline .switch button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.baseline .switch .sep { color: var(--ink-4); }
/* 斜线填充用 CSS 设，避免被 .bar 的 fill 覆盖 */
.baseline svg .bar.low, .baseline svg .bar.low:hover { fill: url(#hatch-low); stroke: var(--ink-3); stroke-width: .8; }
.baseline svg .ci { stroke: var(--ink); stroke-width: 1; }
.baseline .legend i.hatch { background: repeating-linear-gradient(45deg, #fff 0 2px, #8A857C 2px 4px); border: 1px solid var(--ink-3); }
.baseline table tr.low td { color: var(--ink-3); }

/* ---------- 现行对应（草拟/已复核） ---------- */
.current-map { margin: 14px 0 4px; padding: 10px 12px; border: 1px dashed var(--rule-strong); border-radius: 6px; background: var(--surface); font-size: 13px; line-height: 1.75; }
.current-map .head { display: flex; align-items: baseline; gap: 8px; }
.current-map .head .spacer { flex: 1; }
.current-map .kind { font-size: 11px; color: var(--ink-2); border: 1px solid var(--rule-strong); border-radius: 3px; padding: 0 5px; }
.current-map.substantive .kind, .current-map.no_counterpart .kind { color: var(--alert); border-color: var(--alert); }
.current-map .review { font-size: 11px; color: var(--warn-rule); }
.current-map .review.ok { color: var(--ink-3); }
.current-map .target { color: var(--statute); margin-top: 2px; }
.current-map .summary { margin: 4px 0; color: var(--ink); }
.current-map details summary { cursor: pointer; font-size: 12px; color: var(--ink-2); }
.current-map .rules { margin: 6px 0 0; padding-left: 1.2em; color: var(--ink-2); font-size: 12px; }
.current-map .meta { margin: 6px 0 0; font-size: 11px; }

/* ---------- 邮箱身份认证（纸墨风弹窗与顶栏用户徽章） ---------- */
body.auth-open { overflow: hidden; }
.auth-user {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  font-size: 12px; color: var(--ink-2);
}
.auth-user .auth-email {
  max-width: 210px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  padding: 2px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--rule); color: var(--ink-2);
}
.auth-user .auth-logout { color: var(--ink-3); }
.auth-user .auth-logout:hover { color: var(--alert); }
@media (max-width: 640px) {
  .auth-user .auth-email { max-width: 120px; }
}

.auth-backdrop {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(28, 25, 23, 0.36);
  backdrop-filter: blur(3px);
}
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 10px;
  padding: 24px 24px 22px;
  box-shadow: 0 12px 36px rgba(28, 25, 23, 0.14);
}
.auth-title {
  margin: 0 0 4px; text-align: center; font-size: 20px; color: var(--ink);
}
.auth-sub { margin: 0 0 16px; text-align: center; }
.auth-tabs {
  display: flex; gap: 20px; margin-bottom: 16px; border-bottom: 1px solid var(--rule);
}
.auth-tabs button {
  padding: 0 2px 8px; margin-bottom: -1px; font-size: 14px; color: var(--ink-3);
  border-bottom: 2px solid transparent; border-radius: 0;
}
.auth-tabs button:hover { color: var(--ink); }
.auth-tabs button[aria-selected="true"] {
  color: var(--ink); font-weight: 500; border-bottom-color: var(--case);
}
.auth-error {
  margin: 0 0 12px; padding: 8px 10px; border-radius: 6px;
  border: 1px solid rgba(155, 44, 44, 0.28); background: #FDF2F2;
  color: var(--alert); font-size: 12.5px; line-height: 1.5;
}
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--ink-2); }
.auth-form .field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.auth-form input {
  width: 100%; font: inherit; font-size: 14px; padding: 8px 10px;
  border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--ink);
}
.auth-form input:focus { border-color: var(--case); background: var(--surface); }
.auth-submit { width: 100%; margin-top: 4px; padding: 9px 14px; font-size: 14px; }
.auth-submit[disabled] { opacity: .65; cursor: progress; }
