/* ==========================================================================
   IDX AI MARKET ROBOT — design system
   Dark terminal by default, light theme via [data-theme="light"],
   colour-blind-safe up/down palette via [data-cvd="1"].
   ========================================================================== */

:root {
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --r-sm: 6px; --r: 10px; --r-lg: 14px; --r-xl: 18px;
  --sidebar-w: 236px; --topbar-h: 58px; --bottom-nav-h: 66px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: dark;
  --bg: #0a0e13;
  --surface: #10161d;
  --surface-2: #141c25;
  --surface-3: #1a2430;
  --border: #1f2a36;
  --border-strong: #2c3b4c;
  --text: #e7edf3;
  --text-2: #a8b5c2;
  --muted: #6e8092;
  --grid: #1b2530;
  --accent: #3987e5;
  --accent-strong: #5aa0f0;
  --accent-soft: rgba(57, 135, 229, .15);
  --up: #1fbf6a;
  --down: #f04b4b;
  --up-soft: rgba(31, 191, 106, .14);
  --down-soft: rgba(240, 75, 75, .14);
  --warn: #f5a524;
  --warn-soft: rgba(245, 165, 36, .15);
  --info: #38bdf8;
  --info-soft: rgba(56, 189, 248, .14);
  --ai: #a293ff;
  --ai-soft: rgba(162, 147, 255, .15);
  --neutral: #8b98a7;
  --neutral-soft: rgba(139, 152, 167, .14);
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --sig-strong-buy: #12c77e; --sig-buy: #35d27a; --sig-watch: #f5a524; --sig-hold: #8b98a7;
  --sig-reduce: #f28c38; --sig-sell: #f04b4b; --sig-avoid: #e0603a; --sig-conflict: #a78bfa; --sig-stale: #6e8092;
  --chart-ema9: #3987e5; --chart-ema20: #d95926; --chart-ema50: #199e70; --chart-ema200: #9085e9;
  --chart-vwap: #c98500; --chart-bb: #d55181;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f6f8fa;
  --surface-3: #eef2f6;
  --border: #e1e6ec;
  --border-strong: #cbd3dd;
  --text: #0f1720;
  --text-2: #4a5663;
  --muted: #7a8794;
  --grid: #edf0f3;
  --accent: #2a78d6;
  --accent-strong: #1f63b6;
  --accent-soft: rgba(42, 120, 214, .10);
  --up: #0a8a4a;
  --down: #d12f2f;
  --up-soft: rgba(10, 138, 74, .10);
  --down-soft: rgba(209, 47, 47, .09);
  --warn: #b7791f;
  --warn-soft: rgba(245, 165, 36, .16);
  --info: #0b79b8;
  --info-soft: rgba(11, 121, 184, .10);
  --ai: #6b55e0;
  --ai-soft: rgba(107, 85, 224, .10);
  --neutral: #66727f;
  --neutral-soft: rgba(102, 114, 127, .10);
  --shadow: 0 10px 30px rgba(15, 23, 32, .12);
  --sig-strong-buy: #067a47; --sig-buy: #0e8f52; --sig-watch: #a86c0d; --sig-hold: #5d6975;
  --sig-reduce: #c25a12; --sig-sell: #c62828; --sig-avoid: #b4441c; --sig-conflict: #6b55e0; --sig-stale: #7a8794;
  --chart-ema9: #2a78d6; --chart-ema20: #eb6834; --chart-ema50: #1baf7a; --chart-ema200: #4a3aa7;
  --chart-vwap: #eda100; --chart-bb: #e87ba4;
}

/* colour-blind-safe up/down (blue / orange) */
:root[data-cvd="1"] { --up: #3b8fe8; --down: #e8741f; --up-soft: rgba(59, 143, 232, .15); --down-soft: rgba(232, 116, 31, .15); }
:root[data-theme="light"][data-cvd="1"] { --up: #1f63b6; --down: #c2570f; }

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 var(--font-sans); -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 20px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
p { margin: 0 0 8px; }
small, .small { font-size: 12px; }
code, .mono { font-family: var(--font-mono); font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); } .text-2 { color: var(--text-2); }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--text-2); }
.nowrap { white-space: nowrap; } .right { text-align: right; } .center { text-align: center; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 8px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.row-wrap > .seg { min-width: 0; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.grow { flex: 1 1 auto; min-width: 0; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
svg.i { width: 18px; height: 18px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i-sm { width: 14px; height: 14px; }
svg.i-lg { width: 22px; height: 22px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------------------------------------------------------------- app shell */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--ai)); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .02em;
}
.brand-name { font-weight: 750; font-size: 13.5px; line-height: 1.15; letter-spacing: .02em; }
.brand-name span { display: block; color: var(--muted); font-weight: 500; font-size: 11px; letter-spacing: .06em; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; }
.nav-sec { color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 12px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--text-2);
  font-weight: 550; font-size: 13.5px; text-decoration: none; transition: background .15s var(--ease), color .15s var(--ease);
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--text); }
.nav a.active svg { color: var(--accent-strong); }
.nav .count { margin-left: auto; font-size: 11px; background: var(--down); color: #fff; border-radius: 999px; padding: 0 6px; min-width: 18px; text-align: center; font-weight: 700; }
.sidebar-foot { margin-top: auto; padding: 12px 16px 16px; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--border); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 10px;
  padding: 0 16px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.topbar .page-title { font-size: 15px; font-weight: 650; white-space: nowrap; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.content { padding: 16px; width: 100%; max-width: 1720px; margin: 0 auto; flex: 1 0 auto; }
.disclaimer {
  font-size: 11.5px; color: var(--muted); padding: 10px 16px 18px; text-align: center; max-width: 1100px; margin: 0 auto;
}

/* search */
.search { position: relative; flex: 0 1 340px; min-width: 0; }
.search input { width: 100%; padding-left: 34px; height: 36px; }
.search > svg { position: absolute; left: 10px; top: 9px; color: var(--muted); }
.search-results {
  position: absolute; top: 42px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; z-index: 60; max-height: 60vh; overflow-y: auto;
}
.search-results a { display: flex; gap: 10px; align-items: baseline; padding: 9px 12px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover, .search-results a.active { background: var(--surface-2); }
.search-results .t { font-weight: 700; font-family: var(--font-mono); min-width: 64px; }
.search-results .n { color: var(--text-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- mobile shell */
.bottom-nav {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: var(--bottom-nav-h);
  padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--border);
}
.bottom-nav a {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 10.5px; font-weight: 600; text-decoration: none; min-height: 48px; position: relative;
}
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a.active { color: var(--accent-strong); }
.bottom-nav a .dot { position: absolute; top: 8px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--down); border: 2px solid var(--surface); }
.mobile-only-block { display: none; }
@media (min-width: 961px) { .mobile-only { display: none !important; } }

@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 84vw; max-width: 320px; transform: translateX(-102%); transition: transform .25s var(--ease); box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; }
  .bottom-nav { display: flex; }
  .content { padding: 12px 12px calc(var(--bottom-nav-h) + 20px); }
  .disclaimer { padding-bottom: calc(var(--bottom-nav-h) + 14px); }
  .desktop-only { display: none !important; }
  .mobile-only-block { display: block; }
  .topbar { padding: 0 10px; gap: 6px; }
  .search { flex: 1 1 auto; }
  .topbar .page-title { display: none; }
}
.scrim { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 35; }

/* ---------------------------------------------------------------- cards & grids */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); min-height: 46px; }
.card-t { font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.card-b { padding: 14px; }
.card-b.tight { padding: 0; }
.card-f { padding: 10px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.grid { display: grid; gap: 14px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
.g-dash { grid-template-columns: 1.1fr 1fr 1fr; }
@media (max-width: 1280px) { .g-dash { grid-template-columns: 1fr 1fr; } .g-dash > :first-child { grid-column: 1 / -1; } .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .g-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .g-2, .g-3, .g-dash { grid-template-columns: minmax(0, 1fr); } .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-dash > :first-child { grid-column: auto; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head p { color: var(--text-2); margin: 4px 0 0; font-size: 13px; }

/* ---------------------------------------------------------------- stat tiles */
.kpi { padding: 12px 14px; }
.kpi .l { font-size: 11.5px; color: var(--text-2); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: 22px; font-weight: 650; margin-top: 4px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .d { font-size: 12px; margin-top: 2px; color: var(--text-2); }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
@media (max-width: 760px) { .kpi .v { font-size: 18px; } .kpi { padding: 10px 12px; } }
.kpi-row .kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }

/* ---------------------------------------------------------------- header strip (dashboard) */
.strip { display: grid; grid-template-columns: repeat(3, minmax(200px, 1fr)) repeat(3, minmax(160px, .8fr)); gap: 10px; margin-bottom: 14px; }
.strip-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; min-width: 0; position: relative; overflow: hidden; }
.strip-card .l { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; }
.strip-card .l > span:last-child { overflow: hidden; text-overflow: ellipsis; text-transform: none; letter-spacing: 0; font-weight: 600; min-width: 0; }
.strip-card .v { font-size: 20px; font-weight: 650; margin-top: 3px; white-space: nowrap; }
.strip-card .s { font-size: 12.5px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-card .spark { position: absolute; right: 8px; bottom: 8px; width: 42%; height: 34px; opacity: .9; }
.strip-card.small .v { font-size: 17px; white-space: normal; line-height: 1.15; }
.strip-card .reason { font-size: 11.5px; color: var(--text-2); margin-top: 3px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 1280px) { .strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 12px; gap: 8px; margin: 0 -12px 12px; padding: 0 12px 2px; scrollbar-width: none; }
  .strip::-webkit-scrollbar { display: none; }
  .strip-card { flex: 0 0 72%; scroll-snap-align: start; }
  .strip-card.small { flex-basis: 46%; }
}

/* ---------------------------------------------------------------- badges & pills */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; border: 1px solid transparent;
  background: var(--neutral-soft); color: var(--text-2);
}
.badge.lg { height: 28px; padding: 0 12px; font-size: 12px; }
.b-up { background: var(--up-soft); color: var(--up); }
.b-down { background: var(--down-soft); color: var(--down); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-info { background: var(--info-soft); color: var(--info); }
.b-ai { background: var(--ai-soft); color: var(--ai); }
.b-accent { background: var(--accent-soft); color: var(--accent-strong); }
.b-demo { background: repeating-linear-gradient(45deg, var(--warn-soft), var(--warn-soft) 6px, transparent 6px, transparent 12px); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; flex: 0 0 auto; }
.dot.live { box-shadow: 0 0 0 0 currentColor; animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 60%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .dot.live { animation: none; } * { transition: none !important; } }

.sig {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 7px; white-space: nowrap;
  font-size: 11px; font-weight: 800; letter-spacing: .04em; border: 1px solid; background: transparent;
}
.sig.lg { height: 34px; padding: 0 14px; font-size: 13.5px; border-radius: 9px; }
.sig::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: currentColor; }
.sig-strong-buy { color: var(--sig-strong-buy); border-color: color-mix(in srgb, var(--sig-strong-buy) 50%, transparent); background: color-mix(in srgb, var(--sig-strong-buy) 14%, transparent); }
.sig-buy { color: var(--sig-buy); border-color: color-mix(in srgb, var(--sig-buy) 42%, transparent); background: color-mix(in srgb, var(--sig-buy) 10%, transparent); }
.sig-watch { color: var(--sig-watch); border-color: color-mix(in srgb, var(--sig-watch) 42%, transparent); background: color-mix(in srgb, var(--sig-watch) 10%, transparent); }
.sig-hold { color: var(--sig-hold); border-color: color-mix(in srgb, var(--sig-hold) 40%, transparent); }
.sig-reduce { color: var(--sig-reduce); border-color: color-mix(in srgb, var(--sig-reduce) 42%, transparent); background: color-mix(in srgb, var(--sig-reduce) 10%, transparent); }
.sig-sell { color: var(--sig-sell); border-color: color-mix(in srgb, var(--sig-sell) 50%, transparent); background: color-mix(in srgb, var(--sig-sell) 13%, transparent); }
.sig-avoid { color: var(--sig-avoid); border-color: color-mix(in srgb, var(--sig-avoid) 38%, transparent); }
.sig-conflict { color: var(--sig-conflict); border-color: color-mix(in srgb, var(--sig-conflict) 45%, transparent); background: color-mix(in srgb, var(--sig-conflict) 12%, transparent); }
.sig-stale, .sig-na { color: var(--sig-stale); border-color: color-mix(in srgb, var(--sig-stale) 40%, transparent); background: repeating-linear-gradient(135deg, transparent, transparent 5px, color-mix(in srgb, var(--sig-stale) 12%, transparent) 5px, color-mix(in srgb, var(--sig-stale) 12%, transparent) 10px); }

.risk { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 750; letter-spacing: .04em; }
.risk::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.risk-low { color: var(--up); } .risk-medium { color: var(--warn); } .risk-high { color: var(--sig-reduce); } .risk-extreme { color: var(--down); } .risk-na { color: var(--muted); }

.regime { font-weight: 800; letter-spacing: .03em; }
.rg-STRONG_BULL, .rg-BULL { color: var(--up); } .rg-NEUTRAL { color: var(--text-2); } .rg-RISK_OFF { color: var(--warn); }
.rg-BEAR, .rg-STRONG_BEAR { color: var(--down); } .rg-ABNORMAL_VOLATILITY { color: var(--ai); }
.ai-st { font-weight: 800; letter-spacing: .03em; }
.ai-ACTIVE { color: var(--up); } .ai-IDLE { color: var(--info); } .ai-SLEEPING { color: var(--ai); } .ai-BUDGET_LOCK { color: var(--warn); }
.ai-MARKET_CLOSED, .ai-DISABLED, .ai-NOT_CONFIGURED { color: var(--muted); } .ai-DATA_ERROR, .ai-UNAVAILABLE { color: var(--down); }
.lvl-ok { color: var(--up); } .lvl-info { color: var(--info); } .lvl-warning { color: var(--warn); } .lvl-error { color: var(--down); }

/* score ring */
.score { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-weight: 750; font-size: 12.5px;
  background: conic-gradient(var(--c, var(--accent)) calc(var(--p, 0) * 1%), var(--surface-3) 0); position: relative; }
.score::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--surface); }
.score span { position: relative; z-index: 1; }
.score.sm { width: 30px; height: 30px; font-size: 11px; }

/* ---------------------------------------------------------------- buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font: 600 13px var(--font-sans);
  cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .15s var(--ease), border-color .15s var(--ease), opacity .15s;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:disabled, .btn.busy { opacity: .55; cursor: progress; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-up { background: var(--up); border-color: var(--up); color: #fff; }
.btn-down { background: var(--down); border-color: var(--down); color: #fff; }
.btn-ai { background: var(--ai-soft); border-color: color-mix(in srgb, var(--ai) 45%, transparent); color: var(--ai); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { color: var(--down); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 11.5px; border-radius: 6px; }
.btn-block { width: 100%; }
.icon-btn { width: 36px; height: 36px; padding: 0; border-radius: 9px; position: relative; }
.icon-btn .count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 999px; background: var(--down); color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--bg); }

.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface-3);
  color: var(--text); font: 13.5px var(--font-sans); outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 90px; padding: 9px 11px; resize: vertical; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .label { font-size: 12px; font-weight: 650; color: var(--text-2); }
.field .help { font-size: 11.5px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 14px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 13px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 40px; height: 22px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; transition: background .2s; flex: 0 0 auto; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: transform .2s var(--ease), background .2s; }
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* chips & segmented tabs (swipe-friendly) */
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-2); font: 600 12.5px var(--font-sans); cursor: pointer; scroll-snap-align: start; white-space: nowrap;
}
.chip:hover { color: var(--text); }
.chip.active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--text); }
.seg { display: inline-flex; background: var(--surface-3); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: transparent; color: var(--text-2); font: 650 12.5px var(--font-sans); height: 30px; padding: 0 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 12px; color: var(--text-2); font-weight: 600; font-size: 13px; border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.tabs a.active { color: var(--text); border-color: var(--accent); }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.8px; }
.table th {
  position: sticky; top: 0; z-index: 2; background: var(--surface); text-align: left; font-size: 10.8px; font-weight: 750; color: var(--muted);
  letter-spacing: .07em; text-transform: uppercase; padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none;
}
.table th.sortable { cursor: pointer; }
.table th.sortable:hover { color: var(--text); }
.table th.sorted { color: var(--text); }
.table th.sorted::after { content: " ↓"; } .table th.sorted.asc::after { content: " ↑"; }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.clickable { cursor: pointer; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .tk { font-weight: 750; font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .02em; }
.table .nm { color: var(--text-2); max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.table tr.pinned td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.table tr.stale td { opacity: .6; }
.flash-up { animation: flashUp 1.2s var(--ease); } .flash-down { animation: flashDown 1.2s var(--ease); }
@keyframes flashUp { 0% { background: var(--up-soft); } 100% { background: transparent; } }
@keyframes flashDown { 0% { background: var(--down-soft); } 100% { background: transparent; } }
.pin-btn { color: var(--muted); background: none; border: 0; cursor: pointer; padding: 4px; border-radius: 6px; display: inline-grid; place-items: center; }
.pin-btn:hover { color: var(--text); background: var(--surface-3); }
.pin-btn.on { color: var(--warn); }
.pin-btn.on svg { fill: currentColor; }

/* mobile stock cards (not a squeezed table) */
.stock-cards { display: none; }
.scard {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px 12px; border-bottom: 1px solid var(--border);
  color: var(--text); text-decoration: none; min-height: 64px; align-items: center;
}
.scard:active { background: var(--surface-2); }
.scard:hover { text-decoration: none; }
.scard .t { font-weight: 800; font-family: var(--font-mono); font-size: 14px; display: flex; gap: 6px; align-items: center; }
.scard .n { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scard .p { text-align: right; font-weight: 700; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.scard .c { text-align: right; font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.scard .meta { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 11.5px; color: var(--text-2); }
@media (max-width: 760px) {
  .stock-table { display: none; }
  .stock-cards { display: block; }
}

/* ---------------------------------------------------------------- lists: opportunities / reasons / kv */
.olist { display: flex; flex-direction: column; }
.oitem { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.oitem:last-child { border-bottom: 0; }
.oitem:hover { background: var(--surface-2); text-decoration: none; }
.oitem .rank { font-weight: 800; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.oitem .t { font-weight: 800; font-family: var(--font-mono); }
.oitem .sub { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oitem .right { text-align: right; display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }
.ocards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.ocard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px; display: flex; flex-direction: column; gap: 10px; color: var(--text); text-decoration: none; position: relative; }
.ocard:hover { border-color: var(--border-strong); text-decoration: none; }
.ocard .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ocard .tk { font-size: 18px; font-weight: 800; font-family: var(--font-mono); }
.ocard .rank { position: absolute; top: 12px; right: 14px; font-size: 12px; font-weight: 800; color: var(--muted); }
.ocard ul { margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--text-2); display: flex; flex-direction: column; gap: 3px; }
.ocards#presets { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.ocard.preset { gap: 8px; padding: 12px 14px; }
.ocard.preset.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.levels .wide { grid-column: span 2; }
.levels div { background: var(--surface-2); border-radius: 8px; padding: 6px 8px; min-width: 0; }
.levels > div > span { display: block; font-size: 10.5px; color: var(--muted); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.levels b { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 760px) {
  .hswipe { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 12px; gap: 10px; margin: 0 -12px; padding: 0 12px 4px; scrollbar-width: none; }
  .hswipe::-webkit-scrollbar { display: none; }
  .hswipe > * { flex: 0 0 86%; scroll-snap-align: start; }
}

.reasons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.reasons li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.35; }
.reasons li::before { content: ""; flex: 0 0 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; font-size: 12px; font-weight: 900; margin-top: 1px; }
.reasons li.positive::before { content: "+"; background: var(--up-soft); color: var(--up); }
.reasons li.negative::before { content: "−"; background: var(--down-soft); color: var(--down); }
.reasons li.neutral::before { content: "•"; background: var(--neutral-soft); color: var(--text-2); }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px 14px; }
.kv > div { min-width: 0; }
.kv > div > span { display: block; font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.kv b { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

/* breakdown bars */
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 58px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-row .track { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 0 4px 4px 0; background: var(--accent); transition: width .4s var(--ease); }
.bar-row .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.meter { height: 8px; border-radius: 4px; background: var(--accent-soft); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; transition: width .4s var(--ease); }
.meter.warn { background: var(--warn-soft); } .meter.warn > i { background: var(--warn); }
.meter.bad { background: var(--down-soft); } .meter.bad > i { background: var(--down); }

/* robot status */
.robot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.robot > div { padding: 9px 14px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 10px; font-size: 12.8px; min-width: 0; }
.robot > div:nth-child(odd) { border-right: 1px solid var(--border); }
.robot span { color: var(--text-2); white-space: nowrap; }
.robot b { font-weight: 700; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.robot .full { grid-column: 1 / -1; border-right: 0 !important; display: block; }
.robot .full b { display: block; text-align: left; white-space: normal; font-weight: 600; color: var(--text); margin-top: 3px; }

/* heatmap */
.heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.heat-sec { border-radius: 10px; padding: 10px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; min-width: 0; }
.heat-sec .hd { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; margin-bottom: 7px; }
.heat-sec .hd b { font-variant-numeric: tabular-nums; }
.heat-tiles { display: flex; flex-wrap: wrap; gap: 3px; }
.tile { border-radius: 4px; padding: 3px 5px; font-size: 10.5px; font-weight: 750; font-family: var(--font-mono); color: #fff; min-width: 40px; text-align: center; text-decoration: none; line-height: 1.25; }
.tile small { display: block; font-size: 9.5px; font-weight: 650; font-family: var(--font-sans); opacity: .92; }
.tile.dark-text { color: #0b0b0b; }
.heat-legend { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.heat-legend .scale { height: 8px; width: 160px; border-radius: 4px; }

/* breadth */
.breadth { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.breadth .item { background: var(--surface-2); border-radius: 10px; padding: 9px 11px; }
.breadth .item span { font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; display: block; }
.breadth .item b { font-size: 16px; font-variant-numeric: tabular-nums; }
.adbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; background: var(--surface); }
.adbar i { display: block; height: 100%; }

/* ---------------------------------------------------------------- stock page */
.stock-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.stock-head .tk { font-size: 26px; font-weight: 800; font-family: var(--font-mono); letter-spacing: .02em; }
.stock-head .nm { color: var(--text-2); font-size: 13.5px; }
.stock-head .px { font-size: 30px; font-weight: 700; letter-spacing: -.01em; }
.stock-head .chg { font-size: 15px; font-weight: 700; }
.ohlc { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.ohlc b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 650; }
.chart-card { position: relative; }
.chart-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.chart-toolbar .chips { flex: 1 1 100%; order: 3; }
.chart-toolbar .chip { height: 26px; padding: 0 10px; font-size: 12px; }
@media (min-width: 761px) { .chart-toolbar .chips { flex-wrap: wrap; overflow: visible; } }
@media (max-width: 760px) { .chart-toolbar { gap: 6px; padding: 6px 8px; flex-wrap: wrap; } .chart-toolbar .seg { flex: 1 1 auto; min-width: 0; } .chart-toolbar .seg button { padding: 0 6px; font-size: 12px; flex: 1 0 auto; } .chart-legend { font-size: 10.5px; gap: 2px 8px; } }
.chart-box { position: relative; height: 560px; }
.chart-legend { position: absolute; left: 10px; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; pointer-events: none; max-width: calc(100% - 90px); }
.chart-legend .li { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.chart-legend .li i { width: 12px; height: 2px; border-radius: 1px; display: inline-block; }
.chart-legend .ohlc-read { width: 100%; color: var(--text); font-weight: 600; }
.chart-foot { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--border); flex-wrap: wrap; }
.chart-card.fullscreen { position: fixed; inset: 0; z-index: 90; border-radius: 0; display: flex; flex-direction: column; }
.chart-card.fullscreen .chart-box { flex: 1 1 auto; height: auto; }
.signal-card { position: sticky; top: calc(var(--topbar-h) + 12px); }
.signal-card .hero { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.signal-card .conf { font-size: 30px; font-weight: 750; }
.triple { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.triple > div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.triple span { display: block; font-size: 10.5px; color: var(--muted); font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.triple b { display: block; font-size: 12.5px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.triple em { font-style: normal; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.triple .final { outline: 1px solid var(--border-strong); background: var(--surface-3); }
.conflict-box { background: var(--ai-soft); border: 1px solid color-mix(in srgb, var(--ai) 40%, transparent); color: var(--text); border-radius: 10px; padding: 9px 11px; font-size: 12.5px; }
.sticky-signal {
  display: none; position: fixed; left: 8px; right: 8px; bottom: calc(var(--bottom-nav-h) + 8px); z-index: 45; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow); padding: 9px 10px; align-items: center; gap: 10px;
}
@media (max-width: 1100px) { .signal-card { position: static; } }
@media (max-width: 760px) {
  .sticky-signal { display: flex; }
  .chart-box { height: 58vh; min-height: 340px; }
  .stock-head .px { font-size: 26px; }
  .page-stock .content { padding-bottom: calc(var(--bottom-nav-h) + 90px); }
}
.mtf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.mtf-cell { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.mtf-cell .tf { font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .08em; }
.mtf-cell .b { font-weight: 800; font-size: 12.5px; margin-top: 2px; }
.mtf-cell .x { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.b-BULLISH { color: var(--up); } .b-BEARISH { color: var(--down); } .b-NEUTRAL { color: var(--text-2); } .b-INSUFFICIENT { color: var(--muted); }
.audit { font-family: var(--font-mono); font-size: 11.5px; white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border-radius: 10px; padding: 10px; max-height: 420px; overflow: auto; }
details.acc { border-top: 1px solid var(--border); }
details.acc > summary { list-style: none; cursor: pointer; padding: 12px 14px; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: space-between; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::after { content: "+"; color: var(--muted); font-size: 16px; }
details.acc[open] > summary::after { content: "−"; }
details.acc > div { padding: 0 14px 14px; }

/* ---------------------------------------------------------------- modal / sheet / toast */
.modal-root { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .5); }
.modal-root.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-xl); box-shadow: var(--shadow); width: min(560px, 100%); max-height: 88vh; display: flex; flex-direction: column; animation: pop .18s var(--ease); }
.modal.wide { width: min(860px, 100%); }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); gap: 10px; }
.modal-b { padding: 16px; overflow-y: auto; }
.modal-f { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 760px) {
  .modal-root { align-items: flex-end; padding: 0; }
  .modal, .modal.wide { width: 100%; max-height: 90vh; border-radius: 18px 18px 0 0; animation: sheet .22s var(--ease); padding-bottom: env(safe-area-inset-bottom); }
  .modal-h::before { content: ""; position: absolute; left: 50%; top: 6px; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: var(--border-strong); }
  .modal-h { position: relative; padding-top: 18px; }
}
@keyframes sheet { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.toast-root { position: fixed; right: 16px; bottom: 16px; z-index: 120; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--surface); border: 1px solid var(--border-strong); border-left: 4px solid var(--accent); border-radius: 10px; padding: 10px 12px; box-shadow: var(--shadow); font-size: 13px; animation: pop .2s var(--ease); }
.toast.ok { border-left-color: var(--up); } .toast.err { border-left-color: var(--down); } .toast.warn { border-left-color: var(--warn); }
@media (max-width: 760px) { .toast-root { left: 12px; right: 12px; bottom: calc(var(--bottom-nav-h) + 12px); max-width: none; } }
.dropdown { position: absolute; right: 0; top: 44px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow); width: min(380px, calc(100vw - 20px)); z-index: 70; overflow: hidden; }
.dropdown .dh { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 13px; }
.dropdown .db { max-height: 60vh; overflow-y: auto; }
.notif { padding: 10px 12px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 10px; font-size: 12.5px; color: var(--text); text-decoration: none; }
.notif:hover { background: var(--surface-2); text-decoration: none; }
.notif.unread { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.notif .sv { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; }
.sv-info { background: var(--info); } .sv-warning { background: var(--warn); } .sv-critical { background: var(--down); }
.notif .tt { font-weight: 700; } .notif .mm { color: var(--text-2); margin-top: 2px; } .notif .ts { color: var(--muted); font-size: 11px; margin-top: 3px; }

/* ---------------------------------------------------------------- misc */
.alert-box { border-radius: 10px; padding: 10px 12px; font-size: 13px; border: 1px solid; margin-bottom: 12px; }
.alert-box.ok { background: var(--up-soft); border-color: color-mix(in srgb, var(--up) 40%, transparent); }
.alert-box.err { background: var(--down-soft); border-color: color-mix(in srgb, var(--down) 40%, transparent); }
.alert-box.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.alert-box.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 35%, transparent); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; border-radius: 6px; min-height: 14px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.loading-dim { opacity: .55; transition: opacity .2s; }
.health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.hc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; }
.hc .n { font-size: 11.5px; font-weight: 750; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; display: flex; justify-content: space-between; }
.hc .s { font-size: 18px; font-weight: 800; margin-top: 4px; }
.hc .d { font-size: 12.5px; color: var(--text-2); margin-top: 3px; word-break: break-word; }
.st-OK { color: var(--up); } .st-WARNING { color: var(--warn); } .st-ERROR { color: var(--down); }
.chart-mini { height: 220px; position: relative; }
.chart-mini.sm { height: 160px; }
.spark-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.rule-row { display: grid; grid-template-columns: minmax(0, 1.4fr) 110px minmax(0, 1fr) 36px; gap: 8px; align-items: center; margin-bottom: 8px; }
@media (max-width: 600px) { .rule-row { grid-template-columns: 1fr 1fr; } }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 20% -10%, var(--accent-soft), transparent), radial-gradient(900px 500px at 110% 110%, var(--ai-soft), transparent), var(--bg); }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 26px; box-shadow: var(--shadow); }
.more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.more-grid a { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text); font-weight: 600; font-size: 12.5px; text-decoration: none; min-height: 84px; justify-content: center; text-align: center; }
.more-grid a svg { width: 24px; height: 24px; color: var(--accent-strong); }
.pos-row .pnl { font-weight: 700; }
.code-block { font-family: var(--font-mono); font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; overflow-x: auto; white-space: pre; }
.tl { position: relative; padding-left: 16px; }
.tl::before { content: ""; position: absolute; left: 4px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.tl > div { position: relative; padding: 0 0 12px; font-size: 12.5px; }
.tl > div::before { content: ""; position: absolute; left: -16px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
@media print { .sidebar, .topbar, .bottom-nav, .disclaimer, .btn { display: none !important; } .app { display: block; } body { background: #fff; color: #000; } }

/* ==========================================================================
   v1.1 — REAL DATA ONLY + TRADE PLAN ("Aksi Sekarang")
   ========================================================================== */
:root { --act-buy: var(--sig-strong-buy); --act-near: var(--info); --act-wait: var(--warn); --act-hold: var(--accent-strong); --act-profit: var(--up); --act-exit: var(--down); --act-avoid: var(--sig-avoid); --act-stale: var(--muted); }

/* data status pill (top bar, stock page, cards) */
.dpill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .04em; white-space: nowrap; border: 1px solid transparent; background: var(--neutral-soft); color: var(--text-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.dpill .dot { width: 7px; height: 7px; }
.dp-REALTIME { background: var(--up-soft); color: var(--up); }
.dp-DELAYED, .dp-EOD { background: var(--info-soft); color: var(--info); }
.dp-STALE, .dp-OFFLINE, .dp-NOT_CONNECTED, .dp-NO_DATA { background: var(--down-soft); color: var(--down); border-color: color-mix(in srgb, var(--down) 35%, transparent); }
.dp-UNVERIFIED { background: var(--warn-soft); color: var(--warn); }
.dp-DEMO { background: repeating-linear-gradient(45deg, var(--warn-soft), var(--warn-soft) 6px, transparent 6px, transparent 12px); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
#data-pill { cursor: help; }
@media (max-width: 960px) { #data-pill { height: 24px; padding: 0 8px; font-size: 10px; } #data-pill .dp-long { display: none; } }

/* global banner when real data is not connected / demo */
.data-banner { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; border: 1px solid; font-size: 13px; }
.data-banner b.t { display: block; font-size: 13.5px; letter-spacing: .03em; }
.data-banner.nc { background: var(--down-soft); border-color: color-mix(in srgb, var(--down) 40%, transparent); }
.data-banner.demo { background: repeating-linear-gradient(45deg, var(--warn-soft), var(--warn-soft) 10px, transparent 10px, transparent 20px), var(--surface); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.data-banner.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }

/* action pill */
.act { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; border-radius: 8px; font-size: 11.5px; font-weight: 850; letter-spacing: .04em; white-space: nowrap; border: 1px solid; }
.act::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.act.lg { height: 40px; padding: 0 16px; font-size: 16px; border-radius: 11px; }
.act.lg::before { width: 11px; height: 11px; }
.act-buy { color: var(--act-buy); border-color: color-mix(in srgb, var(--act-buy) 55%, transparent); background: color-mix(in srgb, var(--act-buy) 16%, transparent); }
.act-near { color: var(--act-near); border-color: color-mix(in srgb, var(--act-near) 50%, transparent); background: color-mix(in srgb, var(--act-near) 12%, transparent); }
.act-wait { color: var(--act-wait); border-color: color-mix(in srgb, var(--act-wait) 45%, transparent); background: color-mix(in srgb, var(--act-wait) 10%, transparent); }
.act-hold { color: var(--act-hold); border-color: color-mix(in srgb, var(--act-hold) 45%, transparent); background: color-mix(in srgb, var(--act-hold) 10%, transparent); }
.act-profit { color: var(--act-profit); border-color: color-mix(in srgb, var(--act-profit) 55%, transparent); background: color-mix(in srgb, var(--act-profit) 16%, transparent); }
.act-exit { color: var(--act-exit); border-color: color-mix(in srgb, var(--act-exit) 55%, transparent); background: color-mix(in srgb, var(--act-exit) 14%, transparent); }
.act-avoid { color: var(--act-avoid); border-color: color-mix(in srgb, var(--act-avoid) 45%, transparent); background: color-mix(in srgb, var(--act-avoid) 9%, transparent); }
.act-stale, .act-nodata { color: var(--act-stale); border-color: color-mix(in srgb, var(--act-stale) 45%, transparent); background: repeating-linear-gradient(135deg, transparent, transparent 5px, color-mix(in srgb, var(--act-stale) 14%, transparent) 5px, color-mix(in srgb, var(--act-stale) 14%, transparent) 10px); }
.act-nodata { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.sig.sig-demo { color: var(--muted); border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: repeating-linear-gradient(45deg, transparent, transparent 5px, var(--warn-soft) 5px, var(--warn-soft) 10px); }
.sig.sig-demo::before { background: var(--warn); }

/* stock page: quick / advanced */
.view-toggle { margin: 0 0 12px; }
#stock-page[data-view="quick"] .adv-only { display: none !important; }
#stock-page[data-view="quick"] .g-main { grid-template-columns: minmax(0, 1fr); }
#stock-page[data-view="advanced"] .quick-only { display: none !important; }
.stock-status { display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.stock-status b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }

/* plan hero */
.plan-hero { margin-bottom: 14px; overflow: hidden; }
.plan-hero .ph-body { padding: 14px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.6fr); grid-template-areas: "top lv" "more lv"; gap: 10px 16px; align-items: start; }
.plan-hero .ph-top { grid-area: top; } .plan-hero .ph-more { grid-area: more; } .plan-hero .ph-lv { grid-area: lv; }
@media (max-width: 1100px) { .plan-hero .ph-body { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "lv" "more"; } }
@media (max-width: 760px) {
  .plan-hero .ph-body { padding: 10px; gap: 10px; }
  .plan-hero .card-h { padding: 8px 10px; }
  .data-banner { padding: 9px 11px; font-size: 12px; margin-bottom: 10px; gap: 8px; }
  .data-banner .bd { display: none; }
  .data-banner .btn { height: 28px; }
  .stock-status { font-size: 11px; gap: 2px 10px; margin-top: 4px; }
  .stock-status .ss-x { display: none; }
  #stock-page[data-view="quick"] .ohlc { display: none; }
  .stock-head { margin-bottom: 8px; gap: 8px; }
}
.ph-action .label { margin-bottom: 6px; }
.ph-headline { font-size: 16px; font-weight: 700; margin-top: 10px; line-height: 1.3; }
.ph-next { font-size: 13.5px; color: var(--text-2); margin-top: 6px; line-height: 1.45; }
.ph-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ph-sim { margin-top: 10px; border: 1px dashed color-mix(in srgb, var(--warn) 55%, transparent); border-radius: 10px; padding: 8px 10px; font-size: 12px; color: var(--text-2); background: var(--warn-soft); }
.lvl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.lvl-tile { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; min-width: 0; border: 1px solid transparent; }
.lvl-tile.wide { grid-column: span 2; }
.lvl-tile > span { display: block; font-size: 10.5px; color: var(--muted); font-weight: 750; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lvl-tile > b { display: block; font-size: 16px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.lvl-tile > em { display: block; font-style: normal; font-size: 11.5px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lvl-tile.buy { border-color: color-mix(in srgb, var(--act-buy) 45%, transparent); background: color-mix(in srgb, var(--act-buy) 9%, var(--surface-2)); }
.lvl-tile.max { border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.lvl-tile.stop { border-color: color-mix(in srgb, var(--down) 40%, transparent); }
.lvl-tile.tgt { border-color: color-mix(in srgb, var(--up) 30%, transparent); }
@media (max-width: 760px) { .lvl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; } .lvl-tile { padding: 6px 8px; } .lvl-tile > b { font-size: 14.5px; } .act.lg { height: 36px; font-size: 14.5px; } .ph-headline { font-size: 15px; } }

/* price ladder: stop · buy zone · max buy · T1 · T2 with the current price */
.ladder { position: relative; height: 54px; margin: 14px 4px 2px; }
.ladder .rail { position: absolute; left: 0; right: 0; top: 22px; height: 8px; border-radius: 4px; background: var(--surface-3); }
.ladder .seg-risk { position: absolute; top: 22px; height: 8px; background: color-mix(in srgb, var(--down) 35%, transparent); border-radius: 4px 0 0 4px; }
.ladder .seg-zone { position: absolute; top: 18px; height: 16px; background: color-mix(in srgb, var(--act-buy) 40%, transparent); border: 1px solid var(--act-buy); border-radius: 4px; }
.ladder .seg-reward { position: absolute; top: 22px; height: 8px; background: color-mix(in srgb, var(--up) 22%, transparent); }
.ladder .tick { position: absolute; top: 14px; width: 2px; height: 24px; background: var(--border-strong); transform: translateX(-1px); }
.ladder .tick.max { background: var(--warn); }
.ladder .tick.t { background: var(--up); }
.ladder .tick.s { background: var(--down); }
.ladder .tl { position: absolute; top: 40px; font-size: 10.5px; font-weight: 700; color: var(--muted); transform: translateX(-50%); white-space: nowrap; }
.ladder .px { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; font-weight: 800; color: var(--text); white-space: nowrap; }
.ladder .px::after { content: ""; position: absolute; left: 50%; top: 15px; width: 2px; height: 22px; margin-left: -1px; background: var(--text); }

/* Kapan Masuk / Keluar */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: st; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.steps li { counter-increment: st; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; line-height: 1.4; }
.steps li::before { content: counter(st); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 800; background: var(--accent-soft); color: var(--accent-strong); }
.steps.exit li::before { background: var(--down-soft); color: var(--down); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 12px; margin-top: 12px; font-size: 12.5px; }
.checks div { display: flex; gap: 6px; align-items: baseline; }
.checks i { font-style: normal; font-weight: 900; width: 14px; display: inline-block; }
.checks .ok i { color: var(--up); } .checks .no i { color: var(--down); }
.checks small { color: var(--muted); }

/* calculator */
.calc-out { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.calc-out > div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.calc-out > div > span { display: block; font-size: 10.5px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.calc-out b { font-size: 15px; font-variant-numeric: tabular-nums; }
.formula { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-2); background: var(--surface-2); border-radius: 8px; padding: 8px 10px; margin-top: 10px; line-height: 1.5; }

/* TODAY'S ACTION CENTER */
.ac-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.ac-counts { display: flex; gap: 6px; flex-wrap: wrap; }
.ac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; padding: 12px 14px 14px; }
.ac-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); border-left: 4px solid var(--border-strong); color: var(--text); text-decoration: none; min-width: 0; }
.ac-card:hover { text-decoration: none; border-color: var(--border-strong); }
.ac-card.tone-buy { border-left-color: var(--act-buy); } .ac-card.tone-near { border-left-color: var(--act-near); } .ac-card.tone-wait { border-left-color: var(--act-wait); }
.ac-card.tone-hold { border-left-color: var(--act-hold); } .ac-card.tone-profit { border-left-color: var(--act-profit); } .ac-card.tone-exit { border-left-color: var(--act-exit); }
.ac-card.tone-avoid { border-left-color: var(--act-avoid); } .ac-card.tone-stale, .ac-card.tone-nodata { border-left-color: var(--muted); }
.ac-card .top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.ac-card .tk { font-family: var(--font-mono); font-weight: 800; font-size: 15px; }
.ac-card .nm { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.ac-card .px { text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; }
.ac-card .hl { font-size: 12.5px; color: var(--text-2); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ac-card .levels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ac-card .foot { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 11px; color: var(--muted); margin-top: auto; }
.ac-empty { padding: 22px 16px; text-align: center; color: var(--text-2); font-size: 13px; }
@media (max-width: 760px) { .ac-grid { grid-template-columns: minmax(0, 1fr); padding: 10px; } }

/* filter bar (opportunities / watchlist) */
.filterbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.filterbar .field { min-width: 120px; }
.filterbar .field > label { font-size: 11px; }
.filterbar .select, .filterbar .input { height: 32px; font-size: 12.5px; }
.op-table td .sub { display: block; font-size: 11px; color: var(--muted); }
.dist-pos { color: var(--info); } .dist-zero { color: var(--act-buy); font-weight: 750; } .dist-neg { color: var(--warn); }

/* provider setup wizard */
.wz-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.wz-nav button { border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2); border-radius: 999px; height: 30px; padding: 0 12px; font: 650 12.5px var(--font-sans); cursor: pointer; }
.wz-nav button.on { background: var(--accent-soft); color: var(--text); border-color: var(--accent); }
.wz-nav button.done { color: var(--up); }
.wz-step { display: none; }
.wz-step.on { display: block; }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.checklist > div { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; background: var(--surface-2); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; }
.checklist .st { font-weight: 900; }
.checklist .st.ok { color: var(--up); } .checklist .st.no { color: var(--down); } .checklist .st.na { color: var(--muted); }
.checklist b { display: block; font-size: 13px; }
.checklist em { font-style: normal; color: var(--text-2); word-break: break-word; }
.mode-card { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.mode-card > div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.mode-card > div > span { display: block; font-size: 10.5px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mode-card b { font-size: 14px; }
#op-root[data-mode="table"] .op-cards { display: none; }
#op-root[data-mode="cards"] .op-table-wrap { display: none; }
@media (max-width: 760px) { #op-root .op-table-wrap { display: none !important; } #op-root .op-cards { display: grid !important; } .filterbar .field { min-width: calc(50% - 4px); flex: 1 1 calc(50% - 4px); } }
.op-table td { vertical-align: middle; }
.op-table .tk { font-family: var(--font-mono); font-weight: 800; }
.ac-card .levels > div > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-table td .sub .sig { font-size: 10px; height: 20px; }
.lvl-tile > b .dpill, .lvl-tile > b .risk { vertical-align: middle; }
.lvl-tile > b .dpill { height: 22px; font-size: 10.5px; }
.sticky-signal .act { height: 24px; padding: 0 8px; font-size: 10.5px; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sticky-signal .act::before { width: 6px; height: 6px; }
#ss-sig { flex: 0 0 auto; min-width: 0; max-width: 50%; overflow: hidden; display: inline-flex; }
.sticky-signal .act { max-width: 100%; display: inline-flex; white-space: nowrap; }
.sticky-signal .act { text-overflow: ellipsis; overflow: hidden; }
.sticky-signal .btn { padding: 0 10px; }
@media (max-width: 420px) { .hide-xs { display: none; } }
.table tr.demo-row td { background-image: repeating-linear-gradient(135deg, transparent, transparent 8px, color-mix(in srgb, var(--warn) 5%, transparent) 8px, color-mix(in srgb, var(--warn) 5%, transparent) 16px); }
.strip-card.is-demo [data-v] { color: var(--muted); }

/* ==========================================================================
   v1.2 SIMPLE MODE — "Beli atau Tidak?" (one answer per stock)
   ========================================================================== */
:root { --vd-buy: var(--act-buy); --vd-wait: var(--warn); --vd-no: var(--down); --vd-hold: var(--accent-strong); --vd-sell: var(--down); --vd-nodata: var(--muted); }

/* answer badge */
.vd { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 8px; font-size: 12px; font-weight: 850; letter-spacing: .04em; white-space: nowrap; border: 1px solid; vertical-align: middle; }
.vd.lg { height: auto; padding: 8px 16px; font-size: clamp(24px, 6vw, 34px); border-radius: 12px; letter-spacing: .03em; line-height: 1.1; white-space: normal; }
.vd-buy { color: var(--vd-buy); border-color: color-mix(in srgb, var(--vd-buy) 60%, transparent); background: color-mix(in srgb, var(--vd-buy) 16%, transparent); }
.vd-wait { color: var(--vd-wait); border-color: color-mix(in srgb, var(--vd-wait) 55%, transparent); background: color-mix(in srgb, var(--vd-wait) 12%, transparent); }
.vd-no { color: var(--vd-no); border-color: color-mix(in srgb, var(--vd-no) 50%, transparent); background: color-mix(in srgb, var(--vd-no) 10%, transparent); }
.vd-hold { color: var(--vd-hold); border-color: color-mix(in srgb, var(--vd-hold) 50%, transparent); background: color-mix(in srgb, var(--vd-hold) 12%, transparent); }
.vd-sell { color: #fff; border-color: var(--vd-sell); background: var(--vd-sell); }
.vd-nodata { color: var(--vd-nodata); border-color: color-mix(in srgb, var(--vd-nodata) 50%, transparent); background: repeating-linear-gradient(135deg, transparent, transparent 5px, color-mix(in srgb, var(--vd-nodata) 12%, transparent) 5px, color-mix(in srgb, var(--vd-nodata) 12%, transparent) 10px); }

/* page */
.simple { max-width: 1180px; margin: 0 auto; }
.sp-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.sp-head h1 { font-size: 24px; }
.sp-head p { margin: 4px 0 0; font-size: 13.5px; max-width: 640px; }
.sp-check { position: relative; display: flex; gap: 8px; flex: 0 1 360px; min-width: 0; }
.sp-check .input { flex: 1 1 auto; min-width: 0; height: 40px; font-size: 15px; text-transform: uppercase; }
.sp-check .input::placeholder { text-transform: none; }
.sp-check .btn { height: 40px; }
.sp-check .search-results { top: 46px; }
.sp-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 13px; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 9px 12px; margin-bottom: 12px; }
.sp-status:empty { display: none; }
.sp-status .sep { color: var(--muted); margin: 0 2px; }
.sp-status .sp-part { min-width: 0; }
.sp-status .sp-part > .dot:first-child { margin-right: 5px; }
@media (max-width: 560px) { .sp-status { flex-direction: column; align-items: flex-start; gap: 3px; } .sp-status .sep { display: none; } }
.sp-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; margin-right: 2px; }
.sp-status .dot.live { background: var(--up); }
.sp-status .negative { color: var(--down); }
.sp-cta { border: 1px solid color-mix(in srgb, var(--down) 45%, transparent); background: color-mix(in srgb, var(--down) 7%, var(--surface)); border-radius: var(--r-lg); padding: 18px 18px 20px; margin-bottom: 14px; }
.sp-cta-tag { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; color: var(--down); margin-bottom: 6px; }
.sp-cta h2 { font-size: 20px; margin-bottom: 6px; }
.sp-cta p { margin: 6px 0; max-width: 760px; }
.sp-steps { margin: 10px 0 14px; padding-left: 20px; display: grid; gap: 6px; max-width: 760px; font-size: 13.5px; }
.btn-lg { height: 44px; padding: 0 18px; font-size: 15px; border-radius: 10px; }
.sp-progress { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; margin-bottom: 12px; }
.pbar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.pbar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.sp-sec { margin-bottom: 18px; }
.sp-sec-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 8px; flex-wrap: wrap; }
.sp-sec-h h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 16px; }
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.sp-empty { grid-column: 1 / -1; padding: 22px 16px; text-align: center; color: var(--text-2); font-size: 13.5px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); }
.sp-note { grid-column: 1 / -1; }
.sp-more { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.sp-more > summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; }
.sp-more > summary::-webkit-details-marker { display: none; }
.sp-rows { border-top: 1px solid var(--border); padding: 4px 0; }
.sp-rows .sp-note { padding: 8px 14px; }
.sp-own-tip { margin: 6px 0 10px; }
.sp-foot { margin-top: 18px; line-height: 1.5; }

/* answer card */
.vcard { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--border-strong); color: var(--text); text-decoration: none; min-width: 0; }
.vcard:hover { text-decoration: none; border-color: var(--border-strong); }
.vcard.vc-buy { border-left-color: var(--vd-buy); } .vcard.vc-wait { border-left-color: var(--vd-wait); } .vcard.vc-no { border-left-color: var(--vd-no); }
.vcard.vc-hold { border-left-color: var(--vd-hold); } .vcard.vc-sell { border-left-color: var(--vd-sell); } .vcard.vc-nodata { border-left-color: var(--muted); }
.vc-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.vc-tk { font-family: var(--font-mono); font-weight: 850; font-size: 16px; flex: 0 0 auto; }
.vc-nm { font-size: 12px; color: var(--muted); flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-px { flex: 0 0 auto; font-weight: 750; font-variant-numeric: tabular-nums; }
.vc-px em { font-style: normal; font-size: 12px; font-weight: 650; }
.vc-mid { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vc-mid .vd { height: 30px; font-size: 14px; }
.vc-soon, .vc-own { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); }
.vc-line { font-size: 13.5px; line-height: 1.4; }
.vnums { display: flex; flex-wrap: wrap; gap: 6px; }
.vn { display: inline-flex; align-items: baseline; gap: 5px; padding: 4px 8px; border-radius: 8px; background: var(--surface-2); font-size: 12.5px; }
.vn i { font-style: normal; color: var(--muted); font-size: 11.5px; }
.vn b { font-variant-numeric: tabular-nums; }
.vn em { font-style: normal; font-size: 11px; color: var(--text-2); }
.vn-buy b { color: var(--vd-buy); } .vn-stop b { color: var(--down); }

/* compact rows (long "jangan beli" list) */
.vrow { display: grid; grid-template-columns: 64px 84px auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 14px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); font-size: 13px; }
.vrow:last-of-type { border-bottom: 0; }
.vrow:hover { background: var(--surface-2); text-decoration: none; }
.vr-tk { font-family: var(--font-mono); font-weight: 800; }
.vr-px { text-align: right; font-variant-numeric: tabular-nums; }
.vr-line { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vrow .vd { height: 22px; font-size: 10.5px; padding: 0 7px; }
@media (max-width: 760px) {
  .sp-head h1 { font-size: 21px; }
  .sp-check { flex: 1 1 100%; }
  .sp-grid { grid-template-columns: minmax(0, 1fr); }
  .vrow { grid-template-columns: 58px minmax(0, 1fr) auto; }
  .vrow .vr-line { grid-column: 1 / -1; white-space: normal; font-size: 12px; }
  .vrow .vr-px { text-align: left; }
}

/* stock page: the answer on top; the full analysis behind "Lihat analisis lengkap" in simple mode */
.verdict-card { background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--border-strong); border-radius: var(--r-lg); padding: 14px 16px; margin-bottom: 14px; display: grid; gap: 10px; }
.verdict-card.vc-buy { border-left-color: var(--vd-buy); background: color-mix(in srgb, var(--vd-buy) 5%, var(--surface)); }
.verdict-card.vc-wait { border-left-color: var(--vd-wait); } .verdict-card.vc-no { border-left-color: var(--vd-no); }
.verdict-card.vc-hold { border-left-color: var(--vd-hold); } .verdict-card.vc-sell { border-left-color: var(--vd-sell); background: color-mix(in srgb, var(--vd-sell) 5%, var(--surface)); }
.vd-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vd-extra { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.vd-line { font-size: 16px; font-weight: 600; line-height: 1.4; }
.vd-why { line-height: 1.45; }
.vd-actions { gap: 8px; }
body.ui-full .vd-full-btn { display: none; }
body.ui-simple:not(.stock-full) .full-only { display: none !important; }
@media (max-width: 760px) { .vd-line { font-size: 15px; } .verdict-card { padding: 12px; } }

/* "Saham Saya" */
.mine-item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mine-act { display: flex; gap: 6px; justify-content: flex-end; align-items: center; padding: 0 4px; }

/* "Sambungkan Data Real" */
.conn-now.ok { border-color: color-mix(in srgb, var(--up) 40%, transparent); }
.conn-now.nc { border-color: color-mix(in srgb, var(--down) 35%, transparent); }
.preset-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.preset-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.preset-card input { margin-top: 4px; accent-color: var(--accent); width: 18px; height: 18px; flex: 0 0 auto; }
.pc-body { display: grid; gap: 4px; min-width: 0; }
.pc-t { font-size: 15px; }
.qc-checks { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.qc-checks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; background: var(--surface-2); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.qc-checks .qc-d { display: block; word-break: break-word; }
.qc-checks .ok .qc-ic { color: var(--up); font-weight: 900; } .qc-checks .bad .qc-ic { color: var(--down); font-weight: 900; } .qc-checks .na .qc-ic { color: var(--muted); }
.mode-switch { justify-content: center; }

/* simple mode: one search box per screen, no indicator chips until the full analysis is opened */
body.ui-simple.page-simple .topbar .search { display: none; }
@media (max-width: 760px) { body.ui-simple .topbar .search { display: none; } body.ui-simple .topbar .page-title { flex: 1 1 auto; } }
body.ui-simple:not(.stock-full) #ov-chips { display: none; }

/* ==========================================================================
   v1.3 "ChatGPT cari sendiri" — answers from ChatGPT web search (unverified prices)
   ========================================================================== */
.gpt-chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11px; font-weight: 800; letter-spacing: .02em; white-space: nowrap;
  color: var(--ai); background: var(--ai-soft); border: 1px dashed color-mix(in srgb, var(--ai) 55%, transparent); }
.gpt-chip.sm { height: 19px; font-size: 10.5px; padding: 0 7px; }
.gpt-wrap { margin-bottom: 6px; }
.gpt-sec { background: color-mix(in srgb, var(--ai) 4%, var(--bg)); border: 1px solid color-mix(in srgb, var(--ai) 25%, var(--border)); border-radius: var(--r-lg); padding: 14px; }
.gpt-sec .sp-sec-h h2 svg { color: var(--ai); }
.gpt-sec h3 { font-size: 14.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gpt-meta { margin: 2px 0 6px; }
.gpt-sum { margin: 6px 0; font-size: 14px; line-height: 1.45; max-width: 860px; }
.gpt-ihsg { color: var(--text-2); margin: 4px 0; }
.gpt-warn { margin: 6px 0; padding-left: 18px; color: var(--warn); }
.gpt-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 8px; }
.gpt-actions .btn svg, .gpt-bar .btn svg { color: inherit; }
.gpt-sec .sp-more { margin-top: 10px; }
.gpt-sec .sp-more .sp-grid { padding: 0 10px 10px; }
.gpt-run { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; margin: 8px 0; border-radius: var(--r); background: var(--ai-soft); border: 1px solid color-mix(in srgb, var(--ai) 30%, transparent); font-size: 13px; line-height: 1.45; }
.spin { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 1px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--ai) 30%, transparent); border-top-color: var(--ai); animation: gspin .8s linear infinite; }
@keyframes gspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.gcard { gap: 7px; }
.gcard .g-why, .gcard .g-risk { line-height: 1.45; color: var(--text-2); }
.gcard .g-why b, .gcard .g-risk b { color: var(--text); font-weight: 650; }
.gcard .g-iss { color: var(--warn); line-height: 1.4; }
.gcard .g-src { color: var(--text-2); line-height: 1.45; overflow-wrap: anywhere; }
.gcard .g-news { overflow-wrap: anywhere; }
.g-chk { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.g-chk-url { color: var(--up); background: var(--up-soft); }
.g-chk-none { color: var(--warn); background: var(--warn-soft); }
.g-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.g-foot .btn { margin-left: auto; }
.gpt-check-out { margin-bottom: 14px; }
.gpt-check-out .sp-sec-h h2 { font-size: 15px; }
.gpt-bar { display: grid; gap: 4px; margin-bottom: 10px; }
.mine-gpt { display: grid; gap: 4px; padding-left: 10px; border-left: 2px dashed color-mix(in srgb, var(--ai) 40%, transparent); }
.gpt-stock { margin-bottom: 14px; border-color: color-mix(in srgb, var(--ai) 30%, var(--border)); }
.gpt-stock .card-t svg { color: var(--ai); }
.gpt-stock .gcard { border-top: 0; border-right: 0; border-bottom: 0; padding: 4px 0 4px 12px; border-radius: 0; background: none; }
#sp-cta-gpt { background: var(--ai-soft); border: 1px solid color-mix(in srgb, var(--ai) 30%, transparent); border-radius: var(--r); padding: 10px 12px; margin-bottom: 12px; line-height: 1.5; }
#sp-cta-gpt .muted { display: block; font-size: 11.5px; margin-top: 2px; }
.sp-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin: 12px 0 6px; max-width: 900px; }
.sp-opt { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px 14px; display: grid; gap: 6px; align-content: start; }
.sp-opt:first-child { border-color: color-mix(in srgb, var(--ai) 40%, var(--border)); }
.sp-opt-t { font-size: 13.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sp-opt p { margin: 0; }
.sp-opt .btn { justify-self: start; }
/* "Sumber Data" page */
.src-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.src-tab { display: grid; gap: 2px; padding: 10px 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.src-tab:hover { border-color: var(--border-strong); text-decoration: none; }
.src-tab span { font-size: 11.5px; color: var(--muted); font-weight: 700; letter-spacing: .03em; }
.src-tab.on { border-color: color-mix(in srgb, var(--up) 50%, var(--border)); }
.src-tab.on span { color: var(--up); }
.gpt-setup { border-color: color-mix(in srgb, var(--ai) 30%, var(--border)); scroll-margin-top: 70px; }
#vendor { scroll-margin-top: 70px; }
.gpt-setup .card-t svg { color: var(--ai); }
.gpt-facts { margin: 0; padding-left: 18px; display: grid; gap: 6px; line-height: 1.45; max-width: 860px; }
.gpt-now { line-height: 1.6; color: var(--text-2); background: var(--surface-2); border-radius: var(--r); padding: 8px 10px; }
.gpt-now .positive { color: var(--up); } .gpt-now .negative { color: var(--down); }
.input-sm { height: 32px; font-size: 13px; }
@media (max-width: 760px) {
  .src-tabs { grid-template-columns: minmax(0, 1fr); }
  .gpt-sec { padding: 10px; }
  .g-foot .btn { margin-left: 0; }
}
.data-banner.gpt { background: var(--ai-soft); border-color: color-mix(in srgb, var(--ai) 35%, transparent); }
.data-banner.gpt b.t { color: var(--ai); }

/* ==========================================================================
   v1.4 — ChatGPT is the analyzer (only the OpenAI API key is needed)
   ========================================================================== */
.dp-GPT { background: var(--ai-soft); color: var(--ai); border-color: color-mix(in srgb, var(--ai) 40%, transparent); }
.sp-status .dot.gpt { background: var(--ai); }
/* "Pasang ChatGPT" — the one setup card */
.gpt-cta { background: color-mix(in srgb, var(--ai) 6%, var(--surface)); border: 1px solid color-mix(in srgb, var(--ai) 35%, var(--border)); border-radius: var(--r-lg); padding: 18px; margin-bottom: 14px; display: grid; gap: 10px; }
.gpt-cta-t { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; }
.gpt-cta-t svg { color: var(--ai); width: 22px; height: 22px; }
.gpt-cta p { margin: 0; max-width: 820px; line-height: 1.5; }
.gpt-cta .sp-steps { margin: 2px 0; }
.gpt-quick { display: flex; gap: 8px; flex-wrap: wrap; max-width: 760px; }
.gpt-quick .input { flex: 1 1 300px; min-width: 0; height: 44px; font-size: 15px; }
.gpt-quick .btn { flex: 0 0 auto; }
/* "Tanya ChatGPT" hero */
.gpt-hero { background: var(--surface); border: 1px solid color-mix(in srgb, var(--ai) 30%, var(--border)); border-radius: var(--r-lg); padding: 14px 16px; margin-bottom: 14px; display: grid; gap: 10px; }
.gpt-ask { display: grid; gap: 6px; }
.gpt-ask-l { font-weight: 750; font-size: 15px; }
.gpt-ask-row { position: relative; display: flex; gap: 8px; flex-wrap: wrap; }
.gpt-ask-row .input { flex: 1 1 260px; min-width: 0; height: 46px; font-size: 17px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.gpt-ask-row .input::placeholder { text-transform: none; font-weight: 500; letter-spacing: 0; }
.gpt-ask-row .btn { height: 46px; font-size: 15px; padding: 0 16px; }
.gpt-ask-row .search-results { top: 52px; }
.gpt-or { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gpt-or .btn svg, .gpt-ask .btn svg, .gpt-quick .btn svg { color: inherit; }
.gpt-disc { margin: 4px 0 0; }
@media (max-width: 760px) {
  .gpt-cta { padding: 14px; }
  .gpt-cta-t { font-size: 18px; }
  .gpt-quick .btn, .gpt-ask-row .btn { flex: 1 1 100%; }
  .gpt-or .btn { flex: 1 1 100%; }
}
#sp-gpt-run .gpt-run { margin: 0 0 14px; }
