/* LabourOne.Plus portal. Flat, calm, fast. Tokens first, then layout, then parts. */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/fonts/plus-jakarta-sans.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --bg: #f5f7f9; --surface: #ffffff; --surface-2: #eef2f5; --ink: #0f1c2a; --muted: #566575; --line: #e1e7ed;
  --brand: #0d6b68; --brand-strong: #0a5452; --brand-soft: #e2f3f1; --on-brand: #ffffff;
  --accent: #f2b705; --danger: #b93221; --danger-soft: #fdecea;
  --warn-bg: #fff6df; --warn-ink: #5f4200; --warn-line: #ecd9a3;
  --side: #0b2230; --side-ink: #b9c9d4; --side-ink-strong: #ffffff; --side-active: #16384a; --side-line: #1b3a4b;
  --mark: #ffe9a3; --scrim: rgba(8, 18, 26, .5);
  --soft: var(--brand-soft); /* older name, used by forms.css */
  --radius: 14px; --radius-sm: 10px;
  --ease: cubic-bezier(.2, .7, .3, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0a141b; --surface: #111e27; --surface-2: #182a35; --ink: #e9eff4; --muted: #9db0be; --line: #233743;
  --brand: #46c8bd; --brand-strong: #6fdad0; --brand-soft: #113238; --on-brand: #06211f;
  --danger: #ff8a78; --danger-soft: #3a1b17;
  --warn-bg: #33290f; --warn-ink: #f6dc97; --warn-line: #5a4a1c;
  --side: #071118; --side-active: #12303d; --side-line: #132833;
  --mark: #6b5400; --scrim: rgba(0, 0, 0, .62);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 "Plus Jakarta Sans", system-ui, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.015em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { color: var(--brand); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); font-size: 14px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
svg.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100dvh; }
.side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; padding: 18px 12px 14px; position: sticky; top: 0; height: 100dvh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: var(--side-ink-strong); font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.brand .dot { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: #1c1500; display: grid; place-items: center; font-size: 15px; font-weight: 800; }
.brand span span { color: var(--accent); }
.brand small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--side-ink); margin-top: 1px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 9px 12px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--side-ink); font-weight: 600; font-size: 15px; text-align: left; transition: background .16s var(--ease), color .16s var(--ease); }
.nav button:hover { background: var(--side-active); color: var(--side-ink-strong); }
.nav button[aria-current="page"] { background: var(--side-active); color: var(--side-ink-strong); box-shadow: inset 3px 0 0 var(--accent); }
.nav .count { margin-left: auto; font-size: 12px; font-weight: 700; background: var(--side-line); color: var(--side-ink-strong); border-radius: 999px; padding: 1px 8px; }
.sidefoot { margin-top: auto; display: grid; gap: 10px; padding: 12px 6px 0; border-top: 1px solid var(--side-line); }
.sidefoot p { margin: 0; font-size: 12px; line-height: 1.45; color: var(--side-ink); }
.ghost { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 12px; border-radius: var(--radius-sm); border: 1px solid var(--side-line); background: transparent; color: var(--side-ink-strong); font-weight: 600; font-size: 14px; }
.ghost:hover { background: var(--side-active); }

.mainwrap { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 12px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top h1 { font-size: 20px; font-weight: 700; }
.searchbtn { margin-left: auto; display: flex; align-items: center; gap: 10px; min-height: 42px; width: min(360px, 46vw); padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 14px; text-align: left; }
.searchbtn:hover { border-color: var(--brand); }
.searchbtn kbd { margin-left: auto; font: 600 11px/1 inherit; border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; color: var(--muted); }
main { padding: 26px 28px 60px; max-width: 1080px; width: 100%; margin: 0 auto; }
main > section { animation: rise .22s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- shared parts ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 650; font-size: 15px; transition: background .16s var(--ease), border-color .16s var(--ease), transform .12s var(--ease); }
.btn:hover { border-color: var(--brand); }
.btn:active { transform: scale(.98); }
.btn.primary, button.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover, button.primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn.small { min-height: 36px; padding: 5px 14px; font-size: 14px; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.field { width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
.field:hover { border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); }
.field::placeholder { color: var(--muted); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 26px 0 10px; }
.tag { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); margin-right: 8px; white-space: nowrap; }
.tag.act { background: var(--brand-soft); color: var(--brand); }
.tag.amendment { background: var(--warn-bg); color: var(--warn-ink); }
.tag.form { background: color-mix(in srgb, #6d5ae6 16%, var(--surface)); color: color-mix(in srgb, #6d5ae6 70%, var(--ink)); }
.flag { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; margin-top: 12px; }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty svg.ic { width: 34px; height: 34px; margin-bottom: 8px; color: var(--brand); }
.empty h3 { color: var(--ink); font-size: 17px; margin-bottom: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 36px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 550; transition: background .16s var(--ease), border-color .16s var(--ease); }
.chip:hover { border-color: var(--brand); }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.rows li + li { border-top: 1px solid var(--line); }
.rows li.group { padding: 10px 16px; background: var(--surface-2); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rows button { display: block; width: 100%; min-height: 46px; text-align: left; background: none; border: 0; padding: 11px 16px; overflow-wrap: anywhere; transition: background .14s var(--ease); }
.rows button:hover { background: var(--surface-2); }
.rows .snip { color: var(--muted); font-size: 13.5px; margin-top: 2px; }

/* ---------- ask ---------- */
.hero { padding: 26px 0 6px; }
.hero h2 { font-size: clamp(26px, 4vw, 38px); font-weight: 800; letter-spacing: -.03em; }
.hero h2 em { font-style: normal; color: var(--brand); }
.hero p { margin: 8px 0 0; color: var(--muted); max-width: 60ch; }
.composer { margin-top: 20px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 20px; padding: 14px 14px 12px 18px; transition: border-color .16s var(--ease); }
.composer:focus-within { border-color: var(--brand); }
.composer textarea { display: block; width: 100%; min-height: 62px; max-height: 240px; resize: none; border: 0; outline: 0; background: transparent; font-size: 17px; line-height: 1.5; }
.composer .bar { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.composer .bar .muted { flex: 1; min-width: 0; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.quick button { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); min-height: 76px; transition: border-color .16s var(--ease), transform .12s var(--ease); }
.quick button:hover { border-color: var(--brand); }
.quick button:active { transform: scale(.985); }
.quick .qi { width: 38px; height: 38px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.quick strong { display: block; font-size: 15px; }
.quick span span { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; margin-top: 2px; }
.thread { display: grid; gap: 18px; margin-top: 24px; }
.qa .q { display: inline-block; background: var(--brand); color: var(--on-brand); padding: 10px 16px; border-radius: 18px 18px 18px 6px; font-weight: 600; max-width: 90%; }
.qa .a { margin-top: 10px; }
.answer { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16.5px; line-height: 1.65; }
.cite { display: inline-flex; align-items: center; background: var(--brand-soft); color: var(--brand); border: 0; border-radius: 999px; font-size: 12px; font-weight: 700; padding: 1px 9px; margin: 0 3px; white-space: nowrap; vertical-align: 1px; }
.cite:hover { background: var(--brand); color: var(--on-brand); }
.subhead { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; min-height: 36px; padding: 5px 12px 5px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; text-align: left; }
.pill:hover { border-color: var(--brand); }
.pill .tag { margin-right: 8px; }
details.more { margin-top: 12px; }
details.more summary { cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 600; min-height: 32px; }
.skel { display: grid; gap: 10px; }
.skel i { display: block; height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; }
.skel i:nth-child(2) { width: 92%; } .skel i:nth-child(3) { width: 78%; } .skel i:nth-child(4) { width: 55%; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---------- law, forms, saved, sources ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.toolbar > * { flex: 1 1 240px; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.formcard { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 14px 16px; min-height: 96px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); transition: border-color .16s var(--ease), transform .12s var(--ease); }
.formcard:hover { border-color: var(--brand); }
.formcard:active { transform: scale(.985); }
.formcard .code { align-self: flex-start; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; color: var(--brand); background: var(--brand-soft); border-radius: 7px; padding: 2px 8px; }
.formcard strong { font-size: 15px; line-height: 1.3; font-weight: 650; }
.formcard .meta { margin-top: auto; font-size: 12.5px; color: var(--muted); }
.formcard a { font-size: 12.5px; }
.savedlist { display: grid; gap: 10px; }
.saved { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.saved .info { flex: 1 1 260px; min-width: 0; }
.saved .info strong { display: block; overflow-wrap: anywhere; }
.saved .info span { color: var(--muted); font-size: 13.5px; }
.sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.source h3 { font-size: 15.5px; margin: 8px 0 6px; }
.source p { margin: 0; font-size: 14px; color: var(--muted); }
.source .meta { margin-top: 10px; font-size: 13px; font-weight: 600; }

/* ---------- coach ---------- */
.guidegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin: 14px 0; }
.guidecard { display: flex; gap: 14px; align-items: flex-start; text-align: left; padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); transition: border-color .16s var(--ease), transform .12s var(--ease); }
.guidecard:hover { border-color: var(--brand); }
.guidecard:active { transform: scale(.99); }
.guidecard .qi { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.guidecard strong { display: block; font-size: 17px; }
.guidecard .gsum { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; }
.guidecard .gmeta { display: block; font-size: 12.5px; font-weight: 700; color: var(--brand); margin-top: 10px; }
.guidetools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.guidehead h2 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 800; letter-spacing: -.025em; }
.guidehead p { margin: 8px 0 0; max-width: 70ch; }
.progressrow { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.progress { flex: 1; max-width: 360px; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .25s var(--ease); }
.guidenotes { margin: 16px 0; padding: 12px 16px; border-left: 4px solid var(--accent); background: var(--warn-bg); color: var(--warn-ink); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 14.5px; }
.guidenotes p { margin: 5px 0; }
.phasetabs { position: sticky; top: 67px; z-index: 5; background: var(--bg); padding: 10px 0; margin-bottom: 4px; }
#coachPhase { scroll-margin-top: 130px; }
.phasetitle { font-size: 20px; font-weight: 800; margin: 14px 0 4px; }
.step { margin-top: 12px; padding: 16px 18px; }
.step.done { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.stephead { display: flex; align-items: flex-start; gap: 12px; cursor: default; }
label.stephead { cursor: pointer; }
.stephead input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--brand); cursor: pointer; }
.stephead h4 { margin: 0; font-size: 16.5px; font-weight: 700; line-height: 1.35; }
.step.done .stephead h4 { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.points { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.pt { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 12px; align-items: start; font-size: 15px; line-height: 1.5; }
.pt .kind { justify-self: start; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; white-space: nowrap; margin-top: 1px; }
.pt.law .kind { background: var(--brand-soft); color: var(--brand); }
.pt.practice .kind { background: var(--surface-2); color: var(--muted); }
.pt.warning .kind { background: var(--warn-bg); color: var(--warn-ink); }
.lawref { border: 0; background: none; padding: 0; color: var(--brand); font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.stepactions { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.phasenav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.print-only { display: none; }
@media (max-width: 900px) {
  .pt { grid-template-columns: 1fr; gap: 4px; }
  .phasetabs { top: 61px; }
}

/* ---------- sign in and account ---------- */
.login { position: fixed; inset: 0; z-index: 60; background: var(--side); display: grid; place-items: center; padding: 20px; overflow: auto; }
.logincard { width: min(420px, 100%); background: var(--surface); color: var(--ink); border-radius: 22px; padding: 30px 28px 22px; animation: rise .22s var(--ease); }
.loginbrand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; margin-bottom: 22px; }
.loginbrand .dot { width: 32px; height: 32px; border-radius: 10px; background: var(--accent); color: #1c1500; display: grid; place-items: center; font-size: 15px; }
.loginbrand span span { color: var(--brand); }
.logincard h2 { font-size: 24px; font-weight: 800; }
.logincard p.muted { margin: 8px 0 18px; font-size: 15px; }
.logincard form { display: grid; gap: 8px; }
.logincard label { font-size: 13.5px; font-weight: 650; }
.logincard .btn { width: 100%; margin-top: 6px; text-decoration: none; }
.logincard .field.code { font-size: 26px; letter-spacing: .32em; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.or { display: flex; align-items: center; gap: 12px; margin: 16px 0 10px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.linkish { margin-top: 14px; background: none; border: 0; padding: 6px 0; min-height: 36px; color: var(--brand); font-weight: 650; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.loginmsg { min-height: 22px; margin: 12px 0 0; color: var(--danger); font-size: 14px; font-weight: 600; }
.loginmsg.ok { color: var(--brand); }
.loginfoot { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.acctbtn { width: 100%; text-align: left; }
.acctbtn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acctmenu { position: fixed; z-index: 45; left: 12px; bottom: 206px; width: 270px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); animation: rise .16s var(--ease); }
.acctmenu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.acctmenu .who strong { display: block; overflow-wrap: anywhere; }
.acctmenu .who span { color: var(--muted); font-size: 13px; }
.acctmenu .lbl { padding: 8px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.acctmenu button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 42px; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 9px; font-weight: 600; font-size: 14.5px; }
.acctmenu button:hover { background: var(--surface-2); }
.acctmenu button[aria-current="true"] { color: var(--brand); }
.acctmenu button.out { color: var(--danger); }
@media (max-width: 900px) { .acctmenu { left: auto; right: 12px; bottom: auto; top: 62px; } }

/* ---------- admin screens ---------- */
.brand.hastenant { flex-direction: column; align-items: flex-start; gap: 8px; }
.tenantlogo { max-width: 190px; max-height: 60px; background: #fff; border-radius: 10px; padding: 6px 8px; }
.poweredby { font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--side-ink); }
.subtabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.panel { max-width: 760px; }
.panel h2 { font-size: 20px; font-weight: 800; }
.panel > p.muted { margin: 6px 0 16px; }
.formgridc { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 16px; }
.fieldrow { display: grid; gap: 6px; }
.fieldrow.wide { grid-column: 1 / -1; }
.fieldrow label { font-size: 13.5px; font-weight: 650; }
.fieldrow small { color: var(--muted); font-size: 12.5px; }
textarea.field { min-height: 84px; resize: vertical; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.status { font-size: 14px; font-weight: 600; color: var(--brand); }
.status.err { color: var(--danger); }
.logobox { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; padding: 18px; border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.logoprev { width: 240px; height: 100px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); color: #777; font-size: 13px; }
.logoprev img { max-width: 220px; max-height: 84px; }
.iconprev { width: 48px; height: 48px; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; }
.iconprev img { width: 32px; height: 32px; }
.tablecard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.tablecard table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.tablecard th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; background: var(--surface-2); white-space: nowrap; }
.tablecard td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.tablecard td.num, .tablecard th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tablecard .rowact { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.badge { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--brand-soft); color: var(--brand); }
.badge.off { background: var(--danger-soft); color: var(--danger); }
.badge.wait { background: var(--warn-bg); color: var(--warn-ink); }
.inlineform { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 14px 0 18px; }
.inlineform .fieldrow { flex: 1 1 220px; }
.inlineform select.field { min-width: 150px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { padding: 16px; }
.stat b { display: block; font-size: 28px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13.5px; }

/* ---------- drawer (law text) ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(560px, 100vw); background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column; animation: slide .22s var(--ease); }
@keyframes slide { from { transform: translateX(28px); opacity: 0; } }
.drawerhead { display: flex; gap: 12px; align-items: flex-start; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.drawerhead h2 { font-size: 18px; flex: 1; }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; flex: none; color: var(--ink); }
.iconbtn:hover { border-color: var(--brand); }
.drawerbody { padding: 14px 20px 40px; overflow: auto; }
.drawerbody pre, #edLawBody pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 16px/1.65 Georgia, "Times New Roman", serif; margin: 12px 0 0; color: var(--ink); }
mark { background: var(--mark); color: inherit; padding: 1px 2px; border-radius: 3px; }
.amend { border-left: 4px solid var(--accent); background: var(--warn-bg); color: var(--warn-ink); padding: 12px 14px; margin-top: 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.amend h3 { font-size: 14px; }
.amend pre { color: inherit; }

/* ---------- search palette ---------- */
.palette { position: fixed; z-index: 51; top: 9vh; left: 50%; transform: translateX(-50%); width: min(640px, calc(100vw - 24px)); max-height: 76vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; animation: rise .18s var(--ease); }
.palette input { border: 0; outline: 0; background: transparent; padding: 18px 20px; font-size: 17px; border-bottom: 1px solid var(--line); }
.palette ul { list-style: none; margin: 0; padding: 6px; overflow: auto; }
.palette li button { display: flex; align-items: center; width: 100%; min-height: 44px; text-align: left; border: 0; background: none; padding: 8px 12px; border-radius: 10px; overflow-wrap: anywhere; }
.palette li button[aria-selected="true"], .palette li button:hover { background: var(--brand-soft); }
.palette .hint { padding: 10px 18px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
#paletteScrim { z-index: 50; }

/* ---------- phone ---------- */
.bottomnav { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .top { padding: 10px 16px; }
  .top h1 { font-size: 18px; }
  .searchbtn { width: 44px; min-width: 44px; padding: 0; justify-content: center; border-radius: 50%; }
  .searchbtn span, .searchbtn kbd { display: none; }
  main { padding: 18px 16px 104px; }
  .bottomnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .bottomnav button { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; border: 0; background: none; color: var(--muted); font-size: 11.5px; font-weight: 650; border-radius: 10px; }
  .bottomnav button[aria-current="page"] { color: var(--brand); }
  .themebtn-top { display: grid !important; }
}
.themebtn-top { display: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- printing a guide (a form prints through forms.css) ---------- */
@media print {
  body:not(.form-open) .side, body:not(.form-open) .top, body:not(.form-open) .bottomnav, body:not(.form-open) .screen-only,
  body:not(.form-open) .drawer, body:not(.form-open) .scrim, body:not(.form-open) .palette { display: none !important; }
  body:not(.form-open) { background: #fff; color: #000; }
  body:not(.form-open) .app { display: block; }
  body:not(.form-open) main { padding: 0; max-width: none; }
  body:not(.form-open) .print-only { display: block; }
  body:not(.form-open) .step { break-inside: avoid; border-color: #999; }
  body:not(.form-open) .phasetitle { break-after: avoid; margin-top: 18px; }
  body:not(.form-open) .lawref { color: #000; text-decoration: none; }
}
