:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: #0d1b2b;
  --panel2: #102338;
  --line: #233b52;
  --text: #e7f0fa;
  --muted: #8ea5bb;
  --cyan: #48c7d9;
  --blue: #5b9df5;
  --orange: #f2a65a;
  --green: #54d6a0;
  --red: #ff7777;
  --shadow: 0 16px 40px rgba(0,0,0,.22);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(1100px 550px at 10% -10%, #15314b 0%, transparent 65%), var(--bg); color: var(--text); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { max-width: 1480px; margin: 0 auto; padding: 22px clamp(14px, 3vw, 34px) 44px; }
.site-header { display:flex; align-items:center; justify-content:space-between; gap:18px; border-bottom:1px solid var(--line); padding: 4px 0 18px; margin-bottom:22px; }
.brand { display:flex; align-items:center; gap:12px; min-width: 230px; }
.brand img { width:40px; height:40px; }
.brand strong { display:block; font-size:14px; letter-spacing:.08em; text-transform:uppercase; }
.brand small { color:var(--muted); display:block; margin-top:3px; font-size:11px; }
.nav { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; }
.nav a { font-size:11px; color:var(--muted); padding:8px 10px; border:1px solid transparent; border-radius:9px; }
.nav a:hover, .nav a.active { color:var(--text); border-color:#31516b; background:#11263a; }
.eyebrow { color:var(--cyan); font-size:11px; font-weight:800; letter-spacing:.15em; text-transform:uppercase; }
h1 { font-size:clamp(25px, 3.2vw, 40px); letter-spacing:-.035em; line-height:1.08; margin:8px 0 10px; }
h2 { font-size:17px; margin:0 0 8px; }
h3 { font-size:13px; margin:0 0 8px; }
p { color:var(--muted); line-height:1.6; }
.lead { max-width:860px; font-size:14px; margin:0; }
.page-head { display:flex; align-items:flex-end; justify-content:space-between; gap:22px; margin-bottom:18px; }
.head-actions { display:flex; flex-wrap:wrap; gap:8px; }
.btn { border:1px solid #31516b; color:var(--text); background:#142a40; border-radius:9px; padding:9px 13px; font-size:12px; font-weight:700; transition:.15s; }
.btn:hover { background:#1a3b57; border-color:#4b789b; }
.btn.primary { background:#0e5362; border-color:#237e8d; }
.btn.primary:hover { background:#126a7b; }
.btn.subtle { background:transparent; }
.btn.warn { border-color:#84532f; background:#3b2a1d; }
.metrics { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:10px; margin:18px 0; }
.metric { background:linear-gradient(145deg, #10243a, #0b1928); border:1px solid var(--line); border-radius:13px; padding:13px 15px; box-shadow:var(--shadow); }
.metric span { display:block; color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.09em; }
.metric strong { display:block; font-size:23px; margin-top:7px; font-variant-numeric:tabular-nums; }
.metric small { color:var(--muted); font-size:10px; }
.workspace { display:grid; grid-template-columns:minmax(270px, 340px) minmax(0,1fr); gap:14px; align-items:start; }
.panel { background:rgba(13,27,43,.94); border:1px solid var(--line); border-radius:15px; padding:16px; box-shadow:var(--shadow); min-width:0; }
.panel + .panel { margin-top:0; }
.control-panel { position:sticky; top:12px; }
.panel-title { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px; }
.panel-title small { color:var(--muted); font-size:10px; }
.control-grid { display:grid; gap:12px; }
.control { display:grid; gap:6px; }
.control label { display:flex; align-items:center; justify-content:space-between; gap:10px; color:#c8d7e6; font-size:11px; }
.control output { color:var(--cyan); font-weight:800; font-variant-numeric:tabular-nums; }
.control select, .control input[type=number] { width:100%; background:#081624; border:1px solid #2b455d; color:var(--text); border-radius:8px; padding:9px 10px; outline:none; }
.control select:focus, .control input:focus { border-color:var(--cyan); }
.control input[type=range] { width:100%; accent-color:var(--cyan); }
.control .hint { color:#7891a8; font-size:10px; line-height:1.4; }
details { border-top:1px solid var(--line); padding-top:12px; margin-top:12px; }
summary { cursor:pointer; color:#dbe8f4; font-size:12px; font-weight:800; }
.visual-panel { min-height:500px; }
.visual-header { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:12px; }
.visual-header p { margin:0; font-size:11px; }
.visual-stage { border:1px solid #203a50; border-radius:12px; background:linear-gradient(180deg,#091827,#0b1d2d); overflow:hidden; min-height:330px; position:relative; }
.visual-stage canvas { width:100%; height:360px; display:block; }
.visual-stage svg { width:100%; height:auto; min-height:330px; display:block; }
.legend { display:flex; flex-wrap:wrap; gap:12px; margin-top:12px; color:var(--muted); font-size:10px; }
.legend span { display:inline-flex; align-items:center; gap:6px; }
.dot { width:8px; height:8px; border-radius:50%; display:inline-block; }
.info-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:12px; }
.info-card { border:1px solid var(--line); background:#0b1a29; padding:12px; border-radius:10px; }
.info-card strong { display:block; font-size:13px; margin-bottom:5px; }
.info-card p { font-size:11px; margin:0; }
.formula { background:#071522; border:1px solid #23445b; padding:12px; border-radius:10px; color:#ccebf2; font-family:ui-monospace, SFMono-Regular, Consolas, monospace; font-size:12px; overflow-wrap:anywhere; line-height:1.65; }
.status { display:inline-flex; gap:7px; align-items:center; padding:6px 9px; border-radius:99px; background:#132c40; color:#9bdce7; font-size:10px; font-weight:800; }
.status.good { color:#8be3bd; background:#12352f; }
.status.warn { color:#ffcb92; background:#3a2b1e; }
.status.bad { color:#ff9b9b; background:#3b2027; }
.small-note { font-size:10px; color:#7891a8; line-height:1.5; }
.table-wrap { overflow:auto; border:1px solid var(--line); border-radius:10px; margin-top:12px; }
table { width:100%; border-collapse:collapse; font-size:11px; min-width:620px; }
th, td { text-align:left; padding:9px 10px; border-bottom:1px solid #1e3448; white-space:nowrap; }
th { color:#9eb4c8; font-size:10px; text-transform:uppercase; letter-spacing:.06em; background:#10243a; }
td { color:#d8e5f1; }
tr:last-child td { border-bottom:0; }
.module-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-top:25px; }
.module-card { background:linear-gradient(145deg,#10243a,#0b1928); border:1px solid var(--line); border-radius:14px; padding:16px; min-height:150px; transition:.18s; }
.module-card:hover { transform:translateY(-2px); border-color:#3d6a88; }
.module-card .number { color:var(--cyan); font-size:10px; font-weight:900; letter-spacing:.12em; }
.module-card h3 { font-size:14px; margin:10px 0 7px; }
.module-card p { font-size:11px; margin:0 0 12px; }
.module-card .open { color:#9ddce6; font-size:10px; font-weight:800; }
.home-hero { padding:30px; border:1px solid #2b4c66; border-radius:18px; background:radial-gradient(500px 250px at 90% 20%,#17445a,transparent 70%),linear-gradient(120deg,#10243a,#0a1827); }
.home-hero p { max-width:800px; }
.home-stats { display:flex; gap:20px; flex-wrap:wrap; margin-top:20px; }
.home-stats strong { font-size:20px; display:block; }
.home-stats span { color:var(--muted); font-size:10px; text-transform:uppercase; }
.footer { margin-top:28px; padding-top:14px; border-top:1px solid var(--line); color:#6f879e; font-size:10px; display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.pill-row { display:flex; flex-wrap:wrap; gap:6px; }
.pill { border:1px solid #2a455d; background:#0b1a29; border-radius:99px; padding:6px 9px; color:#a9bfd2; font-size:10px; }
.range-row { display:grid; grid-template-columns:1fr auto; gap:10px; align-items:center; }
.range-row input { grid-column:1 / -1; }
.callout { border-left:3px solid var(--cyan); background:#0c2030; padding:11px 13px; border-radius:0 9px 9px 0; color:#bdd3e4; font-size:11px; line-height:1.5; margin-top:12px; }
@media (max-width:1100px) {
  .nav { max-width:650px; }
  .module-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:760px) {
  .app-shell { padding:14px 12px 28px; }
  .site-header { align-items:flex-start; flex-direction:column; }
  .nav { justify-content:flex-start; }
  .page-head { display:block; }
  .head-actions { margin-top:14px; }
  .workspace { grid-template-columns:1fr; }
  .control-panel { position:static; }
  .metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .metric strong { font-size:19px; }
  .visual-panel { min-height:0; }
  .visual-stage canvas { height:300px; }
  .module-grid { grid-template-columns:1fr; }
  .info-grid { grid-template-columns:1fr; }
  .home-hero { padding:20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior:auto !important; transition:none !important; }
}
