/* CPTAIN design system — matched to the lekhanam medical-coding reference UI.
   Blue clinical theme: light blue-gray canvas, white cards, #2B6BE4 primary. */

:root {
  --canvas: #EEF2F9;
  --surface: #FFFFFF;
  --rule: #E4E9F2;
  --rule-strong: #D3DAE8;
  --ink: #1B2A4A;
  --ink-soft: #4A5A78;
  --muted: #8592AB;
  --blue: #2B6BE4;
  --blue-deep: #1D53BC;
  --blue-soft: #E8EFFC;
  --blue-ghost: #F4F7FD;
  --green: #12915E;
  --green-soft: #DFF5EA;
  --red: #C6392F;
  --red-soft: #FBE7E5;
  --amber: #8A5A00;
  --amber-soft: #FBF0DA;
  --purple: #6D4FC4;
  --purple-soft: #EDE9FB;
  /* entity highlight tints (coder legend) */
  --hl-symptom: #FDF0C2;
  --hl-finding: #D3F2DF;
  --hl-diagnosis: #DCE7FB;
  --hl-medication: #E9E2F9;
  --hl-negation: #FBDDE4;
  --hl-anatomy: transparent;
  --hl-measurement: #EFEAF9;
  --hl-procedure: #E9EEF5;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(27, 42, 74, .05), 0 4px 18px rgba(27, 42, 74, .06);
  --sidebar-w: 232px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
}
a { color: var(--blue-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { letter-spacing: -.015em; margin: 0 0 10px; }
code, .mono { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; font-size: .92em; }

/* ---------- Shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 20px;
  height: 62px; padding: 0 22px;
  background: var(--surface); border-bottom: 1px solid var(--rule);
}
.brand { display: flex; flex-direction: column; line-height: 1.1; min-width: 170px; }
.brand .mark { font-weight: 800; font-size: 1.35rem; color: var(--blue); letter-spacing: -.02em; }
.brand .mark span { color: var(--ink); }
.brand small { color: var(--muted); font-size: .72rem; font-weight: 600; letter-spacing: .04em; }

.tabstrip { display: flex; align-items: center; gap: 6px; margin: 0 auto; }
.tabstrip a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 99px;
  color: var(--ink-soft); font-weight: 600; font-size: .92rem;
  border-bottom: 2px solid transparent;
}
.tabstrip a:hover { background: var(--blue-ghost); text-decoration: none; }
.tabstrip a .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: #E7ECF5; color: var(--ink-soft); font-size: .75rem; font-weight: 700;
}
.tabstrip a.active { color: var(--blue); }
.tabstrip a.active .num { background: var(--blue); color: #fff; }

.top-right { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.icon-btn { position: relative; background: none; border: none; cursor: pointer; color: var(--ink-soft); font-size: 1.1rem; }
.icon-btn .dot {
  position: absolute; top: -6px; right: -8px; background: var(--red); color: #fff;
  border-radius: 99px; font-size: .62rem; font-weight: 700; padding: 1px 5px;
}
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--blue-soft); color: var(--blue-deep);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem;
}
.user-chip .who { display: flex; flex-direction: column; line-height: 1.15; text-align: right; }
.user-chip .who b { font-size: .88rem; }
.user-chip .who small { color: var(--muted); font-size: .74rem; }

.shell { display: flex; min-height: calc(100vh - 62px); }
.sidenav {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--rule);
  padding: 18px 12px; position: sticky; top: 62px; height: calc(100vh - 62px);
  display: flex; flex-direction: column;
}
.ws-label { font-size: .68rem; font-weight: 700; letter-spacing: .09em; color: var(--muted); text-transform: uppercase; padding: 0 10px 6px; }
.ws-switch {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; margin-bottom: 16px;
  border: 1px solid var(--rule); border-radius: var(--radius); font-weight: 600; font-size: .9rem;
  background: var(--blue-ghost);
}
.sidenav nav { display: flex; flex-direction: column; gap: 2px; }
.sidenav nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: var(--radius); color: var(--ink-soft); font-weight: 600; font-size: .93rem;
  border-left: 3px solid transparent;
}
.sidenav nav a:hover { background: var(--blue-ghost); text-decoration: none; }
.sidenav nav a.active { background: var(--blue-soft); color: var(--blue-deep); border-left-color: var(--blue); }
.sidenav nav a .count {
  margin-left: auto; background: #E7ECF5; color: var(--ink-soft);
  border-radius: 99px; padding: 1px 9px; font-size: .74rem; font-weight: 700;
}
.sidenav nav a.active .count { background: var(--blue); color: #fff; }
.sidenav .foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 14px; border-top: 1px solid var(--rule); }
.sidenav .foot a { display: flex; gap: 10px; padding: 9px 12px; border-radius: var(--radius); color: var(--ink-soft); font-size: .9rem; }

.main { flex: 1; padding: 24px 28px 70px; max-width: 1440px; }

/* ---------- Cards, grids, tables ---------- */
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card h3 { font-size: 1.02rem; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .cols-3, .cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }

table.ck { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.ck th {
  text-align: left; font-size: .7rem; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--rule-strong);
  white-space: nowrap;
}
table.ck td { padding: 11px 10px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
table.ck tbody tr:last-child td { border-bottom: none; }
table.ck tbody tr { transition: background .12s ease; }
table.ck tbody tr:hover td { background: var(--blue-ghost); }
table.ck th a { color: var(--muted); }
table.ck th a:hover { color: var(--blue-deep); text-decoration: none; }
table.ck th a.sorted { color: var(--blue-deep); }

.stat .k { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stat .v { font-size: 1.85rem; font-weight: 800; letter-spacing: -.02em; }
.stat .d { color: var(--muted); font-size: .82rem; }

.bar-row { display: grid; grid-template-columns: 150px 1fr 64px; align-items: center; gap: 10px; margin: 7px 0; font-size: .86rem; }
.bar-track { background: var(--canvas); border-radius: 99px; height: 12px; overflow: hidden; }
.bar-fill { background: var(--blue); height: 100%; border-radius: 99px; }
.bar-fill.green { background: var(--green); }
.bar-fill.red { background: var(--red); }
.bar-val { text-align: right; font-family: ui-monospace, monospace; font-size: .8rem; }

/* ---------- Badges & buttons ---------- */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 99px;
  font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
}
.badge.blue { background: var(--blue-soft); color: var(--blue-deep); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.slate { background: #E7ECF5; color: var(--ink-soft); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: var(--radius); border: 1px solid var(--rule-strong);
  background: var(--surface); color: var(--ink-soft);
  padding: 9px 16px; font-weight: 600; font-size: .9rem; cursor: pointer;
  font-family: inherit;
}
.btn:hover { border-color: var(--blue); color: var(--blue-deep); text-decoration: none; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-deep); color: #fff; }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-green:hover { background: #0d7a4e; color: #fff; }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); }
.btn-sm { padding: 5px 11px; font-size: .8rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Forms ---------- */
label.ck { display: block; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 5px; }
input.ck, select.ck, textarea.ck {
  width: 100%; padding: 9px 12px; border: 1px solid var(--rule-strong); border-radius: var(--radius);
  font-family: inherit; font-size: .92rem; color: var(--ink); background: var(--surface);
}
input.ck:focus, select.ck:focus, textarea.ck:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.field { margin-bottom: 14px; }
.help { color: var(--muted); font-size: .8rem; }

.flash { padding: 11px 16px; border-radius: var(--radius); margin-bottom: 14px; font-size: .9rem; font-weight: 500; }
.flash.success { background: var(--green-soft); color: var(--green); }
.flash.error { background: var(--red-soft); color: var(--red); }
.flash.info { background: var(--blue-soft); color: var(--blue-deep); }

/* ---------- Case view ---------- */
.case-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.case-head .crumb { color: var(--muted); font-weight: 600; }
.case-head .case-no { font-weight: 800; font-size: 1.15rem; }
.case-actions { margin-left: auto; display: flex; gap: 9px; flex-wrap: wrap; }

.meta-strip { display: flex; gap: 0; flex-wrap: wrap; padding: 12px 8px; }
.meta-strip .item { display: flex; align-items: center; gap: 9px; padding: 2px 22px; }
.meta-strip .item + .item { border-left: 1px solid var(--rule); }
.meta-strip .glyph { color: var(--muted); }
.meta-strip .kv { display: flex; flex-direction: column; line-height: 1.2; }
.meta-strip .kv small { color: var(--muted); font-size: .72rem; font-weight: 600; }
.meta-strip .kv b { font-family: ui-monospace, monospace; font-size: .88rem; font-weight: 600; }

.case-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1080px) { .case-grid { grid-template-columns: 1fr; } }

.doc-tabs, .panel-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin-bottom: 14px; }
.doc-tabs button, .panel-tabs button {
  background: none; border: none; padding: 9px 16px; cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: .92rem; color: var(--ink-soft);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.doc-tabs button.active, .panel-tabs button.active { color: var(--blue); border-bottom-color: var(--blue); }

.doc-body { max-height: 72vh; overflow-y: auto; padding-right: 6px; }
.doc-section { margin-bottom: 18px; }
.doc-section h5 {
  font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink); margin: 0 0 6px; display: flex; align-items: center; gap: 8px;
}
.doc-section h5::before { content: ''; width: 3px; height: 12px; border-radius: 2px; background: var(--blue); opacity: .55; }
.doc-section.missing h5::before { background: var(--red); }
.doc-section .body { white-space: pre-wrap; font-size: .92rem; }
.doc-section.missing { border-left: 3px solid var(--red); padding-left: 12px; background: #FFF9F9; border-radius: 6px; padding-top: 8px; padding-bottom: 8px; }
.doc-section.missing .why { color: var(--red); font-size: .82rem; }

mark.ent { border-radius: 3px; padding: 0 2px; color: inherit; background: transparent; }
mark.ent-symptom { background: var(--hl-symptom); }
mark.ent-finding { background: var(--hl-finding); }
mark.ent-diagnosis { background: var(--hl-diagnosis); }
mark.ent-medication { background: var(--hl-medication); }
mark.ent-negation { background: var(--hl-negation); }
mark.ent-measurement { background: var(--hl-measurement); font-family: ui-monospace, monospace; font-size: .9em; }
mark.ent-anatomy { background: var(--hl-anatomy); border-bottom: 1px dotted var(--ink-soft); }
mark.ent-procedure { background: var(--hl-procedure); }
mark.ent-suppressed { text-decoration: line-through; opacity: .62; }

.ent-legend { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; padding-top: 12px; margin-top: 6px; border-top: 1px solid var(--rule); font-size: .78rem; color: var(--ink-soft); }
.ent-legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.ent-legend .sw-anatomy { border-bottom: 2px dotted var(--ink-soft); border-radius: 0; height: 9px; }

.diff-summary { margin: 0 0 10px; padding: 8px 12px 8px 26px; background: var(--amber-soft);
                border-radius: 8px; font-size: .82rem; color: var(--amber); }
.diff-summary li { margin: 2px 0; }
.diff-summary:empty { display: none; }
.pii-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .8rem; padding: 10px 0 0; }

/* coding panel */
.code-field { margin-bottom: 20px; }
.code-field .fhead { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.code-field .fhead h4 { margin: 0; font-size: .95rem; }
.picker { display: flex; gap: 8px; }
.picker .pick-wrap { position: relative; flex: 1; }
.picker input { width: 100%; padding: 9px 12px; border: 1px solid var(--rule-strong); border-radius: var(--radius); font-family: inherit; font-size: .9rem; }
.picker input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.pick-menu {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius);
  box-shadow: var(--shadow); max-height: 240px; overflow-y: auto; display: none;
}
.pick-menu.open { display: block; }
.pick-menu .opt { padding: 8px 12px; cursor: pointer; font-size: .87rem; display: flex; gap: 9px; }
.pick-menu .opt:hover { background: var(--blue-ghost); }
.pick-menu .opt b { font-family: ui-monospace, monospace; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 9px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--blue-soft); color: var(--blue-deep);
  border-radius: 99px; padding: 4px 7px 4px 12px; font-size: .84rem; font-weight: 600;
}
.chip.primary-chip { background: var(--blue); color: #fff; }
.chip .x { cursor: pointer; border: none; background: rgba(255,255,255,.35); color: inherit; border-radius: 50%; width: 17px; height: 17px; line-height: 1; font-size: .72rem; font-weight: 700; }
.chip .x:hover { background: rgba(0,0,0,.15); }

.rec-box {
  margin-top: 9px; padding: 11px 14px; border-radius: var(--radius);
  background: #F2FBF6; border: 1px solid #D5EFE1; font-size: .86rem;
}
.rec-box .rline { font-weight: 600; color: var(--green); }
.rec-box .rline b { font-family: ui-monospace, monospace; }
.rec-box .why { color: var(--ink-soft); margin-top: 3px; }
.rec-box .accept { margin-top: 7px; }
.rec-box.none { background: var(--blue-ghost); border-color: var(--rule); }
.rec-box.none .rline { color: var(--ink-soft); }
.rec-box.warn { background: var(--amber-soft); border-color: #EED9A9; }
.rec-box.warn .rline { color: var(--amber); }

.ncci-box { padding: 12px 14px; border-radius: var(--radius); font-size: .86rem; }
.ncci-box.clean { background: var(--green-soft); color: var(--green); font-weight: 600; }
.ncci-box.conflicts { background: var(--red-soft); color: var(--red); }

.withheld-list { font-size: .84rem; color: var(--ink-soft); }
.withheld-list li { margin-bottom: 6px; }
.withheld-list .code { font-family: ui-monospace, monospace; font-weight: 700; }

/* dropdown menu (save & submit) */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 210px;
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius);
  box-shadow: var(--shadow); display: none; overflow: hidden;
}
.menu.open { display: block; }
.menu button, .menu a { display: block; width: 100%; text-align: left; padding: 10px 15px; border: none; background: none; font-family: inherit; font-size: .9rem; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.menu button:hover, .menu a:hover { background: var(--blue-ghost); text-decoration: none; }

/* proposal cards (learning loop) */
.proposal-card { border-left: 4px solid var(--blue); }
.proposal-card .q { white-space: pre-wrap; background: var(--blue-ghost); padding: 13px 16px; border-radius: var(--radius); font-size: .92rem; margin: 10px 0; }
.proposal-card .ev { display: flex; gap: 18px; flex-wrap: wrap; color: var(--ink-soft); font-size: .84rem; }
.proposal-card .ev b { color: var(--ink); }

/* checkbox column */
td.sel, th.sel { width: 34px; }

/* ---------- Landing page ---------- */
.lp { background: var(--surface); color: var(--ink); }
.lp-nav { display: flex; align-items: center; max-width: 1080px; margin: 0 auto; padding: 20px 24px; }
.lp-nav .links { margin-left: auto; display: flex; gap: 20px; align-items: center; }
.lp section { max-width: 1080px; margin: 0 auto; padding: 56px 24px; }
.lp .eyebrow { display: inline-block; background: var(--blue-soft); color: var(--blue-deep); font-weight: 700; font-size: .78rem; padding: 4px 14px; border-radius: 99px; letter-spacing: .03em; margin-bottom: 18px; }
.lp h1 { font-size: 2.7rem; line-height: 1.12; letter-spacing: -.03em; margin-bottom: 18px; max-width: 800px; }
.lp .sub { font-size: 1.12rem; color: var(--ink-soft); max-width: 720px; margin-bottom: 26px; }
.lp .cta-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.lp .friction { color: var(--muted); font-size: .85rem; margin-top: 10px; }
.lp .proof-strip { display: flex; gap: 34px; flex-wrap: wrap; margin-top: 44px; padding-top: 26px; border-top: 1px solid var(--rule); }
.lp .proof-strip .p b { display: block; font-size: 1.5rem; letter-spacing: -.02em; }
.lp .proof-strip .p span { color: var(--muted); font-size: .84rem; }
.lp h2 { font-size: 1.75rem; letter-spacing: -.025em; max-width: 760px; }
.lp .band { background: var(--canvas); }
.lp .cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 30px; }
@media (max-width: 860px) { .lp .cols { grid-template-columns: 1fr; } .lp h1 { font-size: 2rem; } }
.lp .step-num { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #fff; align-items: center; justify-content: center; font-weight: 800; margin-bottom: 10px; }
.lp .faq details { border-bottom: 1px solid var(--rule); padding: 14px 0; }
.lp .faq summary { font-weight: 700; cursor: pointer; }
.lp .faq p { color: var(--ink-soft); }
.lp footer { border-top: 1px solid var(--rule); padding: 26px 24px; text-align: center; color: var(--muted); font-size: .85rem; }
.lp .final-cta { text-align: center; }
.lp .old-new { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 26px; }
@media (max-width: 760px) { .lp .old-new { grid-template-columns: 1fr; } }
.lp .old-new .old { border-left: 4px solid var(--red); }
.lp .old-new .new { border-left: 4px solid var(--green); }

/* ---------- Login ---------- */
.login-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.login-art {
  background: linear-gradient(155deg, var(--blue-deep), var(--blue) 60%, #4C86F0);
  color: #fff; padding: 54px; display: flex; flex-direction: column; justify-content: space-between;
}
.login-art .mark { font-weight: 800; font-size: 1.6rem; }
.login-art .tagline { font-size: 1.5rem; line-height: 1.3; letter-spacing: -.02em; max-width: 420px; font-weight: 700; }
.login-art .points { opacity: .92; font-size: .95rem; line-height: 2; }
.login-form-side { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--canvas); }
.login-card { width: 100%; max-width: 400px; }
@media (max-width: 860px) { .login-wrap { grid-template-columns: 1fr; } .login-art { display: none; } }
.cred-box { border: 1.5px dashed var(--rule-strong); border-radius: var(--radius); padding: 12px 15px; font-family: ui-monospace, monospace; font-size: .8rem; color: var(--ink-soft); margin-top: 18px; }

/* ---------- Icons (inline SVG) ---------- */
.ico { width: 17px; height: 17px; flex-shrink: 0; vertical-align: -3px; }
.sidenav .ico, .tabstrip .ico { width: 16px; height: 16px; }

/* ---------- Consent bar (GDPR) ---------- */
.consent-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap;
  background: var(--ink); color: #fff; padding: 12px 20px; font-size: .84rem;
}
.consent-bar a { color: #A9C4F5; }
.consent-bar .consent-actions { display: flex; gap: 8px; }
.consent-bar .btn { border-color: transparent; }

/* ---------- Toolbar / filters ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search-wrap { position: relative; flex: 1; min-width: 220px; max-width: 340px; }
.toolbar .search-wrap .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.toolbar .search-wrap input { padding-left: 36px; }

/* ---------- Empty states ---------- */
.empty {
  text-align: center; padding: 42px 20px; color: var(--muted);
}
.empty .glyph { font-size: 1.9rem; display: block; margin-bottom: 8px; opacity: .5; }
.empty b { color: var(--ink-soft); display: block; margin-bottom: 3px; }

/* ---------- Document chrome (case view) ---------- */
.doc-chrome {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 8px 12px; margin-bottom: 14px; background: var(--blue-ghost);
}
.doc-chrome .doc-chip { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; color: var(--blue-deep); }
.doc-chrome .pager { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .84rem; }
.doc-chrome button { background: none; border: none; cursor: pointer; color: var(--ink-soft); font-size: .95rem; padding: 2px 6px; border-radius: 6px; }
.doc-chrome button:hover { background: var(--blue-soft); color: var(--blue-deep); }
.doc-card.expanded { position: fixed; inset: 24px; z-index: 80; overflow: auto; box-shadow: 0 12px 60px rgba(16,32,43,.35); }
.doc-card.expanded .doc-body { max-height: none; }

/* ---------- Second reader ---------- */
.second-read-box { margin-top: 10px; }
.second-read-result { margin-top: 9px; padding: 11px 14px; border-radius: var(--radius); background: var(--purple-soft); font-size: .85rem; }
.second-read-result .verdict-agree { color: var(--green); font-weight: 700; }
.second-read-result .verdict-object { color: var(--red); font-weight: 700; }
.spinning { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Tables: sticky header, density ---------- */
.table-scroll { overflow-x: auto; }
table.ck thead th { position: sticky; top: 0; background: var(--surface); z-index: 2; }
table.ck td { font-size: .88rem; }
tr.row-click { cursor: pointer; }

/* ---------- Buttons/inputs focus ---------- */
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 1px;
}
.btn:active { transform: translateY(1px); }

/* ---------- Page headers ---------- */
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 1.35rem; }
.page-head .sub { color: var(--muted); font-size: .88rem; width: 100%; margin-top: -6px; }
.page-head .spacer { margin-left: auto; }

/* legal pages */
.legal-body h3 { margin-top: 26px; font-size: 1.05rem; }
.legal-body p, .legal-body li { color: var(--ink-soft); }

/* misc */
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt { margin-top: 16px; }
.mb0 { margin-bottom: 0; }
.flex { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.section-title { display: flex; align-items: baseline; gap: 12px; margin: 26px 0 14px; }
.section-title h2 { margin: 0; font-size: 1.25rem; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }
details.fold summary { cursor: pointer; font-weight: 600; color: var(--ink-soft); }
