:root,
[data-theme="dark"] {
  --background: #000;
  --foreground: #f5f5f7;
  --card: #161617;
  --sidebar: #050506;
  --primary: #f5f5f7;
  --primary-foreground: #000;
  --muted: #1d1d1f;
  --muted-foreground: #86868b;
  --border: rgba(255, 255, 255, 0.12);
  --link: #2997ff;
  --success: #30d158;
  --destructive: #ff453a;
  --glow: #2563eb;
  --glow-strength: 18%;
  --surface-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --font: "DM Sans", sans-serif;
  --mono: "Space Mono", ui-monospace, monospace;
  --radius: 10px;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  color: var(--foreground);
  background: var(--background);
  color-scheme: dark;
  font-family: var(--font);
  font-size: 15px;
  letter-spacing: -0.016em;
  -webkit-font-smoothing: antialiased;
}

[data-theme="light"] {
  --background: #e8ebf2;
  --foreground: #111318;
  --card: rgba(255, 255, 255, 0.72);
  --sidebar: #dfe4ee;
  --primary: #111318;
  --primary-foreground: #f5f5f7;
  --muted: rgba(17, 19, 24, 0.06);
  --muted-foreground: #5c6370;
  --border: rgba(17, 19, 24, 0.1);
  --link: #0b5fff;
  --glow: #2563eb;
  --glow-strength: 16%;
  --surface-shadow: 0 14px 40px rgba(17, 40, 90, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }

.shell {
  display: grid;
  grid-template-columns: 15rem 1fr;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  transition: grid-template-columns 220ms var(--ease);
}
.shell.collapsed { grid-template-columns: 4.25rem 1fr; }
aside {
  background:
    radial-gradient(ellipse 120% 70% at 0% 0%, color-mix(in srgb, var(--glow) calc(var(--glow-strength) * 0.55), transparent), transparent 70%),
    var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 18px 10px 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: auto;
}
.accent-bar { display: none; }
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 18px;
  min-height: 32px;
  color: inherit;
  text-decoration: none;
}
.logo { width: 24px; height: 24px; flex: none; display: block; }
.word { font-size: 15px; font-weight: 600; letter-spacing: -0.03em; }
.shell.collapsed .word,
.shell.collapsed .label { display: none; }
.shell.collapsed .brand { justify-content: center; padding: 4px 0 18px; }
.shell.collapsed aside { padding-left: 8px; padding-right: 8px; }
.shell.collapsed .accent-bar { margin-left: -8px; margin-right: -8px; }
nav { display: flex; flex-direction: column; gap: 2px; }
nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--muted-foreground);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}
.shell.collapsed nav button { justify-content: center; padding: 12px 0; }
nav button:hover { background: var(--muted); color: var(--foreground); }
nav button.active { color: var(--foreground); background: var(--muted); font-weight: 600; }
.mark {
  display: none;
  width: 1.25rem;
  flex: none;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--foreground);
  text-align: center;
}
.shell.collapsed .mark { display: block; }
.scrim {
  display: none;
  border: 0;
  padding: 0;
  background: hsl(233 32% 6% / 0.45);
}
.inset {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 55% at 50% 32%, color-mix(in srgb, var(--glow) var(--glow-strength), transparent), transparent 70%),
    radial-gradient(ellipse 55% 40% at 90% 0%, color-mix(in srgb, var(--glow) calc(var(--glow-strength) * 0.45), transparent), transparent 65%),
    var(--background);
}
header {
  position: relative;
  z-index: 20;
  flex: none;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  font-size: 13px;
  background: color-mix(in srgb, var(--background) 72%, transparent);
  backdrop-filter: saturate(1.4) blur(20px);
  -webkit-backdrop-filter: saturate(1.4) blur(20px);
}
.nav-toggle {
  width: 32px;
  height: 32px;
  display: grid;
  gap: 4px;
  place-content: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  flex: none;
}
.nav-toggle span { display: block; width: 14px; height: 1px; background: currentColor; }
.crumb { color: var(--muted-foreground); }
.crumb-here { font-weight: 600; }
.org-select {
  background: color-mix(in srgb, var(--muted) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
}
.account {
  position: relative;
}
.account[hidden] { display: none; }
.account-btn {
  max-width: 16rem;
  background: color-mix(in srgb, var(--muted) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--foreground);
  font-size: 13px;
}
.account-btn:hover { background: var(--muted); }
.account-btn .caret { color: var(--muted-foreground); font-size: 11px; }
.account-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 12rem;
}
.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 15rem;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 96%, var(--background));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--surface-shadow);
  z-index: 40;
}
.account-menu[hidden] { display: none; }
.account-meta {
  padding: 8px 10px 10px;
  font-size: 12px;
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
  word-break: break-all;
}
.account-usage {
  display: grid;
  gap: 6px;
  padding: 8px 10px 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.account-usage[hidden] { display: none; }
.account-usage .usage-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}
.account-usage .usage-row span { color: var(--muted-foreground); }
.account-usage .usage-row b {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--foreground);
}
.account-menu button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--foreground);
  font-size: 13px;
}
.account-menu button:hover { background: var(--muted); }
.credits {
  display: none;
  align-items: baseline;
  gap: 6px;
  background: color-mix(in srgb, var(--muted) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.credits:not([hidden]) { display: inline-flex; }
.credits:hover, .theme:hover, .nav-toggle:hover { background: var(--muted); }
.credits-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.lang-host {
  display: flex;
  align-items: center;
  margin-left: auto;
}
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 2px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 55%, transparent);
}
.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 4px 7px;
  border-radius: 999px;
  cursor: pointer;
}
.lang-switch button.on {
  color: var(--foreground);
  background: color-mix(in srgb, var(--card) 88%, var(--background));
}
.theme {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
  color: var(--muted-foreground);
  flex: none;
}
.theme:hover {
  color: var(--foreground);
  border-color: color-mix(in srgb, var(--border) 80%, transparent);
  background: color-mix(in srgb, var(--muted) 80%, transparent);
}
.theme-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-moon { fill: currentColor; stroke: none; }
[data-theme="dark"] .theme-sun { display: none; }
[data-theme="light"] .theme-moon { display: none; }
.credits-n { font-family: var(--mono); font-weight: 700; color: var(--foreground); font-size: 13px; }
main {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 28px 28px 56px;
  max-width: 1080px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: transparent;
}
main.wide { max-width: none; }
main.bleed {
  padding: 0;
  gap: 0;
  overflow: hidden;
  max-width: none;
}
h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; margin: 0; }
h2 { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 8px; }
.lede { margin: 0; color: var(--muted-foreground); max-width: 42rem; font-size: 15px; line-height: 1.47; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat { background: transparent; border: 0; border-radius: 0; padding: 14px 16px 14px 0; }
.stats .stat + .stat { box-shadow: inset 1px 0 0 var(--border); padding-left: 16px; }
.stat span { display: block; font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-foreground); }
.stat b { display: block; margin-top: 6px; font-family: var(--mono); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat p { margin: 4px 0 0; font-size: 12px; color: var(--muted-foreground); }
.caption { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--muted-foreground); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0; }
button.primary, button.ghost, label.file {
  font-weight: 500;
  border-radius: var(--radius);
  padding: 8px 14px;
  cursor: pointer;
  transition: opacity 160ms var(--ease), background 160ms var(--ease);
}
button.primary { background: var(--primary); color: var(--primary-foreground); border: 0; }
button.ghost, label.file { background: transparent; border: 1px solid var(--border); }
button.ghost:hover, label.file:hover { background: var(--muted); color: var(--foreground); }
button:disabled { opacity: 0.4; cursor: default; }
input, select {
  background: color-mix(in srgb, var(--muted) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
  border-radius: calc(var(--radius) - 2px);
  padding: 8px 10px;
  color: var(--foreground);
}
input:focus, select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--foreground) 35%, transparent);
  background: color-mix(in srgb, var(--muted) 70%, transparent);
}
[data-theme="light"] input,
[data-theme="light"] select {
  background: color-mix(in srgb, #ffffff 42%, transparent);
  border-color: color-mix(in srgb, var(--border) 100%, transparent);
}
.target input {
  width: 8rem;
  background: color-mix(in srgb, var(--muted) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 95%, transparent);
  box-shadow: none;
}
[data-theme="light"] .target input {
  background: color-mix(in srgb, #ffffff 48%, var(--background));
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted-foreground); font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
.mix { display: flex; flex-direction: column; gap: 8px; }
.mix-row { display: grid; grid-template-columns: 120px 1fr 72px; gap: 8px; align-items: center; font-size: 14px; }
.track { height: 8px; background: var(--muted); border-radius: 2px; overflow: hidden; }
.track span { display: block; height: 100%; width: 0; background: var(--foreground); transition: width 700ms ease; }
.result { border: 1px solid color-mix(in srgb, var(--border) 80%, transparent); border-radius: var(--radius); background: color-mix(in srgb, var(--card) 72%, transparent); padding: 16px; }
.score-num { font-family: var(--mono); font-size: 36px; font-weight: 700; }
.mono { font-family: var(--mono); font-size: 13px; font-weight: 700; }
.error { color: var(--destructive); }
.sources { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  padding: 4px 8px;
  color: var(--muted-foreground);
}
.pill.live { color: var(--success); border-color: hsl(145 63% 48% / 0.45); }
.seg, .tabs {
  display: flex;
  width: fit-content;
  background: var(--muted);
  border: 0;
  border-radius: 9px;
  padding: 2px;
}
.seg button, .tabs button {
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  border-radius: 7px;
}
.seg button.on, .tabs button.on { background: var(--card); color: var(--foreground); }
.seg button + button, .tabs button + button { border-left: 0; }
.target { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.knobs, .account-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.knob, .account-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.knob input, .knob select, .account-form input { width: 100%; }
.account-form { margin-top: 16px; }
.account-form .lede, .account-form .primary, .account-form .check { grid-column: 1 / -1; }
.check { flex-direction: row; align-items: center; }
.acc { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.acc .mono { margin-left: 10px; }
.guide p { margin: 0 0 8px; }
.terminal {
  display: grid;
  grid-template-columns: minmax(22rem, 1.2fr) minmax(16rem, 0.9fr) minmax(17rem, 0.85fr);
  grid-template-rows: auto 1fr;
  flex: 1;
  min-height: 0;
  height: 100%;
  margin: 0;
  border-top: 0;
}
.foxy-mode-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--background) 92%, transparent);
  position: relative;
  z-index: 1;
  flex: none;
}
.foxy-mode-bar h1 { margin: 0; font-size: 22px; }
.foxy-mode .seg, .foxy-mode { flex: none; }
.foxy-mode button { min-width: 4.5rem; }
.ticker {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 8px 0 10px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted-foreground);
  min-width: 0;
  flex: none;
}
.ticker .print,
.ticker > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ticker .mono { color: var(--foreground); font-size: 12px; flex: none; }
.terminal-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: auto;
  padding: 12px 16px 0;
}
.terminal-main .page-head { flex: none; margin: 10px 0 8px; }
.scoreboard {
  flex: none;
  max-height: 42%;
  overflow: auto;
  margin: 0 0 8px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border);
}
.score-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.score-sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
}
.scoreboard .action { margin: 0; padding: 0; }
.scoreboard .side { min-width: 0; }
.scoreboard .side span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: 4px;
}
.scoreboard .side b {
  display: block;
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.04em;
}
.scoreboard .drivers,
.scoreboard .src-row,
.scoreboard .lede,
.scoreboard .call,
.scoreboard .story,
.scoreboard .takes,
.scoreboard img {
  min-width: 0;
}
.scoreboard .drivers { margin: 0; line-height: 1.4; font-size: 12px; }
.scoreboard .story {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.chat {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 0 12px;
}
.thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.bubble {
  position: relative;
  z-index: 0;
  max-width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 10px 12px;
  background: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.4;
  font-size: 13px;
}
.bubble.user { align-self: stretch; }
.bubble.foxy {
  align-self: stretch;
  background: transparent;
  border: 1px solid var(--border);
  padding: 8px 10px;
}
.bubble.pending { color: var(--muted-foreground); }
.bubble img { display: block; max-width: min(100%, 36rem); margin-top: 10px; border-radius: 8px; border: 1px solid var(--border); }
.chart-fig { margin: 12px 0 4px; max-width: min(100%, 36rem); }
.chart-fig img {
  width: 100%;
  margin: 0;
  cursor: zoom-in;
  background: #0b1014;
}
.chart-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chart-actions button {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.chart-actions button:hover { background: var(--muted); }
.chart-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.78);
}
.chart-lightbox.open { display: flex; }
.chart-lightbox img {
  max-width: min(1100px, 100%);
  max-height: 82vh;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0b1014;
}
.chart-lightbox-close {
  position: absolute;
  top: 16px;
  right: 18px;
  appearance: none;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}
.chart-lightbox-actions {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
}
.chart-lightbox-dl {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(20, 20, 24, 0.9);
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.tape {
  border-left: 1px solid var(--border);
  padding: 8px 14px 28px;
  overflow: auto;
  background: var(--card);
  min-width: 0;
}
.tape h2 {
  margin: 18px 0 8px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.tape-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "meta meta"
    "title ask";
  column-gap: 12px;
  row-gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  align-items: start;
  cursor: pointer;
}
.tape-meta {
  grid-area: meta;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
  line-height: 1.3;
}
.tape-meta .caption { color: var(--muted-foreground); font-size: 12px; }
.tape-meta .mono { color: var(--muted-foreground); font-size: 11px; }
.tape-open {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-decoration: none;
}
.tape-open:hover { color: var(--link); }
.tape-title {
  grid-area: title;
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.45;
  font-size: 13px;
}
.tape-title .print { font-weight: 600; }
.tape-row .ask-now { grid-area: ask; align-self: start; margin-top: 0; }
.tape-row.sel {
  background: var(--muted);
  margin: 0 -10px;
  padding: 14px 10px;
  border-radius: 10px;
  border-bottom-color: transparent;
}
.tape-row.flash .caption { color: var(--foreground); }
.tape-row a.tape-open { text-decoration: none; }
.wire-head {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin: 4px 0 14px;
}
.wire-head h2 { margin: 0; }
.tape-rows { display: flex; flex-direction: column; gap: 0; }
.cal-list { display: flex; flex-direction: column; gap: 0; }
.cal-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.cal-top {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: baseline;
  font-size: 11px;
  color: var(--muted-foreground);
}
.cal-top .mono { color: var(--foreground); }
.cal-flag { font-weight: 600; }
.cal-impact { text-transform: uppercase; letter-spacing: 0.04em; }
.cal-row.high .cal-impact { color: var(--destructive); }
.cal-row.soon .cal-top .mono:first-child { color: var(--link); font-weight: 700; }
.cal-eta { margin-left: auto; }
.cal-title {
  display: block;
  width: 100%;
  overflow-wrap: anywhere;
  line-height: 1.4;
  font-size: 13px;
}
.cal-foot {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-height: 1.5rem;
}
.scan { margin: 16px 0 8px; }
.scan .page-head { margin-bottom: 8px; }
.scan h2 { margin: 16px 0 8px; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-foreground); }
.seg.src { flex-wrap: wrap; }
.fill-tape { margin: 0 0 12px; }
.takes { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; }
.takes button { font-family: var(--mono); font-size: 12px; font-weight: 700; }
button.print {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
button.print:hover { color: var(--link); }
.ticker button.print { color: var(--muted-foreground); font-weight: 500; }
.call { margin: 0; font-family: var(--mono); font-size: 13px; font-weight: 700; }
.scoreboard img { max-width: 12rem; }
.action { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.action.take { color: var(--success); }
.action.skip { color: var(--destructive); }
.action.skew { color: var(--mute, var(--muted-foreground)); }
.src-row { display: flex; flex-wrap: wrap; gap: 6px 12px; padding-top: 8px; border-top: 1px solid var(--border); }
.src-row span { font-family: var(--mono); font-size: 11px; color: var(--muted-foreground); }
.src-row span.on { color: var(--success); }
.ask-row { display: grid; grid-template-columns: 7rem minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.drivers { margin: 0; color: var(--muted-foreground); font-size: 12px; }
.scoreline { display: flex; flex-wrap: wrap; gap: 12px 16px; font-family: var(--mono); font-weight: 700; margin-bottom: 8px; }
.pairs { display: flex; gap: 6px; flex-wrap: wrap; }
.pairs button { padding: 6px 10px; font-family: var(--mono); font-size: 12px; font-weight: 700; }
.composer { flex: none; margin: 0 -16px 0; padding: 10px 16px 16px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--background) 78%, transparent); backdrop-filter: blur(16px); }
.composer-box {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 10px 12px 8px;
  box-shadow: var(--surface-shadow);
}
[data-theme="light"] .composer-box,
[data-theme="light"] .basic-composer .composer-box,
[data-theme="light"] .result,
[data-theme="light"] .account-menu {
  background: color-mix(in srgb, #ffffff 82%, transparent);
}
.composer textarea { display: block; width: 100%; min-height: 52px; max-height: 160px; resize: none; border: 0; background: transparent; outline: none; line-height: 1.4; }
.composer-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.composer-bar input { min-width: 0; flex: 1 1 10rem; }
.composer-bar .primary { margin-left: auto; }
.ask-now { padding: 2px 8px; font-size: 12px; font-weight: 700; flex: none; }
.why, .impact, .bubble-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--foreground);
  overflow-wrap: anywhere;
}
.why strong, .impact strong { color: var(--muted-foreground); font-weight: 600; margin-right: 4px; }
.bubble-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 8px; }
.foxy-basic {
  flex: 1;
  min-height: 0;
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: transparent;
}
.foxy-basic .foxy-mode-bar {
  grid-column: auto;
  border-bottom: 0;
  background: transparent;
  padding: 16px 22px 0;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.foxy-brand {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.chat-tools {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  min-width: 0;
}
.chat-history { position: relative; min-width: 0; }
.chat-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: min(14rem, 42vw);
  min-height: 34px;
  padding: 0 10px 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.chat-toggle:hover,
.chat-toggle[aria-expanded="true"] {
  color: var(--foreground);
  background: color-mix(in srgb, var(--muted) 75%, transparent);
}
.chat-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-chevron {
  width: 12px;
  height: 12px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.7;
}
.chat-new {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex: none;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 0;
}
.chat-new svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}
.chat-new:hover {
  color: var(--foreground);
  background: color-mix(in srgb, var(--muted) 75%, transparent);
}
.chat-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(19rem, 78vw);
  max-height: 18rem;
  overflow: auto;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
  background: color-mix(in srgb, var(--card) 96%, var(--background));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--surface-shadow);
  z-index: 30;
}
.chat-menu[hidden] { display: none; }
.chat-menu-sep {
  height: 1px;
  margin: 4px 8px;
  background: color-mix(in srgb, var(--border) 85%, transparent);
}
.chat-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--foreground);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 13px;
  cursor: pointer;
}
.chat-item-new {
  grid-template-columns: auto 1fr;
  color: var(--foreground);
  font-weight: 600;
}
.chat-item-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  background: color-mix(in srgb, var(--muted) 90%, transparent);
  font-size: 14px;
  line-height: 1;
  color: var(--muted-foreground);
}
.chat-item-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-item-meta {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted-foreground);
  letter-spacing: 0.02em;
}
.chat-item:hover, .chat-item.on { background: var(--muted); }
.chat-empty {
  margin: 0;
  padding: 10px;
  font-size: 12px;
  color: var(--muted-foreground);
}
.bubble.foxy .md {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 100%;
}
.bubble.foxy .md h2 {
  margin: 1.1em 0 0.35em;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}
.bubble.foxy .md h2:first-child { margin-top: 0.2em; }
.bubble.foxy .md p {
  margin: 0;
  line-height: 1.55;
  white-space: normal;
}
.bubble.foxy .md table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 6px 0 10px;
}
.bubble.foxy .md th,
.bubble.foxy .md td {
  border-bottom: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
  padding: 7px 6px;
  text-align: left;
  vertical-align: top;
  white-space: normal;
}
.bubble.foxy .md th {
  color: var(--muted-foreground);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.bubble.foxy .md strong { font-weight: 600; }
.bubble.foxy .md code {
  font-family: var(--mono);
  font-size: 0.92em;
}
.bubble.foxy img,
.bubble.foxy .md img {
  display: block;
  width: min(100%, 36rem);
  margin: 12px 0 4px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
}
.foxy-basic-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 44rem;
  width: 100%;
  margin: 0 auto;
  padding: 12px 20px 28px;
}
.foxy-basic.is-empty .foxy-basic-stage {
  justify-content: center;
  gap: 28px;
}
.foxy-basic.has-thread .foxy-basic-stage {
  justify-content: flex-end;
  padding-top: 8px;
}
.foxy-basic .chat {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 0 16px;
  scrollbar-width: thin;
}
.foxy-basic.has-thread .chat {
  justify-content: flex-start;
}
.foxy-basic .thread {
  width: 100%;
  gap: 14px;
  margin-top: auto;
}
.foxy-basic.has-thread .thread { margin-top: 0; }
.foxy-empty {
  text-align: center;
  padding: 0 12px 8px;
}
.foxy-hello {
  margin: 0;
  font-size: clamp(30px, 4.4vw, 42px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: var(--foreground);
}
.foxy-basic .bubble {
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  max-width: 92%;
}
.foxy-basic .bubble.user {
  align-self: flex-end;
  background: color-mix(in srgb, var(--muted) 88%, var(--foreground) 4%);
  border-radius: 22px;
  padding: 12px 16px;
  border: 0;
}
.foxy-basic .bubble.foxy {
  align-self: flex-start;
  max-width: 100%;
  background: transparent;
  border: 0;
  padding: 2px 4px;
  color: var(--foreground);
}
.foxy-basic .bubble.pending {
  opacity: 0.65;
  font-style: italic;
}
.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}
.share-link, .share-copy, .share-make {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--link);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
  border-radius: 999px;
  padding: 6px 12px;
  text-decoration: none;
  cursor: pointer;
}
.share-link:hover, .share-copy:hover, .share-make:hover { background: var(--muted); }
.share-make:disabled, .share-copy:disabled { opacity: 0.5; cursor: wait; }
.basic-composer {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
  flex: none;
}
.composer-box.pill {
  border-radius: 28px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  box-shadow:
    0 1px 0 color-mix(in srgb, #fff 6%, transparent) inset,
    0 18px 50px color-mix(in srgb, #000 22%, transparent);
}
[data-theme="light"] .composer-box.pill {
  background: color-mix(in srgb, #ffffff 88%, transparent);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 16px 40px rgba(30, 60, 120, 0.1);
}
.pill-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.pill-row textarea {
  flex: 1;
  min-width: 0;
  min-height: 24px;
  max-height: 140px;
  padding: 8px 4px;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.pill-row .plus,
.pill-row .send {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  border: 0;
  padding: 0;
}
.pill-row .plus {
  background: transparent;
  color: var(--muted-foreground);
  font-weight: 400;
}
.pill-row .plus:hover { color: var(--foreground); background: var(--muted); }
.pill-row .send {
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 16px;
  font-weight: 600;
}
.pill-row .send:disabled { opacity: 0.35; }
.basic-composer .composer-bar { margin-top: 10px; }
.log { margin: 0; white-space: pre-wrap; max-height: 22rem; overflow: auto; }
.note { margin: 8px 0 0; font-size: 14px; }
@media (max-width: 1400px) {
  .terminal { grid-template-columns: minmax(0, 1.1fr) minmax(15rem, 0.9fr) minmax(16rem, 0.9fr); }
  .scoreboard .side b { font-size: 30px; }
}
@media (max-width: 1200px) {
  .terminal { grid-template-columns: minmax(0, 1fr) minmax(16rem, 18rem); }
  .tape.cal { border-left: 0; border-top: 1px solid var(--border); grid-column: 1 / -1; max-height: 22rem; }
  .scoreboard { max-height: none; }
}
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats .stat + .stat { box-shadow: none; padding-left: 0; }
  .stats .stat:nth-child(even) { box-shadow: inset 1px 0 0 var(--border); padding-left: 16px; }
  .knobs, .account-form { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .shell, .shell.collapsed {
    grid-template-columns: 1fr;
    height: 100dvh;
    min-height: 100dvh;
  }
  aside {
    position: fixed;
    z-index: 30;
    height: 100dvh;
    width: min(16rem, 86vw);
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: none;
  }
  .shell.nav-open aside { transform: translateX(0); }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 25; }
  .shell.collapsed .word,
  .shell.collapsed .label { display: initial; }
  .shell.collapsed .mark { display: none; }
  .shell.collapsed nav button { justify-content: flex-start; padding: 12px; }
  .terminal { grid-template-columns: 1fr; min-height: 0; margin: 0; }
  .terminal-main { height: auto; min-height: 0; }
  .tape { border-left: 0; border-top: 1px solid var(--border); max-height: 28rem; }
  .acc { flex-direction: column; align-items: flex-start; }
  .stats { grid-template-columns: 1fr; }
  .stats .stat + .stat { box-shadow: none; padding-left: 0; border-top: 1px solid var(--border); }
  .scoreboard .side b { font-size: 28px; }
  header { height: auto; min-height: 52px; flex-wrap: wrap; padding: 8px 12px; }
  .org-select { margin-left: 0; }
  main { padding: 12px 12px 40px; }
  main.bleed { padding: 0; }
  h1 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .shell, aside, .track span, nav button, button.primary, button.ghost { transition: none; }
}
