/* ==========================================================================
   GoldB2B — "Bullion desk" design system
   Paper & ink, brass hairlines, monospaced figures. No shadows, no gradients.
   RTL/LTR via logical properties. Simple mode = larger type & targets.
   ========================================================================== */
@font-face { font-family: Vazirmatn; src: url(../fonts/Vazirmatn-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(../fonts/Vazirmatn-Medium.woff2) format("woff2"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(../fonts/Vazirmatn-Bold.woff2) format("woff2"); font-weight: 700 800; font-display: swap; }
@font-face { font-family: Plex; src: url(../fonts/IBMPlexMono-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0020-007F, U+00A0-00FF, U+2212, U+25B2, U+25BC, U+2013, U+2014; }
@font-face { font-family: Plex; src: url(../fonts/IBMPlexMono-Medium.woff2) format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0020-007F, U+00A0-00FF, U+2212, U+25B2, U+25BC, U+2013, U+2014; }
@font-face { font-family: Plex; src: url(../fonts/IBMPlexMono-SemiBold.woff2) format("woff2"); font-weight: 600 700; font-display: swap; unicode-range: U+0020-007F, U+00A0-00FF, U+2212, U+25B2, U+25BC, U+2013, U+2014; }

:root {
  --paper: #f3efe6;
  --surface: #fbf9f4;
  --sunk: #ebe6da;
  --ink: #15130e;
  --ink-2: #4f4a40;
  --ink-3: #6b6557;
  --line: #d9d2c2;
  --line-soft: #e6e0d3;
  --brass: #7d6124;   /* 4.5:1+ on paper */
  --brass-2: #c9a55a;
  --brass-soft: #efe3c6;
  --buy: #1d6a4d;
  --buy-soft: #dcebe2;
  --sell: #9a2e21;
  --sell-soft: #f3dfda;
  --warn: #8a5a00;
  --warn-soft: #f6e8c7;
  --info-soft: #e4e7ea;
  --band: #15130e;       /* header band */
  --band-ink: #efe9dc;
  --radius: 6px;
  --radius-sm: 4px;
  --fs: 15px;
  --tap: 44px;
  --num: Plex, Vazirmatn, ui-monospace, Menlo, monospace;
  --text: Vazirmatn, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #100f0b; --surface: #17150f; --sunk: #1e1b14; --ink: #efe9dc; --ink-2: #bdb5a4; --ink-3: #9a9282;
    --line: #2e2a21; --line-soft: #26231b; --brass: #d0ad62; --brass-2: #e2c27b; --brass-soft: #2f2616;
    --buy: #4fbf8b; --buy-soft: #16271f; --sell: #ee7c6c; --sell-soft: #2c1915; --warn: #e8b64e; --warn-soft: #2d2412;
    --info-soft: #1c1f23; --band: #0a0907; --band-ink: #efe9dc; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #100f0b; --surface: #17150f; --sunk: #1e1b14; --ink: #efe9dc; --ink-2: #bdb5a4; --ink-3: #9a9282;
  --line: #2e2a21; --line-soft: #26231b; --brass: #d0ad62; --brass-2: #e2c27b; --brass-soft: #2f2616;
  --buy: #4fbf8b; --buy-soft: #16271f; --sell: #ee7c6c; --sell-soft: #2c1915; --warn: #e8b64e; --warn-soft: #2d2412;
  --info-soft: #1c1f23; --band: #0a0907; --band-ink: #efe9dc; color-scheme: dark;
}
body.simple { --fs: 18px; --tap: 54px; }
body.pro { --fs: 14px; --tap: 38px; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--fs)/1.7 var(--text); text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration-color: var(--brass-2); text-underline-offset: 3px; }
a:hover { color: var(--brass); }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .6em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.55em; } h2 { font-size: 1.12em; } h3 { font-size: 1em; }
p { margin: 0 0 1em; }
small, .muted { color: var(--ink-3); }
.num, .mono, .lock-timer { font-family: var(--num); font-variant-numeric: tabular-nums; }
.mono { direction: ltr; unicode-bidi: embed; font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
::selection { background: var(--brass-soft); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* ---------- Header band + ticker ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--band); color: var(--band-ink); }
.topbar .in { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 0 16px; height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .02em; color: inherit; text-decoration: none; }
.brand:hover { color: inherit; }
.brand .mark { width: 26px; height: 26px; }
.brand .dot { display: none; }
.nav { display: flex; gap: 2px; margin-inline-start: 18px; height: 100%; }
.nav a { display: flex; align-items: center; padding: 0 12px; color: color-mix(in srgb, var(--band-ink) 70%, transparent); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--band-ink); }
.nav a.on { color: var(--band-ink); border-bottom-color: var(--brass-2); }
.topbar .btn.ghost { color: var(--band-ink); }
.topbar .btn.ghost:hover { background: color-mix(in srgb, var(--band-ink) 10%, transparent); }
.spacer { flex: 1; }

.ticker { background: var(--surface); border-bottom: 1px solid var(--line); overflow: hidden; white-space: nowrap; font-size: .86em; }
.ticker .track { display: inline-flex; gap: 34px; padding: 7px 16px; animation: tick 60s linear infinite; }
.ticker:hover .track { animation-play-state: paused; }
.ticker .it { display: inline-flex; gap: 8px; align-items: baseline; }
.ticker .it b { font-family: var(--num); font-weight: 600; }
.ticker .lbl { color: var(--ink-2); }
[dir="rtl"] .ticker .track { animation-name: tick-rtl; }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes tick-rtl { from { transform: translateX(0); } to { transform: translateX(50%); } }
@media (prefers-reduced-motion: reduce) { .ticker .track { animation: none; } }

/* ---------- Layout ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 22px 16px 48px; }
.narrow { max-width: 580px; margin-inline: auto; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.page-head h1 { margin: 0; }
.eyebrow { display: block; font-size: .72em; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--brass); margin-bottom: 4px; }
@media (max-width: 900px) {
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  .nav { display: none; }
  .g4.keep { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wrap { padding-bottom: 110px; }
}

/* ---------- Bottom tab bar (phones) ---------- */
.tabbar { position: fixed; inset-inline: 0; bottom: 0; z-index: 30; display: none; background: var(--band); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: color-mix(in srgb, var(--band-ink) 62%, transparent); font-size: .74em; padding: 6px 0; text-decoration: none; border-top: 2px solid transparent; }
.tabbar a.on { color: var(--band-ink); border-top-color: var(--brass-2); }
.tabbar svg { width: 22px; height: 22px; }
@media (max-width: 900px) { .tabbar { display: flex; } }

/* ---------- Panels ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card.flat { background: transparent; }
.card.accent { border-top: 2px solid var(--brass); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: -2px 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.card-head h2, .card-head h3 { margin: 0; font-size: 1em; }
.card-head a { font-size: .88em; color: var(--brass); text-decoration: none; }
.section-title { font-size: .76em; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 18px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s, color .12s; }
.btn:hover { border-color: var(--ink-2); color: var(--ink); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--ink-2); border-color: var(--ink-2); color: var(--paper); }
.btn.buy { background: var(--buy); border-color: var(--buy); color: #fff; }
.btn.sell { background: var(--sell); border-color: var(--sell); color: #fff; }
.btn.buy:hover, .btn.sell:hover { filter: brightness(1.08); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.danger { color: var(--sell); border-color: color-mix(in srgb, var(--sell) 35%, var(--line)); background: transparent; }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: .88em; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Primary actions as ledger tiles */
.big-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.big-actions .btn { min-height: 92px; border: 0; border-radius: 0; background: transparent; color: var(--ink); flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; padding: 14px 20px; font-size: 1.08em; border-inline-end: 1px solid var(--line); position: relative; }
.big-actions .btn:last-child { border-inline-end: 0; }
.big-actions .btn::before { content: ""; position: absolute; inset-block: 14px; inset-inline-start: 0; width: 3px; background: var(--line); }
.big-actions .btn.buy::before { background: var(--buy); }
.big-actions .btn.sell::before { background: var(--sell); }
.big-actions .btn:hover { background: var(--sunk); filter: none; color: var(--ink); }
.big-actions .btn small { font-weight: 400; font-size: .76em; }
.big-actions svg { width: 22px; height: 22px; color: var(--ink-3); }
.big-actions .btn.buy svg { color: var(--buy); } .big-actions .btn.sell svg { color: var(--sell); }
@media (max-width: 560px) { .big-actions { grid-template-columns: 1fr 1fr; } .big-actions .btn:last-child { grid-column: span 2; border-top: 1px solid var(--line); } .big-actions .btn:nth-child(2) { border-inline-end: 0; } }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .86em; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }
.input, select.input, textarea.input { width: 100%; min-height: var(--tap); padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; }
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--brass-soft); }
.input.num, input[inputmode="decimal"], input[inputmode="numeric"], input[data-money] { direction: ltr; text-align: end; font-family: var(--num); }
.hint { font-size: .84em; color: var(--ink-3); margin-top: 4px; }
.err { font-size: .84em; color: var(--sell); margin-top: 4px; }
.check { display: flex; align-items: center; gap: 8px; min-height: 36px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.seg label { cursor: pointer; }
.seg label + label { border-inline-start: 1px solid var(--line); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 7px 16px; font-weight: 600; color: var(--ink-2); }
.seg input:checked + span { background: var(--ink); color: var(--paper); }
.seg .buy input:checked + span { background: var(--buy); color: #fff; }
.seg .sell input:checked + span { background: var(--sell); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--brass); outline-offset: -2px; }

/* ---------- Tables & lists ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: start; font-size: .74em; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--ink); white-space: nowrap; }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--sunk) 55%, transparent); }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: end; }
.table-wrap { overflow-x: auto; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.list li:last-child { border-bottom: 0; }

/* Rate board (dashboard / prices) */
.board { width: 100%; border-collapse: collapse; }
.board td { padding: 12px 4px; border-bottom: 1px solid var(--line-soft); }
.board tr:last-child td { border-bottom: 0; }
.board .name { font-weight: 600; }
.board .px { font-family: var(--num); font-weight: 600; font-size: 1.18em; text-align: end; white-space: nowrap; }
.board .chg { font-family: var(--num); text-align: end; width: 1%; white-space: nowrap; padding-inline-start: 16px; font-size: .9em; }
.board .age { color: var(--ink-3); font-size: .8em; text-align: end; width: 1%; white-space: nowrap; padding-inline-start: 16px; }
body.simple .board .px { font-size: 1.35em; }

/* ---------- Labels ---------- */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 3px; font-size: .76em; font-weight: 600; border: 1px solid var(--line); color: var(--ink-2); background: transparent; white-space: nowrap; line-height: 1.8; }
.tag.buy { color: var(--buy); border-color: color-mix(in srgb, var(--buy) 40%, transparent); background: var(--buy-soft); }
.tag.sell { color: var(--sell); border-color: color-mix(in srgb, var(--sell) 40%, transparent); background: var(--sell-soft); }
.tag.gold { color: var(--brass); border-color: color-mix(in srgb, var(--brass) 45%, transparent); background: var(--brass-soft); }
.tag.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-soft); }
.topbar .tag.gold { background: var(--brass-2); color: var(--band); border: 0; }
.tick { display: inline-block; width: 15px; height: 15px; vertical-align: -2px; color: #2f7fd1; }
.tier-bronze { color: #8f6238; } .tier-silver { color: #6f7880; } .tier-gold { color: var(--brass); } .tier-diamond { color: #2f7fd1; }
.up { color: var(--buy); } .down { color: var(--sell); }

/* ---------- Figures ---------- */
.price-tile { display: flex; flex-direction: column; gap: 2px; }
.price-tile .label { color: var(--ink-2); font-size: .88em; }
.price-tile .value { font-family: var(--num); font-size: 1.5em; font-weight: 600; }
.stat .value { font-family: var(--num); font-size: 1.7em; font-weight: 600; }
.stat .label { color: var(--ink-3); font-size: .78em; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }

/* ---------- Notices ---------- */
.alert { padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; background: var(--info-soft); border-inline-start: 3px solid var(--ink-3); }
.alert.success { background: var(--buy-soft); color: var(--buy); border-color: var(--buy); }
.alert.error { background: var(--sell-soft); color: var(--sell); border-color: var(--sell); }
.alert.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }

/* ---------- Progress / chat ---------- */
.steps { display: flex; gap: 4px; margin: 6px 0 18px; }
.steps div { flex: 1; height: 3px; background: var(--line); }
.steps div.on { background: var(--ink); }
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; padding: 4px; }
.bubble { max-width: 82%; padding: 8px 12px; border-radius: var(--radius); background: var(--sunk); }
.bubble.me { align-self: flex-end; background: var(--brass-soft); }
.bubble small { display: block; font-size: .74em; }

/* Order book */
.book { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.book .lvl { display: flex; justify-content: space-between; padding: 4px 8px; font-family: var(--num); font-size: .92em; }
.book .bid .lvl { background: linear-gradient(to left, var(--buy-soft) var(--w, 0%), transparent 0); }
.book .ask .lvl { background: linear-gradient(to right, var(--sell-soft) var(--w, 0%), transparent 0); }

.sparkline { width: 100%; height: 36px; }
.sparkline path { fill: none; stroke: var(--brass); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.empty { text-align: center; color: var(--ink-3); padding: 34px 12px; }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.otp-input { letter-spacing: .5em; text-align: center !important; font-size: 1.5em; font-family: var(--num); }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 7px 18px; margin: 0; }
dl.kv dt { color: var(--ink-3); } dl.kv dd { margin: 0; font-weight: 600; }

/* ---------- Auth (split screen) ---------- */
.auth-split { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-side { background: var(--band); color: var(--band-ink); padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.auth-side .brand { font-size: 1.15em; }
.auth-side h2 { font-size: 1.9em; line-height: 1.35; font-weight: 800; margin: 0 0 10px; max-width: 16em; }
.auth-side p { color: color-mix(in srgb, var(--band-ink) 65%, transparent); max-width: 30em; }
.auth-side .board td { border-color: color-mix(in srgb, var(--band-ink) 12%, transparent); }
.auth-side .board .age { color: color-mix(in srgb, var(--band-ink) 45%, transparent); }
.auth-side .rule { height: 1px; background: linear-gradient(to left, var(--brass-2), transparent); }
.auth-main { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 1.7em; }
@media (max-width: 900px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-side { padding: 22px 20px; }
  .auth-side .hide-m { display: none; }
  .auth-side h2 { font-size: 1.25em; }
}

/* ---------- Admin ---------- */
.admin-side { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 28px; align-items: start; }
.adm-nav { position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow-y: auto; border-inline-end: 1px solid var(--line); padding-inline-end: 12px; scrollbar-width: thin; }
.adm-nav-current, .adm-burger { display: none; }
.adm-group { padding: 4px 0 10px; }
.adm-group + .adm-group { border-top: 1px solid var(--line-soft); padding-top: 10px; }
.adm-group-title { display: block; font-size: .72em; font-weight: 700; color: var(--ink-3); padding: 2px 10px 6px; }
.adm-nav a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; color: var(--ink-2); text-decoration: none; border-inline-start: 2px solid transparent; border-radius: 0 3px 3px 0; line-height: 1.35; }
[dir="rtl"] .adm-nav a { border-radius: 3px 0 0 3px; }
.adm-nav a:hover { color: var(--ink); background: var(--sunk); }
.adm-nav a.on { color: var(--ink); font-weight: 600; border-inline-start-color: var(--brass); background: var(--sunk); }
.adm-nav .count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--brass-2); color: var(--band); font: 600 .74em/20px var(--num); text-align: center; }
.adm-logout { display: none; padding: 10px; border-top: 1px solid var(--line-soft); }
.adm-user { font-size: .86em; color: color-mix(in srgb, var(--band-ink) 70%, transparent); white-space: nowrap; }
.adm-main { min-width: 0; }
.adm-main > h1:first-of-type, .adm-main > .page-head:first-of-type { margin-top: 0; }
.hide-md { }
@media (max-width: 1100px) { .hide-md { display: none; } }
@media (max-width: 900px) {
  .admin-side { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .adm-burger { display: inline-flex; }
  .adm-nav { position: static; max-height: none; overflow: visible; border: 1px solid var(--line); border-radius: var(--radius); padding: 0; background: var(--surface); }
  .adm-nav-current { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; font-weight: 600; cursor: pointer; }
  .adm-nav-body { display: none; border-top: 1px solid var(--line-soft); padding: 8px; }
  .adm-nav-toggle:checked + .admin-side .adm-nav-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 10px; }
  .adm-nav-toggle:checked + .admin-side .adm-nav-current span { transform: rotate(180deg); }
  .adm-group { padding: 6px 0; }
  .adm-group + .adm-group { border-top: 0; padding-top: 6px; }
  .adm-logout { display: block; grid-column: 1 / -1; }
}
@media (max-width: 560px) { .topbar .adm-brand span { display: none; } }

.hide-sm { }
@media (max-width: 560px) { .hide-sm { display: none; } }

/* ---------- Phones: tables become cards ---------- */
@media (max-width: 700px) {
  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
  .table.stack tr { border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 12px; margin-bottom: 10px; background: var(--surface); }
  .table.stack tbody tr:hover td { background: transparent; }
  .table.stack td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line-soft); text-align: end; }
  .table.stack td:last-child { border-bottom: 0; }
  .table.stack td[data-label]::before { content: attr(data-label); color: var(--ink-3); font-size: .84em; text-align: start; font-family: var(--text); }
  .table.stack td.empty { display: block; text-align: center; }
  .card:has(> .table-wrap > .table.stack), .card:has(> .table.stack) { background: transparent; border: 0; padding: 0; }
  h1 { font-size: 1.3em; }
  .seg span { padding: 7px 11px; }
  dl.kv { grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; }
  dl.kv dd { text-align: end; overflow-wrap: anywhere; }
  .board .age { display: none; }
  .board .px { font-size: 1.05em; }
  body.simple .board .px { font-size: 1.15em; }
  .board .chg { padding-inline-start: 8px; }
}
@media (pointer: coarse) { .btn.sm { min-height: 40px; } .check input { width: 22px; height: 22px; } }
@media print { .topbar, .ticker, .tabbar, .no-print { display: none !important; } body { background: #fff; } }

.unit { font-family: var(--text); font-size: .62em; font-weight: 500; color: var(--ink-3); margin-inline-start: 4px; }
.ticker small { font-size: .85em; }

/* Header clock & market session */
.clock { display: inline-flex; align-items: center; gap: 12px; font-size: .84em; color: color-mix(in srgb, var(--band-ink) 75%, transparent); }
.clock .time { color: var(--band-ink); font-weight: 600; font-size: 1.05em; }
.clock .mkt { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border: 1px solid color-mix(in srgb, var(--band-ink) 22%, transparent); border-radius: 3px; }
.clock .mkt i { width: 7px; height: 7px; border-radius: 50%; background: var(--sell); }
.clock .mkt.on i { background: #4fbf8b; box-shadow: 0 0 0 3px color-mix(in srgb, #4fbf8b 25%, transparent); }
@media (max-width: 900px) { .clock .date { display: none; } .clock { gap: 8px; } }

/* Chat rooms */
.room.locked { opacity: .55; cursor: not-allowed; }
.room:hover:not(.locked) { border-color: var(--ink-2); }
.chatroom { max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; }
.msg { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.msg .who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .9em; }
.msg .body { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
form.inline { display: inline; }

/* Bar chart */
.bars { direction: ltr; }
.bars svg { width: 100%; height: 170px; display: block; }
.bars rect { fill: var(--ink); }
.bars rect:hover { fill: var(--brass); }
.bars line { stroke: var(--line); stroke-width: .3; vector-effect: non-scaling-stroke; }
.bars-labels { display: grid; font-size: .72em; color: var(--ink-3); text-align: center; margin-top: 4px; }

.flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: var(--brass-soft); } to { background: transparent; } }
.mic-wrap { position: relative; display: block; }
.mic-wrap > .input { padding-inline-end: 44px; }
.mic { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--ink-3); border-radius: 50%; width: 32px; height: 32px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.mic:hover { color: var(--ink); background: var(--sunk); }
small.words { display: block; margin-top: 4px; color: var(--brass); font-size: .82em; line-height: 1.6; min-height: 1.3em; }
.mic.on { color: var(--sell); border-color: var(--sell); }

.qr { background: #fff; padding: 10px; display: inline-block; border: 1px solid var(--line); border-radius: 4px; }
.qr svg { display: block; width: 200px; height: 200px; }

/* Onboarding */
.onb-steps { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.onb-steps li { padding: 12px 14px; color: var(--ink-3); border-inline-end: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.onb-steps li:last-child { border-inline-end: 0; }
.onb-steps li b { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid currentColor; font-size: .85em; }
.onb-steps li.on { color: var(--ink); background: var(--brass-soft); font-weight: 600; }
.onb-steps li.done { color: var(--buy); }
.contract-text { max-height: 46vh; overflow-y: auto; padding-inline-end: 8px; line-height: 2; }
.contract-text h3 { font-size: 1.1em; } .contract-text h4 { font-size: 1em; margin: 14px 0 4px; }
.sig-pad { width: 100%; max-width: 600px; height: 180px; background: #fff; border: 1px dashed var(--ink-3); border-radius: 4px; touch-action: none; display: block; }
@media (max-width: 700px) { .onb-steps { grid-template-columns: 1fr; } .onb-steps li { border-inline-end: 0; border-bottom: 1px solid var(--line); } }
/* Phones: keep the top bar inside the viewport */
@media (max-width: 560px) {
  .topbar .in { gap: 6px; padding: 0 10px; }
  .topbar .btn.sm { padding-inline: 6px; }
  .clock { gap: 6px; }
  .clock .mkt { white-space: nowrap; padding: 2px 6px; font-size: .92em; }
  .clock .time { font-size: 1em; }
}
@media (max-width: 560px) { .topbar .brand { font-size: 0; gap: 0; } }
@media (max-width: 560px) {
  .board .age { display: none; }
  .board .px { white-space: normal; font-size: 1.05em; }
  .board .px .unit { display: block; white-space: nowrap; }
  .board .chg { padding-inline-start: 8px; }
}

/* ---- Admin building blocks ------------------------------------------------ */
.grid.top { align-items: start; }
.hint { color: var(--ink-3); font-size: .86em; margin: 6px 0 12px; line-height: 1.7; }
.form-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-start; padding-top: 14px; margin-top: 6px; border-top: 1px solid var(--line-soft); }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.inline-form .field { margin: 0; min-width: 140px; }
.inline-form .grow { flex: 1 1 220px; }
.inline-form .btn { flex: 0 0 auto; }
.list li.past { opacity: .5; }
.status-strip { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 16px; border: 1px solid var(--line); border-inline-start: 3px solid var(--sell); border-radius: var(--radius); background: var(--surface); }
.status-strip.on { border-inline-start-color: var(--buy); }
.status-strip > i { width: 10px; height: 10px; border-radius: 50%; background: var(--sell); flex: 0 0 auto; }
.status-strip.on > i { background: var(--buy); box-shadow: 0 0 0 4px var(--buy-soft); }
.status-strip > div { display: flex; flex-wrap: wrap; gap: 4px 12px; flex: 1; }
/* Weekly schedule rows */
.sched { display: grid; gap: 2px; }
.sched-row { display: grid; grid-template-columns: minmax(110px, 1fr) 96px 16px 96px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.sched-row:last-child { border-bottom: 0; }
.sched-head { font-size: .78em; color: var(--ink-3); font-weight: 600; padding-top: 0; }
.sched-row .time-in { text-align: center; min-height: 38px; padding: 6px 8px; }
.sched-row > span.muted { text-align: center; }
.sched-row.off .time-in { opacity: .35; }
.sched-row.off .switch span { color: var(--ink-3); }
/* Toggle switch (checkbox) */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; min-height: 36px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { position: relative; width: 38px; height: 22px; border-radius: 11px; background: var(--line); transition: background .15s; flex: 0 0 auto; }
.switch i::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .25); transition: inset-inline-start .15s; }
.switch input:checked + i { background: var(--buy); }
.switch input:checked + i::after { inset-inline-start: 19px; }
.switch input:focus-visible + i { outline: 2px solid var(--brass); outline-offset: 2px; }
.switch span { font-weight: 600; }
@media (max-width: 560px) {
  .sched-row { grid-template-columns: 1fr 78px 10px 78px; gap: 6px; }
  .inline-form .field, .inline-form .btn { flex: 1 1 100%; }
}
/* Settings */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: .84em; color: var(--ink-2); text-decoration: none; background: var(--surface); }
.chips a:hover { border-color: var(--brass); color: var(--ink); }
.set-section { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; margin-bottom: 14px; scroll-margin-top: 80px; }
.set-section header h2 { margin: 0 0 6px; font-size: 1.05em; }
.set-section header p { margin: 0; font-size: .86em; line-height: 1.7; }
.set-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; }
.set-row { display: block; padding: 8px 0; }
.set-row.toggle { grid-column: 1 / -1; padding: 4px 0; }
.set-row.toggle .hint { margin: 0 0 4px; margin-inline-start: 48px; }
.set-label { display: block; font-size: .86em; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.set-row textarea { resize: vertical; }
.set-row:has(textarea) { grid-column: 1 / -1; }
.input-unit { position: relative; display: block; }
.input-unit em { position: absolute; inset-block: 0; inset-inline-end: 12px; display: flex; align-items: center; font-style: normal; font-size: .84em; color: var(--ink-3); pointer-events: none; }
.input-unit .input { padding-inline-end: 64px; text-align: start; }
.sticky-save { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; margin-top: 4px; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: var(--radius); }
@media (max-width: 1000px) { .set-section { grid-template-columns: 1fr; gap: 10px; } }
@media (max-width: 560px) { .set-body { grid-template-columns: 1fr; } .sticky-save { bottom: 0; } .sticky-save .muted { display: none; } .sticky-save .btn { width: 100%; } }
/* Price sources */
.col-stack { display: grid; gap: 16px; align-content: start; }
.num.end, .end { text-align: end; }
.source { border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; background: var(--paper); }
.source-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.source-fields { display: grid; grid-template-columns: 1.2fr .8fr 2fr 80px; gap: 0 12px; }
.source-fields .field { margin-bottom: 10px; }
.source-fields .full { grid-column: 1 / -1; }
.source-fields textarea { font-size: .84em; min-height: 58px; }
.source.add { background: transparent; border-style: dashed; }
.source.add summary { list-style: none; cursor: pointer; }
.source.add summary::-webkit-details-marker { display: none; }
.source.add[open] summary { margin-bottom: 12px; }
details.help summary { cursor: pointer; color: var(--ink-2); font-size: .88em; margin-top: 6px; }
.alert.small { font-size: .84em; padding: 8px 12px; margin: 0 0 10px; }
@media (max-width: 900px) { .source-fields { grid-template-columns: 1fr 1fr; } .source-fields .wide { grid-column: 1 / -1; } }
.nowrap { white-space: nowrap; }
.table.audit td.meta { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) { .table.audit td.meta { max-width: none; white-space: normal; word-break: break-all; } }
@media (max-width: 700px) { .table.stack td.user-cell { display: flex; flex-wrap: wrap; gap: 4px 8px; justify-content: flex-start; font-weight: 600; } }
.filter-tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.filter-tabs .btn { flex: 0 0 auto; }
.toggle-btn { position: relative; width: 42px; height: 24px; border-radius: 12px; border: 0; padding: 0; background: var(--line); cursor: pointer; flex: 0 0 auto; transition: background .15s; }
.toggle-btn i { position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .25); transition: inset-inline-start .15s; }
.toggle-btn.on { background: var(--buy); }
.toggle-btn.on i { inset-inline-start: 21px; }
.toggle-btn:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* ---- App navigation ------------------------------------------------------ */
.nav a, .nav summary { white-space: nowrap; }
.nav-more { position: relative; display: flex; }
.nav-more summary { display: flex; align-items: center; gap: 6px; padding: 0 12px; cursor: pointer; list-style: none; color: color-mix(in srgb, var(--band-ink) 70%, transparent); font-weight: 500; border-bottom: 2px solid transparent; }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary:hover, .nav-more[open] summary { color: var(--band-ink); }
.nav-more summary.on { color: var(--band-ink); border-bottom-color: var(--brass-2); }
.nav-more summary span { font-size: .8em; transition: transform .15s; }
.nav-more[open] summary span { transform: rotate(180deg); }
.nav-menu { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; min-width: 220px; padding: 6px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgb(0 0 0 / .18); z-index: 40; }
.nav-menu a { display: block; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; border: 0; }
.nav-menu a:hover, .nav-menu a.on { background: var(--sunk); }
.nav-menu a.on { font-weight: 600; }
.nav-menu hr { margin: 6px 0; border: 0; border-top: 1px solid var(--line-soft); }
.linklike { width: 100%; text-align: start; padding: 9px 12px; background: none; border: 0; border-radius: var(--radius-sm); font: inherit; color: var(--ink); cursor: pointer; }
.linklike:hover { background: var(--sunk); }
.linklike.danger { color: var(--sell); }
.topbar .bell { position: relative; }
.hide-lg { }
@media (max-width: 1180px) { .hide-lg { display: none; } .clock .date { display: none; } .nav a, .nav-more summary { padding: 0 9px; } .nav { margin-inline-start: 8px; } }
@media (max-width: 1000px) { .clock .mkt .mkt-txt, .clock .mkt .hide-sm { display: none; } .clock .mkt { padding: 6px; border-radius: 50%; } }
/* Mobile tab bar + "more" sheet */
.tabbar a, .tabbar label { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; color: color-mix(in srgb, var(--band-ink) 62%, transparent); font-size: .74em; padding: 6px 0; text-decoration: none; border-top: 2px solid transparent; cursor: pointer; }
.tabbar a span, .tabbar label span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tabbar a.on, .tabbar label.on { color: var(--band-ink); border-top-color: var(--brass-2); }
.tabbar label svg { width: 22px; height: 22px; }
.sheet { display: none; }
@media (max-width: 900px) {
  .sheet-toggle:checked ~ .sheet { display: block; }
  .sheet { position: fixed; inset: 0; z-index: 25; }
  .sheet-backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / .35); }
  .sheet-body { position: absolute; inset-inline: 0; bottom: 0; padding: 16px 16px calc(84px + env(safe-area-inset-bottom)); background: var(--surface); border-radius: 14px 14px 0 0; box-shadow: 0 -10px 30px rgb(0 0 0 / .2); animation: sheet-up .18s ease-out; }
  .sheet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
  .sheet-grid a { padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; font-weight: 500; background: var(--paper); }
  .sheet-grid a.on { border-color: var(--brass); background: var(--brass-soft); }
}
@keyframes sheet-up { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.clock, .clock .mkt, .clock .time, .clock .date { white-space: nowrap; }
.modlist li { align-items: flex-start; }
.modlist li > span:first-child { line-height: 1.8; overflow-wrap: anywhere; }
.hidden-msg { opacity: .55; }
.mute-pop { position: relative; }
.mute-pop summary { list-style: none; }
.mute-pop summary::-webkit-details-marker { display: none; }
.mute-pop .pop { position: absolute; inset-inline-end: 0; top: calc(100% + 4px); z-index: 10; width: 240px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 28px rgb(0 0 0 / .16); }
tr.muted td { opacity: .6; }
@media (max-width: 900px) { .grid.top[style*="2fr"] { grid-template-columns: 1fr !important; } }
/* Scheduled tasks */
.input.sm { min-height: 36px; padding: 5px 10px; width: auto; }
.table.tasks td { vertical-align: top; }
.table.tasks .time-in { width: 76px; text-align: center; margin-inline-start: 4px; }
.methods h3 { margin: 0 0 6px; font-size: .95em; }
code.copy { display: block; padding: 10px 12px; margin: 6px 0; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .8em; word-break: break-all; cursor: copy; text-align: left; }
code.copy.copied { border-color: var(--buy); }
pre.output { max-height: 280px; overflow: auto; padding: 10px; background: var(--sunk); border-radius: var(--radius-sm); font-size: .8em; white-space: pre-wrap; text-align: left; }
.runs li > span { display: block; width: 100%; }
.set-row.full { grid-column: 1 / -1; }
.checklist .chk { flex: 0 0 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .9em; background: var(--sunk); color: var(--ink-3); }
.checklist .chk.ok { background: var(--buy-soft); color: var(--buy); }
.checklist .chk.bad { background: var(--sell-soft); color: var(--sell); }
.checklist .chk.warn { background: var(--warn-soft); color: var(--warn); }
.checklist li { align-items: flex-start; }
.small { font-size: .84em; }
.danger-zone { border-color: color-mix(in srgb, var(--sell) 40%, var(--line)); }
/* Admin search */
.adm-search { position: relative; display: flex; align-items: center; margin-inline-start: 18px; flex: 0 1 320px; min-width: 160px; }
.adm-search svg { position: absolute; inset-inline-start: 10px; color: color-mix(in srgb, var(--band-ink) 55%, transparent); pointer-events: none; }
.adm-search input { width: 100%; height: 36px; padding: 0 12px; padding-inline-start: 32px; border-radius: 18px; border: 1px solid color-mix(in srgb, var(--band-ink) 20%, transparent); background: color-mix(in srgb, var(--band-ink) 8%, transparent); color: var(--band-ink); font: inherit; font-size: .9em; }
.adm-search input::placeholder { color: color-mix(in srgb, var(--band-ink) 45%, transparent); }
.adm-search input:focus { outline: none; border-color: var(--brass-2); background: color-mix(in srgb, var(--band-ink) 14%, transparent); }
.adm-search-m { display: none; }
@media (max-width: 900px) { .adm-search { display: none; } .adm-search-m { display: block; grid-column: 1 / -1; margin: 4px 0 8px; } }
[hidden] { display: none !important; }
/* Product credits */
.credits { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; margin: 36px 0 8px; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: .78em; color: var(--ink-3); text-align: center; }
.credits a { color: inherit; }
.credits .sep { opacity: .5; }
.auth-main .credits { border: 0; margin-top: 20px; }
/* Error pages & about */
body.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.error-box { max-width: 520px; text-align: center; }
.error-code { font-size: 4.2em; font-weight: 700; color: var(--brass); line-height: 1; margin-bottom: 8px; }
.error-box h1 { margin: 0 0 8px; }
.about-mark .mark { width: 44px; height: 44px; }
.steps-list { padding-inline-start: 20px; line-height: 1.9; }
.steps-list li { margin-bottom: 8px; }
.changelog h2, .changelog h3 { font-size: 1em; margin: 14px 0 6px; }
.changelog ul { padding-inline-start: 20px; line-height: 1.9; }
.bal-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.bal-row:last-child { border-bottom: 0; }
.bal-asset { flex: 1 1 100%; font-weight: 600; }
.bal small { color: inherit; opacity: .8; }
.list li.wrap-li { flex-wrap: wrap; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tags .tag { white-space: normal; }
@media (max-width: 560px) { .list li { flex-wrap: wrap; } }
/* Dark mode: readable buy/sell buttons */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.buy, :root:not([data-theme="light"]) .btn.sell { color: #0c0b08; } }
:root[data-theme="dark"] .btn.buy, :root[data-theme="dark"] .btn.sell { color: #0c0b08; }
/* Accessibility */
.skip-link { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 100; padding: 8px 14px; background: var(--ink); color: var(--paper); border-radius: var(--radius-sm); }
.skip-link:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
fieldset.field { border: 0; padding: 0; margin: 0 0 14px; }
fieldset.field legend { font-size: .86em; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; padding: 0; }
/* Market list as cards in simple view (bigger, one action per card) */
.table.cards thead { display: none; }
.table.cards, .table.cards tbody, .table.cards tr, .table.cards td { display: block; width: 100%; }
.table.cards tr { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 14px; margin-bottom: 12px; background: var(--surface); }
.table.cards td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line-soft); text-align: end; }
.table.cards td:last-child { border-bottom: 0; }
.table.cards td:last-child .btn { width: 100%; min-height: 52px; font-size: 1.05em; }
.table.cards td[data-label]::before { content: attr(data-label); color: var(--ink-3); font-size: .84em; text-align: start; }
.card:has(> .table-wrap > .table.cards) { background: transparent; border: 0; padding: 0; }
.insight-wrap > summary { cursor: pointer; margin-bottom: 8px; }
/* Trade page */
.trade-steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0; margin: 0 0 16px; }
.trade-steps li { display: flex; flex-direction: column; gap: 6px; font-size: .8em; color: var(--ink-3); }
.trade-steps .dot { height: 5px; border-radius: 3px; background: var(--line); }
.trade-steps li.on .dot { background: var(--brass); }
.trade-steps li.on { color: var(--ink-2); }
.trade-steps li.now { color: var(--ink); font-weight: 600; }
.confirm-summary { padding: 12px 14px; margin: 10px 0; background: var(--brass-soft); border-radius: var(--radius); line-height: 2; }
.confirm-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.confirm-form .field { flex: 1 1 160px; margin: 0; }
.cancel-trade { margin-top: 18px; }
.cancel-trade summary { cursor: pointer; font-size: .88em; margin-bottom: 8px; }
[data-copy] { cursor: copy; }
[data-copy].copied { outline: 1px solid var(--buy); border-radius: 3px; }
/* File picker (translated, touch friendly) */
.file-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; cursor: pointer; }
.file-pick input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-pick input[type=file]:focus-visible + .btn { outline: 2px solid var(--brass); outline-offset: 2px; }
.guide-steps { list-style: none; counter-reset: g; padding: 0; margin: 0; display: grid; gap: 10px; }
.guide-steps li { counter-increment: g; display: grid; grid-template-columns: 30px 1fr auto; gap: 2px 10px; align-items: center; }
.guide-steps li::before { content: counter(g); grid-row: span 2; width: 26px; height: 26px; border-radius: 50%; background: var(--brass-soft); color: var(--brass); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.guide-steps li.done::before { content: "✓"; background: var(--buy-soft); color: var(--buy); }
.guide-steps li b { grid-column: 2; }
.guide-steps li span { grid-column: 2; color: var(--ink-2); font-size: .9em; line-height: 1.7; }
.guide-steps li .btn { grid-column: 3; grid-row: 1 / span 2; }
@media (max-width: 560px) { .guide-steps li { grid-template-columns: 30px 1fr; } .guide-steps li .btn { grid-column: 2; grid-row: auto; justify-self: start; margin-top: 4px; } }
.notif-list li.unread { font-weight: 600; }
.notif-list li.unread > span:first-child::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brass); margin-inline-end: 8px; vertical-align: middle; }
.notif-list li.read { color: var(--ink-2); }
.notif-list li.day-sep { padding: 12px 0 4px; border-bottom: 0; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: .85em; cursor: pointer; }
.chip:hover { border-color: var(--brass); color: var(--ink); }
@media (max-width: 560px) { .filter-tabs { flex-wrap: wrap; overflow: visible; } }
fieldset.set-body { border: 0; margin: 0; padding: 0; min-width: 0; }
.offline-bar { position: sticky; top: 0; z-index: 50; padding: 10px 16px; background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--line); text-align: center; font-weight: 600; }
/* Persian/Arabic: letter-spacing breaks cursive joining; no uppercase either */
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] .brand, [dir="rtl"] .eyebrow, [dir="rtl"] .section-title,
[dir="rtl"] .table th, [dir="rtl"] .stat .label { letter-spacing: 0; text-transform: none; }
/* Touch screens keep 44px targets even in the compact view */
@media (pointer: coarse) { body.pro { --tap: 44px; } }
/* Windows high-contrast: keep a visible focus ring */
@media (forced-colors: active) { .input:focus, .adm-search input:focus, .btn:focus-visible { outline: 2px solid CanvasText; outline-offset: 2px; } }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Print: statements and trade pages */
@media print {
  @page { margin: 14mm; }
  .adm-nav, .adm-search, .sheet, .offline-bar, .chat-error, form, .btn, .filter-tabs, .ticker, .tabbar, .topbar { display: none !important; }
  .card { border: 0; padding: 0; break-inside: avoid; }
  .admin-side { display: block; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; color: #555; }
  body { font-size: 11pt; color: #000; }
}
/* Announcements */
.announce { background: var(--info-soft); border-bottom: 1px solid var(--line); color: var(--ink); }
.announce.warn { background: var(--warn-soft); color: var(--warn); }
.announce.critical { background: var(--sell-soft); color: var(--sell); font-weight: 600; }
.announce .wrap-in { max-width: 1240px; margin: 0 auto; padding: 9px 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; line-height: 1.7; }
.announce-x { border: 0; background: none; font-size: 1.3em; line-height: 1; cursor: pointer; color: inherit; padding: 4px 8px; }
[dir="rtl"] .input-unit .input { text-align: right; }
[dir="ltr"] .input-unit .input { text-align: left; }
/* Phones: rate board rows as two lines (name, then price + change) */
@media (max-width: 560px) {
  .board, .board tbody { display: block; }
  .board tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
  .board tr:last-child { border-bottom: 0; }
  .board td { border: 0; padding: 0; }
  .board td.name { grid-column: 1 / -1; padding-bottom: 4px; }
  .board .px { text-align: start; }
  .board .px small { white-space: nowrap; }
  .board .chg { align-self: start; }
}
@media (max-width: 560px) { .board .px br { display: none; } .board .px small.muted { display: block; margin-top: 2px; } }
