:root {
  --bg: #f4f8f7; --surface: #ffffff; --surface-2: #edf5f3; --surface-3: #dfeeea;
  --text: #102522; --muted: #506762; --line: #c6d9d4; --primary: #006b5b; --primary-2: #008b75;
  --accent: #7a4a00; --accent-soft: #fff0c9; --danger: #a12b2b; --success: #176b46;
  --shadow: 0 18px 45px rgba(6,45,39,.10); --radius: 20px; --radius-sm: 12px;
  --focus: #0a7e6c;
}
html[data-theme="dark"] {
  --bg: #061917; --surface: #0c2723; --surface-2: #10342e; --surface-3: #17463e;
  --text: #f4fbf9; --muted: #b9d0ca; --line: #28584f; --primary: #63dfc2; --primary-2: #8cebd5;
  --accent: #ffd166; --accent-soft: #41351a; --danger: #ff9b9b; --success: #8de7b9;
  --shadow: 0 22px 55px rgba(0,0,0,.28); --focus: #9bf0dd;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: radial-gradient(circle at 85% -10%, rgba(0,139,117,.18), transparent 32%), var(--bg); color: var(--text); line-height: 1.55; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip-link { position: fixed; left: 8px; top: -60px; z-index: 9999; background: var(--surface); padding: 10px 14px; border-radius: 8px; }
.skip-link:focus { top: 8px; }
.topbar { position: sticky; top: 0; z-index: 40; min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px clamp(16px, 3vw, 38px); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; min-width: 0; }
.brand-mark { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: linear-gradient(145deg, var(--primary), var(--surface-3)); font-size: 24px; box-shadow: var(--shadow); }
.brand strong { display:block; letter-spacing: .11em; font-size: 14px; }
.brand small { display:block; color: var(--muted); font-weight: 700; font-size: 12px; white-space: nowrap; }
.top-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.nav-compact, .avatar-link { text-decoration:none; font-weight:700; color:var(--muted); }
.avatar-link span { max-width:150px; overflow:hidden; text-overflow:ellipsis; display:inline-block; vertical-align:bottom; }
.icon-btn, .ghost-btn, .primary-btn, .secondary-btn, .danger-btn { border:0; border-radius:12px; min-height:42px; padding:10px 14px; display:inline-flex; align-items:center; justify-content:center; gap:8px; cursor:pointer; text-decoration:none; font-weight:800; transition:.18s ease; }
.icon-btn { width:42px; padding:0; background:var(--surface-2); color:var(--text); border:1px solid var(--line); }
.primary-btn { background:var(--primary); color:#04211c; }
html[data-theme="light"] .primary-btn { color:white; }
.secondary-btn { background:var(--surface-3); color:var(--text); border:1px solid var(--line); }
.ghost-btn { background:transparent; color:var(--text); border:1px solid var(--line); }
.danger-btn { background:transparent; color:var(--danger); border:1px solid color-mix(in srgb, var(--danger) 50%, var(--line)); }
.primary-btn:hover, .secondary-btn:hover, .ghost-btn:hover, .icon-btn:hover { transform:translateY(-1px); filter:brightness(1.04); }
.inline-form { display:inline; margin:0; }
.app-shell { display:grid; grid-template-columns: 230px minmax(0,1fr); min-height:calc(100vh - 72px); }
.sidebar { position:sticky; top:72px; align-self:start; height:calc(100vh - 72px); padding:24px 14px; border-right:1px solid var(--line); background:color-mix(in srgb, var(--surface) 78%, transparent); }
.sidebar a { display:flex; align-items:center; gap:12px; padding:12px 14px; margin:4px 0; border-radius:13px; color:var(--muted); text-decoration:none; font-weight:800; }
.sidebar a:hover, .sidebar a.active { color:var(--text); background:var(--surface-2); }
.main-content, .public-main { width:100%; min-width:0; }
.main-content { padding:clamp(20px, 3vw, 42px); }
.public-main { padding:0; }
.page-head { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:24px; flex-wrap:wrap; }
.eyebrow { color:var(--primary); font-size:12px; font-weight:900; letter-spacing:.14em; text-transform:uppercase; }
h1,h2,h3 { line-height:1.1; margin:0 0 10px; }
h1 { font-size:clamp(30px,4vw,54px); letter-spacing:-.04em; }
h2 { font-size:clamp(23px,2.5vw,34px); }
h3 { font-size:18px; }
p { margin:0 0 12px; }
.lead { color:var(--muted); max-width:760px; font-size:clamp(17px,2vw,20px); }
.grid { display:grid; gap:18px; }
.grid-2 { grid-template-columns:repeat(2,minmax(0,1fr)); }
.grid-3 { grid-template-columns:repeat(3,minmax(0,1fr)); }
.grid-4 { grid-template-columns:repeat(4,minmax(0,1fr)); }
.card { background:linear-gradient(160deg,var(--surface),color-mix(in srgb,var(--surface) 92%,var(--primary) 8%)); border:1px solid var(--line); border-radius:var(--radius); padding:20px; box-shadow:var(--shadow); min-width:0; }
.metric { position:relative; overflow:hidden; }
.metric::after { content:""; position:absolute; width:95px; height:95px; border-radius:50%; right:-38px; top:-45px; background:color-mix(in srgb,var(--primary) 16%,transparent); }
.metric-label { color:var(--muted); font-size:13px; font-weight:800; }
.metric-value { font-size:clamp(22px,3vw,34px); font-weight:900; letter-spacing:-.04em; margin-top:8px; word-break:break-word; }
.badge { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--line); background:var(--surface-2); border-radius:999px; padding:5px 9px; font-size:12px; font-weight:800; color:var(--muted); }
.badge.accent { background:var(--accent-soft); color:var(--accent); border-color:color-mix(in srgb,var(--accent) 45%,var(--line)); }
.hero { min-height:calc(100vh - 72px); display:grid; grid-template-columns:1.05fr .95fr; align-items:center; gap:clamp(32px,6vw,90px); padding:clamp(48px,7vw,100px) clamp(20px,7vw,100px); overflow:hidden; }
.hero-copy { max-width:760px; }
.hero h1 span { color:var(--primary); }
.hero-actions { display:flex; gap:12px; flex-wrap:wrap; margin:28px 0; }
.hero-orbit { min-height:520px; position:relative; display:grid; place-items:center; }
.time-core { width:min(420px,85vw); aspect-ratio:1; border-radius:50%; border:1px solid var(--line); background:radial-gradient(circle at 50% 50%, color-mix(in srgb,var(--primary) 28%,var(--surface)), var(--surface) 54%, transparent 55%), conic-gradient(from 20deg,color-mix(in srgb,var(--primary) 45%,transparent),transparent,var(--accent),transparent); display:grid; place-items:center; box-shadow:0 0 90px color-mix(in srgb,var(--primary) 20%,transparent); }
.time-core-inner { width:68%; aspect-ratio:1; border-radius:50%; background:var(--surface); border:1px solid var(--line); display:grid; place-items:center; text-align:center; padding:28px; box-shadow:inset 0 0 30px color-mix(in srgb,var(--primary) 10%,transparent); }
.time-core-inner strong { font-size:clamp(28px,5vw,48px); display:block; color:var(--primary); }
.orbit-chip { position:absolute; background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow); padding:10px 13px; border-radius:999px; font-weight:800; }
.orbit-chip.one { top:12%; left:3%; } .orbit-chip.two { right:0; top:27%; } .orbit-chip.three { bottom:16%; left:7%; } .orbit-chip.four { right:5%; bottom:8%; }
.feature-strip { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; padding:0 clamp(20px,7vw,100px) 70px; }
.feature-strip .card { box-shadow:none; }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px; }
#simGrid { grid-template-columns:minmax(300px,.82fr) minmax(0,1.5fr); align-items:start; }
.field { min-width:0; }
.field label { display:block; font-size:13px; font-weight:900; margin-bottom:6px; color:var(--muted); }
.field input, .field select, .field textarea { width:100%; min-height:46px; border:1px solid var(--line); border-radius:11px; background:var(--surface-2); color:var(--text); padding:10px 12px; }
.field textarea { min-height:120px; resize:vertical; }
.field input[type="checkbox"] { width:auto; min-height:auto; accent-color:var(--primary); transform:scale(1.2); margin-right:9px; }
.form-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:18px; }
.notice { border-left:4px solid var(--accent); background:var(--accent-soft); color:var(--text); padding:13px 16px; border-radius:10px; margin:14px 0; }
.error { border-left-color:var(--danger); background:color-mix(in srgb,var(--danger) 13%,var(--surface)); }
.success { border-left-color:var(--success); background:color-mix(in srgb,var(--success) 12%,var(--surface)); }

.sim-metrics .metric-value { font-size:clamp(25px,2.6vw,34px); word-break:normal; overflow-wrap:anywhere; }
.mc-grid { display:grid; gap:8px; margin-top:14px; }
.mc-row { display:flex; justify-content:space-between; align-items:baseline; gap:14px; padding:10px 0; border-bottom:1px solid var(--line); }
.mc-row:last-child { border-bottom:0; }
.mc-row strong { font-size:clamp(22px,2.3vw,30px); letter-spacing:-.03em; text-align:right; white-space:nowrap; }
.timing-card .metric-label { display:block; }
.timing-card .metric-value { display:block; font-size:clamp(23px,2.2vw,29px); white-space:nowrap; word-break:normal; }
.timing-values { display:grid; gap:12px; margin-top:12px; }
.timing-values > div { padding-bottom:10px; border-bottom:1px solid var(--line); }
.timing-values > div:last-child { border-bottom:0; }

.chart-shell { min-height:320px; padding:14px; border:1px solid var(--line); border-radius:16px; background:var(--surface-2); overflow:hidden; }
.chart-shell svg { display:block; width:100%; height:290px; }
.chart-legend { display:flex; flex-wrap:wrap; gap:12px; color:var(--muted); font-size:12px; font-weight:800; margin-top:8px; }
.legend-dot { width:10px; height:10px; border-radius:50%; display:inline-block; background:var(--primary); } .legend-dot.alt { background:var(--accent); }
.table-wrap { width:100%; overflow:auto; border:1px solid var(--line); border-radius:16px; }
table { width:100%; border-collapse:collapse; min-width:680px; background:var(--surface); }
th,td { text-align:left; padding:13px 14px; border-bottom:1px solid var(--line); vertical-align:top; }
th { color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.08em; background:var(--surface-2); }
.case-list { display:grid; gap:14px; }
.case-card { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:20px; align-items:center; }
.case-card p { color:var(--muted); max-width:900px; }
.case-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.filter-bar { display:grid; grid-template-columns:1.3fr repeat(3,1fr) auto; gap:10px; align-items:end; margin-bottom:18px; }
.pagination { display:flex; gap:8px; justify-content:center; align-items:center; margin-top:22px; flex-wrap:wrap; }
.timeline { display:grid; gap:14px; }
.timeline-step { display:grid; grid-template-columns:46px 1fr; gap:14px; align-items:start; }
.timeline-step .num { width:42px; height:42px; border-radius:50%; display:grid; place-items:center; font-weight:900; background:var(--surface-3); color:var(--primary); border:1px solid var(--line); }
.auth-wrap { min-height:calc(100vh - 72px); display:grid; place-items:center; padding:40px 20px; }
.auth-card { width:min(560px,100%); }
.auth-card .brand-panel { margin-bottom:20px; }
.kicker { font-weight:900; color:var(--primary); }
.divider { height:1px; background:var(--line); margin:18px 0; }
.site-footer { padding:28px clamp(20px,5vw,70px); color:var(--muted); font-size:13px; border-top:1px solid var(--line); background:var(--surface); }
.site-footer p { max-width:1200px; }
.text-muted { color:var(--muted); }
.stack { display:grid; gap:14px; }
.flex { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.right { margin-left:auto; }
.hero-stat { display:inline-flex; gap:8px; align-items:center; color:var(--muted); font-weight:800; margin-right:16px; }
.print-only { display:none; }
@media (max-width: 1050px) {
  .app-shell { grid-template-columns:88px minmax(0,1fr); }
  .sidebar a { justify-content:center; font-size:22px; }
  .sidebar a span { display:none; }
  .grid-4 { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .hero { grid-template-columns:1fr; }
  .hero-orbit { min-height:440px; }
  .feature-strip { grid-template-columns:repeat(2,1fr); }
  .filter-bar { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 720px) {
  .topbar { align-items:flex-start; }
  .brand small { display:none; }
  .nav-compact, .avatar-link span { display:none; }
  .app-shell { display:block; }
  .sidebar { position:sticky; top:66px; z-index:35; width:100%; height:auto; display:flex; overflow:auto; padding:8px 10px; border-right:0; border-bottom:1px solid var(--line); background:var(--bg); }
  .sidebar a { min-width:52px; margin:0 3px; padding:10px; }
  .main-content { padding:20px 14px 34px; }
  .grid-2,.grid-3,.grid-4,.form-grid { grid-template-columns:1fr; }
  #simGrid { grid-template-columns:1fr; }
  .feature-strip { grid-template-columns:1fr; padding:0 20px 45px; }
  .hero { padding:46px 20px; }
  .hero-orbit { min-height:380px; }
  .orbit-chip { font-size:12px; }
  .case-card { grid-template-columns:1fr; }
  .case-actions { justify-content:flex-start; }
  .filter-bar { grid-template-columns:1fr; }
  .metric-value { font-size:28px; }
}
@media (max-width: 430px) {
  .topbar { padding:9px 10px; }
  .brand-mark { width:40px; height:40px; }
  .top-actions { gap:5px; }
  .ghost-btn,.primary-btn,.secondary-btn,.danger-btn { min-height:40px; padding:9px 11px; }
  .hero-orbit { min-height:335px; }
  .time-core { width:285px; }
  .orbit-chip.two { right:-3%; } .orbit-chip.one { left:-4%; }
}
@media print {
  .topbar,.sidebar,.site-footer,.no-print { display:none !important; }
  .app-shell { display:block; }
  .main-content { padding:0; }
  .card { box-shadow:none; break-inside:avoid; }
  .print-only { display:block; }
}
.compare-editors .field { margin-top:10px; }
.compare-value { font-size:clamp(24px,2.5vw,32px); font-weight:900; letter-spacing:-.04em; margin:7px 0; white-space:nowrap; }
.quick-presets { display:flex; flex-wrap:wrap; gap:7px; margin-top:4px; }
.quick-presets button { min-height:34px; padding:6px 10px; font-size:12px; }
