/* The page around the v5 terminal: what the mock-up did not draw and the terminal online has (the account menu, the
   language menu, the banners, the visitor's keys, "No active account", the account notice, "Service unavailable"),
   the loading state of a plate whose panel is not drawn yet, the price badge of term-fresh.js, the status bar's parts.
   Tokens only (tokens.css); hover only where a pointer hovers; never italic. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 200; padding: 8px 12px; border-radius: var(--r); background: var(--surface-3); color: var(--text); text-decoration: none; }
.skip:focus { top: 8px; }
a { color: var(--acc); }
a.key { text-decoration: none; }

/* who sees what: a visitor, a trader, a demo session, a brand without funding */
html:not([data-demo]) [data-demo-note] { display: none !important; }
body:not([data-visitor="true"]) [data-only="visit"] { display: none !important; }
body[data-visitor="true"]:not([data-show]) [data-only="live"] { display: none !important; }   /* the framed showcase shows the account's panels (show.js) */
body[data-na="none"] #app, body[data-mode="unavailable"] #app { display: none; }
html[data-funding="off"] .st-fund { display: none; }

/* ---- top bar ---- */
.brandmark { color: var(--text); text-decoration: none; }
.brand-logo { width: 24px; height: 24px; flex: none; }
.tbar .app-back { min-width: 36px; min-height: 36px; padding: 0; margin: 0; border-radius: var(--r); }
.tbar .app-back__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mkt-btn:disabled { opacity: 1; cursor: default; }
.mkt-btn:disabled .mkt-caret { display: none; }
.mkt-btn.frozen { box-shadow: inset 0 1px 0 var(--key-shine), inset 0 0 0 1px var(--warn), 0 1px 0 var(--key-edge); }
#lastPx[data-fresh="stale"], #lastPx[data-fresh="dead"] { color: var(--dim); }
.px-badge { align-self: center; padding: 2px 6px; border-radius: 4px; background: var(--warn-soft); color: var(--warn); font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; }
.quote-ch[data-tone="up"], #msFunding[data-tone="up"] { color: var(--up); }
.quote-ch[data-tone="down"], #msFunding[data-tone="down"] { color: var(--down); }
.stats[data-state="waiting"] dd { color: var(--dim); }
.key-acc { background: linear-gradient(var(--acc), var(--acc-strong)); color: var(--key-ink); }
.visit-keys { display: flex; gap: 8px; }

/* ---- account menu ---- */
.menu { position: relative; }
/* the account pill of the mock-up, as the menu's button (a phone keeps the initial alone) */
.menu-btn { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px 0 6px; border: 0; border-radius: 999px; background: none; box-shadow: inset 0 0 0 1px var(--hair-2); color: var(--mute); font: inherit; font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.menu-btn[aria-expanded="true"] { box-shadow: inset 0 0 0 1px var(--acc); }
.term[data-form="phone"] .menu-btn { height: 44px; padding: 0 8px; }
.menu-avatar { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-4); color: var(--text); font-size: 11px; font-weight: 700; }
.menu-avatar:empty { display: none; }
.menu-name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.menu-acct { color: var(--dim); }
.menu-acct:empty { display: none; }
.userbar { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; display: grid; gap: 2px; min-width: 220px; padding: 6px; border-radius: var(--r); background: var(--surface-2); box-shadow: var(--shadow-pop); }
.ub-item { display: flex; align-items: center; min-height: 36px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: none; color: var(--mute); font: inherit; font-size: 12.5px; font-weight: 600; text-align: left; text-decoration: none; cursor: pointer; }
.ub-item:disabled { opacity: 0.5; cursor: not-allowed; }
.ub-legal { display: block; max-width: 240px; margin: 4px 0 0; padding: 8px 10px 4px; border-top: 1px solid var(--hair); color: var(--dim); font-size: 11px; line-height: 1.45; }   /* the price source line and the chart library credit live in the menu, never under the chart (founder, 2026-11-23) */
.ub-legal a { color: var(--mute); }
.ub-item:focus-visible, .field-sel:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.field-sel { min-height: 36px; margin: 2px 4px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: var(--bg); box-shadow: inset 0 0 0 1px var(--hair-2); color: var(--text); font: inherit; }

/* ---- language: the flag and its menu (space/space-menus.js) ---- */
.term-lang { position: relative; }
.term-lang .sp-lang-btn { appearance: none; display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; box-shadow: inset 0 0 0 1px var(--hair-2); cursor: pointer; }
.term-lang .sp-lang-btn[aria-expanded="true"] { box-shadow: inset 0 0 0 1px var(--acc); }
.term-lang .sp-flag { width: 20px; height: 14px; border-radius: 2px; box-shadow: 0 0 0 1px var(--hair-3); }
.term-lang .sp-pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 60; min-width: 210px; padding: 6px; border-radius: var(--r); background: var(--surface-2); box-shadow: var(--shadow-pop); }
.term-lang .sp-lang-list { display: grid; gap: 2px; }
.term-lang .sp-lang-row { appearance: none; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; text-align: start; cursor: pointer; }
.term-lang .sp-lang-name { flex: 1; min-width: 0; }
.term-lang .sp-lang-row[aria-pressed="true"] { background: var(--surface-4); }
.term-lang .sp-icon { flex: none; color: var(--acc); }

/* ---- banners: never a row of the terminal's own (one coming or going would lay it out again and redraw the chart).
   A computer: in the status bar, before the legal line. A phone: over the account strip, at its height. ---- */
.banners { display: flex; }
.banners:empty { display: none; }
.banner { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--text); background: var(--warn-soft); box-shadow: inset 2px 0 0 var(--warn); }
.banner > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.banner[data-tone="down"] { background: var(--down-soft); box-shadow: inset 2px 0 0 var(--down); }
.sbar { contain: layout paint; }
.tbar { contain: layout; position: relative; z-index: 34; }   /* the freshness badge (term-fresh.js) comes and goes inside the bar only; contained, the bar is a layer of its own: over the panels, where its menus open, and under the scrim */
.sbar > .banners { flex: 0 0 auto; max-width: 62%; min-width: 0; gap: 6px; margin-left: auto; overflow: hidden; }   /* the legal line gives way first */
.sbar > .banners .banner { flex: 0 1 auto; min-width: 0; height: 18px; padding: 0 8px; border-radius: 4px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.sbar .banner-btn { flex: none; min-height: 0; height: 16px; padding: 0 6px; border-radius: 3px; font-size: 10.5px; }
.sbar > .sb-legal { margin-inline-start: auto; }   /* the bar's far end, where it sat beside the price tape (gone in v147) */
.term[data-banner="1"] .sbar > .sb-legal { margin-inline-start: 0; }   /* a banner takes the free room before it (its own margin) */
.term[data-form="phone"] > .banners { grid-area: strip; z-index: 6; height: 0; min-height: 100%; overflow: hidden; }
body[data-visitor="true"] .term[data-form="phone"] > .banners { grid-area: main; align-self: start; height: auto; min-height: 0; }
.term[data-form="phone"] > .banners .banner { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 0 0 14px; background: var(--surface-2); background-image: linear-gradient(var(--warn-soft), var(--warn-soft)); font-size: 12px; line-height: 1.35; border-bottom: 1px solid var(--hair); }
.term[data-form="phone"] > .banners .banner[data-tone="down"] { background-image: linear-gradient(var(--down-soft), var(--down-soft)); }
.term[data-form="phone"] > .banners .banner > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.term[data-form="phone"] > .banners .banner:not(:last-child) { display: none; }   /* the link's news before the frozen markets */
.term[data-form="phone"] .banner-btn { flex: none; align-self: stretch; margin-left: auto; min-height: 44px; border-radius: 0; }

/* ---- a plate whose panel is not drawn yet: a still outline that breathes, and its words ---- */
.pstate { position: absolute; inset: 0; z-index: 1; display: grid; align-content: center; justify-items: center; gap: 12px; padding: 16px; pointer-events: none; }
.book .pstate, .bot-body .pstate { position: relative; inset: auto; min-height: 100%; }
.gaugep .pstate, .ticketp .pstate { position: relative; inset: auto; flex: 1; }
.pstate-text { margin: 0; color: var(--dim); font-size: 12px; }
.pstate-skel { display: block; width: min(320px, 80%); border-radius: var(--r-sm); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair); animation: pstate-breathe 1.6s var(--ease) infinite alternate; }
.pstate-chart { width: 86%; height: 46%; }
.pstate-rows { width: 86%; height: 60%; }
.pstate-form { width: 100%; height: 56%; }
.pstate-line { width: 100%; height: 10px; }
.strip .pstate-line { height: auto; background: none; box-shadow: none; color: var(--dim); font-size: 12px; animation: none; }
.ptabs-title { display: inline-flex; align-items: center; min-height: 40px; padding: 0 10px; color: var(--text); font-size: 12px; font-weight: 600; }
@keyframes pstate-breathe { from { opacity: 0.55; } to { opacity: 1; } }

/* ---- the visitor's ticket ---- */
.visit { display: grid; gap: 10px; align-content: start; }
.visit-title { margin: 0; font-size: 15px; font-weight: 700; }
.visit-text { margin: 0; color: var(--mute); font-size: 12.5px; line-height: 1.5; }
.visit-cta { min-height: 40px; }
.visit-have { margin: 0; padding: 4px 2px; color: var(--mute); font-size: 12.5px; }
/* a visitor on a computer has no ticket to fill the column: the visit plate is as tall as what it says, the book takes
   the rest of the column down to the foot of the positions panel, and the chart the middle column's width (B10); no
   account's line (the top bar's keys sign in), the positions panel one line (Q1) */
body[data-visitor="true"]:not([data-show]) .term[data-form="desk"]:not([data-focus="1"]) .tgrid { --bot: var(--bot-fold); grid-template-columns: minmax(0, 1fr) var(--tk-w);
  grid-template-rows: auto minmax(0, 1fr) var(--bot); grid-template-areas: "chart ticket" "chart book" "bottom book"; }
body[data-visitor="true"]:not([data-show]) .term[data-form="desk"]:not([data-focus="1"]) .tgrid[data-ladder] { grid-template-columns: minmax(0, 1fr) 320px; }
body[data-visitor="true"]:not([data-show]) .term[data-form="desk"] :is(.gaugep, .split) { display: none; }
body[data-visitor="true"]:not([data-show]) .term[data-form="desk"] .botp { flex-direction: row; align-items: center; }
body[data-visitor="true"]:not([data-show]) .term[data-form="desk"] .botp > .ptabs-in { flex: none; border-bottom: 0; }
body[data-visitor="true"]:not([data-show]) .term[data-form="desk"] .bot-body { flex: 1 1 auto; overflow: hidden; }
body[data-visitor="true"]:not([data-show]) .term[data-form="desk"] .bot-body > .pstate { display: block; min-height: 0; padding: 0 8px; }
body[data-visitor="true"]:not([data-show]) .term[data-form="desk"] .bot-body .pstate-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-msg { margin: 0; min-height: 1.4em; color: var(--mute); font-size: 12px; line-height: 1.4; }
.tk-msg[data-tone="down"] { color: var(--down); }
.tk-msg:empty { display: none; }

/* ---- status bar ---- */
.sb-conn { display: inline-flex; align-items: center; gap: 6px; color: var(--mute); font-weight: 600; }
.sb-conn .dot { background: var(--warn); }
.sb-conn[data-tone="ok"] .dot { background: var(--acc); }
.sb-conn[data-tone="down"] .dot { background: var(--down); }
.sb-lat { color: var(--dim); font-weight: 400; }
.sb-item { display: inline-flex; gap: 6px; }
.sb-k { color: var(--dim); }
#sbSource[data-tone="warn"] #sbTick { color: var(--warn); }
#sbSource[data-tone="down"] #sbTick { color: var(--down); }
/* The legal line never ends on "…": when the bar is short of room its sentences leave whole, the last one first (the
   chart's licence, whose notice ships with the page, then the demo note, then the brand's own line when two banners
   take the bar). They wrap to a second line the one-line box does not show; `clip` so that nothing, a focus included,
   can scroll that line up. The empty first item holds the first line, so that the first sentence can leave it as the
   others do. The link reached by the keyboard brings the end of the line back. */
.sb-legal { flex: 0 1 auto; min-width: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; align-content: flex-start; column-gap: 0.5em; height: 16px; line-height: 16px; overflow: hidden; overflow: clip; color: var(--dim); white-space: nowrap; }
.sb-legal::before { content: ""; flex: none; width: 0; height: 100%; margin-inline-end: -0.5em; }   /* holds the first line at its full height: a sentence too long for it goes under, out of sight */
.sb-legal > * { flex: none; }
.sb-legal:focus-within { flex-wrap: nowrap; }
.sb-legal:focus-within > :first-child { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sb-legal a { color: var(--mute); }

/* ---- no active account, the account notice, service unavailable ---- */
.na-screen, .gate { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.gate { align-content: center; gap: 12px; text-align: center; }
.gate h1 { margin: 0; font-size: 20px; font-weight: 700; }
.gate p { max-width: 46ch; margin: 0; color: var(--mute); line-height: 1.5; }
.na-card { display: grid; gap: 12px; width: min(460px, 100%); padding: 24px; border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair); }
.na-card h1, .na-card h2 { margin: 0; font-size: 20px; font-weight: 700; }
.eyebrow { margin: 0; color: var(--dim); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.na-text { margin: 0; color: var(--mute); line-height: 1.5; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.na-notice { padding: 0; border: 0; background: none; color: var(--text); }
.na-notice::backdrop { background: var(--scrim); }

/* ---- phone ---- */
.term[data-form="phone"] .menu-name, .term[data-form="phone"] .menu-acct, .term[data-form="phone"] .visit-keys .key-ghost { display: none; }
/* a visitor's two keys: in the top bar of a computer, in a band above the tabs of a phone (the bar keeps the market,
   its price and the language) */
.visitbar { display: none; }
.term[data-form="phone"] .tbar .visit-keys { display: none; }
.term[data-form="phone"] .visitbar { grid-area: pkeys; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--hair); background: var(--surface); }
.term[data-form="phone"] .visitbar .key { min-height: 46px; font-size: 14px; }

@media (hover: hover) {
  .ub-item:hover, .term-lang .sp-lang-row:hover { background: var(--surface-3); color: var(--text); }
  .term-lang .sp-lang-btn:hover { box-shadow: inset 0 0 0 1px var(--hair-3); }
  .menu-btn:hover .menu-name, .sb-legal a:hover { color: var(--text); }
}
@media (prefers-reduced-motion: reduce) {
  .pstate-skel { animation: none; }
}
