/* =========================================================================
   Advisor & Client Experience — demo stylesheet

   One token system, three display modes. Nothing here is a hardcoded colour or
   a spacing value off the scale: §10.1 treats those as defects, and the audit of
   the inherited prototype found 575 raw hex literals against a single var().

   Sections
     1  fonts
     2  tokens
     3  reset and base
     4  primitives
     5  components
     6  charts
     7  demo shell
     8  guided mode
     9  screens
    10  web-mobile
    11  native-app
    12  motion and reduced motion
   ========================================================================= */

/* ---------------------------------- 1 fonts ----------------------------- */
/* Self-hosted. §14.1 allows no browser request to any external origin, so the
   CDN links inherited from the prototype are gone.                          */

@font-face { font-family: Inter; src: url('./fonts/inter-400.8909904ab6.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: Inter; src: url('./fonts/inter-500.f3779f1efc.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: Inter; src: url('./fonts/inter-600.f9a06e79cd.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: Inter; src: url('./fonts/inter-700.6f56409fd3.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter Tight'; src: url('./fonts/inter-tight-600.db1a039d03.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter Tight'; src: url('./fonts/inter-tight-700.9c4f02f386.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap; }

/* ---------------------------------- 2 tokens ---------------------------- */

:root {
  /* surfaces */
  --surface-page:    #F4F6F9;
  --surface-0:       #FFFFFF;
  --surface-1:       #F7F9FB;
  --surface-2:       #EDF1F5;
  --surface-3:       #E2E8EF;
  --surface-inverse: #0D0D12;
  --surface-inverse-1: #1A1B22;

  /* text — every value below measured against its surface for WCAG AA */
  --text-strong:  #0D0D12;   /* 18.9:1 on surface-0 */
  --text-body:    #35384A;   /* 10.4:1 */
  --text-muted:   #666D80;   /*  5.2:1 — the floor for text */
  --text-inverse: #FFFFFF;
  --text-on-accent: #FFFFFF;

  /* borders */
  --border-subtle: #E4E9EF;
  --border-default: #D3DAE3;
  --border-strong: #A9B4C2;   /* 3.1:1 — the floor for control borders */

  /* accents. Two values per meaning: a text-safe dark and the bright original
     for graphics. The inherited brights fail AA as text — #2EBD85 is 2.40:1 —
     and they were being used as text. */
  --accent-positive:      #2EBD85;
  --accent-positive-text: #177A53;   /* 4.6:1 on surface-0 */
  --accent-positive-soft: #E7F8F0;
  --accent-negative:      #E2464A;
  --accent-negative-text: #B3261E;   /* 5.0:1 */
  --accent-negative-soft: #FDECEC;
  --accent-attention:      #D98324;
  --accent-attention-text: #8A4B00;  /* 5.6:1 */
  --accent-attention-soft: #FFF4E5;
  --accent-info:      #4F6BED;
  --accent-info-text: #2F45B8;       /* 5.4:1 */
  --accent-info-soft: #EEF1FE;

  /* type scale */
  --font-sans: Inter, system-ui, -apple-system, sans-serif;
  --font-num: 'Inter Tight', Inter, system-ui, sans-serif;
  --text-2xs: 11px;  --lh-2xs: 16px;
  --text-xs:  12px;  --lh-xs: 18px;
  --text-sm:  13px;  --lh-sm: 20px;
  --text-md:  15px;  --lh-md: 22px;
  --text-lg:  18px;  --lh-lg: 26px;
  --text-xl:  22px;  --lh-xl: 30px;
  --text-2xl: 28px;  --lh-2xl: 36px;
  --text-3xl: 36px;  --lh-3xl: 44px;
  --text-4xl: 44px;  --lh-4xl: 52px;

  /* spacing — multiples of 4 only */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-7: 32px; --space-8: 40px;
  --space-9: 48px; --space-10: 64px;

  /* radius */
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px; --radius-xl: 20px;
  --radius-pill: 999px;

  /* elevation — three steps, not seventy-seven */
  --elev-1: 0 1px 2px rgba(13, 13, 18, .05);
  --elev-2: 0 4px 12px rgba(13, 13, 18, .07);
  --elev-3: 0 16px 40px rgba(13, 13, 18, .12);

  /* focus ring */
  --focus-ring: 0 0 0 2px var(--surface-0), 0 0 0 4px var(--accent-info);

  /* motion */
  --dur-1: 120ms; --dur-2: 180ms; --dur-3: 260ms;
  --ease-out: cubic-bezier(.2, .8, .3, 1);
  --ease-in-out: cubic-bezier(.4, 0, .2, 1);

  /* layout */
  --shell-h: 52px;
  --sidebar-w: 244px;
  --content-max: 1240px;
}

/* ---------------------------- 3 reset and base -------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--lh-md);
  color: var(--text-body);
  background: var(--surface-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; color: var(--text-strong); font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: var(--text-2xl); line-height: var(--lh-2xl); }
h2 { font-size: var(--text-lg); line-height: var(--lh-lg); }
h3 { font-size: var(--text-md); line-height: var(--lh-md); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* Prose lines stay in the 45–75 character band §10.1 asks for. */
.prose { max-width: 62ch; }

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }

:focus { outline: none; }
:focus-visible { box-shadow: var(--focus-ring); border-radius: var(--radius-sm); outline: none; }

.num { font-family: var(--font-num); font-variant-numeric: tabular-nums;
       font-feature-settings: 'tnum' 1; letter-spacing: -.01em; }

.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;
}

::selection { background: var(--accent-info-soft); color: var(--text-strong); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: var(--radius-pill);
  border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------ 4 primitives ---------------------------- */

.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.gap-1 { gap: var(--space-1); } .gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); } .gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); } .gap-6 { gap: var(--space-6); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.label { font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--text-muted);
         font-weight: 500; }
.label-up { font-size: var(--text-2xs); line-height: var(--lh-2xs); color: var(--text-muted);
            font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.muted { color: var(--text-muted); }
.small { font-size: var(--text-sm); line-height: var(--lh-sm); }
.xs { font-size: var(--text-xs); line-height: var(--lh-xs); }

.pos { color: var(--accent-positive-text); }
.neg { color: var(--accent-negative-text); }
.warn { color: var(--accent-attention-text); }

.chip {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: 2px var(--space-2); border-radius: var(--radius-pill);
  font-size: var(--text-2xs); line-height: 18px; font-weight: 600;
  background: var(--surface-2); color: var(--text-body); white-space: nowrap;
}
.chip--pos { background: var(--accent-positive-soft); color: var(--accent-positive-text); }
.chip--neg { background: var(--accent-negative-soft); color: var(--accent-negative-text); }
.chip--warn { background: var(--accent-attention-soft); color: var(--accent-attention-text); }
.chip--info { background: var(--accent-info-soft); color: var(--accent-info-text); }
.chip--ghost { background: transparent; border: 1px solid var(--border-default); color: var(--text-muted); }

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 40px; padding: 0 var(--space-4); border-radius: var(--radius-md);
  font-size: var(--text-sm); font-weight: 600; color: var(--text-strong);
  background: var(--surface-0); border: 1px solid var(--border-default);
  transition: background var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out),
              transform var(--dur-1) var(--ease-out);
}
.btn:hover { background: var(--surface-1); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--surface-inverse); border-color: var(--surface-inverse);
                color: var(--text-inverse); }
.btn--primary:hover { background: var(--surface-inverse-1); border-color: var(--surface-inverse-1); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text-strong); }
.btn--sm { min-height: 32px; padding: 0 var(--space-3); font-size: var(--text-xs); }
.btn--block { width: 100%; }
.btn--danger { color: var(--accent-negative-text); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-md); color: var(--text-muted);
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text-strong); }

.field { display: flex; flex-direction: column; gap: var(--space-1); }
.input {
  min-height: 40px; padding: 0 var(--space-3); border-radius: var(--radius-md);
  background: var(--surface-0); border: 1px solid var(--border-default);
  color: var(--text-strong); font-size: var(--text-sm);
  transition: border-color var(--dur-1) var(--ease-out);
}
.input:hover { border-color: var(--border-strong); }
.input:focus-visible { border-color: var(--accent-info); box-shadow: var(--focus-ring); }
textarea.input { min-height: 84px; padding: var(--space-2) var(--space-3);
                 line-height: var(--lh-sm); resize: vertical; }

.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--surface-2);
       border-radius: var(--radius-md); }
.seg button {
  min-height: 30px; padding: 0 var(--space-3); border-radius: var(--radius-sm);
  font-size: var(--text-xs); font-weight: 600; color: var(--text-muted);
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.seg button:hover { color: var(--text-strong); }
.seg button[aria-pressed="true"] { background: var(--surface-0); color: var(--text-strong);
  box-shadow: var(--elev-1); }

.switch {
  position: relative; width: 38px; height: 22px; border-radius: var(--radius-pill);
  background: var(--border-default); flex: none;
  transition: background var(--dur-2) var(--ease-out);
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--surface-0); box-shadow: var(--elev-1);
  transition: transform var(--dur-2) var(--ease-out);
}
[aria-pressed="true"] > .switch { background: var(--accent-positive-text); }
[aria-pressed="true"] > .switch::after { transform: translateX(16px); }

.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 36px; height: 36px; border-radius: var(--radius-md);
  font-family: var(--font-num); font-size: var(--text-xs); font-weight: 600;
  letter-spacing: .02em;
}
.avatar--sm { width: 28px; height: 28px; font-size: var(--text-2xs); border-radius: var(--radius-sm); }
.avatar--lg { width: 48px; height: 48px; font-size: var(--text-sm); border-radius: var(--radius-lg); }
/* Initials, never faces: the inherited avatar images had unestablished
   provenance, and generated faces move the risk rather than remove it. */

/* ------------------------------ 5 components ---------------------------- */

.card {
  background: var(--surface-0); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); box-shadow: var(--elev-1);
}
.card__head { padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border-subtle);
              display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.card__body { padding: var(--space-5); }
.card__body--flush { padding: 0; }
.card__foot { padding: var(--space-3) var(--space-5); border-top: 1px solid var(--border-subtle);
              background: var(--surface-1); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.metric { display: flex; flex-direction: column; gap: var(--space-1); }
.metric__value { font-family: var(--font-num); font-size: var(--text-2xl);
                 line-height: var(--lh-2xl); font-weight: 600; color: var(--text-strong); }
.metric__value--hero { font-size: var(--text-4xl); line-height: var(--lh-4xl); }
.metric__value { overflow-wrap: anywhere; }
.metric__delta { font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: 600; }

.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
  position: sticky; top: 0; z-index: 1; text-align: left; white-space: nowrap;
  padding: var(--space-2) var(--space-4); background: var(--surface-1);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-2xs); font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em;
}
.table th.right, .table td.right { text-align: right; }
.table td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-subtle);
            font-size: var(--text-sm); }
.table tbody tr { transition: background var(--dur-1) var(--ease-out); }
.table tbody tr[tabindex]:hover { background: var(--surface-1); cursor: pointer; }
.table tfoot td { padding: var(--space-3) var(--space-4); background: var(--surface-1);
  font-weight: 600; color: var(--text-strong); font-size: var(--text-sm);
  border-top: 1px solid var(--border-default); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.sortable { display: inline-flex; align-items: center; gap: var(--space-1);
            color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; }
.sortable:hover { color: var(--text-strong); }

.list { display: flex; flex-direction: column; }
.list__item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--border-subtle);
  transition: background var(--dur-1) var(--ease-out);
}
.list__item:last-child { border-bottom: 0; }
.list__item--action { cursor: pointer; }
.list__item--action:hover { background: var(--surface-1); }

/* Signal card — the wow surface. Reason in plain language, cause on demand. */
.signal {
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  background: var(--surface-0); overflow: hidden;
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.signal:hover { border-color: var(--border-strong); box-shadow: var(--elev-2); }
.signal[data-open="true"] { border-color: var(--accent-info); box-shadow: var(--elev-2); }
.signal__btn { display: block; width: 100%; text-align: left; padding: var(--space-3) var(--space-4); }
.signal__why {
  padding: 0 var(--space-4) var(--space-4);
  border-top: 1px dashed var(--border-default);
  animation: reveal var(--dur-3) var(--ease-out) both;
}
.signal__why-row { display: flex; gap: var(--space-2); padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle); font-size: var(--text-sm);
  animation: rise var(--dur-2) var(--ease-out) both; }
.signal__why-row:last-of-type { border-bottom: 0; }

.empty {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2);
  padding: var(--space-6); background: var(--surface-1);
  border: 1px dashed var(--border-default); border-radius: var(--radius-md);
}
.empty__title { font-weight: 600; color: var(--text-strong); font-size: var(--text-sm); }

.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s var(--ease-in-out) infinite;
  border-radius: var(--radius-sm); }

.notice {
  display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md); font-size: var(--text-sm); line-height: var(--lh-sm);
  background: var(--accent-info-soft); color: var(--accent-info-text);
}
.notice--warn { background: var(--accent-attention-soft); color: var(--accent-attention-text); }
.notice--muted { background: var(--surface-2); color: var(--text-body); }

.note {
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  background: var(--surface-1); border: 1px solid var(--border-subtle);
  animation: rise var(--dur-2) var(--ease-out) both;
}

.toast {
  position: fixed; left: 50%; bottom: var(--space-6); transform: translateX(-50%);
  z-index: 60; display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  background: var(--surface-inverse); color: var(--text-inverse); box-shadow: var(--elev-3);
  font-size: var(--text-sm); animation: toast-in var(--dur-3) var(--ease-out) both;
}
.toast button { color: var(--accent-positive); font-weight: 600; }

.modal-scrim {
  position: fixed; inset: 0; z-index: 70; background: rgba(13, 13, 18, .38);
  display: flex; align-items: center; justify-content: center; padding: var(--space-4);
  animation: fade var(--dur-2) var(--ease-out) both;
}
.modal {
  width: 100%; max-width: 560px; background: var(--surface-0);
  border-radius: var(--radius-xl); box-shadow: var(--elev-3); overflow: hidden;
  animation: pop var(--dur-3) var(--ease-out) both;
}
.modal__head { padding: var(--space-5); border-bottom: 1px solid var(--border-subtle);
               display: flex; align-items: center; justify-content: space-between; }
.modal__body { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); }
.modal__foot { padding: var(--space-4) var(--space-5); border-top: 1px solid var(--border-subtle);
               display: flex; justify-content: flex-end; gap: var(--space-2);
               background: var(--surface-1); }

.progress { height: 6px; border-radius: var(--radius-pill); background: var(--surface-2);
            overflow: hidden; }
.progress__bar { height: 100%; border-radius: var(--radius-pill);
  background: var(--accent-positive-text); transition: width var(--dur-3) var(--ease-out); }

/* ------------------------------- 6 charts ------------------------------- */

.spark { display: block; width: 100%; height: auto; }
.spark path.line { fill: none; stroke: var(--accent-info); stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.spark path.area { fill: url(#lineFade); stroke: none; }
.spark path.bench { fill: none; stroke: var(--border-strong); stroke-width: 1.5;
  stroke-dasharray: 4 4; }
.spark .grid { stroke: var(--border-subtle); stroke-width: 1; }
.spark .axis-label { font-size: 10px; fill: var(--text-muted); font-family: var(--font-num); }
.spark.animate path.line, .spark.animate path.bench {
  stroke-dasharray: var(--len); stroke-dashoffset: var(--len);
  animation: draw 720ms var(--ease-out) forwards;
}
.spark.animate path.area { animation: fade var(--dur-3) var(--ease-out) 200ms both; }

.bars { display: flex; align-items: flex-end; gap: 3px; height: 48px; }
.bars__bar { flex: 1; border-radius: 2px 2px 0 0; background: var(--accent-info);
  transform-origin: bottom; animation: grow var(--dur-3) var(--ease-out) both; }
.bars__bar--neg { background: var(--accent-negative); }

.alloc__row { display: grid; grid-template-columns: 128px 1fr 88px; align-items: center;
              gap: var(--space-3); padding: var(--space-2) 0; }
.alloc__track { position: relative; height: 10px; border-radius: var(--radius-pill);
                background: var(--surface-2); }
.alloc__fill { position: absolute; inset: 0 auto 0 0; border-radius: var(--radius-pill);
  background: var(--accent-info); transform-origin: left;
  animation: grow var(--dur-3) var(--ease-out) both; }
.alloc__target { position: absolute; top: -3px; bottom: -3px; width: 2px;
  background: var(--text-strong); border-radius: 1px; }
.alloc__legend { display: flex; gap: var(--space-4); flex-wrap: wrap; }
.alloc__legend-item { display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); color: var(--text-muted); }
.alloc__legend-mark { width: 12px; height: 10px; border-radius: 2px; background: var(--accent-info); }
.alloc__legend-mark--target { width: 2px; height: 14px; border-radius: 1px;
  background: var(--text-strong); }

/* ----------------------------- 7 demo shell ----------------------------- */
/* The shell belongs to the demo, not to the product being demonstrated.     */

.shell {
  position: sticky; top: 0; z-index: 50; min-height: var(--shell-h);
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--surface-inverse); color: var(--text-inverse);
}
.shell__badge {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 3px var(--space-3); border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .1); font-size: var(--text-2xs); font-weight: 600;
  letter-spacing: .04em; white-space: nowrap;
}
.shell__badge .dot { background: var(--accent-positive); animation: pulse 2.4s var(--ease-in-out) infinite; }
.shell__sep { width: 1px; height: 22px; background: rgba(255, 255, 255, .16); flex: none; }
/* Below the width where every control fits on one line, the bar wraps instead of
   widening the document. Six of seven controls used to sit off-screen at 375,
   About this demo among them. */
@media (max-width: 820px) {
  .shell { row-gap: var(--space-2); }
  .shell .grow { flex-basis: 100%; height: 0; }
}
.shell select {
  height: 32px; padding: 0 var(--space-2); border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18);
  color: var(--text-inverse); font-size: var(--text-xs); font-weight: 500;
}
.shell select:focus-visible { box-shadow: 0 0 0 2px var(--surface-inverse), 0 0 0 4px var(--accent-info); }
.shell__link { color: rgba(255, 255, 255, .78); font-size: var(--text-xs); font-weight: 500;
  padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); }
.shell__link:hover { color: var(--text-inverse); background: rgba(255, 255, 255, .1); }
.shell__seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--radius-md);
  background: rgba(255, 255, 255, .1); }
.shell__seg button { min-height: 28px; padding: 0 var(--space-2); border-radius: var(--radius-sm);
  font-size: var(--text-2xs); font-weight: 600; color: rgba(255, 255, 255, .7);
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out); }
.shell__seg button:hover { color: var(--text-inverse); }
.shell__seg button[aria-pressed="true"] { background: var(--surface-0); color: var(--text-strong); }

/* ---------------------------- 8 guided mode ----------------------------- */

.guide {
  position: fixed; z-index: 55; width: min(340px, calc(100vw - 32px));
  background: var(--surface-0); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); box-shadow: var(--elev-3);
  animation: rise var(--dur-3) var(--ease-out) both;
}
.guide__head { display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-2); padding: var(--space-3) var(--space-4) 0; }
.guide__body { padding: var(--space-2) var(--space-4) var(--space-4);
  font-size: var(--text-sm); line-height: var(--lh-sm); }
.guide__step { font-family: var(--font-num); font-size: var(--text-2xs); font-weight: 600;
  color: var(--accent-info-text); letter-spacing: .04em; }
.guide--web { right: var(--space-5); bottom: var(--space-5); width: min(316px, calc(100vw - 32px)); }
.guide--mobile { left: var(--space-3); right: var(--space-3); bottom: calc(var(--space-3) + 64px);
  width: auto; max-height: 33vh; overflow: auto; }
.guide--native { left: var(--space-5); top: 50%; transform: translateY(-50%);
  width: min(300px, calc(50vw - 240px)); }
/* When the gutter is too small to hold it, the guide goes under the phone rather
   than over it: §12.2 forbids the tip entering the phone screen at all. */
@media (max-width: 1120px) {
  .guide--native { left: 50%; top: auto; bottom: var(--space-4);
    transform: translateX(-50%); width: min(340px, calc(100vw - 32px)); }
}
.guide__origin { margin-top: var(--space-2); }

/* -------------------------------- 9 screens ----------------------------- */

.app { display: flex; min-height: calc(100vh - var(--shell-h)); }

.sidebar {
  width: var(--sidebar-w); flex: none; padding: var(--space-5) var(--space-3);
  background: var(--surface-0); border-right: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; gap: var(--space-5);
  position: sticky; top: var(--shell-h); height: calc(100vh - var(--shell-h));
}
.brand { display: flex; flex-direction: column; gap: 2px; padding: 0 var(--space-3); }
.brand__mark { font-family: var(--font-num); font-size: var(--text-lg); font-weight: 600;
  color: var(--text-strong); letter-spacing: -.02em; }
.brand__desc { font-size: var(--text-xs); color: var(--text-muted); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__item {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: 40px; padding: 0 var(--space-3); border-radius: var(--radius-md);
  font-size: var(--text-sm); font-weight: 500; color: var(--text-body);
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.nav__item:hover { background: var(--surface-2); color: var(--text-strong); }
.nav__item[aria-current="page"] { background: var(--surface-inverse); color: var(--text-inverse); }
.nav__item[aria-current="page"] .nav__count { color: rgba(255, 255, 255, .7); }
.nav__count { margin-left: auto; font-family: var(--font-num); font-size: var(--text-xs);
  color: var(--text-muted); }

.main { flex: 1 1 auto; min-width: 0; padding: var(--space-6);
        display: flex; flex-direction: column; gap: var(--space-5); }
.main__inner { width: 100%; max-width: var(--content-max); margin: 0 auto;
               display: flex; flex-direction: column; gap: var(--space-5); }

.page-head { display: flex; flex-direction: column; gap: var(--space-2); }
.asof { display: inline-flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
  font-size: var(--text-xs); color: var(--text-muted); }

.grid { display: grid; gap: var(--space-5); }
.grid--kpi { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid > * { min-width: 0; }
.grid--2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.grid--halves { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }

.crumb { display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); font-weight: 600; color: var(--text-muted); }
.crumb:hover { color: var(--text-strong); }

.client-shell { width: 100%; max-width: 760px; margin: 0 auto; padding: var(--space-6) var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-5); }
/* The portal header sits in its own shell above the view's shell; without this
   the two paddings stack into a gap that reads as a rendering fault. */
.client-shell--header { padding-bottom: 0; }
.client-shell--header + * .client-shell,
.client-shell--header ~ .client-shell { padding-top: var(--space-4); }

/* Guided mode is a floating layer, and §12.2 says it must not block what is
   underneath. On narrow layouts it takes room at the end of the scroll; from
   1200px up the content column shifts instead, so nothing is covered at all. */
:root[data-guided="on"] .main,
:root[data-guided="on"] .client-shell { padding-bottom: 172px; }
:root[data-guided="on"] .client-shell--header { padding-bottom: 0; }
:root[data-guided="on"] .native-scroll { padding-bottom: 0; }

/* No width is taken from the layout: the reserve is vertical only, so the grid
   keeps its column count with the guide on. */
.client-nav { display: flex; gap: var(--space-1); padding: var(--space-1);
  background: var(--surface-2); border-radius: var(--radius-md); }
.client-nav a { flex: 1; text-align: center; min-height: 36px; display: flex;
  align-items: center; justify-content: center; border-radius: var(--radius-sm);
  font-size: var(--text-xs); font-weight: 600; color: var(--text-muted); }
.client-nav a[aria-current="page"] { background: var(--surface-0); color: var(--text-strong);
  box-shadow: var(--elev-1); }

.auth-wrap { min-height: calc(100vh - var(--shell-h)); display: flex; align-items: center;
  justify-content: center; padding: var(--space-6); }
.auth-card { width: 100%; max-width: 420px; }
.channel-pop {
  position: fixed; z-index: 65; right: var(--space-6); top: var(--space-8);
  width: min(340px, calc(100vw - 32px));
  background: var(--surface-0); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); box-shadow: var(--elev-3); overflow: hidden;
  animation: slide-in var(--dur-3) var(--ease-out) both;
}
.channel-pop__head { display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3); background: var(--surface-2);
  font-size: var(--text-2xs); font-weight: 600; color: var(--text-muted); }
.channel-pop__body { padding: var(--space-3); display: flex; flex-direction: column;
  gap: var(--space-2); }
.channel-pop__code { font-family: var(--font-num); font-size: var(--text-2xl);
  font-weight: 700; letter-spacing: .18em; color: var(--text-strong); }

/* ------------------------------ 10 web-mobile --------------------------- */
/* A different layout, not a narrower desktop.                              */

:root[data-mode="web-mobile"] .app,
:root[data-mode="native-app"] .app { flex-direction: column; }

:root[data-mode="web-mobile"] .sidebar,
:root[data-mode="native-app"] .sidebar { display: none; }

:root[data-mode="web-mobile"] .main { padding: var(--space-4) var(--space-4) 88px; }
:root[data-mode="web-mobile"] .grid--2,
:root[data-mode="web-mobile"] .grid--halves { grid-template-columns: minmax(0, 1fr); }
:root[data-mode="web-mobile"] .metric__value { font-size: var(--text-xl); line-height: var(--lh-xl); }
:root[data-mode="web-mobile"] .metric__value--hero { font-size: var(--text-2xl); line-height: var(--lh-2xl); }
:root[data-mode="web-mobile"] .grid--kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
:root[data-mode="web-mobile"] .alloc__row { grid-template-columns: 96px 1fr 72px; }
:root[data-mode="web-mobile"] .client-shell { padding: var(--space-4) var(--space-4) 88px; }
:root[data-mode="web-mobile"] .modal-scrim { align-items: flex-end; padding: 0; }
:root[data-mode="web-mobile"] .modal { max-width: none; border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  animation: sheet-up var(--dur-3) var(--ease-out) both; }
:root[data-mode="web-mobile"] .channel-pop { left: var(--space-3); right: var(--space-3);
  width: auto; top: var(--space-4); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: none; align-items: stretch;
  padding: var(--space-1) var(--space-2) calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
  background: var(--surface-0); border-top: 1px solid var(--border-subtle);
}
:root[data-mode="web-mobile"] .tabbar { display: flex; }
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-height: 48px; border-radius: var(--radius-md);
  font-size: 10px; font-weight: 600; color: var(--text-muted);
}
.tabbar a[aria-current="page"] { color: var(--text-strong); }
.tabbar a[aria-current="page"] .tabbar__dot { opacity: 1; }
.tabbar__dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text-strong);
  opacity: 0; transition: opacity var(--dur-1) var(--ease-out); }

/* Cards instead of tables on narrow layouts. */
.cardlist { display: flex; flex-direction: column; }
.cardlist__item { display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-subtle); }
.cardlist__item:last-child { border-bottom: 0; }
:root[data-mode="web-desktop"] .cardlist { display: none; }
:root[data-mode="web-mobile"] .table-wrap,
:root[data-mode="native-app"] .table-wrap { display: none; }

/* ------------------------------ 11 native-app --------------------------- */
/* Its own idiom: status bar, tab bar, push stack, sheets.                   */

.frame-stage {
  display: none; min-height: calc(100vh - var(--shell-h));
  padding: var(--space-7) var(--space-4);
  background:
    radial-gradient(900px 420px at 20% -10%, #E8EEF6 0%, rgba(232, 238, 246, 0) 70%),
    radial-gradient(700px 380px at 92% 8%, #EAF6F0 0%, rgba(234, 246, 240, 0) 72%),
    var(--surface-page);
  align-items: center; justify-content: center; gap: var(--space-8);
}
:root[data-mode="native-app"][data-frame="on"] .frame-stage { display: flex; }
:root[data-mode="native-app"][data-frame="on"] .app { display: none; }

.frame-note { max-width: 300px; display: flex; flex-direction: column; gap: var(--space-3); }

.device {
  position: relative; width: 390px; flex: none;
  border-radius: 44px; padding: 12px; background: #14161C;
  box-shadow: var(--elev-3), inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.device__screen {
  position: relative; isolation: isolate; height: 780px; max-height: min(780px, calc(100vh - 200px));
  border-radius: 33px; overflow: hidden; background: var(--surface-page);
  display: flex; flex-direction: column;
}
.device__notch {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 104px; height: 26px; border-radius: var(--radius-pill); background: #14161C; z-index: 5;
}

.statusbar {
  display: none; align-items: center; justify-content: space-between; flex: none;
  padding: var(--space-2) var(--space-5) var(--space-1);
  font-family: var(--font-num); font-size: var(--text-2xs); font-weight: 600;
  color: var(--text-strong); background: var(--surface-page);
}
:root[data-mode="native-app"] .statusbar { display: flex; }
.statusbar__glyphs { display: inline-flex; gap: 5px; align-items: center; }
.statusbar__bar { width: 3px; border-radius: 1px; background: var(--text-strong); }

.native-nav {
  display: none; align-items: center; gap: var(--space-2); flex: none;
  padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-0);
}
:root[data-mode="native-app"] .native-nav { display: flex; }
.native-nav__title { font-size: var(--text-sm); font-weight: 600; color: var(--text-strong);
  flex: 1; text-align: center; }

.native-scroll { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.native-tabbar {
  display: none; flex: none; align-items: stretch;
  padding: var(--space-1) var(--space-2) var(--space-2);
  background: var(--surface-0); border-top: 1px solid var(--border-subtle);
}
:root[data-mode="native-app"] .native-tabbar { display: flex; }
:root[data-mode="native-app"][data-frame="off"] .native-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
}
:root[data-mode="native-app"][data-frame="off"] .native-nav { position: sticky; top: 0; z-index: 44; }
:root[data-mode="native-app"][data-frame="off"] .main,
:root[data-mode="native-app"][data-frame="off"] .client-shell { padding-bottom: 96px; }
.native-tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; min-height: 48px; font-size: 10px; font-weight: 600;
  color: var(--text-muted); border-radius: var(--radius-md); }
.native-tabbar a[aria-current="page"] { color: var(--text-strong); }

:root[data-mode="native-app"] .main,
:root[data-mode="native-app"] .client-shell { padding: var(--space-4) var(--space-4) var(--space-6); }
:root[data-mode="native-app"] .grid--2,
:root[data-mode="native-app"] .grid--halves { grid-template-columns: minmax(0, 1fr); }
:root[data-mode="native-app"] .grid--kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
:root[data-mode="native-app"] .metric__value { font-size: var(--text-xl); line-height: var(--lh-xl); }
:root[data-mode="native-app"] .metric__value--hero { font-size: var(--text-2xl); line-height: var(--lh-2xl); }
:root[data-mode="native-app"] .card { border-radius: var(--radius-md); }
:root[data-mode="native-app"] .alloc__row { grid-template-columns: 96px 1fr 72px; }
:root[data-mode="native-app"] .modal-scrim { align-items: flex-end; padding: 0; }
:root[data-mode="native-app"] .modal { max-width: none;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  animation: sheet-up var(--dur-3) var(--ease-out) both; }
.sheet-grip { width: 36px; height: 4px; border-radius: 2px; background: var(--border-strong);
  margin: var(--space-2) auto 0; }

/* Overlays are absolute inside the phone screen when the frame is shown, so a
   sheet or a toast cannot spill across the browser window. */
.device__screen .modal-scrim { position: absolute; inset: 0; z-index: 20; padding: 0;
  align-items: flex-end; }
.device__screen .modal { max-width: none; border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  animation: sheet-up var(--dur-3) var(--ease-out) both; max-height: 86%; overflow: auto; }
.device__screen .toast { position: absolute; left: 50%; bottom: 76px; z-index: 22;
  width: max-content; max-width: 88%; }
.device__screen .channel-pop { position: absolute; left: var(--space-3); right: var(--space-3);
  top: var(--space-6); width: auto; z-index: 24; }

/* Push transition: entering a deeper screen slides in from the trailing edge. */
:root[data-mode="native-app"] .push-enter { animation: push-in var(--dur-3) var(--ease-out) both; }
:root[data-mode="native-app"] .push-back { animation: push-back var(--dur-3) var(--ease-out) both; }

/* --------------------- 12 motion and reduced motion -------------------- */

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes reveal { from { opacity: 0; max-height: 0; } to { opacity: 1; max-height: 420px; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(8px); }
                 to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); }
                      to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes push-in { from { opacity: .4; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes push-back { from { opacity: .4; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes count { from { opacity: .35; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

.counting { animation: count var(--dur-1) var(--ease-out) both; }

/* A working flow without movement, not a broken one. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    transition-duration: .001ms !important;
  }
  .spark.animate path.line, .spark.animate path.bench { stroke-dashoffset: 0 !important; }
  .signal__why { max-height: none !important; }
}

/* Reflow at 200% zoom and on the 640–1023 band: one content column, icon rail. */
@media (max-width: 1023px) {
  :root[data-mode="web-desktop"] .sidebar { width: 72px; }
  :root[data-mode="web-desktop"] .brand__desc,
  :root[data-mode="web-desktop"] .nav__item span.nav__text,
  :root[data-mode="web-desktop"] .nav__count { display: none; }
  :root[data-mode="web-desktop"] .nav__item { justify-content: center; padding: 0; }
  :root[data-mode="web-desktop"] .grid--2,
  :root[data-mode="web-desktop"] .grid--halves { grid-template-columns: minmax(0, 1fr); }
  /* In the icon rail the wordmark and the footer note have no room to be read;
     showing them wrapped over three lines is worse than not showing them. */
  :root[data-mode="web-desktop"] .brand { align-items: center; padding: 0; }
  :root[data-mode="web-desktop"] .brand__mark {
    font-size: var(--text-sm); text-align: center; white-space: nowrap;
    overflow: hidden; text-overflow: clip; max-width: 100%;
  }
  :root[data-mode="web-desktop"] .sidebar > p.xs { display: none; }
}

@media print { .shell, .guide, .tabbar, .frame-stage { display: none !important; } }

/* ===================== 13 native-app: its own layout ======================
   Not the web views restyled — a different structure. Inset grouped lists with
   separators that stop short of the leading edge, large titles, disclosure rows,
   hero figures instead of a card grid. A review measured the first attempt and
   found the bodies byte-identical to web-mobile; this section is the answer.
   ========================================================================= */

.n-page { display: flex; flex-direction: column; gap: var(--space-5);
  padding: var(--space-2) 0 var(--space-8); }

.n-title { padding: var(--space-3) var(--space-5) 0; }
.n-title h1 { font-size: var(--text-3xl); line-height: var(--lh-3xl); letter-spacing: -.02em; }

.n-asof { padding: 0 var(--space-5); font-size: var(--text-xs); line-height: var(--lh-xs);
  color: var(--text-muted); display: flex; align-items: center; gap: var(--space-1); flex-wrap: wrap; }

.n-hero { padding: var(--space-2) var(--space-5) 0; display: flex; flex-direction: column; gap: 2px; }
.n-hero__value { font-size: var(--text-4xl); line-height: var(--lh-4xl); font-weight: 600;
  color: var(--text-strong); }
.n-hero__foot { font-size: var(--text-sm); font-weight: 600; }

.n-section { display: flex; flex-direction: column; gap: var(--space-2); }
.n-section__head { padding: 0 var(--space-5); font-size: var(--text-2xs); font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .07em; }
.n-section__foot { padding: 0 var(--space-5); font-size: var(--text-xs); line-height: var(--lh-xs);
  color: var(--text-muted); }

/* Inset grouped list: rounded container, hairline separators inset from the
   leading edge, the platform convention rather than a bordered card. */
.n-list { margin: 0 var(--space-4); background: var(--surface-0);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--elev-1); }

.n-row { display: flex; align-items: center; gap: var(--space-3); width: 100%;
  min-height: 52px; padding: var(--space-3) var(--space-4); text-align: left;
  position: relative; background: none; color: inherit; }
.n-row::after { content: ''; position: absolute; left: var(--space-4); right: 0; bottom: 0;
  height: 1px; background: var(--border-subtle); }
.n-row:last-child::after { display: none; }
.n-row--action { transition: background var(--dur-1) var(--ease-out); }
.n-row--action:active { background: var(--surface-2); }
.n-row--stack { align-items: flex-start; }
.n-row__lead { flex: none; display: inline-flex; }
.n-row__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.n-row__title { font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--text-strong); }
.n-row__sub { font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--text-muted); }
.n-row__value { flex: none; font-size: var(--text-sm); font-weight: 600; color: var(--text-strong);
  text-align: right; }
.n-row__chev { flex: none; color: var(--border-strong); display: inline-flex;
  transition: transform var(--dur-2) var(--ease-out); }
[data-open="true"] > .n-row .n-row__chev--rot { transform: rotate(90deg); }

.n-check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; color: var(--text-inverse);
  transition: background var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out); }
.n-check.is-done { background: var(--accent-positive-text); border-color: var(--accent-positive-text); }

.n-signal { position: relative; }
.n-signal__why { padding: 0 var(--space-4) var(--space-4) var(--space-4);
  background: var(--surface-1); animation: reveal var(--dur-3) var(--ease-out) both; }
.n-signal__why .label-up { padding-top: var(--space-3); }
.n-why-row { display: flex; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-2) 0; border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm); animation: rise var(--dur-2) var(--ease-out) both; }
.n-why-row:last-of-type { border-bottom: 0; }
.n-note { margin-top: var(--space-2); font-size: var(--text-2xs); color: var(--text-muted); }

/* Segmented control: the platform's tab affordance, not a row of links. */
.n-segment { display: flex; margin: 0 var(--space-4); padding: 2px; gap: 2px;
  background: var(--surface-2); border-radius: var(--radius-md); }
.n-segment button { flex: 1; min-height: 34px; border-radius: var(--radius-sm);
  font-size: var(--text-xs); font-weight: 600; color: var(--text-muted);
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out); }
.n-segment button[aria-pressed="true"] { background: var(--surface-0); color: var(--text-strong);
  box-shadow: var(--elev-1); }

.n-actions { display: flex; flex-direction: column; gap: var(--space-2); padding: 0 var(--space-4); }
.n-cta { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 46px; border-radius: var(--radius-md); background: var(--surface-inverse);
  color: var(--text-inverse); font-size: var(--text-sm); font-weight: 600;
  transition: transform var(--dur-1) var(--ease-out); }
.n-cta:active { transform: scale(.985); }
.n-cta--ghost { background: var(--surface-0); color: var(--text-strong);
  border: 1px solid var(--border-default); }
.n-signal__why .n-cta { width: 100%; margin-top: var(--space-3); }

.n-chart { display: flex; flex-direction: column; gap: var(--space-2);
  margin: 0 var(--space-4); padding: var(--space-4); background: var(--surface-0);
  border-radius: var(--radius-lg); box-shadow: var(--elev-1); }

.n-filter { display: flex; align-items: center; justify-content: space-between;
  margin: 0 var(--space-4); padding: var(--space-2) var(--space-3);
  background: var(--accent-info-soft); color: var(--accent-info-text);
  border-radius: var(--radius-md); font-size: var(--text-xs); font-weight: 600; }
.n-filter button { color: inherit; text-decoration: underline; min-height: 32px; padding: 0 var(--space-2); }
.n-total { display: flex; justify-content: space-between; gap: var(--space-3); }

.n-alloc { position: relative; height: 8px; border-radius: var(--radius-pill);
  background: var(--surface-2); margin-top: var(--space-1); }
.n-alloc__fill { position: absolute; inset: 0 auto 0 0; border-radius: var(--radius-pill);
  background: var(--accent-info); transform-origin: left;
  animation: grow var(--dur-3) var(--ease-out) both; }
.n-alloc__target { position: absolute; top: -3px; bottom: -3px; width: 2px;
  background: var(--text-strong); border-radius: 1px; }

.n-tag { flex: none; align-self: flex-start; padding: 2px var(--space-2);
  border-radius: var(--radius-pill); font-size: var(--text-2xs); font-weight: 600;
  background: var(--surface-2); color: var(--text-muted); }
.n-tag.is-client { background: var(--accent-positive-soft); color: var(--accent-positive-text); }

.n-lock { display: flex; gap: var(--space-2); margin: 0 var(--space-4);
  padding: var(--space-3); border-radius: var(--radius-md); background: var(--surface-2);
  font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--text-body); }

.n-page .empty { margin: 0 var(--space-4); }
