/* UltraTrade: EpicUltra navy, green up, red down. No outside fonts or files. */
:root {
  --bg: #0a1222; --bg2: #0d172b; --card: #111c33; --card2: #15223d; --line: #22314f; --line2: #2c3d60;
  --text: #e8edf7; --muted: #8e9bb8; --dim: #64728f; --accent: #4f8cff; --accent2: #3a74ef; --accent-soft: rgba(79, 140, 255, .14);
  --up: #19c37d; --down: #f0475a; --up-soft: rgba(25, 195, 125, .13); --down-soft: rgba(240, 71, 90, .13); --warn: #f5b62a; --warn-soft: rgba(245, 182, 42, .13);
  --r: 14px; --r-sm: 9px; --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 26px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
p { margin: 0 0 .8em; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, td.n, .mono { font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .down { color: var(--down); } .muted { color: var(--muted); } .dim { color: var(--dim); }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff; padding: 8px 12px; z-index: 99; border-radius: 0 0 8px 0; }
.skip:focus { left: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 20px; }
main.wrap { flex: 1; padding-top: 22px; padding-bottom: 40px; }
[hidden] { display: none !important; }

/* top bar */
.top { position: sticky; top: 0; z-index: 30; background: rgba(10, 18, 34, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1320px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 750; font-size: 17px; letter-spacing: -.02em; flex: none; }
.brand:hover { text-decoration: none; }
.brand img { display: block; border-radius: 8px; }
.nav { display: flex; gap: 2px; }
.nav a { color: var(--muted); padding: 7px 11px; border-radius: 8px; font-weight: 560; font-size: 14px; }
.nav a:hover { color: var(--text); background: var(--card); text-decoration: none; }
.nav a[aria-current] { color: var(--text); background: var(--card2); }
.search { position: relative; flex: 1; max-width: 340px; margin-left: auto; }
.search input { width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); padding: 0 12px 0 36px; outline: none; }
.search input:focus { border-color: var(--accent); background: var(--card); }
.s-ic { position: absolute; left: 11px; top: 10px; width: 18px; height: 18px; color: var(--dim); }
.search-list { position: absolute; top: 44px; left: 0; right: 0; background: var(--card); border: 1px solid var(--line2); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 40; }
.search-list a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.search-list a:hover, .search-list a.on { background: var(--card2); text-decoration: none; }
.search-list .tk { font-weight: 700; width: 52px; }
.search-list .nm { flex: 1; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-right { display: flex; align-items: center; gap: 10px; flex: none; }
.mkt { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); padding: 5px 10px; border: 1px solid var(--line); border-radius: 99px; white-space: nowrap; }
.mkt i { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.mkt.open i { background: var(--up); box-shadow: 0 0 0 0 rgba(25, 195, 125, .6); animation: pulse 2s infinite; }
.mkt.closed i { background: var(--warn); }
.mkt b { font-weight: 600; color: var(--text); }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(25, 195, 125, 0); } 100% { box-shadow: 0 0 0 0 rgba(25, 195, 125, 0); } }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.iconbtn { position: relative; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.iconbtn:hover { color: var(--text); background: var(--card); }
.iconbtn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--down); border: 2px solid var(--bg2); }
.me { position: relative; }
.me-btn { display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 10px 0 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); cursor: pointer; }
.me-btn:hover { background: var(--card); }
.av { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(135deg, #5b9bff, #2f5fe0); font-weight: 750; font-size: 13px; color: #fff; flex: none; }
.av.lg { width: 56px; height: 56px; border-radius: 14px; font-size: 24px; }
.me-txt { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.me-txt b { font-size: 13px; } .me-txt small { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.menu { position: absolute; right: 0; top: 46px; min-width: 210px; background: var(--card); border: 1px solid var(--line2); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 40; }
.menu a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--text); font-size: 14px; }
.menu a:hover { background: var(--card2); text-decoration: none; }
.tape { border-top: 1px solid var(--line); overflow: hidden; height: 30px; position: relative; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.tape-in { display: flex; gap: 26px; white-space: nowrap; position: absolute; left: 0; top: 0; height: 30px; align-items: center; animation: tape 80s linear infinite; will-change: transform; padding-left: 20px; }
.tape:hover .tape-in { animation-play-state: paused; }
.tape a { color: var(--text); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tape a b { margin-right: 6px; } .tape a:hover { text-decoration: none; color: var(--accent); }
@keyframes tape { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .tape-in { animation: none; } .mkt.open i { animation: none; } }
.notice { background: var(--warn-soft); color: #ffd98a; border-bottom: 1px solid rgba(245, 182, 42, .3); text-align: center; padding: 9px 20px; font-size: 14px; }

/* cards + layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.card + .card { margin-top: 16px; }
.grid > .card + .card, .split > .card + .card { margin-top: 0; }
.grid > *, .split > * { min-width: 0; }
.card h2 { display: flex; align-items: center; gap: 10px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-h h2 { margin: 0; }
.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)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.stack > * + * { margin-top: 16px; }
.center { text-align: center; }
.msg { max-width: 520px; margin: 60px auto; padding: 36px; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-h h1 { margin: 0; }
.page-h p { margin: 4px 0 0; color: var(--muted); }
.loading { display: grid; place-items: center; min-height: 40vh; }
.spin { width: 28px; height: 28px; border: 3px solid var(--line2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { color: var(--muted); text-align: center; padding: 26px 10px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--card2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill.up { background: var(--up-soft); color: var(--up); border-color: transparent; }
.pill.down { background: var(--down-soft); color: var(--down); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.acc { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chg { display: inline-block; min-width: 72px; text-align: right; padding: 2px 8px; border-radius: 7px; font-weight: 650; font-variant-numeric: tabular-nums; font-size: 13.5px; }
.chg.up { background: var(--up-soft); } .chg.down { background: var(--down-soft); } .chg.flat { background: var(--card2); color: var(--muted); }
.flash-up { animation: fu .9s ease-out; } .flash-down { animation: fd .9s ease-out; }
@keyframes fu { 0% { background: rgba(25, 195, 125, .35); } 100% { background: transparent; } }
@keyframes fd { 0% { background: rgba(240, 71, 90, .35); } 100% { background: transparent; } }

/* buttons: they press down like a key */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card2);
  color: var(--text); font-weight: 650; cursor: pointer; transition: transform .08s, box-shadow .08s, background .15s, filter .15s; box-shadow: 0 3px 0 rgba(0, 0, 0, .35); white-space: nowrap; user-select: none; }
.btn:hover { text-decoration: none; filter: brightness(1.12); }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 rgba(0, 0, 0, .35); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: none; }
.btn-primary { background: linear-gradient(180deg, #5a95ff, #3a74ef); border-color: #3a74ef; color: #fff; box-shadow: 0 3px 0 #1f4fb8; }
.btn-primary:active { box-shadow: 0 0 0 #1f4fb8; }
.btn-buy { background: linear-gradient(180deg, #22d08a, #14a96b); border-color: #14a96b; color: #04170f; box-shadow: 0 3px 0 #0b7a4c; }
.btn-buy:active { box-shadow: 0 0 0 #0b7a4c; }
.btn-sell { background: linear-gradient(180deg, #ff5b6d, #e03a4d); border-color: #e03a4d; color: #fff; box-shadow: 0 3px 0 #a52434; }
.btn-sell:active { box-shadow: 0 0 0 #a52434; }
.btn-ghost { background: transparent; box-shadow: none; border-color: var(--line); }
.btn-ghost:active { transform: translateY(1px); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 12.5px; border-radius: 7px; box-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.btn-xs:active { transform: translateY(2px); }
.btn-block { width: 100%; }
.btn-danger { color: var(--down); }
.tabs { display: inline-flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.tabs button { border: 0; background: transparent; color: var(--muted); padding: 5px 11px; border-radius: 7px; cursor: pointer; font-weight: 620; font-size: 13px; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-pressed="true"] { background: var(--card2); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset; }

/* tables */
.tbl-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th.n, td.n { text-align: right; }
th button { all: unset; cursor: pointer; } th button:hover { color: var(--text); } th button[data-dir]::after { content: ' ↓'; } th button[data-dir="asc"]::after { content: ' ↑'; }
td { padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr.link { cursor: pointer; } tbody tr.link:hover td { background: rgba(255, 255, 255, .025); }
tr.me-row td { background: var(--accent-soft); }
.tk { font-weight: 720; letter-spacing: .01em; }
.co { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 11.5px; color: #fff; flex: none; letter-spacing: -.02em; }
.co .t { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.co .t small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
a.co, a.co:hover { color: var(--text); text-decoration: none; }
.spark { display: block; width: 90px; height: 30px; }

/* lists on the home page */
.rows a { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--line); color: var(--text); }
.rows a:last-child { border-bottom: 0; }
.rows a:hover { text-decoration: none; background: rgba(255, 255, 255, .02); }
.rows .px { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; }
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: center; padding: 28px; background: radial-gradient(1200px 400px at 0% 0%, rgba(79, 140, 255, .16), transparent 60%), var(--card); }
.hero h1 { font-size: 32px; letter-spacing: -.025em; }
.hero p { color: var(--muted); font-size: 16px; max-width: 560px; }
.hero .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hero .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.big { font-size: 30px; font-weight: 760; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpis + .card, .card + .kpis { margin-top: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.kpi small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi b { display: block; font-size: 19px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi span { font-size: 12.5px; }
.heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.heat a { border-radius: 9px; padding: 10px 8px; color: #fff; text-align: center; font-variant-numeric: tabular-nums; line-height: 1.25; border: 1px solid rgba(255, 255, 255, .05); }
.heat a:hover { text-decoration: none; filter: brightness(1.2); }
.heat a b { display: block; font-size: 14px; } .heat a span, .heat a span.up, .heat a span.down { font-size: 12.5px; opacity: .92; color: #fff; }
.news-list .item { display: block; padding: 11px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.news-list .item:last-child { border-bottom: 0; }
.news-list .item .h { font-weight: 620; }
.news-list .item .meta { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); margin-top: 3px; flex-wrap: wrap; }
.news-list .item p { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
.cal .day { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin: 14px 0 6px; }
.cal .day:first-child { margin-top: 0; }
.cal .ev { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.cal .ev:hover { text-decoration: none; background: rgba(255, 255, 255, .02); }

/* stock page */
.sh { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.sh .logo { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 14px; flex: none; }
.sh h1 { margin: 0; font-size: 24px; }
.sh .sub { color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; margin-top: 2px; }
.sh .price { margin-left: auto; text-align: right; }
.sh .price .big { font-size: 34px; }
.sh .acts { display: flex; gap: 8px; align-items: center; }
.chart-box { position: relative; height: 380px; margin: 0 -6px; }
.chart-box.sm { height: 230px; }
.chart-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
.chart-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.tip { position: absolute; pointer-events: none; background: rgba(13, 23, 43, .96); border: 1px solid var(--line2); border-radius: 9px; padding: 7px 10px; font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; z-index: 3; box-shadow: var(--shadow); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 0 18px; }
.stats div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.stats dt { color: var(--muted); } .stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.halt { display: flex; gap: 10px; align-items: center; background: var(--warn-soft); color: #ffd98a; border: 1px solid rgba(245, 182, 42, .35); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }
.book { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; font-size: 13px; font-variant-numeric: tabular-nums; }
.book .col div { position: relative; display: flex; justify-content: space-between; padding: 3px 6px; z-index: 0; }
.book .col div i { position: absolute; top: 1px; bottom: 1px; z-index: -1; border-radius: 4px; }
.book .bids div i { right: 0; background: var(--up-soft); } .book .asks div i { left: 0; background: var(--down-soft); }
.book .bids .p { color: var(--up); } .book .asks .p { color: var(--down); }
.book .you::after { content: '•'; color: var(--accent); margin-left: 4px; }
.book .hd { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.spread { text-align: center; font-size: 12.5px; color: var(--muted); padding: 6px 0; }
.tape-list { font-size: 13px; font-variant-numeric: tabular-nums; max-height: 300px; overflow: auto; }
.tape-list div { display: grid; grid-template-columns: 64px 1fr 1fr; gap: 8px; padding: 3px 6px; border-radius: 5px; }
.tape-list div span:nth-child(2), .tape-list div span:nth-child(3) { text-align: right; }
.tape-list .u { background: var(--accent-soft); }

/* order ticket */
.ticket { position: sticky; top: 108px; }
.side-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--bg2); border: 1px solid var(--line); border-radius: 11px; padding: 4px; margin-bottom: 14px; }
.side-tabs button { height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 720; cursor: pointer; }
.side-tabs button[aria-pressed="true"].b { background: var(--up); color: #04170f; }
.side-tabs button[aria-pressed="true"].s { background: var(--down); color: #fff; }
.field { margin-bottom: 12px; }
.field > label, .lbl { display: block; font-size: 12.5px; font-weight: 650; color: var(--muted); margin-bottom: 5px; }
.inp, select.inp, textarea.inp { width: 100%; height: 40px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg2); padding: 0 12px; outline: none; font-variant-numeric: tabular-nums; }
textarea.inp { height: auto; min-height: 90px; padding: 10px 12px; line-height: 1.45; resize: vertical; }
.inp:focus { border-color: var(--accent); }
.inp-row { display: flex; gap: 8px; }
.inp-pre { position: relative; } .inp-pre span { position: absolute; left: 12px; top: 9px; color: var(--dim); } .inp-pre .inp { padding-left: 24px; }
.inp-post { position: relative; } .inp-post span { position: absolute; right: 12px; top: 9px; color: var(--dim); } .inp-post .inp { padding-right: 30px; }
.qty-btns { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.sumry { background: var(--bg2); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; margin: 12px 0; font-size: 14px; }
.sumry div { display: flex; justify-content: space-between; padding: 3px 0; font-variant-numeric: tabular-nums; }
.sumry div span:first-child { color: var(--muted); }
.form-err { color: var(--down); font-size: 13.5px; margin: 8px 0; }
.help { color: var(--muted); font-size: 13px; margin-top: 5px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 14px; }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--accent); }
.switch-row { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.switch-row:last-child { border-bottom: 0; }
.switch-row p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.sw { position: relative; width: 46px; height: 26px; flex: none; }
.sw input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.sw span { position: absolute; inset: 0; background: var(--line2); border-radius: 99px; transition: background .15s; }
.sw span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.sw input:checked + span { background: var(--accent); } .sw input:checked + span::after { transform: translateX(20px); }
.sw input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.alloc { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--bg2); margin: 6px 0 10px; }
.alloc i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.legend span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: var(--c); margin-right: 6px; }

/* overlays */
.dlg-bg { position: fixed; inset: 0; background: rgba(3, 7, 16, .65); z-index: 60; display: grid; place-items: center; padding: 16px; animation: fade .12s; }
.dlg { width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow: auto; background: var(--card); border: 1px solid var(--line2); border-radius: 16px; box-shadow: var(--shadow); padding: 22px; animation: pop .14s ease-out; }
.dlg.wide { max-width: 720px; }
.dlg h2 { margin-bottom: 12px; }
.dlg .acts { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.notes { position: fixed; top: 66px; right: 20px; width: 380px; max-height: 70vh; overflow: auto; background: var(--card); border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--shadow); z-index: 50; padding: 8px; }
.notes .n { padding: 10px; border-radius: 9px; font-size: 14px; display: flex; gap: 10px; }
.notes .n.unread { background: var(--accent-soft); }
.notes .n small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.notes .nh { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 10px; }
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 70; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 40px)); }
.toast { background: var(--card2); border: 1px solid var(--line2); border-left: 4px solid var(--accent); border-radius: 11px; padding: 11px 14px; box-shadow: var(--shadow); font-size: 14px; animation: slide .2s ease-out; }
.toast.ok { border-left-color: var(--up); } .toast.bad { border-left-color: var(--down); } .toast.warn { border-left-color: var(--warn); }
@keyframes slide { from { transform: translateX(20px); opacity: 0; } }

/* learn + text pages */
.prose { max-width: 760px; }
.prose p, .prose li { color: #c9d2e4; }
.prose h2 { margin-top: 30px; font-size: 20px; }
.prose h2:first-child { margin-top: 0; }
.ex { background: var(--bg2); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 12px 14px; margin: 10px 0 16px; font-size: 14.5px; }
.ex b.t { display: block; color: var(--accent); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.ex ul, .ex ol { margin: 4px 0 0; padding-left: 20px; }
.toc { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.steps { counter-reset: s; display: grid; gap: 12px; }
.steps > div { counter-increment: s; display: flex; gap: 14px; align-items: flex-start; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.steps > div::before { content: counter(s); width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: #fff; font-weight: 800; display: grid; place-items: center; flex: none; }
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 14px; }
.kv { font-size: 13px; color: var(--muted); }

/* footer + phone tab bar */
.foot { border-top: 1px solid var(--line); background: var(--bg2); color: var(--muted); font-size: 14px; }
.foot-in { display: flex; justify-content: space-between; gap: 20px; padding-top: 22px; padding-bottom: 22px; flex-wrap: wrap; }
.foot-in p { margin: 3px 0 0; } .foot-in b { color: var(--text); }
.foot nav { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.foot nav a { color: var(--muted); } .foot nav a:hover { color: var(--text); }
.tabbar { display: none; }

@media (max-width: 1120px) {
  .nav a:nth-child(n+5) { display: none; }
  .split { grid-template-columns: minmax(0, 1fr) 330px; }
}
@media (max-width: 920px) {
  .nav { display: none; }
  .split { grid-template-columns: 1fr; }
  .ticket { position: static; }
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  body { font-size: 15px; padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .wrap { padding: 0 14px; }
  .top-in { padding: 0 14px; gap: 10px; height: 56px; }
  .brand span { display: none; }
  .search { max-width: none; }
  .mkt b, .me-txt { display: none; }
  .mkt { padding: 5px 8px; }
  .me-btn { padding: 0 4px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .card { padding: 15px; border-radius: 13px; }
  .tbl-wrap { margin: 0 -15px; padding: 0 15px; }
  h1 { font-size: 22px; } .hero h1 { font-size: 25px; } .hero { padding: 20px; }
  .chart-box { height: 280px; }
  .sh .price { margin-left: 0; text-align: left; width: 100%; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
  .sh .price .big { font-size: 30px; }
  .notes { left: 10px; right: 10px; width: auto; top: 62px; }
  .co .t small { max-width: 140px; }
  .hide-sm { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: rgba(13, 23, 43, .97); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; color: var(--muted); font-size: 11px; font-weight: 600; }
  .tabbar a[aria-current] { color: var(--accent); }
  .tabbar a:hover { text-decoration: none; }
  .tabbar .ic { width: 22px; height: 22px; }
  .toasts { bottom: calc(74px + env(safe-area-inset-bottom)); right: 10px; left: 10px; width: auto; }
}
