/* BetterSPICE website: the inner pages (features, calculators, license, 404). Loaded after site.css and built on its
 * tokens: one ground, one surface step, hairlines, radii 0 / 2px / pill, no shadows, tabular figures, Barlow only.
 * Motion: 150 ms hover, 300 ms state, 500 ms a group arriving, 1200 ms travel; ease-move for moves, linear fades,
 * nothing scales, nothing loops. */

:root { --side: 248px; --sticky-top: 60px; }
.pg-hero { padding: 64px 0 0; }
.pg-hero .lede { margin-bottom: 28px; }
mark { background: rgba(255, 107, 0, .22); color: var(--text); border-radius: var(--radius-surface); padding: 0 1px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border: 1px solid var(--rule); border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--soft); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------------------------------------ hero figures */
.pg-figs { display: flex; flex-wrap: wrap; gap: 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: 8px 0 0; }
.pg-figs > div { padding: 14px 28px 14px 0; margin-right: 28px; border-right: 1px solid var(--rule); }
.pg-figs > div:last-child { border-right: 0; }
.pg-figs .k { font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pg-figs .v { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }

/* ------------------------------------------------------------------------------------------------ feature explorer */
.fx { padding: 40px 0 96px; }
.fx-grid { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); gap: 56px; align-items: start; }
.fx-side { position: sticky; top: calc(var(--sticky-top) + 20px); max-height: calc(100vh - var(--sticky-top) - 40px); overflow: auto; scrollbar-width: thin; }
.fx-search { position: relative; margin-bottom: 18px; }
.fx-search input { width: 100%; height: 44px; padding: 0 40px 0 38px; background: var(--surface); color: var(--text); border: 1px solid var(--rule);
  border-radius: var(--radius-surface); font: 400 16px/1 Barlow, sans-serif; transition: border-color var(--motion-micro) linear; -webkit-appearance: none; appearance: none; }
.fx-search input::placeholder { color: var(--muted); }
.fx-search input::-webkit-search-cancel-button { display: none; }
.fx-search input:focus-visible { outline: none; border-color: var(--accent); }
.fx-search .ic { position: absolute; left: 12px; top: 13px; color: var(--muted); pointer-events: none; }
.fx-search kbd { position: absolute; right: 10px; top: 11px; pointer-events: none; transition: opacity var(--motion-micro) linear; }
.fx-search.has-q kbd { opacity: 0; }
.fx-clear { position: absolute; right: 4px; top: 4px; width: 36px; height: 36px; border: 0; background: none; color: var(--muted); cursor: pointer;
  border-radius: var(--radius-surface); display: none; align-items: center; justify-content: center; transition: color var(--motion-micro) linear; }
.fx-search.has-q .fx-clear { display: inline-flex; }
.fx-count { font-size: 13px; color: var(--muted); margin: 8px 0 0; font-variant-numeric: tabular-nums; min-height: 20px; }
.fx-nav ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.fx-nav li { border-bottom: 1px solid var(--rule); }
.fx-nav a { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px 0 12px; text-decoration: none;
  color: var(--muted); font-size: 15px; font-weight: 500; box-shadow: inset 2px 0 0 transparent;
  transition: color var(--motion-micro) linear, background-color var(--motion-micro) linear, box-shadow var(--motion-micro) linear; }
.fx-nav a b { font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.fx-nav a i { font-style: normal; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); }
.fx-nav a.on { color: var(--text); background: var(--surface); box-shadow: inset 2px 0 0 var(--accent); }
.fx-nav a.on b { color: var(--accent); }
.fx-nav a.none { opacity: .45; }
.fx-tools { display: flex; gap: 8px; margin-top: 16px; }
.fx-tools .btn { flex: 1; justify-content: center; height: 36px; font-size: 12px; padding: 0 10px; }
.fx-side .fx-manual { font-size: 14px; color: var(--muted); margin: 18px 0 0; line-height: 1.5; }
.fx-side .fx-manual a { color: var(--soft); }

.fx-area { padding: 0 0 72px; scroll-margin-top: 80px; }
.fx-area[hidden] { display: none; }
.fx-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 40px; align-items: start; margin-bottom: 28px; }
.fx-head > div:first-child { padding-top: 4px; }
.fx-head.nofig { grid-template-columns: minmax(0, 1fr); }
.fx-head h2 { font-size: 34px; line-height: 1.1; font-weight: 800; margin: 0 0 12px; }
.fx-head p.d { color: var(--soft); margin: 0; max-width: 520px; }
.fx-head figure { margin: 0; }
.fx-head .cap { font-size: 13px; }
.fx-q .fx-head figure { display: none; }
.fx-q .fx-head { grid-template-columns: minmax(0, 1fr); margin-bottom: 18px; }
.fx-q .fx-head h2 { font-size: 26px; }

.fx-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.fx-list > li { border-bottom: 1px solid var(--rule); }
.fx-list > li[hidden] { display: none; }
.ft summary { list-style: none; display: grid; grid-template-columns: minmax(150px, 230px) minmax(0, 1fr) auto 20px; gap: 6px 24px; align-items: baseline;
  padding: 14px 12px 14px 14px; cursor: pointer; box-shadow: inset 2px 0 0 transparent;
  transition: background-color var(--motion-micro) linear, box-shadow var(--motion-micro) linear; }
.ft summary::-webkit-details-marker { display: none; }
.ft summary:focus-visible { outline-offset: -2px; }
.ft .t { font-weight: 600; color: var(--text); }
.ft .s { color: var(--soft); }
.ft .pg { font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ft .pm { align-self: center; width: 20px; height: 20px; color: var(--muted); transition: color var(--motion-micro) linear; }
.ft .pm .v { transition: opacity var(--motion-micro) linear; }
.ft[open] .pm .v { opacity: 0; }
.ft[open] summary { box-shadow: inset 2px 0 0 var(--accent); background: var(--surface); }
.ft[open] .pm { color: var(--text); }
.ft .b { display: grid; grid-template-columns: minmax(150px, 230px) minmax(0, 1fr); gap: 0 24px; padding: 0 44px 18px 14px; background: var(--surface); box-shadow: inset 2px 0 0 var(--accent); }
.ft .b > div { grid-column: 2; }
.ft .b p { margin: 0 0 10px; color: var(--soft); max-width: 700px; }
.ft .b .m { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 4px 0 0; font-size: 14px; }
.ft .b .m a { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; min-height: 32px;
  background: linear-gradient(var(--accent), var(--accent)) 0 calc(100% - 4px) / 100% 1px no-repeat; transition: color var(--motion-micro) linear; }
.ft .b .m .keys { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.ft[open] .b { animation: pg-fade var(--motion-state) linear; }
@keyframes pg-fade { from { opacity: 0; } to { opacity: 1; } }
.fx-empty { border: 1px solid var(--rule); border-radius: var(--radius-surface); background: var(--surface); padding: 22px 24px; margin: 0 0 40px; }
.fx-empty[hidden] { display: none; }
.fx-empty h3 { margin: 0 0 6px; font-size: 20px; }
.fx-empty p { margin: 0 0 12px; color: var(--soft); }
.fx-empty .sugg { display: flex; flex-wrap: wrap; gap: 8px; }
.chipb { height: 36px; padding: 0 14px; border: 1px solid var(--rule); border-radius: var(--radius-pill); background: transparent; color: var(--soft);
  font: 500 14px/1 Barlow, sans-serif; cursor: pointer; transition: border-color var(--motion-micro) linear, color var(--motion-micro) linear; }
.fx-end { border-top: 1px solid var(--rule); padding-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.fx-end p { margin: 0; color: var(--soft); max-width: 620px; }
.fx-end .cta { display: flex; gap: 12px; flex-wrap: wrap; }

html.js .pg-rv { opacity: 0; }
html.js .pg-rv.in { opacity: 1; transition: opacity var(--motion-reveal) linear; }

/* ------------------------------------------------------------------------------------------------ calculators */
.cx-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cx-jump a { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid var(--rule); border-radius: var(--radius-pill);
  text-decoration: none; color: var(--soft); font-size: 14px; font-weight: 500; transition: border-color var(--motion-micro) linear, color var(--motion-micro) linear; }
.cx-jump a b { color: var(--muted); font-weight: 600; font-size: 12px; font-variant-numeric: tabular-nums; }
.cx-list { padding-top: 48px; padding-bottom: 40px; }
.calc { border-top: 1px solid var(--rule); padding: 56px 0 64px; scroll-margin-top: 70px; }
.calc-h { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 28px; }
.calc-h h2 { font-size: 34px; line-height: 1.1; font-weight: 800; margin: 0 0 8px; }
.calc-h p { margin: 0; color: var(--soft); max-width: 640px; }
.calc-body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); border: 1px solid var(--rule); border-radius: var(--radius-surface); background: var(--surface); }
.calc-in { padding: 22px 22px 24px; border-right: 1px solid var(--rule); }
.calc-out { padding: 22px 24px 24px; min-width: 0; }
.calc-in .seg { margin-bottom: 16px; }
.seg-l, .fld label { display: block; font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.seg-b { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--rule); border-radius: var(--radius-surface); overflow: hidden; }
.seg-b button { height: 34px; padding: 0 12px; border: 0; border-right: 1px solid var(--rule); background: var(--ground); color: var(--muted); cursor: pointer;
  font: 500 14px/1 Barlow, sans-serif; transition: background-color var(--motion-state) linear, color var(--motion-state) linear; }
.seg-b button:last-child { border-right: 0; }
.seg-b button[aria-pressed="true"] { background: var(--raised); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.flds { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 14px; }
.fld { min-width: 0; }
.fld.full { grid-column: 1 / -1; }
.fld[hidden] { display: none; }
.fld .in { position: relative; }
.fld input, .fld select { width: 100%; height: 42px; padding: 0 44px 0 12px; background: var(--ground); color: var(--text); border: 1px solid var(--rule);
  border-radius: var(--radius-surface); font: 600 16px/1 Barlow, sans-serif; font-variant-numeric: tabular-nums; transition: border-color var(--motion-micro) linear; }
.fld select { padding-right: 12px; font-weight: 500; -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px; background-size: 5px 5px; background-repeat: no-repeat; }
.fld input:focus-visible, .fld select:focus-visible { outline: none; border-color: var(--accent); }
.fld .u { position: absolute; right: 12px; top: 0; height: 42px; display: flex; align-items: center; color: var(--muted); font-size: 14px; font-weight: 500; pointer-events: none; }
.fld input[aria-invalid="true"] { border-color: var(--danger); }
.fld .h { font-size: 12px; color: var(--muted); margin: 5px 0 0; line-height: 1.4; }
.res { display: flex; flex-wrap: wrap; border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.res > div { flex: 1 1 30%; padding: 12px 14px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); min-width: 0; }
.res .k { font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.res .v { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res .main { flex-basis: 100%; }
.res .main .v { font-size: 34px; color: var(--accent); }
.calc-msg { font-size: 14px; color: var(--soft); margin: 12px 0 0; min-height: 20px; }
.calc-msg.warn { color: var(--warn); }
.calc-msg.bad { color: var(--danger); }
.calc-plot { margin-top: 16px; border: 1px solid var(--rule); background: var(--ground); border-radius: var(--radius-surface); }
.calc-plot svg { display: block; width: 100%; height: auto; }
.calc-plot .ttl { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--rule); font-size: 12px; color: var(--muted); }
.calc-plot .ttl > span:first-child { letter-spacing: .12em; text-transform: uppercase; font-weight: 500; }
.calc-plot .lg { display: inline-flex; gap: 14px; }
.calc-plot .lg i { display: inline-block; width: 14px; height: 2px; vertical-align: middle; margin-right: 6px; }
.pairs { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 14px; font-variant-numeric: tabular-nums; }
.pairs th { text-align: left; font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 6px 10px 6px 0; border-bottom: 1px solid var(--rule); }
.pairs td { padding: 7px 10px 7px 0; border-bottom: 1px solid var(--rule); color: var(--soft); white-space: nowrap; }
.pairs tr:first-child td { color: var(--text); font-weight: 600; }
.pairs td.n, .pairs th.n { text-align: right; }
.calc-foot { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0; margin-top: 0; }
.calc-f { padding: 20px 22px 4px 0; }
.calc-v { padding: 20px 0 4px 24px; border-left: 1px solid var(--rule); }
.calc-foot h3 { font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.fx-math { list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-size: 14px; color: var(--soft); }
.fx-math li { padding: 6px 0; border-bottom: 1px solid var(--rule); overflow-x: auto; }
.fx-math li:first-child { border-top: 1px solid var(--rule); }
.fx-math b { color: var(--text); font-weight: 500; }
.calc-v p { margin: 0 0 10px; color: var(--soft); }
.calc-v .src { font-size: 13px; color: var(--muted); }
.calc-v a, .calc-f a, .cx-note a, .lic-doc a { color: var(--text); text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 1px no-repeat; transition: color var(--motion-micro) linear; }
.one17 { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border: 1px solid var(--rule); border-radius: var(--radius-pill); font-size: 13px; color: var(--soft); white-space: nowrap; }
.one17 i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.cx-note { border: 1px solid var(--rule); border-radius: var(--radius-surface); padding: 22px 24px; margin: 0 0 80px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 32px; align-items: center; }
.cx-note p { margin: 0; color: var(--soft); }
.cx-note h2 { font-size: 24px; margin: 0 0 6px; }

/* ------------------------------------------------------------------------------------------------ license */
.lic-grid { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); gap: 56px; align-items: start; padding-top: 40px; padding-bottom: 96px; }
.lic-toc { position: sticky; top: calc(var(--sticky-top) + 20px); max-height: calc(100vh - var(--sticky-top) - 40px); overflow: auto; scrollbar-width: thin; }
.lic-toc h2 { font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.lic-toc ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.lic-toc li { border-bottom: 1px solid var(--rule); }
.lic-toc a { display: grid; grid-template-columns: 28px 1fr; gap: 6px; padding: 7px 10px 7px 12px; text-decoration: none; color: var(--muted); font-size: 14px; line-height: 1.35;
  box-shadow: inset 2px 0 0 transparent; transition: color var(--motion-micro) linear, background-color var(--motion-micro) linear, box-shadow var(--motion-micro) linear; }
.lic-toc a b { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 12px; padding-top: 1px; }
.lic-toc a.on { color: var(--text); background: var(--surface); box-shadow: inset 2px 0 0 var(--accent); }
.lic-toc li.grp > a { color: var(--soft); font-weight: 600; }
.lic-sum { list-style: none; margin: 0 0 18px; padding: 0; border-top: 1px solid var(--rule); max-width: 820px; }
.lic-sum li { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 4px 24px; padding: 12px 0; border-bottom: 1px solid var(--rule); color: var(--soft); }
.lic-sum li b { color: var(--text); font-weight: 600; }
.lic-doc { max-width: 760px; }
.lic-doc section { padding: 0 0 18px; scroll-margin-top: 80px; }
.lic-doc h2 { font-size: 26px; font-weight: 800; margin: 40px 0 14px; padding-top: 18px; border-top: 1px solid var(--rule); }
.lic-doc section:first-child h2 { margin-top: 0; }
.lic-doc h3 { font-size: 19px; font-weight: 700; margin: 28px 0 10px; }
.lic-doc p { color: var(--soft); margin: 0 0 14px; overflow-wrap: anywhere; }
.lic-doc p.ind { padding-left: 24px; border-left: 1px solid var(--rule); font-family: var(--mono); font-size: 13.5px; }
.lic-doc .hr { height: 1px; background: var(--rule); margin: 24px 0; }
.lic-top { position: fixed; right: 24px; bottom: 24px; z-index: 8; opacity: 0; pointer-events: none; transition: opacity var(--motion-micro) linear; background: var(--ground); }
.lic-top.on { opacity: 1; pointer-events: auto; }

/* ------------------------------------------------------------------------------------------------ 404 */
.nf { padding: 72px 0 96px; }
.nf-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.nf h1 { font-size: 56px; line-height: 1.02; font-weight: 800; margin: 0 0 18px; }
.nf .lede { font-size: 20px; color: var(--soft); margin: 0 0 26px; max-width: 520px; }
.nf .cta { display: flex; flex-wrap: wrap; gap: 12px; }
.nf-path { font-family: var(--mono); font-size: 14px; color: var(--muted); margin: 0 0 24px; overflow-wrap: anywhere; }
.nf-path b { color: var(--soft); font-weight: 400; }
.nf-links { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.nf-links a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 14px 12px 14px 14px; border-bottom: 1px solid var(--rule); text-decoration: none;
  box-shadow: inset 2px 0 0 transparent; transition: background-color var(--motion-micro) linear, box-shadow var(--motion-micro) linear; }
.nf-links b { font-weight: 600; }
.nf-links span { grid-column: 1; color: var(--muted); font-size: 14px; }
.nf-links svg { grid-row: 1 / span 2; grid-column: 2; align-self: center; color: var(--muted); transition: transform var(--motion-micro) var(--ease-move), color var(--motion-micro) linear; }
.nf-scope { margin-top: 28px; border: 1px solid var(--rule); border-radius: var(--radius-surface); background: var(--surface); }
.nf-scope .ttl { display: flex; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--rule); font-size: 12px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.nf-scope svg { display: block; width: 100%; height: auto; }

/* ------------------------------------------------------------------------------------------------ hover, touch */
@media (hover: hover) {
  .fx-nav a:hover { color: var(--text); background: var(--surface); }
  .ft summary:hover { background: var(--surface); box-shadow: inset 2px 0 0 var(--accent); }
  .ft summary:hover .pm { color: var(--text); }
  .ft .b .m a:hover, .calc-v a:hover, .calc-f a:hover, .cx-note a:hover, .lic-doc a:hover { color: var(--accent); }
  .fx-clear:hover { color: var(--text); }
  .chipb:hover, .cx-jump a:hover { border-color: var(--accent); color: var(--text); }
  .seg-b button:hover { color: var(--text); }
  .lic-toc a:hover { color: var(--text); background: var(--surface); }
  .nf-links a:hover { background: var(--surface); box-shadow: inset 2px 0 0 var(--accent); }
  .nf-links a:hover svg { transform: translateX(3px); color: var(--accent); }
}
@media (hover: none) {
  .ft summary:active, .fx-nav a:active, .lic-toc a:active, .nf-links a:active { background: var(--surface); }
  .chipb:active, .cx-jump a:active { border-color: var(--accent); }
}

/* ------------------------------------------------------------------------------------------------ narrow screens */
@media (max-width: 1080px) {
  .fx-grid, .lic-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .fx-side { position: sticky; top: var(--sticky-top); z-index: 7; max-height: none; overflow: visible; margin: 0 -32px 28px; padding: 10px 32px 0; background: var(--ground); border-bottom: 1px solid var(--rule); }
  .fx-search { margin-bottom: 8px; }
  .fx-count { display: none; }
  .fx-nav { overflow-x: auto; scrollbar-width: none; margin: 0 -32px; padding: 0 32px; }
  .fx-nav::-webkit-scrollbar { display: none; }
  .fx-nav ol { display: flex; border-top: 0; gap: 4px; width: max-content; }
  .fx-nav li { border-bottom: 0; }
  .fx-nav a { grid-template-columns: auto auto auto; min-height: 44px; padding: 0 12px; white-space: nowrap; box-shadow: inset 0 -2px 0 transparent; }
  .fx-nav a.on { box-shadow: inset 0 -2px 0 var(--accent); background: transparent; }
  .fx-tools, .fx-side .fx-manual { display: none; }
  .fx-area { scroll-margin-top: 150px; }
  .lic-toc { position: static; max-height: none; margin-bottom: 32px; }
  .lic-toc ol { columns: 2; column-gap: 24px; border-top: 0; }
  .lic-toc li { break-inside: avoid; }
  .calc-body, .calc-foot { grid-template-columns: minmax(0, 1fr); }
  .calc-in { border-right: 0; border-bottom: 1px solid var(--rule); }
  .calc-v { border-left: 0; padding-left: 0; }
  .nf-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}
@media (max-width: 760px) {
  .pg-hero { padding-top: 40px; }
  .pg-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pg-figs > div { padding: 10px 8px 10px 0; margin-right: 0; border-right: 0; }
  .pg-figs .v { font-size: 21px; }
  .fx-side { margin: 0 -20px 24px; padding: 8px 20px 0; }
  .fx-nav { margin: 0 -20px; padding: 0 20px; }
  .fx-head { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .fx-head h2, .calc-h h2 { font-size: 28px; }
  .ft summary { grid-template-columns: minmax(0, 1fr) 20px; gap: 4px 12px; padding: 13px 8px 13px 12px; }
  .ft .t { grid-column: 1; }
  .ft .s { grid-column: 1; grid-row: 2; font-size: 15px; }
  .ft .pg { display: none; }
  .ft .pm { grid-column: 2; grid-row: 1 / span 2; }
  .ft .b { grid-template-columns: minmax(0, 1fr); padding: 0 12px 16px 12px; }
  .ft .b > div { grid-column: 1; }
  .flds { grid-template-columns: minmax(0, 1fr); }
  .res > div { flex-basis: 45%; }
  .res .main { flex-basis: 100%; }
  .res .v { font-size: 19px; }
  .res .main .v { font-size: 28px; }
  .calc-in, .calc-out { padding: 18px 16px; }
  .cx-note { grid-template-columns: minmax(0, 1fr); }
  .lic-toc ol { columns: 1; }
  .lic-sum li { grid-template-columns: minmax(0, 1fr); }
  .lic-doc p.ind { padding-left: 14px; font-size: 13px; }
  .nf h1 { font-size: 40px; }
  .lic-top { right: 14px; bottom: 14px; }
}
@media (max-width: 760px) and (orientation: landscape), (max-height: 500px) {
  .fx-side { position: static; margin-bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .ft[open] .b { animation: none; }
  html.js .pg-rv { opacity: 1; }
}
.ft .b .m a.pdf { color: var(--muted); background-size: 0 1px; }
.seg[hidden] { display: none; }
.pairs[hidden] { display: none; }

/* calculators: the app's own window in a frame */
.cx-hero{padding-bottom:18px}
.cx-open{margin:14px 0 0}
.cx-app-wrap{width:min(1480px,calc(100% - 32px));margin:0 auto 64px;border:1px solid var(--rule,#2a2a2a)}
.cx-app{display:block;width:100%;height:min(920px,calc(100vh - 110px));min-height:620px;border:0;background:#0D0D0D}
@media (max-width:820px){.cx-app-wrap{width:100%;border-left:0;border-right:0}.cx-app{height:calc(100vh - 70px);min-height:560px}}

/* ------------------------------------------------------------------------------------------------ guides, compare and calculator pages
 * (vs-ltspice.html, kicad-simulation.html, calculators/<id>.html): a reading column inside .wrap, ruled tables, numbered steps,
 * the calculator window framed inside the column (never full-bleed). */
.art-hero { padding-bottom: 8px; }
.art { max-width: 760px; min-width: 0; }
.art p, .art li { color: var(--soft); }
.art p b, .art li b { color: var(--text); font-weight: 600; }
.hero .art .lede { margin-bottom: 18px; }
.art-date { font-size: 14px; color: var(--muted) !important; }
.art a, .art-sec .fine a, .calc-embed-note a, .cx-pages a { color: var(--text); text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 1px no-repeat; transition: color var(--motion-micro) linear; }
.art a.btn { background: none; }
.art h2, .art-sec h2 { font-size: 30px; line-height: 1.12; font-weight: 800; margin: 0 0 14px; }
.art h3 { font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 22px 0 8px; }
.art-sec { padding: 56px 0 0; }
.art-sec.art-last { padding-bottom: 24px; }
.art-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.art-grid .art { max-width: none; }
.art-fig { margin: 0; min-width: 0; }
.art-fig.wide { margin: 22px 0 0; max-width: 1000px; }
.art-src { font-size: 14px; margin-top: 16px; }
.tbl-scroll { overflow-x: auto; max-width: 100%; border-top: 1px solid var(--rule); }
.tbl-scroll:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.vs-t { min-width: 640px; }
.vs-t thead th { padding-top: 12px; }
.vs-t th[scope="row"] { text-align: left; font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 14px 16px 12px 0; border-bottom: 1px solid var(--rule); vertical-align: top; width: 150px; }
.vs-t td { width: auto; }
.vs-t td:first-of-type { color: var(--soft); }
.vs-t td a { color: var(--text); text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 1px no-repeat; }
.plus { list-style: none; margin: 0; padding: 0; }
.plus li { padding: 12px 0 12px 22px; border-bottom: 1px solid var(--rule); position: relative; font-size: 16px; }
.plus li::before { content: ''; position: absolute; left: 0; top: 22px; width: 10px; height: 2px; background: var(--accent); }
.art .limits li { font-size: 16px; }
.srcs { margin: 0; padding: 0 0 0 20px; }
.srcs li { margin: 0 0 10px; font-size: 15px; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: st; }
.steps > li { counter-increment: st; position: relative; padding: 0 0 48px 64px; scroll-margin-top: 80px; }
.steps > li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 40px; height: 40px; border: 1px solid var(--rule); border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--accent); }
.steps > li + li { border-top: 1px solid var(--rule); padding-top: 32px; }
.steps > li + li::before { top: 32px; }
.steps h2 { font-size: 26px; margin-top: 4px; }
.calc-embed { border: 1px solid var(--rule); border-radius: var(--radius-surface); overflow: hidden; background: var(--ground); }
.calc-embed iframe { display: block; width: 100%; height: min(860px, calc(100vh - 110px)); min-height: 600px; border: 0; background: var(--ground); }
.calc-embed-note { font-size: 14px; color: var(--muted); margin: 10px 0 0; }
.cx-rel { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 40px; padding: 0; list-style: none; }
.cx-rel a, .cx-all a { color: var(--soft); text-decoration: none; transition: color var(--motion-micro) linear, border-color var(--motion-micro) linear; }
.cx-rel a { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border: 1px solid var(--rule); border-radius: var(--radius-pill); font-size: 14px; font-weight: 500; }
.cx-all { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 32px; border-top: 1px solid var(--rule); }
.cx-all h3 { font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 18px 0 6px; }
.cx-all ul { list-style: none; margin: 0; padding: 0; }
.cx-all li { padding: 6px 0; font-size: 15px; border-bottom: 1px solid var(--rule); }
.cx-all li span { color: var(--text); font-weight: 600; }
.art-more { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 0; }
.cx-note .art-more { margin: 0; }
.cx-note.art-end { margin-bottom: 0; }
.art-last .cx-note { margin-bottom: 0; }
.cx-pages { font-size: 14px; color: var(--muted); margin: 12px 0 0; line-height: 1.9; }
.cx-pages a { color: var(--soft); white-space: nowrap; }
@media (hover: hover) {
  .art a:not(.btn):hover, .art-sec .fine a:hover, .calc-embed-note a:hover, .cx-pages a:hover, .vs-t td a:hover, .cx-all a:hover { color: var(--accent); }
  .cx-rel a:hover { border-color: var(--accent); color: var(--text); }
}
@media (max-width: 1080px) {
  .art-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .cx-all { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .art h2, .art-sec h2 { font-size: 24px; }
  .art-sec { padding-top: 40px; }
  .steps > li { padding-left: 0; padding-top: 52px; }
  .steps > li + li { padding-top: 84px; }
  .steps > li::before { width: 34px; height: 34px; }
  .cx-all { grid-template-columns: minmax(0, 1fr); }
  .calc-embed iframe { height: calc(100vh - 70px); min-height: 560px; }
  .calc-embed-note { margin-top: 12px; }
}
@media (max-height: 500px) { .calc-embed iframe { min-height: 480px; } }
/* narrow screens: each row of a comparison table becomes a small block, every value under its column name */
@media (max-width: 760px) {
  .tbl-scroll { overflow-x: visible; }
  .vs-t { min-width: 0; }
  .vs-t thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .vs-t, .vs-t tbody, .vs-t tr, .vs-t th[scope="row"], .vs-t td { display: block; width: auto; }
  .vs-t tr { padding: 14px 0 6px; border-bottom: 1px solid var(--rule); }
  table.t.vs-t th[scope="row"] { border: 0; padding: 0 0 6px; width: auto; }
  table.t.vs-t td { border: 0; padding: 4px 0 8px; }
  .vs-t td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
  .vs-t td:first-of-type { color: var(--soft); }
}
