:root {
  color-scheme: dark;
  --black: #000000;
  --surface: #0d0d0d;
  --surface-2: #141414;
  --surface-3: #1b1b1b;
  --border: #282828;
  --border-soft: #1d1d1d;
  --white: #ffffff;
  --muted: #9b9b9b;
  --dim: #666666;
  --lime: #bcff2f;
  --orange: #ffb547;
  --red: #ff5c5c;
  font-family: OKXSans, Arial, "Helvetica Neue", sans-serif;
  background: var(--black);
  color: var(--white);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.login-page { display: grid; place-items: center; padding: 40px 20px; }
.login-shell { width: min(440px, 100%); }
.login-shell > .wordmark { margin: 0 0 36px; }
.login-panel { padding: 32px; }
.login-panel h1 { font-size: clamp(26px, 5vw, 36px); margin-bottom: 14px; }
.login-description { color: var(--muted); font-size: 14px; line-height: 1.6; margin-bottom: 28px; }
.login-panel form { display: grid; gap: 18px; }
.login-panel label { display: grid; gap: 8px; }
.login-panel input { width: 100%; }
.login-panel .lime-button { width: 100%; margin-top: 8px; }
.login-footer { color: var(--dim); text-align: center; font-size: 10px; letter-spacing: .14em; margin-top: 24px; }
button:disabled { cursor: wait; opacity: .6; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--black); }
section { scroll-margin-top: 88px; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.app-shell { width: min(1240px, calc(100% - 48px)); margin: 0 auto; }
.site-header { min-height: 72px; position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 36px; border-bottom: 1px solid var(--border-soft); background: rgba(0,0,0,.94); backdrop-filter: blur(16px); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 800; letter-spacing: .12em; }
.mark { width: 22px; height: 22px; display: grid; grid-template-columns: repeat(2, 9px); grid-template-rows: repeat(2, 9px); gap: 3px; transform: skew(-10deg); }
.mark i { display: block; background: var(--white); border-radius: 1px; }
.mark i:nth-child(2), .mark i:nth-child(3) { background: var(--lime); }
.main-nav { display: flex; align-items: stretch; gap: 26px; flex: 1; height: 72px; }
.main-nav a { display: inline-flex; align-items: center; position: relative; color: var(--muted); font-size: 13px; white-space: nowrap; transition: color .18s ease; }
.main-nav a:hover, .main-nav a.active { color: var(--white); }
.main-nav a.active::after { content: ""; height: 2px; position: absolute; left: 0; right: 0; bottom: 0; background: var(--lime); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-mode, .panel-status, .online-badge { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.status-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--lime); box-shadow: 0 0 14px rgba(188,255,47,.65); }
[data-connection="offline"] { color: var(--red); }
[data-connection="offline"] .status-dot { background: var(--red); box-shadow: none; }
[data-connection="waiting"] { color: var(--orange); }
[data-connection="waiting"] .status-dot { background: var(--orange); box-shadow: none; }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 50%; background: transparent; color: var(--white); font-size: 19px; line-height: 1; }
.icon-button:hover { border-color: var(--lime); color: var(--lime); }
.header-button, .secondary-button { border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--white); padding: 10px 16px; font-size: 12px; }
.header-button:hover, .secondary-button:hover { border-color: var(--white); }

.hero-section { min-height: 430px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); align-items: center; gap: 30px; padding: 72px 0 56px; }
.eyebrow, .section-kicker { margin: 0 0 14px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.live-line { width: 22px; height: 2px; display: inline-block; margin: 0 8px 3px 0; background: var(--lime); }
h1, h2, p { margin-top: 0; }
h1 { max-width: 700px; margin-bottom: 24px; font-size: clamp(46px, 6vw, 74px); line-height: .98; letter-spacing: -.055em; font-weight: 800; }
h1 span { color: var(--lime); }
h2 { margin-bottom: 0; font-size: 20px; letter-spacing: -.025em; }
.hero-description { max-width: 535px; margin-bottom: 30px; color: var(--muted); font-size: 16px; line-height: 1.5; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.primary-button, .lime-button { border: 0; border-radius: 999px; background: var(--white); color: var(--black); padding: 14px 19px; font-weight: 700; font-size: 13px; }
.primary-button span, .lime-button span, .secondary-button span { margin-left: 10px; }
.primary-button:hover { background: var(--lime); }
.secondary-button { display: inline-flex; align-items: center; padding: 13px 18px; }
.hero-orbit { width: min(360px, 80vw); height: 300px; position: relative; justify-self: end; }
.orbit-ring { position: absolute; inset: 50% auto auto 50%; border: 1px solid #2b2b2b; border-radius: 50%; transform: translate(-50%, -50%) rotate(-15deg); }
.ring-one { width: 270px; height: 130px; }
.ring-two { width: 310px; height: 210px; transform: translate(-50%, -50%) rotate(42deg); border-color: #202020; }
.orbit-core { width: 150px; height: 150px; position: absolute; top: 50%; left: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px solid #353535; border-radius: 50%; background: radial-gradient(circle at 50% 30%, #242424 0, #0b0b0b 63%); transform: translate(-50%, -50%); box-shadow: 0 0 60px rgba(188,255,47,.08); }
.orbit-core span, .orbit-core small { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .16em; }
.orbit-core strong { color: var(--lime); font-size: 42px; letter-spacing: -.08em; line-height: 1; }
.orbit-core strong span { color: var(--lime); font-size: 15px; letter-spacing: 0; }
.orbit-chip { position: absolute; display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; border: 1px solid #3a3a3a; border-radius: 50%; background: var(--surface); color: var(--lime); font-size: 10px; font-weight: 800; }
.chip-one { top: 26px; left: 30px; }.chip-two { top: 48px; right: 20px; }.chip-three { bottom: 22px; left: 72px; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
.metric-card { min-height: 124px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface); padding: 18px; }
.metric-card.metric-primary { border-color: #38530d; background: linear-gradient(120deg, rgba(188,255,47,.08), var(--surface) 55%); }
.metric-label, .metric-card small { color: var(--muted); font-size: 11px; }
.metric-card strong { margin: 12px 0 4px; font-size: 25px; letter-spacing: -.04em; }
.metric-card.metric-primary strong { color: var(--lime); }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); gap: 20px; margin-bottom: 20px; }
.panel { border: 1px solid var(--border-soft); border-radius: 16px; background: var(--surface); padding: 24px; }
.panel-heading, .radar-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-kicker { margin-bottom: 8px; color: var(--dim); }
.panel-status { padding: 6px 9px; border: 1px solid var(--border); border-radius: 999px; }
.online-badge { color: var(--lime); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
label { display: grid; gap: 7px; margin-bottom: 14px; color: var(--muted); font-size: 12px; }
.field-note { color: var(--dim); font-size: 10px; font-weight: 400; }
input, select, textarea { width: 100%; border: 1px solid var(--border); border-radius: 9px; outline: none; background: #090909; color: var(--white); padding: 11px 12px; }
input:focus, select:focus, textarea:focus { border-color: var(--lime); box-shadow: 0 0 0 2px rgba(188,255,47,.12); }
textarea { resize: vertical; }
.form-hint, .table-subtitle { margin: 2px 0 18px; color: var(--dim); font-size: 11px; line-height: 1.5; }
.lime-button { background: var(--lime); }
.lime-button:hover { background: #d1ff72; }
.message { min-height: 18px; margin: 12px 0 0; color: var(--lime); font-size: 12px; line-height: 1.45; }
.status { display: grid; gap: 0; }
.gauge-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; }
.gauge-card { min-height: 112px; display: grid; grid-template-rows: auto 1fr; gap: 10px; align-items: center; border: 1px solid var(--border-soft); border-radius: 12px; background: #090909; padding: 12px; }
.gauge-label { grid-column: 1 / -1; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.gauge-body { min-width: 0; display: flex; align-items: center; gap: 11px; }
.gauge { width: 76px; height: 38px; flex: 0 0 76px; position: relative; overflow: hidden; border-radius: 76px 76px 0 0; background: conic-gradient(from 270deg at 50% 100%, var(--lime) 0 calc(var(--gauge) / 2), #2b2b2b calc(var(--gauge) / 2) 50%, transparent 50% 100%); }
.gauge::after { content: ""; position: absolute; width: 54px; height: 27px; left: 11px; bottom: 0; border-radius: 54px 54px 0 0; background: #090909; }
.gauge-copy { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.gauge-value { display: block; min-width: 0; overflow: hidden; color: var(--white); font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 700; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.gauge-detail { display: block; overflow: hidden; color: var(--dim); font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.metric { display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--border-soft); padding: 13px 0; }
.metric:first-child { padding-top: 0; }.metric span { color: var(--muted); font-size: 12px; }.metric strong { max-width: 65%; color: var(--white); font-size: 12px; text-align: right; overflow-wrap: anywhere; }
.warning { margin-top: 12px; border-left: 2px solid var(--orange); background: rgba(255,181,71,.06); color: #e4b86f; padding: 9px 10px; font-size: 11px; line-height: 1.4; }
.openai-panel { margin-bottom: 28px; }
.ai-freshness { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; padding: 7px 10px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; white-space: nowrap; }
.ai-freshness.is-fresh { border-color: rgba(188,255,47,.45); background: rgba(188,255,47,.08); color: var(--lime); }
.ai-freshness.is-stale { border-color: rgba(255,181,71,.5); background: rgba(255,181,71,.08); color: var(--orange); }
.ai-freshness.is-error { border-color: rgba(255,92,92,.5); background: rgba(255,92,92,.08); color: var(--red); }
.ai-analysis-content { min-height: 96px; }
.ai-empty-state { border: 1px dashed var(--border); border-radius: 10px; color: var(--muted); padding: 18px; font-size: 12px; line-height: 1.5; }
.ai-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.ai-stat { min-width: 0; border: 1px solid var(--border-soft); border-radius: 10px; background: #090909; padding: 13px; }
.ai-stat span, .ai-detail > span { display: block; margin-bottom: 8px; color: var(--dim); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.ai-stat strong { display: block; overflow: hidden; color: var(--white); font-size: 16px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.ai-stat .decision-buy { color: var(--lime); }.ai-stat .decision-sell { color: var(--red); }.ai-stat .decision-hold { color: var(--orange); }
.ai-detail-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(220px, .75fr); gap: 10px; }
.ai-detail { min-width: 0; border-top: 1px solid var(--border-soft); padding: 15px 0 0; }
.ai-detail ul { display: grid; gap: 7px; margin: 0; padding-left: 18px; color: #d8d8d8; font-size: 12px; line-height: 1.45; }
.ai-detail p { margin: 0; color: #d8d8d8; font-size: 12px; line-height: 1.45; }

.radar-panel { margin-bottom: 28px; }
.radar-heading { align-items: flex-end; }
.table-subtitle { margin: 7px 0 0; }
.ai-callout { max-width: 440px; color: var(--lime); font-size: 12px; line-height: 1.4; text-align: right; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { border-bottom: 1px solid var(--border-soft); padding: 14px 10px; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--dim); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
td { color: #d8d8d8; }.table-wrap tbody tr:hover { background: #121212; }
td:first-child { color: var(--white); font-weight: 700; }
.pair-state, .state-badge { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 999px; padding: 4px 7px; color: var(--dim); font-size: 9px; font-weight: 800; letter-spacing: .06em; }
.pair-state.is-open, .state-badge.badge-open { border-color: rgba(188,255,47,.55); background: rgba(188,255,47,.09); color: var(--lime); }
.pair-state.is-signal { border-color: #686868; background: rgba(255,255,255,.06); color: var(--white); }
.pair-state.is-closed, .state-badge.badge-closed { border-color: #3b3b3b; color: #9b9b9b; }
.pair-state.is-neutral { color: #555; }
.row-open { background: rgba(188,255,47,.065); }
.row-signal { background: rgba(255,255,255,.025); }
.row-closed { background: rgba(255,255,255,.012); }
.row-open td:nth-child(3), .row-signal td:nth-child(3) { color: var(--lime); font-weight: 700; }
.history-panel { margin-bottom: 28px; }
.history-stats { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; color: var(--muted); font-size: 10px; }
.history-stats span { border: 1px solid var(--border); border-radius: 999px; padding: 6px 8px; }
.history-row-open { background: rgba(188,255,47,.045); }
.pnl-positive { color: var(--lime) !important; font-weight: 700; }
.pnl-negative { color: var(--red) !important; font-weight: 700; }
.pnl-neutral { color: var(--muted) !important; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 0 0 28px; color: var(--dim); font-size: 10px; letter-spacing: .08em; }

@media (max-width: 900px) { .main-nav { gap: 15px; }.main-nav a:nth-child(2) { display: none; }.hero-section, .workspace-grid { grid-template-columns: 1fr; }.hero-orbit { justify-self: center; }.metrics-grid { grid-template-columns: 1fr 1fr; }.ai-summary { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .app-shell { width: min(100% - 28px, 1240px); }.site-header { gap: 14px; }.main-nav { display: none; }.header-mode { display: none; }.header-button { padding: 9px 11px; font-size: 11px; }.hero-section { padding: 52px 0 40px; }.hero-orbit { transform: scale(.86); margin: -18px auto -14px; }.metrics-grid, .form-grid { grid-template-columns: 1fr; }.gauge-grid { grid-template-columns: 1fr 1fr; }.panel { padding: 18px; }.radar-heading, .panel-heading { display: grid; }.ai-callout { text-align: left; }.ai-summary, .ai-detail-grid { grid-template-columns: 1fr; }.history-stats { justify-content: flex-start; }.site-footer { display: grid; gap: 8px; } }
