:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --line: #e4e8f0;
  --line-2: #eef1f6;
  --text: #0f172a;
  --muted: #64748b;
  --faint: #94a3b8;
  --brand: #1d4ed8;
  --brand-2: #2563eb;
  --brand-soft: #e8efff;
  --side: #0b1530;
  --side-2: #142149;
  --side-text: #c7d2ec;
  --ok: #059669; --ok-soft: #e3f7ef;
  --warn: #d97706; --warn-soft: #fff4e0;
  --bad: #dc2626; --bad-soft: #fde8e8;
  --info: #0891b2; --info-soft: #e0f6fb;
  --violet: #7c3aed; --violet-soft: #f0e9ff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .05);
  --shadow-lg: 0 20px 60px rgba(15, 23, 42, .25);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #0b1020; --panel: #121a2e; --panel-2: #0f1628; --line: #222c45; --line-2: #1a2339;
  --text: #e6ebf5; --muted: #95a1bb; --faint: #6b7794;
  --brand: #4f7dff; --brand-2: #6b91ff; --brand-soft: #1b2850;
  --side: #070b17; --side-2: #121a33; --side-text: #aab6d3;
  --ok-soft: #0f2f26; --warn-soft: #33260b; --bad-soft: #3a1414; --info-soft: #0c2c35; --violet-soft: #241a40;
  --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 20px 60px rgba(0,0,0,.6);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; } .nowrap { white-space: nowrap; }
.right { text-align: right; } .center { text-align: center; } .mono { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 8px; } .wrap { flex-wrap: wrap; } .grow { flex: 1; } .gap-lg { gap: 16px; }
.stack > * + * { margin-top: 12px; }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-text); padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: #fff; }
.brand-logo { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #3b82f6, #1d4ed8); display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.brand b { display: block; font-size: 14px; line-height: 1.2; }
.brand span { font-size: 11px; color: var(--side-text); opacity: .8; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: var(--side-text); font-weight: 500; }
.nav a:hover { background: var(--side-2); color: #fff; }
.nav a.active { background: var(--brand); color: #fff; }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav .count { margin-left: auto; font-size: 11px; background: rgba(255,255,255,.12); padding: 1px 7px; border-radius: 99px; }
.nav a.active .count { background: rgba(255,255,255,.25); }
.side-foot { margin-top: auto; display: grid; gap: 4px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 12px 28px; display: flex; align-items: center; gap: 14px; }
.topbar h1 { font-size: 19px; }
.search-trigger { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 280px; padding: 8px 12px; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; color: var(--muted); cursor: pointer; }
.search-trigger kbd { margin-left: auto; }
kbd { font: 11px var(--font); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; color: var(--muted); background: var(--panel-2); }
.content { padding: 22px 28px 60px; }

/* ---------- primitives ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 500; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--panel-2); border-color: #cfd6e3; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--line-2); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn.icon { padding: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.card-h h3 { font-size: 14.5px; }
.card-b { padding: 16px 18px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
input.in, select.in, textarea.in { width: 100%; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); outline: none; }
input.in:focus, select.in:focus, textarea.in:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea.in { resize: vertical; min-height: 70px; }
.in.sm { padding: 5px 8px; font-size: 12.5px; border-radius: 7px; }
label.f { display: grid; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
label.f > span { text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--line-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); } .badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand); } .badge.violet { background: var(--violet-soft); color: var(--violet); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 40px; height: 40px; opacity: .4; margin-bottom: 8px; }
.progress { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; min-width: 60px; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.progress.ok > i { background: var(--ok); }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

/* ---------- KPIs ---------- */
.kpi { padding: 16px 18px; }
.kpi .lbl { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.kpi .val { font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi .ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.kpi .ico svg { width: 16px; height: 16px; }

/* ---------- sheet tabs + table ---------- */
.sheet-tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; scrollbar-width: thin; }
.sheet-tabs button { border: 0; background: transparent; padding: 9px 13px; border-radius: 9px 9px 0 0; cursor: pointer; color: var(--muted); font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; display: flex; align-items: center; gap: 7px; }
.sheet-tabs button:hover { color: var(--text); background: var(--panel); }
.sheet-tabs button.active { color: var(--brand); border-bottom-color: var(--brand); background: var(--panel); }
.sheet-tabs .n { font-size: 11px; background: var(--line-2); color: var(--muted); border-radius: 99px; padding: 0 7px; }
.sheet-tabs button.active .n { background: var(--brand-soft); color: var(--brand); }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .in { width: auto; }
.table-wrap { overflow: auto; max-height: calc(100vh - 250px); border-radius: var(--radius); }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.t th { position: sticky; top: 0; z-index: 2; background: var(--panel-2); text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: pointer; user-select: none; }
table.t th.nosort { cursor: default; }
table.t th .arr { opacity: .5; font-size: 10px; }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; background: var(--panel); }
table.t tr.click:hover td { background: var(--panel-2); cursor: pointer; }
table.t td.sticky, table.t th.sticky { position: sticky; left: 0; z-index: 1; }
table.t th.sticky { z-index: 3; }
table.t td.sticky2, table.t th.sticky2 { position: sticky; left: 52px; z-index: 1; box-shadow: 1px 0 0 var(--line); }
table.t th.sticky2 { z-index: 3; }
table.t td.wrapc { white-space: normal; min-width: 220px; max-width: 320px; }
table.t tfoot td { position: sticky; bottom: 0; background: var(--panel-2); font-weight: 700; border-top: 1px solid var(--line); }
.lbl-bar { display: inline-block; width: 4px; height: 22px; border-radius: 3px; vertical-align: middle; margin-right: 8px; }
.name-cell { font-weight: 600; }
.name-cell .sub { font-weight: 400; font-size: 11.5px; color: var(--muted); }

/* label colours (like the sheet row colours) */
.lc-red { --lc: #ef4444; } .lc-orange { --lc: #f59e0b; } .lc-yellow { --lc: #eab308; } .lc-green { --lc: #22c55e; } .lc-blue { --lc: #38bdf8; } .lc-purple { --lc: #a855f7; } .lc-none { --lc: transparent; }
tr[class*="lc-"]:not(.lc-none) td { background: color-mix(in srgb, var(--lc) 9%, var(--panel)); }
tr[class*="lc-"] .lbl-bar { background: var(--lc); }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line); cursor: pointer; background: var(--lc); }
.swatch.lc-none { background: repeating-linear-gradient(45deg, var(--line) 0 3px, var(--panel) 3px 6px); }
.swatch.sel { box-shadow: 0 0 0 2px var(--brand); }

/* ---------- pipeline ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: 262px; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: var(--line-2); border-radius: var(--radius); padding: 10px; min-height: 200px; }
.col.drag { outline: 2px dashed var(--brand); background: var(--brand-soft); }
.col-h { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 12.5px; padding: 2px 4px 10px; }
.col-h .n { margin-left: auto; font-size: 11px; background: var(--panel); color: var(--muted); border-radius: 99px; padding: 0 8px; }
.kcard { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow); border-left: 4px solid var(--lc, var(--line)); }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: .4; }
.kcard b { display: block; font-size: 13px; }
.kcard .meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ---------- client detail ---------- */
.hero { padding: 20px 22px; display: flex; gap: 18px; align-items: flex-start; }
.avatar { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-weight: 700; font-size: 19px; color: #fff; flex: none; }
.hero h2 { font-size: 21px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px; color: var(--muted); font-size: 13px; }
.facts span { display: inline-flex; align-items: center; gap: 5px; }
.facts svg { width: 14px; height: 14px; }
.stepper { display: flex; padding: 14px 22px 18px; gap: 0; overflow-x: auto; border-top: 1px solid var(--line); }
.step { flex: 1; min-width: 100px; position: relative; text-align: center; cursor: pointer; padding-top: 2px; }
.step::before { content: ""; position: absolute; top: 13px; left: -50%; right: 50%; height: 3px; background: var(--line); z-index: 0; }
.step:first-child::before { display: none; }
.step.done::before, .step.cur::before { background: var(--brand); }
.step i { position: relative; z-index: 1; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; background: var(--panel); border: 2px solid var(--line); font-style: normal; font-size: 11px; font-weight: 700; color: var(--muted); }
.step.done i { background: var(--brand); border-color: var(--brand); color: #fff; }
.step.cur i { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.step span { display: block; font-size: 11px; margin-top: 6px; color: var(--muted); font-weight: 600; padding: 0 4px; }
.step.cur span { color: var(--brand); }
.step:hover i { border-color: var(--brand); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 18px 0 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; gap: 7px; align-items: center; white-space: nowrap; }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.dl { display: grid; grid-template-columns: 170px 1fr; gap: 9px 14px; font-size: 13.5px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 500; word-break: break-word; }

/* document checklist */
.doc-row { display: grid; grid-template-columns: 26px minmax(200px, 1.4fr) 140px minmax(160px, 1.6fr) 130px 36px; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line-2); }
.doc-row:last-child { border-bottom: 0; }
.doc-row.dragover { background: var(--brand-soft); outline: 2px dashed var(--brand); outline-offset: -4px; }
.doc-row .dname { font-weight: 600; }
.doc-row .dname small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.doc-row.st-verified .dname, .doc-row.st-received .dname { color: var(--text); }
.doc-row.st-na { opacity: .55; }
.files { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; background: var(--panel-2); max-width: 210px; cursor: pointer; }
.file-chip:hover { border-color: var(--brand); color: var(--brand); }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip svg { width: 14px; height: 14px; flex: none; }
.file-chip .x { border: 0; background: none; padding: 0 3px; cursor: pointer; color: var(--faint); font-size: 14px; line-height: 1; }
.file-chip .x:hover { color: var(--bad); }
.doc-head { display: grid; grid-template-columns: 26px minmax(200px, 1.4fr) 140px minmax(160px, 1.6fr) 130px 36px; gap: 12px; padding: 9px 16px; background: var(--panel-2); border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-radius: var(--radius) var(--radius) 0 0; }
select.st { border-radius: 99px; padding: 4px 10px; font-size: 12px; font-weight: 600; border: 1px solid var(--line); cursor: pointer; }
select.st.Pending { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
select.st.Received { background: var(--info-soft); color: var(--info); border-color: transparent; }
select.st.Verified { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
select.st.Rejected { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
select.st.NA { background: var(--line-2); color: var(--muted); border-color: transparent; }

/* timeline */
.tl { position: relative; padding-left: 22px; }
.tl::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-i { position: relative; padding: 0 0 14px; }
.tl-i::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--panel); border: 2px solid var(--brand); }
.tl-i .when { font-size: 11.5px; color: var(--muted); }
.note { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.note .when { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; display: flex; }
.note p { margin: 0; white-space: pre-wrap; }

/* alerts list */
.alert-i { display: flex; gap: 12px; align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.alert-i:hover { background: var(--panel-2); }
.alert-i:last-child { border-bottom: 0; }
.alert-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.alert-ico svg { width: 16px; height: 16px; }
.alert-i .t { font-weight: 600; font-size: 13px; }
.alert-i .s { font-size: 12px; color: var(--muted); }

/* charts */
.bars { display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 90px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-row .track { height: 10px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.bar-row .track i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.vbars { display: flex; align-items: flex-end; gap: 8px; height: 190px; padding-top: 10px; }
.vbar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.vbar i { width: 100%; max-width: 38px; background: linear-gradient(180deg, var(--brand-2), var(--brand)); border-radius: 6px 6px 2px 2px; min-height: 2px; position: relative; }
.vbar i:hover::after { content: attr(data-v); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 4px; background: var(--text); color: var(--panel); font-size: 11px; padding: 2px 6px; border-radius: 5px; white-space: nowrap; font-style: normal; }
.vbar span { font-size: 10.5px; color: var(--muted); }
.donut-wrap { display: flex; gap: 20px; align-items: center; }
.legend { display: grid; gap: 7px; font-size: 12.5px; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend b { margin-left: auto; padding-left: 14px; }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(9, 14, 30, .55); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .12s; }
.modal { background: var(--panel); border-radius: 16px; box-shadow: var(--shadow-lg); width: min(760px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop .15s; }
.modal.wide { width: min(1100px, 100%); height: calc(100vh - 40px); }
.modal.sm { width: min(460px, 100%); }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal-h h3 { font-size: 16px; }
.modal-b { padding: 18px 20px; overflow: auto; flex: 1; }
.modal-f { padding: 13px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.form-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--brand); margin: 18px 0 10px; }
.form-sec:first-child { margin-top: 0; }
.viewer { flex: 1; background: #1e293b; display: grid; place-items: center; overflow: auto; }
.viewer iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }

/* command palette */
.palette { width: min(620px, 100%); align-self: start; margin-top: 10vh; }
.palette input { border: 0; border-bottom: 1px solid var(--line); border-radius: 16px 16px 0 0; padding: 18px 20px; font-size: 16px; width: 100%; outline: none; background: transparent; }
.palette .res { max-height: 420px; overflow: auto; padding: 6px; }
.palette .ri { padding: 10px 12px; border-radius: 9px; display: flex; gap: 10px; align-items: center; cursor: pointer; }
.palette .ri.sel, .palette .ri:hover { background: var(--brand-soft); }

/* toasts */
#toasts { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 8px; z-index: 200; }
.toast { background: var(--text); color: var(--panel); padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 500; animation: pop .15s; max-width: 380px; }
.toast.err { background: var(--bad); color: #fff; }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 10% -10%, #1d4ed8 0, transparent 60%), radial-gradient(800px 600px at 110% 110%, #7c3aed 0, transparent 55%), var(--side); padding: 20px; }
.auth .card { width: min(400px, 100%); padding: 30px; }
.auth h2 { font-size: 22px; margin: 14px 0 4px; }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; overflow-x: auto; padding: 8px; }
  .brand, .side-foot { display: none; }
  .nav { display: flex; gap: 4px; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; } .span2 { grid-column: auto; }
  .search-trigger { min-width: 0; }
  .doc-row, .doc-head { grid-template-columns: 26px 1fr; } .doc-head { display: none; }
  .dl { grid-template-columns: 1fr; }
}
@media print {
  .side, .topbar, .no-print { display: none !important; }
  .shell { display: block; }
}
