@font-face { font-family: "Inter"; src: url("/static/fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
/* BTC Bot — iOS-style design system.
   Tokens follow Apple's system colors; light and dark mode, sidebar on wide screens, tab bar on phones. */
:root {
  --bg: #F2F2F7; --bg2: #FFFFFF; --bg3: #F2F2F7; --fill: rgba(120,120,128,.12); --fill2: rgba(120,120,128,.20);
  --label: #000000; --label2: rgba(60,60,67,.60); --label3: rgba(60,60,67,.30); --sep: rgba(60,60,67,.18);
  --blue: #007AFF; --green: #34C759; --red: #FF3B30; --orange: #FF9500; --purple: #AF52DE; --yellow: #FFCC00; --teal: #30B0C7;
  --bar: rgba(249,249,249,.78); --hero1: #0A3D91; --hero2: #1E6BFF; --shadow: 0 1px 0 rgba(0,0,0,.04);
  --radius-l: 22px; --radius-m: 14px; --radius-s: 10px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, "Segoe UI", Roboto, "Noto Sans Thai", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --bg2: #1C1C1E; --bg3: #2C2C2E; --fill: rgba(118,118,128,.24); --fill2: rgba(118,118,128,.32);
    --label: #FFFFFF; --label2: rgba(235,235,245,.60); --label3: rgba(235,235,245,.30); --sep: rgba(84,84,88,.55);
    --blue: #0A84FF; --green: #30D158; --red: #FF453A; --orange: #FF9F0A; --purple: #BF5AF2; --yellow: #FFD60A; --teal: #40C8E0;
    --bar: rgba(22,22,24,.78); --hero1: #0B2A66; --hero2: #1559E0; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --bg2: #1C1C1E; --bg3: #2C2C2E; --fill: rgba(118,118,128,.24); --fill2: rgba(118,118,128,.32);
  --label: #FFFFFF; --label2: rgba(235,235,245,.60); --label3: rgba(235,235,245,.30); --sep: rgba(84,84,88,.55);
  --blue: #0A84FF; --green: #30D158; --red: #FF453A; --orange: #FF9F0A; --purple: #BF5AF2; --yellow: #FFD60A; --teal: #40C8E0;
  --bar: rgba(22,22,24,.78); --hero1: #0B2A66; --hero2: #1559E0; color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--label); font: 17px/1.35 var(--font); letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--blue); text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--green); } .neg { color: var(--red); } .muted { color: var(--label2); } .faint { color: var(--label3); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent); outline-offset: 2px; border-radius: 8px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------------------------------------------------------------- shell */
.app { min-height: 100%; }
.sidebar { display: none; }
.main { padding: calc(var(--safe-t)) 0 calc(84px + var(--safe-b)); max-width: 1180px; margin: 0 auto; }
.navbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(8px + var(--safe-t)) 16px 8px; margin-top: calc(-1 * var(--safe-t));
  background: transparent; transition: background .2s, border-color .2s; border-bottom: .5px solid transparent; min-height: 52px; }
.navbar.scrolled { background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom-color: var(--sep); }
.navbar .small-title { font-weight: 600; font-size: 17px; opacity: 0; transition: opacity .2s; position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; }
.navbar.scrolled .small-title { opacity: 1; }
.navbar .left, .navbar .right { display: flex; align-items: center; gap: 8px; min-width: 40px; }
.large-title { font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: 0.01em; margin: 2px 16px 12px; }
.page-sub { margin: -8px 16px 14px; color: var(--label2); font-size: 15px; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around;
  padding: 6px 4px calc(4px + var(--safe-b)); background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid var(--sep); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 3px 0; color: var(--label2);
  font-size: 10px; font-weight: 500; background: none; border: 0; cursor: pointer; }
.tab svg { width: 26px; height: 26px; }
.tab.active { color: var(--blue); }

@media (min-width: 1024px) {
  .app { display: grid; grid-template-columns: 260px 1fr; }
  .sidebar { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; padding: 18px 12px;
    background: var(--bg2); border-right: .5px solid var(--sep); }
  .sidebar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; padding: 6px 10px 18px; }
  .sidebar .brand img { width: 34px; height: 34px; border-radius: 9px; }
  .side-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--label);
    font-size: 16px; font-weight: 500; border: 0; background: none; cursor: pointer; text-align: left; }
  .side-item svg { width: 22px; height: 22px; color: var(--blue); }
  .side-item:hover { background: var(--fill); }
  .side-item.active { background: var(--blue); color: #fff; }
  .side-item.active svg { color: #fff; }
  .sidebar .side-foot { margin-top: auto; padding: 10px; font-size: 13px; color: var(--label2); }
  .tabbar { display: none; }
  .main { padding-bottom: 40px; width: 100%; }
  .large-title { margin-top: 18px; }
}

/* ---------------------------------------------------------------- controls */
.seg { display: inline-flex; background: var(--fill); border-radius: 9px; padding: 2px; position: relative; }
.seg button { border: 0; background: none; padding: 5px 14px; border-radius: 7px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--label); min-width: 60px; }
.seg button.on { background: var(--bg2); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04); }
:root[data-theme="dark"] .seg button.on, .dark-seg .seg button.on { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button.on { background: #636366; } }
.seg.live-on button.on.live { background: var(--red); color: #fff; }
.seg.wide { display: flex; } .seg.wide button { flex: 1; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px; padding: 12px 18px;
  font-weight: 600; font-size: 17px; cursor: pointer; background: var(--blue); color: #fff; }
.btn.secondary { background: var(--fill); color: var(--blue); }
.btn.danger { background: var(--red); }
.btn.small { padding: 7px 14px; font-size: 15px; border-radius: 18px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--fill); color: var(--blue); display: inline-grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 19px; height: 19px; }
.link-btn { border: 0; background: none; color: var(--blue); font-size: 17px; cursor: pointer; padding: 4px 0; }

.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--fill2); border-radius: 31px; transition: background .2s; }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16); transition: transform .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch.red input:checked + span { background: var(--red); }

.chip { border: 0; background: var(--fill); color: var(--label); border-radius: 16px; padding: 6px 12px; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--label); color: var(--bg2); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }

.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 10px; padding: 2px 8px; font-size: 12px; font-weight: 600; }
.pill.buy { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.pill.sell { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }
.pill.gray { background: var(--fill); color: var(--label2); }
.pill.blue { background: color-mix(in srgb, var(--blue) 16%, transparent); color: var(--blue); }
.pill.orange { background: color-mix(in srgb, var(--orange) 18%, transparent); color: var(--orange); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------------------------------------------------------------- grouped lists (iOS Settings style) */
.section { margin: 0 16px 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 7px; }
.section-head h2 { font-size: 20px; font-weight: 700; margin: 0; letter-spacing: 0; }
.section-head .link-btn { font-size: 15px; }
.section-note { font-size: 13px; color: var(--label2); margin: 7px 16px 0; line-height: 1.4; }
.group { background: var(--bg2); border-radius: var(--radius-m); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; min-height: 44px; position: relative; background: var(--bg2);
  width: 100%; border: 0; text-align: left; color: var(--label); }
.row + .row::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; border-top: .5px solid var(--sep); }
.row.icon-row + .row::before, .row.icon-row + .row.icon-row::before { left: 60px; }
button.row, a.row { cursor: pointer; }
button.row:active, a.row:active { background: var(--fill); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-size: 17px; }
.row .sub { font-size: 13px; color: var(--label2); margin-top: 1px; }
.row .value { color: var(--label2); text-align: right; }
.row .chev { color: var(--label3); width: 9px; height: 15px; flex: none; }
.row input[type=text], .row input[type=number], .row input[type=password], .row input[type=time], .row input[type=date], .row select {
  border: 0; background: transparent; text-align: right; color: var(--label2); outline: none; min-width: 0; max-width: 60%; font-size: 17px; }
.row input:focus { color: var(--label); }
.row textarea { width: 100%; border: 0; background: var(--fill); border-radius: 10px; padding: 10px; }
.row.stack { flex-direction: column; align-items: stretch; gap: 8px; }
.sym-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none; }
.sym-icon svg { width: 19px; height: 19px; }

/* coin avatar */
.coin { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; flex: none; letter-spacing: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.coin.sm { width: 30px; height: 30px; font-size: 10px; }

/* ---------------------------------------------------------------- home hero (Wallet-style card) */
.hero { margin: 0 16px 22px; border-radius: var(--radius-l); padding: 20px 20px 10px; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 100% 0%, var(--hero2) 0%, var(--hero1) 60%, #071a3d 100%); box-shadow: 0 18px 40px -22px rgba(10,61,145,.7); }
.hero.live { background: radial-gradient(120% 140% at 100% 0%, #FF5E3A 0%, #B3261E 58%, #5c120d 100%); box-shadow: 0 18px 40px -22px rgba(179,38,30,.7); }
.hero .h-top { display: flex; justify-content: space-between; align-items: center; font-size: 15px; opacity: .85; }
.hero .h-total { font-size: 44px; line-height: 1.05; font-weight: 700; letter-spacing: -0.02em; margin: 8px 0 4px; }
.hero .h-total small { font-size: 22px; font-weight: 600; opacity: .8; margin-left: 4px; }
.hero .h-line { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 15px; }
.hero .h-line b { font-weight: 600; }
.hero .h-chart { height: 120px; margin: 10px -8px 0; }
.hero .h-legend { display: flex; gap: 14px; font-size: 12px; opacity: .85; padding-bottom: 6px; }
.hero .h-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.hero .badge { background: rgba(255,255,255,.18); border-radius: 10px; padding: 3px 9px; font-size: 13px; font-weight: 600; }
.hero-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 16px 24px; }
.stat { background: var(--bg2); border-radius: var(--radius-m); padding: 12px 14px; }
.stat .k { font-size: 13px; color: var(--label2); }
.stat .v { font-size: 20px; font-weight: 700; margin-top: 2px; }

.regime { display: flex; gap: 12px; align-items: center; }
.regime .ring { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; }

@media (min-width: 1024px) {
  .home-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 0 8px; align-items: start; }
  .hero .h-chart { height: 170px; }
  .hero .h-total { font-size: 52px; }
}

/* ---------------------------------------------------------------- chart page */
.chart-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 16px 10px; flex-wrap: wrap; }
.coin-switch { display: flex; align-items: center; gap: 10px; border: 0; background: none; cursor: pointer; padding: 0; text-align: left; }
.coin-switch .cs-name { font-size: 28px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.coin-switch .cs-name svg { width: 14px; height: 14px; color: var(--label3); }
.price-line { font-size: 15px; }
.price-line b { font-size: 22px; margin-right: 6px; }
.chart-card { background: var(--bg2); margin: 0 16px 14px; border-radius: var(--radius-m); padding: 8px 4px 4px; position: relative; }
.chart-box { height: 56vh; min-height: 360px; max-height: 640px; }
.ohlc { position: absolute; left: 14px; top: 10px; z-index: 3; font-size: 12px; color: var(--label2); pointer-events: none; display: flex; gap: 8px; flex-wrap: wrap; }
.ohlc b { color: var(--label); font-weight: 600; }
.ind-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--label2); padding: 0 12px 6px; }
.ind-legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.toolbar { display: flex; gap: 10px; align-items: center; margin: 0 16px 12px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- trades */
.day-head { font-size: 13px; color: var(--label2); margin: 16px 20px 6px; font-weight: 600; }
.trade-row .amt { text-align: right; }
.trade-row .amt .t { font-weight: 600; }
.empty { text-align: center; color: var(--label2); padding: 40px 24px; }
.empty svg { width: 54px; height: 54px; color: var(--label3); margin-bottom: 10px; }
.empty .e-title { font-size: 20px; font-weight: 600; color: var(--label); margin-bottom: 6px; }

/* ---------------------------------------------------------------- sheets, toasts, dialogs */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 50; opacity: 0; transition: opacity .25s; }
.scrim.show { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: var(--bg); border-radius: 14px 14px 0 0; max-height: 92vh;
  display: flex; flex-direction: column; transform: translateY(100%); transition: transform .32s cubic-bezier(.2,.8,.2,1); padding-bottom: var(--safe-b); }
.sheet.show { transform: translateY(0); }
.sheet .grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--label3); margin: 6px auto 0; flex: none; }
.sheet .sheet-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px 6px; flex: none; }
.sheet .sheet-bar h3 { margin: 0; font-size: 17px; font-weight: 600; position: absolute; left: 50%; transform: translateX(-50%); }
.sheet .sheet-body { overflow-y: auto; padding: 8px 0 24px; -webkit-overflow-scrolling: touch; }
@media (min-width: 760px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 560px; border-radius: 16px; transform: translate(-50%, -46%) scale(.98); opacity: 0;
    transition: transform .25s, opacity .25s; max-height: 86vh; }
  .sheet.show { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  .sheet .grabber { display: none; }
}
.toast { position: fixed; left: 50%; top: calc(14px + var(--safe-t)); transform: translate(-50%, -140%); z-index: 60; background: var(--bg2);
  color: var(--label); border-radius: 22px; padding: 10px 18px; font-size: 15px; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,.18);
  transition: transform .35s cubic-bezier(.2,.8,.2,1); display: flex; gap: 8px; align-items: center; max-width: 92vw; }
.toast.show { transform: translate(-50%, 0); }
.toast.err { color: var(--red); }

/* ---------------------------------------------------------------- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .card { width: 100%; max-width: 380px; text-align: center; }
.login img { width: 86px; height: 86px; border-radius: 20px; box-shadow: 0 12px 30px -12px rgba(10,61,145,.6); }
.login h1 { font-size: 28px; margin: 18px 0 6px; }
.login p { color: var(--label2); margin: 0 0 22px; font-size: 15px; }
.login input { width: 100%; border: 0; background: var(--bg2); border-radius: 12px; padding: 14px 16px; font-size: 17px; margin-bottom: 12px; outline: none; }
.login .err { color: var(--red); font-size: 14px; min-height: 20px; margin-bottom: 8px; }

/* misc */
.bar-chart { display: flex; align-items: flex-end; gap: 3px; height: 110px; padding: 10px 16px 0; }
.bar-chart div { flex: 1; background: var(--fill2); border-radius: 3px 3px 0 0; position: relative; }
.bar-chart div.win { background: var(--blue); }
.bar-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--label2); padding: 4px 16px 10px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 15px; }
.kv dt { color: var(--label2); } .kv dd { margin: 0; text-align: right; }
.progress { height: 4px; border-radius: 2px; background: var(--fill); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--blue); border-radius: 2px; }
.rank-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.rank-table td { padding: 8px 16px; border-top: .5px solid var(--sep); }
.rank-table tr:first-child td { border-top: 0; }
.hide-m { display: none; }
@media (min-width: 760px) { .hide-m { display: initial; } .hide-d { display: none; } }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--fill2); border-top-color: var(--label2); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-pad { padding: 60px 0; display: grid; place-items: center; }
.banner { margin: 0 16px 16px; border-radius: var(--radius-m); padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 15px;
  background: color-mix(in srgb, var(--orange) 14%, var(--bg2)); }
.banner.red { background: color-mix(in srgb, var(--red) 14%, var(--bg2)); }
.banner svg { width: 20px; height: 20px; flex: none; margin-top: 1px; color: var(--orange); }
.banner.red svg { color: var(--red); }

/* chart overview: one card per coin */
.mini-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 0 16px 24px; }
@media (min-width: 760px) { .mini-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1500px) { .mini-grid { grid-template-columns: 1fr 1fr 1fr; } }
.mini-card { background: var(--bg2); border-radius: var(--radius-m); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.mini-card:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent); }
.mc-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px 4px; }
.mc-head .title { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.mc-head .sub { font-size: 13px; color: var(--label2); }
.mc-chart { height: 210px; margin: 0 2px; }
.mc-foot { display: flex; align-items: center; gap: 8px; padding: 10px 14px 12px; border: 0; border-top: .5px solid var(--sep); background: none;
  text-align: left; font-size: 13px; color: var(--label2); cursor: pointer; width: 100%; }
.mc-foot .mc-why { flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
.mc-foot .chev { margin-left: auto; }
.mc-foot .chev { width: 9px; height: 15px; flex: none; color: var(--label3); }
.mc-foot .pill { white-space: nowrap; flex: none; }
.pill { white-space: nowrap; }

/* documents */
.doc { max-width: 760px; margin: 0 16px 28px; font-size: 16px; line-height: 1.55; color: var(--label); }
@media (min-width: 1024px) { .doc { margin-left: 16px; } }
.doc h2 { font-size: 22px; line-height: 1.25; margin: 30px 0 10px; letter-spacing: 0; scroll-margin-top: 70px; }
.doc h3 { font-size: 17px; margin: 22px 0 8px; }
.doc p { margin: 0 0 12px; }
.doc code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .88em; background: var(--fill); padding: 1px 5px; border-radius: 5px; }
.doc .md-pre { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; line-height: 1.5; background: var(--bg2); border-radius: var(--radius-s);
  padding: 12px 14px; overflow-x: auto; margin: 0 0 14px; }
.doc .md-list { margin: 0 0 14px; padding-left: 22px; }
.doc .md-list li { margin: 4px 0; }
.doc .md-list .md-list { margin: 4px 0 0; }
.doc .md-callout { background: color-mix(in srgb, var(--blue) 10%, var(--bg2)); border-radius: var(--radius-m); padding: 14px 16px; margin: 0 0 18px; }
.md-table-wrap { overflow-x: auto; margin: 0 0 16px; border-radius: var(--radius-m); background: var(--bg2); }
.md-table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
.md-table th { text-align: left; font-weight: 600; color: var(--label2); font-size: 13px; padding: 10px 12px; border-bottom: .5px solid var(--sep); white-space: nowrap; }
.md-table td { padding: 9px 12px; border-top: .5px solid var(--sep); vertical-align: top; }
.md-table tbody tr:first-child td { border-top: 0; }
.md-table td:first-child { color: var(--label); }
.doc-toc { padding-bottom: 14px; }
.doc-toc .chip { text-decoration: none; }
.doc-live .group { margin-top: 6px; }
.rank-chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* split view: one chart per strategy */
.split-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 0 16px 14px; }
.split-grid .chart-card { margin: 0; min-width: 0; }
@media (min-width: 1100px) { .split-grid { grid-template-columns: 1fr 1fr; } }
.split-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px 4px; font-size: 15px; flex-wrap: wrap; }
.split-head .muted { font-size: 13px; }
.chart-box.split { height: 46vh; min-height: 320px; }
.split-card .ohlc { position: static; padding: 0 10px 2px; }
.split-sum { min-width: 0; flex: 1 1 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 759px) { .split-sum { display: none; } }

/* home: top-20 market cap list */
.uni-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: .5px solid var(--sep); }
.uni-cell { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 0; background: none; text-align: left; cursor: pointer;
  border-bottom: .5px solid var(--sep); min-width: 0; color: var(--label); font-size: 15px; }
.uni-cell:nth-child(odd) { border-right: .5px solid var(--sep); }
.uni-cell .uni-rank { width: 20px; color: var(--label2); font-size: 13px; flex: none; }
.uni-cell .uni-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.uni-cell .uni-cap { color: var(--label2); font-size: 13px; flex: none; }
.uni-cell.held { background: color-mix(in srgb, var(--blue) 10%, transparent); }
.uni-cell:active { background: var(--fill); }
@media (max-width: 520px) { .uni-cell .coin { display: none; } .uni-cell { padding: 9px 10px; gap: 6px; } }

/* alerts badge + page */
.tab-ic { position: relative; display: inline-flex; }
.badge { position: absolute; top: -4px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px var(--bar); }
.badge.warn { background: var(--orange); }
.badge[hidden] { display: none; }
.side-item .badge { position: static; margin-left: auto; box-shadow: none; }
.side-item.active .badge { background: #fff; color: var(--red); }
.alert-row { align-items: flex-start; }
.alert-row .alert-ic { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.alert-row .alert-ic svg { width: 22px; height: 22px; }
.alert-row .alert-msg { font-size: 15px; line-height: 1.4; }
.alert-row.unread { background: color-mix(in srgb, var(--blue) 6%, var(--bg2)); }
@media (max-width: 420px) { .tab { font-size: 9.5px; } .tab svg { width: 24px; height: 24px; } }
.line-preview { white-space: pre-wrap; font-family: var(--font); font-size: 15px; line-height: 1.45; background: var(--bg2); border-radius: var(--radius-m); padding: 14px 16px; margin: 0; }
