/* PerpCalc Tools - design system
   Dark trading-terminal UI. No frameworks, no external CSS. */

:root {
  --bg: #06080c;
  --bg-2: #0a0e14;
  --panel: #0f151e;
  --panel-2: #0b1118;
  --panel-3: #141c28;
  --line: #1b2532;
  --line-2: #2a3648;
  --text: #e9eff7;
  --text-2: #b3c0d3;
  --muted: #8695aa;
  --dim: #5c6b80;
  --up: #16c784;
  --down: #f6465d;
  --accent: #1be3a6;
  --accent-ink: #03231a;
  --accent-2: #7b8cff;
  --gold: #f5c044;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 22px 44px -28px rgba(0, 0, 0, .95);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, canvas { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; font-weight: 650; }
h1 { font-size: clamp(2.1rem, 4.4vw, 3.5rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0 0 1em; padding-left: 1.15em; }
li { margin-bottom: .4em; }
strong { color: #fff; font-weight: 600; }
code, .mono { font-family: var(--mono); font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 780px; }
.section { padding: 72px 0; }
.section-tight { padding: 48px 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(6, 8, 12, .82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 26px; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(150deg, #1be3a6, #0f9e8a 60%, #0b6f7f);
  color: #04211a; font-family: var(--mono); font-weight: 700; font-size: 15px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08) inset;
}
.brand-name { font-size: 1.02rem; }
.brand-name span { color: var(--muted); font-weight: 500; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: 6px; }
.nav a { color: var(--text-2); font-size: .92rem; padding: 8px 11px; border-radius: 8px; }
.nav a:hover { color: #fff; background: var(--panel-3); text-decoration: none; }
.header-cta { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; }
.header-cta .menu-btn { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--panel-3); color: var(--text); font: inherit; font-weight: 550; font-size: .95rem;
  cursor: pointer; transition: transform .12s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; border-color: #3a4a63; background: #18212e; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, #22e9ad, #12c795);
  color: #03231a; border-color: transparent; font-weight: 650;
  box-shadow: 0 8px 24px -12px rgba(27, 227, 166, .55);
}
.btn-primary:hover { background: linear-gradient(180deg, #34f2b9, #16d29e); border-color: transparent; color: #03231a; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 13px; font-size: .86rem; border-radius: 9px; }

/* ---------- risk strip ---------- */
.risk-strip {
  background: linear-gradient(90deg, rgba(246, 70, 93, .13), rgba(246, 70, 93, .05));
  border-bottom: 1px solid rgba(246, 70, 93, .22);
  color: #ffc3cc; font-size: .82rem;
}
.risk-strip .wrap { display: flex; gap: 10px; align-items: flex-start; padding-top: 9px; padding-bottom: 9px; }
.risk-strip b { color: #ff9fae; font-weight: 600; }
.risk-strip .rs-ico { flex: 0 0 auto; color: #ff7f92; display: inline-flex; margin-top: 1px; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: 76px 0 54px; }
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto -10%; height: 720px;
  background:
    radial-gradient(46% 46% at 18% 30%, rgba(27, 227, 166, .13), transparent 70%),
    radial-gradient(40% 40% at 82% 12%, rgba(123, 140, 255, .12), transparent 70%);
  pointer-events: none;
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.08fr .92fr; gap: 44px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; text-transform: uppercase;
  letter-spacing: .14em; font-size: .72rem; font-weight: 600; color: var(--accent); margin: 0 0 18px;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--accent); opacity: .7; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lead { font-size: clamp(1.02rem, 1.4vw, 1.16rem); color: var(--text-2); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 22px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px; }
.fact {
  display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--line); padding: 6px 11px; border-radius: 999px;
}
.fact svg { color: var(--accent); }

/* hero terminal preview */
.term {
  background: linear-gradient(180deg, #0e1520, #0a0f16);
  border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow);
  overflow: hidden; font-family: var(--mono); font-size: .82rem;
}
.term-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: #0b1119; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #2b3647; }
.dot.g { background: #1b6f57; } .dot.y { background: #6b5a1b; } .dot.r { background: #6b2531; }
.term-title { margin-left: 6px; color: var(--dim); font-size: .75rem; letter-spacing: .04em; }
.term-body { padding: 16px; display: grid; gap: 10px; }
.term-row { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.term-row b { color: var(--text); font-weight: 500; }
.term-row .up { color: var(--up); }
.term-row .down { color: var(--down); }
.term-sep { height: 1px; background: var(--line); margin: 4px 0; }
.term-big { color: var(--accent); font-size: 1.5rem; letter-spacing: -.02em; }
.term-tag { font-size: .68rem; color: var(--dim); }
.term-note { padding: 0 16px 14px; color: var(--dim); font-size: .7rem; }

/* ---------- tool cards ---------- */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.toolcard {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px 18px;
  color: inherit; transition: border-color .15s ease, transform .15s ease, background .15s ease;
}
.toolcard:hover { text-decoration: none; border-color: #2f4d46; transform: translateY(-2px); background: linear-gradient(180deg, #111a24, #0c1118); }
.toolcard .ico {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(27, 227, 166, .09); color: var(--accent); border: 1px solid rgba(27, 227, 166, .18);
}
.toolcard h3 { margin: 4px 0 0; font-size: 1.02rem; }
.toolcard p { color: var(--muted); font-size: .88rem; margin: 0; }
.toolcard .go { margin-top: auto; padding-top: 10px; font-size: .84rem; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.toolcard .go svg { transition: transform .15s ease; }
.toolcard:hover .go svg { transform: translateX(3px); }
.card-kicker { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }

/* generic panel */
.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
}
.panel-flat { background: var(--panel-2); }
.panel h2 { margin-bottom: 6px; }

/* ---------- section headings ---------- */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.sec-head p { color: var(--muted); margin: 8px 0 0; max-width: 46em; }
.sec-link { font-size: .9rem; white-space: nowrap; }

/* ---------- calculator layout ---------- */
.calc-page { padding: 44px 0 64px; }
.page-head { max-width: 780px; margin-bottom: 30px; }
.page-head h1 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
.page-head .lead { margin-top: 10px; }
.breadcrumb { font-size: .8rem; color: var(--dim); margin-bottom: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted); }

.calc-shell { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 22px; align-items: start; }
.calc-form { display: grid; gap: 18px; }
.form-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.form-head h2 { font-size: 1.05rem; margin: 0; }
.badge {
  font-size: .7rem; letter-spacing: .04em; color: var(--muted);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 9px; white-space: nowrap;
}
.badge.accent { color: var(--accent); border-color: rgba(27, 227, 166, .3); background: rgba(27, 227, 166, .07); }

.field { display: grid; gap: 7px; }
.field > label, .label-row > label { font-size: .82rem; color: var(--text-2); font-weight: 500; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field .hint { font-size: .76rem; color: var(--dim); margin: 0; line-height: 1.45; }
.levout {
  font-family: var(--mono); font-size: .82rem; color: var(--accent);
  background: rgba(27, 227, 166, .08); border: 1px solid rgba(27, 227, 166, .2);
  padding: 2px 8px; border-radius: 7px;
}

.input-wrap {
  display: flex; align-items: center; gap: 8px; background: var(--bg-2);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 0 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input-wrap:focus-within { border-color: #2f7f68; box-shadow: 0 0 0 3px rgba(27, 227, 166, .12); }
.input-wrap .prefix, .input-wrap .suffix { color: var(--dim); font-size: .82rem; font-family: var(--mono); }
.input-wrap .prefix { padding-right: 2px; }
.input-wrap input {
  flex: 1 1 auto; min-width: 0; width: 100%; background: transparent; border: 0; outline: 0;
  color: var(--text); font-family: var(--mono); font-size: 1rem; padding: 11px 0;
  font-variant-numeric: tabular-nums;
}
.input-wrap input::-webkit-outer-spin-button, .input-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input-wrap input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.input-wrap.sm input { font-size: .92rem; padding: 9px 0; }

select.input {
  width: 100%; appearance: none; background: var(--bg-2) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238695aa' d='M6 8 0 0h12z'/%3E%3C/svg%3E") no-repeat right 13px center;
  border: 1px solid var(--line-2); border-radius: 10px; color: var(--text);
  font: inherit; font-size: .9rem; padding: 11px 34px 11px 12px; cursor: pointer;
}
select.input:focus { outline: 0; border-color: #2f7f68; box-shadow: 0 0 0 3px rgba(27, 227, 166, .12); }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 11px; padding: 5px; }
.segmented.three { grid-template-columns: repeat(3, 1fr); }
.seg {
  border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .88rem; font-weight: 550;
  padding: 8px 6px; border-radius: 7px; cursor: pointer; transition: color .14s, background .14s;
}
.seg:hover { color: var(--text); }
.seg[aria-pressed="true"] { background: var(--panel-3); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset; }
.seg[aria-pressed="true"][data-value="long"] { background: rgba(22, 199, 132, .14); color: #3ce3a2; }
.seg[aria-pressed="true"][data-value="short"] { background: rgba(246, 70, 93, .13); color: #ff8496; }
.seg[aria-pressed="true"][data-value="maker"] { background: rgba(27, 227, 166, .1); color: #5ff0c5; }

.range { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 4px; background: var(--line-2); outline: 0; margin: 10px 0 4px; }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; cursor: pointer;
  background: #0b1118; border: 2px solid var(--accent); box-shadow: 0 0 0 4px rgba(27, 227, 166, .12);
}
.range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; cursor: pointer; background: #0b1118; border: 2px solid var(--accent); }
.range-scale { display: flex; justify-content: space-between; font-size: .68rem; color: var(--dim); font-family: var(--mono); }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 2px 0; }
.switch-row .sw-label { font-size: .84rem; color: var(--text-2); }
.switch { position: relative; width: 42px; height: 24px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: var(--line-2); border-radius: 999px; transition: background .16s ease; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #97a6bb; transition: transform .16s ease, background .16s ease; }
.switch input:checked + span { background: rgba(27, 227, 166, .25); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--accent); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px rgba(27, 227, 166, .2); }

.form-error { color: #ff98a6; font-size: .8rem; min-height: 1.1em; }
.form-error:empty { min-height: 0; }

/* ---------- results ---------- */
.results { display: grid; gap: 18px; }
.result-top {
  position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid rgba(27, 227, 166, .22);
  background:
    radial-gradient(120% 150% at 100% 0%, rgba(27, 227, 166, .12), transparent 60%),
    linear-gradient(180deg, #0d1a1c, #0b1218);
  padding: 22px 24px;
}
.result-top .result-label { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.big-value { font-family: var(--mono); font-size: clamp(1.9rem, 4vw, 2.7rem); letter-spacing: -.02em; color: #fff; margin-top: 6px; font-variant-numeric: tabular-nums; }
.big-value.pos { color: var(--up); } .big-value.neg { color: var(--down); }
.big-sub { color: var(--muted); font-size: .86rem; margin-top: 4px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pill { font-size: .76rem; font-family: var(--mono); padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line-2); color: var(--text-2); }
.pill.warn { color: #ffc46b; border-color: rgba(245, 192, 68, .3); background: rgba(245, 192, 68, .08); }
.pill.bad { color: #ff98a6; border-color: rgba(246, 70, 93, .32); background: rgba(246, 70, 93, .09); }
.pill.pos { color: var(--up); border-color: rgba(22, 199, 132, .32); background: rgba(22, 199, 132, .09); }
.pill.neg { color: #ff98a6; border-color: rgba(246, 70, 93, .32); background: rgba(246, 70, 93, .09); }

.advanced { border: 1px solid var(--line); border-radius: 10px; background: #0b1119; padding: 0 14px; }
.advanced summary { cursor: pointer; list-style: none; padding: 12px 0; font-size: .84rem; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::after { content: "+"; font-family: var(--mono); color: var(--dim); }
.advanced[open] summary::after { content: "–"; }
.advanced-body { display: grid; gap: 12px; padding: 2px 0 16px; }

.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.metric { background: var(--panel-2); padding: 13px 15px; }
.metric span { display: block; font-size: .74rem; color: var(--dim); margin-bottom: 3px; }
.metric strong { font-family: var(--mono); font-size: .98rem; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.metric strong.pos { color: var(--up); } .metric strong.neg { color: var(--down); }

.gauge { margin-top: 4px; }
.gauge-head { display: flex; justify-content: space-between; font-size: .74rem; color: var(--dim); margin-bottom: 6px; }
.gauge-track { height: 7px; border-radius: 999px; background: #0a0f16; border: 1px solid var(--line-2); overflow: hidden; }
.gauge-fill { height: 100%; width: 0; background: linear-gradient(90deg, rgba(27, 227, 166, .35), var(--accent)); transition: width .25s ease; }
.gauge-fill.warn { background: linear-gradient(90deg, rgba(245, 192, 68, .4), var(--gold)); }
.gauge-fill.bad { background: linear-gradient(90deg, rgba(246, 70, 93, .4), var(--down)); }

.note { font-size: .8rem; color: var(--muted); border-left: 2px solid var(--line-2); padding: 2px 0 2px 12px; }
.note b { color: var(--text); font-weight: 550; }
.note.alert { border-left-color: var(--gold); color: #e8c98d; }
.note.danger { border-left-color: var(--down); color: #ffb3bf; }

.chart-wrap { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); padding: 12px 12px 6px; }
.chart-wrap canvas { display: block; width: 100%; height: 210px; }
.chart-cap { display: flex; justify-content: space-between; font-size: .7rem; color: var(--dim); padding: 2px 4px 6px; font-family: var(--mono); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--dim); font-weight: 600; background: #0b1119; }
td { color: var(--text-2); font-variant-numeric: tabular-nums; }
td strong { color: var(--text); }
tbody tr:last-child td { border-bottom: 0; }
tr.hl td { background: rgba(27, 227, 166, .05); color: var(--text); }
td.num, th.num { text-align: right; font-family: var(--mono); }

/* side-by-side bar comparison */
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 92px; gap: 12px; align-items: center; font-size: .82rem; }
.bar-row .bar-label { color: var(--text-2); }
.bar-track { height: 8px; background: #0a0f16; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #0f9e8a, var(--accent)); }
.bar-fill.warm { background: linear-gradient(90deg, #a4771a, var(--gold)); }
.bar-fill.cold { background: linear-gradient(90deg, #6b2531, var(--down)); }
.bar-row .bar-val { text-align: right; font-family: var(--mono); color: var(--text); }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 10px; }
.faq details { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; }
.faq details[open] { border-color: var(--line-2); background: #0e141d; }
.faq summary {
  cursor: pointer; list-style: none; padding: 15px 0; font-weight: 550; color: var(--text);
  display: flex; justify-content: space-between; gap: 16px; align-items: center; font-size: .95rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-family: var(--mono); font-size: 1.1rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq .faq-body { padding: 0 0 16px; color: var(--text-2); font-size: .92rem; }
.faq .faq-body p { margin: 0 0 .7em; }

/* ---------- article ---------- */
.article { padding: 44px 0 60px; }
.article-body { max-width: 760px; }
.article-body h2 { margin-top: 2.2em; padding-top: .2em; }
.article-body h3 { margin-top: 1.7em; font-size: 1.06rem; color: #dfe8f5; }
.article-body p, .article-body li { color: var(--text-2); }
.article-body li strong, .article-body p strong { color: #f2f6fb; }
.article-body .table-wrap { margin: 1.4em 0; }
.article-body code { background: #0b1119; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: #9ff0d6; }
.article-meta { font-size: .8rem; color: var(--dim); display: flex; gap: 14px; flex-wrap: wrap; margin: 14px 0 26px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.formula {
  background: #0a1017; border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 14px 16px; font-family: var(--mono); font-size: .84rem; color: #cbe6dd;
  overflow-x: auto; margin: 1.2em 0; line-height: 1.7;
}
.formula .c { color: var(--dim); }
.toc { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; margin: 0 0 30px; }
.toc p { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); margin: 0 0 8px; }
.toc ol { margin: 0; padding-left: 1.1em; font-size: .88rem; }
.toc li { margin-bottom: .25em; }
.toc a { color: var(--text-2); }
.article-aside { position: sticky; top: 90px; display: grid; gap: 16px; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 44px; align-items: start; }
.mini-links { display: grid; gap: 8px; }
.mini-links a { display: flex; justify-content: space-between; gap: 10px; font-size: .88rem; color: var(--text-2); padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); }
.mini-links a:hover { border-color: var(--line-2); color: #fff; text-decoration: none; }

/* ---------- CTA ---------- */
.cta-card {
  position: relative; overflow: hidden; border-radius: 18px; padding: 26px 26px 22px;
  border: 1px solid rgba(27, 227, 166, .26);
  background:
    radial-gradient(90% 160% at 0% 0%, rgba(27, 227, 166, .13), transparent 55%),
    radial-gradient(80% 140% at 100% 100%, rgba(123, 140, 255, .1), transparent 60%),
    linear-gradient(180deg, #0d151d, #0a1017);
  display: grid; gap: 16px;
}
.cta-card .eyebrow { margin: 0; }
.cta-card h2, .cta-card h3 { margin: 0; font-size: clamp(1.3rem, 2.4vw, 1.6rem); }
.cta-card p { color: var(--text-2); font-size: .93rem; max-width: 46em; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cta-disclosure { font-size: .76rem; color: var(--dim); line-height: 1.5; margin: 0; }
.cta-inline { margin: 34px 0; }
.cta-mini {
  border: 1px solid rgba(27, 227, 166, .22); border-radius: 12px; padding: 14px 16px;
  background: linear-gradient(180deg, rgba(27, 227, 166, .07), rgba(27, 227, 166, .02));
  display: grid; gap: 10px;
}
.cta-mini strong { display: block; color: #fff; font-size: .92rem; font-weight: 600; }
.cta-mini .cm-sub { color: var(--muted); font-size: .82rem; }
.cta-mini .cm-sub code { color: var(--accent); font-family: var(--mono); letter-spacing: .06em; }
.cta-mini-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cta-mini .codecopy code { font-size: .82rem; padding: 7px 10px; }
.cta-mini .codecopy button { font-size: .76rem; padding: 7px 10px; }
.cta-mini .cta-disclosure { font-size: .7rem; margin: 0; line-height: 1.45; }

.codecopy {
  display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--line-2);
  border-radius: 10px; background: #080d13; overflow: hidden;
}
.codecopy code { font-family: var(--mono); font-size: .95rem; letter-spacing: .12em; color: var(--accent); padding: 10px 14px; }
.codecopy button {
  border: 0; border-left: 1px solid var(--line-2); background: var(--panel-3); color: var(--text-2);
  font: inherit; font-size: .8rem; padding: 10px 14px; cursor: pointer; transition: background .14s, color .14s;
}
.codecopy button:hover { background: #1c2634; color: #fff; }
.codecopy button.done { color: var(--accent); }

/* ---------- disclosure / trust ---------- */
.trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.trust-item { border-top: 2px solid var(--line-2); padding-top: 14px; }
.trust-item h3 { font-size: .98rem; margin-bottom: 6px; }
.trust-item p { font-size: .88rem; color: var(--muted); margin: 0; }
.disclosure-box {
  border: 1px solid var(--line); border-left: 3px solid var(--gold); background: rgba(245, 192, 68, .045);
  border-radius: 10px; padding: 14px 16px; font-size: .82rem; color: #cdb98e;
}
.disclosure-box b { color: #f0d9a4; }
.risk-box {
  border: 1px solid rgba(246, 70, 93, .22); background: rgba(246, 70, 93, .05);
  border-radius: 10px; padding: 14px 16px; font-size: .82rem; color: #e3b3ba;
}
.risk-box b { color: #ffb0bb; }
.risk-box h3 { color: #ffc7cf; font-size: .9rem; margin: 0 0 6px; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: #05070a; padding: 52px 0 34px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 34px; }
.footer-brand p { font-size: .86rem; color: var(--muted); margin: 12px 0 0; max-width: 30em; }
.footer-col h4 { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); margin-bottom: 12px; }
.footer-col a { display: block; font-size: .87rem; color: var(--text-2); padding: 4px 0; }
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-note { display: grid; gap: 12px; margin-top: 26px; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  border-top: 1px solid var(--line); padding-top: 22px; font-size: .78rem; color: var(--dim);
}
.footer-bottom a { color: var(--muted); }

/* ---------- misc ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--accent); color: #04231a; padding: 8px 12px; border-radius: 8px; }
[hidden] { display: none !important; }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .term { max-width: 520px; }
  .article-layout { grid-template-columns: 1fr; gap: 30px; }
  .article-aside { position: static; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
@media (max-width: 860px) {
  .nav { display: none; }
  .header-cta .menu-btn { display: inline-flex; }
  .nav.open {
    display: flex; position: absolute; left: 0; right: 0; top: 66px; flex-direction: column; align-items: stretch;
    background: #080c11; border-bottom: 1px solid var(--line); padding: 10px 18px 16px; gap: 2px;
  }
  .nav.open a { padding: 11px 8px; }
  .calc-shell { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .trust-grid { grid-template-columns: 1fr; }
  .hero { padding: 52px 0 40px; }
  .section { padding: 54px 0; }
}
@media (min-width: 861px) {
  .calc-shell > .results { position: sticky; top: 84px; }
}
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .wrap { padding: 0 16px; }
  .brand-name span { display: none; }
  .header-inner { gap: 12px; }
  .header-cta { gap: 8px; }
  .header-cta .btn { padding: 9px 13px; font-size: .85rem; }
  .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr; }
  .panel, .result-top { padding: 18px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-brand { grid-column: 1 / -1; }
  .hero-actions .btn { width: 100%; }
  .bar-row { grid-template-columns: 100px 1fr 78px; }
  .cta-card { padding: 20px 18px; }
  .cta-row .btn { width: 100%; }
  .article { padding: 30px 0 44px; }
  th, td { padding: 9px 11px; }
}

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

@media print {
  .site-header, .site-footer, .cta-card, .risk-strip { display: none; }
  body { background: #fff; color: #111; }
}
