/* Onwyn app shell + components. Pages may add page-scoped <style> but must reuse tokens. */
@import url("tokens.css");

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text-body);
  font: 400 var(--fs-base)/1.55 var(--font-sans);
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4 { color: var(--text); margin: 0 0 var(--sp-2); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-2xl); } h2 { font-size: var(--fs-xl); } h3 { font-size: var(--fs-lg); } h4 { font-size: var(--fs-md); }
p { margin: 0 0 var(--sp-3); }
a { color: var(--accent-600); text-decoration: none; }
a:hover { text-decoration: underline; }
/* A11y: in-copy links must not rely on color alone (WCAG 1.4.1). */
p a, td a, .callout a, .xs a { text-decoration: underline; }
/* A11y: screen-reader-only text (e.g. empty-looking action-column headers). */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
svg { flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--accent-500); outline-offset: 2px; border-radius: var(--r-sm); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Subtle thin scrollbars (webkit + Firefox) */
* { scrollbar-width: thin; scrollbar-color: var(--slate-300) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--slate-300); border-radius: var(--r-full);
  border: 3px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--slate-400); }
.sidebar * { scrollbar-color: var(--navy-700) transparent; }
.sidebar ::-webkit-scrollbar-thumb { background-color: var(--navy-700); }

/* Skeleton shimmer for loading states */
.skel {
  display: inline-block; position: relative; overflow: hidden; vertical-align: middle;
  background: var(--slate-100); border-radius: var(--r-sm); color: transparent !important;
  min-height: 10px; pointer-events: none;
}
.skel::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  animation: skel-shine 1.2s ease-in-out infinite;
}
.sidebar .skel { background: var(--navy-800); }
.sidebar .skel::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent); }
@keyframes skel-shine { to { transform: translateX(100%); } }

/* ---------- App layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.main { min-width: 0; display: flex; flex-direction: column; }
.content {
  width: 100%; max-width: var(--content-max); margin: 0 auto;
  padding: var(--sp-8) var(--sp-8) var(--sp-12); flex: 1;
  animation: fadeIn 180ms ease-out;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--navy-900); color: var(--slate-300); position: sticky; top: 0;
  height: 100vh; display: flex; flex-direction: column; z-index: var(--z-nav);
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px 14px; color: #fff; }
.sidebar .brand .logo-mark { width: 30px; height: 30px; display: block; flex: none; }
.sidebar .brand .name { font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }
.sidebar .persona-tag { margin: 0 20px 12px; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--slate-400); }
.sidebar nav { flex: 1; overflow-y: auto; padding: 4px 12px; }
.nav-section { margin: 14px 8px 6px; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--slate-400); /* slate-500 is only ~3.6:1 on the dark sidebar (a11y) */ }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 2px 0;
  border-radius: var(--r-md); color: var(--slate-300); font-size: var(--fs-base);
  cursor: pointer; transition: background 150ms, color 150ms; text-decoration: none;
}
.nav-item:hover { background: var(--navy-800); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--navy-800); color: #fff; box-shadow: inset 3px 0 0 var(--accent-500); }
.nav-item svg { width: 17px; height: 17px; opacity: 0.85; }
.nav-item .count { margin-left: auto; background: var(--navy-700); color: var(--slate-200); border-radius: var(--r-full); font-size: 11px; padding: 1px 7px; }
.sidebar .side-foot { padding: 14px 20px; border-top: 1px solid var(--navy-800); font-size: var(--fs-xs); color: var(--slate-400); /* a11y: contrast on dark sidebar */ }
.sidebar .side-foot a { color: var(--slate-400); }

/* ---------- Topbar ---------- */
.topbar {
  height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: var(--sp-4); padding: 0 var(--sp-6);
  position: sticky; top: 0; z-index: var(--z-nav);
}
.topbar .ctx { display: flex; align-items: center; gap: 8px; font-size: var(--fs-base); color: var(--text-muted); min-width: 0; }
.topbar .ctx b { color: var(--text); font-weight: 600; white-space: nowrap; }
.topbar .spacer { flex: 1; }
.demo-pill {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; padding: 3px 9px; border-radius: var(--r-full);
  background: var(--warn-100); color: var(--warn-700); border: 1px solid #FDE68A; white-space: nowrap;
}
.avatar {
  width: 30px; height: 30px; border-radius: var(--r-full); display: inline-grid; place-items: center;
  background: var(--accent-100); color: var(--accent-700); font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.avatar.lg { width: 38px; height: 38px; font-size: 14px; }

/* Persona switcher dropdown */
.dropdown { position: relative; }
.dropdown-btn {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--border);
  background: var(--surface); border-radius: var(--r-md); cursor: pointer; font: inherit; color: var(--text-body);
  transition: border-color 150ms, background 150ms;
}
.dropdown-btn:hover { border-color: var(--border-strong); background: var(--slate-50); }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: 6px; display: none; z-index: var(--z-dropdown);
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--r-md); color: var(--text-body); }
.dropdown-menu a:hover { background: var(--slate-100); text-decoration: none; }
.dropdown-menu .desc { font-size: var(--fs-xs); color: var(--text-faint); display: block; }

/* Notification bell */
#notif-dd .dropdown-btn { position: relative; padding: 8px; }
.notif-dot {
  position: absolute; top: 5px; right: 6px; width: 8px; height: 8px; border-radius: var(--r-full);
  background: var(--bad-700); border: 2px solid var(--surface);
}
.notif-menu { min-width: 320px; max-width: 380px; max-height: 420px; overflow-y: auto; padding: 4px; }
.notif-head { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); padding: 8px 10px 6px; }
.notif-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: var(--r-md); }
.notif-item.unread { background: var(--accent-50); }
.notif-item + .notif-item { margin-top: 1px; }

/* Demo ribbon */
.ribbon {
  background: var(--navy-900); color: var(--slate-300); font-size: var(--fs-sm);
  display: flex; align-items: center; justify-content: center; gap: 12px; padding: 7px 16px;
}
.ribbon button { background: none; border: 0; color: var(--slate-400); cursor: pointer; font-size: 16px; line-height: 1; padding: 2px; }
.ribbon button:hover { color: #fff; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-6); flex-wrap: wrap; }
.page-head .sub { color: var(--text-muted); font-size: var(--fs-base); max-width: 70ch; }
.page-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

/* ---------- Cards & grids ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card .card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); }
.card .card-head h3, .card .card-head h4 { margin: 0; }
.card .card-body { padding: var(--sp-5); }
.card .card-foot { padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--border); font-size: var(--fs-sm); color: var(--text-muted); }
.card.hoverable { transition: box-shadow 180ms, border-color 180ms; cursor: pointer; }
.card.hoverable:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.grid { display: grid; gap: var(--sp-5); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .cols-4 { grid-template-columns: repeat(2, 1fr); } .cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px)  { .cols-4, .cols-3, .cols-2 { grid-template-columns: 1fr; } }

/* Stat tile */
.stat { padding: var(--sp-4) var(--sp-5); }
.stat .label { font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: 2px; }
.stat .value { font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; line-height: 1.2; }
.stat .delta { font-size: var(--fs-xs); margin-top: 2px; }
.delta.up { color: var(--ok-700); } .delta.down { color: var(--bad-700); } .delta.flat { color: var(--text-faint); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.table-wrap.scroll-y { max-height: 440px; overflow-y: auto; } /* opt-in capped height; thead stays pinned */
table.table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.table th {
  text-align: left; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-faint); font-weight: 600; padding: 10px 14px; background: var(--slate-50);
  white-space: nowrap;
  /* sticky header: box-shadow instead of border so the rule travels with the sticky cell */
  position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 var(--border);
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--slate-100); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 120ms; }
.table tbody tr:hover { background: var(--accent-50); }
.table .row-click { cursor: pointer; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Badges & status ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--r-full);
  font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; border: 1px solid transparent;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok    { background: var(--ok-100);   color: var(--ok-700); }
.badge.warn  { background: var(--warn-100); color: var(--warn-700); }
.badge.bad   { background: var(--bad-100);  color: var(--bad-700); }
.badge.info  { background: var(--info-100); color: var(--info-700); }
.badge.na    { background: var(--na-100);   color: var(--na-700); }
.badge.purple{ background: var(--purple-100); color: var(--purple-700); }
.badge.accent{ background: var(--accent-100); color: var(--accent-700); }
.badge.outline { background: var(--surface); border-color: var(--border-strong); color: var(--text-muted); }
/* AI provenance badges */
.badge.ai { background: var(--info-100); color: var(--info-700); }
.badge.human { background: var(--ok-100); color: var(--ok-700); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; min-height: 36px;
  border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-body); font: 500 var(--fs-base) var(--font-sans); cursor: pointer;
  transition: background 150ms, border-color 150ms, color 150ms, transform 150ms; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--slate-100); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--accent-600); border-color: var(--accent-600); color: #fff; }
.btn.primary:hover { background: var(--accent-700); border-color: var(--accent-700); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent-600); }
.btn.ghost:hover { background: var(--accent-50); }
.btn.danger { background: var(--bad-700); border-color: var(--bad-700); color: #fff; }
.btn.danger:hover { filter: brightness(1.08); }
.btn.ok { background: var(--ok-700); border-color: var(--ok-700); color: #fff; }
.btn.sm { padding: 4px 10px; min-height: 28px; font-size: var(--fs-sm); }

/* ---------- Progress ---------- */
.progress { height: 8px; background: var(--slate-100); border-radius: var(--r-full); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent-600); border-radius: var(--r-full); }
.progress.ok > i { background: var(--ok-700); }
.progress.warn > i { background: var(--warn-700); }
.progress.bad > i { background: var(--bad-700); }
.progress.lg { height: 12px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: var(--sp-5); overflow-x: auto; }
.tab {
  padding: 9px 14px; font: 500 var(--fs-base) var(--font-sans); color: var(--text-muted); background: none;
  border: 0; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; transition: color 150ms;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent-700); border-bottom-color: var(--accent-600); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Forms ---------- */
label.field-label { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--text); margin-bottom: 5px; }
.input, select.input, textarea.input {
  width: 100%; padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: var(--r-md);
  font: 400 var(--fs-base)/1.4 var(--font-sans); color: var(--text); background: var(--surface);
  transition: border-color 150ms, box-shadow 150ms;
}
.input:focus { outline: none; border-color: var(--accent-500); box-shadow: 0 0 0 3px var(--accent-100); }
textarea.input { resize: vertical; min-height: 74px; }
.field { margin-bottom: var(--sp-4); }
.help { font-size: var(--fs-xs); color: var(--text-faint); margin-top: 4px; }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-faint); }
.search-box .input { padding-left: 32px; }

/* Maturity scale picker */
.scale { display: flex; gap: 6px; }
.scale button {
  width: 36px; height: 36px; border-radius: var(--r-md); border: 1px solid var(--border-strong);
  background: var(--surface); font: 600 var(--fs-base) var(--font-sans); color: var(--text-muted); cursor: pointer;
  transition: all 150ms;
}
.scale button:hover { border-color: var(--accent-500); color: var(--accent-700); }
.scale button:active { transform: translateY(1px); }
.scale button.sel { background: var(--accent-600); border-color: var(--accent-600); color: #fff; }
.scale button.na-btn { width: auto; padding: 0 10px; font-size: var(--fs-sm); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(2, 6, 23, 0.55); z-index: var(--z-modal);
  display: none; align-items: flex-start; justify-content: center; padding: 6vh var(--sp-4);
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: 84vh; overflow-y: auto;
}
.modal.wide { max-width: 760px; }
.modal .modal-head { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); }
.modal .modal-head h3 { margin: 0; }
.modal .modal-body { padding: var(--sp-5); }
.modal .modal-foot { display: flex; justify-content: flex-end; gap: var(--sp-2); padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--border); }
.modal .close-x { background: none; border: 0; cursor: pointer; color: var(--text-faint); padding: 4px; border-radius: var(--r-sm); }
.modal .close-x:hover { color: var(--text); background: var(--slate-100); }

/* ---------- Toast ---------- */
.toast-host { position: fixed; bottom: 24px; right: 24px; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--navy-900); color: var(--slate-100); padding: 10px 16px; border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); font-size: var(--fs-base); display: flex; align-items: center; gap: 10px;
  animation: toast-in 200ms ease-out;
}
.toast svg { width: 16px; height: 16px; color: #4ADE80; }
.toast.out { animation: toast-out 300ms ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(14px); } }

/* ---------- Phase stepper ---------- */
.stepper { display: flex; align-items: center; gap: 0; overflow-x: auto; padding: var(--sp-2) 0; }
.step { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.step .bubble {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; background: var(--slate-100); color: var(--text-faint); border: 2px solid var(--slate-300);
}
.step.done .bubble { background: var(--ok-700); border-color: var(--ok-700); color: #fff; }
.step.current .bubble { background: var(--accent-600); border-color: var(--accent-600); color: #fff; }
.step .step-label { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 500; }
.step.current .step-label { color: var(--text); font-weight: 600; }
.step-line { width: 42px; height: 2px; background: var(--slate-300); margin: 0 10px; flex-shrink: 0; }
.step-line.done { background: var(--ok-700); }

/* ---------- Clause tree ---------- */
.tree { font-size: var(--fs-base); }
.tree .tree-group { margin-bottom: 2px; }
.tree .tree-parent { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: var(--r-md); font-weight: 600; color: var(--text); cursor: pointer; }
.tree .tree-parent:hover { background: var(--slate-100); }
.tree .tree-kids { margin-left: 14px; border-left: 1px solid var(--border); padding-left: 8px; }
.tree .tree-leaf { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--r-md); color: var(--text-body); cursor: pointer; text-decoration: none; }
.tree .tree-leaf:hover { background: var(--slate-100); text-decoration: none; }
.tree .tree-leaf.active { background: var(--accent-50); color: var(--accent-700); font-weight: 600; }
.tree .ref { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-faint); min-width: 44px; }
.tree .tree-leaf.active .ref { color: var(--accent-700); }

/* ---------- 5x5 risk matrix ---------- */
.matrix { display: grid; grid-template-columns: auto repeat(5, 1fr); gap: 3px; font-size: var(--fs-xs); }
.matrix .axis { display: grid; place-items: center; color: var(--text-faint); font-weight: 600; padding: 4px; }
.matrix .cell {
  aspect-ratio: 1.6; border-radius: var(--r-sm); display: grid; place-items: center;
  font-weight: 700; color: rgba(2,6,23,0.72); position: relative; min-width: 46px;
}
.matrix .cell.g  { background: #BBF7D0; } .matrix .cell.y  { background: #FDE68A; }
.matrix .cell.o  { background: #FDBA74; } .matrix .cell.r  { background: #FCA5A5; }
.matrix .cell .pin {
  position: absolute; inset: auto 4px 4px auto; background: var(--navy-900); color: #fff;
  border-radius: var(--r-full); font-size: 10px; padding: 1px 6px; font-weight: 700;
}

/* ---------- Misc ---------- */
.muted { color: var(--text-muted); } .faint { color: var(--text-faint); }
.small { font-size: var(--fs-sm); } .xs { font-size: var(--fs-xs); }
.mono { font-family: var(--font-mono); font-size: 0.92em; }
.flex { display: flex; align-items: center; gap: var(--sp-2); }
.between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.wrap { flex-wrap: wrap; }
.mt-2 { margin-top: var(--sp-2); } .mt-4 { margin-top: var(--sp-4); } .mt-6 { margin-top: var(--sp-6); } .mt-8 { margin-top: var(--sp-8); }
.mb-2 { margin-bottom: var(--sp-2); } .mb-4 { margin-bottom: var(--sp-4); } .mb-6 { margin-bottom: var(--sp-6); }
.divider { border: 0; border-top: 1px solid var(--border); margin: var(--sp-5) 0; }
.kbd { font-family: var(--font-mono); font-size: 11px; background: var(--slate-100); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; }
.empty { text-align: center; padding: var(--sp-10); color: var(--text-faint); }
.callout { border: 1px solid var(--border); border-left: 3px solid var(--accent-600); background: var(--accent-50); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); font-size: var(--fs-base); }
.callout.warn { border-left-color: var(--warn-700); background: var(--warn-100); }
.callout.purple { border-left-color: var(--purple-700); background: var(--purple-100); }
.citation {
  border: 1px solid var(--border); background: var(--slate-50); border-radius: var(--r-md);
  padding: var(--sp-3); font-size: var(--fs-sm); color: var(--text-body);
}
.citation .src { font-size: var(--fs-xs); color: var(--text-faint); margin-top: 6px; display: flex; gap: 6px; align-items: center; }
.citation mark { background: var(--accent-100); color: var(--accent-700); padding: 0 2px; border-radius: 3px; }

/* Login page */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; background:
  radial-gradient(1000px 500px at 80% -10%, var(--accent-50), transparent), var(--bg); padding: var(--sp-6); }
.auth-card { width: 100%; max-width: 880px; }

/* ---------- Responsive shell ---------- */
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .sidebar nav { display: flex; overflow-x: auto; padding: 6px 10px; }
  .sidebar .nav-section, .sidebar .side-foot { display: none; }
  .nav-item { white-space: nowrap; }
  .content { padding: var(--sp-5) var(--sp-4) var(--sp-10); }
}
