/* AI Trading Platform dashboard. System fonts only, no outside files.
   Colour rules: green/red only for gains and losses (always with + / − signs); one identity colour per AI
   (Grok blue, OpenAI orange, both AIs together teal) used for marks only, never for text; amber for demo
   and warnings. The three AI colours are the first three slots of the validated categorical palette. */

:root {
  color-scheme: light;
  --page: #f4f4f1;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --surface-3: #e6e5e0;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #646360;
  --faint: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.1);
  --border-strong: rgba(11, 11, 11, 0.2);
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.05), 0 4px 16px rgba(11, 11, 11, 0.06);
  --gain: #006300;
  --loss: #b42318;
  --grok: #2a78d6;
  --openai: #eb6834;
  --claude: #a3542a;
  --gemini: #7a3fd1;
  --both: #1baf7a;
  --invested: #5b4bd6;
  --cash: #e0a526;
  --portfolio: #5b4bd6;
  --sp500: #d6336c;
  --target: #b7791f;
  --warn-bg: #fff5d6;
  --warn-ink: #5c3d00;
  --warn-line: #e3a008;
  --agreed-bg: #dcf2e9;
  --agreed-ink: #0a4d36;
  --btn-bg: #151514;
  --btn-ink: #ffffff;
  --toast-bg: #1c1c1b;
  --toast-ink: #ffffff;
  --focus: #0b0b0b;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #232321;
    --surface-3: #2e2e2b;
    --ink: #f5f5f2;
    --ink-2: #c3c2b7;
    --muted: #a5a49c;
    --faint: #898781;
    --grid: #2c2c2a;
    --axis: #45453f;
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.2);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.35);
    --gain: #2fb52f;
    --loss: #f2726a;
    --grok: #3987e5;
    --openai: #d95926;
    --claude: #e0905f;
    --gemini: #b48cf2;
    --both: #199e70;
    --invested: #9b8cf2;
    --cash: #f0b73c;
    --portfolio: #9b8cf2;
    --sp500: #f06595;
    --target: #f0b73c;
    --warn-bg: #33280a;
    --warn-ink: #ffd98a;
    --warn-line: #c98f00;
    --agreed-bg: #0f3127;
    --agreed-ink: #8fe3c3;
    --btn-bg: #f5f5f2;
    --btn-ink: #111110;
    --toast-bg: #f5f5f2;
    --toast-ink: #111110;
    --focus: #f5f5f2;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #232321;
  --surface-3: #2e2e2b;
  --ink: #f5f5f2;
  --ink-2: #c3c2b7;
  --muted: #a5a49c;
  --faint: #898781;
  --grid: #2c2c2a;
  --axis: #45453f;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);
  --gain: #2fb52f;
  --loss: #f2726a;
  --grok: #3987e5;
  --openai: #d95926;
  --claude: #e0905f;
  --gemini: #b48cf2;
  --both: #199e70;
  --invested: #9b8cf2;
  --cash: #f0b73c;
  --portfolio: #9b8cf2;
  --sp500: #f06595;
  --target: #f0b73c;
  --warn-bg: #33280a;
  --warn-ink: #ffd98a;
  --warn-line: #c98f00;
  --agreed-bg: #0f3127;
  --agreed-ink: #8fe3c3;
  --btn-bg: #f5f5f2;
  --btn-ink: #111110;
  --toast-bg: #f5f5f2;
  --toast-ink: #111110;
  --focus: #f5f5f2;
}

/* ── base ── */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.45 var(--font);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
h1,
h2,
h3,
h4 {
  line-height: 1.25;
}
p {
  margin: 0 0 8px;
}
p:last-child {
  margin-bottom: 0;
}
a {
  color: var(--ink);
  text-decoration-color: var(--axis);
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-color: currentColor;
}
img,
svg {
  max-width: 100%;
}
:focus {
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
[tabindex='-1']:focus-visible {
  outline: none;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  background: var(--btn-bg);
  color: var(--btn-ink);
  padding: 8px 12px;
  border-radius: 8px;
}
.skip:focus {
  left: 8px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}
.num,
.tabular {
  font-variant-numeric: tabular-nums;
}
.nowrap {
  white-space: nowrap;
}
.warn-text {
  color: var(--warn-ink);
  font-weight: 650;
}
.icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -3px;
}
.icon--small {
  width: 12px;
  height: 12px;
  vertical-align: -1px;
}
.boot {
  color: var(--muted);
  padding: 24px 0;
}

/* ── demo banner ── */
.demo-banner {
  background: #f6b40e;
  color: #1f1500;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}
.demo-banner strong {
  font-weight: 800;
  letter-spacing: 0.04em;
}
/* A spending limit was reached today (Tudor, 2026-10-14): impossible to miss, on every page. */
.limit-banner {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-bottom: 2px solid var(--warn-line);
  font-size: 14px;
  padding: 10px 16px;
  text-align: center;
}
.limit-banner p {
  margin: 0;
}
.limit-banner p + p {
  margin-top: 2px;
}
.limit-banner a {
  color: inherit;
  font-weight: 650;
}

/* ── shell ── */
.shell {
  display: flex;
  flex: 1;
  min-width: 0;
}
.content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(60px + env(safe-area-inset-bottom));
}
.sidebar {
  display: none;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.brand img {
  border-radius: 6px;
}
.clock {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.clock__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--axis);
  flex: none;
}
.clock__dot.is-open {
  background: var(--ink);
}
.main {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}
.main:focus {
  outline: none;
}
.footer {
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  padding: 16px;
  border-top: 1px solid var(--border);
}

/* phone navigation: bottom tab bar + "More" sheet, reachable with one thumb */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  text-decoration: none;
  font: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
.nav__link--tab {
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-height: 56px;
  padding: 6px 2px 4px;
  font-size: 11px;
  font-weight: 600;
}
.nav__link--tab .icon {
  width: 20px;
  height: 20px;
}
.nav__link--tab[aria-current] {
  color: var(--ink);
}
.nav__link--tab[aria-current]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 28%;
  right: 28%;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--ink);
}
.nav__badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.nav__link--tab .nav__badge {
  position: absolute;
  top: 4px;
  left: calc(50% + 6px);
}
.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.35);
}
.sheet__panel {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: calc(64px + env(safe-area-inset-bottom));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 6px;
}
.sheet__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__link--sheet {
  min-height: 50px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.nav__link--sheet[aria-current] {
  background: var(--surface-2);
}

@media (min-width: 1024px) {
  .content {
    padding-bottom: 0;
  }
  .tabbar,
  .sheet,
  .topbar {
    display: none !important;
  }
  .sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 220px;
    flex: none;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 18px 12px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
  }
  .sidebar .brand {
    padding: 4px 10px;
    font-size: 16px;
  }
  .nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .nav__link--side {
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 8px;
    font-weight: 550;
  }
  .nav__link--side:hover {
    background: var(--surface-2);
    color: var(--ink);
  }
  .nav__link--side[aria-current] {
    background: var(--surface-2);
    color: var(--ink);
    font-weight: 700;
  }
  .nav__link--side .nav__badge {
    margin-left: auto;
  }
  .sidebar__foot {
    margin-top: auto;
    padding: 0 10px;
  }
  .main {
    padding: 24px 32px 32px;
  }
}
body.is-signed-out .sidebar,
body.is-signed-out .tabbar {
  display: none !important;
}
body.is-signed-out .content {
  padding-bottom: 0;
}
@media (min-width: 1024px) {
  body.is-signed-out .topbar {
    display: flex !important;
  }
}

/* ── page layout ── */
.page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}
.page-head__text {
  min-width: 0;
}
.page-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0;
}
.page-sub {
  margin: 4px 0 0;
  color: var(--muted);
}
.page-head__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
  margin-bottom: -4px;
}
.back:hover {
  color: var(--ink);
}
.section-title {
  font-size: 17px;
  font-weight: 700;
  margin: 8px 0 0;
}
.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 360px) {
  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 720px) {
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 719px) {
  .grid--4 .stat__value {
    font-size: 19px;
  }
  .grid--4 .card {
    padding: 12px;
  }
}
@media (min-width: 1100px) {
  .grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .grid--hero {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  }
}
@media (min-width: 720px) and (max-width: 1099px) {
  .grid--hero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.split {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 860px) {
  .split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.row--between {
  justify-content: space-between;
}
.spacer {
  flex: 1;
}

/* ── cards and figures ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  min-width: 0;
}
.card--flush {
  padding: 0;
}
.card__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
}
.card__title {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}
.card__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.card__foot {
  margin-top: 12px;
  font-size: 14px;
}
.stat__label {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 2px;
}
.stat__value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.2;
}
.stat__sub {
  font-size: 13.5px;
  color: var(--ink-2);
  margin: 6px 0 0;
}
.hero__value {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 2px 0 6px;
}
@media (min-width: 1024px) {
  .hero__value {
    font-size: 48px;
  }
}
.hero__change {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
}
.chg {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.chg--gain {
  color: var(--gain);
}
.chg--loss {
  color: var(--loss);
}
.chg--flat {
  color: var(--ink-2);
}
.todo-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  border: 2px solid var(--ink);
}
.todo-card.is-clear {
  border: 1px solid var(--border);
}
.todo-card__count {
  font-size: 40px;
  font-weight: 750;
  line-height: 1;
  margin: 4px 0;
}
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px 16px;
  margin: 0;
}
.facts--wide {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.fact {
  min-width: 0;
}
.fact dt {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 1px;
}
.fact dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.fact__hint {
  display: block;
  font-weight: 400;
  font-size: 12.5px;
  color: var(--muted);
}
.kv {
  display: grid;
  grid-template-columns: minmax(110px, auto) minmax(0, 1fr);
  gap: 6px 14px;
  margin: 0;
  font-size: 14px;
}
.kv dt {
  color: var(--muted);
}
.kv dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.list > li {
  padding: 10px 0;
  border-bottom: 1px solid var(--grid);
}
.list > li:first-child {
  padding-top: 0;
}
.list > li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.bullets {
  margin: 4px 0 0;
  padding-left: 18px;
}
.bullets li {
  margin: 2px 0;
}
.prose {
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.longtext .linkish {
  font-size: 13px;
}
.empty {
  padding: 22px 16px;
  text-align: center;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 10px;
}
.empty p {
  margin: 0;
  font-weight: 600;
  color: var(--ink-2);
}
.note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  font-size: 14px;
}
.note .icon {
  margin-top: 2px;
}
.note__body {
  min-width: 0;
  flex: 1;
}
.note__body p {
  margin: 0 0 6px;
}
.note__body p:last-child {
  margin: 0;
}
.note--warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-color: var(--warn-line);
}
.note--warn a {
  color: inherit;
}
.note--error {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border: 2px solid var(--warn-line);
  font-weight: 500;
}
.note--error .btn {
  margin-top: 8px;
}

/* ── badges and tags ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px 1px 6px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  line-height: 20px;
  white-space: nowrap;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--ink-2);
  vertical-align: middle;
}
.badge .icon {
  width: 13px;
  height: 13px;
  stroke-width: 2;
  vertical-align: 0;
}
.badge--agreed {
  background: var(--agreed-bg);
  color: var(--agreed-ink);
  border-color: transparent;
}
.badge--waiting,
.badge--warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-color: var(--warn-line);
}
.badge--action {
  background: var(--btn-bg);
  color: var(--btn-ink);
  border-color: var(--btn-bg);
}
.badge--blocked {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--ink);
}
.badge--disagreed {
  background: var(--surface);
  color: var(--ink);
  border-style: dashed;
  border-color: var(--ink-2);
}
.badge--notrade,
.badge--cancelled,
.badge--neutral {
  background: var(--surface-2);
  color: var(--ink-2);
}
.badge--copied,
.badge--held,
.badge--watch,
.badge--info {
  background: var(--surface);
  color: var(--ink-2);
}
.side {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 1px 7px;
  border-radius: 5px;
  border: 1.5px solid var(--ink);
  line-height: 18px;
  vertical-align: middle;
}
.side--buy {
  background: var(--ink);
  color: var(--surface);
}
.side--sell {
  background: var(--surface);
  color: var(--ink);
}
.agent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 650;
  white-space: nowrap;
}
.agent__extra {
  font-weight: 500;
  color: var(--ink-2);
}
.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
  background: var(--k, var(--faint));
}
.dot--grok,
.key--grok {
  --k: var(--grok);
}
.dot--openai,
.key--openai {
  --k: var(--openai);
}
.dot--claude,
.key--claude {
  --k: var(--claude);
}
.dot--gemini,
.key--gemini {
  --k: var(--gemini);
}
.dot--manager,
.key--manager {
  --k: var(--ink-2);
}
.dot--both,
.key--both {
  --k: var(--both);
}
.key--portfolio {
  --k: var(--portfolio);
}
.key--sp500,
.key--sp500price {
  --k: var(--sp500);
}
.key--target {
  --k: var(--target);
}
.key--ideal {
  --k: var(--faint);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  border: 1px solid transparent;
  font-variant-numeric: tabular-nums;
}
button.chip {
  cursor: pointer;
  font-family: inherit;
}
button.chip:hover {
  border-color: var(--border-strong);
}

/* ── buttons and forms ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover {
  background: var(--surface-2);
}
.btn--primary {
  background: var(--btn-bg);
  color: var(--btn-ink);
  border-color: var(--btn-bg);
}
.btn--primary:hover {
  background: var(--btn-bg);
  opacity: 0.88;
}
.btn--big {
  min-height: 50px;
  padding: 12px 20px;
  font-size: 16px;
  border-radius: 11px;
}
.btn--small {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 13px;
  border-radius: 7px;
}
.btn--block {
  width: 100%;
}
.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.45;
  cursor: not-allowed;
}
.setting .btn--primary:disabled {
  background: transparent;
  color: var(--muted);
  border-color: var(--border-strong);
  opacity: 1;
}
.btn[aria-busy='true'] {
  cursor: progress;
}
.btn--ghost-inverse {
  background: transparent;
  color: inherit;
  border-color: currentColor;
}
.btn--ghost-inverse:hover {
  background: rgba(127, 127, 127, 0.2);
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--axis);
  text-underline-offset: 3px;
  font: inherit;
  cursor: pointer;
}
.linkish:hover {
  text-decoration-color: currentColor;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.field__label {
  font-size: 14px;
  font-weight: 650;
}
.field__hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}
input[type='text'],
input[type='password'],
input[type='search'],
input:not([type]),
select,
textarea {
  font: inherit;
  font-size: 16px;
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
}
textarea {
  min-height: 80px;
  resize: vertical;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
input[aria-invalid='true'] {
  border-color: var(--warn-line);
  border-width: 2px;
}
.input-affix {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  overflow: hidden;
}
.input-affix:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.input-affix input {
  border: 0;
  border-radius: 0;
  min-width: 0;
  outline: none !important;
}
.input-affix__fix {
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 14px;
  white-space: nowrap;
}
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: var(--surface-2);
}
.segmented__btn {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  padding: 5px 10px;
  min-height: 32px;
  border-radius: 7px;
  cursor: pointer;
}
.segmented__btn:hover {
  color: var(--ink);
}
.segmented__btn[aria-pressed='true'] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
}
.filters .field {
  width: auto;
  min-width: 160px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  cursor: pointer;
}
.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--ink);
}
.hours {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  flex: 1 1 100%;
  max-width: 520px;
}
@media (min-width: 560px) {
  .hours {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
}
.hour {
  min-height: 40px;
  min-width: 0;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  padding: 0;
}
.hour[aria-pressed='true'] {
  background: var(--btn-bg);
  color: var(--btn-ink);
  border-color: var(--btn-bg);
}
.radio {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  cursor: pointer;
}
.radio input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--ink);
  flex: none;
}
.radio:has(input:checked) {
  border-color: var(--ink);
  background: var(--surface-2);
}

/* ── tables ── */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th,
.table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--grid);
  vertical-align: top;
}
.table thead th {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  white-space: nowrap;
  border-bottom-color: var(--axis);
}
.table tbody tr:last-child td,
.table tbody tr:last-child th {
  border-bottom: 0;
}
.table--num td,
.table td.num,
.table th.num {
  font-variant-numeric: tabular-nums;
}
.table .num {
  text-align: right;
}
.table tbody th {
  font-weight: 600;
}
.table--compact th,
.table--compact td {
  padding: 6px 8px;
}

/* ── skeletons and toasts ── */
.skeleton-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.skeleton {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 300% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton:nth-child(2n) {
  width: 70%;
}
.skeleton--tall {
  height: 180px;
  width: 100% !important;
}
.skeleton--title {
  height: 28px;
  width: 220px;
}
@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
  }
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
.toasts {
  position: fixed;
  z-index: 70;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(72px + env(safe-area-inset-bottom));
  width: min(560px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
@media (min-width: 1024px) {
  .toasts {
    bottom: 24px;
  }
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px 10px 14px;
  border-radius: 11px;
  background: var(--toast-bg);
  color: var(--toast-ink);
  box-shadow: var(--shadow);
  font-size: 14px;
  transition: opacity 0.2s, transform 0.2s;
}
.toast--out {
  opacity: 0;
  transform: translateY(6px);
}
.toast__text {
  flex: 1;
  margin: 0;
}
.toast__close {
  background: none;
  border: 0;
  color: inherit;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
}
.toast--error {
  outline: 2px solid var(--warn-line);
}

/* ── dialogs ── */
.dialog {
  border: 0;
  padding: 0;
  border-radius: 16px;
  width: min(480px, calc(100vw - 24px));
  max-height: calc(100vh - 48px);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.dialog--wide {
  width: min(720px, calc(100vw - 24px));
}
.dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}
.dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 10px 6px 18px;
}
.dialog__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}
.dialog__body {
  padding: 6px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dialog__actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
@media (max-width: 480px) {
  .dialog__actions .btn {
    flex: 1;
  }
}
.form-error {
  margin: 0;
  color: var(--warn-ink);
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}

/* ── charts ── */
.chart {
  margin: 0;
}
.chart__plot {
  position: relative;
  width: 100%;
  touch-action: pan-y;
}
.chart__plot:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
  border-radius: 6px;
}
.chart__svg {
  display: block;
  overflow: visible;
}
.chart__grid line {
  stroke: var(--grid);
  stroke-width: 1;
}
.chart__ylabel,
.chart__xlabel,
.chart__axistitle {
  fill: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.chart__axistitle {
  font-size: 11.5px;
}
.chart__baseline {
  stroke: var(--axis);
  stroke-width: 1;
}
.series {
  fill: none;
  stroke: var(--k);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.series.is-dashed {
  stroke-dasharray: 6 4;
  stroke-linecap: butt;
}
.series.is-thin {
  stroke-width: 1.5;
}
.enddot {
  fill: var(--k);
  stroke: var(--surface);
  stroke-width: 2;
}
.chart__cross {
  stroke: var(--axis);
  stroke-width: 1;
}
.chart__overlay {
  fill: transparent;
  cursor: crosshair;
}
.calib__pt {
  cursor: default;
}
.calib__pt .hit {
  fill: transparent;
}
.calib__pt:focus .enddot,
.calib__pt:hover .enddot {
  stroke: var(--ink);
}
.chart__tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  min-width: 170px;
  max-width: 260px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  font-size: 13px;
}
.tip__date {
  margin: 0 0 4px;
  font-weight: 650;
  color: var(--ink-2);
}
.tip__rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tip__row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tip__value {
  font-variant-numeric: tabular-nums;
}
.tip__label {
  color: var(--ink-2);
}
.chart__empty {
  padding: 32px 8px;
  text-align: center;
  color: var(--muted);
  margin: 0;
}
.chart__table {
  margin-top: 8px;
  font-size: 13px;
}
.chart__table summary {
  cursor: pointer;
  color: var(--ink-2);
  font-weight: 600;
  padding: 4px 0;
}
.chart__table .table-wrap {
  max-height: 320px;
  overflow: auto;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  font-size: 13px;
}
.legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend__label {
  color: var(--ink-2);
}
.legend__value {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.legend__key {
  display: inline-block;
  flex: none;
}
.legend__key--line {
  width: 18px;
  height: 0;
  border-top: 2.5px solid var(--k);
}
.legend__key--line.is-dashed {
  border-top-style: dashed;
}
.legend__key--dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--k);
}
.range {
  min-width: 140px;
}
.plan-range {
  max-width: 560px;
  margin-bottom: 14px;
}
.range__track {
  position: relative;
  height: 6px;
  margin: 8px 6px 4px;
  border-radius: 3px;
  background: var(--surface-3);
}
.range__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 3px;
  background: var(--axis);
}
.range__cost {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  margin-left: -1px;
  background: var(--ink-2);
  border-radius: 1px;
}
.range__mark {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 2px var(--surface);
}
.range__labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.meter {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
}
.meter__fill {
  height: 100%;
  border-radius: 4px;
  background: var(--ink-2);
}
.meter--warn .meter__fill {
  background: var(--warn-line);
}
.meter--full .meter__fill {
  background: var(--warn-ink);
}
.parts {
  display: flex;
  gap: 2px;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  margin: 10px 0 6px;
}
.parts__seg {
  min-width: 3px;
}
.key-bg--invested {
  background: var(--invested);
}
.key-bg--cash {
  background: var(--cash);
}
.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: -1px;
}
.wbar {
  position: relative;
  height: 4px;
  border-radius: 2px;
  background: var(--surface-3);
  margin-top: 5px;
}
.wbar__fill {
  height: 100%;
  border-radius: 2px;
  background: var(--ink-2);
}
.wbar__fill.is-over {
  background: var(--warn-line);
}
.wbar__limit {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 1.5px;
  background: var(--ink);
}

/* ── overview ── */
.status-list {
  display: grid;
  gap: 12px 20px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 720px) {
  .status-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1100px) {
  .status-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.status-item h3 {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
  margin: 0 0 4px;
}
.status-item p {
  margin: 0 0 4px;
  font-size: 14px;
}
.spend {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}
.spend__line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}
.mini-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  align-items: center;
}
.mini-row__title {
  font-weight: 650;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mini-row__sub {
  grid-column: 1 / -1;
  font-size: 13px;
  color: var(--muted);
}

/* ── to do ── */
.trade-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-left: 4px solid var(--ink);
  transition: opacity 0.2s;
}
.trade-card--sell {
  border-left: 6px double var(--ink);
}
.trade-card.is-saving {
  opacity: 0.55;
}
.trade-card__title {
  font-size: 19px;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
}
@media (min-width: 720px) {
  .trade-card__title {
    font-size: 21px;
  }
}
.ticket__main {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.ticket__meta {
  margin: -6px 0 0;
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.trade-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}
@media (max-width: 559px) {
  .trade-card__actions .btn--big {
    width: 100%;
  }
}
.reasons {
  display: grid;
  gap: 10px;
}
@media (min-width: 860px) {
  .reasons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.reason {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border-top: 3px solid var(--k, var(--axis));
  font-size: 14px;
  min-width: 0;
}
.reason--plan {
  grid-column: 1 / -1;
  border-top-color: var(--both);
}
.reason__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

/* ── holdings ── */
.hrows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hrow {
  position: relative;
  display: grid;
  gap: 10px 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    'co co'
    'val gain'
    'shares price'
    'range range'
    'horizon checks';
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.hrow:hover {
  border-color: var(--border-strong);
}
.hrow__co {
  grid-area: co;
  min-width: 0;
}
.hrow__shares {
  grid-area: shares;
}
.hrow__price {
  grid-area: price;
}
.hrow__val {
  grid-area: val;
}
.hrow__gain {
  grid-area: gain;
}
.hrow__range {
  grid-area: range;
}
.hrow__horizon {
  grid-area: horizon;
}
.hrow__checks {
  grid-area: checks;
}
.hrow__label {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}
.hrow__main {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.hrow__sub {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.hrow__name {
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
}
.hrow__name::after {
  /* the whole row opens the company page */
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}
.hrow__name:focus-visible::after {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.hrow__name:focus-visible {
  outline: none;
}
.hrow__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.hrow__head {
  display: none;
}
.checks {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12.5px;
}
.checks .agent {
  font-weight: 600;
}
.check-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 6px;
}
@media (min-width: 720px) {
  .hrow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-areas:
      'co co co co'
      'shares price val gain'
      'range range horizon checks';
  }
}
@media (min-width: 1360px) {
  .hrow,
  .hrow__head {
    grid-template-columns: minmax(130px, 1.3fr) minmax(76px, 0.7fr) minmax(100px, 0.9fr) minmax(96px, 0.8fr) minmax(76px, 0.7fr) minmax(180px, 1.6fr) minmax(96px, 0.8fr) minmax(150px, 1.2fr);
    grid-template-areas: 'co shares price val gain range horizon checks';
    align-items: start;
  }
  .hrow {
    padding: 12px 14px;
    border-radius: 10px;
  }
  .hrow__head {
    display: grid;
    gap: 16px;
    padding: 0 15px;
    font-size: 12px;
    font-weight: 650;
    color: var(--muted);
  }
  .hrow .hrow__label {
    display: none;
  }
}

/* ── decisions ── */
.drow {
  display: grid;
  gap: 6px 12px;
  grid-template-columns: minmax(0, 1fr);
  padding: 12px 0;
  border-bottom: 1px solid var(--grid);
  position: relative;
}
.drow:last-child {
  border-bottom: 0;
}
.drow__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.drow__sym {
  font-weight: 750;
  font-size: 15.5px;
  text-decoration: none;
}
.drow__sym::after {
  content: '';
  position: absolute;
  inset: 0;
}
.drow:hover .drow__sym {
  text-decoration: underline;
}
.drow__meta {
  font-size: 13px;
  color: var(--muted);
}
.drow__reason {
  font-size: 14px;
  color: var(--ink-2);
  margin: 0;
}
.drow__ais {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 13px;
}
.day-head {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin: 14px 0 0;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--axis);
}
.day-head:first-child {
  margin-top: 0;
}
.round-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin: 8px 0 0;
}
.round-head h2 {
  margin: 0;
  font-size: 18px;
}
.panel {
  border-top: 4px solid var(--k, var(--axis));
}
.panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.panel__call {
  font-size: 22px;
  font-weight: 750;
  margin: 0;
}
.panel h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin: 14px 0 4px;
  text-transform: none;
}
.risk-pips {
  display: inline-flex;
  gap: 3px;
  margin-left: 6px;
  vertical-align: 1px;
}
.risk-pips span {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--surface-3);
}
.risk-pips span.is-on {
  background: var(--ink-2);
}
.sources {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13.5px;
}
.sources li {
  display: flex;
  gap: 6px;
  align-items: baseline;
  min-width: 0;
}
.sources a {
  overflow-wrap: anywhere;
}
.source--opened .icon {
  color: var(--ink);
  stroke-width: 2.2;
}
.source--unopened {
  color: var(--muted);
}
.source--unopened a {
  color: var(--muted);
}
.source__tag {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}
.compare {
  display: flex;
  flex-direction: column;
}
.compare__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--grid);
}
.compare__row:last-child {
  border-bottom: 0;
}
.compare__point h3 {
  margin: 0 0 2px;
  font-size: 15px;
}
.compare__point p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}
.compare__vals {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.compare__note {
  font-size: 14px;
  margin: 0;
}
@media (min-width: 900px) {
  .compare__row {
    grid-template-columns: minmax(180px, 1.1fr) minmax(200px, 1.3fr) auto minmax(200px, 1.6fr);
    align-items: start;
  }
  .compare__vals {
    flex-direction: column;
  }
}

/* ── research ── */
.opp-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 720px) {
  .opp-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1180px) {
  .opp-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.opp {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13.5px;
  min-width: 0;
}
.opp__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.opp__sym {
  font-weight: 750;
  font-size: 15px;
}
.opp__idea {
  display: flex;
  gap: 6px;
  align-items: baseline;
}
.opp__idea .dot {
  transform: translateY(1px);
}
.pipeline-sec {
  scroll-margin-top: 72px;
}
.pipeline-sec > h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  margin: 0 0 10px;
}
.memory {
  border-top: 4px solid var(--k);
}
.feed td,
.feed th {
  white-space: nowrap;
}
.feed td.wrap {
  white-space: normal;
}

/* ── activity ── */
.event {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--grid);
  font-size: 14px;
}
.event:last-child {
  border-bottom: 0;
}
.event__lvl {
  grid-row: span 2;
  padding-top: 1px;
}
.event__msg {
  margin: 0;
  overflow-wrap: anywhere;
}
.event__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 12.5px;
  color: var(--muted);
}
.event__meta a {
  color: var(--ink-2);
}
.pre {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0;
  max-height: 420px;
  overflow: auto;
}
details.block {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  background: var(--surface);
}
details.block > summary {
  cursor: pointer;
  font-weight: 650;
  padding: 10px 0;
}
details.block[open] > summary {
  border-bottom: 1px solid var(--grid);
  margin-bottom: 10px;
}
details.block[open] {
  padding-bottom: 12px;
}
.sources-block {
  margin-top: 12px;
}
.full-analysis {
  margin-top: 14px;
}
.full-analysis > summary {
  color: var(--ink-2);
}
.panel__headline {
  font-weight: 600;
  margin: 2px 0 8px;
}
.compare-why {
  display: block;
  min-width: 160px;
  max-width: 300px;
  line-height: 1.35;
}
/* The four answers side by side on an analysis page (Tudor, 2026-10-14). */
.compare-table th,
.compare-table td {
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}
.compare-table thead th {
  white-space: nowrap;
  font-size: 13px;
}
.compare-table tbody th {
  color: var(--muted);
  font-weight: 600;
  min-width: 130px;
}
@media (max-width: 760px) {
  .compare-table tbody th,
  .compare-table thead th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--surface);
  }
}
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--axis);
  overflow-x: auto;
}
.tabs a {
  padding: 8px 12px;
  text-decoration: none;
  font-weight: 650;
  color: var(--ink-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tabs a[aria-current] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* ── settings ── */
.setting {
  display: grid;
  gap: 8px 16px;
  grid-template-columns: minmax(0, 1fr);
  padding: 14px 0;
  border-bottom: 1px solid var(--grid);
}
.setting:last-child {
  border-bottom: 0;
}
.setting__label {
  font-weight: 650;
  margin: 0;
}
.setting__help {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.setting__control {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
}
.setting__control > .input-affix,
.setting__control > input,
.setting__control > select {
  width: 180px;
  max-width: 100%;
}
.setting__control > .input-wide {
  width: 260px;
}
.setting__msg {
  font-size: 13px;
  margin: 0;
  width: 100%;
}
.setting__msg.is-error {
  color: var(--warn-ink);
  background: var(--warn-bg);
  border-radius: 6px;
  padding: 4px 8px;
}
@media (min-width: 860px) {
  .setting {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    align-items: start;
  }
}
.keys {
  display: grid;
  gap: 6px 16px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
}
.keys li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rule-list > li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
}
.rule-list .rule__value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.rule-list .rule__help {
  grid-column: 1 / -1;
  font-size: 13px;
  color: var(--muted);
}

/* ── learning ── */
.score {
  border-top: 4px solid var(--k);
}
.score__big {
  font-size: 30px;
  font-weight: 750;
  margin: 2px 0;
  line-height: 1.1;
}
.calls > li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  font-size: 14px;
}
.calls .call__sub {
  grid-column: 1 / -1;
  font-size: 12.5px;
  color: var(--muted);
}
.strategy {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.strategy.is-candidate {
  border: 2px solid var(--ink);
}

/* ── sign-in ── */
.login {
  max-width: 400px;
  margin: 6vh auto 0;
}
.login .card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login h1 {
  margin: 0;
  font-size: 22px;
}

@media (forced-colors: active) {
  .series,
  .enddot {
    stroke: CanvasText;
  }
  .badge,
  .btn,
  .card {
    border: 1px solid CanvasText;
  }
}

/* ── analyses table (Tudor, 2026-10-14): one column per agent ── */
.analyses-table th,
.analyses-table td {
  vertical-align: middle;
}
.analyses-table thead th.atable__agent {
  white-space: nowrap;
}
.atable__company {
  min-width: 180px;
}
.atable__sym {
  font-weight: 750;
  font-size: 15.5px;
  text-decoration: none;
}
.atable__row {
  cursor: pointer;
}
.atable__row:hover > * {
  background: var(--surface-2);
}
.atable__row:hover .atable__sym,
.atable__sym:hover {
  text-decoration: underline;
}
.atable__call {
  white-space: nowrap;
}
.atable__call--strong {
  font-weight: 700;
}
.atable__conf {
  color: var(--muted);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.atable__result {
  min-width: 260px;
  max-width: 420px;
}
.atable__reason {
  margin-top: 4px;
}
.analyses-table tr.atable__day th {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  padding-top: 14px;
  border-bottom-color: var(--axis);
}
.analyses-table tbody tr.atable__day:first-child th {
  padding-top: 8px;
}
/* On a phone the table scrolls sideways; the company column stays in view. */
@media (max-width: 760px) {
  .atable__company {
    min-width: 128px;
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--surface);
  }
  .atable__daylabel {
    position: sticky;
    left: 10px;
  }
}

/* ── holdings table ── */
/* Wide tables use the room a large window has, instead of scrolling inside the usual 1240px page. */
.main:has(.page--wide) {
  max-width: 1600px;
}
.holdings-card {
  padding: 8px 4px;
}
.holdings-table td,
.holdings-table th {
  white-space: nowrap;
  vertical-align: middle;
  padding: 10px 12px;
}
.holdings-table tbody th a {
  font-weight: 650;
}
.holdings-table td.is-over {
  color: var(--warn-ink);
  font-weight: 650;
}
.sort-btn {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  gap: 4px;
  align-items: center;
  font: inherit;
  color: inherit;
}
.sort-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.sort-btn__arrow {
  color: var(--faint);
  font-size: 11px;
}

/* ── overview: big numbers (Tudor, 2026-10-13) ── */
.kpi__title {
  font-size: 17px;
  font-weight: 650;
  color: var(--ink);
  margin: 0 0 6px;
}
.kpi__title--small {
  font-size: 15px;
  margin-bottom: 8px;
}
.kpi__value {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.hero__top {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 720px) {
  .hero__top {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
    gap: 32px;
    align-items: start;
  }
}
.hero__breakdown {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hero__total {
  border-top: 1px solid var(--grid);
  padding-top: 6px;
  font-weight: 700;
}

/* ── sign-in by email code ── */
.code-input {
  font-size: 28px;
  letter-spacing: 0.3em;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.btn--link {
  background: none;
  border: 0;
  padding: 4px 0;
  color: var(--ink-2);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  align-self: center;
}

/* ── rules page: the team diagram (Tudor, 2026-10-14) ── */
.rules-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rules-list .rules-list {
  margin-top: 6px;
  list-style: circle;
}
.flow {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.flow__group,
.flow__rule,
.flow__end {
  border-radius: var(--radius);
  padding: 12px;
}
.flow__group {
  border: 1px dashed var(--border-strong);
}
.flow__label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}
.flow__sub {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.flow__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.team-agent {
  flex: 1 1 130px;
  max-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--team-agent, var(--ink));
  border-radius: 10px;
}
.team-agent--grok {
  --team-agent: var(--grok);
}
.team-agent--openai {
  --team-agent: var(--openai);
}
.team-agent--claude {
  --team-agent: var(--claude);
}
.team-agent--gemini {
  --team-agent: var(--gemini);
}
.team-agent__who {
  font-weight: 700;
}
.team-agent__role {
  font-size: 12px;
  color: var(--muted);
}
.flow__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.flow__arrow {
  font-size: 20px;
  line-height: 1.1;
  color: var(--faint);
}
.flow__rule {
  border: 2px solid var(--ink);
  background: var(--surface-2);
}
.flow__rule p:not(.flow__label) {
  margin: 4px 0 0;
}
.flow__end {
  border: 1px solid var(--border-strong);
  text-align: center;
}
.flow__end p {
  margin: 0;
}

