/* =====================================================================
   CasePilot · Chamber app · app.css
   White UI, ink-navy primary, oxblood for alerts, brass used sparingly.
   Instrument Sans for UI, JetBrains Mono for case numbers / CNRs.
   ===================================================================== */
:root {
  --bg: #f7f7f4; --surface: #fff; --surface-2: #fafaf8; --paper: #fbf8f2;
  --navy: #14213d; --navy-2: #1f2f55; --navy-bg: #e9ecf3;
  --ink: #18202f; --ink-2: #3d4657; --muted: #5b6475; --faint: #9aa1ad;
  --line: rgba(20, 33, 61, .09); --line-2: rgba(20, 33, 61, .16);
  --ox: #8c1c13; --ox-d: #6f150e; --ox-bg: #f9e9e6; --ox-line: rgba(140, 28, 19, .25);
  --brass: #b08d57; --brass-d: #7a5d2e; --brass-bg: #f6efe2;
  --ok: #1e6b45; --ok-bg: #e2f2e8; --warn: #8a5a00; --warn-bg: #fbf0d6;
  --r: 12px; --r-sm: 8px;
  --sh: 0 1px 2px rgba(20, 33, 61, .05), 0 1px 8px rgba(20, 33, 61, .03);
  --sh-lg: 0 24px 60px rgba(20, 33, 61, .22), 0 4px 14px rgba(20, 33, 61, .08);
  --sb: 236px; --tb: 60px;
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --doc: "Cambria", "Georgia", "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--navy-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.mono { font-family: var(--mono); font-size: .88em; letter-spacing: -.01em; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.num { text-align: right; white-space: nowrap; }
.strong { font-weight: 700; }
.ox { color: var(--ox); }
.okc { color: var(--ok); }
.bi { line-height: 1; vertical-align: -.125em; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-sb { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.grow { flex: 1; min-width: 0; }

/* ---------------- shell ---------------- */
.app { display: flex; min-height: 100vh; background: linear-gradient(to right, var(--surface) calc(var(--sb) - 1px), var(--line) calc(var(--sb) - 1px), var(--line) var(--sb), transparent var(--sb)); }
.sb { width: var(--sb); flex: none; position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 12px 14px; overflow-y: auto; z-index: 40; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; color: inherit; text-decoration: none !important; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--navy); color: #f6f1e7; display: grid; place-items: center; flex: none;
  font: 700 13px/1 var(--font); letter-spacing: .02em; position: relative; }
.brand-mark::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 6px; height: 2px; border-radius: 2px; background: var(--brass); }
.brand-txt { min-width: 0; }
.brand-txt b { display: block; font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-txt small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.sb-nav { display: flex; flex-direction: column; gap: 1px; }
.sb-sec { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 14px 10px 6px; }
.sb-link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.sb-link .bi { font-size: 16px; color: var(--muted); width: 18px; text-align: center; }
.sb-link:hover { background: var(--bg); text-decoration: none; color: var(--ink); }
.sb-link.is-active { background: var(--navy-bg); color: var(--navy); }
.sb-link.is-active .bi { color: var(--navy); }
.sb-count { margin-left: auto; min-width: 20px; height: 19px; padding: 0 6px; border-radius: 10px; background: var(--ox); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.sb-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.sb-foot .sb-link { font-size: 13px; }
.sb-mode { font-size: 11.5px; color: var(--muted); padding: 8px 10px 0; }
.credit { font-size: 11.5px; color: var(--muted); padding: 8px 10px 0; }
.credit a { color: var(--navy-2); font-weight: 600; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.2) blur(8px); border-bottom: 1px solid var(--line); }
.topbar .tb-brand { display: none; }
.tb-date { color: var(--muted); font-weight: 600; font-size: 13px; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.demo-pill { font-size: 11.5px; font-weight: 600; color: var(--brass-d); background: var(--brass-bg); padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.role-sw { display: flex; align-items: center; gap: 8px; }
.role-sw label { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.role-sw select { height: 34px; border: 1px solid var(--line-2); border-radius: 9px; padding: 0 30px 0 10px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2314213d' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center;
  -webkit-appearance: none; appearance: none; font-weight: 600; font-size: 13px; color: var(--navy); cursor: pointer; max-width: 170px; }
.timer-pill { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border-radius: 16px; background: var(--ox-bg); color: var(--ox); font-weight: 700; font-size: 12.5px; text-decoration: none !important; white-space: nowrap; }
.timer-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ox); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px 28px 72px; }

.tabbar { display: none; }
.more-sheet .sb-link { padding: 12px 10px; font-size: 15px; }

/* page header */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 18px; }
.ph h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--navy); }
.ph p { color: var(--muted); margin-top: 3px; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brass-d); margin-bottom: 4px; }

/* ---------------- buttons ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { background: var(--surface-2); border-color: rgba(20, 33, 61, .28); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn-ox { background: var(--ox); border-color: var(--ox); color: #fff; }
.btn-ox:hover { background: var(--ox-d); border-color: var(--ox-d); }
.btn-wa { background: #1d7a46; border-color: #1d7a46; color: #fff; }
.btn-wa:hover { background: #17633a; border-color: #17633a; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(20, 33, 61, .05); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 7px; gap: 5px; }
.btn-block { width: 100%; }
.icon-btn { width: 36px; height: 36px; border-radius: 9px; border: 0; background: transparent; color: var(--ink-2); display: inline-grid; place-items: center; cursor: pointer; flex: none; font-size: 17px; }
.icon-btn:hover { background: rgba(20, 33, 61, .06); color: var(--ink); }
.linkish { background: none; border: 0; padding: 0; color: var(--navy-2); font-weight: 600; cursor: pointer; font-size: inherit; text-align: left; }
.linkish:hover { text-decoration: underline; }

.seg { display: inline-flex; padding: 3px; background: #eef0f3; border-radius: 10px; gap: 2px; max-width: 100%; }
.seg button { border: 0; background: transparent; padding: 0 12px; height: 32px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--navy); box-shadow: 0 1px 3px rgba(20, 33, 61, .16); }

/* ---------------- chips, tags ---------------- */
.chip { --c: #4b5567; --cb: #eef0f3; display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 11.5px; font-weight: 700; white-space: nowrap; color: var(--c); background: var(--cb); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.chip.no-dot::before { display: none; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px; border-radius: 6px; background: #f0f1f4; color: var(--ink-2); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.tag-brass { background: var(--brass-bg); color: var(--brass-d); }
.tag-ox { background: var(--ox-bg); color: var(--ox); }
.tag-navy { background: var(--navy-bg); color: var(--navy); }
.tag-ok { background: var(--ok-bg); color: var(--ok); }
.lock { display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 8px; border-radius: 6px; background: #f4eee6; color: var(--brass-d); font-size: 11.5px; font-weight: 700; white-space: nowrap; border: 1px solid rgba(176, 141, 87, .35); }
.av { --t: var(--navy); width: 26px; height: 26px; border-radius: 50%; background: var(--t); color: #fff; display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 700; flex: none; letter-spacing: .02em; }
.av-lg { width: 36px; height: 36px; font-size: 12.5px; }
.av-stack { display: inline-flex; }
.av-stack .av { border: 2px solid #fff; margin-left: -6px; }
.av-stack .av:first-child { margin-left: 0; }
.who { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.who b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fchips { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip { height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 12.5px; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.fchip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.fchip .av { width: 20px; height: 20px; font-size: 9px; }

/* ---------------- cards & tiles ---------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); }
.card-pad { padding: 18px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-h h2, .card-h h3 { font-size: 15px; font-weight: 700; color: var(--navy); }
.card-b { padding: 16px 18px; }
.grid { display: grid; gap: 16px; }
.grid > *, .stack > * { min-width: 0; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g-side { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.g-drafts { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); align-items: start; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--sh); min-width: 0; }
.tile .k { font-size: 12px; font-weight: 600; color: var(--muted); }
.tile .v { font-size: 24px; font-weight: 700; color: var(--navy); letter-spacing: -.02em; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .s { font-size: 12px; color: var(--muted); }
.tile.is-ox .v { color: var(--ox); }
.empty { padding: 28px 18px; text-align: center; color: var(--muted); }
.empty .bi { font-size: 26px; color: var(--faint); display: block; margin-bottom: 6px; }

.note { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 10px; font-size: 13px; line-height: 1.45; background: #f0f2f6; color: var(--ink-2); }
.note .bi { font-size: 15px; margin-top: 1px; }
.note-ox { background: var(--ox-bg); color: var(--ox-d); }
.note-brass { background: var(--brass-bg); color: var(--brass-d); }
.note-ok { background: var(--ok-bg); color: var(--ok); }
.badge-src { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 4px 11px; line-height: 1.35; }
.badge-src .live { width: 7px; height: 7px; border-radius: 50%; background: #2e9a5f; flex: none; }

/* ---------------- tables ---------------- */
.tbl-wrap { overflow-x: auto; position: relative; }
.switch, .card { position: relative; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.tbl th.num { text-align: right; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover td { background: #fafbfc; }
.tbl .t-title { font-weight: 600; color: var(--ink); }
.tbl tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line-2); }

/* ---------------- forms ---------------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label, .lbl { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .req { color: var(--ox); }
.field .opt { color: var(--faint); font-weight: 500; }
.field input, .field select, .field textarea, .inp { width: 100%; min-height: 40px; border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 11px; background: #fff; font-size: 14px; }
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .inp:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(20, 33, 61, .12); }
.field .hint { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--ox); font-weight: 600; min-height: 0; }
.field.has-err input, .field.has-err select, .field.has-err textarea { border-color: var(--ox); }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.fgrid .full { grid-column: 1 / -1; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search input { width: 100%; height: 38px; border: 1px solid var(--line-2); border-radius: 9px; padding: 0 12px 0 34px; background: #fff; }
.search .bi { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters select { height: 38px; border: 1px solid var(--line-2); border-radius: 9px; padding: 0 10px; background: #fff; font-size: 13px; max-width: 200px; }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--navy); flex: none; }
.pills { display: flex; flex-wrap: wrap; gap: 7px; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.pill input:checked + span { border-color: var(--navy); background: var(--navy); color: #fff; }
.pill input:focus-visible + span { outline: 2px solid var(--navy); outline-offset: 2px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 13.5px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .tr { width: 38px; height: 22px; border-radius: 11px; background: #cdd2db; position: relative; transition: background .15s; flex: none; }
.switch .tr::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked + .tr { background: var(--navy); }
.switch input:checked + .tr::after { transform: translateX(16px); }
.switch input:focus-visible + .tr { outline: 2px solid var(--navy); outline-offset: 2px; }
.switch input:disabled + .tr { opacity: .45; }

/* ---------------- tabs ---------------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-2); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 10px 13px; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs button[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--navy); }
.tabs .cnt { font-size: 11px; background: #eef0f3; border-radius: 9px; padding: 1px 6px; color: var(--ink-2); }

/* ---------------- modal / sheet / drawer ---------------- */
.mdl-wrap { position: fixed; inset: 0; background: rgba(20, 33, 61, .42); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 90; animation: fadeIn .15s ease; }
.mdl { background: #fff; border-radius: 14px; box-shadow: var(--sh-lg); width: 100%; max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: popIn .18s ease; }
.mdl-sm { max-width: 440px; } .mdl-md { max-width: 580px; } .mdl-lg { max-width: 820px; } .mdl-xl { max-width: 1000px; }
.mdl-form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.mdl-head { display: flex; align-items: flex-start; gap: 10px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.mdl-head h2 { font-size: 17px; font-weight: 700; color: var(--navy); }
.mdl-head p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.mdl-head .mdl-x { margin-left: auto; margin-top: -4px; margin-right: -6px; }
.mdl-body { padding: 16px 18px; overflow-y: auto; flex: 1; min-height: 0; }
.mdl-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; background: var(--surface-2); border-radius: 0 0 14px 14px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.drw-scrim { position: fixed; inset: 0; background: rgba(20, 33, 61, .32); z-index: 80; animation: fadeIn .15s ease; }
.drw { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: #fff; z-index: 81; box-shadow: var(--sh-lg); display: flex; flex-direction: column; animation: slideIn .2s ease; outline: none; }
@keyframes slideIn { from { transform: translateX(30px); opacity: .6; } }
.drw-head { display: flex; align-items: flex-start; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drw-head .dh-main { flex: 1; min-width: 0; }
.drw-head h2 { font-size: 17px; color: var(--navy); }
.drw-body { flex: 1; overflow-y: auto; padding: 16px 18px 28px; }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 9px; background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 11px; box-shadow: var(--sh-lg); font-weight: 600; font-size: 13.5px; animation: popIn .2s ease; transition: opacity .3s, transform .3s; }
.toast.is-warn { background: var(--ox); }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ---------------- court day ---------------- */
.cd-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cd-date { font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--navy); }
.cd-date small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.cd-ctrl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cd-ctrl input[type=date] { height: 38px; border: 1px solid var(--line-2); border-radius: 9px; padding: 0 10px; background: #fff; font-size: 13px; }
.cd-meta { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cd-sum { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.cd-sum b { color: var(--navy); font-size: 14px; }
.clash { border: 1px solid var(--ox-line); background: var(--ox-bg); border-radius: var(--r); padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.clash > .bi { color: var(--ox); font-size: 20px; margin-top: 1px; }
.clash b { color: var(--ox-d); }
.clash p { color: var(--ox-d); font-size: 13px; margin-top: 2px; }
.clash .btn { margin-left: auto; }
.strips { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.strip { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; min-width: 0; }
.strip h3 { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.strip h3 a { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 600; }
.strip ul { list-style: none; margin: 0; padding: 0; }
.strip li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; min-width: 0; }
.strip li:first-child { border-top: 0; }
.strip li .grow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip .when { font-weight: 700; font-size: 12px; white-space: nowrap; }
.court-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); margin-bottom: 14px; overflow: hidden; }
.court-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--navy); color: #fff; }
.court-h .bi { font-size: 17px; color: var(--brass); }
.court-h h2 { font-size: 15px; font-weight: 700; }
.court-h small { display: block; font-size: 11.5px; opacity: .72; font-weight: 500; }
.court-h .cnt { margin-left: auto; font-size: 12px; font-weight: 700; background: rgba(255, 255, 255, .12); border-radius: 10px; padding: 2px 9px; white-space: nowrap; }
.hall-h { display: flex; align-items: center; gap: 8px; padding: 9px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); font-weight: 700; font-size: 13px; color: var(--navy-2); }
.hall-h:first-of-type { border-top: 0; }
.hall-h .bi { color: var(--muted); }
.hrow { display: grid; grid-template-columns: 64px minmax(0, 1fr) 170px 150px auto; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); position: relative; }
.hrow:last-child { border-bottom: 0; }
.hrow.in-list { background: linear-gradient(90deg, var(--brass-bg), transparent 60%); }
.hrow.in-list::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brass); }
.hrow.is-done { background: #fcfcfb; }
.hrow.is-clash::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 3px; background: var(--ox); }
.item { text-align: center; }
.item b { display: block; font: 700 20px/1.1 var(--mono); color: var(--navy); letter-spacing: -.03em; }
.item small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 2px; white-space: nowrap; }
.hmain { min-width: 0; }
.hmain .t { font-weight: 700; font-size: 14.5px; color: var(--ink); display: block; line-height: 1.3; }
.hmain .t:hover { color: var(--navy); }
.hmain .c { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.hmain .c .mono { color: var(--ink-2); font-size: 12px; }
.hmain .p { margin-top: 3px; font-size: 13px; color: var(--ink-2); }
.hmain .p b { font-weight: 600; }
.happ { min-width: 0; }
.happ .who { font-size: 13px; }
.happ small { display: block; font-size: 11.5px; color: var(--muted); padding-left: 33px; }
.hstat { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.hstat small { font-size: 11.5px; color: var(--muted); }
.hact { display: flex; gap: 6px; justify-content: flex-end; }
.inlist-tag { font-size: 10.5px; font-weight: 700; color: var(--brass-d); letter-spacing: .04em; text-transform: uppercase; }

/* ---------------- timeline ---------------- */
.tl { list-style: none; margin: 0; padding: 0 0 0 4px; }
.tl li { position: relative; padding: 0 0 18px 24px; border-left: 2px solid var(--line-2); }
.tl li:last-child { border-left-color: transparent; padding-bottom: 0; }
.tl .dot { position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--navy); }
.tl li.is-next .dot { background: var(--brass); border-color: var(--brass); }
.tl .tl-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl .tl-top b { color: var(--navy); }
.tl p { margin-top: 4px; color: var(--ink-2); font-size: 13px; }

/* ---------------- kanban ---------------- */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.kcol { background: #f0f1f3; border-radius: var(--r); padding: 10px; min-width: 0; }
.kcol h2 { font-size: 13px; font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: 8px; padding: 4px 4px 10px; }
.kcol h2 .n { font-size: 11.5px; background: #fff; border-radius: 9px; padding: 1px 7px; color: var(--muted); }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; margin-bottom: 8px; box-shadow: var(--sh); }
.kcard .kt { font-weight: 600; font-size: 13.5px; line-height: 1.35; }
.kcard .km { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--muted); }
.kcard .ka { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.kcard.is-late { border-left: 3px solid var(--ox); }
.thumb { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); cursor: zoom-in; }
.kind-ic { width: 26px; height: 26px; border-radius: 7px; background: var(--navy-bg); color: var(--navy); display: inline-grid; place-items: center; font-size: 13px; flex: none; }

/* ---------------- calendar ---------------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--line); border-top: 1px solid var(--line); background: #fff; border-radius: var(--r); overflow: hidden; }
.cal .dow { padding: 8px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal .day { min-height: 108px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; min-width: 0; background: #fff; text-align: left; border-top: 0; border-left: 0; font: inherit; display: block; width: 100%; }
.cal .day:hover { background: #fafbfc; }
.cal .day.out { background: #fafaf8; color: var(--faint); }
.cal .day.sun { background: #fbfaf7; }
.cal .day.sel { box-shadow: inset 0 0 0 2px var(--navy); }
.cal .dn { font-weight: 700; font-size: 12.5px; display: flex; align-items: center; gap: 5px; }
.cal .day.today .dn span:first-child { background: var(--navy); color: #fff; border-radius: 10px; padding: 0 7px; }
.cal .ev { display: block; font-size: 11.5px; line-height: 1.3; padding: 2px 5px; border-radius: 4px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-h { background: var(--navy-bg); color: var(--navy); }
.ev-d { background: var(--ox-bg); color: var(--ox); }
.ev-a { background: var(--brass-bg); color: var(--brass-d); }
.ev-more { color: var(--muted); font-size: 11px; margin-top: 2px; }
.clash-dot { margin-left: auto; color: var(--ox); font-size: 11px; font-weight: 700; }
.dots { display: none; gap: 3px; margin-top: 4px; flex-wrap: wrap; }
.dots i { width: 6px; height: 6px; border-radius: 50%; display: block; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.wday { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; min-height: 180px; min-width: 0; }
.wday h3 { font-size: 12.5px; color: var(--navy); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.wday.today { border-color: var(--navy); }

/* ---------------- list items ---------------- */
.li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); min-width: 0; }
.li:last-child { border-bottom: 0; }
.li .grow b { font-weight: 600; }
.li .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.li.click { cursor: pointer; }
.li.click:hover { background: #fafbfc; }
.li.sel { background: var(--navy-bg); }
.due { font-weight: 700; font-size: 12.5px; white-space: nowrap; text-align: right; }
.due small { display: block; font-weight: 500; color: var(--muted); }
.due.late { color: var(--ox); }
.dl-group h3 { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px 16px 6px; display: flex; align-items: center; gap: 8px; }
.dl-group h3.ox { color: var(--ox); }
.kv { margin: 0; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.steps { display: flex; gap: 0; margin: 4px 0 14px; flex-wrap: wrap; }
.steps span { font-size: 12px; font-weight: 600; color: var(--faint); padding: 5px 10px 5px 0; display: inline-flex; align-items: center; gap: 6px; }
.steps span::after { content: "›"; color: var(--faint); margin-left: 4px; }
.steps span:last-child::after { display: none; }
.steps span.done { color: var(--ok); }
.steps span.cur { color: var(--navy); }
.steps .n { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; line-height: 1; flex: none; font-size: 11px; background: #eef0f3; color: var(--muted); }
.steps span.cur .n { background: var(--navy); color: #fff; }
.steps span.done .n { background: var(--ok-bg); color: var(--ok); }
.hit { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: 9px; border: 1px solid var(--line); margin-top: 6px; font-size: 13px; }
.hit.high { border-color: var(--ox-line); background: var(--ox-bg); color: var(--ox-d); }
.hit.high b { color: var(--ox); }

/* ---------------- matter header ---------------- */
.mhead { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--sh); }
.mhead h1 { font-size: 22px; font-weight: 700; color: var(--navy); letter-spacing: -.015em; }
.mhead .ids { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; margin-top: 6px; font-size: 13px; color: var(--muted); }
.mhead .facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.fact .k { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.fact .v { font-weight: 600; margin-top: 2px; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 10px; display: inline-flex; align-items: center; gap: 6px; }

/* ---------------- money ---------------- */
.ledger-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sumrow { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 13.5px; border-bottom: 1px dashed var(--line-2); }
.sumrow:last-child { border-bottom: 0; }
.sumrow b { white-space: nowrap; }
.sumrow.total { font-size: 15px; font-weight: 700; color: var(--navy); border-top: 1px solid var(--line-2); border-bottom: 0; padding-top: 9px; margin-top: 4px; }
.bar { height: 8px; border-radius: 6px; background: #eef0f3; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--navy); border-radius: 6px; }
.bar.warn i { background: var(--brass); }
.bar.over i { background: var(--ox); }

/* printable documents (invoice, statement, drafts) */
.doc { background: #fff; border: 1px solid var(--line-2); border-radius: 6px; padding: 34px 38px; font-size: 13px; color: #1b1f27; box-shadow: var(--sh); }
.doc h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 6px; }
.doc .dh { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 2px solid var(--navy); }
.doc .dh .fn { font-size: 19px; font-weight: 700; color: var(--navy); letter-spacing: -.01em; }
.doc .dh .fa { font-size: 12px; color: var(--muted); max-width: 340px; }
.doc .dt { text-align: right; }
.doc .dt b { font-size: 16px; color: var(--navy); letter-spacing: .06em; }
.doc table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.doc th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--line-2); padding: 7px 6px; }
.doc td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc .tot { margin-left: auto; width: min(320px, 100%); margin-top: 10px; }
.doc .legend-box { margin-top: 16px; padding: 10px 12px; border-left: 3px solid var(--brass); background: var(--paper); font-size: 12px; color: var(--ink-2); }
.doc .pay { display: flex; gap: 16px; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.doc .pay svg { width: 112px; height: 112px; flex: none; }
.a4 { background: #fff; width: 100%; max-width: 794px; min-height: 900px; margin: 0 auto; padding: 64px 72px; box-shadow: 0 2px 18px rgba(20, 33, 61, .12); border: 1px solid var(--line); font: 15px/1.7 var(--doc); color: #111; white-space: pre-wrap; overflow-wrap: anywhere; }
.a4:focus { outline: 2px dashed var(--brass); outline-offset: 4px; }
.a4 mark { background: #fff3c4; padding: 0 2px; }
.a4-wrap { background: #e9ebef; border-radius: var(--r); padding: 24px; overflow: hidden; }
#printRoot { display: none; }

/* ---------------- charts ---------------- */
.hbar { display: grid; grid-template-columns: minmax(90px, 170px) minmax(0, 1fr) 44px; gap: 8px 10px; align-items: center; font-size: 13px; }
.hbar .lab { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .trk { height: 14px; background: #f0f1f4; border-radius: 4px; overflow: hidden; }
.hbar .trk i { display: block; height: 100%; background: var(--navy); border-radius: 4px; }
.hbar .val { font-weight: 700; text-align: right; color: var(--navy); }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg text { font-family: var(--font); }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.big-num { font-size: 30px; font-weight: 700; color: var(--navy); letter-spacing: -.02em; }

/* settings */
.set-sec { margin-bottom: 18px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.set-row:first-child { border-top: 0; }
.set-row .grow b { font-weight: 600; display: block; }
.set-row .grow small { color: var(--muted); font-size: 12.5px; }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.matrix .yes { color: var(--ok); font-size: 16px; }
.matrix .no { color: #c8ccd4; }

/* lock panel */
.locked { max-width: 520px; margin: 40px auto; text-align: center; }
.locked .bi-lock { font-size: 30px; color: var(--brass); }
.locked h1 { font-size: 22px; color: var(--navy); margin: 10px 0 6px; }

/* ---------------- responsive ---------------- */
@media (max-width: 1180px) {
  .hrow { grid-template-columns: 58px minmax(0, 1fr) 150px auto; }
  .hrow .hstat { grid-column: 2; grid-row: 2; flex-direction: row; align-items: center; gap: 8px; }
  .hrow .hact { grid-column: 4; grid-row: 1 / span 2; }
  .g-side { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 960px) {
  :root { --sb: 0px; }
  .sb { display: none; }
  .topbar { padding: 0 12px; gap: 8px; height: 54px; }
  .topbar .tb-brand { display: flex; align-items: center; gap: 9px; min-width: 0; color: inherit; text-decoration: none !important; }
  .topbar .tb-brand .brand-mark { width: 32px; height: 32px; font-size: 11.5px; border-radius: 9px; }
  .topbar .tb-brand .brand-mark::after { left: 7px; right: 7px; bottom: 5px; }
  .topbar .tb-brand b { font-size: 15px; font-weight: 700; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tb-date, .demo-pill { display: none; }
  .role-sw label { display: none; }
  .role-sw select { max-width: 132px; height: 32px; font-size: 12.5px; }
  .wrap { padding: 16px 14px calc(var(--tb) + 34px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: #fff; border-top: 1px solid var(--line-2);
    height: calc(var(--tb) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 18px rgba(20, 33, 61, .06); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none !important; border: 0; background: none; cursor: pointer; padding: 0 2px; min-width: 0; position: relative; }
  .tabbar .bi { font-size: 20px; }
  .tabbar .is-active { color: var(--navy); }
  .tabbar .is-active::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--navy); }
  .tabbar .tb-count { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--ox); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 4px; }
  .toasts { bottom: calc(var(--tb) + 16px + env(safe-area-inset-bottom)); }
  body.no-scroll .toasts { bottom: auto; top: 12px; }
  .tb-right { gap: 6px; }
  .timer-pill > span:last-child:not(.mono) { display: none; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .g2, .g3, .g-side, .g-drafts { grid-template-columns: 1fr; }
  .mhead .facts { grid-template-columns: 1fr 1fr; }
  .ph h1 { font-size: 22px; }
  .kanban { grid-template-columns: 1fr; }
  .week { grid-template-columns: 1fr; }
  .wday { min-height: 0; }
}
@media (max-width: 700px) {
  body { font-size: 14.5px; }
  .strips { grid-template-columns: 1fr; }
  .cd-wrap { display: flex; flex-direction: column; }
  .cd-wrap .strips { order: 5; margin-top: 4px; }
  .cd-wrap .cd-foot { order: 6; }
  .cd-date { font-size: 22px; }
  .cd-head { align-items: flex-start; }
  .cd-ctrl { width: 100%; }
  .cd-ctrl .seg { flex: 1; }
  .cd-ctrl .seg button { flex: 1; justify-content: center; }
  .court-h { padding: 11px 14px; }
  .hall-h { padding: 8px 14px; }
  .hrow { grid-template-columns: 52px minmax(0, 1fr); gap: 6px 12px; padding: 13px 14px; align-items: start; }
  .hrow .item { grid-row: 1 / span 3; padding-top: 2px; }
  .item b { font-size: 19px; }
  .hrow .hmain { grid-column: 2; }
  .hrow .happ { grid-column: 2; grid-row: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .happ small { padding-left: 0; }
  .hrow .hstat { grid-column: 2; grid-row: auto; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .hrow .hact { grid-column: 1 / -1; grid-row: auto; justify-content: stretch; margin-top: 4px; }
  .hrow .hact .btn { flex: 1; height: 42px; font-size: 14px; }
  .hmain .t { font-size: 15px; }
  .clash { flex-wrap: wrap; }
  .clash .btn { margin-left: 0; width: 100%; height: 42px; }
  .fgrid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { margin-top: 8px; font-size: 12px; }
  .ledger-split { grid-template-columns: 1fr; }
  .search { max-width: none; min-width: 0; flex-basis: 100%; }
  .filters select { flex: 1 1 calc(50% - 8px); max-width: none; min-width: 0; }
  .mdl-wrap { padding: 0; align-items: flex-end; }
  .mdl { max-width: none !important; border-radius: 16px 16px 0 0; max-height: 94vh; animation: sheetUp .22s ease; }
  .mdl-head::before { content: ""; position: absolute; left: 50%; transform: translateX(-50%); top: 6px; width: 38px; height: 4px; border-radius: 2px; background: #d5d9e0; }
  .mdl-head { position: relative; padding-top: 18px; }
  .mdl-foot { border-radius: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .mdl-foot .btn { flex: 1; height: 44px; }
  .doc { padding: 20px 16px; }
  .a4 { padding: 28px 20px; min-height: 0; font-size: 14px; }
  .a4-wrap { padding: 10px; }
  .tbl-cards thead { display: none; }
  .tbl-cards, .tbl-cards tbody, .tbl-cards tr, .tbl-cards td { display: block; width: 100%; }
  .tbl-cards tr { padding: 12px 14px; border-bottom: 1px solid var(--line); position: relative; }
  .tbl-cards td { border: 0; padding: 2px 0; }
  .tbl-cards td[data-l]::before { content: attr(data-l) " · "; color: var(--muted); font-size: 12px; font-weight: 600; }
  .tbl-cards td.num { text-align: left; }
  .tbl-cards td[data-l] { display: inline-block; width: auto; margin-right: 14px; font-size: 13px; }
  .tbl-cards td.st { position: absolute; top: 12px; right: 14px; width: auto; }
  .tbl-cards tr:has(td.st) > td:first-child { padding-right: 96px; }
  .tbl-cards tfoot tr { background: var(--surface-2); }
  .cal .day { min-height: 54px; padding: 4px; }
  .cal .ev, .cal .ev-more { display: none; }
  .cal .dots { display: flex; }
  .cal .dow { padding: 6px 2px; text-align: center; font-size: 10.5px; }
  .clash-dot { font-size: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--ox); }
  .hbar { grid-template-columns: 96px minmax(0, 1fr) 38px; font-size: 12.5px; }
  .mhead { padding: 14px; }
  .mhead h1 { font-size: 19px; }
  .tile .v { font-size: 20px; }
  .tile { padding: 12px; }
  .card-h, .card-b { padding-left: 14px; padding-right: 14px; }
  .li { padding: 12px 14px; }
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: .5; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------- print ---------------- */
@media print {
  @page { size: A4; margin: 14mm; }
  body.printing > *:not(#printRoot) { display: none !important; }
  body.printing #printRoot { display: block !important; }
  #printRoot .doc, #printRoot .a4 { border: 0; box-shadow: none; padding: 0; max-width: none; min-height: 0; }
  body { background: #fff; }
}
