/* Grok Bot desk app. Black iOS look. No neon, glow, double borders or gradients on cards. */
:root {
  --bg: #000;
  --text: #fff;
  --text2: rgba(235, 235, 245, 0.6);
  --text3: rgba(235, 235, 245, 0.3);
  --sep: rgba(84, 84, 88, 0.55);
  --card: #1c1c1e;
  --card2: #2c2c2e;
  --green: #00d35a;
  --red: #ff453a;
  --orange: #ff9f0a;
  --cyan: #64d2ff;
  --blue: #0a84ff;
  --yellow: #ffd60a;
  --pink: #ff6b9a;
  --purple: #bf5af2;
  --gutter: 16px;
  --tabbar-h: 52px;
  --kb: 0px;
  --f-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --f-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --f-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: #000; color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.35 var(--f-text);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
body.pane-open { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; min-height: 44px; min-width: 44px; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
ol, ul { list-style: none; margin: 0; padding: 0; }
svg.i { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }

#app { max-width: 560px; margin: 0 auto; min-height: 100vh; position: relative; }
.tab { display: none; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 36px + var(--kb)); }
.tab.on { display: block; }

/* ---------- skeletons ---------- */
@keyframes pulse { from { opacity: 0.5; } to { opacity: 1; } }
.is-loading { background: var(--card) !important; color: transparent !important; border-radius: 14px; animation: pulse 1.2s ease-in-out infinite alternate; pointer-events: none; }
.is-loading * { visibility: hidden; }
.is-loading canvas { display: none; }

/* ---------- top bars ---------- */
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(0, 0, 0, 0.72); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); padding-top: env(safe-area-inset-top); }
.nav { display: flex; align-items: center; height: 52px; padding: 0 4px 0 12px; gap: 2px; }
.nav h1 { font: 700 28px/1 var(--f-display); letter-spacing: -0.02em; padding-left: 4px; }
.nav .grow { flex: 1; }
.nav .avatar { width: 44px; height: 44px; display: grid; place-items: center; }
.nav .avatar span { width: 32px; height: 32px; border-radius: 50%; background: var(--card2); display: grid; place-items: center; font-weight: 600; font-size: 14px; color: var(--text); }
.nav .avatar svg { width: 18px; height: 18px; color: var(--text2); }
.nav .title { display: inline-flex; align-items: center; height: 44px; padding: 0 4px; font: 600 17px var(--f-text); gap: 2px; }
.nav .title svg { width: 16px; height: 16px; color: var(--text3); }
.nav .ib { width: 44px; height: 44px; display: grid; place-items: center; position: relative; color: var(--text); }
.nav .ib .dotbadge { position: absolute; top: 10px; right: 10px; width: 9px; height: 9px; background: var(--red); border-radius: 50%; }
.offline { background: var(--red); color: #fff; font-size: 13px; font-weight: 600; padding: 7px 16px; text-align: center; }

/* ---------- odometer ---------- */
.od { display: inline-flex; font-family: var(--f-display); font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.od-col { position: relative; display: inline-block; height: 1em; overflow: hidden; vertical-align: top; }
.od-ghost { visibility: hidden; display: block; height: 1em; line-height: 1; }
.od-strip { position: absolute; left: 0; top: 0; transition: transform 600ms ease-out; will-change: transform; }
.od-strip i { display: block; height: 1em; line-height: 1; font-style: normal; text-align: center; }
.od-ch { display: inline-block; height: 1em; line-height: 1; vertical-align: top; }
@media (prefers-reduced-motion: reduce) { .od-strip { transition: none !important; } }

/* ---------- home hero ---------- */
.hero { padding: 6px 16px 0; }
.bal-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 66px; }
.od-big { font-size: 88px; }
.badge-paper { font: 700 12px var(--f-text); letter-spacing: 0.02em; color: #000; background: var(--orange); border-radius: 999px; padding: 4px 10px; align-self: center; }
.sub-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; min-height: 32px; }
.today { font: 600 17px var(--f-text); min-width: 80px; }
.pos { color: var(--green); } .neg { color: var(--red); } .mute { color: var(--text2); }
.pill-mult { display: inline-flex; align-items: center; height: 28px; padding: 0 11px; border-radius: 999px; background: rgba(0, 211, 90, 0.16); color: var(--green); font-size: 15px; font-weight: 600; }
.pill-mult.down { background: rgba(255, 69, 58, 0.16); color: var(--red); }
.pill-mult .od { font-family: var(--f-text); letter-spacing: 0; }

/* ---------- chart ---------- */
.chart-wrap { position: relative; height: 230px; margin: 10px 0 0; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; touch-action: pan-y; }
.chart-wrap.is-loading { margin: 10px 16px 0; border-radius: 16px; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text2); font-size: 15px; }
.ranges { display: flex; justify-content: space-between; padding: 0 10px; margin-top: 4px; }
.ranges button { flex: 1; height: 44px; display: grid; place-items: center; }
.ranges button span { padding: 5px 11px; border-radius: 999px; font: 600 13px var(--f-text); color: var(--text2); }
.ranges button.on span { background: var(--card); color: var(--green); }

/* ---------- live screen ---------- */
.live-card { position: relative; margin: 12px 16px 0; aspect-ratio: 16 / 9; border-radius: 22px; overflow: hidden; background: var(--card); cursor: pointer; }
.live-card .frame { position: absolute; inset: 0; }
.frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.frame img.front { opacity: 1; }
.frame-empty { position: absolute; inset: 0; display: none; place-items: center; color: var(--text2); font-size: 14px; }
.frame.empty .frame-empty { display: grid; }
.chip { position: absolute; top: 10px; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 14px; background: rgba(0, 0, 0, 0.62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font: 600 12px var(--f-text); white-space: nowrap; }
.chip.l { left: 10px; } .chip.r { right: 10px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text3); display: inline-block; flex: none; }
.dot.live { background: var(--red); animation: pulse 1.2s ease-in-out infinite alternate; }
.live-paused { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.82); color: var(--text2); font-weight: 600; font-size: 15px; }
.order-line { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 12px 16px 0; font-size: 14px; }
.order-line .ot { color: var(--text); }
.order-line.none .ot { color: var(--text2); }
.checks { display: inline-flex; gap: 8px; flex: none; }
.chk { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text2); }
.chk svg { width: 14px; height: 14px; stroke-width: 2.4; }
.chk.ok svg { color: var(--green); } .chk.bad svg { color: var(--red); } .chk.na svg { color: var(--text3); }

/* ---------- sections ---------- */
.sec { display: flex; align-items: center; justify-content: space-between; padding: 0 16px; margin: 22px 0 4px; min-height: 44px; }
.sec h2 { font: 700 20px var(--f-display); letter-spacing: -0.01em; }
.sec h2 em { font-style: normal; color: var(--text2); font-weight: 500; }
.sec .link { color: var(--blue); font-size: 15px; height: 44px; padding: 0 0 0 12px; }

.carousel { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 16px 4px; scroll-padding: 0 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.carousel::-webkit-scrollbar { display: none; }
.bot-card { flex: 0 0 min(78%, 300px); scroll-snap-align: start; background: var(--card); border-radius: 20px; padding: 16px; min-height: 212px; display: flex; flex-direction: column; }
.bc-head { display: flex; align-items: center; gap: 8px; }
.bc-name { font-weight: 600; font-size: 15px; }
.bc-state { margin-left: auto; color: var(--text2); font-size: 13px; }
.bc-big { font: 700 26px var(--f-display); letter-spacing: -0.02em; margin: 10px 0 10px; }
.feed li { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; padding: 5px 0; min-height: 30px; align-items: center; }
.feed .sym { font-weight: 600; }
.feed .k .sym { color: var(--text3); text-decoration: line-through; text-decoration-color: var(--red); }
.feed .k .why { color: var(--red); font-size: 13px; text-align: right; }
.feed .p .sym { color: var(--text); } .feed .p .why { color: var(--cyan); font-weight: 600; }
.feed .w .sym { color: var(--text2); } .feed .w .why { color: var(--text3); }
.an-top { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.an-top .soc { font-size: 14px; color: var(--text2); } .an-top .soc b { color: var(--yellow); font-weight: 600; }
.strips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.strip { height: 32px; border-radius: 9px; background: var(--card2); display: flex; align-items: center; justify-content: center; gap: 4px; font: 600 11px var(--f-mono); color: var(--text3); }
.strip svg { width: 12px; height: 12px; stroke-width: 2.6; }
.strip.ok { background: rgba(0, 211, 90, 0.16); color: var(--green); }
.strip.red { background: rgba(255, 69, 58, 0.18); color: var(--red); }
.strip.running { background: rgba(255, 214, 10, 0.16); color: var(--yellow); animation: pulse 1.2s ease-in-out infinite alternate; }
.rule-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pill { font: 600 12px var(--f-mono); padding: 6px 10px; border-radius: 999px; background: var(--card2); color: var(--text3); white-space: nowrap; }
.pill.on { background: rgba(191, 90, 242, 0.2); color: var(--purple); }
.pill.red { background: rgba(255, 69, 58, 0.18); color: var(--red); }
.pill.green { background: rgba(0, 211, 90, 0.16); color: var(--green); }
.size-line { font: 600 20px var(--f-display); }
.bar { height: 42px; border-radius: 12px; background: var(--card2); display: flex; align-items: center; gap: 8px; padding: 0 14px; font-size: 14px; color: var(--text2); margin-top: 4px; }
.bar.busy { color: var(--text); animation: pulse 1.2s ease-in-out infinite alternate; }
.bar.done { color: var(--green); font-weight: 600; }
.bar svg { width: 16px; height: 16px; stroke-width: 2.4; }
.bar-sym { margin-top: 10px; color: var(--text2); font-size: 13px; }

/* ---------- lists ---------- */
.rows { margin: 0 16px; background: var(--card); border-radius: 18px; overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 8px 2px 8px 14px; min-height: 64px; cursor: pointer; }
.row + .row { border-top: 0.5px solid var(--sep); }
.row .ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--card2); flex: none; }
.row .ic svg { width: 18px; height: 18px; stroke-width: 2.2; }
.ic-bought { color: var(--blue); } .ic-sold { color: var(--green); } .ic-stopped { color: var(--red); } .ic-rejected { color: var(--text2); }
.row .rt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row .rt b { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .rt small { color: var(--text2); font-size: 13px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row .rv { display: flex; flex-direction: column; align-items: flex-end; max-width: 36%; flex: none; text-align: right; }
.row .rv b { font-weight: 600; font-size: 15px; }
.row .rv small { font-size: 12px; font-weight: 500; opacity: 0.8; }
.row .ext { width: 44px; height: 44px; display: grid; place-items: center; color: var(--text3); flex: none; }
.row .ext svg { width: 18px; height: 18px; }
.row.sk-row { min-height: 64px; margin-bottom: 0; border-radius: 0; }
.empty { padding: 36px 16px; text-align: center; color: var(--text2); font-size: 15px; }
.more-btn { display: block; width: calc(100% - 32px); margin: 12px 16px 0; height: 44px; border-radius: 14px; background: var(--card); color: var(--text2); font-weight: 600; }

/* ---------- bots tab ---------- */
.card { background: var(--card); border-radius: 20px; margin: 12px 16px 0; padding: 14px 16px; }
.botc-head { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.botc-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.botc-title b { font-size: 17px; font-weight: 600; }
.botc-title small { color: var(--text2); font-size: 13px; }
.botc-count { text-align: right; }
.botc-count b { display: block; font: 700 22px var(--f-display); line-height: 1.1; }
.botc-count small { color: var(--text2); font-size: 12px; }
.sw { width: 51px; height: 44px; position: relative; flex: none; }
.sw::before { content: ""; position: absolute; left: 0; top: 6.5px; width: 51px; height: 31px; border-radius: 16px; background: #39393d; transition: background 0.2s; }
.sw::after { content: ""; position: absolute; left: 2px; top: 8.5px; width: 27px; height: 27px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.sw[aria-checked="true"]::before { background: var(--green); }
.sw[aria-checked="true"]::after { transform: translateX(20px); }
.sw[disabled] { opacity: 0.4; cursor: default; }
.botc-lock { display: flex; align-items: center; gap: 6px; color: var(--text2); font-size: 13px; padding: 0 0 6px; }
.botc-lock svg { width: 14px; height: 14px; }
.dec { margin-top: 4px; border-top: 0.5px solid var(--sep); }
.dec li { display: flex; gap: 10px; align-items: center; padding: 0; font-size: 14px; min-height: 48px; }
.dec li + li { border-top: 0.5px solid var(--sep); }
.dec .t { color: var(--text3); font: 500 12px var(--f-mono); width: 40px; flex: none; }
.dec .x { flex: 1; min-width: 0; }
.dec .x button { display: inline-flex; align-items: center; min-height: 44px; min-width: 0; font-weight: 600; padding: 0 4px 0 0; vertical-align: middle; }
.dec .ext { width: 44px; height: 44px; display: grid; place-items: center; color: var(--text3); }
.dec .ext svg { width: 16px; height: 16px; }
.linkrow { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; }
.linkbtn { color: var(--blue); font-size: 15px; height: 44px; padding: 0; }
.dec-empty { color: var(--text2); font-size: 14px; padding: 12px 0 6px; border-top: 0.5px solid var(--sep); margin-top: 4px; }

/* ---------- panes (coin, audit, live) ---------- */
.pane { position: fixed; inset: 0; z-index: 30; background: #000; overflow-y: auto; transition: transform 0.25s ease-out; }
.pane.enter, .pane.leave { transform: translateX(100%); }
.pane-in { max-width: 560px; margin: 0 auto; padding-bottom: calc(env(safe-area-inset-bottom) + 40px + var(--kb)); min-height: 100%; }
.pane-bar { display: flex; align-items: center; height: 52px; padding: 0 12px 0 4px; }
.pane-bar .back { width: 44px; height: 44px; display: grid; place-items: center; }
.pane-bar .grow { flex: 1; }
.pane .topbar { background: rgba(0, 0, 0, 0.8); }
@media (prefers-reduced-motion: reduce) { .pane, .sheet, .sheet-back { transition: none !important; } }

.c-head { padding: 4px 16px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.c-head h1 { font: 700 28px/1.15 var(--f-display); letter-spacing: -0.02em; }
.c-sub { color: var(--text2); font-size: 15px; margin-top: 4px; }
.shield { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 10px; border-radius: 16px; background: rgba(0, 211, 90, 0.16); color: var(--green); font: 600 14px var(--f-text); flex: none; margin-top: 4px; }
.shield svg { width: 16px; height: 16px; stroke-width: 2.2; }
.shield.bad { background: rgba(255, 69, 58, 0.18); color: var(--red); }
.c-price { padding: 14px 16px 0; }
.c-price .p { font: 600 44px/1.05 var(--f-display); letter-spacing: -0.03em; }
.c-price .s { margin-top: 6px; font-size: 16px; font-weight: 600; min-height: 22px; }
.c-chart { position: relative; height: 250px; margin-top: 10px; }
.c-chart canvas { width: 100%; height: 100%; display: block; touch-action: pan-y; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 14px 16px 0; background: var(--card); border-radius: 18px; }
.stats div { padding: 14px 14px; }
.stats div + div { border-left: 0.5px solid var(--sep); }
.stats small { display: block; color: var(--text2); font-size: 12px; margin-bottom: 4px; }
.stats b { font: 600 17px var(--f-text); }
.posbox { margin: 12px 16px 0; background: var(--card); border-radius: 18px; padding: 14px 16px; display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.posbox span:first-child { color: var(--text2); }
.btn-row { display: flex; gap: 12px; margin: 16px 16px 0; }
.btn { flex: 1; height: 50px; border-radius: 14px; font: 600 16px var(--f-text); display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--card2); color: var(--text); }
.btn svg { width: 18px; height: 18px; stroke-width: 2.2; }
.btn.red { background: var(--red); color: #fff; }
.btn.green { background: var(--green); color: #000; }
.btn[disabled] { opacity: 0.4; cursor: default; }
.btn.block { width: calc(100% - 32px); margin: 16px 16px 0; display: flex; }

/* audit */
.a-stack { margin: 14px 16px 0; background: var(--card); border-radius: 22px; padding: 14px 0 10px; position: relative; }
.a-stack svg { display: block; width: 100%; height: auto; }
.a-sum { display: flex; align-items: center; gap: 14px; margin: 12px 16px 0; }
.a-list { margin: 12px 16px 0; background: var(--card); border-radius: 18px; overflow: hidden; }
.a-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 56px; }
.a-row + .a-row { border-top: 0.5px solid var(--sep); }
.a-row .n { width: 28px; height: 28px; border-radius: 50%; background: var(--card2); display: grid; place-items: center; font: 600 12px var(--f-mono); color: var(--text3); flex: none; transition: background 0.2s, color 0.2s; }
.a-row .n svg { width: 15px; height: 15px; stroke-width: 2.6; }
.a-row.ok .n { background: rgba(0, 211, 90, 0.18); color: var(--green); }
.a-row.red .n { background: rgba(255, 69, 58, 0.2); color: var(--red); }
.a-row .nm { flex: 1; min-width: 0; }
.a-row .nm b { font-weight: 600; font-size: 15px; display: block; }
.a-row .nm small { color: var(--text2); font-size: 12px; }
.a-row .val { font-weight: 600; font-size: 14px; text-align: right; max-width: 48%; opacity: 0; transition: opacity 0.2s; }
.a-row.done .val { opacity: 1; }
.a-row.ok .val { color: var(--green); } .a-row.red .val { color: var(--red); }
.a-row.grey .val { color: var(--text3); }
.a-soc { margin: 12px 16px 0; background: var(--card); border-radius: 18px; padding: 14px 16px; font-size: 15px; }
.a-soc b { color: var(--yellow); }
.a-reason { margin: 12px 16px 0; background: rgba(255, 69, 58, 0.14); color: var(--red); border-radius: 18px; padding: 14px 16px; font-weight: 600; font-size: 15px; }

/* full screen live */
.pane.live { background: #000; }
.zoom { position: absolute; inset: 0; overflow: hidden; touch-action: none; display: grid; place-items: center; }
.zoom .frame { position: relative; width: min(100vw, calc(100vh * 16 / 9)); aspect-ratio: 16 / 9; transform-origin: 0 0; }
.zoom .frame img { object-fit: contain; }
.live-top { position: absolute; left: 0; right: 0; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; padding: calc(env(safe-area-inset-top) + 8px) calc(env(safe-area-inset-right) + 10px) 0 calc(env(safe-area-inset-left) + 6px); pointer-events: none; }
.live-top > * { pointer-events: auto; }
.live-top .rb { width: 44px; height: 44px; border-radius: 22px; background: rgba(0, 0, 0, 0.62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); display: grid; place-items: center; }
.live-top .rb svg { width: 20px; height: 20px; }
.live-top .ofm { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px; border-radius: 22px; background: rgba(0, 0, 0, 0.62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font-weight: 600; font-size: 14px; }
.live-top .ofm svg { width: 16px; height: 16px; }
.live-bot { position: absolute; left: calc(env(safe-area-inset-left) + 10px); bottom: calc(env(safe-area-inset-bottom) + 14px); z-index: 3; }

/* ---------- account ---------- */
.group-title { padding: 0 32px; margin: 24px 0 8px; color: var(--text2); font-size: 13px; }
.lst { margin: 0 16px; background: var(--card); border-radius: 18px; overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 0 16px; min-height: 56px; width: 100%; text-align: left; }
.item + .item { border-top: 0.5px solid var(--sep); }
.item .l { flex: 1; min-width: 0; }
.item .l small { display: block; color: var(--text2); font-size: 12px; }
.item .r { color: var(--text2); font-size: 15px; display: flex; align-items: center; gap: 6px; }
.item .r svg { width: 18px; height: 18px; }
.item.col { flex-direction: column; align-items: stretch; padding: 12px 16px; gap: 8px; }
.item .lead { width: 30px; height: 30px; border-radius: 8px; background: var(--card2); display: grid; place-items: center; flex: none; }
.item .lead svg { width: 17px; height: 17px; }
.seg { display: flex; background: var(--card2); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { flex: 1; height: 44px; min-height: 44px; border-radius: 10px; font: 600 14px var(--f-text); color: var(--text2); }
.seg button.on { background: #636366; color: #fff; }
.seg.mode button.on[data-v="PAPER"] { background: var(--orange); color: #000; }
.seg.mode button.on[data-v="LIVE"] { background: var(--red); color: #fff; }
.stat-ok { color: var(--green); } .stat-no { color: var(--text2); }
.sgroup { margin: 12px 16px 0; background: var(--card); border-radius: 18px; overflow: hidden; }
.sg-head { display: flex; align-items: center; gap: 10px; width: 100%; height: 56px; padding: 0 16px; font: 600 16px var(--f-text); text-align: left; }
.sg-head .grow { flex: 1; }
.sg-head svg.chev { width: 18px; height: 18px; color: var(--text3); transition: transform 0.2s; }
.sgroup.open .sg-head svg.chev { transform: rotate(90deg); }
.sg-body { display: none; border-top: 0.5px solid var(--sep); }
.sgroup.open .sg-body { display: block; }
.set { padding: 12px 16px 10px; }
.set + .set { border-top: 0.5px solid var(--sep); }
.set-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.set-top label { font-size: 15px; flex: 1; min-width: 0; }
.set-top small { display: block; color: var(--text3); font-size: 11px; font-family: var(--f-mono); }
.num { width: 104px; height: 44px; border-radius: 10px; background: var(--card2); color: #fff; border: 0; text-align: right; padding: 0 10px; font: 600 15px var(--f-mono); }
.txt { width: 160px; height: 44px; border-radius: 10px; background: var(--card2); color: #fff; border: 0; padding: 0 10px; font: 500 14px var(--f-text); }
.num:focus, .txt:focus, .inp:focus, select:focus { outline: 2px solid var(--blue); outline-offset: 0; }
.set .rng { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.set .rng span { font: 500 11px var(--f-mono); color: var(--text3); min-width: 28px; }
.set .rng span:last-child { text-align: right; }
.set .err { color: var(--red); font-size: 12px; margin-top: 4px; }
input[type="range"] { -webkit-appearance: none; appearance: none; flex: 1; height: 32px; background: transparent; margin: 0; min-width: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--ac, #fff) var(--pct, 0%), #3a3a3c var(--pct, 0%)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; margin-top: -11px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: #3a3a3c; }
input[type="range"]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 0; }
select, .inp { background: var(--card2); color: #fff; border: 0; border-radius: 10px; height: 44px; padding: 0 10px; font: 500 15px var(--f-text); }
.inp { width: 100%; height: 48px; font-size: 17px; border-radius: 12px; padding: 0 14px; }
.hint { color: var(--text2); font-size: 13px; padding: 8px 16px 0; }
.hint.err { color: var(--red); }

/* ---------- tab bar ---------- */
#tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(28, 28, 30, 0.72); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); border-top: 0.5px solid var(--sep); padding-bottom: env(safe-area-inset-bottom); }
#tabbar .in { max-width: 560px; margin: 0 auto; display: flex; height: var(--tabbar-h); }
#tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text3); font: 500 10px var(--f-text); min-height: 44px; }
#tabbar button svg { width: 26px; height: 26px; }
#tabbar button.on { color: var(--text); }
body.has-live #tabbar { display: none; }

/* ---------- sheets, toast ---------- */
.sheet-back { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.5); opacity: 0; transition: opacity 0.2s; }
.sheet-back.on { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: var(--kb); z-index: 51; max-width: 560px; margin: 0 auto; background: var(--card); border-radius: 22px 22px 0 0; padding: 8px 16px calc(env(safe-area-inset-bottom) + 20px); transform: translateY(105%); transition: transform 0.25s ease-out; max-height: 88vh; overflow-y: auto; }
.sheet.on { transform: translateY(0); }
.grab { width: 36px; height: 5px; border-radius: 3px; background: #48484a; margin: 4px auto 14px; }
.sheet h3 { font: 700 20px var(--f-display); margin-bottom: 6px; }
.sheet p { color: var(--text2); font-size: 15px; margin-bottom: 14px; }
.sheet .seg { margin-bottom: 14px; }
.sheet .btn { width: 100%; margin-top: 10px; }
.sheet .results .r { display: flex; align-items: center; justify-content: space-between; min-height: 52px; border-top: 0.5px solid var(--sep); width: 100%; text-align: left; }
.sheet .results .r small { color: var(--text2); font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 18px + var(--kb)); transform: translate(-50%, 12px); background: var(--card2); color: #fff; font-size: 14px; font-weight: 500; padding: 11px 16px; border-radius: 14px; z-index: 60; opacity: 0; transition: opacity 0.2s, transform 0.2s; max-width: calc(100vw - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--red); }
body.has-live .toast { bottom: calc(env(safe-area-inset-bottom) + 24px); }

/* auth gate */
.gate { position: fixed; inset: 0; z-index: 90; background: #000; display: grid; place-items: center; padding: 32px; text-align: center; }
.gate h1 { font: 700 28px var(--f-display); margin-bottom: 10px; }
.gate p { color: var(--text2); max-width: 300px; margin: 0 auto 18px; }
.gate .btn { max-width: 240px; margin: 0 auto; flex: none; }

@media (min-width: 700px) { .sheet { border-radius: 22px; bottom: calc(var(--kb) + 24px); } }

/* ---------- copy picks ---------- */
.pk-count { display: flex; justify-content: space-between; align-items: center; padding: 6px 16px 0; font-size: 15px; font-weight: 600; min-height: 32px; }
.pk-count .mute { font-weight: 500; font-size: 13px; }
.pk-error { margin: 10px 16px 0; padding: 12px 14px; border-radius: 14px; background: rgba(255, 69, 58, 0.14); color: var(--red); font-size: 14px; font-weight: 600; }
.pk-refresh { color: var(--blue); font-size: 15px; display: inline-flex; align-items: center; gap: 8px; padding: 0 4px 0 12px; flex: none; margin-top: -2px; }
.pk-refresh[disabled] { color: var(--text2); cursor: default; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--card2); border-top-color: var(--text2); display: inline-block; animation: spin 0.8s linear infinite; }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; border-color: var(--text2); border-bottom-color: var(--card2); } }
.pcard { background: var(--card); border-radius: 20px; margin: 12px 16px 0; padding: 12px 16px 4px; }
.pcard.is-loading { height: 244px; padding: 0; }
.pk-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
.pk-h { min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.pk-h b { font: 700 19px var(--f-display); letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-h small { color: var(--text3); font-size: 13px; }
.pk-btn { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border-radius: 22px; background: var(--card2); font-weight: 600; font-size: 14px; flex: none; white-space: nowrap; }
.pk-btn svg { width: 15px; height: 15px; stroke-width: 2.2; }
.pk-pnl-row { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 2px; }
.pk-pnl { font: 700 20px var(--f-display); letter-spacing: -0.01em; }
.pk-pnl.pos { color: var(--green); } .pk-pnl.neg { color: var(--red); } .pk-pnl.mute { color: var(--text2); }
.pk-meta { color: var(--text2); font-size: 13px; margin-top: 6px; }
.pk-buy { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--card2); border-radius: 14px; padding: 4px 4px 4px 14px; margin-top: 12px; min-height: 52px; }
.pk-bl { min-width: 0; font-size: 15px; }
.pk-sym { font-weight: 700; }
button.pk-sym { min-height: 44px; min-width: 0; display: inline-flex; align-items: center; padding: 0; color: var(--text); font-size: 15px; }
.pk-at { color: var(--text2); }
.pk-why { color: var(--text2); font-size: 14px; margin: 12px 0 0; }
.pk-sw { display: flex; align-items: center; justify-content: space-between; border-top: 0.5px solid var(--sep); margin-top: 10px; min-height: 52px; }
.pk-sw span { font-weight: 600; font-size: 15px; }
.pk-err { color: var(--red); font-size: 13px; font-weight: 500; padding: 0 0 12px; }
.pk-notes { margin: 14px 16px 0; padding: 0 16px; }
.pk-notes p { color: var(--text2); font-size: 14px; margin: 0 0 4px; }
.pk-sec { padding: 0 32px; margin: 26px 0 8px; color: var(--text2); font-size: 13px; }
.pk-drop { margin: 0 16px; }
.pk-drop li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 16px; color: var(--text3); font-size: 14px; }
.pk-drop li b { color: var(--text2); font-weight: 500; }
.pk-foot { margin: 22px 16px 0; padding: 0 16px; color: var(--text2); font-size: 14px; overflow-wrap: anywhere; }
.pk-foot a { color: var(--blue); display: inline-flex; align-items: center; min-height: 44px; }
.pk-hrow { display: flex; gap: 12px; padding: 12px 16px; font-size: 14px; }
.pk-hrow + .pk-hrow { border-top: 0.5px solid var(--sep); }
.pk-hrow .d { flex: none; width: 84px; color: var(--text2); font-size: 13px; padding-top: 1px; }
.pk-hrow .hs { flex: 1; min-width: 0; line-height: 1.5; }
.pk-hrow .hs b { color: var(--text); font-weight: 600; }
.pk-hrow .hs i { color: var(--text3); font-style: normal; }
.pk-legend { color: var(--text3); font-size: 12px; padding: 8px 32px 0; }
.empty small { display: block; margin-top: 6px; font-size: 13px; color: var(--text3); }
