/* ==========================================================================
   TERMINAL LOOK for every screen, like the Swarm and the Morning Brief:
   mono capitals with wide tracking for titles and labels, a small colour square
   before each screen's title, near-black panels with thin strong borders and
   tighter corners, outlined mono buttons. Tokens only; loaded after the screens'
   own styles so it wins.
   ========================================================================== */

/* The screens' backdrop: the Swarm's black, with a faint dot grid. */
:is(#dashboard, #overview, #logview, #reportview, #tradesview) {
  background-color: var(--swarm-bg);
  background-image: radial-gradient(color-mix(in srgb, var(--text) 7%, transparent) 1px, transparent 1.2px);
  background-size: 22px 22px;
}

/* Titles: "■ TRADES", like "■ MORNING BRIEF". */
#dashboard .dtool .h2,
#overview .ov__title,
#logview .lgfull__head .lgcard__title,
#reportview .rc__title,
#tradesview .rc__title {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-weight: 700; font-size: var(--fs-lg);
  text-transform: uppercase; letter-spacing: 0.14em;
}
#dashboard .dtool .h2::before,
#overview .ov__title::before,
#logview .lgfull__head .lgcard__title::before,
#reportview .rc__title::before,
#tradesview .rc__title::before { content: ''; width: 10px; height: 10px; flex: none; background: var(--term-sq, var(--accent)); }
#dashboard { --term-sq: var(--accent); }
#overview { --term-sq: var(--av-gold); }
#tradesview { --term-sq: var(--pos); }
#logview { --term-sq: var(--bot-skeptic); }
#reportview { --term-sq: var(--warn); }

/* Sub-lines under titles: small mono, like the Brief's date line. */
:is(#overview .ov__sub, #logview .lgfull__sub, #reportview .rc__head .muted, #tradesview .rc__head .muted, #dashboard .dtool__sub) {
  font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 0.04em; color: var(--text-3);
}

/* Labels and table headers: mono capitals. */
:is(#dashboard, #overview, #logview, #reportview, #tradesview, #feed, .side) :is(.dwidget__title, .rc__label, .tv__row--head, .rc__table th, .dpos--head, .durow--head, .eyebrow, .equity__label, .trow--head, .dtable th, .form-group, .lg__day, .debate__title, .lgfull__killed span) {
  font-family: var(--font-mono); letter-spacing: 0.12em;
}
#tradesview .tv__sec > :first-child { font-family: var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; font-size: var(--fs-2xs); color: var(--text-3); }

/* Panels: near-black, thin strong borders, tighter corners, no soft shadow. */
:is(#dashboard .dwidget, #overview .ov, #logview .lgcard, #logview .lgfull, #reportview .rc__tile, #reportview .rc__empty, #reportview .rc > section, #tradesview .tv__table, #tradesview .tv__empty, .side .panel, .side .kv) {
  background: var(--mb-bg); border-color: var(--border-strong); border-radius: var(--radius-md); box-shadow: none;
}
:is(#tradesview, #reportview) :is(.rc__tile) { border-style: solid; }
#tradesview .tv__empty, #reportview .rc__empty { border-style: dashed; }

/* Buttons on the screens: outlined mono capitals, like "▶ RUN BRIEF". */
:is(#dashboard, #overview, #logview, #reportview, #tradesview) :is(.btn--secondary, .btn--ghost):not(.btn--icon) {
  height: 26px; padding: 0 12px; border: var(--border-w) solid var(--border-strong); border-radius: var(--radius-sm); background: transparent;
  font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text);
}
:is(#dashboard, #overview, #logview, #reportview, #tradesview) :is(.btn--secondary, .btn--ghost):not(.btn--icon):hover { background: var(--hover); border-color: var(--text-3); }

/* Option pills on the screens (This week / Last week, 1D 1W…, All · Wins · Losses). */
:is(#dashboard, #overview, #logview, #reportview, #tradesview) .seg { border-radius: var(--radius-sm); border-color: var(--border-strong); background: transparent; }
:is(#dashboard, #overview, #logview, #reportview, #tradesview) .seg__btn { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: 0.08em; text-transform: uppercase; border-radius: 3px; }
:is(#dashboard, #overview, #logview, #reportview, #tradesview) .seg__btn.is-on { background: var(--active); box-shadow: inset 0 0 0 1px var(--border-strong); }

/* The view tabs and the round controls above them: the same voice. */
.seg--view .seg__btn { font-family: var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; font-size: var(--fs-xs); }
#roundsMeta { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: 0.08em; text-transform: uppercase; }

/* The account panel on the right: mono labels, square cells. */
.side .kv span { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.side .section-head .eyebrow, .side #acctTitle { font-family: var(--font-mono); letter-spacing: 0.12em; }

/* Card titles inside screens (the Desk's Debate log and Logger, the Report's sections). */
.lgcard__title, #reportview h3, #tradesview h3, #dashboard .dwidget h3 {
  font-family: var(--font-mono); font-weight: 700; font-size: var(--fs-md); text-transform: uppercase; letter-spacing: 0.12em;
}
#overview .lgcard__title::before, #reportview h3::before { content: '▸ '; color: var(--term-sq, var(--accent)); }

/* ---------- Settings in the same terminal style (overrides the softer look in app.css) ---------- */
#settings .sheet { background: var(--mb-bg); border: var(--border-w) solid var(--border-strong); border-radius: var(--radius-md); }
#settings .sheet__head { background: var(--mb-bg); border-bottom-color: var(--border-strong); }
#settings .sheet__head h2, #settings .sheet__head .h2, #settings .sheet__title, #settings .sheet__head > :first-child {
  display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-weight: 700; font-size: var(--fs-lg); text-transform: uppercase; letter-spacing: 0.14em;
}
#settings .sheet__head > :first-child::before { content: ''; width: 10px; height: 10px; background: var(--accent); flex: none; }
#settings .sheet__foot { background: var(--mb-bg); border-top-color: var(--border-strong); }

/* Tabs: mono capitals, a square marker on the one open. */
#settings .tabs { background: var(--swarm-bg); border-right-color: var(--border-strong); padding: var(--sp-3) var(--sp-2); }
#settings .tabs__btn { height: 32px; border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-2); }
#settings .tabs__btn:hover { transform: none; background: var(--hover); }
#settings .tabs__btn.is-on { background: var(--active); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }
#settings .tabs__btn.is-on::before { left: 0; top: 0; bottom: 0; width: 3px; border-radius: 0; background: var(--accent); }
#settings #settingsSearch { border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: var(--fs-xs); background: var(--swarm-bg); border-color: var(--border-strong); }

/* The pane: a dot grid like the screens; sections as "▸ TITLE ───". */
#settings #settingsPanes { background-color: var(--swarm-bg); background-image: radial-gradient(color-mix(in srgb, var(--text) 7%, transparent) 1px, transparent 1.2px); background-size: 22px 22px; }
#settings .form-group { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: 0.14em; color: var(--text-2); }
#settings .form-group::before { content: '▸'; color: var(--accent); }
#settings .form-group::after { background: var(--border-strong); }

/* Rows: near-black panels with thin strong borders and tight corners. */
#settings .field { background: var(--mb-bg); border: var(--border-w) solid var(--border-strong); border-radius: var(--radius-sm); padding: 11px 14px; }
#settings .field:hover { background: var(--mb-bg); border-color: var(--text-3); }
#settings .field:focus-within { border-color: var(--accent); box-shadow: none; }
#settings .field__label > span:first-child { font-size: var(--fs-sm); }
#settings .field__help { font-size: var(--fs-xs); }

/* Notes: a dashed terminal box, mono, with a "›" marker. */
#settings .form-note { background: var(--mb-bg); border: var(--border-w) dashed var(--border-strong); border-left: 2px solid var(--accent); border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: 0.02em; line-height: 1.6; padding: 10px 12px 10px 28px; }
#settings .form-note::before { content: '›'; width: auto; height: auto; top: 8px; left: 12px; background: none; font-size: 14px; }

/* Inputs, pills and buttons: mono, square-ish, outlined. */
#settings .input { border-radius: var(--radius-sm); background: var(--swarm-bg); border-color: var(--border-strong); font-family: var(--font-mono); }
#settings .seg { border-radius: var(--radius-sm); background: transparent; border-color: var(--border-strong); }
#settings .seg__btn { border-radius: 3px; font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: 0.08em; text-transform: uppercase; }
#settings .seg__btn.is-on { background: var(--active); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
#settings .pane :is(.btn--secondary, .btn--ghost):not(.btn--icon), #settings .sheet__foot .btn--secondary {
  height: 28px; padding: 0 12px; border: var(--border-w) solid var(--border-strong); border-radius: var(--radius-sm); background: transparent;
  font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text);
}
#settings .pane .btn--primary, #settings .sheet__foot .btn--primary { border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: 0.1em; text-transform: uppercase; }
#settings .switch__track { border-radius: 3px; }
#settings .switch__thumb { border-radius: 2px; }

/* Style switches (Crypto, Memecoins), presets, Vega's notes and the share card: same panels. */
#settings :is(.memestyle, .field--presets, .vcoach, .sharecard, .deskswitch) { border-radius: var(--radius-sm); }
#settings .sharecard { background: var(--mb-bg); border-color: var(--border-strong); }
#settings .sharecard__head b { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em; font-size: var(--fs-sm); }
#settings .sharecard__badge, #settings .sharetile__icon { border-radius: var(--radius-sm); }
#settings .sharecard__label { font-family: var(--font-mono); letter-spacing: 0.14em; }
#settings .sharechip { border-radius: 3px; font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: 0.08em; text-transform: uppercase; background: transparent; border-color: var(--border-strong); }
#settings .sharechip.is-on { background: var(--active); border-color: var(--accent); }
#settings .sharetile { border-radius: var(--radius-sm); background: transparent; border-color: var(--border-strong); }
#settings .sharetile b { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; font-size: var(--fs-xs); }
#settings .sharecard .input, #settings .sharecard__send { border-radius: var(--radius-sm); }
#settings .seg__btn { white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
#settings :is(.lc__hero, .lc__invest, .lc__m, .lc__lesson, .lc__conf, .lc__next, .lc__tier, .profile__head, .ref, .about__grid, .xid) { border-radius: var(--radius-sm); }
#settings :is(.lc__hero, .lc__invest) { background: var(--mb-bg); border-color: var(--border-strong); }
#settings .lc__invest b, #settings .lc__level { font-family: var(--font-mono); letter-spacing: 0.06em; }
#settings .field--presets { grid-template-columns: 1fr auto; }

/* Settings -> Appearance -> Font (app.js sets html[data-font]); fonts in fonts.css. */
:root[data-font="roboto"] { --font-sans: "Roboto", "Segoe UI", system-ui, sans-serif; }
:root[data-font="plex"] { --font-sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif; }
:root[data-font="poppins"] { --font-sans: "Poppins", "Segoe UI", system-ui, sans-serif; }
:root[data-font="system"] { --font-sans: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif; }

/* The Dashboard's ticker tape, terminal style: a black strip, mono capitals, arrows instead of
   coloured pills, thin dividers. */
#dashboard .ttape { background: var(--swarm-bg); border-color: var(--border-strong); border-radius: 6px; }
#dashboard .ttape__run { gap: var(--sp-5); padding: 9px var(--sp-4); }
#dashboard .tchip { gap: 7px; font-family: var(--font-mono); font-size: var(--fs-sm); }
#dashboard .tchip b { text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
#dashboard .tchip__dot, #dashboard .tchip__logo { width: 16px; height: 16px; border-radius: 3px; }
#dashboard .tchip .tchip__px { color: var(--text); }
#dashboard .tchip__pct { padding: 0; background: none; font-size: var(--fs-xs); }
#dashboard .tchip__pct.pos { background: none; color: var(--pos); }
#dashboard .tchip__pct.neg { background: none; color: var(--neg); }
#dashboard .tchip__open { color: var(--accent); letter-spacing: 0.1em; }
#dashboard .tchip + .tchip::before { height: 12px; background: var(--border-strong); }
#dashboard .ttape__empty { font-family: var(--font-mono); border-radius: 6px; }

/* Desk → Positions: a smart card per position (app.js). */
#positions { display: grid; gap: 8px; }
.pcard { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--border-strong); border-left: 3px solid var(--pos); border-radius: var(--radius-sm); background: var(--mb-bg, var(--surface)); }
.pcard.is-down { border-left-color: var(--neg); }
.pcard__head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pcard__sym { font-family: var(--font-mono); font-size: var(--fs-md); letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard__head .pill { font-size: 9px; padding: 1px 6px; letter-spacing: .1em; }
.pill--long { background: var(--pos-soft); color: var(--pos); }
.pcard__head .gecko { margin-left: 0; }
.pcard__sp { flex: 1; }
.pcard__close { flex: none; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: .08em; text-transform: uppercase; }
.pcard__close { gap: 5px; line-height: 1; }
.pcard__x { display: inline-flex; width: 14px; height: 14px; align-items: center; justify-content: center; }
.pcard__x .icon { display: block; width: 14px; height: 14px; stroke-width: 2.4; }
.pcard__close:hover { border-color: var(--neg); color: var(--neg); }
.pcard__res { display: flex; align-items: baseline; gap: 8px; }
.pcard__pl { font-size: var(--fs-xl); font-weight: 700; line-height: 1.1; }
.pcard__res span { font-size: var(--fs-sm); }
.pcard__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.pcard__kv { display: grid; gap: 1px; min-width: 0; }
.pcard__kv span { font-family: var(--font-mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.pcard__kv b { font-size: var(--fs-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard__bar { display: grid; gap: 4px; }
.pcard__track { position: relative; height: 6px; border-radius: 3px; background: linear-gradient(90deg, color-mix(in srgb, var(--neg) 30%, transparent), color-mix(in srgb, var(--text) 8%, transparent) 50%, color-mix(in srgb, var(--pos) 30%, transparent)); }
.pcard__fill { position: absolute; top: 0; bottom: 0; border-radius: 3px; opacity: .9; }
.pcard__fill.pos { background: var(--pos); }
.pcard__fill.neg { background: var(--neg); }
.pcard__entry { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text-3); }
.pcard__mark { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 2px var(--bg); }
.pcard__ends { display: flex; justify-content: space-between; font-size: 10px; }

/* Space radio (cosmic.js): the app's own seg, buttons, slider and switches; only layout here. */
.cplayer { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--mb-bg, var(--surface)); }
.cplayer__top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cplayer__now { display: grid; min-width: 0; flex: 1; }
.cplayer__now b { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: .12em; text-transform: uppercase; }
.cplayer__now span { font-size: 10px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cviz { flex: none; width: 60px; height: 22px; color: #b48cff; }
.cseg { display: flex; width: 100%; }
.cseg .seg__btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; } /* the lock icon sits beside the name */
.cplayer__row { display: flex; align-items: center; gap: 8px; }

/* The Radio bot: ten little dances, ~5 s each while the music plays (transform only: cheap). */
.rbot { flex: none; width: 30px; height: 30px; display: grid; place-items: center; transform-origin: 50% 90%; cursor: pointer; }
.rbot--emoji { font-size: 22px; line-height: 1; }
.rbot[data-dance="rest"] { opacity: .75; }
.rbot[data-dance="bob"] { animation: rb-bob .9s ease-in-out infinite; }
.rbot[data-dance="sway"] { animation: rb-sway 1.4s ease-in-out infinite; }
.rbot[data-dance="nod"] { animation: rb-nod .6s ease-in-out infinite; }
.rbot[data-dance="hop"] { animation: rb-hop .7s cubic-bezier(.3, 0, .5, 1) infinite; }
.rbot[data-dance="wobble"] { animation: rb-wobble 1s ease-in-out infinite; }
.rbot[data-dance="spin"] { animation: rb-spin 2.5s linear infinite; transform-origin: 50% 50%; }
.rbot[data-dance="float"] { animation: rb-float 2.5s ease-in-out infinite; }
.rbot[data-dance="wave"] { animation: rb-wave 1.6s ease-in-out infinite; }
.rbot[data-dance="bounce"] { animation: rb-bounce .5s ease-in-out infinite alternate; }
.rbot[data-dance="pulse"] { animation: rb-pulse 1.2s ease-in-out infinite; transform-origin: 50% 50%; }
@keyframes rb-bob { 50% { transform: translateY(-3px); } }
@keyframes rb-sway { 25% { transform: rotate(-9deg); } 75% { transform: rotate(9deg); } }
@keyframes rb-nod { 50% { transform: rotate(6deg) translateY(1px); } }
@keyframes rb-hop { 0%, 100% { transform: translateY(0) scaleY(1); } 15% { transform: scaleY(.85); } 50% { transform: translateY(-7px) scaleY(1.05); } }
@keyframes rb-wobble { 20% { transform: skewX(-8deg); } 40% { transform: skewX(6deg); } 60% { transform: skewX(-4deg); } 80% { transform: skewX(2deg); } }
@keyframes rb-spin { to { transform: rotate(360deg); } }
@keyframes rb-float { 0%, 100% { transform: translate(0, 0); } 33% { transform: translate(2px, -4px); } 66% { transform: translate(-2px, -2px); } }
@keyframes rb-wave { 25% { transform: translateX(-3px) rotate(-5deg); } 75% { transform: translateX(3px) rotate(5deg); } }
@keyframes rb-bounce { from { transform: translateY(0) scale(1.04, .94); } to { transform: translateY(-5px) scale(.97, 1.03); } }
@keyframes rb-pulse { 50% { transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .rbot { animation: none !important; } }

/* House rules edited in place (app.js editRule): a dotted underline says "click to change". */
#rules dd.is-editable { cursor: pointer; text-decoration: underline dotted color-mix(in srgb, var(--text-3) 60%, transparent); text-underline-offset: 3px; }
#rules dd.is-editable:hover { color: var(--accent); }
#rules dd.is-editing { text-decoration: none; cursor: default; }
.rules-edit { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.rules-edit__num { width: 64px; height: 22px; padding: 0 6px; font-size: var(--fs-xs); text-align: right; }
.rules-edit__unit, .rules-edit__lab { font-size: 10px; color: var(--text-3); white-space: nowrap; }
.rules-live__d svg { width: 15px; height: 15px; display: block; }

/* Space radio controls (cosmic.js) in the app's own look: the accent colour, its borders and
   surfaces, like the primary buttons and the switches elsewhere. */
.cplayer__row { gap: 12px; padding: 2px 2px 0; }
.corb { position: relative; flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; display: grid; place-items: center; -webkit-tap-highlight-color: transparent; }
.corb__ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, var(--accent), transparent 55%, var(--accent)); will-change: transform; transform: translateZ(0); opacity: .55; }
.corb__ring::after { content: ''; position: absolute; inset: 2px; border-radius: 50%; background: var(--mb-bg, var(--surface)); }
.corb__core { position: relative; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--accent); transition: transform 150ms ease, background 150ms ease; }
.corb__core svg { margin-left: 1px; }
.corb[aria-pressed="true"] .corb__core { background: var(--surface-3); color: var(--text); }
.corb[aria-pressed="true"] .corb__core svg { margin-left: 0; }
.corb:hover .corb__core { transform: scale(1.06); }
.corb:active .corb__core { transform: scale(.94); }
.corb:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.cplayer.is-on .corb__ring { animation: corb-turn 6s linear infinite; opacity: 1; }
@keyframes corb-turn { to { transform: rotate(360deg); } }

.cvb { position: relative; flex: 1; min-width: 0; height: 24px; cursor: pointer; touch-action: none; outline: none; }
.cvb__track { position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 999px; background: var(--border-strong); overflow: hidden; }
.cvb__fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--accent); }
.cvb__knob { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px var(--border-strong), 0 1px 3px rgba(0, 0, 0, .4); transition: transform 140ms ease; }
.cvb:hover .cvb__knob, .cvb.is-drag .cvb__knob { transform: scale(1.15); }
.cvb:focus-visible .cvb__knob { box-shadow: 0 0 0 2px var(--accent); }
.cvb.is-mute .cvb__knob { background: var(--surface-3); }
.cvb__tip { position: absolute; bottom: 100%; margin-bottom: 2px; transform: translateX(-50%); padding: 1px 6px; border-radius: var(--radius-xs, 4px); font-size: 10px; color: var(--text); background: var(--surface-3); border: 1px solid var(--border-strong); opacity: 0; pointer-events: none; transition: opacity 120ms ease; white-space: nowrap; }
.cvb:hover .cvb__tip, .cvb.is-drag .cvb__tip, .cvb:focus-visible .cvb__tip { opacity: 1; }
.cseg .seg__btn.is-locked { opacity: .55; }
.cviz { color: var(--accent) !important; }
@media (prefers-reduced-motion: reduce) { .cplayer.is-on .corb__ring { animation: none; } }

/* Title bar: the token chip's bolt and the desk icons sit on the same centre line as their text. */
.tb-tokens > span:first-child { display: inline-flex; align-items: center; }
.tb-tokens svg { display: block; }
.tb-tokens b { line-height: 1; }
.seg__btn--emoji { display: inline-flex !important; align-items: center; justify-content: center; }
.seg--asset .seg__btn--emoji { height: 22px; }
.seg__emo { align-items: center; justify-content: center; line-height: 0; }
.seg__emo svg { width: 16px; height: 16px; }

/* The roster: each bot opens its popup. */
#roster .bot { cursor: pointer; border-radius: var(--radius-sm); transition: background 120ms ease; }
#roster .bot:hover { background: var(--hover); }
#roster .bot:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* The bot popup (botpop.js): the app's modal look, the bot's colour as the accent. */
.bpop { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 24px 16px; background: rgba(0, 0, 0, .55); backdrop-filter: blur(4px); }
.bpop__card { width: min(560px, 100%); max-height: calc(100vh - 48px); overflow: auto; display: grid; gap: 8px; padding: 18px 20px 20px; border: 1px solid var(--border-strong); border-top: 3px solid var(--bot-c); border-radius: var(--radius-sm); background: var(--mb-bg, var(--surface)); box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
.bpop__head { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; margin-bottom: 4px; }
.bpop__av { width: 52px; height: 52px; display: grid; place-items: center; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--bot-c) 14%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--bot-c) 40%, transparent); }
.bpop__name { font-family: var(--font-mono); font-size: var(--fs-lg); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--bot-c); }
.bpop__role { font-size: var(--fs-sm); color: var(--text-2); }
.bpop__now { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: var(--fs-xs); color: var(--text-3); }
.bpop__now i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.bpop__now.is-active i { background: var(--pos); }
.bpop__now.is-error i { background: var(--neg); }
.bpop__x { align-self: start; }
.bpop__sec { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-family: var(--font-mono); font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text); }
.bpop__sec::before { content: ''; width: 8px; height: 8px; background: var(--bot-c); }
.bpop__memhead { display: flex; align-items: baseline; gap: 6px; }
.bpop__memhead b { font-size: var(--fs-lg); }
.bpop__pct { margin-left: auto; color: var(--text-3); font-size: var(--fs-xs); }
.bpop__bar { height: 8px; border-radius: 999px; background: var(--border-strong); overflow: hidden; }
.bpop__bar i { display: block; height: 100%; border-radius: 999px; background: var(--bot-c); }
.bpop__acts { margin-top: 4px; }
.bpop__flush:hover { color: var(--neg); }
.bpop__codebox { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--neg) 40%, transparent); border-radius: var(--radius-sm); }
.bpop__coderow { display: flex; gap: 8px; }
.bpop__code { width: 120px; letter-spacing: .3em; text-align: center; }
.bpop__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.bpop__kv { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.bpop__kv span { color: var(--text-3); }
.bpop__lessons { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: var(--fs-sm); color: var(--text-2); }
.bpop__mems { display: grid; gap: 4px; }
.bpop__mem { display: grid; grid-template-columns: 52px 1fr auto; gap: 8px; align-items: baseline; padding: 6px 8px; border-left: 2px solid var(--pos); border-radius: 3px; background: color-mix(in srgb, var(--text) 3%, transparent); font-size: var(--fs-xs); }
.bpop__mem.is-wrong { border-left-color: var(--neg); }
.bpop__when, .bpop__mode { color: var(--text-3); font-size: 10px; }
@media (max-width: 560px) { .bpop__cols { grid-template-columns: 1fr; } }

/* The BTC hedge's position card (app.js, meeting.js manageHedge). */
.pill--hedge { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.pcard__note { font-size: var(--fs-xs); color: var(--text-3); margin-top: -2px; }

/* The bot popup's intro (botpop.js INTRO): who the bot is, in its colour's frame. */
.bpop__intro { margin: 2px 0 4px; padding: 10px 12px; border-left: 2px solid var(--bot-c); border-radius: 3px; background: color-mix(in srgb, var(--bot-c) 7%, transparent); font-size: var(--fs-sm); line-height: 1.55; color: var(--text-2); }

.trow--work .sub .pos { color: var(--pos); }
.trow--work .sub .neg { color: var(--neg); }
.trow__by { color: var(--text-3); }

/* Closing actions (Close, Close G-01, Cancel): the position card's button, in red. */
.pcard__close.is-danger { color: var(--neg); border-color: color-mix(in srgb, var(--neg) 40%, var(--border-strong)); }
.pcard__close.is-danger:hover { background: var(--neg-soft); border-color: var(--neg); color: var(--neg); }
.tv__acts .pcard__close, .tv__row > .pcard__close { justify-self: end; }
/* Open orders: cards like the positions; the left edge says what it is. */
.ocard { border-left-color: var(--accent); }
.ocard.is-stop { border-left-color: var(--neg); }
.ocard.is-target { border-left-color: var(--pos); }
.ocard__by { font-size: var(--fs-2xs); letter-spacing: .08em; color: var(--text-3); }
#orders { display: grid; gap: 8px; }
/* Bot popup: what you tuned it to do on this desk */
.bpop__tuned { margin: 6px 0 2px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 6px; background: color-mix(in srgb, var(--accent) 6%, transparent); }
.bpop__tunedhead { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); }
.bpop__tunedtext { margin: 8px 0 0; font-size: var(--fs-sm); line-height: 1.55; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }

/* The Desk (bot list on the left): 20% bigger than the base sizes. */
#roster .bot { grid-template-columns: 17px 22px 1fr auto; gap: 10px; padding: 9px 10px; }
#roster .bot .av-wrap { width: 22px; height: 22px; }
#roster .bot__name { font-size: calc(var(--fs-sm) * 1.2); }
#roster .bot__meta, #roster .bot__state, #roster .bot__idx { font-size: calc(var(--fs-2xs) * 1.2); }

/* Bot popup: +100 memories in the bot's own colour */
.bpop .bpop__extend { background: color-mix(in srgb, var(--bot-c) 82%, #000); color: #fff; border: 1px solid color-mix(in srgb, var(--bot-c) 60%, transparent); font-weight: 600; }
.bpop .bpop__extend:hover:not(:disabled) { background: var(--bot-c); color: #0b0b0d; }
.bpop .bpop__extend:disabled { opacity: 0.55; }

/* The Desk: "Tuned" right after the bot's name */
#roster .bot__name { display: flex; align-items: center; gap: 6px; }
#roster .bot__tuned { flex: none; padding: 1px 6px; border-radius: 999px; font-size: calc(var(--fs-2xs) * 1.1); font-weight: 600; line-height: 1.4; color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
