/* ============================================================
   Beany Portal - Design System (sample direction)
   Built by Sander as a working sample for Beany's cloud
   accounting portal. Every token below is a CSS variable so it
   maps 1:1 to a Tailwind theme / design-tokens.json and can be
   handed directly to Claude code for React/Tailwind build-out.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* Brand palette (sample - swaps to Beany's real hexes in one place) */
  --bone:    #F7F4EE;   /* app background, warm off-white */
  --paper:   #FFFFFF;   /* surface / cards */
  --paper-2: #FBF9F5;   /* sunken surface */
  --ink:     #1B1A17;   /* primary text */
  --ink-2:   #5C574E;   /* secondary text */
  --ink-3:   #8E887C;   /* muted text */
  --line:    #E8E3D8;   /* hairline border */
  --line-2:  #F0ECE3;   /* faint border */

  --primary:     #0F6B4F;  /* Beany green - actions, positive states */
  --primary-700: #0B533D;  /* hover / pressed */
  --primary-300: #5BA98C;  /* light accent line */
  --primary-50:  #E4F0EA;  /* tint surface */

  --accent:    #E07A43;    /* warm apricot - the human touch, used sparingly */
  --accent-50: #FBECE1;

  /* Status roles */
  --success:    #2F8F5B;  --success-bg: #E6F2EA;
  --warning:    #B27D17;  --warning-bg: #F7EED7;
  --danger:     #C24A39;  --danger-bg:  #F8E4DF;
  --info:       #2E6F8E;  --info-bg:    #E2EDF3;

  /* Typography */
  --font-display: "Fraunces", Georgia, serif;
  --font-ui: "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, monospace;

  /* Type scale (1.20 minor third, 16px base) */
  --t-xs:   0.75rem;   /* 12 */
  --t-sm:   0.875rem;  /* 14 */
  --t-base: 1rem;      /* 16 */
  --t-md:   1.125rem;  /* 18 */
  --t-lg:   1.375rem;  /* 22 */
  --t-xl:   1.75rem;   /* 28 */
  --t-2xl:  2.25rem;   /* 36 */
  --t-3xl:  3rem;      /* 48 */

  /* Spacing scale (4px base) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;

  /* Radius */
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px; --r-pill: 999px;

  /* Elevation */
  --sh-1: 0 1px 2px rgba(27,26,23,.04), 0 1px 3px rgba(27,26,23,.05);
  --sh-2: 0 2px 6px rgba(27,26,23,.05), 0 8px 24px rgba(27,26,23,.06);
  --sh-3: 0 12px 40px rgba(27,26,23,.12);

  --shell: 260px; /* sidebar width */
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  background: var(--bone);
  color: var(--ink);
  font-size: var(--t-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01";
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

.num { font-variant-numeric: tabular-nums lining-nums; }
.mono { font-family: var(--font-mono); }
.serif { font-family: var(--font-display); }

/* ============================================================
   APP SHELL
   ============================================================ */
.app { display: grid; grid-template-columns: var(--shell) 1fr; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
  background: var(--paper);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: var(--s-5) var(--s-4);
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 var(--s-2) var(--s-5); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--primary); color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 600; font-size: 20px;
}
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; letter-spacing: -.01em; }
.brand-name span { color: var(--accent); }

.nav-label {
  font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .12em;
  color: var(--ink-3); font-weight: 600; padding: var(--s-4) var(--s-2) var(--s-2);
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px var(--s-3); border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 500; font-size: var(--t-sm);
  width: 100%; text-align: left; transition: background .15s, color .15s;
}
.nav-item svg { width: 19px; height: 19px; stroke-width: 1.7; flex-shrink: 0; }
.nav-item:hover { background: var(--paper-2); color: var(--ink); }
.nav-item.active { background: var(--primary-50); color: var(--primary-700); font-weight: 600; }
.nav-item .badge-dot { margin-left: auto; }

.side-foot { margin-top: auto; padding-top: var(--s-5); }
.side-card {
  background: var(--accent-50); border-radius: var(--r);
  padding: var(--s-4); display: flex; flex-direction: column; gap: 8px;
}
.side-card .accountant { display: flex; align-items: center; gap: 10px; }
.side-card .accountant img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.side-card .accountant b { font-size: var(--t-sm); }
.side-card .accountant small { color: var(--ink-2); font-size: var(--t-xs); display: block; }

/* ---- Main ---- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: var(--s-4);
  padding: var(--s-4) var(--s-6);
  border-bottom: 1px solid var(--line); background: rgba(247,244,238,.85);
  backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-family: var(--font-display); font-weight: 500; font-size: var(--t-xl); letter-spacing: -.015em; }
.topbar .sub { color: var(--ink-3); font-size: var(--t-sm); margin-top: 1px; }
.topbar .spacer { flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 8px 14px; color: var(--ink-3); font-size: var(--t-sm); width: 240px;
}
.search svg { width: 16px; height: 16px; }
.search input { border: none; background: none; outline: none; font-family: inherit; font-size: var(--t-sm); color: var(--ink); width: 100%; }
.icon-btn {
  width: 40px; height: 40px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--paper); display: grid; place-items: center; color: var(--ink-2); position: relative;
}
.icon-btn svg { width: 19px; height: 19px; stroke-width: 1.7; }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); border: 2px solid var(--paper); }
.avatar-sm { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }

.content { padding: var(--s-6); max-width: 1240px; width: 100%; }
.screen { display: none; }
.screen.active { display: block; animation: rise .4s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============================================================
   PRIMITIVES (the component library)
   ============================================================ */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-ui); font-weight: 600; font-size: var(--t-sm);
  padding: 10px 18px; border-radius: var(--r-sm); transition: all .15s;
  border: 1px solid transparent; white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; stroke-width: 1.9; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-700); box-shadow: var(--sh-1); }
.btn-secondary { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--ink-3); }
.btn-ghost { background: transparent; color: var(--primary-700); }
.btn-ghost:hover { background: var(--primary-50); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(.95); }
.btn-sm { padding: 6px 12px; font-size: var(--t-xs); border-radius: 7px; }
.btn-lg { padding: 13px 24px; font-size: var(--t-base); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* Badges & status pills */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--t-xs); font-weight: 600; padding: 4px 10px; border-radius: var(--r-pill);
  letter-spacing: .01em;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-neutral { background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line); }
.badge.no-dot::before { display: none; }
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }

/* Cards */
.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--s-5); box-shadow: var(--sh-1);
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-4); }
.card-head h3 { font-size: var(--t-md); font-weight: 600; letter-spacing: -.01em; }
.card-head .link { color: var(--primary-700); font-size: var(--t-sm); font-weight: 600; }

/* Inputs */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s-4); }
.field label { font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }
.input, .select, .textarea {
  font-family: inherit; font-size: var(--t-sm); color: var(--ink);
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 11px 14px; width: 100%; transition: border .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.input::placeholder { color: var(--ink-3); }
.input-group { position: relative; }
.input-group .prefix { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: var(--t-sm); }
.input-group .input { padding-left: 30px; }
.field .hint { font-size: var(--t-xs); color: var(--ink-3); }
.field.error .input { border-color: var(--danger); }
.field.error .hint { color: var(--danger); }

/* Toggle */
.toggle { width: 42px; height: 24px; border-radius: var(--r-pill); background: var(--line); position: relative; transition: background .2s; flex-shrink: 0; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: left .2s; }
.toggle.on { background: var(--primary); }
.toggle.on::after { left: 20px; }

/* Tables */
.table-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); }
table.data { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
table.data thead th {
  text-align: left; font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-3); font-weight: 600; padding: 14px var(--s-5); background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}
table.data tbody td { padding: 15px var(--s-5); border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--paper-2); }
table.data .right { text-align: right; }
.cell-strong { font-weight: 600; color: var(--ink); }
.cell-mute { color: var(--ink-3); }
.amount-pos { color: var(--success); font-weight: 600; }
.amount-neg { color: var(--ink); font-weight: 600; }

/* Avatar group */
.avatar-stack { display: flex; }
.avatar-stack img, .avatar-stack span { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--paper); margin-left: -8px; object-fit: cover; }
.avatar-stack :first-child { margin-left: 0; }
.avatar-init { display: grid; place-items: center; background: var(--primary-50); color: var(--primary-700); font-size: var(--t-xs); font-weight: 700; }

/* Alerts */
.alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r); border: 1px solid; align-items: flex-start; }
.alert svg { width: 19px; height: 19px; flex-shrink: 0; margin-top: 1px; }
.alert b { font-weight: 600; }
.alert p { font-size: var(--t-sm); color: var(--ink-2); }
.alert-success { background: var(--success-bg); border-color: #BfDFC9; color: var(--success); }
.alert-warning { background: var(--warning-bg); border-color: #E8D49B; color: var(--warning); }
.alert-danger  { background: var(--danger-bg);  border-color: #E7BDB2; color: var(--danger); }
.alert-info    { background: var(--info-bg);    border-color: #B6D2DF; color: var(--info); }

/* Progress */
.progress { height: 8px; border-radius: var(--r-pill); background: var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: var(--r-pill); background: var(--primary); }

/* Tabs (segmented) */
.seg { display: inline-flex; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg button { padding: 7px 14px; border-radius: 7px; font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }
.seg button.active { background: var(--paper); color: var(--ink); box-shadow: var(--sh-1); }

/* ============================================================
   DASHBOARD layout helpers
   ============================================================ */
.grid { display: grid; gap: var(--s-5); }
.kpi-row { grid-template-columns: repeat(4, 1fr); }
.cols-3-1 { grid-template-columns: 2.1fr 1fr; align-items: start; }
.cols-2 { grid-template-columns: 1fr 1fr; }

.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-5); box-shadow: var(--sh-1); }
.kpi .label { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: var(--t-sm); font-weight: 500; }
.kpi .label .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary-700); }
.kpi .label .ic svg { width: 17px; height: 17px; stroke-width: 1.8; }
.kpi .value { font-family: var(--font-display); font-weight: 500; font-size: var(--t-2xl); letter-spacing: -.02em; margin: var(--s-3) 0 var(--s-1); }
.kpi .delta { font-size: var(--t-xs); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.kpi .delta.up { color: var(--success); }
.kpi .delta.down { color: var(--danger); }
.kpi .delta.flat { color: var(--ink-3); }

.welcome { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); margin-bottom: var(--s-6); }
.welcome h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--t-2xl); letter-spacing: -.02em; }
.welcome h2 b { font-weight: 600; }
.welcome p { color: var(--ink-2); margin-top: 4px; }

/* Chart */
.chart { width: 100%; height: 220px; }
.chart-legend { display: flex; gap: var(--s-5); margin-top: var(--s-3); font-size: var(--t-sm); color: var(--ink-2); }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 7px; vertical-align: middle; }

/* Task / checklist list */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line-2); }
.list-row:last-child { border-bottom: none; }
.check { width: 22px; height: 22px; border-radius: 7px; border: 1.8px solid var(--line); display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.check.done { background: var(--primary); border-color: var(--primary); }
.check svg { width: 13px; height: 13px; stroke-width: 2.6; }
.list-row .l-main { flex: 1; min-width: 0; }
.list-row .l-main b { font-size: var(--t-sm); font-weight: 600; display: block; }
.list-row.done .l-main b { color: var(--ink-3); text-decoration: line-through; }
.list-row .l-main small { color: var(--ink-3); font-size: var(--t-xs); }

/* Doc / message rows */
.doc-row, .msg-row { display: flex; align-items: center; gap: 14px; padding: 14px var(--s-5); border-bottom: 1px solid var(--line-2); }
.doc-row:last-child, .msg-row:last-child { border-bottom: none; }
.doc-ic { width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line); }
.doc-ic svg { width: 19px; height: 19px; }
.doc-row .d-main { flex: 1; min-width: 0; }
.doc-row .d-main b { font-size: var(--t-sm); font-weight: 600; display: block; }
.doc-row .d-main small { color: var(--ink-3); font-size: var(--t-xs); }

/* Messages screen */
.thread { display: flex; flex-direction: column; gap: var(--s-4); padding: var(--s-5); max-height: 460px; overflow: auto; }
.bubble { max-width: 74%; padding: 12px 16px; border-radius: var(--r-lg); font-size: var(--t-sm); line-height: 1.5; }
.bubble.them { background: var(--paper-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.me { background: var(--primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble small { display: block; margin-top: 5px; font-size: 11px; opacity: .7; }
.msg-meta { display: flex; align-items: center; gap: 8px; font-size: var(--t-xs); color: var(--ink-3); margin-bottom: -8px; }
.composer { display: flex; gap: 10px; padding: var(--s-4) var(--s-5); border-top: 1px solid var(--line); }

/* Empty state */
.empty { text-align: center; padding: var(--s-7) var(--s-5); color: var(--ink-3); }

/* Section heading */
.sec-h { display: flex; align-items: center; justify-content: space-between; margin: var(--s-6) 0 var(--s-4); }
.sec-h h2 { font-family: var(--font-display); font-weight: 500; font-size: var(--t-lg); letter-spacing: -.01em; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-scrim { position: fixed; inset: 0; background: rgba(27,26,23,.42); backdrop-filter: blur(3px); display: none; place-items: center; z-index: 100; padding: var(--s-5); }
.modal-scrim.open { display: grid; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--paper); border-radius: var(--r-lg); width: 100%; max-width: 460px; box-shadow: var(--sh-3); overflow: hidden; animation: rise .3s ease both; }
.modal-head { padding: var(--s-5) var(--s-5) 0; display: flex; justify-content: space-between; align-items: flex-start; }
.modal-head h3 { font-family: var(--font-display); font-weight: 600; font-size: var(--t-lg); }
.modal-body { padding: var(--s-4) var(--s-5); }
.modal-foot { padding: var(--s-4) var(--s-5) var(--s-5); display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--line-2); margin-top: var(--s-2); }

/* ============================================================
   DESIGN SYSTEM DOC page
   ============================================================ */
.ds-body { background: var(--bone); }
.ds-wrap { max-width: 1080px; margin: 0 auto; padding: var(--s-7) var(--s-5); }
.ds-hero { margin-bottom: var(--s-7); }
.ds-hero .eyebrow { font-family: var(--font-mono); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .18em; color: var(--accent); }
.ds-hero h1 { font-family: var(--font-display); font-weight: 400; font-size: var(--t-3xl); letter-spacing: -.025em; margin: var(--s-3) 0; line-height: 1.05; }
.ds-hero h1 b { font-weight: 600; }
.ds-hero p { color: var(--ink-2); font-size: var(--t-md); max-width: 640px; }
.ds-back { display: inline-flex; align-items: center; gap: 7px; font-size: var(--t-sm); font-weight: 600; color: var(--primary-700); margin-bottom: var(--s-5); }
.ds-back svg { width: 16px; height: 16px; }

.ds-section { margin-bottom: var(--s-7); scroll-margin-top: 90px; }
.ds-section > h2 { font-family: var(--font-display); font-weight: 500; font-size: var(--t-xl); letter-spacing: -.015em; margin-bottom: 6px; }
.ds-section > .lead { color: var(--ink-2); margin-bottom: var(--s-5); max-width: 680px; }
.ds-num { font-family: var(--font-mono); color: var(--accent); font-size: var(--t-sm); margin-right: 10px; }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-5); box-shadow: var(--sh-1); }

/* swatches */
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--s-4); }
.swatch { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--paper); }
.swatch .chip { height: 84px; }
.swatch .meta { padding: 12px 14px; }
.swatch .meta b { font-size: var(--t-sm); display: block; }
.swatch .meta .role { font-size: var(--t-xs); color: var(--ink-3); display: block; margin-top: 1px; }
.swatch .meta .hex { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--ink-2); margin-top: 6px; display: block; }

/* type specimens */
.type-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-5); padding: var(--s-4) 0; border-bottom: 1px solid var(--line-2); }
.type-row:last-child { border-bottom: none; }
.type-row .spec { color: var(--ink); }
.type-row .meta { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--ink-3); white-space: nowrap; }

/* spacing scale */
.space-row { display: flex; align-items: center; gap: var(--s-4); padding: 8px 0; }
.space-row .bar { background: var(--primary-300); height: 16px; border-radius: 3px; }
.space-row .lbl { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--ink-2); width: 120px; }

/* component demo grid */
.demo { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: center; }
.demo-block { display: grid; gap: var(--s-4); }
.demo-label { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; margin-bottom: var(--s-2); }

/* code block */
.code {
  background: #181712; color: #EDE8DD; border-radius: var(--r); padding: var(--s-4) var(--s-5);
  font-family: var(--font-mono); font-size: var(--t-sm); line-height: 1.7; overflow-x: auto;
}
.code .c { color: #8E887C; }
.code .k { color: #7FC9A6; }
.code .v { color: #E5A06E; }

.token-table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.token-table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); }
.token-table tr:last-child td { border-bottom: none; }
.token-table .tk { font-family: var(--font-mono); color: var(--primary-700); }
.token-table .sw { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); display: inline-block; vertical-align: middle; margin-right: 10px; }

/* ds nav */
.ds-toc { position: sticky; top: var(--s-5); display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--s-6); padding-bottom: var(--s-5); border-bottom: 1px solid var(--line); }
.ds-toc a { font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--paper); }
.ds-toc a:hover { border-color: var(--primary-300); color: var(--primary-700); }

.callout { display: flex; gap: 14px; background: var(--accent-50); border: 1px solid #F0D5C2; border-radius: var(--r-lg); padding: var(--s-5); margin-bottom: var(--s-6); }
.callout svg { width: 24px; height: 24px; color: var(--accent); flex-shrink: 0; }
.callout b { font-weight: 600; }
.callout p { color: var(--ink-2); font-size: var(--t-sm); margin-top: 3px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
.menu-btn { display: none; }
@media (max-width: 980px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .cols-3-1, .cols-2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  :root { --shell: 0px; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 60; width: 270px; height: 100vh;
    transform: translateX(-100%); transition: transform .25s; box-shadow: var(--sh-3);
  }
  .sidebar.open { transform: none; }
  .app { grid-template-columns: 1fr; }
  .menu-btn { display: grid; }
  .scrim-m { position: fixed; inset: 0; background: rgba(27,26,23,.4); z-index: 55; display: none; }
  .scrim-m.open { display: block; }
  .search { display: none; }
  .content { padding: var(--s-4); }
  .topbar { padding: var(--s-4); }
  .type-row { flex-direction: column; align-items: flex-start; gap: 6px; }
}
@media (max-width: 620px) {
  .kpi-row { grid-template-columns: 1fr; }
  .grid[style*="repeat(3,1fr)"] { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .welcome { flex-direction: column; align-items: flex-start; }
  .welcome .btn { width: 100%; justify-content: center; }
  .kpi .value { font-size: var(--t-xl); }
  .ds-hero h1 { font-size: var(--t-2xl); }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
}
