:root {
  color-scheme: light;
  --ink: #071b33;
  --ink-2: #163553;
  --muted: #60748a;
  --line: #dce6ef;
  --surface: #ffffff;
  --surface-2: #f4f8fb;
  --blue: #176bff;
  --blue-dark: #0b4bc2;
  --teal: #16b8b1;
  --green: #087f5b;
  --red: #c92a3a;
  --amber: #9a6300;
  --shadow: 0 18px 50px rgba(7, 27, 51, .11);
  --shadow-sm: 0 8px 24px rgba(7, 27, 51, .08);
  --radius: 18px;
  --radius-sm: 11px;
  --shell: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--surface-2);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--blue-dark); text-underline-offset: 3px; }
a:hover { color: var(--blue); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(23, 107, 255, .35); outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.025em; }
h1 { font-size: clamp(2.25rem, 4.5vw, 4.75rem); }
h2 { font-size: clamp(1.55rem, 2.5vw, 2.55rem); }
h3 { font-size: 1.2rem; }
small { color: var(--muted); }
.shell { width: min(calc(100% - 36px), var(--shell)); margin-inline: auto; }
.section { padding: 84px 0; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip-link { position: fixed; z-index: 1000; top: 12px; left: 12px; transform: translateY(-150%); background: var(--surface); padding: 10px 16px; border-radius: 8px; }
.skip-link:focus { transform: translateY(0); }

.site-header { position: sticky; z-index: 100; top: 0; background: rgba(255,255,255,.92); border-bottom: 1px solid rgba(220,230,239,.9); backdrop-filter: blur(18px); }
.nav-shell { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 26px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand img { flex: 0 0 auto; }
.brand span { display: grid; line-height: 1.05; }
.brand strong { font-size: 1rem; letter-spacing: -.01em; }
.brand small { margin-top: 5px; font-size: .64rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--teal); }
.main-nav { display: flex; align-items: center; gap: 5px; }
.main-nav > a, .nav-logout button { padding: 10px 12px; color: var(--ink-2); font-size: .9rem; font-weight: 700; text-decoration: none; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.main-nav > a:hover, .nav-logout button:hover { background: #eaf2ff; color: var(--blue-dark); }
.main-nav .nav-cta { background: var(--ink); color: white; padding-inline: 18px; }
.main-nav .nav-cta:hover { background: var(--blue); color: white; }
.nav-logout { margin: 0; }
.nav-toggle { display: none; width: 44px; height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.nav-toggle > span:not(.sr-only) { display: block; height: 2px; margin: 5px 0; background: var(--ink); }

.flash-stack { position: fixed; z-index: 90; top: 88px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; pointer-events: none; }
.flash { justify-self: end; max-width: 680px; padding: 13px 17px; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-sm); background: white; font-weight: 700; pointer-events: auto; }
.flash-success { border-left: 5px solid var(--green); }
.flash-error { border-left: 5px solid var(--red); }
.flash-warning { border-left: 5px solid #f0a202; }

.hero { position: relative; overflow: hidden; min-height: 700px; display: grid; align-items: center; color: white; background: radial-gradient(circle at 72% 18%, rgba(22,184,177,.22), transparent 28%), linear-gradient(135deg, #051527 0%, #0b2c50 62%, #0b4462 100%); }
.hero::after { content: ""; position: absolute; inset: auto -10% -48% 30%; height: 500px; border-radius: 50%; background: rgba(23,107,255,.09); filter: blur(4px); }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.02fr .98fr; gap: 76px; align-items: center; padding-block: 82px; }
.eyebrow { display: block; margin-bottom: 13px; color: var(--teal); font-size: .72rem; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.hero h1 { max-width: 760px; margin-bottom: 24px; }
.hero-lead { max-width: 650px; color: #cbd9e8; font-size: 1.2rem; }
.hero-actions, .toolbar { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border: 1px solid transparent; border-radius: 10px; font-weight: 800; text-decoration: none; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--blue), #0d55da); color: white; box-shadow: 0 9px 22px rgba(23,107,255,.23); }
.btn-primary:hover { color: white; background: var(--blue-dark); }
.btn-secondary { border-color: #a9bed2; background: white; color: var(--ink); }
.hero .btn-secondary { border-color: rgba(255,255,255,.38); color: white; background: rgba(255,255,255,.06); }
.btn-light { background: white; color: var(--ink); }
.btn-ghost { border-color: var(--line); background: white; color: var(--ink-2); }
.btn-danger { background: #fff0f1; border-color: #f4bdc2; color: var(--red); }
.btn-small { min-height: 36px; padding: 7px 11px; font-size: .78rem; }
.btn-block { width: 100%; }
.trust-row { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 38px; color: #a9c1d6; font-size: .82rem; font-weight: 750; }
.trust-row span::before { content: "✓"; margin-right: 7px; color: #5ee6df; }

.hero-visual { position: relative; min-height: 450px; display: grid; place-items: center; }
.signal-orbit { position: absolute; border: 1px solid rgba(94,230,223,.2); border-radius: 50%; }
.orbit-one { width: 510px; height: 510px; }
.orbit-two { width: 390px; height: 390px; }
.market-card { position: relative; z-index: 2; width: min(100%, 560px); padding: 24px; border: 1px solid rgba(255,255,255,.15); border-radius: 23px; background: rgba(5,21,39,.68); box-shadow: 0 28px 80px rgba(0,0,0,.32); backdrop-filter: blur(18px); }
.market-card-head { display: flex; justify-content: space-between; color: #cbd9e8; font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.live-dot { color: #5ee6df; }
.live-dot::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 5px rgba(94,230,223,.1); }
.market-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.market-metrics div { display: grid; gap: 3px; padding: 12px; border-radius: 9px; background: rgba(255,255,255,.06); }
.market-metrics span { color: #8fa9bf; font-size: .66rem; text-transform: uppercase; }
.market-metrics strong { font-size: .82rem; }
.floating-card { position: absolute; z-index: 3; min-width: 145px; padding: 13px 16px; border: 1px solid rgba(255,255,255,.2); border-radius: 12px; background: rgba(11,44,80,.88); box-shadow: var(--shadow); }
.floating-card span { display: block; color: #9db4c8; font-size: .68rem; text-transform: uppercase; }
.floating-card strong { color: white; }
.floating-a { top: 12%; right: -4%; }
.floating-b { bottom: 7%; left: -5%; }

.section-heading { max-width: 760px; margin: 0 auto 42px; }
.feature-grid, .action-grid, .candidate-grid, .prompt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card, .action-card, .candidate-card, .prompt-card, .panel, .metric-grid article { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.feature-card { padding: 30px; }
.feature-index { display: grid; width: 44px; height: 44px; place-items: center; margin-bottom: 40px; border-radius: 12px; background: #eaf2ff; color: var(--blue); font-weight: 900; }
.feature-card p, .action-card p { color: var(--muted); }
.section-dark { color: white; background: var(--ink); }
.split-callout { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 40px; }
.split-callout p { max-width: 760px; margin-bottom: 0; color: #b9cada; }

.page-hero, .admin-hero, .trade-hero, .performance-hero, .legal-hero { color: white; background: linear-gradient(135deg, #071b33, #0e3c67); }
.page-hero .shell, .admin-hero .shell, .trade-hero .shell, .performance-hero .shell, .legal-hero .shell { padding-block: 72px; }
.page-hero.compact .shell, .admin-hero.compact .shell { padding-block: 48px; }
.page-hero h1, .admin-hero h1, .trade-hero h1, .performance-hero h1, .legal-hero h1 { margin-bottom: 10px; font-size: clamp(2.1rem, 4vw, 3.7rem); }
.page-hero p, .admin-hero p, .trade-hero p, .performance-hero p { max-width: 760px; margin-bottom: 0; color: #c2d2e1; }
.trade-hero .shell, .performance-hero .shell { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.paper-badge, .secure-pill, .mode-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; color: #d7e9f5; background: rgba(255,255,255,.08); font-size: .72rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.paper-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }

.action-card { position: relative; min-height: 260px; padding: 30px; color: var(--ink); text-decoration: none; transition: border-color .2s, transform .2s, box-shadow .2s; }
.action-card:hover, .candidate-card:hover, .prompt-card:hover { color: var(--ink); transform: translateY(-3px); border-color: #aac8ff; box-shadow: var(--shadow); }
.action-card > span { color: var(--teal); font-weight: 900; }
.action-card h2 { margin-top: 46px; font-size: 1.55rem; }
.action-card strong { position: absolute; bottom: 28px; color: var(--blue); }

.auth-shell { min-height: calc(100vh - 76px); display: grid; grid-template-columns: minmax(360px, .9fr) minmax(480px, 1.1fr); }
.auth-visual { display: grid; align-content: center; padding: clamp(48px, 8vw, 130px); color: white; background: radial-gradient(circle at 80% 15%, rgba(22,184,177,.22), transparent 30%), var(--ink); }
.auth-visual h1 { font-size: clamp(2.4rem, 4vw, 4.2rem); }
.auth-visual p { color: #b9cada; font-size: 1.1rem; }
.auth-points { display: grid; gap: 11px; margin-top: 36px; color: #c8d8e5; font-weight: 700; }
.auth-points span::before { content: "◆"; margin-right: 9px; color: var(--teal); font-size: .66rem; }
.auth-shell > .auth-card { align-self: center; justify-self: center; width: min(90%, 600px); margin: 60px 0; }
.auth-card { width: 100%; max-width: 540px; padding: clamp(26px, 4vw, 46px); border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: var(--shadow); }
.auth-card.wide { max-width: 760px; }
.auth-card-head { margin-bottom: 27px; }
.auth-card h1, .auth-card h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); }
.auth-links { display: flex; justify-content: space-between; gap: 16px; margin-top: 20px; font-size: .88rem; font-weight: 700; }
.form-page { display: grid; place-items: center; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
form label { display: grid; gap: 7px; margin-bottom: 17px; color: var(--ink-2); font-size: .88rem; font-weight: 750; }
input, select, textarea { width: 100%; border: 1px solid #b9c9d8; border-radius: 9px; padding: 11px 12px; color: var(--ink); background: white; }
input:hover, select:hover, textarea:hover { border-color: #829bb2; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,107,255,.12); outline: 0; }
textarea { resize: vertical; }
.consent-box { margin: 20px 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.consent-box legend { padding: 0 5px; font-weight: 850; }
.check-row { grid-template-columns: auto 1fr; align-items: start; gap: 11px; }
.check-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--blue); }
.check-row small { display: block; }
.form-errors { margin: 0 0 20px; padding: 15px 17px; border: 1px solid #f0b7bd; border-left: 5px solid var(--red); border-radius: 9px; color: #81212c; background: #fff4f5; }
.form-errors ul { margin-bottom: 0; }
.step-list { display: grid; gap: 16px; padding-left: 22px; color: #c6d7e4; }
.secret-box { margin: 20px 0; padding: 18px; border: 1px dashed #9db4c8; border-radius: 10px; background: var(--surface-2); }
.mfa-setup-grid { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; margin: 22px 0; }
.qr-box { padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: var(--shadow-sm); }
.secret-box span { display: block; font-size: .74rem; font-weight: 800; text-transform: uppercase; }
.secret-box code, .break-code { overflow-wrap: anywhere; }
.recovery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 25px 0; }
.recovery-grid code { padding: 9px; border-radius: 7px; background: var(--ink); color: white; text-align: center; }

.admin-layout { display: grid; grid-template-columns: 235px minmax(0, 1fr); gap: 28px; align-items: start; padding-block: 34px 80px; }
.admin-sidebar { position: sticky; top: 100px; display: grid; gap: 3px; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: var(--shadow-sm); }
.admin-sidebar a { padding: 9px 10px; border-radius: 7px; color: var(--ink-2); font-size: .86rem; font-weight: 720; text-decoration: none; }
.admin-sidebar a:hover { background: #eef4ff; color: var(--blue-dark); }
.sidebar-label { margin: 14px 10px 4px; color: #8a9aab; font-size: .63rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.sidebar-label:first-child { margin-top: 4px; }
.admin-content { min-width: 0; display: grid; gap: 24px; }
.panel { padding: 24px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.panel-head h2 { margin-bottom: 0; font-size: 1.45rem; }
.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.quick-actions a { display: grid; gap: 5px; padding: 20px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: white; text-decoration: none; box-shadow: var(--shadow-sm); }
.quick-actions span { color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.quick-actions strong { color: var(--blue-dark); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.metric-grid article { padding: 20px; }
.metric-grid span { display: block; margin-bottom: 10px; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.metric-grid strong { display: block; font-size: clamp(1.2rem, 2.2vw, 1.65rem); }
.comparison-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-list, .profile-list { margin: 0; }
.detail-list div, .profile-list div { display: grid; grid-template-columns: 1fr auto; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.detail-list dt, .profile-list dt { color: var(--muted); }
.detail-list dd, .profile-list dd { margin: 0; font-weight: 800; text-align: right; }
.current-quote { background: linear-gradient(145deg, var(--ink), #103c63); color: white; border: 0; }
.current-quote .detail-list div { border-color: rgba(255,255,255,.13); }
.current-quote .detail-list dt, .current-quote .quote-state { color: #afc3d4; }
.quote-value { display: block; margin: 18px 0 2px; color: #5ee6df; font-size: 2.7rem; }
.quote-state { display: block; margin-bottom: 20px; font-size: .76rem; }
.quote-cta { margin-top: 20px; }
.quote-error { margin-top: 18px; }
.trade-guide { display: grid; gap: 20px; }
.trade-guide h2, .portfolio-help h2 { margin-bottom: 0; }
.trade-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0; padding: 0; list-style: none; }
.trade-steps li { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 10px; padding: 14px; border-radius: 11px; background: var(--surface-2); color: var(--muted); }
.trade-steps strong { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: white; background: var(--blue); }
.position-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 14px 16px; border: 1px solid #a9e0cb; border-radius: 11px; background: #ecfaf4; }
.position-notice span { color: var(--green); font-size: .72rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.position-notice a { margin-left: auto; font-weight: 800; }
.decision-note { margin: 0; color: var(--muted); font-size: .85rem; }
.unavailable-action { border-style: dashed; }
.unavailable-action p { margin-bottom: 0; color: var(--muted); }
.trade-form-panel { scroll-margin-top: 96px; }
.btn-buy { min-width: min(100%, 330px); }
.calculation-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 20px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--line); }
.calculation-strip div { padding: 16px; background: var(--surface-2); }
.calculation-strip span { display: block; color: var(--muted); font-size: .72rem; }
.calculation-strip strong { font-size: .95rem; }
.ticker-pill, .badge, .category, .grade { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: #eaf2ff; color: var(--blue-dark); font-size: .72rem; font-weight: 850; }
.ticker-pill.large { margin-right: 9px; font-size: .46em; vertical-align: middle; }
.badge-green { background: #e7f7f0; color: var(--green); }
.badge-blue { background: #eaf2ff; color: var(--blue-dark); }
.ticker-cell { color: var(--blue-dark); font-size: 1rem; }

.table-panel { padding: 0; overflow: hidden; }
.table-panel .panel-head { padding: 23px 24px 0; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .84rem; }
th, td { padding: 14px 15px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #52677b; background: #f7fafc; font-size: .68rem; letter-spacing: .07em; text-transform: uppercase; }
td small { display: block; margin-top: 4px; }
tbody tr:hover { background: #fbfdff; }
.row-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.row-actions form { display: flex; gap: 5px; margin: 0; }
.row-actions select, .sell-form input { min-width: 104px; padding: 7px; font-size: .78rem; }
.sell-form { display: flex; min-width: 260px; gap: 6px; align-items: start; }
.sell-form label { min-width: 82px; margin: 0; }
.sell-form .btn { white-space: nowrap; }
.owner-lock { color: var(--green); font-weight: 800; }
.permission-editor { margin-top: 9px; }
.permission-editor summary { color: var(--blue-dark); font-weight: 800; cursor: pointer; }
.permission-editor form { min-width: 420px; margin-top: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.permission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; }
.permission-grid label { margin-bottom: 7px; }
.positive { color: var(--green); font-weight: 850; }
.negative { color: var(--red); font-weight: 850; }
.empty-inline, .empty-state { padding: 30px; color: var(--muted); text-align: center; }
.empty-state { border: 1px dashed #afc0d0; border-radius: var(--radius); background: white; }
.toolbar { margin: 0; }

.date-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.date-grid a { display: grid; min-height: 95px; align-content: end; padding: 15px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: white; font-weight: 850; text-decoration: none; box-shadow: var(--shadow-sm); }
.date-grid a:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-2px); }
.candidate-card, .prompt-card { display: block; padding: 23px; color: var(--ink); text-decoration: none; transition: .2s ease; }
.candidate-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.decision-help { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; padding: 0; overflow: hidden; background: var(--line); }
.decision-help div { display: grid; gap: 5px; padding: 18px; background: white; }
.decision-help strong { color: var(--blue-dark); }
.decision-help span { color: var(--muted); font-size: .82rem; }
.decision-status { display: inline-flex; margin: -4px 0 14px; padding: 6px 9px; border-radius: 8px; background: #eef4ff; color: var(--blue-dark); font-size: .72rem; font-weight: 800; }
.decision-skip { background: #f0f2f4; color: #53677a; }
.decision-buy { background: #e7f7f0; color: var(--green); }
.open-position-badge { margin: 0 0 14px; padding: 9px 11px; border-left: 4px solid var(--green); border-radius: 7px; color: var(--green); background: #ecfaf4; font-size: .78rem; font-weight: 800; }
.position-link { display: block; margin-top: 11px; text-align: center; font-size: .82rem; font-weight: 800; }
.decision-actions { display: flex; gap: 7px; margin-top: 20px; }
.decision-actions form { flex: 1; margin: 0; }
.decision-actions button { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-2); background: var(--surface-2); font-size: .78rem; font-weight: 800; cursor: pointer; }
.decision-actions button:hover { border-color: var(--blue); color: var(--blue-dark); }
.decision-actions button.is-active { border-color: var(--blue); color: white; background: var(--blue-dark); }
.portfolio-help p { margin-bottom: 8px; color: var(--muted); }
#open-positions { scroll-margin-top: 96px; }
.prompt-panel pre, .methodology-text { overflow: auto; padding: 22px; border-radius: 12px; background: #061829; color: #d9e8f3; white-space: pre-wrap; word-break: break-word; font: 13px/1.58 ui-monospace, SFMono-Regular, Menlo, monospace; }

.performance-metrics { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 24px; }
.chart-panel-large { margin-bottom: 24px; }
.performance-chart { width: 100%; min-height: 320px; overflow: hidden; border-radius: 12px; background: linear-gradient(180deg, #f4f9ff, white); }
.chart-grid-line { stroke: #dce6ef; stroke-width: 1; }
.chart-line { fill: none; stroke: var(--blue); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.chart-benchmark { fill: none; stroke: var(--teal); stroke-width: 3; stroke-dasharray: 9 7; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: url(#performance-gradient); }
.chart-dot { fill: white; stroke: var(--blue); stroke-width: 3; }
.chart-label { fill: #657b90; font-size: 12px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 15px; color: var(--muted); font-size: .74rem; font-weight: 750; }
.chart-legend span::before { content: ""; display: inline-block; width: 22px; height: 3px; margin: 0 7px 2px 0; background: var(--blue); }
.chart-legend .legend-benchmark::before { background: repeating-linear-gradient(90deg, var(--teal) 0 6px, transparent 6px 10px); }

.legal-layout { display: grid; grid-template-columns: 260px minmax(0, 820px); gap: 42px; align-items: start; justify-content: center; }
.legal-toc { position: sticky; top: 104px; padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.legal-toc strong { display: block; margin-bottom: 10px; }
.legal-toc a { display: block; padding: 6px 0; font-size: .8rem; font-weight: 700; text-decoration: none; }
.legal-document { padding: clamp(26px, 5vw, 60px); border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow-sm); }
.legal-document h2 { margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 1.55rem; }
.legal-document h3 { margin-top: 26px; }
.legal-document p, .legal-document li { color: #324d67; }
.legal-meta { color: #d1dfeb; font-size: .82rem; }
.legal-intro { font-size: 1.08rem; }

.site-footer { padding: 40px 0; color: #9eb2c4; background: #041321; }
.footer-grid { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.footer-brand { display: flex; align-items: center; gap: 12px; color: white; }
.footer-brand div { display: grid; }
.footer-brand span { color: #8fa6ba; font-size: .76rem; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: end; gap: 18px; }
.site-footer a { color: #c7d6e3; font-size: .8rem; font-weight: 700; text-decoration: none; }
.site-footer p { grid-column: 1 / -1; margin: 0; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); font-size: .75rem; }

@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { max-width: 760px; }
  .hero-visual { max-width: 680px; width: 100%; margin-inline: auto; }
  .feature-grid, .action-grid, .candidate-grid, .prompt-grid { grid-template-columns: repeat(2, 1fr); }
  .decision-help { grid-template-columns: repeat(2, 1fr); }
  .quick-actions { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .date-grid { grid-template-columns: repeat(4, 1fr); }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { min-height: 410px; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; grid-template-columns: repeat(3, 1fr); }
  .admin-sidebar .sidebar-label { grid-column: 1 / -1; }
  .legal-layout { grid-template-columns: 1fr; }
  .legal-toc { position: static; columns: 2; }
}

@media (max-width: 780px) {
  .nav-toggle { display: block; }
  .main-nav { position: absolute; top: 76px; right: 18px; left: 18px; display: none; align-items: stretch; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: var(--shadow); }
  .main-nav.is-open { display: grid; }
  .nav-logout button { width: 100%; text-align: left; }
  .hero { min-height: auto; }
  .hero-grid { gap: 30px; padding-block: 60px; }
  .hero-visual { min-height: 350px; }
  .floating-card { display: none; }
  .feature-grid, .action-grid, .candidate-grid, .prompt-grid, .comparison-grid, .form-grid { grid-template-columns: 1fr; }
  .trade-steps, .decision-help { grid-template-columns: 1fr; }
  .split-callout, .footer-grid { grid-template-columns: 1fr; }
  .site-footer nav { justify-content: start; }
  .trade-hero .shell, .performance-hero .shell { align-items: start; flex-direction: column; }
  .date-grid { grid-template-columns: repeat(3, 1fr); }
  .calculation-strip { grid-template-columns: 1fr; }
  .admin-sidebar { grid-template-columns: repeat(2, 1fr); }
  .permission-editor form { min-width: 0; }
  .permission-grid { grid-template-columns: 1fr; }
  .mfa-setup-grid { grid-template-columns: 1fr; }
  .qr-box { justify-self: center; }
}

@media (max-width: 520px) {
  .shell { width: min(calc(100% - 24px), var(--shell)); }
  .brand span { display: none; }
  .section { padding-block: 58px; }
  .hero h1 { font-size: 2.55rem; }
  .hero-visual { min-height: 290px; }
  .market-card { padding: 15px; }
  .market-metrics { grid-template-columns: 1fr; }
  .metric-grid, .date-grid, .recovery-grid { grid-template-columns: 1fr; }
  .admin-sidebar { grid-template-columns: 1fr; }
  .auth-visual { min-height: 340px; padding: 44px 24px; }
  .auth-shell > .auth-card { width: calc(100% - 24px); }
  .legal-toc { columns: 1; }
}

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