/* GUTL Fusion live arena — presentation layer, 20 November 2026.
   Same six type roles in both languages. Header/footer belong to fusion-shell.css.
   Chart markers, feed timing, order controls and data logic retain their geometry. */
:root {
  --font: "InterVariable", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --numeric: "InterVariable", "Noto Sans SC", sans-serif;
  --type-xs: .875rem;
  --type-sm: 1rem;
  --type-md: 1.25rem;
  --type-lg: 1.5rem;
  --type-xl: 2rem;
  --type-2xl: 3rem;
  --arena-blue: #00356b;
  --arena-heading: #00356b;
  --arena-action: #1b5da9;
  --arena-paper: #f6f4ef;
  --arena-surface: #fff;
  --arena-raised: #f3f5f7;
  --arena-ink: #263545;
  --arena-muted: #526173;
  --arena-line: #d4d9df;
  --arena-soft-line: #e5e8eb;
  --arena-pale: #eaf0f7;
  --arena-hover: #f0f4f8;
  --arena-control: #74869a;
  --arena-accent: #00356b;
  --arena-button-bg: #00356b;
  --arena-button-ink: #fff;
  --arena-positive: #216443;
  --arena-negative: #a32f43;
  --arena-buy-surface: #edf6f0;
  --arena-sell-surface: #fcf0f2;
  --arena-buy-button: #216443;
  --arena-sell-button: #a32f43;
  --arena-trade-ink: #fff;
  --arena-avatar-line: #c0cedc;
  --arena-gold: #795823;
  --arena-gold-surface: #f7f1e5;
  --arena-gold-line: #d9caaa;
  --arena-depth-buy: #e3f0e8;
  --arena-depth-sell: #f7e6e9;
  --arena-depth-track: #dfb9c1;
  --arena-depth-fill: #74a58a;
  --arena-toast-bg: #00356b;
  --arena-toast-ink: #f6f4ef;
  --chart-grid: #e8edf2;
  --chart-average: #567caa;
  --chart-volume-up: #b7d3c2;
  --chart-volume-down: #e3bec7;
}

/* Night mode retains the GUTL navy/cream identity and semantic trading colours. */
html[data-theme="dark"] {
  --arena-blue: #f6f4ef;
  --arena-heading: #f6f4ef;
  --arena-action: #a9cef5;
  --arena-paper: #062347;
  --arena-surface: #0b2d55;
  --arena-raised: #10365f;
  --arena-ink: #f0f1ed;
  --arena-muted: #c2cedb;
  --arena-line: #3b5776;
  --arena-soft-line: #284966;
  --arena-pale: #193f69;
  --arena-hover: #183e68;
  --arena-control: #89a4c1;
  --arena-accent: #f6f4ef;
  --arena-button-bg: #f6f4ef;
  --arena-button-ink: #00356b;
  --arena-positive: #a0e5bf;
  --arena-negative: #ffb7c5;
  --arena-buy-surface: #163f44;
  --arena-sell-surface: #443450;
  --arena-buy-button: #a0e5bf;
  --arena-sell-button: #ffb7c5;
  --arena-trade-ink: #092c40;
  --arena-avatar-line: #7792b0;
  --arena-gold: #eddbb1;
  --arena-gold-surface: #3b3d48;
  --arena-gold-line: #95866c;
  --arena-depth-buy: #194850;
  --arena-depth-sell: #4a3a55;
  --arena-depth-track: #9c6d86;
  --arena-depth-fill: #71ba9b;
  --arena-toast-bg: #f6f4ef;
  --arena-toast-ink: #00356b;
  --chart-grid: #264a70;
  --chart-average: #a0c5ec;
  --chart-volume-up: #3d7468;
  --chart-volume-down: #8e6078;
  --chart-price-ink: #062347;
}

.arena-shell,
.trading-main {
  max-width: 1440px;
  margin-inline: auto;
  padding: 32px 24px;
  color: var(--arena-ink);
  font-family: var(--font);
  font-size: var(--type-sm);
  line-height: 1.6;
}
.arena-shell *, .trading-main * { min-width: 0; }
.arena-shell :is(h1,h2,h3), .trading-main :is(h1,h2,h3) {
  color: var(--arena-heading);
  font-family: var(--font);
  font-weight: 600;
  letter-spacing: 0;
}
.arena-shell :is(button,input,select,textarea),
.trading-main :is(button,input,select,textarea) {
  font-family: var(--font);
  font-size: var(--type-sm);
  line-height: 1.5;
}
.arena-shell :is(button,a,input,select,textarea,[tabindex]):focus-visible,
.trading-main :is(button,a,input,select,textarea,[tabindex]):focus-visible {
  outline: 2px solid var(--arena-action);
  outline-offset: 3px;
}
.arena-shell :is(.numeric,.standing-return,.standing-rank,.standing-movement,.market-price,.session-strip strong,time),
.trading-main :is(.terminal-quote,.context-pnl-amount,.book-level,.book-mid,.dock-equity,dd,.position-pnl,input) {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* A single editorial masthead precedes the functional data sheets. */
.arena-shell .page-heading {
  padding: 32px;
  background: #00356b;
  color: #f6f4ef;
  border: 1px solid #00356b;
  gap: 24px;
  margin: 0;
  box-shadow: none;
}
.arena-shell .page-heading::before,
.arena-shell .page-heading::after { display: none; }
.arena-shell .page-heading h1 {
  max-width: 30ch;
  color: #f6f4ef;
  font-size: var(--type-xl);
  line-height: 1.3;
  text-wrap: balance;
}
.arena-shell .page-heading .eyebrow {
  color: #d5e1ef;
  font-size: var(--type-xs);
  font-weight: 500;
  letter-spacing: .04em;
  margin-bottom: 16px;
}
.arena-shell .hero-status-dot { background: #c7e3d2; }
.arena-shell .hero-edition { border-color: #7e9cbd; }
.arena-shell .live-controls { flex-shrink: 0; gap: 16px; }
.arena-shell .page-heading .connection-state { display: inline-flex; color: #d6eadf; }
.arena-shell .page-heading .connection-state.paused { color: #e1e6ee; }
.arena-shell .page-heading .outline-button {
  min-height: 44px;
  padding: 8px 16px;
  color: #00356b;
  background: #f6f4ef;
  border: 1px solid #f6f4ef;
  border-radius: 2px;
  white-space: nowrap;
}
.arena-shell .page-heading .outline-button:hover { background: #fff; }
.arena-shell .page-heading button:focus-visible { outline-color: #f6f4ef; }
.arena-shell .session-strip {
  grid-template-columns: 1.1fr 1.2fr .8fr .8fr 1fr;
  padding: 24px;
  border-top: 0;
  margin-bottom: 24px;
  border-radius: 0;
}
.arena-shell .session-strip > div { padding-inline: 20px; }
.arena-shell .session-strip > div:first-child { padding-left: 0; }
.arena-shell .session-strip span { font-size: var(--type-xs); line-height: 1.6; }
.arena-shell .session-strip strong { font-size: var(--type-lg); line-height: 1.3; }
.arena-shell .session-title strong { font-size: var(--type-sm); line-height: 1.5; }
.arena-shell .session-clock strong { font-size: var(--type-md); }
.arena-shell .session-strip .session-dot { width: 4px; height: 32px; }

/* Workspaces remain data-dense, but never achieve density by shrinking type. */
.arena-shell { --arena-market-height: 44rem; --arena-lower-height: 22rem; --arena-standings-height: 44rem; }
.arena-shell .arena-grid {
  grid-template-columns: 280px minmax(0,1fr) 304px;
  grid-template-rows: var(--arena-market-height) var(--arena-lower-height);
  gap: 16px;
  min-height: 0;
  align-items: stretch;
}
.arena-shell :is(.standings-column,.market-column) {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  grid-template-rows: subgrid;
  grid-row: 1 / span 2;
  gap: inherit;
  min-height: 0;
}
.arena-shell .standings-column { grid-column: 1; }
.arena-shell .market-column { grid-column: 2; }
.arena-shell .chat-column { grid-column: 3; grid-row: 1 / span 2; contain: size; }
.arena-shell .chat-column > #chat-root { min-height: 0; height: 100%; }
.arena-shell :is(.market-panel,.tape-panel,.standings-panel,.bulletin-panel) { height: 100%; }
.arena-shell :is(.panel,.arena-chat), .trading-main .terminal-panel {
  background: var(--arena-surface);
  border: 1px solid var(--arena-line);
  border-top: 2px solid var(--arena-accent);
  border-radius: 2px;
  box-shadow: none;
}
.arena-shell .panel-heading {
  min-height: 64px;
  padding: 16px;
  border-bottom: 1px solid var(--arena-line);
  gap: 8px;
  flex-wrap: wrap;
}
.arena-shell .panel-heading h2, .arena-shell .arena-chat__title,
.trading-main .terminal-panel-heading h2 { font-size: var(--type-md); line-height: 1.4; }
.arena-shell .heading-title { gap: 8px; }
.arena-shell .square { width: 6px; height: 6px; }
.arena-shell .standings-meta { padding-top: 12px; margin-inline: 16px; }
.arena-shell .standings-row {
  grid-template-columns: 22px 32px minmax(0,1fr) auto;
  min-height: 76px;
  padding: 12px;
  gap: 8px;
}
.arena-shell .standings-row .avatar { display: flex; width: 32px; height: 32px; }
.arena-shell .standing-name { font-size: var(--type-sm); font-weight: 600; line-height: 1.5; }
.arena-shell .standing-university { margin-top: 2px; line-height: 1.5; }
.arena-shell .standing-return { font-size: var(--type-sm); }
.arena-shell .standing-rank.podium { font-weight: 600; }
.arena-shell :is(.tiny-label,.tag,.standings-meta,.standing-university,.standing-movement,.panel-footnote,.bulletin-label,.bulletin-detail,.bulletin-footer,.market-bottom,.chart-legend) {
  font-size: var(--type-xs);
  line-height: 1.6;
}
.arena-shell .bulletin-item { padding: 16px; gap: 4px; }
.arena-shell .bulletin-headline { flex-wrap: wrap; }
.arena-shell .bulletin-headline strong { font-size: var(--type-sm); }
.arena-shell .bulletin-value { font-size: var(--type-md); }
.arena-shell .market-header { padding: 20px; align-items: center; gap: 16px; }
.arena-shell .instrument-mark { width: 40px; height: 40px; font-size: var(--type-lg); }
.arena-shell .instrument-title select { min-height: 44px; font-size: var(--type-md); max-width: 190px; }
.arena-shell .market-price > strong { font-size: var(--type-lg); line-height: 1.3; }
.arena-shell .market-price > span { font-size: var(--type-xs); line-height: 1.6; }
.arena-shell .chart-toolbar { padding: 4px 16px; background: var(--arena-raised); gap: 8px; }
.arena-shell :is(.range-controls button,.trade-filter,.standings-clear) { min-height: 44px; font-size: var(--type-sm); }
.arena-shell .range-controls button { padding: 8px; border-radius: 2px; }
.arena-shell .range-controls > span { font-size: var(--type-xs); }
.arena-shell .chart-legend { padding: 12px 20px 4px; gap: 12px; }
.arena-shell .chart-legend .chart-hint { display: none; }
.arena-shell .market-bottom { padding: 12px 20px; }
.arena-shell .tape-scroll th { padding: 10px 16px; font-size: var(--type-xs); }
.arena-shell .tape-scroll td { padding: 12px 16px; font-size: var(--type-sm); }
.arena-shell .arena-chat__header { padding: 16px; }
.arena-shell .arena-chat__tab { min-height: 72px; }
.arena-shell .arena-chat__message { margin-bottom: 20px; }
.arena-shell .arena-chat__messages { padding: 16px; }
.arena-shell .arena-chat__new { box-shadow: none; white-space: normal; }
.arena-shell .arena-chat__input { min-height: 80px; }
.arena-shell .arena-chat__compose-bottom { flex-wrap: wrap; }

/* Focused trading: the same sheets and type hierarchy, with market semantics intact. */
.trading-main .trading-context { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--arena-line); }
.trading-main .trading-context-main { flex-wrap: wrap; gap: 12px 16px; }
.trading-main .trading-context .trading-identity { width: auto; max-width: 100%; flex: 0 1 auto; min-width: 0; border: 0; padding: 0; }
.trading-main .trading-identity h1 { font-size: var(--type-xl); line-height: 1.3; white-space: normal; overflow-wrap: anywhere; }
.trading-main .trading-contest-context { flex: 1 1 280px; min-width: 0; }
.trading-main .trading-contest-context a { font-size: var(--type-sm); line-height: 1.5; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.trading-main .terminal-grid { gap: 16px; }
.trading-main .terminal-panel-heading { padding: 16px; min-height: 64px; }
.trading-main .ticket-panel > .terminal-panel-heading h2 { font-size: var(--type-md); }
.trading-main .terminal-market-head { height: auto; min-height: 0; padding: 20px; gap: 16px; flex-wrap: wrap; }
.trading-main .terminal-market-head .instrument-title select { min-height: 44px; font-size: var(--type-md); }
.trading-main .terminal-market-head .instrument-title { flex: 1 1 160px; }
.trading-main .terminal-quote-group { flex: 1 1 300px; }
.trading-main .terminal-quote-group :is(.context-label,.terminal-quote > span) { white-space: normal; min-height: 0; line-height: 1.6; }
.trading-main .terminal-quote > strong, .trading-main .context-pnl-amount strong { font-size: var(--type-lg); line-height: 1.3; }
.trading-main .terminal-chart-toolbar { padding-inline: 16px; background: var(--arena-raised); }
.trading-main .terminal-chart-toolbar .range-controls button { min-height: 44px; font-size: var(--type-sm); }
.trading-main :is(.record-tabs button,.order-type-tabs button,.quick-quantities button,.record-action) {
  min-height: 44px;
  font-size: var(--type-sm);
}
.trading-main .direction-controls button > span,
.trading-main .direction-controls button > strong { font-size: var(--type-sm); line-height: 1.5; }
.trading-main .direction-controls button { min-height: 76px; }
.trading-main .ticket-field label { font-size: var(--type-sm); font-weight: 600; }
.trading-main .ticket-field label > span:last-child { font-size: var(--type-xs); }
.trading-main :is(.ticket-help,.order-policy,.ticket-error,.book-note,.trading-footnote) { font-size: var(--type-xs); line-height: 1.6; }
.trading-main .ticket-leverage { font-size: var(--type-sm); }
.trading-main .dock-account { padding: 16px; }
.trading-main .dock-equity { flex-wrap: wrap; font-size: var(--type-xs); }
.trading-main .dock-equity strong { font-size: var(--type-md); }
.trading-main .order-estimate { margin-block: 16px; }
.trading-main .submit-order { min-height: 48px; font-size: var(--type-sm); }
.trading-main .submit-order:hover { transform: none; }
.trading-main .orderbook-panel .terminal-panel-heading { min-height: 64px; padding: 16px 12px; }
.trading-main .book-level { min-height: 32px; }
.trading-main .book-mid strong { font-size: var(--type-md); }
.trading-main .records-toolbar { padding-inline: 16px; }
.trading-main .record-tabs { gap: 16px; }
.trading-main .record-tabs button { width: auto; min-width: 88px; padding-inline: 8px; }
.trading-main .records-empty { gap: 8px; }
.trading-main .records-empty strong { font-weight: 600; }
.trading-main .records-scroll td { font-size: var(--type-xs); line-height: 1.6; }
.arena-shell .arena-chart__tooltip, .trading-main .arena-chart__tooltip { border-radius: 2px; box-shadow: 0 4px 16px #00356b18; }
.arena-shell .arena-chart__tooltip-trader, .trading-main .arena-chart__tooltip-trader { font-size: var(--type-sm); }

/* A wider chart takes priority over keeping three cramped columns. */
@media (min-width: 1200px) {
  .trading-main .terminal-grid { grid-template-columns: minmax(0,1fr) 216px 280px; }
}
@media (min-width: 901px) and (max-width: 1199px) {
  .arena-shell .arena-grid { grid-template-columns: 280px minmax(0,1fr); grid-template-rows: var(--arena-market-height) var(--arena-lower-height) 44rem; }
  .arena-shell .standings-column { grid-column: 1; }
  .arena-shell .market-column { grid-column: 2; }
  .arena-shell .chat-column { grid-column: 1/-1; grid-row: 3; height: auto; contain: size; }
  .arena-shell .session-strip { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .arena-shell .session-strip > div:nth-child(4) { display: none; }
  .arena-shell .session-strip > div { padding-inline: 12px; }
  .arena-shell .session-strip strong { font-size: var(--type-md); }
  .arena-shell .session-title strong { font-size: var(--type-sm); }
  .arena-shell .market-header { padding: 16px; }
  .arena-shell .instrument-mark { display: none; }
  .arena-shell .instrument-title select { max-width: 160px; }
  .arena-shell .live-controls .connection-state { display: none; }
  .trading-main .terminal-grid { grid-template-columns: minmax(0,1fr) 216px; grid-template-rows: 40rem 24rem auto; }
  .trading-main .terminal-market { grid-column: 1; grid-row: 1; }
  .trading-main .records-panel { grid-column: 1; grid-row: 2; }
  .trading-main .orderbook-panel { grid-column: 2; grid-row: 1 / span 2; }
  .trading-main .ticket-panel { grid-column: 1/-1; grid-row: 3; }
  .trading-main .ticket-editor { overflow: visible; }
}
@media (max-width: 900px) {
  .arena-shell, .trading-main { padding: 24px 16px; }
  .arena-shell .page-heading { padding: 24px; flex-direction: column; align-items: flex-start; gap: 24px; }
  .arena-shell .page-heading h1 { max-width: none; font-size: var(--type-xl); }
  .arena-shell .page-heading .live-controls { justify-content: space-between; width: 100%; }
  .arena-shell .session-strip { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px 16px; padding: 20px; }
  .arena-shell .session-strip > div { border: 0; padding: 0; }
  .arena-shell .session-strip > div:nth-child(4) { display: none; }
  .arena-shell .session-strip > div:nth-child(n+3) { border-top: 1px solid var(--arena-line); padding-top: 16px; }
  .arena-shell .session-strip strong { font-size: var(--type-md); white-space: normal; }
  .arena-shell .session-title strong { font-size: var(--type-sm); }
  .arena-shell .arena-grid { display: flex; flex-direction: column; gap: 16px; }
  .arena-shell :is(.market-column,.standings-column) { display: flex; flex-direction: column; gap: 16px; }
  .arena-shell .market-column { order: 0; }
  .arena-shell .standings-column { order: 1; }
  .arena-shell .chat-column { order: 2; height: auto; contain: none; }
  .arena-shell .market-panel { height: 40rem; }
  .arena-shell .tape-panel { height: 22rem; }
  .arena-shell .standings-panel { height: 36rem; contain: none; }
  .arena-shell .bulletin-panel { height: 24rem; }
  .arena-shell .chat-column > #chat-root { height: 46rem; }
  .arena-shell .chart-root { min-height: 0; }
  .arena-shell .market-header { padding: 16px; align-items: center; }
  .arena-shell .instrument-mark { display: none; }
  .arena-shell .instrument-title select { max-width: 160px; font-size: var(--type-md); }
  .arena-shell .range-controls > span { display: none; }
  .arena-shell .chart-legend { padding-inline: 16px; }
  .trading-main .terminal-grid { display: flex; flex-direction: column; gap: 16px; }
  .trading-main .terminal-market { order: 0; height: 40rem; min-height: 40rem; }
  .trading-main .ticket-panel { order: 1; }
  .trading-main .records-panel { order: 2; height: 36rem; min-height: 24rem; max-height: none; }
  .trading-main .orderbook-panel { order: 3; height: 44rem; min-height: 32rem; }
  .trading-main .ticket-editor { flex: none; overflow: visible; }
  .trading-main .terminal-market-head { height: auto; min-height: 0; padding: 16px; }
  .trading-main .terminal-market-head .instrument-title select { max-width: 170px; }
  .trading-main .terminal-quote-group { width: 100%; }
}
@media (max-width: 480px) {
  .arena-shell .page-heading { padding: 24px 20px; }
  .arena-shell .hero-edition { padding-left: 0; border-left: 0; width: 100%; }
  .arena-shell .live-controls { flex-wrap: wrap; }
  .arena-shell .page-heading .connection-state { white-space: normal; }
  .arena-shell .market-header { align-items: flex-start; gap: 8px; flex-wrap: wrap; }
  .arena-shell .instrument-title { flex: 1; }
  .arena-shell .market-price { margin-left: auto; }
  .arena-shell .instrument-title select { max-width: 144px; font-size: var(--type-sm); }
  .arena-shell .market-price > strong { font-size: var(--type-md); }
  .arena-shell .market-price > span { max-width: 144px; }
  .arena-shell .chart-toolbar { padding-inline: 12px; }
  .arena-shell .standings-row { grid-template-columns: 22px 32px minmax(0,1fr) auto; gap: 8px; }
  .arena-shell .standing-name { white-space: normal; overflow-wrap: anywhere; }
  .arena-shell .arena-chat__identity { white-space: normal; }
  .arena-shell .arena-chat__compose-bottom { gap: 8px; }
  .trading-main .trading-context-main { flex-wrap: wrap; gap: 12px; }
  .trading-main .trading-title-divider { display: none; }
  .trading-main .terminal-quote-group { gap: 12px; grid-template-columns: minmax(0,1fr) 1px minmax(0,1fr); }
  .trading-main .terminal-quote > strong, .trading-main .context-pnl-amount strong { font-size: var(--type-md); }
  .trading-main .terminal-chart-toolbar .range-controls > span { display: none; }
}
@media (max-width: 600px) {
  .trading-main .trading-context { grid-template-rows: auto auto; }
  .trading-main .trading-context-main { align-items: flex-start; flex-direction: column; }
  .trading-main .trading-contest-context { flex: 0 1 auto; }
  .trading-main .trading-title-divider { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .arena-shell *, .arena-shell *::before, .arena-shell *::after,
  .trading-main *, .trading-main *::before, .trading-main *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
