/* Server Fits site stylesheet (from web/mockups/style.css without the mock-up bar, the mock-up states and the mock-up slot switch). Tokens first.
   Heading face: a Latin subset of Source Serif 4 Bold (Adobe, SIL OFL 1.1, fonts/OFL.txt), renamed "Server Fits Serif" because "Source" is a Reserved Font Name. */
@font-face { font-family: "Server Fits Serif"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("fonts/ServerFitsSerif-Bold-latin.38c6df91.woff2") format("woff2"); }
:root {
  color-scheme: light;
  /* surfaces and ink */
  --bg: #f6f4ee;          /* warm paper */
  --surface: #fffefb;
  --text: #1d211e;
  --muted: #566058;
  --rule: #dcd9ce;        /* decorative hairlines only */
  --rule-strong: #8c8b7d; /* UI boundaries (3:1) */
  /* brand */
  --accent: #1b6b4a;
  --accent-soft: #e1eee7;
  --on-accent: #ffffff;
  --focus: #1a4fd0;
  /* states */
  --community-fg: #6b4300;  --community-bg: #f8ebcc;
  --floor-fg: #6b4300;      --floor-edge: #9a6a10;
  --scope-fg: #40463f;      --scope-bg: #ebe9e0;
  --derived-fg: #2a4a80;    --derived-bg: #e4eaf6;
  --incomplete-fg: #8a3a0e; --incomplete-bg: #fbe4d5;
  --nofit-fg: #8c2222;      --nofit-bg: #f9e1de;
  /* type */
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Server Fits Serif", "Iowan Old Style", Georgia, serif; /* headings only, never digits */
  --radius: 3px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.55 var(--sans); }
a { color: var(--accent); text-underline-offset: 3px; overflow-wrap: anywhere; } /* long source URLs shown as link text must wrap at 320 px */
a:focus-visible, button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
.num { font-variant-numeric: tabular-nums lining-nums; }

.top { background: var(--surface); border-bottom: 2px solid var(--text); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.5rem; min-height: 3.5rem; }
.brand { font: 700 1.25rem var(--serif); color: var(--text); text-decoration: none; padding: .5rem 0; }
.nav { display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin-left: auto; font-size: .9375rem; }
.nav a { color: var(--muted); text-decoration: none; padding: .75rem 0; min-height: 44px; display: inline-flex; align-items: center; }
.nav a[aria-current] { color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); }

h1 { font: 700 clamp(1.75rem, 5vw, 2.5rem)/1.12 var(--serif); letter-spacing: -.01em; margin: 1.5rem 0 .5rem; }
h2 { font: 700 1.375rem/1.2 var(--serif); margin: 2.25rem 0 .5rem; }
.lead { font-size: 1.125rem; max-width: 42rem; margin: 0 0 .75rem; }
.asof { font-size: .875rem; color: var(--muted); margin: 0 0 1rem; max-width: 46rem; }
.note { font-size: .875rem; color: var(--muted); max-width: 46rem; }
/* Marks an unwritten-copy placeholder (preview builds only; a normal build fails on one). */
.copy { background: #fff3a8; color: #3a3000; padding: 0 .25em; font-size: .85em; }

/* Options strip: a form-free summary of the cost options in force */
.opts { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin: 1rem 0 .5rem; font-size: .9375rem; }
.opts b { font-weight: 600; }
.opts a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .25rem; }

/* Chips: shape + word, never colour alone */
.chip { display: inline-block; padding: .05rem .45rem; font-size: .75rem; font-weight: 600; line-height: 1.5; border-radius: var(--radius); white-space: nowrap; }
.chip.incomplete { background: var(--incomplete-bg); color: var(--incomplete-fg); border: 1px dashed var(--incomplete-fg); }
.chip.nofit { background: var(--nofit-bg); color: var(--nofit-fg); border: 1px solid var(--nofit-fg); }
.chip.scope { background: var(--scope-bg); color: var(--scope-fg); border: 1px dashed var(--scope-fg); }
.chip.community { background: var(--community-bg); color: var(--community-fg); }
.chip.floor { background: var(--surface); color: var(--floor-fg); border: 1px solid var(--floor-edge); }
.chip.derived { background: var(--derived-bg); color: var(--derived-fg); }

/* ---- Ranked cost table ---- */
.ledger { width: 100%; border-collapse: collapse; background: var(--surface); border-top: 2px solid var(--text); border-bottom: 1px solid var(--text); font-size: .9375rem; }
.ledger caption { text-align: left; padding: .75rem 0 .5rem; font-weight: 600; caption-side: top; }
.ledger th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; text-align: left; padding: .5rem .625rem; border-bottom: 1px solid var(--rule-strong); }
.ledger td { padding: .75rem .625rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.ledger tr:last-child td { border-bottom: 0; }
.ledger .r { text-align: right; }
.ledger .rank { color: var(--muted); width: 2rem; }
.ledger .who b { display: block; font-weight: 600; }
.ledger .sub { display: block; font-size: .8125rem; color: var(--muted); }
.ledger .total { font-weight: 700; font-size: 1.0625rem; }
.ledger .src { font-size: .8125rem; color: var(--muted); }
.ledger .src a { display: inline-block; padding: .25rem 0; }
.ledger tr.incomplete td { background: var(--incomplete-bg); }
.ledger tr.incomplete td:first-child { box-shadow: inset 4px 0 0 var(--incomplete-fg); }
.ledger tr.nofit td { background: var(--nofit-bg); color: var(--nofit-fg); }
.ledger tr.nofit td:first-child { box-shadow: inset 4px 0 0 var(--nofit-fg); }

/* Phone: each row becomes a ledger entry; same markup, same order, no scroller.
   Grid: rank | 4 equal columns. Part cells (plan, surcharge, IPv4, backups) start at column 2 and flow. */
@media (max-width: 47.99rem) {
  .ledger, .ledger tbody, .ledger tr, .ledger td, .ledger caption { display: block; }
  .ledger thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .ledger tr { display: grid; grid-template-columns: 1.75rem repeat(4, minmax(0, 1fr)); column-gap: .5rem; row-gap: .25rem; padding: .875rem .75rem; border-bottom: 1px solid var(--rule); }
  .ledger tr:last-child { border-bottom: 0; }
  .ledger td { padding: 0; border: 0; background: none !important; box-shadow: none !important; min-width: 0; }
  .ledger tr.incomplete { background: var(--incomplete-bg); box-shadow: inset 4px 0 0 var(--incomplete-fg); }
  .ledger tr.nofit { background: var(--nofit-bg); box-shadow: inset 4px 0 0 var(--nofit-fg); }
  .ledger .rank { grid-column: 1; grid-row: 1; width: auto; padding-top: .1rem; }
  .ledger .who { grid-column: 2 / 4; grid-row: 1; }
  .ledger .total { grid-column: 4 / -1; grid-row: 1; text-align: right; font-size: 1.25rem; }
  .ledger .specs { grid-column: 2 / -1; grid-row: 2; font-size: .875rem; color: var(--muted); }
  .ledger .part { grid-row: 3; font-size: .875rem; margin-top: .375rem; }
  .ledger .pc2 { grid-column: 2; } .ledger .pc3 { grid-column: 3; } .ledger .pc4 { grid-column: 4; } .ledger .pc5 { grid-column: 5; }
  .ledger .part::before { content: attr(data-label); display: block; font-size: .6875rem; line-height: 1.25; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); overflow-wrap: anywhere; }
  @media (max-width: 23.99rem) { .ledger tr { column-gap: .25rem; } .ledger .part::before { letter-spacing: 0; text-transform: none; font-size: .625rem; } }
  .ledger .r { text-align: left; }
  .ledger .total.r { text-align: right; }
  .ledger .src { grid-column: 2 / -1; grid-row: 4; margin-top: .125rem; }
  .ledger .nofit-msg { grid-column: 2 / -1; grid-row: 2; }
}
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .8125rem; color: var(--muted); margin: .5rem 0 0; }
.foot { margin-top: 3rem; padding: 1.25rem 0 2rem; border-top: 2px solid var(--text); font-size: .875rem; color: var(--muted); }

/* ===== Step 2 additions ===== */
.num-r { text-align: right; }
.lead-fig { font-variant-numeric: tabular-nums lining-nums; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: .5rem; top: .5rem; }
h3 { font: 700 1.0625rem/1.25 var(--sans); margin: 1.75rem 0 .25rem; }
.sub-h { font-size: .875rem; color: var(--muted); margin: 0 0 .5rem; max-width: 46rem; }
main { padding-bottom: 1rem; }
.prose { max-width: 42rem; }
.prose p, .prose li { max-width: 42rem; }
.crumb { font-size: .875rem; color: var(--muted); margin: 1rem 0 0; }
.crumb a { display: inline-flex; align-items: center; min-height: 44px; }


/* Cost-options switch: two links, same weight; the current one is underlined and bold */
.opts .sw { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.opts .sw a { padding: 0 .875rem; text-decoration: none; color: var(--text); min-height: 44px; display: inline-flex; align-items: center; }
.opts .sw a + a { border-left: 1px solid var(--rule-strong); }
.opts .sw a[aria-current="true"] { background: var(--text); color: var(--surface); font-weight: 600; }
.view-b { display: none; }
.view-b:target { display: block; }
main:has(.view-b:target) .view-a { display: none; }
main:has(.view-b:target) .sw .to-a { background: none; color: var(--text); font-weight: 400; }
main:has(.view-b:target) .sw .to-b { background: var(--text); color: var(--surface); font-weight: 600; }
main:has(.view-b:target) .sw .to-a[aria-current] { }

/* Source line, state chips additions */
.chip.official { background: var(--surface); color: var(--text); border: 1px solid var(--rule-strong); }
.chip.partial { background: var(--scope-bg); color: var(--scope-fg); border: 1px dashed var(--scope-fg); }
.chips { display: inline-flex; flex-wrap: wrap; gap: .25rem; vertical-align: baseline; }
.src-line { font-size: .8125rem; color: var(--muted); margin: .25rem 0 0; }
.src-line a { display: inline-block; padding: .25rem 0; }

/* Callouts: a rule on the left, no box */
.callout { border-left: 4px solid var(--rule-strong); padding: .5rem 0 .5rem 1rem; margin: 1rem 0; max-width: 46rem; }
.callout > :first-child { margin-top: 0; } .callout > :last-child { margin-bottom: 0; }
.callout.community { border-left-color: var(--floor-edge); background: var(--community-bg); padding-right: 1rem; color: var(--community-fg); }
.callout.community a { color: var(--community-fg); }
.callout.pointer { border-left-color: var(--accent); }
.callout.rule { border-left-color: var(--text); background: var(--surface); padding: .75rem 1rem; font-size: 1.0625rem; }

/* Requirements sheet (also provider plan lists and matrices) */
.sheet { width: 100%; border-collapse: collapse; background: var(--surface); border-top: 2px solid var(--text); border-bottom: 1px solid var(--text); font-size: .9375rem; }
.sheet caption { text-align: left; padding: .75rem 0 .5rem; font-weight: 600; caption-side: top; }
.sheet th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; text-align: left; padding: .5rem .625rem; border-bottom: 1px solid var(--rule-strong); }
.sheet td { padding: .625rem .625rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.sheet tr:last-child td { border-bottom: 0; }
.sheet .r { text-align: right; }
.sheet .sub { display: block; font-size: .8125rem; color: var(--muted); }
.sheet tr.floor td { background: var(--surface); box-shadow: none; }
.sheet tr.floor td:first-child { box-shadow: inset 4px 0 0 var(--floor-edge); }
.sheet tbody th { text-transform: none; letter-spacing: 0; font-size: .9375rem; color: var(--text); font-weight: 600; border-bottom: 1px solid var(--rule); background: var(--surface); vertical-align: top; padding: .625rem .625rem; }
.sheet tbody tr:last-child th { border-bottom: 0; }
.sheet .grp th { background: var(--bg); text-transform: uppercase; font-size: .75rem; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--rule-strong); }
.sheet a { display: inline-block; padding: .125rem 0; }
.tot { font-weight: 700; }
.muted { color: var(--muted); }
.dash { color: var(--muted); }

@media (max-width: 47.99rem) {
  .sheet, .sheet tbody, .sheet tr, .sheet td, .sheet th, .sheet caption { display: block; }
  .sheet thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .sheet tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: .5rem; row-gap: .125rem; padding: .75rem .75rem; border-bottom: 1px solid var(--rule); }
  .sheet tr:last-child { border-bottom: 0; }
  .sheet td, .sheet tbody th { padding: 0; border: 0; min-width: 0; grid-column: auto; }
  .sheet tbody th { grid-column: 1 / -1; }
  .sheet tr.floor { box-shadow: inset 4px 0 0 var(--floor-edge); }
  .sheet tr.floor td:first-child { box-shadow: none; }
  .sheet td[data-label]::before { content: attr(data-label); display: block; font-size: .6875rem; line-height: 1.25; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
  .sheet .r { text-align: left; }
  .sheet .wide { grid-column: 1 / -1; margin-top: .25rem; }
  .sheet .span2 { grid-column: span 2; }
  .sheet .grp { display: block; padding: .5rem .75rem; background: var(--bg); }
  .sheet .grp th { padding: 0; border: 0; grid-column: 1 / -1; }
  /* plan lists: name and price on row 1, specs with inline units on row 2, extras below */
  .plans tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: .75rem; }
  .plans .t-name { grid-column: 1; grid-row: 1; font-weight: 600; }
  .plans td.t-price { grid-column: 2; grid-row: 1; text-align: right; font-weight: 700; }
  .plans td.t-extra { grid-column: 1 / -1; font-size: .8125rem; color: var(--muted); }
  .sheet.plans td.t-price[data-label]::before { display: none; }
  .sheet.plans td[data-unit]::before { display: none; }
  .plans td[data-unit]::after { content: " " attr(data-unit); color: var(--muted); }
  .sheet.plans td.t-extra[data-label]::before { display: inline; content: attr(data-label) ": "; text-transform: none; letter-spacing: 0; font-size: inherit; }
  .sheet.plans td.t-extra { display: block; }
  .matrix tr { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Cost breakdown bar (CSS, no image) */
.bar { display: flex; height: .875rem; border: 1px solid var(--text); background: var(--surface); margin: .5rem 0; max-width: 32rem; }
.bar i { display: block; height: 100%; }
.bar .b-plan { background: var(--text); }
.bar .b-sur { background: repeating-linear-gradient(45deg, var(--text) 0 2px, var(--surface) 2px 5px); }
.bar .b-ipv4 { background: var(--rule-strong); }
.bar .b-bk { background: var(--accent); }
.keys { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .8125rem; color: var(--muted); margin: 0; padding: 0; list-style: none; }
.keys li::before { content: ""; display: inline-block; width: .75rem; height: .75rem; margin-right: .375rem; border: 1px solid var(--text); vertical-align: -1px; }
.keys .k-plan::before { background: var(--text); }
.keys .k-sur::before { background: repeating-linear-gradient(45deg, var(--text) 0 2px, var(--surface) 2px 4px); }
.keys .k-bk::before { background: var(--accent); }

/* Monetization slot: a plain line under the source line, same size as it. Empty = absent (no markup). */
.slot { font-size: .8125rem; color: var(--muted); margin: .25rem 0 0; }
.slot a { display: inline-block; padding: .25rem 0; }
.slot b { color: var(--text); font-weight: 600; }
.ftc { font-size: .875rem; color: var(--text); max-width: 46rem; margin: .5rem 0 1rem; padding: .5rem .75rem; border: 1px solid var(--rule-strong); background: var(--surface); }

/* Jump nav and group heads for long lists */
.jump { display: flex; flex-wrap: wrap; gap: .25rem .5rem; margin: .75rem 0; padding: 0; list-style: none; }
.jump a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .75rem; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; font-size: .9375rem; }
.jump a small { color: var(--muted); margin-left: .375rem; font-size: .8125rem; }
.group-head { margin-top: 2rem; }
.to-top { font-size: .875rem; }
.to-top a { display: inline-flex; min-height: 44px; align-items: center; }

/* Panels for empty states: dashed edges, plain background */
.empty { border: 1px dashed var(--rule-strong); padding: 1rem; background: var(--surface); max-width: 46rem; }
.empty p { margin: 0 0 .5rem; } .empty p:last-child { margin: 0; }

/* Forms (calculator) */
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem 1.5rem; max-width: 56rem; margin: 1rem 0; }
.field { display: flex; flex-direction: column; gap: .25rem; }
.field label, .field legend { font-size: .875rem; font-weight: 600; padding: 0; }
.field select, .field input[type="number"] { min-height: 44px; font: inherit; padding: 0 .625rem; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); width: 100%; }
.field .hint { font-size: .8125rem; color: var(--muted); }
.checks { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }
.checks label { display: inline-flex; align-items: center; gap: .625rem; min-height: 44px; font-weight: 400; font-size: 1rem; }
.checks input { width: 1.25rem; height: 1.25rem; accent-color: var(--accent); margin: 0; }
select:focus-visible, input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
select:disabled, input:disabled { background: var(--bg); color: var(--muted); border-style: dashed; }
.btn { min-height: 44px; padding: 0 1.25rem; font: 600 1rem var(--sans); background: var(--accent); color: var(--on-accent); border: 0; border-radius: var(--radius); cursor: pointer; }
.btn:disabled { background: var(--bg); color: var(--muted); border: 1px dashed var(--rule-strong); cursor: not-allowed; }
.result { border-top: 2px solid var(--text); border-bottom: 1px solid var(--text); background: var(--surface); padding: 1rem; max-width: 40rem; margin: 1rem 0; }
.result .big { font-size: 2.25rem; font-weight: 700; line-height: 1.1; }
.result dl { margin: .75rem 0 0; display: grid; grid-template-columns: 1fr auto; gap: .375rem 1rem; font-size: .9375rem; }
.result dt { color: var(--text); } .result dd { margin: 0; text-align: right; }
.result dt small { display: block; color: var(--muted); font-size: .8125rem; }
.result .apart { margin-top: .75rem; padding-top: .75rem; border-top: 1px dashed var(--rule-strong); font-size: .9375rem; }

/* Index lists (home, apps) */
.index { width: 100%; border-collapse: collapse; background: var(--surface); border-top: 2px solid var(--text); border-bottom: 1px solid var(--text); font-size: .9375rem; }
.index th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; text-align: left; padding: .5rem .625rem; border-bottom: 1px solid var(--rule-strong); }
.index td { padding: .75rem .625rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.index tr:last-child td { border-bottom: 0; }
.index td.name a { font-weight: 600; font-size: 1.0625rem; }
.index .r { text-align: right; }
.index .sub { display: block; font-size: .8125rem; color: var(--muted); }
.index a { display: inline-block; padding: .125rem 0; }
@media (max-width: 47.99rem) {
  .index, .index tbody, .index tr, .index td { display: block; }
  .index thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .index tr { padding: .75rem; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .125rem .75rem; }
  .index tr:last-child { border-bottom: 0; }
  .index td { padding: 0; border: 0; }
  .index td.name { grid-column: 1; } .index td.cost { grid-column: 2; grid-row: 1; text-align: right; font-weight: 700; }
  .index td.need, .index td.kind { grid-column: 1 / -1; font-size: .875rem; color: var(--muted); }
  .index td.r { text-align: left; }
  .index td.cost.r { text-align: right; }
}
.method-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem 2rem; margin: 1rem 0; padding: 0; list-style: none; counter-reset: s; }
.method-steps li { border-top: 2px solid var(--text); padding-top: .5rem; counter-increment: s; }
.method-steps li::before { content: counter(s) "."; font-weight: 700; margin-right: .375rem; }
.legend-t td:first-child { white-space: nowrap; width: 1%; }
.foot p { margin: .25rem 0; max-width: 46rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.foot a { display: inline-flex; align-items: center; min-height: 44px; }
.ledger .who a { color: var(--text); text-decoration-color: var(--rule-strong); }
@media (max-width: 47.99rem) { .ledger, .sheet, .index { position: relative; overflow: hidden; } }
@media (max-width: 47.99rem) { .ledger .src br { display: none; } .ledger .src > a::before { content: "·"; display: inline-block; margin: 0 .5em; text-decoration: none; } .ledger .src a { padding: .25rem 0; } }
.ledger .total .sub { font-weight: 400; }
@media (min-width: 48rem) { .index { table-layout: fixed; } .index th:nth-child(1) { width: 22%; } .index th:nth-child(2) { width: 33%; } .index th:nth-child(3) { width: 25%; } .index th:nth-child(4) { width: 20%; } }
.field select:disabled, .field input:disabled { background: var(--bg); color: var(--muted); border-style: dashed; }
.keys .k-ipv4::before { background: var(--rule-strong); }
