:root {
  color-scheme: dark;
  --bg: #071019;
  --panel: #101c28;
  --panel-2: #142334;
  --line: #2a3b4e;
  --text: #edf6ff;
  --muted: #9fb0c1;
  --blue: #63a9ff;
  --green: #65d6a0;
  --paper: #c9a8ff;
  --danger: #ff8b8b;
}

* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 20% 0%, #112a3f 0, var(--bg) 34rem); color: var(--text); font: 16px/1.55 Inter, ui-sans-serif, system-ui, sans-serif; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.site-header { min-height: 68px; padding: 0 5vw; border-bottom: 1px solid var(--line); background: rgb(7 16 25 / 92%); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; backdrop-filter: blur(16px); }
.site-header nav { display: flex; gap: 1rem; align-items: center; }
.brand { color: var(--text); font-size: 1.25rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.page-shell { width: min(1180px, 92vw); margin: 0 auto; padding: 2.5rem 0 5rem; }
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .84rem; padding: 1.5rem 5vw; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 5vw, 4.4rem); line-height: 1.04; max-width: 900px; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
button, input { font: inherit; }
.hero { display: flex; justify-content: space-between; gap: 2rem; align-items: flex-end; padding: clamp(1.5rem, 4vw, 3.5rem); border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(145deg, rgb(20 45 66 / 94%), rgb(12 25 38 / 96%)); margin-bottom: 1.5rem; box-shadow: 0 20px 55px rgb(0 0 0 / 25%); }
.public-hero { background: linear-gradient(145deg, #123a58, #101b29 60%, #193c36); }
.paper-hero { background: linear-gradient(145deg, #33254f, #101b29 68%); }
.hero p { color: #c4d5e4; max-width: 720px; }
.hero-stat { min-width: 230px; border-left: 1px solid var(--line); padding-left: 1.5rem; display: grid; }
.hero-stat strong { font-size: 2rem; }
.hero-stat span, .hero-stat small { color: var(--muted); }
.eyebrow { color: var(--green) !important; font-size: .76rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; margin-bottom: .55rem; }
.tab-row { display: flex; gap: .5rem; overflow-x: auto; margin: 1.25rem 0 2.5rem; }
.tab-row a { padding: .65rem 1rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); white-space: nowrap; }
.tab-row a.active { background: var(--text); color: #08111a; border-color: var(--text); }
.section-heading, .card-top { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 2.5rem; }
.account-grid.compact { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.account-card, .panel, .metric-card { border: 1px solid var(--line); background: linear-gradient(145deg, var(--panel-2), var(--panel)); border-radius: 18px; padding: 1.35rem; }
.account-card h3 { font-size: 1.2rem; margin-bottom: .25rem; }
.account-value { font-size: 2rem; font-weight: 760; margin: 1.25rem 0 0; }
.risk-pill, .badge { display: inline-flex; border-radius: 999px; padding: .32rem .64rem; font-size: .74rem; font-weight: 800; white-space: nowrap; }
.risk-pill { background: #17324d; color: #acd4ff; }
.badge.neutral { background: #203041; color: #d3e2f1; }
.badge.paper { background: #443460; color: #eadcff; }
.badge.assisted { background: #1b4a3a; color: #a8f0cc; margin-left: .3rem; }
.muted, small { color: var(--muted); }
.tfsa-block { display: grid; gap: .25rem; margin: 1rem 0; padding: .8rem; background: #0a1723; border-left: 3px solid var(--green); border-radius: 8px; font-size: .88rem; }
.holding-list { margin-top: 1rem; border-top: 1px solid var(--line); }
.holding-list > div { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid rgb(42 59 78 / 55%); }
.panel { margin: 1.25rem 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }
.notice { border: 1px solid #3b5268; border-radius: 14px; background: #0b1722; color: #bed0df; padding: 1rem; margin-top: 2rem; }
.paper-band { margin: 3.5rem 0 1rem; padding: 2rem; border-top: 4px solid var(--paper); border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgb(68 52 96 / 45%), transparent); }
.auth-card { width: min(520px, 100%); margin: 4rem auto; border: 1px solid var(--line); background: var(--panel); border-radius: 20px; padding: 2rem; }
.auth-card.wide { width: min(700px, 100%); }
.stacked-form p { display: grid; gap: .35rem; }
.stacked-form input[type="text"], .stacked-form input[type="password"], .stacked-form input[type="email"], .stacked-form input[type="number"] { width: 100%; padding: .72rem; color: var(--text); border: 1px solid var(--line); border-radius: 8px; background: #09131e; }
.checkbox-form p:has(input[type="checkbox"]) { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: .55rem; }
.primary-button, .secondary-button { display: inline-block; border: 0; border-radius: 9px; padding: .75rem 1rem; font-weight: 750; cursor: pointer; }
.primary-button { color: #06121b; background: var(--green); }
.secondary-button { color: var(--text); background: #20364a; }
.error { color: var(--danger); }
.message { margin-bottom: 1rem; padding: .8rem 1rem; border: 1px solid #326b55; border-radius: 10px; background: #102c23; }
.inline-form { display: inline; }
.link-button { border: 0; background: none; color: var(--blue); padding: 0; cursor: pointer; }
.admin-list > div { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.admin-list small { display: block; }
.empty-state { color: var(--muted); padding: 1rem 0; }

@media (max-width: 720px) {
  .site-header { align-items: flex-start; padding-block: 1rem; }
  .site-header nav { flex-wrap: wrap; justify-content: flex-end; }
  .hero { align-items: flex-start; flex-direction: column; }
  .hero-stat { border-left: 0; border-top: 1px solid var(--line); padding: 1rem 0 0; width: 100%; }
  .account-grid { grid-template-columns: 1fr; }
  .page-shell { width: min(94vw, 1180px); padding-top: 1.25rem; }
}
