:root {
  --ink: #0b0f14;
  --muted: #647083;
  --line: #dfe5ec;
  --surface: #ffffff;
  --canvas: #f3f6f8;
  --lime: #c7ff3d;
  --blue: #246bfd;
  --red: #e84f5f;
  --amber: #c27a10;
  --green: #16825d;
  --radius: 22px;
  --shadow: 0 22px 60px rgba(20, 32, 50, 0.09);
}

* { box-sizing: border-box; }
html { background: var(--canvas); color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 80% -10%, rgba(36, 107, 253, 0.11), transparent 34rem), var(--canvas); }
button, input { font: inherit; }
button { cursor: pointer; }

.page-shell { width: min(1240px, calc(100% - 40px)); margin: 0 auto; }
.topbar { min-height: 88px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(11, 15, 20, 0.1); }
.brand { color: inherit; text-decoration: none; display: inline-flex; gap: 12px; align-items: center; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--ink); color: var(--lime); font-weight: 850; letter-spacing: -0.04em; box-shadow: 0 10px 25px rgba(11, 15, 20, 0.18); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1rem; letter-spacing: -0.02em; }
.brand small { color: var(--muted); font-size: 0.66rem; letter-spacing: 0.16em; margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.topbar-actions form { margin: 0; }
.mode-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: #e9f8ef; color: #146849; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #20aa72; box-shadow: 0 0 0 5px rgba(32, 170, 114, 0.12); }
.text-button { border: 0; background: transparent; color: var(--muted); padding: 8px; }
.text-button:hover { color: var(--ink); }

main { padding: 46px 0 30px; }
.hero-grid { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 28px; align-items: stretch; }
.hero-copy { padding: 18px 4px 14px 0; }
.eyebrow { margin: 0 0 12px; color: var(--blue); font-size: 0.72rem; font-weight: 850; letter-spacing: 0.16em; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(2.65rem, 5.6vw, 5.1rem); line-height: 0.94; letter-spacing: -0.065em; margin-bottom: 24px; max-width: 820px; }
.hero-copy > p:not(.eyebrow) { color: var(--muted); font-size: 1.05rem; line-height: 1.68; max-width: 660px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 28px; }
.primary-button, .danger-button, .login-form button { min-height: 46px; border: 0; border-radius: 13px; padding: 0 18px; font-weight: 780; transition: transform 140ms ease, box-shadow 140ms ease; }
.primary-button, .login-form button { background: var(--ink); color: white; box-shadow: 0 12px 26px rgba(11, 15, 20, 0.16); }
.primary-button:hover, .login-form button:hover { transform: translateY(-1px); box-shadow: 0 16px 30px rgba(11, 15, 20, 0.2); }
.danger-button { color: #a52e3e; background: #fff0f2; border: 1px solid #ffd2d8; }
.danger-button:hover { background: #ffe5e9; }
.primary-button:disabled, .danger-button:disabled { cursor: wait; opacity: 0.58; transform: none; }
.action-status { color: var(--muted); font-size: 0.86rem; min-height: 1.2em; }
.halt-banner, .pause-banner { display: grid; gap: 4px; max-width: 660px; margin: 20px 0; padding: 13px 15px; border-radius: 13px; font-size: 0.84rem; }
.halt-banner { color: #8e2433; background: #fff0f2; border: 1px solid #ffd2d8; }
.pause-banner { color: #81500b; background: #fff5e7; border: 1px solid #f1d6ad; }
.halt-banner span, .pause-banner span { opacity: 0.82; line-height: 1.45; }

.equity-card { background: var(--ink); color: white; border-radius: 28px; padding: 28px; box-shadow: 0 32px 70px rgba(10, 18, 29, 0.19); overflow: hidden; position: relative; }
.equity-card::after { content: ""; position: absolute; width: 210px; height: 210px; border-radius: 50%; background: rgba(199, 255, 61, 0.11); filter: blur(2px); right: -95px; top: -100px; }
.card-heading { display: flex; justify-content: space-between; align-items: center; color: #aeb8c5; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
.status-dot { padding: 6px 9px; border-radius: 99px; font-size: 0.64rem; font-weight: 800; }
.status-running { background: rgba(199, 255, 61, 0.15); color: var(--lime); }
.status-paused, .status-halted { background: rgba(255, 167, 84, 0.15); color: #ffb46c; }
.equity-value { margin: 42px 0 20px; font-size: clamp(3.5rem, 7vw, 5.7rem); line-height: 0.9; letter-spacing: -0.07em; font-weight: 780; }
.equity-baseline { height: 7px; border-radius: 99px; background: #29303a; overflow: hidden; }
.equity-baseline span { display: block; width: 76%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--lime), #71f5ae); }
.equity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 14px; margin-top: 32px; }
.equity-grid small, .signal-strip small { color: #8f9aa8; display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 5px; }
.equity-grid strong { font-variant-numeric: tabular-nums; }

.signal-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 34px 0 22px; box-shadow: var(--shadow); }
.signal-strip > div { background: var(--surface); padding: 18px 20px; min-height: 78px; }
.signal-strip strong { font-size: 0.87rem; }
.good { color: var(--green); }
.warn { color: var(--amber); }
.locked { color: var(--red); }

.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 22px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.panel-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 22px; }
.panel-title .eyebrow { margin-bottom: 6px; }
.panel-title h2 { margin: 0; font-size: 1.42rem; letter-spacing: -0.035em; }
.panel-title > span, .version { color: var(--muted); font-size: 0.75rem; }
.version { border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.rule-line { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line); }
.rule-index { font: 0.75rem ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--blue); }
.rule-line strong { font-size: 0.92rem; }
.rule-line p { margin: 3px 0 0; color: var(--muted); font-size: 0.85rem; }
.benchmark-row { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 16px 0 7px; }
.benchmark-row span { color: var(--muted); font-size: 0.88rem; }
.benchmark-row small { font-size: 0.72rem; }
.benchmark-row strong { font-size: 1.55rem; letter-spacing: -0.04em; }
.benchmark-bar { height: 12px; border-radius: 99px; background: #edf1f5; overflow: hidden; }
.benchmark-bar span { display: block; height: 100%; border-radius: inherit; }
.strategy-bar { width: 95.8%; background: var(--blue); }
.baseline-bar { width: 100%; background: var(--ink); }
.panel-note { color: var(--muted); font-size: 0.84rem; line-height: 1.6; margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }

.table-panel { margin-bottom: 22px; padding-bottom: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 13px 12px; border-top: 1px solid var(--line); font-size: 0.82rem; vertical-align: top; }
th { color: var(--muted); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.11em; }
td { font-variant-numeric: tabular-nums; }
td:nth-child(4) { color: var(--muted); max-width: 420px; }
.run-status { display: inline-flex; padding: 5px 8px; border-radius: 99px; font-size: 0.68rem; font-weight: 760; }
.run-success { color: var(--green); background: #e9f8ef; }
.run-error { color: #a52e3e; background: #fff0f2; }
.run-running, .run-skipped { color: var(--amber); background: #fff5e7; }
.empty-row { color: var(--muted); text-align: center; padding: 32px; }

footer { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 0.74rem; border-top: 1px solid var(--line); padding: 24px 0 34px; }

.login-body { display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 15%, rgba(36, 107, 253, 0.16), transparent 30rem), #eef2f5; }
.login-shell { width: min(100%, 440px); }
.login-card { background: white; border: 1px solid var(--line); border-radius: 28px; padding: 34px; box-shadow: 0 28px 80px rgba(20, 32, 50, 0.14); }
.login-card .brand-mark { margin-bottom: 28px; }
.login-card h1 { font-size: 2.3rem; line-height: 1; letter-spacing: -0.055em; margin-bottom: 16px; }
.login-copy, .login-footnote { color: var(--muted); line-height: 1.6; font-size: 0.9rem; }
.login-form { display: grid; gap: 9px; margin-top: 26px; }
.login-form label { font-size: 0.78rem; font-weight: 700; }
.login-form input { width: 100%; height: 48px; border: 1px solid #cfd7e2; border-radius: 12px; padding: 0 13px; outline: none; }
.login-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(36, 107, 253, 0.1); }
.login-form button { margin-top: 6px; }
.login-footnote { margin: 22px 0 0; font-size: 0.75rem; }
.form-error { color: #a52e3e; background: #fff0f2; border: 1px solid #ffd2d8; border-radius: 10px; padding: 10px 12px; font-size: 0.8rem; }

@media (max-width: 900px) {
  .hero-grid, .content-grid { grid-template-columns: 1fr; }
  .signal-strip { grid-template-columns: 1fr 1fr; }
  .hero-copy { padding-right: 0; }
}

@media (max-width: 560px) {
  .page-shell { width: min(100% - 24px, 1240px); }
  .topbar { min-height: 76px; }
  .brand small { display: none; }
  .mode-pill { font-size: 0.62rem; padding: 7px 9px; }
  main { padding-top: 30px; }
  h1 { font-size: 3rem; }
  .equity-card, .panel { border-radius: 18px; padding: 20px; }
  .signal-strip { grid-template-columns: 1fr; }
  .signal-strip > div { min-height: auto; }
  footer { flex-direction: column; }
  .login-card { padding: 26px; border-radius: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
