/* Bazaar supervisor — shared tokens and components (Pencil sv-* variables). Square corners everywhere; only status dots are round. */
:root {
  --bg: #08090B; --s1: #0E1013; --s2: #14171B; --s3: #1C2026;
  --line: #1F2329; --line-2: #2D323A;
  --ink: #ECEEF0; --ink-2: #A4ABB3; --ink-3: #6A727B;
  --ok: #45B883; --ok-soft: #45B8831A; --bad: #E2564D; --bad-soft: #E2564D1F; --warn: #E5BE4F; --warn-soft: #E5BE4F1A; --pause: #F08A3E; --pause-soft: #F08A3E1F;
  --live: #F0443A; --signal: #F4F1EA; --signal-soft: #F4F1EA14;
  --t-compra: #3FB97A; --t-venta: #E5534B; --t-cambio: #4C9BE0; --t-puja: #E3A33B; --t-duelo: #9B7FE6; --t-dealer: #35B5A8; --t-anuncio: #9AA4B1;
  --dom-mercado: var(--t-compra); --dom-duelos: var(--t-duelo); --dom-dealers: var(--t-dealer); --dom-broker: var(--t-cambio); --dom-lab: #8E99A6;
  --set-lav: #E4572E; --set-mal: #E83F8C; --set-lat: #F2A541; --set-sal: #2EC4B6; --set-ret: #7B8CDE; --set-cha: #9BC53D;
  --r-common: #9AA4B8; --r-uncommon: #3DDC97; --r-rare: #4C8DFF; --r-epic: #B061FF; --r-legendary: #FFC44D;
  --opus: #D9895B;
  --font-ui: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-num: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --topbar-h: 56px; --nav-w: 208px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body { font-family: var(--font-ui); font-size: 13px; line-height: 1.4; -webkit-font-smoothing: antialiased; overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
.num, code, kbd { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); } .small { font-size: 11px; }
.ic { display: block; flex: none; }
.ic-wrap { display: inline-flex; align-items: center; flex: none; }
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: var(--line-2); } ::-webkit-scrollbar-track { background: transparent; }

/* ---------- top bar */
.topbar { position: fixed; inset: 0 0 auto 0; height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 12px 0 20px;
  background: var(--s1); border-bottom: 1px solid var(--line); z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; width: calc(var(--nav-w) - 50px); flex: none; }
.brand-mark { width: 22px; height: 22px; display: grid; place-items: center; background: var(--signal); color: var(--bg); font-weight: 700; font-size: 11px; }
.brand-name { font-weight: 600; font-size: 15px; }
.tb-stats { display: flex; gap: 10px; min-width: 0; overflow: hidden; }
.tb-group { display: flex; gap: 18px; padding: 6px 12px; border: 1px solid var(--line-2); background: var(--s2); flex: none; }
.tb-label { font-family: var(--font-num); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.tb-value { font-size: 13.5px; white-space: nowrap; }
.tb-sub { font-size: 10.5px; color: var(--ink-3); }
.tb-clock { display: flex; margin-left: auto; border: 1px solid var(--line-2); background: var(--s2); flex: none; }
.tb-cell { display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 34px; border-left: 1px solid var(--line-2); white-space: nowrap; font-size: 13px; }
.tb-cell:first-child { border-left: 0; }
.tb-accent { color: #9DA8FF; }
.bell { position: relative; width: 38px; height: 38px; display: grid; place-items: center; background: var(--s2); border: 1px solid var(--line-2); cursor: pointer; flex: none; }
.bell:hover { border-color: var(--ink-3); }
.bell-count { position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; padding: 0 3px; background: var(--warn); color: #111; font-size: 10px; font-weight: 600; display: grid; place-items: center; }

/* ---------- layout + nav */
.layout { position: fixed; inset: var(--topbar-h) 0 0 0; display: flex; }
.sidenav { width: var(--nav-w); flex: none; display: flex; flex-direction: column; padding: 14px 12px 12px; border-right: 1px solid var(--line); background: var(--s1); overflow-y: auto; }
.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 7px 9px; border: 1px solid transparent; color: var(--ink-2); font-size: 13.5px; }
.nav-item:hover { background: var(--s2); border-color: var(--line-2); color: var(--ink); }
.nav-item.active { background: var(--s3); border-color: var(--line-2); color: var(--ink); }
.nav-badge { margin-left: auto; font-size: 10px; padding: 0 5px; background: var(--s3); color: var(--ink-2); border: 1px solid var(--line-2); }
.nav-list { margin-bottom: 16px; }
.status-box { border: 1px solid var(--line-2); background: var(--s1); margin-top: auto; font-size: 12px; }
/* last item of the menu, in the flow: with a short window it shows at the end of the scroll */
.lang-switch { display: flex; flex: none; border: 1px solid var(--line-2); background: var(--s1); margin-top: 8px; }
.lang-btn { flex: 1; height: 28px; background: none; border: 0; border-left: 1px solid var(--line-2); color: var(--ink-3); font-family: var(--font-num); font-size: 11px; letter-spacing: .08em; cursor: pointer; }
.lang-btn:first-child { border-left: 0; }
.lang-btn:hover { background: var(--s2); color: var(--ink); }
.lang-btn.on { background: var(--s3); color: var(--ink); }
.lang-btn:focus-visible { outline: 1px solid var(--ink-2); outline-offset: -1px; }
.sb-sec { padding: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.sb-sec:first-child { border-top: 0; }
.sb-head { font-family: var(--font-num); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.sb-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sb-sub { font-family: var(--font-num); font-size: 10.5px; color: var(--ink-3); margin-top: -4px; }
.sb-name { white-space: nowrap; flex: none; }
.segs { display: flex; gap: 2px; margin-left: auto; margin-right: 6px; }
.seg { width: 5px; height: 8px; background: var(--line-2); } .seg.on { background: var(--t-dealer); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 6px; font-family: var(--font-num); font-size: 10px; font-weight: 600; letter-spacing: .04em; border: 1px solid currentColor; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.tone-ok { color: var(--ok); background: var(--ok-soft); } .pill.tone-bad { color: var(--bad); background: var(--bad-soft); }
.pill.tone-warn { color: var(--warn); background: var(--warn-soft); } .pill.tone-pause { color: var(--pause); background: var(--pause-soft); border-color: var(--pause); } .pill.tone-mute { color: var(--ink-3); }

.main-wrap { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.screen { flex: 1; overflow: auto; padding: 18px 20px 28px; }
.placeholder { padding: 60px 20px; color: var(--ink-3); } .placeholder h1 { color: var(--ink); font-weight: 600; font-size: 22px; margin: 0 0 6px; }

/* ---------- banners / global states */
.banners:empty { display: none; }
.banners { padding: 14px 20px 0; display: flex; flex-direction: column; gap: 8px; }
.banner { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--line-2); border-left: 3px solid var(--ink-3); background: var(--s2); }
.banner > div { flex: 1; color: var(--ink-2); font-size: 12px; } .banner strong { color: var(--ink); font-size: 13px; display: block; }
.banner.tone-bad { border-left-color: var(--bad); background: linear-gradient(90deg, var(--bad-soft), var(--s2) 60%); } .banner.tone-bad > .ic-wrap { color: var(--bad); }
.banner.tone-warn { border-left-color: var(--warn); }
.closed-overlay { position: absolute; inset: 0; background: rgba(8, 9, 11, .72); display: grid; place-items: center; z-index: 20; }
.closed-card { width: min(600px, 90%); background: var(--s1); border: 1px solid var(--bad); padding: 26px 28px; }
.closed-card h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 19px; font-weight: 600; } .closed-card h2 .ic-wrap { color: var(--bad); }
.closed-sub { color: var(--ink-2); font-size: 13px; }
.closed-count { font-size: 44px; font-weight: 500; margin: 14px 0; letter-spacing: -.01em; }
.closed-card p { color: var(--ink-2); margin: 0 0 12px; }
.closed-foot { color: var(--ok); font-size: 12px; margin-bottom: 16px; }

/* ---------- buttons, switches */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--s2); border: 1px solid var(--line-2); color: var(--ink); cursor: pointer; font-size: 12.5px; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); } .btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--signal); color: var(--bg); border-color: var(--signal); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #06140d; }
.icon-btn { background: none; border: 0; padding: 2px; color: var(--ink-3); cursor: pointer; display: inline-grid; place-items: center; } .icon-btn:hover { color: var(--ink); }
.link-btn { background: none; border: 0; color: var(--ink-2); cursor: pointer; font-size: 12px; padding: 0; } .link-btn:hover { color: var(--ink); }
.switch { width: 28px; height: 14px; padding: 0; border: 1px solid var(--line-2); background: var(--s3); position: relative; cursor: pointer; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 8px; height: 8px; background: var(--ink-3); transition: left .12s; }
.switch.on { background: var(--ok-soft); border-color: var(--ok); } .switch.on::after { left: 16px; background: var(--ok); }

/* ---------- chips & tags */
.chip, .tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 7px; font-size: 12px; white-space: nowrap; line-height: 18px; }
.chip.type { border-left: 2px solid var(--tc); background: color-mix(in srgb, var(--tc) 13%, transparent); color: var(--ink); font-weight: 500; }
.chip.type .ic-wrap { color: var(--tc); }
.chip-count { color: var(--tc, var(--ink-3)); font-size: 11px; }
.t-compra { --tc: var(--t-compra); } .t-venta { --tc: var(--t-venta); } .t-cambio { --tc: var(--t-cambio); } .t-puja { --tc: var(--t-puja); }
.t-duelo { --tc: var(--t-duelo); } .t-dealer { --tc: var(--t-dealer); } .t-anuncio { --tc: var(--t-anuncio); } .t-none { --tc: var(--line-2); }
.tag.team { background: var(--s3); color: var(--ink-2); padding: 2px 7px 2px 2px; gap: 6px; }
.team-sq { width: 18px; height: 18px; display: grid; place-items: center; background: var(--line-2); color: var(--ink-2); font-size: 9px; }
.tag.team.us { background: var(--signal); color: var(--bg); font-weight: 600; } .tag.team.us .team-sq { background: var(--bg); color: var(--signal); }
.tag.src { border: 1px solid var(--sc); color: var(--sc); background: color-mix(in srgb, var(--sc) 10%, transparent); font-size: 11px; padding: 0 6px; }
.src-opus { --sc: var(--opus); } .src-consejo { --sc: var(--t-cambio); } .src-reserva { --sc: var(--warn); } .src-codigo { --sc: var(--ink-3); }
.src-extra { opacity: .85; }
.tag.res { font-size: 11px; padding: 0 6px; border: 1px solid currentColor; }
.tone-ok.res { color: var(--ok); background: var(--ok-soft); } .tone-bad.res { color: var(--bad); background: var(--bad-soft); }
.tone-warn.res { color: var(--warn); background: var(--warn-soft); } .tone-mute.res { color: var(--ink-3); }

/* ---------- list rows (Home style) */
.ui-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, auto); align-items: center; gap: 14px; padding: 0 16px; min-height: 48px;
  border-bottom: 1px solid var(--line); border-left: 3px solid var(--tc); background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 5%, transparent), transparent 40%); }
.ui-row .cell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-row .cell.wrap { white-space: normal; }
.ui-row .al-right { text-align: right; justify-self: end; } .ui-row .al-center { text-align: center; }
.ui-row.clickable { cursor: pointer; } .ui-row.clickable:hover { background: var(--s2); } .ui-row:focus-visible { outline: 1px solid var(--ink-3); outline-offset: -1px; }
.ui-row.us { background: linear-gradient(90deg, var(--signal-soft), transparent 50%); }

/* ---------- filter bar */
.filterbar { display: flex; flex-direction: column; gap: 6px; }
.fb-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.fb-type { background: none; border: 0; padding: 0; cursor: pointer; }
.fb-type.off .chip.type { background: transparent; color: var(--ink-3); border-left-color: var(--line-2); } .fb-type.off .ic-wrap, .fb-type.off .chip-count { color: var(--ink-3); }
.fb-seg { display: flex; border: 1px solid var(--line-2); margin-left: 6px; }
.fb-seg-btn, .fb-select { background: none; border: 0; border-left: 1px solid var(--line-2); padding: 2px 8px; font-size: 11.5px; color: var(--ink-3); cursor: pointer; height: 24px; }
.fb-seg-btn:first-child { border-left: 0; } .fb-seg-btn.on, .fb-select.on { background: var(--s3); color: var(--ink); }
.fb-select { background: var(--bg); }
.fb-search-wrap { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); padding: 0 8px; height: 26px; color: var(--ink-3); margin-left: 4px; }
.fb-search { background: none; border: 0; outline: 0; width: 120px; font-size: 12px; color: var(--ink); }
.fb-extra-label { font-family: var(--font-num); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-right: 6px; }
.fb-opt { display: inline-flex; align-items: center; gap: 6px; background: none; border: 1px solid var(--line-2); padding: 2px 8px; font-size: 12px; color: var(--ink-3); cursor: pointer; }
.fb-opt.on { color: var(--ink); background: var(--s3); border-color: var(--ink-3); }

/* ---------- price bar */
.pricebar { --pb-tint: var(--ink-2); position: relative; padding: 0 2px; min-width: 160px; }
.pb-labels { position: relative; height: 16px; font-size: 10.5px; }
.pb-lab { position: absolute; transform: translateX(-50%); white-space: nowrap; color: var(--ink-2); }
.pb-lab .num { color: var(--ink); } .pb-lab.ours { color: var(--pb-tint); } .pb-lab.lim { color: var(--bad); } .pb-lab.deal { color: var(--ok); }
.pb-track { position: relative; height: 16px; }
.pb-line { position: absolute; left: 0; right: 0; top: 7px; height: 2px; background: var(--line-2); }
.pb-zone { position: absolute; top: 3px; height: 10px; background: color-mix(in srgb, var(--ok) 22%, transparent); border-left: 1px solid var(--ok); border-right: 1px solid var(--ok); }
.pb-limit { position: absolute; top: 0; width: 3px; height: 16px; margin-left: -1px; background: var(--bad); }
.pb-dot { position: absolute; top: 3px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; }
.pb-dot.ours { background: var(--pb-tint, var(--ink)); box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--ink); z-index: 2; } .pb-dot.theirs { border: 2px solid var(--ink); background: var(--bg); }
.pb-hist { position: absolute; top: 6px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; opacity: .45; }
.pb-hist.ours { background: var(--pb-tint); } .pb-hist.theirs { background: var(--ink-3); }
.pb-deal { position: absolute; top: -1px; width: 2px; height: 18px; margin-left: -1px; background: var(--ok); }
.pricebar.nodeal { opacity: .55; } .pb-nodeal { position: absolute; right: 0; top: 0; font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.pricebar.compact .pb-labels { height: 13px; font-size: 9.5px; } .pricebar.compact .pb-track { height: 12px; }
.pricebar.compact .pb-line { top: 5px; } .pricebar.compact .pb-dot { top: 1px; } .pricebar.compact .pb-limit { height: 12px; } .pricebar.compact .pb-zone { top: 1px; }

/* ---------- KPI, meter, charts */
.kpi { padding: 12px 16px; border: 1px solid var(--line-2); background: var(--s1); min-width: 0; }
.kpi-label { font-family: var(--font-num); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.kpi-value { font-size: 22px; margin-top: 4px; white-space: nowrap; }
.kpi-sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.kpi.tone-ok .kpi-value { color: var(--ok); } .kpi.tone-bad .kpi-value { color: var(--bad); } .kpi.tone-warn .kpi-value { color: var(--warn); }
.meter { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); }
.meter-bar { height: 3px; background: var(--line-2); position: relative; }
.meter-fill { position: absolute; inset: 0 auto 0 0; background: var(--ink-2); }
.meter.tone-warn .meter-fill { background: var(--warn); } .meter.tone-bad .meter-fill { background: var(--bad); }
.meter-val { font-size: 11px; color: var(--ink); min-width: 34px; text-align: right; }
.spark, .bars { display: block; overflow: visible; }

/* ---------- panel */
.panel { border: 1px solid var(--line-2); background: var(--s1); min-width: 0; display: flex; flex-direction: column; }
.panel-head { display: flex; align-items: baseline; gap: 12px; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.panel-title { margin: 0; font-size: 15px; font-weight: 600; }
.panel-sub { font-family: var(--font-num); font-size: 11px; color: var(--ink-3); }
.panel-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.panel-body { min-width: 0; }

/* ---------- drawer, modal */
.drawer-wrap { position: fixed; inset: 0; z-index: 50; }
.drawer-shade { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 92vw); background: var(--s1); border-left: 1px solid var(--line-2); display: flex; flex-direction: column; animation: slidein .16s ease-out; }
.drawer.wide { width: min(860px, 96vw); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.drawer-body { flex: 1; overflow: auto; padding: 16px 18px; }
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .6); display: grid; place-items: center; }
.modal { width: min(480px, 92vw); background: var(--s1); border: 1px solid var(--line-2); padding: 20px 22px; }
.modal.danger { border-color: var(--bad); }
.modal-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 16px; font-weight: 600; } .modal.danger .modal-title .ic-wrap { color: var(--bad); }
.modal-text { color: var(--ink-2); margin: 0 0 16px; white-space: pre-line; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ---------- states */
.state { display: flex; align-items: center; gap: 8px; padding: 18px 16px; color: var(--ink-3); font-size: 12.5px; }
.state.error { color: var(--bad); }
.spinner { width: 10px; height: 10px; flex: none; border: 2px solid var(--line-2); border-top-color: var(--ink-2); border-radius: 0; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- toasts */
.toasts { position: fixed; top: calc(var(--topbar-h) + 4px); right: 0; z-index: 40; width: 340px; display: flex; flex-direction: column; gap: 4px; }
.toast { background: var(--s1); border: 1px solid var(--tone); border-left-width: 3px; padding: 10px 12px; cursor: pointer; animation: slidein .16s ease-out; transition: opacity .2s; --tone: var(--line-2); }
.toast.out { opacity: 0; }
.toast-head { display: flex; align-items: center; gap: 8px; } .toast-head .ic-wrap { color: var(--tone); } .toast-head strong { flex: 1; font-weight: 600; }
.toast-time { color: var(--ink-3); font-size: 11px; }
.toast-text { color: var(--ink-2); margin-top: 4px; font-size: 12.5px; }
.toast-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 12px; color: var(--ink); }
.tone-ok { --tone: var(--ok); } .tone-bad { --tone: var(--bad); } .tone-warn { --tone: var(--warn); } .tone-teal { --tone: var(--t-dealer); }
.tone-blue { --tone: var(--t-cambio); } .tone-violet { --tone: var(--t-duelo); } .tone-mute { --tone: var(--ink-3); }

/* ---------- bell panel */
.bell-panel { position: fixed; top: var(--topbar-h); right: 0; width: 380px; max-height: calc(100vh - var(--topbar-h)); overflow: auto; z-index: 45; background: var(--s1); border: 1px solid var(--line-2); border-top: 0; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.bell-sec { padding: 10px 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.bell-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bell-list { display: flex; flex-direction: column; }
.bell-item { display: block; padding: 10px 16px; border-bottom: 1px solid var(--line); border-left: 2px solid transparent; }
.bell-item:hover { background: var(--s2); }
.bell-item.unread { border-left-color: var(--tone, var(--ink-3)); }
.bell-item-head { display: flex; align-items: center; gap: 8px; } .bell-item-head strong { flex: 1; font-weight: 600; } .bell-item-head .ic-wrap { color: var(--tone, var(--ink-3)); }
.bell-item-text { color: var(--ink-2); font-size: 12px; margin: 2px 0 0 22px; }
.bell-item.tone-aprobar { --tone: var(--warn); } .bell-item.tone-breaker { --tone: var(--bad); } .bell-item.tone-gran { --tone: var(--ok); }
.bell-item.tone-novedad { --tone: var(--t-dealer); } .bell-item.tone-duelo { --tone: var(--t-duelo); } .bell-item.tone-broker { --tone: var(--t-cambio); }
.bell-foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; color: var(--ink-3); font-size: 12px; }

/* ---------- small screens */
@media (max-width: 1100px) { .tb-stats .tb-group:nth-child(n+4) { display: none; } }
@media (max-width: 820px) {
  :root { --nav-w: 64px; }
  .brand-name, .nav-item span:not(.ic-wrap), .status-box { display: none; }
  .lang-switch { flex-direction: column; margin-top: auto; }
  .lang-btn { flex: none; border-left: 0; border-top: 1px solid var(--line-2); letter-spacing: 0; }
  .lang-btn:first-child { border-top: 0; }
  .tb-stats { display: none; }
  .screen { padding: 12px; }
}

/* Native form controls: square like everything else (browsers round selects and inputs by default). */
select, input, textarea, button { border-radius: 0 !important; }
select {
  -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3, #777) 50%), linear-gradient(135deg, var(--ink-3, #777) 50%, transparent 50%);
  background-position: calc(100% - 13px) 50%, calc(100% - 8px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  padding-right: 26px !important;
}

/* Game paused by the organisers: orange, never red (red means closed or off). */
.closed-card.is-paused { border-color: var(--pause); }
.closed-card.is-paused h2 .ic-wrap { color: var(--pause); }
.closed-card.is-paused .closed-sub { color: var(--pause); }
.refresh { margin-right: 6px; color: var(--ink-2); }
.refresh:hover { color: var(--ink); }
.refresh.spin svg { animation: refresh-spin .7s linear infinite; }
@keyframes refresh-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .refresh.spin svg { animation: none; } }
/* the Madrid clock sits centred in the free space between the stats and the tick group */
.tb-wall { margin: 0 auto; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; flex: none;
  border: 1px solid var(--line-2); background: var(--s2); white-space: nowrap; }
.tb-wall .num { font-size: 15px; font-weight: 600; color: var(--ink); }
.topbar .tb-stats { flex: 0 1 auto; }
.topbar .tb-clock { margin-left: 0; }
.refresh.ok-flash { border-color: var(--ok); color: var(--ok); transition: border-color .2s, color .2s; }
.nav-badge.is-alert { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
a.sb-keys { text-decoration: none; color: inherit; }
a.sb-keys:hover { background: var(--s2); }
.banner.tone-warn { background: linear-gradient(90deg, var(--warn-soft), var(--s2) 60%); } .banner.tone-warn > .ic-wrap { color: var(--warn); }

/* venue volume ranking (Competición, Broker) */
.vrank { display: flex; flex-direction: column; }
.vrank-head { display: flex; align-items: baseline; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.vrank-us { font-size: 14px; } .vrank-sub { font-size: 11.5px; color: var(--ink-3); }
.vrank-row { display: grid; grid-template-columns: 28px 190px minmax(80px, 1fr) 70px 96px 170px; align-items: center; gap: 10px; padding: 5px 16px; font-size: 12.5px; border-left: 3px solid transparent; }
.vrank.compact .vrank-row { grid-template-columns: 24px 170px minmax(60px, 1fr) 64px 92px; }
.vrank-row.clickable { cursor: pointer; } .vrank-row.clickable:hover { background: var(--s2); }
.vrank-row.is-us { border-left-color: var(--signal); background: var(--signal-soft); }
.vrank-row.is-ally { border-left-color: var(--t-cambio); }
.vrank-n { color: var(--ink-3); text-align: right; }
.vrank-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vrank-tag { font-size: 10px; padding: 0 5px; margin-left: 6px; line-height: 15px; }
.vrank-tag.us { background: var(--signal); color: var(--bg); font-weight: 600; }
.vrank-tag.ally { border: 1px solid var(--t-cambio); color: var(--t-cambio); }
.vrank-bar { position: relative; height: 12px; background: var(--s2); border: 1px solid var(--line); }
.vrank-fill { position: absolute; inset: 0 auto 0 0; background: var(--t-cambio); opacity: .75; }
.vrank-row.is-us .vrank-fill { background: var(--signal); opacity: 1; }
.vrank-hour { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(135deg, rgba(255,255,255,.55) 0 3px, transparent 3px 6px); }
.vrank-val { text-align: right; font-weight: 600; } .vrank-h, .vrank-meta { text-align: right; color: var(--ink-3); font-size: 11.5px; white-space: nowrap; }

.negparts { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.negparts-l { font-family: var(--font-num); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.negparts-i b { color: var(--ink); } .negparts-m { color: var(--ink-3); }
