/* Markets Dashboard: light bento fintech scratchpad. System fonts only, no external resources. */

:root {
  color-scheme: light;
  --canvas: #EEF0F4;
  --card: #FFFFFF;
  --ink: #121826;
  --ink-2: #2F3850;
  --muted: #566079;
  --line: #DCE0E9;
  --line-2: #C5CCDA;
  --field: #8791A5;
  --track: #8791A5;
  --cobalt: #2457F5;
  --cobalt-d: #1A45CC;
  --cobalt-t: #E8EEFF;
  --gain: #0E7A4B;
  --gain-t: #E2F4EA;
  --loss: #B3261E;
  --loss-t: #FCEAE8;
  --caution: #8A5300;
  --caution-t: #FFF2D9;
  --r-card: 20px;
  --r-ctl: 12px;
  --gap: 16px;
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --font: ui-sans-serif, system-ui, -apple-system, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 1px 2px rgba(18, 24, 38, 0.06), 0 10px 28px -14px rgba(18, 24, 38, 0.22);
  --shadow-pop: 0 2px 4px rgba(18, 24, 38, 0.1), 0 18px 40px -12px rgba(18, 24, 38, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--canvas);
  background-image: radial-gradient(rgba(18, 24, 38, 0.07) 1px, transparent 1.3px);
  background-size: 22px 22px;
  min-height: 100vh;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  overflow-x: hidden;
}

img, svg { max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--cobalt-d); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
code { font-family: var(--mono); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 16px; top: -80px;
  z-index: 100;
  background: var(--ink); color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 650;
  text-decoration: none;
}
.skip:focus { top: 12px; }

:focus-visible {
  outline: 3px solid var(--cobalt);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #fff;
  border-radius: 8px;
}
.limits :focus-visible, .toast :focus-visible, .kpi-hero :focus-visible { outline-color: #fff; box-shadow: 0 0 0 2px var(--ink); }

.wrap { width: min(100% - 32px, 1280px); margin-inline: auto; }
.page { padding-top: var(--s-5); padding-bottom: var(--s-6); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(238, 240, 244, 0.96);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.topbar.is-scrolled { border-bottom-color: var(--line-2); box-shadow: 0 8px 24px -16px rgba(18, 24, 38, 0.4); }
.topbar-in { display: flex; align-items: center; gap: var(--s-4); min-height: 64px; padding-block: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 750; letter-spacing: -0.01em; min-height: 44px; }
.brand-mark { width: 34px; height: 34px; flex: none; filter: drop-shadow(0 4px 8px rgba(36, 87, 245, 0.35)); }
.brand-name { font-size: 1.0625rem; white-space: nowrap; }
.nav { display: flex; gap: 4px; margin-inline: auto; }
.nav a {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  border-radius: 999px;
  color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 0.9375rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.nav a:hover { background: var(--cobalt-t); color: var(--cobalt-d); }
.nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.ni { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: none; }

.mini {
  display: inline-flex; align-items: baseline; gap: 8px;
  min-height: 40px; padding: 6px 14px;
  background: #fff; border: 1px solid var(--line-2); border-radius: 999px;
  text-decoration: none; color: var(--ink);
  box-shadow: 0 1px 2px rgba(18, 24, 38, 0.06);
  max-width: 100%; white-space: nowrap; overflow: hidden;
}
.mini:hover { border-color: var(--cobalt); color: var(--ink); }
.mini-l { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 650; }
.mini-v { font-weight: 750; text-overflow: ellipsis; overflow: hidden; }
.mini-pl { font-size: 0.8125rem; font-weight: 700; }
.mini-pl.gain { color: var(--gain); }
.mini-pl.loss { color: var(--loss); }
.mini-pl.flat { color: var(--muted); }

/* ---------- Typography ---------- */
h1 { font-size: clamp(1.875rem, 1.25rem + 2.8vw, 3.125rem); line-height: 1.06; letter-spacing: -0.028em; font-weight: 750; text-wrap: balance; }
h2 { font-size: clamp(1.125rem, 1.02rem + 0.45vw, 1.4375rem); line-height: 1.2; letter-spacing: -0.014em; font-weight: 700; }
h3 { font-size: 1.0625rem; line-height: 1.25; font-weight: 700; }
.eyebrow { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.09em; font-weight: 700; color: var(--cobalt-d); margin-bottom: 4px; }
.lede { font-size: clamp(1rem, 0.95rem + 0.3vw, 1.1875rem); color: var(--ink-2); max-width: 62ch; margin-top: var(--s-3); }
.hint { font-size: 0.9375rem; color: var(--ink-2); margin-bottom: var(--s-4); max-width: 72ch; }
.hint.center { text-align: center; margin: var(--s-3) auto; }
.fine { font-size: 0.8125rem; color: var(--muted); }
.h-sub { margin-top: var(--s-5); margin-bottom: var(--s-2); }

.noscript { background: var(--caution-t); border: 1.5px solid var(--caution); color: var(--ink); padding: 14px 18px; border-radius: 16px; margin-bottom: var(--s-4); }

/* ---------- Page head ---------- */
.page-head { display: grid; gap: var(--s-5); align-items: end; margin-bottom: var(--s-5); padding-block: var(--s-3) var(--s-2); }
.page-head-side { display: grid; gap: var(--s-3); justify-items: start; }
.badge-note { display: inline-flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line-2); border-radius: 14px; padding: 10px 14px; font-size: 0.875rem; font-weight: 600; color: var(--ink); box-shadow: 0 1px 2px rgba(18, 24, 38, 0.05); }
.badge-note svg { width: 20px; height: 20px; flex: none; color: var(--cobalt-d); }
.badge-note-flat { box-shadow: none; background: var(--cobalt-t); border-color: transparent; margin-top: var(--s-4); }
.page-head-slim h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem); }
@media (min-width: 900px) {
  .page-head { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .page-head-side { justify-items: end; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: var(--r-ctl);
  border: 1px solid transparent;
  font-weight: 650; font-size: 0.9375rem; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease, color 0.15s ease;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--cobalt); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 1px 2px rgba(26, 69, 204, 0.5), 0 8px 16px -8px rgba(36, 87, 245, 0.7);
}
.btn-primary:hover { background: var(--cobalt-d); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line-2); box-shadow: 0 1px 2px rgba(18, 24, 38, 0.05); }
.btn-ghost:hover { border-color: var(--cobalt); color: var(--cobalt-d); background: #fff; }
.btn-quiet { background: transparent; color: var(--cobalt-d); }
.btn-quiet:hover { background: var(--cobalt-t); color: var(--cobalt-d); }
.btn-danger { background: transparent; color: var(--loss); border-color: transparent; }
.btn-danger:hover { background: var(--loss-t); color: var(--loss); }
.btn-toast { background: #fff; color: var(--ink); min-height: 40px; padding: 0 14px; }
.btn-toast:hover { background: var(--cobalt-t); color: var(--ink); }
.btn:disabled { background: #E3E6EC; color: #566079; border-color: transparent; box-shadow: none; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-2); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; flex: none;
  background: transparent; border: 1px solid transparent; border-radius: 12px;
  color: var(--muted); font-size: 1.5rem; line-height: 1; cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--loss-t); color: var(--loss); }
.icon-btn-light { color: #fff; }
.icon-btn-light:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }

.chip-row { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-block: var(--s-3); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 16px;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line-2); border-radius: 999px;
  font-weight: 600; font-size: 0.9375rem; cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.chip:hover { border-color: var(--cobalt); color: var(--cobalt-d); }
.chip-small { min-height: 40px; padding: 0 14px; font-size: 0.875rem; }
.chip-quiet { background: transparent; border-style: dashed; }
.chip.is-on, .chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.is-on .chip-n, .chip[aria-pressed="true"] .chip-n { color: #DCE3F5; }
.chip-n { color: var(--muted); font-weight: 500; }

/* ---------- Forms ---------- */
.field { margin-bottom: var(--s-4); min-width: 0; }
.field label { display: block; font-weight: 650; font-size: 0.875rem; margin-bottom: 6px; }
.opt { font-weight: 500; color: var(--muted); font-size: 0.8125rem; margin-left: 4px; }
.field input[type="text"], .field input[type="search"], .field input[type="date"], .field select, .field textarea, .num-in input {
  width: 100%; min-height: 46px; padding: 0 14px;
  background: #fff; color: var(--ink);
  border: 1px solid var(--field); border-radius: var(--r-ctl);
  font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea { padding: 12px 14px; line-height: 1.5; resize: vertical; min-height: 96px; font-family: inherit; }
.field select, .tools select {
  appearance: none; -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5 8 5 5 5-5' fill='none' stroke='%23121826' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
input::placeholder, textarea::placeholder { color: #566079; opacity: 1; }
input:hover:not(:disabled), select:hover, textarea:hover { border-color: var(--ink-2); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--cobalt); }
[aria-invalid="true"] { border-color: var(--loss) !important; border-width: 2px !important; background-color: #FFF6F5 !important; }
.field-msg { font-size: 0.8125rem; color: var(--loss); font-weight: 600; margin-top: 6px; }
.field-msg:empty { display: none; }
.field-inline { display: flex; align-items: center; gap: var(--s-2); margin: 0; }
.field-inline label { margin: 0; white-space: nowrap; color: var(--muted); }
.field-inline select { width: auto; min-height: 44px; }
.form-grid { display: grid; gap: 0 var(--s-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--cobalt); cursor: pointer; margin: 0; }
.num-in { display: flex; align-items: center; gap: 6px; flex: none; font-weight: 650; }
.num-in input { width: 84px; text-align: right; padding: 0 10px; }

/* ---------- Cards and grids ---------- */
.card {
  background: var(--card);
  border: 1px solid rgba(18, 24, 38, 0.07);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: clamp(18px, 1.6vw + 8px, 28px);
  min-width: 0;
  position: relative;
  animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); flex-wrap: wrap; }
.card-h > div:first-child { min-width: 0; }
.card-f { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2) var(--s-3); margin-top: var(--s-4); padding-top: var(--s-3); border-top: 1px dashed var(--line-2); }
.card-f .fine { margin-left: auto; }
.tools { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2) var(--s-3); }

@keyframes rise { from { transform: translateY(12px); } to { transform: none; } }
.bento > .card:nth-child(2) { animation-delay: 0.05s; }
.bento > .card:nth-child(3) { animation-delay: 0.1s; }
.bento > .card:nth-child(4) { animation-delay: 0.15s; }
.bento > .card:nth-child(5) { animation-delay: 0.2s; }
.bento > .card:nth-child(n+6) { animation-delay: 0.25s; }

.bento { display: grid; gap: var(--gap); grid-template-columns: repeat(12, minmax(0, 1fr)); }
.bento-dash {
  grid-template-areas:
    "hold hold hold hold hold hold hold hold alloc alloc alloc alloc"
    "conc conc conc conc conc conc conc conc pl pl pl pl"
    "reb reb reb reb reb reb reb reb reb reb reb reb"
    "note note note note note note note note note note note note";
}
.c-note .ticks { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 28px; }
.c-hold { grid-area: hold; } .c-alloc { grid-area: alloc; } .c-conc { grid-area: conc; }
.c-pl { grid-area: pl; } .c-reb { grid-area: reb; } .c-note { grid-area: note; }

.bento-sc {
  grid-template-areas:
    "glob glob glob glob glob sum sum sum sum sum sum sum"
    "pos pos pos pos pos shift shift shift shift shift shift shift"
    "pos pos pos pos pos rec rec rec rec rec rec rec"
    "det det det det det det det det det det det det"
    "ass ass ass ass ass ass ass ass ass ass ass ass";
}
.c-glob { grid-area: glob; } .c-sum { grid-area: sum; } .c-pos { grid-area: pos; }
.c-shift { grid-area: shift; } .c-det { grid-area: det; } .c-rec { grid-area: rec; } .c-ass { grid-area: ass; }

.bento-j {
  align-items: start;
  grid-template-areas:
    "comp comp comp comp comp feed feed feed feed feed feed feed"
    "jnote jnote jnote jnote jnote feed feed feed feed feed feed feed";
}
.c-comp { grid-area: comp; } .c-feed { grid-area: feed; } .c-jnote { grid-area: jnote; }

.bento-contact {
  grid-template-areas:
    "form form form form form form form mail mail mail mail mail"
    "form form form form form form form expect expect expect expect expect"
    "faq faq faq faq faq faq faq faq faq faq faq faq";
}
.c-form { grid-area: form; } .c-mail { grid-area: mail; } .c-expect { grid-area: expect; } .c-faq { grid-area: faq; }

.bento-learn { grid-auto-flow: dense; }
.bento-sc.no-data { grid-template-areas: "rec rec rec rec rec rec ass ass ass ass ass ass"; align-items: start; }
@media (max-width: 1179px) { .bento-sc.no-data { grid-template-areas: "rec rec rec ass ass ass"; } }
@media (max-width: 899px) { .bento-sc.no-data { grid-template-areas: "rec rec rec rec rec rec" "ass ass ass ass ass ass"; } }
.s-4 { grid-column: span 4; } .s-6 { grid-column: span 6; } .s-8 { grid-column: span 8; } .s-12 { grid-column: span 12; }

@media (max-width: 1179px) {
  .bento { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .bento-dash {
    grid-template-areas:
      "alloc alloc alloc conc conc conc"
      "hold hold hold hold hold hold"
      "reb reb reb reb reb reb"
      "pl pl pl note note note";
  }
  .bento-sc {
    grid-template-areas:
      "glob glob glob sum sum sum"
      "pos pos pos shift shift shift"
      "pos pos pos rec rec rec"
      "det det det det det det"
      "ass ass ass ass ass ass";
  }
  .bento-j {
    grid-template-areas:
      "comp comp comp comp comp comp"
      "feed feed feed feed feed feed"
      "jnote jnote jnote jnote jnote jnote";
  }
  .bento-contact {
    grid-template-areas:
      "form form form form form form"
      "mail mail mail expect expect expect"
      "faq faq faq faq faq faq";
  }
  .s-4 { grid-column: span 3; } .s-6 { grid-column: span 3; } .s-8, .s-12 { grid-column: span 6; }
  .limits { grid-column: span 6; }
}
@media (max-width: 899px) {
  .bento-sc {
    grid-template-areas: "glob glob glob glob glob glob" "sum sum sum sum sum sum" "pos pos pos pos pos pos" "shift shift shift shift shift shift" "det det det det det det" "rec rec rec rec rec rec" "ass ass ass ass ass ass";
  }
  .bento-dash {
    grid-template-areas: "hold hold hold hold hold hold" "alloc alloc alloc alloc alloc alloc" "conc conc conc conc conc conc" "pl pl pl pl pl pl" "reb reb reb reb reb reb" "note note note note note note";
  }
  .bento-contact {
    grid-template-areas: "form form form form form form" "mail mail mail mail mail mail" "expect expect expect expect expect expect" "faq faq faq faq faq faq";
  }
}
@media (max-width: 639px) {
  .bento-learn .s-4, .bento-learn .s-6, .bento-learn .s-8, .bento-learn .s-12, .limits { grid-column: span 6; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- KPI strip ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi {
  background: var(--card);
  border: 1px solid rgba(18, 24, 38, 0.07);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
  min-width: 0;
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.kpi:nth-child(3) { animation-delay: 0.05s; } .kpi:nth-child(4) { animation-delay: 0.1s; } .kpi:nth-child(5) { animation-delay: 0.15s; }
.kpi-l { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--muted); }
.kpi-v { font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem); font-weight: 750; letter-spacing: -0.02em; line-height: 1.15; margin-top: 6px; overflow-wrap: anywhere; }
.kpi-s { font-size: 0.8125rem; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.kpi-hero {
  background: radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, 0.1), transparent 55%), var(--cobalt);
  border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(26, 69, 204, 0.5), 0 14px 30px -14px rgba(36, 87, 245, 0.8);
}
.kpi-hero .kpi-l, .kpi-hero .kpi-s { color: #EEF2FF; }
.kpi-hero .kpi-v { color: #fff; }
.kpi.is-gain .kpi-v { color: var(--gain); }
.kpi.is-loss .kpi-v { color: var(--loss); }
.kpi.is-gain .kpi-s { color: var(--gain); font-weight: 650; }
.kpi.is-loss .kpi-s { color: var(--loss); font-weight: 650; }

@media (max-width: 1099px) {
  .kpis:not(.kpis-4) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpis:not(.kpis-4) .kpi-hero { grid-column: 1 / -1; }
}
@media (max-width: 699px) {
  .kpis, .kpis:not(.kpis-4), .kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi { padding: 14px 16px; }
}

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; margin: 0 -4px; padding: 4px; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.tbl th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; text-align: left; padding: 0 8px 10px; white-space: nowrap; }
.tbl td, .tbl tbody th { padding: 8px; border-top: 1px solid var(--line); vertical-align: middle; text-transform: none; letter-spacing: 0; }
.tbl tbody th { font-size: 1rem; color: var(--ink); white-space: normal; font-weight: 650; }
.tbl .num { text-align: right; }
.tbl tbody tr:hover td, .tbl tbody tr:hover th { background: #F7F9FC; }
.tbl-small { max-width: 320px; margin-top: var(--s-4); }
.tbl-small td, .tbl-small th { padding: 8px 8px; }
.cell-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.cell-input {
  width: 100%; min-width: 74px; min-height: 44px; padding: 0 10px;
  background: #fff; border: 1px solid var(--field); border-radius: 10px;
  font-size: 1rem; font-variant-numeric: tabular-nums;
}
.cell-input.num { text-align: right; }
.cell-input.sym { text-transform: uppercase; font-weight: 650; min-width: 96px; }
.td-out .out-main { display: block; font-weight: 650; }
.td-out .out-sub { display: block; font-size: 0.8125rem; color: var(--muted); }
.out-main.gain, .gain { color: var(--gain); }
.out-main.loss, .loss { color: var(--loss); }
.out-main.flat, .flat { color: var(--muted); }
.td-name .sw { margin-right: 10px; vertical-align: -1px; }
.td-x { width: 52px; text-align: right; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 4px; flex: none; }
.trade { font-weight: 650; }
.trade.buy { color: var(--cobalt-d); }
.trade.sell { color: var(--caution); }
.trade.muted { color: var(--muted); font-weight: 500; }

.issues { display: grid; gap: 8px; margin-top: var(--s-3); }
.issues:empty { display: none; }
.issue { padding: 10px 14px; border-radius: 12px; font-size: 0.875rem; }
.issue-bad { background: var(--loss-t); border: 1px solid #E8A9A4; color: var(--ink); }
.issue-bad strong { color: var(--loss); }
.issue-info { background: #F1F3F8; border: 1px solid var(--line-2); color: var(--ink-2); }

/* ---------- Empty states ---------- */
.empty { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: var(--s-5); align-items: center; padding: var(--s-4); border: 1.5px dashed var(--line-2); border-radius: 16px; background: #FAFBFD; }
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--ink-2); margin-bottom: var(--s-3); max-width: 60ch; }
.empty-tight { grid-template-columns: minmax(0, 1fr); }
.empty-card { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: var(--s-5); align-items: center; margin-bottom: var(--gap); }
.empty-card h2 { margin-bottom: 8px; }
.empty-card p { color: var(--ink-2); margin-bottom: var(--s-3); max-width: 62ch; }
.ill { width: 100%; max-width: 220px; height: auto; justify-self: center; }
.ill-env { max-width: 180px; margin-bottom: var(--s-3); }
@media (max-width: 639px) {
  .empty, .empty-card { grid-template-columns: minmax(0, 1fr); text-align: left; }
  .ill { max-width: 160px; justify-self: start; }
}

/* ---------- Donut ---------- */
.donut-wrap { position: relative; width: min(100%, 280px); margin: 0 auto var(--s-4); aspect-ratio: 1; }
.donut-wrap svg { width: 100%; height: 100%; display: block; overflow: visible; }
.donut-track { stroke: #E3E7EF; }
.is-empty .donut-track { stroke: var(--line-2); stroke-dasharray: 5 7; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 22%; pointer-events: none; }
.dc-l { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }
.dc-v { font-size: clamp(1.0625rem, 0.9rem + 0.6vw, 1.375rem); font-weight: 750; letter-spacing: -0.02em; overflow-wrap: anywhere; line-height: 1.15; }
.legend { margin: 0; }
.legend li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto auto; gap: 4px 10px; align-items: center; padding: 9px 0; border-top: 1px dashed var(--line-2); font-size: 0.9375rem; }
.legend li:first-child { border-top: 0; }
.lg-n { font-weight: 650; overflow-wrap: anywhere; }
.lg-p { font-weight: 700; }
.lg-v { color: var(--muted); font-size: 0.8125rem; min-width: 5.5em; text-align: right; }
@media (max-width: 420px) { .legend li { grid-template-columns: 14px minmax(0, 1fr) auto; } .lg-v { display: none; } }

/* ---------- Concentration ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; border: 1.5px solid; margin-bottom: var(--s-4); color: var(--ink); }
.alert-ico { width: 26px; height: 26px; flex: none; margin-top: 1px; }
.alert-t { font-weight: 750; }
.alert-p { font-size: 0.9375rem; margin-top: 2px; }
.alert-neutral { background: #F1F3F8; border-color: var(--line-2); }
.alert-neutral .alert-ico { color: var(--ink-2); }
.alert-caution { background: var(--caution-t); border-color: #D7A453; }
.alert-caution .alert-ico, .alert-caution .alert-t { color: var(--caution); }
.alert-ok { background: var(--gain-t); border-color: #7CC3A0; }
.alert-ok .alert-ico, .alert-ok .alert-t { color: var(--gain); }
p.alert { align-items: center; margin: var(--s-3) 0 0; font-size: 0.9375rem; }

.meter { position: relative; height: 12px; border-radius: 99px; background: #E3E7EF; margin: 30px 0 var(--s-5); }
.meter-fill { height: 100%; width: 0; border-radius: 99px; background: var(--cobalt); transition: width 0.45s cubic-bezier(0.2, 0.7, 0.2, 1); }
.meter-fill.over { background: var(--caution); }
.meter-mark { position: absolute; top: -6px; bottom: -6px; width: 3px; margin-left: -1.5px; background: var(--ink); border-radius: 2px; transition: left 0.3s ease; }
.meter-mark span { background: #fff; padding: 0 4px; border-radius: 4px; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 3px; font-size: 0.75rem; font-weight: 700; color: var(--ink); white-space: nowrap; }
.meter-mark.flip span { left: auto; right: -2px; transform: none; }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini-stats > div { background: #F5F7FB; border-radius: 14px; padding: 12px 14px; }
.mini-stats dt { font-size: 0.75rem; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; }
.mini-stats dd { font-size: 1.25rem; font-weight: 750; margin-top: 2px; }

/* ---------- P/L bars ---------- */
.plbars { display: grid; gap: 14px; }
.pl-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 0.9375rem; margin-bottom: 6px; }
.pl-n { font-weight: 650; overflow-wrap: anywhere; }
.pl-v { font-weight: 700; }
.pl-track { position: relative; height: 10px; background: #E3E7EF; border-radius: 99px; }
.pl-track::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink-2); border-radius: 2px; }
.plbar { position: absolute; top: 0; bottom: 0; border-radius: 99px; transition: width 0.4s ease; }
.plbar.gain { left: 50%; background: var(--gain); }
.plbar.loss { right: 50%; background: var(--loss); }
.plbar.flat { left: 50%; background: var(--muted); }

/* ---------- Rebalance ---------- */
.reb-controls { display: grid; gap: var(--s-3) var(--s-5); grid-template-columns: minmax(0, 280px) auto minmax(0, 1fr); align-items: end; margin-bottom: var(--s-3); }
.reb-controls .field { margin: 0; }
.check-wrap { padding-bottom: 0; }
.reb-sum { font-weight: 650; padding: 10px 14px; border-radius: 12px; margin: var(--s-3) 0; background: #F1F3F8; border: 1px solid var(--line-2); font-size: 0.9375rem; }
.reb-sum.good { background: var(--gain-t); border-color: #7CC3A0; color: var(--ink); }
.reb-sum.warn { background: var(--caution-t); border-color: #D7A453; }
.reb-sum.bad { background: var(--loss-t); border-color: #E8A9A4; }
.reb-sum.good::before { content: "\2713  "; color: var(--gain); font-weight: 800; }
.reb-sum.warn::before { content: "\26A0  "; color: var(--caution); }
.reb-sum.bad::before { content: "\2715  "; color: var(--loss); font-weight: 800; }
.reb-net { margin: var(--s-3) 0; font-weight: 600; color: var(--ink-2); font-size: 0.9375rem; }
.reb-net:empty { display: none; }
@media (max-width: 899px) { .reb-controls { grid-template-columns: minmax(0, 1fr); align-items: start; } }

/* ---------- Lists ---------- */
.ticks, .crosses { display: grid; gap: 12px; }
.ticks li, .crosses li { position: relative; padding-left: 28px; color: var(--ink-2); }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.3em; width: 16px; height: 16px; border-radius: 50%; background: var(--cobalt-t) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4.500 8.200 2.300 2.300 4.700-5' fill='none' stroke='%231A45CC' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
.crosses li::before { content: ""; position: absolute; left: 0; top: 0.3em; width: 16px; height: 16px; border-radius: 50%; background: var(--loss-t) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m5.500 5.500 5 5m0-5-5 5' fill='none' stroke='%23B3261E' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
.ticks strong { color: var(--ink); }

/* ---------- Scenario sliders ---------- */
.sl-master { margin-bottom: var(--s-3); }
.sl-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sl-name { font-weight: 650; display: inline-flex; align-items: center; gap: 8px; }
.sl-out { font-size: 1.75rem; font-weight: 750; letter-spacing: -0.02em; }
.sl-meta { font-size: 0.8125rem; color: var(--muted); }
.sl-ctl { display: flex; align-items: center; gap: 14px; }
.ticks-row { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--muted); font-weight: 650; padding-right: 110px; margin-top: -4px; }
.sl-list { display: grid; gap: 4px; }
.sl-row { padding: 14px 0; border-top: 1px dashed var(--line-2); }
.sl-row:first-child { border-top: 0; padding-top: 4px; }
.sl-res { font-size: 0.875rem; font-weight: 650; color: var(--muted); }
.sl-res.gain { color: var(--gain); } .sl-res.loss { color: var(--loss); }

.range {
  --a: 50%; --b: 50%; --fill: var(--cobalt);
  -webkit-appearance: none; appearance: none;
  flex: 1 1 auto; min-width: 0; width: 100%;
  height: 44px; margin: 0; padding: 0;
  background: transparent; cursor: pointer;
}
.range.is-pos { --fill: var(--gain); }
.range.is-neg { --fill: var(--loss); }
.range::-webkit-slider-runnable-track {
  height: 8px; border-radius: 99px;
  background: linear-gradient(90deg, var(--track) 0%, var(--track) var(--a), var(--fill) var(--a), var(--fill) var(--b), var(--track) var(--b), var(--track) 100%);
}
.range::-moz-range-track {
  height: 8px; border-radius: 99px;
  background: linear-gradient(90deg, var(--track) 0%, var(--track) var(--a), var(--fill) var(--a), var(--fill) var(--b), var(--track) var(--b), var(--track) 100%);
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 28px; height: 28px; margin-top: -10px; border-radius: 50%;
  background: #fff; border: 4px solid var(--ink);
  box-shadow: 0 2px 6px rgba(18, 24, 38, 0.35);
  transition: transform 0.12s ease;
}
.range::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 4px solid var(--ink);
  box-shadow: 0 2px 6px rgba(18, 24, 38, 0.35);
}
.range:active::-webkit-slider-thumb { transform: scale(1.12); }
.range:focus-visible { outline-offset: 0; border-radius: 12px; }

/* ---------- Results ---------- */
.sum-hero { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; margin-bottom: var(--s-4); }
.sum-big { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); font-weight: 780; letter-spacing: -0.03em; line-height: 1.05; overflow-wrap: anywhere; }
.pill { display: inline-flex; align-items: center; padding: 5px 14px; border-radius: 999px; font-weight: 700; font-size: 0.9375rem; }
.pill-gain { background: var(--gain-t); color: var(--gain); }
.pill-loss { background: var(--loss-t); color: var(--loss); }
.pill-neutral { background: #E9ECF2; color: var(--ink-2); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.stat { background: #F5F7FB; border-radius: 14px; padding: 14px 16px; min-width: 0; }
.stat dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; color: var(--muted); }
.stat dd { margin: 3px 0 0; font-size: 1.1875rem; font-weight: 750; overflow-wrap: anywhere; line-height: 1.25; }
.stat .stat-sub { font-size: 0.8125rem; font-weight: 500; color: var(--muted); margin-top: 4px; }
.stack-bars { display: grid; gap: 14px; margin-bottom: var(--s-3); }
.sb-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 12px; }
.sb-l { font-weight: 700; font-size: 0.875rem; }
.sb { display: flex; gap: 2px; height: 40px; border-radius: 12px; overflow: hidden; background: #E3E7EF; }
.seg { display: block; height: 100%; min-width: 0; transition: width 0.45s cubic-bezier(0.2, 0.7, 0.2, 1); }
.rec-out { font-weight: 700; font-size: 1.0625rem; padding: 12px 16px; background: var(--cobalt-t); border-radius: 14px; color: var(--ink); }

/* ---------- Journal ---------- */
.filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 0 var(--s-4); }
.tagbar-l { font-size: 0.875rem; font-weight: 650; }
.timeline { position: relative; margin: var(--s-3) 0 0; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line-2); border-radius: 2px; }
.entry { position: relative; margin-bottom: 14px; }
.entry-dot { position: absolute; left: -26px; top: 22px; width: 16px; height: 16px; border-radius: 50%; background: var(--cobalt); border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--cobalt); }
.entry-card { background: #F7F8FB; border: 1px solid var(--line); border-radius: 16px; padding: 12px 8px 14px 16px; min-width: 0; }
.entry-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding-right: 0; }
.entry-head .icon-btn { margin-left: auto; }
.entry-sym { font-size: 1.0625rem; letter-spacing: 0.01em; }
.entry-date { color: var(--muted); font-size: 0.875rem; }
.entry-trade { font-size: 0.9375rem; font-weight: 600; margin-top: 2px; padding-right: 8px; }
.entry-why { margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; padding-right: 8px; }
.entry-change { margin-top: 8px; color: var(--ink-2); font-size: 0.9375rem; white-space: pre-wrap; overflow-wrap: anywhere; padding-right: 8px; }
.entry-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { min-height: 40px; padding: 0 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line-2); color: var(--cobalt-d); font-weight: 650; font-size: 0.875rem; cursor: pointer; }
.tag:hover { border-color: var(--cobalt); }
.tag.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.type-badge { display: inline-flex; align-items: center; padding: 3px 12px; border-radius: 999px; font-weight: 700; font-size: 0.8125rem; border: 1px solid transparent; white-space: nowrap; }
.type-buy { background: var(--cobalt-t); color: var(--cobalt-d); }
.type-sell { background: var(--ink); color: #fff; }
.type-hold { background: #E9ECF2; color: var(--ink); }
.type-watch { background: #F0E9FD; color: #4B25A8; }
.type-note { background: #fff; color: var(--ink-2); border-color: var(--line-2); }
#csv-out { font-family: var(--mono); font-size: 0.8125rem; }

/* ---------- Learn ---------- */
.hero-card { padding: clamp(22px, 3vw, 40px); background: linear-gradient(180deg, #fff, #F7F9FE); }
.art-card { display: grid; place-items: center; background: linear-gradient(160deg, #fff, var(--cobalt-t)); }
.art { width: 100%; max-width: 340px; height: auto; }
.metric h2 { margin-top: 10px; }
.metric-n { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--cobalt-t); color: var(--cobalt-d); font-weight: 750; font-size: 0.8125rem; letter-spacing: 0.04em; }
.formula { font-family: var(--mono); font-size: 0.875rem; background: #F1F3F8; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 12px 0; overflow-wrap: anywhere; color: var(--ink); }
.metric p:not(.formula):not(.eg):not(.metric-n) { color: var(--ink-2); font-size: 0.9375rem; }
.eg { margin-top: 12px; padding-left: 12px; border-left: 3px solid var(--cobalt); font-size: 0.9375rem; color: var(--ink-2); }
.eg-l { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 750; color: var(--cobalt-d); margin-bottom: 2px; }
.limits { background: var(--ink); color: #E6EAF3; border-color: var(--ink); }
.limits .eyebrow { color: #B9C8FB; }
.limits h2 { color: #fff; margin-bottom: var(--s-3); }
.limits .ticks li { color: #E6EAF3; }
.limits .ticks li::before { background-color: #2B3550; }
.gloss { display: grid; gap: 0; margin-top: var(--s-3); }
.gloss > div { padding: 12px 0; border-top: 1px dashed var(--line-2); }
.gloss > div:first-child { border-top: 0; }
.gloss dt { font-weight: 750; }
.gloss dd { color: var(--ink-2); font-size: 0.9375rem; margin-top: 2px; }
.faq { margin-top: var(--s-3); display: grid; gap: 8px; }
.faq details { border: 1px solid var(--line); border-radius: 14px; background: #F9FAFC; }
.faq summary { cursor: pointer; padding: 12px 16px; min-height: 46px; font-weight: 650; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 14px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.375rem; line-height: 1; color: var(--cobalt-d); font-weight: 600; flex: none; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding: 0 16px 14px; color: var(--ink-2); font-size: 0.9375rem; }

/* ---------- Contact ---------- */
.draft { margin-top: var(--s-5); padding: var(--s-4); background: var(--cobalt-t); border-radius: 16px; }
.draft p { margin: 6px 0 var(--s-3); color: var(--ink-2); }
.draft-pre { background: #fff; border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; font-family: var(--mono); font-size: 0.8125rem; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; margin: 0; }
.c-mail h2 { overflow-wrap: anywhere; font-size: clamp(1.125rem, 1rem + 0.8vw, 1.5rem); }
.c-mail p { margin: 6px 0 var(--s-3); color: var(--ink-2); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; width: min(560px, calc(100% - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: var(--ink); color: #fff; border-radius: 16px; padding: 8px 8px 8px 18px; box-shadow: var(--shadow-pop); animation: rise 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.toast-msg { flex: 1 1 auto; font-size: 0.9375rem; }

/* ---------- Footer ---------- */
.foot { margin-top: var(--s-6); background: #fff; border-top: 1px solid var(--line-2); padding-block: var(--s-6); }
.foot-in { display: grid; gap: var(--s-5); grid-template-columns: 1.3fr 1fr 1.4fr; align-items: start; }
.foot-name { font-weight: 750; font-size: 1.0625rem; margin-bottom: 4px; }
.foot-brand p, .foot-meta p { color: var(--ink-2); font-size: 0.9375rem; margin-bottom: 6px; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.foot-nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 999px; font-weight: 600; font-size: 0.9375rem; color: var(--ink); text-decoration: none; }
.foot-nav a:hover { background: var(--cobalt-t); color: var(--cobalt-d); }
.foot-meta a { font-weight: 650; }
@media (max-width: 899px) { .foot-in { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Mobile: bottom tab bar ---------- */
@media (max-width: 819px) {
  body { padding-bottom: 84px; }
  .topbar-in { justify-content: space-between; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px;
    margin: 0; padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    background: #fff; border-top: 1px solid var(--line-2);
    box-shadow: 0 -10px 30px -16px rgba(18, 24, 38, 0.4);
  }
  .nav a { flex-direction: column; justify-content: center; gap: 2px; padding: 4px 2px; min-height: 54px; border-radius: 14px; font-size: 0.75rem; position: relative; }
  .nav a[aria-current="page"] { background: var(--cobalt-t); color: var(--cobalt-d); }
  .nav a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--cobalt); }
  .ni { display: block; }
  .mini-l { display: none; }
  .toasts { bottom: 94px; }
  .brand-name { font-size: 1rem; }
}
@media (max-width: 420px) {
  .brand-name { font-size: 0.9375rem; }
  .brand-mark { width: 30px; height: 30px; }
  .mini { padding: 6px 10px; }
  .mini-pl { display: none; }
  .topbar-in { gap: 8px; }
}

/* ---------- Stacked tables on small screens ---------- */
@media (max-width: 719px) {
  .stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); }
  .stack, .stack tbody { display: block; }
  .stack tr { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 16px; background: #FAFBFD; }
  .stack td, .stack tbody th { display: block; padding: 0; border: 0; text-align: left; background: transparent !important; min-width: 0; }
  .stack td.num { text-align: left; }
  .stack .td-sym, .stack .td-name { grid-column: 1 / -1; padding-right: 48px; }
  .stack td[data-label]::before { content: attr(data-label); display: block; font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; }
  .stack .td-x { position: absolute; top: 6px; right: 6px; width: auto; }
  .stack .cell-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; clip-path: none; white-space: normal; display: block; font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
  .stack .cell-input.num, .stack .cell-input { text-align: left; min-width: 0; }
  .stack td:last-child:not(.td-x) { grid-column: 1 / -1; }
  .table-scroll { overflow: visible; }
  .card-f .fine { margin-left: 0; width: 100%; }
  .sb-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .ticks-row { padding-right: 96px; }
  .filters { grid-template-columns: minmax(0, 1fr); }
}

/* no-data layouts must win over the responsive area maps above */
.bento-sc.no-data { grid-template-areas: "rec rec rec rec rec rec ass ass ass ass ass ass"; }
@media (max-width: 1179px) { .bento-sc.no-data { grid-template-areas: "rec rec rec ass ass ass"; } }
@media (max-width: 899px) { .bento-sc.no-data { grid-template-areas: "rec rec rec rec rec rec" "ass ass ass ass ass ass"; } }

/* ---------- Print ---------- */
@media print {
  body { background: #fff; padding-bottom: 0; }
  .topbar, .nav, .skip, .toasts, .btn, .icon-btn, .tools, .card-f .btn, .chip-row, .filters, .tagbar, .foot-nav, .reb-controls, .field-inline { display: none !important; }
  .card, .kpi { box-shadow: none; border: 1px solid #999; animation: none; break-inside: avoid; }
  .bento { display: block; }
  .bento > .card { margin-bottom: 12px; }
  .kpis { grid-template-columns: repeat(5, 1fr); }
  .kpi-hero { background: #fff; }
  .kpi-hero .kpi-l, .kpi-hero .kpi-s, .kpi-hero .kpi-v { color: #000; }
  .cell-input { border: 0; padding: 0; }
  .foot { border: 0; }
  a { color: #000; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    animation-delay: 0s !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
