:root {
  color-scheme: dark;
  --canvas: oklch(0.155 0.012 255);
  --surface: oklch(0.205 0.014 255);
  --surface-raised: oklch(0.245 0.016 255);
  --surface-hover: oklch(0.275 0.018 255);
  --line: oklch(0.34 0.015 255);
  --line-strong: oklch(0.45 0.018 255);
  --ink: oklch(0.95 0.008 255);
  --muted: oklch(0.72 0.015 255);
  --quiet: oklch(0.58 0.014 255);
  --accent: oklch(0.77 0.16 195);
  --buy: oklch(0.74 0.18 150);
  --buy-bg: oklch(0.27 0.065 150);
  --sell: oklch(0.7 0.2 27);
  --sell-bg: oklch(0.27 0.065 27);
  --wait: oklch(0.82 0.15 86);
  --wait-bg: oklch(0.27 0.052 86);
  --focus: oklch(0.84 0.14 195);
  --radius: 12px;
  --z-sticky: 20;
  --z-toast: 40;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--canvas); scroll-behavior: smooth; }

body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--canvas); color: var(--ink); }

button, input { font: inherit; }
button { color: inherit; }

button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.skip-link { position: fixed; left: 16px; top: 12px; z-index: 100; transform: translateY(-150%); background: var(--accent); color: var(--canvas); padding: 10px 14px; border-radius: 8px; font-weight: 700; }
.skip-link:focus { transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.topbar { height: 72px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: var(--canvas); position: sticky; top: 0; z-index: var(--z-sticky); }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup h1 { margin: 0; font-size: 18px; letter-spacing: -0.02em; }
.brand-lockup p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.mark { width: 32px; height: 32px; display: flex; align-items: end; justify-content: center; gap: 3px; padding: 7px; background: var(--accent); border-radius: 8px; }
.mark span { display: block; width: 4px; border-radius: 3px; background: var(--canvas); }
.mark span:nth-child(1) { height: 8px; }.mark span:nth-child(2) { height: 16px; }.mark span:nth-child(3) { height: 12px; }
.session-cluster { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.session-state { display: inline-flex; align-items: center; gap: 7px; }
.session-state i, .source-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--quiet); }
.session-state.open i { background: var(--buy); box-shadow: 0 0 0 4px oklch(0.74 0.18 150 / 0.12); }

main { width: min(1600px, 100%); margin: 0 auto; padding: 22px 28px 36px; }
.command-strip { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.snapshot-copy { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.source-status { display: inline-flex; align-items: center; gap: 7px; color: var(--accent); font-size: 13px; font-weight: 700; white-space: nowrap; }
.source-status i { background: var(--accent); }
.snapshot-copy strong { font-size: 14px; }.snapshot-copy > span:last-child { color: var(--muted); font-size: 13px; }
.alert-actions { display: flex; gap: 8px; }
.button { border: 0; border-radius: 9px; min-height: 38px; padding: 0 14px; background: var(--accent); color: var(--canvas); font-size: 13px; font-weight: 750; cursor: pointer; transition: background 180ms ease, transform 180ms ease; }
.button:hover { background: oklch(0.84 0.15 195); }.button:active { transform: translateY(1px); }
.button.secondary { display: inline-flex; align-items: center; gap: 8px; background: var(--surface-raised); color: var(--ink); }
.button.secondary:hover { background: var(--surface-hover); }
.icon-button { width: 38px; padding: 0; font-size: 20px; background: transparent; border: 1px solid var(--line); color: var(--muted); }
.icon-button:hover { background: var(--surface); color: var(--ink); }

.view-tabs { display: flex; gap: 4px; margin: -2px 0 14px; border-bottom: 1px solid var(--line); }
.view-tab { min-height: 40px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 13px; font-weight: 750; cursor: pointer; }
.view-tab:hover { color: var(--ink); }.view-tab.active { border-bottom-color: var(--accent); color: var(--ink); }
.tab-count { display: inline-grid; min-width: 20px; min-height: 20px; margin-left: 6px; padding: 0 6px; place-items: center; border-radius: 999px; background: var(--surface-raised); color: var(--accent); font-size: 10px; }

.pulse { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; }
.pulse-item { position: relative; min-height: 94px; padding: 16px 18px; text-align: left; background: var(--surface); border: 0; border-right: 1px solid var(--line); cursor: pointer; }
.pulse-item:last-child { border-right: 0; }.pulse-item:hover { background: var(--surface-raised); }
.pulse-item.active::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.pulse-item.buy.active::after { background: var(--buy); }.pulse-item.sell.active::after { background: var(--sell); }.pulse-item.wait.active::after { background: var(--wait); }
.pulse-item span, .pulse-item small { display: block; color: var(--muted); font-size: 12px; }
.pulse-item strong { display: block; margin: 4px 0 1px; font-size: 27px; line-height: 1; letter-spacing: -0.035em; }
.pulse-item.buy strong { color: var(--buy); }.pulse-item.sell strong { color: var(--sell); }.pulse-item.wait strong { color: var(--wait); }
.movers-pulse .pulse-item { cursor: default; }.movers-pulse .pulse-item:hover { background: var(--surface); }

.workspace { display: grid; grid-template-columns: minmax(680px, 1fr) 370px; gap: 18px; align-items: start; }
.watchlist-panel, .detail-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.panel-heading { min-height: 74px; padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.panel-heading h2, .detail-topline h2 { margin: 0; font-size: 18px; letter-spacing: -0.02em; }.panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.search-control { width: min(260px, 38%); min-height: 38px; padding: 0 10px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--canvas); }
.search-control:focus-within { border-color: var(--accent); }.search-control input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }.search-control input::placeholder { color: var(--muted); opacity: 1; }
.table-shell { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 830px; }
th { height: 38px; padding: 0 12px; background: var(--canvas); color: var(--muted); font-size: 11px; font-weight: 650; text-align: left; white-space: nowrap; }
th button { width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: inherit; cursor: pointer; }
th.numeric, td.numeric { text-align: right; }.levels-col { min-width: 145px; }
tbody tr { border-top: 1px solid var(--line); cursor: pointer; transition: background 160ms ease; }
tbody tr:hover { background: var(--surface-raised); }tbody tr.selected { background: oklch(0.29 0.035 195); }
tbody tr:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
td { height: 60px; padding: 8px 12px; font-size: 13px; vertical-align: middle; }
.symbol-cell strong { display: block; font-size: 14px; }.symbol-cell span { display: block; max-width: 150px; margin-top: 3px; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.positive { color: var(--buy); }.negative { color: var(--sell); }.muted { color: var(--muted); }
.signal-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 25px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.signal-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.signal-chip.buy { color: var(--buy); background: var(--buy-bg); }.signal-chip.sell { color: var(--sell); background: var(--sell-bg); }.signal-chip.wait { color: var(--wait); background: var(--wait-bg); }.signal-chip.unavailable { color: var(--muted); background: var(--surface-raised); }
.ma-stack { font-size: 12px; white-space: nowrap; }.ma-stack .bullish { color: var(--buy); }.ma-stack .bearish { color: var(--sell); }
.level-stack { display: grid; gap: 2px; font-size: 11px; white-space: nowrap; }.level-stack .r { color: var(--sell); }.level-stack .s { color: var(--buy); }
.empty-state { padding: 56px 24px; text-align: center; }.empty-state strong, .empty-state span { display: block; }.empty-state span { margin-top: 6px; color: var(--muted); font-size: 13px; }
.empty-state span { max-width: 62ch; margin-left: auto; margin-right: auto; line-height: 1.5; }
.movers-heading { min-height: 78px; }.movers-method { color: var(--muted); font-size: 12px; white-space: nowrap; }.movers-method span { margin: 0 5px; color: var(--accent); }
.movers-table { min-width: 830px; }.movers-table .retrace-cell { color: var(--accent); font-weight: 750; }

.detail-panel { position: sticky; top: 90px; min-height: 600px; }
.detail-loading { padding: 22px; }.skeleton { display: block; height: 18px; width: 55%; margin-bottom: 18px; border-radius: 5px; background: var(--surface-raised); animation: pulse 1.3s ease-in-out infinite alternate; }.skeleton.wide { width: 85%; }.skeleton.tall { width: 100%; height: 180px; }
.detail-topline { min-height: 108px; padding: 20px; display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.detail-topline .signal-chip { align-self: flex-start; }
.group-label { display: block; margin-bottom: 5px; color: var(--accent); font-size: 11px; font-weight: 750; }.detail-topline h2 { font-size: 26px; }.detail-topline p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.price-block { padding: 18px 20px; border-bottom: 1px solid var(--line); }.price-block strong { font-size: 30px; letter-spacing: -0.035em; }.price-block > span { margin-left: 9px; font-size: 14px; font-weight: 700; }.price-block small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.mover-context { padding: 16px 20px; border-bottom: 1px solid var(--line); }.mover-context h3 { margin: 0; font-size: 13px; }.mover-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 12px 0 0; overflow: hidden; border-radius: 8px; background: var(--line); }.mover-grid div { padding: 10px; background: var(--canvas); }.mover-grid dt { color: var(--muted); font-size: 10px; }.mover-grid dd { margin: 4px 0 0; font-size: 13px; font-weight: 750; }
.evidence-section, .indicator-section, .level-section { padding: 18px 20px; border-bottom: 1px solid var(--line); }.section-heading { display: flex; align-items: center; justify-content: space-between; }.evidence-section h3, .indicator-section h3, .level-section h3 { margin: 0 0 13px; font-size: 13px; }.section-heading h3 { margin: 0; }.section-heading span { color: var(--muted); font-size: 11px; }
.evidence-list { display: grid; gap: 7px; margin: 12px 0 0; padding: 0; list-style: none; }.evidence-list li { display: flex; align-items: center; gap: 9px; min-height: 30px; color: var(--muted); font-size: 12px; }.evidence-list i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-style: normal; font-size: 10px; }.evidence-list .bullish i { background: var(--buy-bg); color: var(--buy); }.evidence-list .bearish i { background: var(--sell-bg); color: var(--sell); }.evidence-list .neutral i { background: var(--surface-raised); color: var(--muted); }
.indicator-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0; background: var(--line); border-radius: 8px; overflow: hidden; }.indicator-grid div { padding: 10px; background: var(--canvas); }.indicator-grid dt { color: var(--muted); font-size: 10px; }.indicator-grid dd { margin: 4px 0 0; font-size: 13px; font-weight: 700; }
.level-row { display: flex; justify-content: space-between; font-size: 12px; }.level-row span { color: var(--muted); }.level-row.resistance strong { color: var(--sell); }.level-row.support strong { color: var(--buy); }
.price-position { position: relative; height: 5px; margin: 14px 0; border-radius: 4px; background: linear-gradient(90deg, var(--buy), var(--wait) 50%, var(--sell)); }.price-position span { position: absolute; top: 50%; left: 50%; width: 11px; height: 11px; border: 2px solid var(--ink); border-radius: 50%; background: var(--canvas); transform: translate(-50%, -50%); }
.methodology { padding: 15px 20px; }.methodology summary { color: var(--muted); font-size: 12px; cursor: pointer; }.methodology p { color: var(--muted); font-size: 11px; line-height: 1.55; }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: var(--z-toast); display: grid; gap: 8px; }.toast { max-width: 340px; padding: 12px 14px; border-radius: 9px; background: var(--ink); color: var(--canvas); font-size: 13px; animation: toast-in 200ms ease-out; }
footer { width: min(1600px, 100%); margin: 0 auto; padding: 0 28px 24px; display: flex; justify-content: space-between; gap: 20px; color: var(--quiet); font-size: 11px; }

@keyframes pulse { to { opacity: 0.48; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } }

@media (max-width: 1080px) {
  .workspace { grid-template-columns: 1fr; }.detail-panel { position: static; min-height: 0; }.detail-panel[hidden] { display: none; }
}

@media (max-width: 720px) {
  .topbar { height: auto; min-height: 64px; padding: 10px 16px; }.brand-lockup p, #market-clock { display: none; }
  main { padding: 14px 12px 28px; }.command-strip { align-items: flex-start; }.snapshot-copy { display: grid; gap: 3px; }.snapshot-copy > span:last-child { display: none; }
  #notification-button { width: 38px; padding: 0; justify-content: center; }#notification-label { display: none; }
  .pulse { grid-template-columns: repeat(4, minmax(76px, 1fr)); overflow-x: auto; }.pulse-item { min-height: 78px; padding: 12px 10px; }.pulse-item strong { font-size: 22px; }.pulse-item small { display: none; }
  .panel-heading { align-items: stretch; flex-direction: column; gap: 12px; }.search-control { width: 100%; }
  .view-tabs { margin-top: 0; }.movers-method { white-space: normal; }
  .table-shell { overflow: visible; }table, thead, tbody { display: block; min-width: 0; }thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  tbody tr { min-height: 82px; padding: 12px; display: grid; grid-template-columns: 1fr auto auto; gap: 6px 12px; align-items: center; }
  td { height: auto; padding: 0; }.symbol-cell { grid-row: 1 / 3; }.symbol-cell span { max-width: 120px; }.price-cell { grid-column: 2; font-size: 15px; font-weight: 750; }.day-cell { grid-column: 3; }.setup-cell { grid-column: 2 / 4; text-align: right; }.ma-cell, .vwap-cell, .levels-cell { display: none; }
  .movers-table tbody tr { grid-template-columns: 1fr auto auto; }.movers-table .baseline-cell { grid-column: 2; }.movers-table .current-cell { grid-column: 3; }.movers-table .retrace-cell { grid-column: 2 / 4; text-align: right; }.movers-table .setup-cell { display: none; }
  footer { padding: 0 16px 20px; flex-direction: column; gap: 5px; }.toast-region { left: 12px; right: 12px; bottom: 12px; }.toast { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }*, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
