/* =========================================================
   Cylinder Volume Calculator: styles
   ========================================================= */
:root {
  --bg: #f3f5fa;
  --bg-2: #e9edf6;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --ink: #0d1324;
  --ink-2: #2a3350;
  --muted: #646e86;
  --line: #e2e6f0;
  --line-2: #d3d9e6;
  --accent: #2b5bff;
  --accent-ink: #ffffff;
  --accent-soft: #e8eeff;
  --nav-active: #4f46e5;
  color-scheme: light;

  --c-r: #7c4dff;   /* radius */
  --c-h: #0fa88a;   /* height */
  --c-v: #2b6bff;   /* volume */
  --c-fill: #0ea5e9;
  --c-solved: #f59e0b;

  --glass-a: rgba(186, 203, 235, 0.22);
  --glass-b: rgba(255, 255, 255, 0.75);
  --glass-c: rgba(140, 160, 200, 0.35);
  --glass-line: #8b98b8;

  --radius: 18px;
  --shadow: 0 1px 2px rgba(13, 19, 36, .04), 0 8px 28px -12px rgba(13, 19, 36, .14);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0e19;
  --bg-2: #0f1424;
  --surface: #121829;
  --surface-2: #171e33;
  --ink: #eaf0ff;
  --ink-2: #c6cfe6;
  --muted: #8b95b0;
  --line: #232b44;
  --line-2: #2e3753;
  --accent: #5b82ff;
  --accent-soft: #1c2645;
  --nav-active: #8b8cff;
  --c-r: #a684ff;
  --c-h: #2dd4b0;
  --c-v: #5b8cff;
  --glass-a: rgba(120, 140, 190, 0.10);
  --glass-b: rgba(200, 215, 255, 0.22);
  --glass-c: rgba(90, 110, 160, 0.20);
  --glass-line: #6c7aa0;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -12px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%),
    radial-gradient(900px 400px at -10% 10%, color-mix(in srgb, var(--c-r) 9%, transparent), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); font-weight: 500; }
.wrap { width: min(1240px, 100% - 40px); margin-inline: auto; }
h1, .h2, .h3 { margin: 0; letter-spacing: -0.02em; }
.h2, .h3 { font-weight: 700; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: saturate(1.4) blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 600; letter-spacing: -0.01em; }
.topnav { display: flex; align-items: center; gap: 36px; }
.topnav a { color: var(--ink-2); text-decoration: none; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; padding: 6px 0; transition: color .15s; white-space: nowrap; }
.topnav a:hover, .topnav a[aria-current="page"] { color: var(--nav-active); }

/* ---------- hero ---------- */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 34px 0 22px; }
.hero h1 { font-size: clamp(28px, 3.6vw, 42px); font-weight: 800; line-height: 1.08; }
.formula-chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-family: var(--mono); font-size: 26px; font-weight: 600;
  padding: 12px 20px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  white-space: nowrap;
}
.formula-chip .op { color: var(--muted); margin: 0 2px; }
.formula-chip .fx-pi { color: var(--ink-2); }
.formula-chip .fx:first-child { color: var(--c-v); }
.formula-chip .r { color: var(--c-r); }
.formula-chip .h { color: var(--c-h); }
.formula-chip sup { font-size: .55em; margin-left: -5px; margin-right: 2px; position: relative; top: -0.75em; line-height: 0; }

/* ---------- layout ---------- */
.tool {
  display: grid;
  grid-template-columns: minmax(310px, 370px) minmax(0, 1fr);
  grid-template-areas:
    "panel stage"
    "steps conv"
    "net   sens";
  gap: 18px;
  padding-bottom: 40px;
}
.panel { grid-area: panel; }
.stage { grid-area: stage; }
.steps-card { grid-area: steps; }
.conv-card { grid-area: conv; }
.net-card { grid-area: net; }
.sens-card { grid-area: sens; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  min-width: 0;
}
.card-head, .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card .h2, .panel .h2 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.tag-soft { font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); padding: 3px 9px; border-radius: 99px; white-space: nowrap; }

/* ---------- inputs panel ---------- */
.panel { display: flex; flex-direction: column; gap: 16px; }
.field { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); display: inline-flex; align-items: center; gap: 7px; padding: 0; }
.label .sym { font-style: normal; color: var(--muted); font-weight: 600; font-family: var(--mono); font-size: 12px; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.row-2 { display: grid; grid-template-columns: 1fr 96px; gap: 12px; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot-r { background: var(--c-r); }
.dot-h { background: var(--c-h); }
.dot-v { background: var(--c-v); }
.dot-fill { background: linear-gradient(135deg, #38bdf8, #2563eb); }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; padding: 9px 6px; border-radius: 9px; font-weight: 700; font-size: 13.5px; color: var(--muted); transition: background .18s, color .18s, box-shadow .18s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(13,19,36,.08), 0 0 0 1px var(--line); }

.mini-seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.mini-seg button { border: 0; background: transparent; font-family: var(--mono); font-size: 12px; font-weight: 600; width: 28px; height: 22px; border-radius: 6px; color: var(--muted); }
.mini-seg button[aria-checked="true"] { background: var(--c-r); color: #fff; }

.select { position: relative; display: block; }
.select select {
  appearance: none; width: 100%; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 10px 32px 10px 12px;
}
.select::after { content: ""; position: absolute; right: 13px; top: 50%; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap input {
  width: 100%; font-family: var(--mono); font-size: 20px; font-weight: 600; color: var(--ink);
  background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 11px 64px 11px 14px; transition: border-color .15s, box-shadow .15s, background .15s;
  -moz-appearance: textfield;
}
.input-wrap input::-webkit-outer-spin-button, .input-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input-wrap input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface); }
.num-field[data-key="r"] .input-wrap input:focus { border-color: var(--c-r); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-r) 16%, transparent); }
.num-field[data-key="h"] .input-wrap input:focus { border-color: var(--c-h); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-h) 16%, transparent); }
.num-field[data-key="v"] .input-wrap input:focus { border-color: var(--c-v); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-v) 16%, transparent); }
.input-wrap input.invalid { border-color: #ef4444 !important; box-shadow: 0 0 0 4px rgba(239, 68, 68, .14) !important; }
.suffix { position: absolute; right: 14px; font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--muted); pointer-events: none; }
.badge-solved { display: none; position: absolute; right: 12px; top: -10px; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #7a4b00; background: #ffe7b3; border: 1px solid #f7c968; padding: 1px 7px; border-radius: 99px; }

.num-field.solved .input-wrap input {
  background: color-mix(in srgb, var(--c-solved) 9%, var(--surface));
  border-color: color-mix(in srgb, var(--c-solved) 55%, transparent);
  border-style: dashed;
  cursor: default;
}
.num-field.solved .badge-solved { display: block; }
.num-field.solved .range { opacity: .45; pointer-events: none; }
.num-field.solved .input-wrap input.flash { animation: flash .5s ease; }
@keyframes flash { 0% { background: color-mix(in srgb, var(--c-solved) 30%, var(--surface)); } 100% {} }

/* range sliders */
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 0; --c: var(--accent); --p: 50%; }
.range-r { --c: var(--c-r); }
.range-h { --c: var(--c-h); }
.range-v { --c: var(--c-v); }
.range-fill { --c: var(--c-fill); }
.range::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--c) var(--p), var(--line) var(--p)); }
.range::-moz-range-track { height: 6px; border-radius: 99px; background: var(--line); }
.range::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--c); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: var(--surface); border: 3px solid var(--c); box-shadow: 0 2px 6px rgba(13,19,36,.2); transition: transform .12s; }
.range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--c); box-shadow: 0 2px 6px rgba(13,19,36,.2); }
.range:active::-webkit-slider-thumb { transform: scale(1.18); }
#fillOut { font-size: 13px; font-weight: 600; color: var(--ink-2); }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 2px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; background: var(--ink); color: var(--bg);
  font-weight: 700; font-size: 13.5px; padding: 11px 14px; border-radius: 12px;
  transition: transform .12s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -6px rgba(13,19,36,.35); }
.btn:active { transform: translateY(0); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { box-shadow: 0 4px 14px -8px rgba(13,19,36,.3); }
.ghost-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; padding: 6px 8px; border-radius: 8px; }
.ghost-btn:hover { color: var(--ink); background: var(--surface-2); }
.hint { margin: 0; font-size: 12.5px; color: #dc2626; font-weight: 600; }

/* ---------- stage ---------- */
.stage { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.stage-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 0; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--c-v); display: flex; align-items: center; gap: 8px; }
.eyebrow.solved-eyebrow::after { content: attr(data-status); font-size: 10px; letter-spacing: .06em; color: #7a4b00; background: #ffe7b3; border: 1px solid #f7c968; padding: 0 7px; border-radius: 99px; }
.big-result { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
#bigValue { font-size: clamp(34px, 4.6vw, 54px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; word-break: break-all; }
.big-unit { font-size: 20px; font-weight: 700; color: var(--muted); font-family: var(--mono); }
.sub-result { color: var(--muted); font-size: 14px; font-weight: 600; margin-top: 4px; }
.fill-pill { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding: 10px 14px; border-radius: 14px; background: linear-gradient(135deg, color-mix(in srgb, #38bdf8 14%, var(--surface)), color-mix(in srgb, #2563eb 12%, var(--surface))); border: 1px solid color-mix(in srgb, #3b82f6 25%, var(--line)); white-space: nowrap; }
.fill-pill-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.fill-pill-label b { color: var(--ink); }
#fillVol { font-size: 15px; font-weight: 600; }

.viz { position: relative; flex: 1; min-height: 340px; display: flex; align-items: center; justify-content: center; padding: 4px 8px; }
#viz { width: 100%; height: auto; max-height: 470px; display: block; overflow: visible; }
.not-to-scale { position: absolute; top: 8px; right: 18px; font-size: 11.5px; font-weight: 700; color: #7a4b00; background: #fff1cc; border: 1px solid #f7d58a; padding: 3px 9px; border-radius: 99px; }

.glass-stop-a { stop-color: var(--glass-a); }
.glass-stop-b { stop-color: var(--glass-b); }
.glass-stop-c { stop-color: var(--glass-c); }
.glass-body { stroke: none; }
.glass-outline { fill: none; stroke: var(--glass-line); stroke-width: 1.6; stroke-linejoin: round; }
.top-rim { fill: color-mix(in srgb, var(--glass-b) 60%, transparent); stroke: var(--glass-line); stroke-width: 1.6; }
.back-rim { fill: none; stroke: var(--glass-line); stroke-width: 1.2; stroke-dasharray: 4 5; opacity: .7; }
.grid line { stroke: var(--line); stroke-width: 1; }

.ann line { stroke-width: 1.6; stroke-linecap: round; }
.ann .ext { stroke-width: 1; stroke-dasharray: 3 4; opacity: .7; }
.ann text { font-family: var(--mono); font-size: 13px; font-weight: 600; fill: #fff; }
.ann-r line, .ann-d line { stroke: var(--c-r); }
.ann-r circle { fill: var(--c-r); }
.ann-r rect, .ann-d rect { fill: var(--c-r); }
.ann-h line { stroke: var(--c-h); }
.ann-h rect { fill: var(--c-h); }
.ann-fill line { stroke: #2563eb; stroke-dasharray: 2 4; stroke-width: 1.4; }
.ann-fill rect { fill: #1d4ed8; }
.ann.is-solved rect { fill: var(--c-solved); }
.ann.is-solved text { fill: #3b2400; }
.ann.is-solved line { stroke: var(--c-solved); }
.ann.is-solved circle { fill: var(--c-solved); }
.ann.is-solved .ext { stroke: var(--c-solved); }
.scalebar line { stroke: var(--muted); stroke-width: 1.6; }
.scalebar text { font-family: var(--mono); font-size: 12px; fill: var(--muted); font-weight: 600; }

.stage-foot { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); background: var(--surface-2); }
.mini-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 18px; border-right: 1px solid var(--line); min-width: 0; }
.mini-stat:last-child { border-right: 0; }
.mini-stat .k { font-size: 11.5px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.mini-stat .mono { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; counter-reset: st; }
.steps li { counter-increment: st; display: flex; gap: 12px; align-items: baseline; padding: 8px 10px; border-radius: 10px; font-size: 14px; overflow-wrap: anywhere; }
.steps li::before { content: counter(st); font-size: 11px; font-weight: 700; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); width: 20px; height: 20px; border-radius: 6px; display: inline-grid; place-items: center; flex: none; transform: translateY(-1px); }
.steps li.final { background: color-mix(in srgb, var(--c-solved) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c-solved) 35%, transparent); font-weight: 700; }
.steps li.final::before { background: var(--c-solved); color: #3b2400; border-color: transparent; }
.steps .vr { color: var(--c-r); font-weight: 700; }
.steps .vh { color: var(--c-h); font-weight: 700; }
.steps .vv { color: var(--c-v); font-weight: 700; }
.steps .cm { color: var(--muted); font-family: var(--font); font-size: 12.5px; margin-left: auto; padding-left: 8px; white-space: nowrap; }

/* ---------- conversions ---------- */
.conv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.conv {
  text-align: left; border: 1px solid var(--line); background: var(--surface-2); border-radius: 13px; padding: 11px 13px;
  display: flex; flex-direction: column; gap: 2px; transition: border-color .15s, transform .12s, background .15s; min-width: 0;
}
.conv:hover { border-color: var(--c-v); transform: translateY(-1px); background: var(--surface); }
.conv .cv { font-family: var(--mono); font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .cu { font-size: 12px; color: var(--muted); font-weight: 600; }
.conv.native { border-color: color-mix(in srgb, var(--c-v) 45%, var(--line)); background: color-mix(in srgb, var(--c-v) 7%, var(--surface)); }
.equiv { margin: 14px 0 0; font-size: 13.5px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.equiv b { color: var(--ink); font-family: var(--mono); }

/* ---------- net ---------- */
.net-layout { display: flex; flex-direction: column; gap: 14px; }
#net { width: 100%; height: auto; max-height: 260px; }
#net .net-rect { fill: color-mix(in srgb, var(--c-h) 14%, var(--surface)); stroke: var(--c-h); stroke-width: 1.5; }
#net .net-circle { fill: color-mix(in srgb, var(--c-r) 14%, var(--surface)); stroke: var(--c-r); stroke-width: 1.5; }
#net text { font-family: var(--mono); font-size: 11.5px; font-weight: 600; fill: var(--ink-2); }
#net .dim { stroke: var(--muted); stroke-width: 1; }
.area-list { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.area-list > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.area-list > div:last-child { border-bottom: 0; }
.area-list dt { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.area-list dt .muted { font-family: var(--mono); font-size: 11.5px; margin-left: 4px; }
.area-list dd { margin: 0; font-size: 14px; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.area-list .total dt, .area-list .total dd { font-weight: 800; color: var(--ink); }

/* ---------- charts ---------- */
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.charts figure { margin: 0; min-width: 0; }
.charts figcaption { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.charts svg { width: 100%; height: auto; display: block; overflow: visible; }
.charts .axis { stroke: var(--line-2); stroke-width: 1; }
.charts .gridl { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.charts .tick { font-family: var(--mono); font-size: 10px; fill: var(--muted); }
.charts .guide { stroke-width: 1; stroke-dasharray: 3 3; }
.charts .curve { fill: none; stroke-width: 2.5; stroke-linecap: round; }
.charts .marker { stroke: var(--surface); stroke-width: 3; }
.insight { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.insight b { color: var(--ink); font-family: var(--mono); font-weight: 600; }

/* ---------- content article ---------- */
.content-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 36px; padding: 20px 0 60px; align-items: start; }
.toc { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; padding: 16px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.toc-title { margin: 0 0 8px 6px; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: flex; gap: 8px; padding: 6px 8px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 13px; font-weight: 600; line-height: 1.35; }
.toc a::before { content: counter(toc, decimal-leading-zero); font-family: var(--mono); font-size: 11px; color: var(--muted); padding-top: 1px; }
.toc a:hover, .toc a.active { background: var(--accent-soft); color: var(--accent); }

.content { min-width: 0; max-width: 860px; }
.sec { padding: 34px 0 30px; border-bottom: 1px solid var(--line); }
.sec:first-child { padding-top: 8px; }
.sec:last-child { border-bottom: 0; }
.sec h2 { font-size: clamp(24px, 2.6vw, 30px); font-weight: 800; line-height: 1.2; margin: 0 0 14px; }
.sec h3 { font-size: 19px; font-weight: 700; line-height: 1.3; margin: 30px 0 10px; }
.sec p { margin: 0 0 14px; color: var(--ink-2); font-size: 16px; line-height: 1.7; }
.sec p b, .sec li b { color: var(--ink); }
.sec .answer { font-size: 17px; padding: 14px 18px; border-left: 4px solid var(--c-v); background: color-mix(in srgb, var(--c-v) 6%, var(--surface)); border-radius: 0 12px 12px 0; }
.sec ul { color: var(--ink-2); line-height: 1.7; }
.mono { font-family: var(--mono); }

/* figures */
.fig { margin: 22px 0; padding: 18px 18px 14px; border: 1px solid var(--line); border-radius: 16px; background:
  linear-gradient(var(--surface), var(--surface)) padding-box,
  var(--surface); box-shadow: var(--shadow); }
.fig svg { width: 100%; height: auto; display: block; max-height: 320px; overflow: visible; }
.fig figcaption { margin-top: 10px; font-size: 13.5px; color: var(--muted); font-weight: 500; text-align: center; }
.fig-narrow svg { max-height: 280px; }
.fig text { font-family: var(--mono); font-size: 13px; font-weight: 600; fill: var(--ink-2); }
.g-body { fill: color-mix(in srgb, var(--c-v) 12%, var(--surface)); stroke: var(--glass-line); stroke-width: 1.5; }
.g-top { fill: color-mix(in srgb, var(--c-v) 22%, var(--surface)); stroke: var(--glass-line); stroke-width: 1.5; }
.g-hidden { fill: none; stroke: var(--glass-line); stroke-width: 1.2; stroke-dasharray: 4 5; opacity: .7; }
.g-base { fill: color-mix(in srgb, var(--c-r) 26%, var(--surface)); stroke: var(--c-r); stroke-width: 1.6; }
.g-solid { fill: color-mix(in srgb, var(--muted) 34%, var(--surface)); stroke: var(--glass-line); stroke-width: 1.5; }
.g-solid-top { fill: color-mix(in srgb, var(--muted) 20%, var(--surface)); stroke: var(--glass-line); stroke-width: 1.5; }
.g-inside { fill: color-mix(in srgb, var(--ink) 30%, var(--surface)); stroke: var(--glass-line); stroke-width: 1.5; }
.g-inner-wall { fill: none; stroke: var(--glass-line); stroke-width: 1; opacity: .6; }
.g-slice { fill: color-mix(in srgb, var(--c-v) 16%, var(--surface)); stroke: var(--c-v); stroke-width: 1.1; }
.g-slice-top { fill: color-mix(in srgb, var(--c-r) 20%, var(--surface)); stroke: var(--c-v); stroke-width: 1.1; }
.g-tape { fill: none; stroke: var(--c-solved); stroke-width: 5; stroke-linecap: round; }
.g-tape.back { stroke-width: 2.5; stroke-dasharray: 5 5; opacity: .7; }
.g-cone { fill: color-mix(in srgb, var(--c-solved) 18%, var(--surface)); stroke: var(--glass-line); stroke-width: 1.5; }
.g-sphere { fill: color-mix(in srgb, var(--c-r) 16%, var(--surface)); stroke: var(--glass-line); stroke-width: 1.5; }
.g-eq { fill: none; stroke: var(--glass-line); stroke-width: 1.2; }
.g-circle { fill: color-mix(in srgb, var(--c-v) 8%, var(--surface)); stroke: var(--glass-line); stroke-width: 1.5; }
.g-square { fill: color-mix(in srgb, var(--c-r) 16%, var(--surface)); stroke: var(--c-r); stroke-width: 1.5; }
.g-base-circle { fill: color-mix(in srgb, var(--c-r) 22%, var(--surface)); stroke: var(--c-r); stroke-width: 1.5; }
.fig .g-label { font-family: var(--font); font-size: 13.5px; fill: var(--muted); }
.fig .g-formula, .step-viz .g-formula { font-size: 17px; fill: var(--ink-2); }
.fig .g-formula.strong { font-size: 21px; font-weight: 700; fill: var(--c-v); }
.g-small { font-family: var(--mono); font-size: 12px; fill: var(--muted); }
.a-r, .a-h, .a-c { stroke-width: 1.8; stroke-linecap: round; }
.a-r { stroke: var(--c-r); } .a-r-fill { fill: var(--c-r); }
.a-h { stroke: var(--c-h); } .a-h-fill { fill: var(--c-h); }
.a-c { stroke: var(--c-solved); } .a-c-fill { fill: var(--c-solved); }
.dot-r-fill { fill: var(--c-r); }
svg .tag text { font-family: var(--mono); font-size: 12.5px; font-weight: 700; fill: #fff; }
.t-r rect { fill: var(--c-r); } .t-h rect { fill: var(--c-h); } .t-v rect { fill: var(--c-v); }
.t-c rect { fill: var(--c-solved); } .t-c text { fill: #3b2400 !important; }
.chip rect { fill: var(--surface-2); stroke: var(--line); }
.chip .chip-sym { font-size: 22px; font-weight: 700; }
.chip .chip-desc { font-family: var(--font); font-size: 13px; font-weight: 500; fill: var(--muted); }
.chip.c-r .chip-sym { fill: var(--c-r); } .chip.c-h .chip-sym { fill: var(--c-h); } .chip.c-v .chip-sym { fill: var(--c-v); }
.chip.c-v rect { stroke: var(--c-v); fill: color-mix(in srgb, var(--c-v) 8%, var(--surface)); }
.net-c { fill: color-mix(in srgb, var(--c-r) 16%, var(--surface)); stroke: var(--c-r); stroke-width: 1.5; }
.net-r { fill: color-mix(in srgb, var(--c-h) 14%, var(--surface)); stroke: var(--c-h); stroke-width: 1.5; }

/* formula anatomy */
.anatomy { display: flex; align-items: stretch; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 18px 0 20px; }
.anatomy .part { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 16px; min-width: 96px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.anatomy .sym { font-family: var(--mono); font-size: 30px; font-weight: 700; line-height: 1.1; }
.anatomy .lbl { font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; }
.anatomy .op { align-self: center; font-family: var(--mono); font-size: 24px; color: var(--muted); }
.p-v .sym { color: var(--c-v); } .p-r .sym { color: var(--c-r); } .p-h .sym { color: var(--c-h); } .p-pi .sym { color: var(--ink-2); }

/* worked examples */
.worked { margin: 14px 0 18px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.worked .given { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--ink); }
.worked ol { margin: 0 0 10px; padding-left: 22px; display: grid; gap: 4px; font-size: 14.5px; color: var(--ink-2); }
.worked .ans, .ex-card .ans { font-weight: 700; color: var(--c-v); }
.worked p { font-size: 14.5px; }
.worked.solution ol { font-family: var(--font); gap: 8px; font-size: 15px; }
.worked.solution ol .mono { margin-left: 6px; color: var(--ink); }
.final-ans { padding: 12px 14px; border-radius: 10px; background: color-mix(in srgb, var(--c-solved) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c-solved) 35%, transparent); }
.load-btn { font-size: 13px; padding: 8px 12px; }
.load-btn::before { content: "↗"; font-weight: 800; }

/* tables */
.table-wrap { overflow-x: auto; margin: 16px 0 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.data-table th { text-align: left; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: top; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td.mono { white-space: nowrap; color: var(--ink); font-weight: 600; }

/* how-to + features */
.howto { list-style: none; padding: 0; margin: 14px 0 18px; display: grid; gap: 10px; }
.howto li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink-2); line-height: 1.6; }
.n { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--c-v); color: #fff; font-weight: 800; font-size: 14px; }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.feature { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 14px; background: linear-gradient(135deg, var(--accent-soft), var(--surface)); border: 1px solid var(--line); }
.feature b { font-size: 15px; }
.feature span { font-size: 12.5px; color: var(--muted); font-weight: 500; line-height: 1.45; }

/* step cards */
.step-cards { list-style: none; padding: 0; margin: 18px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.step-card { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 14px; box-shadow: var(--shadow); }
.step-viz { background: var(--surface-2); border-radius: 12px; padding: 8px; margin-bottom: 10px; }
.step-viz svg { width: 100%; height: auto; display: block; }
.step-viz text { font-family: var(--mono); font-size: 12px; font-weight: 600; }
.step-card .step-t { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--ink); font-size: 15px; margin: 0 0 6px; }
.step-card .step-t .n { width: 22px; height: 22px; font-size: 12px; border-radius: 7px; }
.step-card p { font-size: 13.5px; line-height: 1.55; margin: 0; }
.callout { margin: 16px 0; padding: 14px 18px; border-radius: 12px; background: color-mix(in srgb, var(--c-solved) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c-solved) 32%, transparent); color: var(--ink-2); font-size: 15px; line-height: 1.6; }

/* formula cards */
.formula-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0 8px; }
.fcard { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); border-top: 4px solid var(--c-v); }
.fcard.fc-h { border-top-color: var(--c-h); } .fcard.fc-r { border-top-color: var(--c-r); }
.fcard .k { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fcard .mono { font-size: 16px; font-weight: 700; color: var(--ink); }

/* units */
.unit-scale { display: grid; gap: 8px; margin: 16px 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.us-row { display: grid; grid-template-columns: 120px 1fr 220px; align-items: center; gap: 12px; }
.us-k { font-family: var(--mono); font-weight: 700; font-size: 14px; }
.us-bar { height: 12px; border-radius: 99px; width: var(--w); background: linear-gradient(90deg, #38bdf8, var(--c-v)); }
.us-v { font-size: 13px; color: var(--muted); font-weight: 600; }
.unit-examples { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.unit-examples .worked { margin: 0; }
.unit-examples .worked p.mono { font-size: 13.5px; margin: 0; }

/* example cards */
.ex-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 18px 0; }
.ex-card { display: flex; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.ex-icon { flex: none; width: 76px; }
.ex-icon svg { width: 100%; height: auto; }
.ex-title { margin: 0 0 2px !important; font-weight: 800; font-size: 16px !important; color: var(--ink) !important; }
.ex-card .given { margin: 0 0 6px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.ex-card ol { margin: 0 0 10px; padding-left: 20px; font-size: 13.5px; display: grid; gap: 2px; color: var(--ink-2); }

/* timeline */
.plain-steps { color: var(--ink-2); line-height: 1.7; padding-left: 22px; margin: 0 0 16px; }
.timeline { list-style: none; margin: 14px 0 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); display: grid; gap: 14px; }
.timeline li { position: relative; display: grid; grid-template-columns: 100px 1fr; gap: 12px; color: var(--ink-2); line-height: 1.6; font-size: 15px; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--c-v); }
.timeline .yr { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--c-v); padding-top: 2px; }

.split { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: center; }
.split .fig { margin: 0; }

/* ---------- FAQ ---------- */
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; padding: 0 18px; transition: box-shadow .15s; }
.faq details[open] { box-shadow: var(--shadow); }
.faq summary { cursor: pointer; list-style: none; padding: 15px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary h3 { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.4; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; font-weight: 500; color: var(--muted); transition: transform .2s; flex: none; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq-a { padding-bottom: 6px; }
.faq-a p, .faq-a li { font-size: 15px; }

.footer { border-top: 1px solid var(--line); padding: 22px 0 30px; color: var(--muted); font-size: 13px; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .tool {
    grid-template-columns: 1fr;
    grid-template-areas: "stage" "panel" "steps" "conv" "net" "sens";
  }
  .panel { position: static; }
  .content-layout { grid-template-columns: 1fr; }
  .toc { display: none; }
  .step-cards, .feature-grid, .formula-cards { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 1020px) and (min-width: 700px) {
  .tool { grid-template-columns: 1fr 1fr; grid-template-areas: "stage stage" "panel steps" "conv conv" "net sens"; }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 24px); }
  .hero { flex-direction: column; align-items: flex-start; padding-top: 22px; }
  .formula-chip { font-size: 20px; }
  .brand { font-size: 13.5px; gap: 7px; white-space: nowrap; }
  .brand svg { width: 22px; height: 22px; }
  .stage-head { flex-direction: column; padding: 18px 18px 0; }
  .fill-pill { align-items: flex-start; }
  .stage-foot { grid-template-columns: 1fr 1fr; }
  .mini-stat:nth-child(2) { border-right: 0; }
  .mini-stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .charts { grid-template-columns: 1fr; }
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 10px 0 0; row-gap: 4px; }
  .topnav { width: 100%; gap: 22px; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a { font-size: 15px; }
  .ex-grid, .unit-examples { grid-template-columns: 1fr; }
  .us-row { grid-template-columns: 96px 1fr; }
  .us-v { display: none; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
  .sec .answer { font-size: 16px; }
  .fig { padding: 12px 10px 10px; }
  .data-table { font-size: 13.5px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
.footer { padding: 38px 0 22px; }
.footer-grid { display: grid; grid-template-columns: 1.2fr .75fr 1.15fr 1fr 1.35fr; gap: 30px; padding-bottom: 30px; }
.footer-grid a { display: block; width: fit-content; margin: 7px 0; color: var(--muted); text-decoration: none; }
.footer-grid a:hover { color: var(--ink); }
.footer-brand { color: var(--ink) !important; font-size: 18px; font-weight: 750; letter-spacing: -0.02em; }
.footer-about p { max-width: 300px; margin: 10px 0; }
.footer-column h2 { margin: 0 0 10px; color: var(--ink); font-size: 14px; font-weight: 700; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 18px; }
.footer-bottom > span { font-size: 12px; }
@media (max-width: 1020px) { .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 20px; } }
@media (max-width: 760px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 18px; } }
@media (max-width: 440px) { .footer-grid { grid-template-columns: 1fr; gap: 18px; } }

/* ---------- theme toggle ---------- */
.theme-toggle { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface-2); }
.theme-toggle .tt-opt { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--muted); transition: background .15s, color .15s; }
.theme-toggle[aria-checked="false"] .tt-light, .theme-toggle[aria-checked="true"] .tt-dark { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(13,19,36,.12), 0 0 0 1px var(--line); }

/* ---------- back to top ---------- */
.back-to-top { position: fixed; right: 22px; bottom: 22px; z-index: 40; width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--ink); color: var(--bg); box-shadow: 0 10px 24px -10px rgba(13,19,36,.55); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s; }
.back-to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.back-to-top:hover { transform: translateY(-2px); }
@media (max-width: 1340px) { .footer { padding-bottom: 80px; } }
@media (max-width: 640px) { .back-to-top { right: 14px; bottom: 14px; width: 42px; height: 42px; } }
.info-main { padding: 54px 0 70px; }
.info-main .sec { max-width: 820px; }
.info-main h1 { font-size: clamp(32px, 5vw, 48px); margin-bottom: 12px; }
.info-main h2 { margin-top: 30px; }
.info-main p, .info-main li { color: var(--ink-2); font-size: 16px; }
.info-main a { color: var(--accent); }

/* =========================================================
   Interactive section widgets (js/learn.js)
   ========================================================= */
:root { --c-c: var(--c-solved); }
.widget { margin: 24px 0; min-height: 120px; }
.widget.w-ready { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 5%, var(--surface)), var(--surface)); box-shadow: var(--shadow); animation: wIn .5s ease both; }
@keyframes wIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.w-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 14px; }
.w-badge { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 4px 9px; border-radius: 99px; }
.w-title { margin: 0; font-weight: 800; font-size: 16.5px; color: var(--ink); }
.w-sub { margin: 0; flex-basis: 100%; font-size: 13.5px; color: var(--muted); }
.w-body { display: grid; grid-template-columns: 230px 1fr; gap: 18px; align-items: center; }
.w-controls { display: flex; flex-direction: column; gap: 14px; }
.w-view { min-width: 0; }
.w-view svg { width: 100%; height: auto; display: block; max-height: 300px; overflow: visible; }
.w-view text { font-family: var(--mono); font-size: 13px; font-weight: 600; fill: var(--ink-2); }
.w-out { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14.5px; }
.w-out:empty { display: none; }
.w-res b { color: var(--c-v); font-family: var(--mono); }
.w-res-sub { color: var(--muted); font-size: 13px; }
.w-note { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.w-warn { color: #dc2626; font-weight: 600; }
.w-slider { display: block; }
.w-sl-top { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 4px; }
.w-sl-top output { font-family: var(--mono); color: var(--c); }
.w-num { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; color: var(--ink-2); transition: opacity .2s; }
.w-num-wrap { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 0 10px; }
.w-num input { width: 100%; border: 0; background: transparent; padding: 9px 0; font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--ink); outline: none; }
.w-num input.bad { color: #dc2626; }
.w-num-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.w-num em { font-style: normal; color: var(--muted); font-family: var(--mono); font-size: 12px; }
.w-num.is-unknown { opacity: .4; pointer-events: none; }
.w-num.is-unknown .w-num-wrap { border-style: dashed; }
.w-num-group { display: flex; flex-direction: column; gap: 10px; }
.w-num .select select { width: 100%; }
.w-seg { display: flex; flex-wrap: wrap; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.w-seg button { flex: 1 1 auto; border: 0; background: transparent; padding: 8px 8px; border-radius: 9px; font-weight: 700; font-size: 12.5px; color: var(--muted); cursor: pointer; transition: background .18s, color .18s; }
.w-seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.w-play { align-self: flex-start; }

/* svg parts */
.w-shadow { fill: var(--ink); opacity: .07; }
.w-cyl { fill: color-mix(in srgb, var(--c-v) 10%, var(--surface)); stroke: var(--glass-line); stroke-width: 1.5; }
.w-top { fill: color-mix(in srgb, var(--c-v) 20%, var(--surface)); stroke: var(--glass-line); stroke-width: 1.5; }
.w-hidden { fill: none; stroke: var(--glass-line); stroke-width: 1.2; stroke-dasharray: 4 5; opacity: .7; }
.w-liq { fill: color-mix(in srgb, var(--c-fill) 38%, var(--surface)); }
.w-liq-top { fill: color-mix(in srgb, var(--c-fill) 55%, var(--surface)); stroke: var(--c-fill); stroke-width: 1; }
.w-base-disk { fill: color-mix(in srgb, var(--c-r) 40%, var(--surface)); stroke: var(--c-r); stroke-width: 1.5; }
.w-edge { fill: none; stroke: var(--glass-line); stroke-width: 1.5; }
.w-inside { fill: color-mix(in srgb, var(--ink) 28%, var(--surface)); stroke: var(--glass-line); stroke-width: 1.5; }
.w-solid { fill: color-mix(in srgb, var(--muted) 34%, var(--surface)); stroke: var(--glass-line); stroke-width: 1.5; }
.w-solid-top { fill: color-mix(in srgb, var(--muted) 18%, var(--surface)); stroke: var(--glass-line); stroke-width: 1.5; }
.w-ghost { fill: none; stroke: var(--glass-line); stroke-width: 1; stroke-dasharray: 3 4; opacity: .6; }
.w-slice { fill: color-mix(in srgb, var(--c-v) 16%, var(--surface)); stroke: var(--c-v); stroke-width: 1; }
.w-slice-top { fill: color-mix(in srgb, var(--c-r) 22%, var(--surface)); stroke: var(--c-v); stroke-width: 1; }
.w-r, .w-h, .w-c { stroke-width: 2; }
.w-r { stroke: var(--c-r); } .w-h { stroke: var(--c-h); } .w-c { stroke: var(--c-c); }
.w-r-fill { fill: var(--c-r); } .w-h-fill { fill: var(--c-h); } .w-c-fill { fill: var(--c-c); }
.w-r-dash { stroke: var(--c-r); stroke-width: 1.5; stroke-dasharray: 4 4; }
.w-tag rect { fill: var(--surface); stroke-width: 1.5; }
.w-tag text { font-size: 12.5px !important; }
.w-t-r rect { stroke: var(--c-r); } .w-t-r text { fill: var(--c-r) !important; }
.w-t-h rect { stroke: var(--c-h); } .w-t-h text { fill: var(--c-h) !important; }
.w-t-c rect { stroke: var(--c-c); } .w-t-c text { fill: var(--c-c) !important; }
.w-t-v rect { stroke: var(--c-v); } .w-t-v text { fill: var(--c-v) !important; }
.w-top-circle { fill: color-mix(in srgb, var(--c-v) 8%, var(--surface)); stroke: var(--glass-line); stroke-width: 1.5; transition: fill .4s; }
.w-top-circle.w-fill-area { fill: color-mix(in srgb, var(--c-r) 30%, var(--surface)); }
.w-square { fill: color-mix(in srgb, var(--c-r) 18%, var(--surface)); stroke: var(--c-r); stroke-width: 1.5; }
.w-chip rect { fill: var(--surface); stroke-width: 1.5; }
.w-chip-r rect { stroke: var(--c-r); } .w-chip-h rect { stroke: var(--c-h); } .w-chip-v rect { stroke: var(--c-v); fill: color-mix(in srgb, var(--c-v) 8%, var(--surface)); }
.w-view .w-chip-sym { font-size: 18px; font-weight: 800; }
.w-chip-r .w-chip-sym { fill: var(--c-r); } .w-chip-h .w-chip-sym { fill: var(--c-h); } .w-chip-v .w-chip-sym { fill: var(--c-v); }
.w-view .w-chip-val { font-size: 15px; fill: var(--ink); }
.w-view .w-chip-lbl, .w-view .w-step-d { font-family: var(--font); font-size: 12px; font-weight: 500; fill: var(--muted); }
.w-step-card rect { fill: var(--surface); stroke: var(--line-2); stroke-width: 1.2; }
.w-view .w-step-n { font-size: 11px; letter-spacing: .08em; fill: var(--accent); font-weight: 800; }
.w-view .w-step-t { font-family: var(--font); font-size: 16px; font-weight: 800; fill: var(--ink); }
.w-view .w-step-eq { font-size: 13.5px; fill: var(--ink-2); white-space: pre; }
.w-view .w-step-eq.b { fill: var(--c-v); font-weight: 800; font-size: 15px; }
.w-tape { fill: none; stroke: var(--c-c); stroke-width: 5; stroke-linecap: round; }
.w-tape-flat { stroke: var(--c-c); stroke-width: 5; stroke-linecap: round; }
.w-poly { fill: color-mix(in srgb, var(--c-r) 22%, transparent); stroke: var(--c-r); stroke-width: 1.6; stroke-linejoin: round; }
.w-fan { stroke: var(--c-r); stroke-width: .8; opacity: .45; }
.w-net-side { fill: color-mix(in srgb, var(--c-h) 16%, var(--surface)); stroke: var(--c-h); stroke-width: 1.5; }
.w-net-cap { fill: color-mix(in srgb, var(--c-r) 20%, var(--surface)); stroke: var(--c-r); stroke-width: 1.5; transition: opacity .2s; }
.w-bar-bg { fill: var(--line); } .w-bar-r { fill: var(--c-r); } .w-bar-h { fill: var(--c-h); } .w-bar-v { fill: var(--c-v); }
.w-view .w-bar-l { font-family: var(--font); font-size: 12px; font-weight: 600; fill: var(--muted); }
.w-view text.w-bar-v { fill: var(--ink); font-size: 12.5px; }
.w-view text.w-bar-v.b { fill: var(--c-v); font-size: 15px; }
.w-cone { fill: color-mix(in srgb, var(--c-c) 22%, var(--surface)); stroke: var(--glass-line); stroke-width: 1.5; }
.w-cone-top { fill: color-mix(in srgb, var(--c-c) 34%, var(--surface)); stroke: var(--glass-line); stroke-width: 1.5; }
.w-sphere { fill: color-mix(in srgb, var(--c-r) 18%, var(--surface)); stroke: var(--glass-line); stroke-width: 1.5; }
.w-eq { fill: none; stroke: var(--glass-line); stroke-width: 1.2; }
.w-stream { fill: none; stroke: var(--c-fill); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 10 8; animation: wFlow .5s linear infinite; opacity: .8; }
@keyframes wFlow { to { stroke-dashoffset: -18; } }
.w-view .w-cap { font-family: var(--font); font-size: 12.5px; fill: var(--muted); }
.w-view .w-cap-v { fill: var(--ink); }
.tilt { animation: wTilt 1.1s ease both; }
@keyframes wTilt { 0%,100% { transform: rotate(0); } 30%,75% { transform: rotate(-28deg); } }
.draw-in { stroke-dasharray: 400; animation: wDraw .9s ease both; }
@keyframes wDraw { from { stroke-dashoffset: 400; } to { stroke-dashoffset: 0; } }
.pop { transform-box: fill-box; transform-origin: 0 100%; animation: wPop .5s cubic-bezier(.3,1.5,.5,1) both; }
@keyframes wPop { from { transform: scale(0); } to { transform: scale(1); } }
.rise { animation: wRise .7s cubic-bezier(.3,1.3,.5,1) both; }
@keyframes wRise { from { transform: scaleY(.05); opacity: .3; } to { transform: none; opacity: 1; } }
.w-liq-top, .w-base-disk { animation: wBob 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes wBob { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(.82); } }

/* triangle */
.tri { fill: color-mix(in srgb, var(--accent) 6%, var(--surface)); stroke: var(--line-2); stroke-width: 1.5; }
.tri-cell rect { fill: var(--surface); stroke: var(--line-2); stroke-width: 1.5; transition: fill .25s; }
.w-view .tri-cell text { font-size: 22px; font-weight: 800; fill: var(--ink); }
.tri-cell.unk rect { fill: color-mix(in srgb, var(--c-solved) 30%, var(--surface)); stroke: var(--c-solved); stroke-dasharray: 5 4; animation: wDash 1s linear infinite; }
@keyframes wDash { to { stroke-dashoffset: -18; } }
.w-view .tri-op { font-size: 22px; fill: var(--muted); }

/* in terms of pi */
.pi-board { font-family: var(--mono); padding: 10px 4px; }
.pi-line { font-size: 16px; color: var(--ink-2); margin-bottom: 8px; }
.pi-line .c-r { color: var(--c-r); font-weight: 700; } .pi-line .c-h { color: var(--c-h); font-weight: 700; }
.pi-big { font-size: 32px; font-weight: 800; color: var(--c-v); margin-top: 14px; animation: wFlip .45s ease both; }
@keyframes wFlip { from { opacity: 0; transform: rotateX(80deg); } to { opacity: 1; transform: none; } }

/* approximations */
.approx-list { display: flex; flex-direction: column; gap: 6px; }
.approx-row { display: grid; grid-template-columns: 64px 1fr 96px 84px; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; background: transparent; text-align: left; color: var(--ink-2); cursor: pointer; transition: background .15s, border-color .15s; }
.approx-row:hover { background: var(--surface-2); }
.approx-row.on { border-color: var(--c-v); background: color-mix(in srgb, var(--c-v) 8%, var(--surface)); }
.ap-l { font-weight: 800; color: var(--ink); }
.ap-bar { position: relative; height: 10px; background: var(--surface-2); border-radius: 99px; }
.ap-bar em { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: var(--muted); }
.ap-bar i { position: absolute; top: 0; bottom: 0; border-radius: 99px; transition: width .4s; }
.ap-bar i.neg { right: 50%; background: var(--c-r); }
.ap-bar i.pos { left: 50%; background: var(--c-solved); }
.ap-v, .ap-e { font-size: 13px; text-align: right; }

/* step nav */
.step-nav { display: flex; gap: 6px; }
.step-nav .btn { padding: 9px 12px; }
.step-dots { display: flex; gap: 8px; }
.step-dots button { width: 28px; height: 6px; border-radius: 99px; border: 0; background: var(--line-2); cursor: pointer; transition: background .2s; }
.step-dots button.on { background: var(--accent); }

/* units */
.unit-bars { display: flex; flex-direction: column; gap: 7px; }
.ub-row { display: grid; grid-template-columns: 76px 1fr 110px; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.ub-row.on { font-weight: 800; color: var(--ink); }
.ub-track { height: 12px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.ub-track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--c-h), var(--c-v)); transition: width .5s cubic-bezier(.3,1.2,.5,1); }
.ub-row.on .ub-track i { background: var(--c-solved); }
.ub-v { text-align: right; }

/* presets */
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.preset { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s; }
.preset svg { width: 64px; height: 64px; }
.preset:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 10px 24px -14px var(--accent); }
.preset:hover .w-liq-top { animation-duration: 1s; }
.preset b { font-size: 13.5px; }
.preset span { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.howto-link { cursor: pointer; transition: background .15s; border-radius: 10px; }
.howto-link:hover, .howto-link:focus-visible { background: var(--accent-soft); outline: none; }
.pulse-hl { animation: wPulse 1.1s ease 2; border-radius: 12px; }
@keyframes wPulse { 0%,100% { box-shadow: 0 0 0 0 transparent; } 40% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 45%, transparent); } }

/* quiz */
.quiz-q { font-size: 15.5px; color: var(--ink); margin-bottom: 12px; }
.quiz-q b { font-family: var(--mono); color: var(--c-v); }
.quiz-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.quiz-in { width: 150px; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; font-family: var(--mono); font-size: 15px; background: var(--surface); color: var(--ink); }
.quiz-in:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.quiz-unit { color: var(--muted); margin-right: 6px; }
.quiz-fb { min-height: 22px; margin-top: 10px; font-weight: 700; }
.quiz-fb.ok { color: #16a34a; animation: wPop .35s ease; } .quiz-fb.no { color: #dc2626; animation: wShake .4s ease; }
@keyframes wShake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.quiz-steps { margin: 8px 0 0; padding-left: 20px; font-size: 13.5px; color: var(--ink-2); }
.quiz-score { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

/* pour */
.pour-btns { display: flex; flex-wrap: wrap; gap: 6px; }

/* faq tools */
.widget.faq-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 0; padding: 12px; }
.faq-search { flex: 1 1 240px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: 12px; padding: 0 12px; background: var(--surface); color: var(--muted); }
.faq-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.faq-search input { flex: 1; border: 0; outline: none; background: transparent; padding: 10px 0; font-size: 14.5px; color: var(--ink); }
.faq-count { font-size: 12.5px; color: var(--muted); }

@media (max-width: 760px) {
  .w-body { grid-template-columns: 1fr; }
  .approx-row { grid-template-columns: 48px 1fr 80px; }
  .ap-e { display: none; }
  .ub-row { grid-template-columns: 64px 1fr 92px; }
}
@media (prefers-reduced-motion: reduce) {
  .widget *, .widget.w-ready { animation: none !important; transition: none !important; }
}
.widget [hidden] { display: none !important; }

/* =========================================================
   All calculators section (generated by tools/subcalc/build.mjs)
   ========================================================= */
.cd-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 18px 0 16px; }
.cd-search { flex: 1 1 280px; display: flex; align-items: center; gap: 9px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); color: var(--muted); }
.cd-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cd-search input { flex: 1; border: 0; outline: none; background: transparent; padding: 12px 0; font-size: 15px; color: var(--ink); }
.cd-count { font-size: 12.5px; color: var(--muted); }
.cd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.cd-card { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); text-decoration: none; overflow: hidden; transition: transform .18s, border-color .18s, box-shadow .18s; }
.cd-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120px 80px at 0% 0%, color-mix(in srgb, var(--cd) 14%, transparent), transparent 70%); opacity: .7; transition: opacity .2s; pointer-events: none; }
.cd-card:hover, .cd-card:focus-visible { transform: translateY(-3px); border-color: color-mix(in srgb, var(--cd) 55%, var(--line)); box-shadow: 0 14px 30px -18px var(--cd); outline: none; }
.cd-card:hover::before { opacity: 1; }
.cd-ic { position: relative; flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; color: var(--cd); background: color-mix(in srgb, var(--cd) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--cd) 26%, transparent); transition: transform .25s cubic-bezier(.3,1.4,.5,1); }
.cd-card:hover .cd-ic { transform: rotate(-6deg) scale(1.08); }
.ic { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ic .ic-acc { stroke: color-mix(in srgb, var(--cd) 55%, var(--ink)); stroke-width: 1.9; }
.ic .ic-fill { fill: color-mix(in srgb, var(--cd) 28%, transparent); stroke: none; }
.ic .ic-dot { fill: currentColor; stroke: none; }
.cd-txt { position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.cd-tag { font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--cd); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-t { font-weight: 700; font-size: 14.5px; line-height: 1.3; color: var(--ink); }
.cd-t::first-letter { text-transform: uppercase; }
.cd-f { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-go { position: relative; flex: none; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s, stroke .2s; }
.cd-card:hover .cd-go { transform: translateX(3px); stroke: var(--cd); }
.cd-card[hidden] { display: none; }
.cd-empty { color: var(--muted); }
:root[data-theme="dark"] .cd-card::before { opacity: .45; }

/* ===== Info pages: contact form, sitemap, 404, language switcher ===== */
.updated { color: var(--muted); font-size: 14px; }
.contact-form { display: grid; gap: 16px; margin: 22px 0 10px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .cf-row { grid-template-columns: 1fr; } }
.cf-field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink); }
.cf-field input, .cf-field textarea { font: inherit; font-weight: 400; color: var(--ink); background: var(--bg); border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 13px; min-height: 44px; }
.cf-field textarea { min-height: 150px; resize: vertical; }
.cf-field input:focus-visible, .cf-field textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.cf-field [aria-invalid="true"] { border-color: #d93a3a; }
.cf-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cf-note { color: var(--muted); font-size: 13px; margin: 0; }
.cf-status { margin: 0; font-size: 14px; min-height: 1.4em; }
.cf-status.is-error { color: #d93a3a; }
.cf-status.is-sending { color: var(--muted); }
.cf-status.is-sent { color: #1f9d55; }
.sitemap-list { padding-left: 18px; line-height: 1.9; }
.sitemap-cols { columns: 2 260px; column-gap: 28px; }
.nf-links { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; list-style: none; }
.nf-links a { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; }
.lang-menu { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.footer-grid .lang-menu a {
  display: block;
  margin: 0;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-wrap: anywhere;
}
.footer-grid .lang-menu a:hover { background: var(--surface); border-color: var(--line-2); }
.footer-grid .lang-menu a[aria-current="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
[dir="rtl"] .footer-inner, [dir="rtl"] .topbar-inner { direction: rtl; }
/* Math reads left to right in every language */
[dir="rtl"] .formula-chip, [dir="rtl"] .cd-f, [dir="rtl"] .w-res-sub, [dir="rtl"] li.mono, [dir="rtl"] .ans { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .formula-chip { justify-self: start; }

/* Links from homepage sections to the calculator that owns the topic */
.more-link { margin-top: 14px; padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; font-size: 15px; }
.more-link a { color: var(--accent); font-weight: 600; text-underline-offset: 3px; }
.more-link a:hover { text-decoration-thickness: 2px; }

/* ---- Readability pass: numbered sections, shorter lines, clearer scanning ---- */
.content { counter-reset: sec; }
.content > .sec { counter-increment: sec; scroll-margin-top: 84px; }
.content > .sec > h2 { display: flex; align-items: flex-start; gap: 12px; letter-spacing: -0.02em; }
.content > .sec > h2::before {
  content: counter(sec, decimal-leading-zero); flex: none; margin-top: .22em;
  font: 700 12.5px/1 var(--mono); color: var(--accent); background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); border-radius: 8px; padding: 6px 7px;
}
.content > .sec { padding: 44px 0 38px; }
.content > .sec:first-child { padding-top: 10px; }
.sec h3, .sec h3[id] { scroll-margin-top: 84px; }
.content > .sec h3 { position: relative; padding-left: 14px; font-size: 20px; margin-top: 34px; }
.content > .sec h3::before { content: ""; position: absolute; left: 0; top: .2em; bottom: .2em; width: 4px; border-radius: 4px; background: linear-gradient(var(--c-r), var(--c-v)); }
.content > .sec p:not(.answer):not(.given):not(.more-link) { max-width: 68ch; font-size: 16.5px; line-height: 1.78; }
.content > .sec .answer { font-size: 17.5px; line-height: 1.65; box-shadow: 0 1px 0 color-mix(in srgb, var(--c-v) 12%, transparent); }
.content > .sec ul:not([class]), .content > .sec ol:not([class]) { max-width: 68ch; padding-left: 0; list-style: none; display: grid; gap: 8px; margin: 0 0 16px; }
.content > .sec ul:not([class]) > li { position: relative; padding-left: 22px; font-size: 16px; line-height: 1.7; }
.content > .sec ul:not([class]) > li::before { content: ""; position: absolute; left: 4px; top: .7em; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }
.content > .sec ol:not([class]) { counter-reset: li; }
.content > .sec ol:not([class]) > li { counter-increment: li; position: relative; padding-left: 32px; font-size: 16px; line-height: 1.7; }
.content > .sec ol:not([class]) > li::before { content: counter(li); position: absolute; left: 0; top: .15em; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 700 12px/1 var(--mono); color: var(--accent); background: var(--accent-soft); }
.data-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.data-table tbody tr:hover td { background: var(--accent-soft); }
.data-table td:first-child { color: var(--ink); font-weight: 600; }
.worked { border-left: 4px solid var(--c-h); }
.worked .given { text-transform: none; letter-spacing: 0; }
.sec code, .sec .mono:not(td) { overflow-wrap: anywhere; }
.faq details { scroll-margin-top: 84px; }
@media (max-width: 760px) {
  .content > .sec { padding: 34px 0 28px; }
  .content > .sec > h2 { gap: 10px; }
  .content > .sec > h2::before { font-size: 11px; padding: 5px 6px; }
  .content > .sec p:not(.answer):not(.given):not(.more-link) { font-size: 16px; }
}

/* Byline, update date and key takeaways at the top of the guide */
.page-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 6px 0 16px; font-size: 13.5px; color: var(--muted); }
.page-meta .pm-by { font-weight: 600; color: var(--ink-2); }
.page-meta .pm-upd::before { content: "·"; margin-right: 10px; color: var(--line-2); }
.page-meta .pm-date { font-family: var(--mono); font-weight: 600; color: var(--ink-2); }
.takeaways { margin: 0 0 8px; padding: 20px 22px 16px; border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); border-radius: 16px; background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%); }
.tk-title { margin: 0 0 10px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.tk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; counter-reset: tk; }
.tk-list li { counter-increment: tk; position: relative; padding-left: 34px; font-size: 15.5px; line-height: 1.6; color: var(--ink-2); }
.tk-list li::before { content: counter(tk); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font: 700 12px/1 var(--mono); color: #fff; background: var(--accent); }
.tk-list b { color: var(--ink); }

/* Footer: calculator links in their own 4-column layer under the main columns */
.footer-grid { grid-template-columns: 1.5fr 1fr 1.3fr 1fr; }
.footer-calculators { padding: 24px 0 26px; border-top: 1px solid var(--line); }
.footer-calculators h2 { margin: 0 0 12px; color: var(--ink); font-size: 14px; font-weight: 700; }
.fc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px 24px; }
.fc-grid a { display: block; padding: 5px 0; color: var(--muted); text-decoration: none; font-size: 13px; line-height: 1.35; }
.fc-grid a:hover { color: var(--accent); }
@media (max-width: 1020px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .fc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 440px) { .footer-grid { grid-template-columns: 1fr; } .fc-grid { grid-template-columns: 1fr; } }

/* Footer calculators: 3 columns filled top to bottom, like a directory */
.footer-calculators { padding: 28px 0 30px; }
.footer-calculators h2 { margin: 0 0 18px; font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.fc-grid { display: block; columns: 3; column-gap: 48px; }
.fc-grid a { display: block; break-inside: avoid; padding: 7px 0; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.fc-grid a:hover { color: var(--accent); }
@media (max-width: 1020px) { .fc-grid { columns: 2; } }
@media (max-width: 760px) { .fc-grid { columns: 2; column-gap: 24px; } .fc-grid a { font-size: 14px; } }
@media (max-width: 440px) { .fc-grid { columns: 1; } }

/* Sources and references list */
.ref-list { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; }
.ref-list li { padding: 12px 14px 12px 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); position: relative; font-size: 15.5px; line-height: 1.6; }
.ref-list li::before { content: "↗"; position: absolute; left: 14px; top: 11px; color: var(--accent); font-weight: 800; }
.ref-list a { font-weight: 700; }
