/* NetDesignKit site styles. Layout: patch-panel workbench. No external fonts or requests. */
:root {
  --bg: #F3F6F7;
  --panel: #FFFFFF;
  --ink: #14212B;
  --muted: #5B6B76;
  --line: #D6DEE2;
  --accent: #0B7A84;
  --accent-ink: #FFFFFF;
  --accent-soft: #DDF0F1;
  --free: #E7ECEE;
  --bad: #B3261E;
  --bad-soft: #FBE7E5;
  --s1: #0B7A84; --s2: #3A63B8; --s3: #8C5CC2; --s4: #C0702B; --s5: #4E8A3A; --s6: #B5487A; --s7: #5C7A8C; --s8: #9A8A23;
  --display: "Avenir Next", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0F171C; --panel: #16222A; --ink: #E3ECEF; --muted: #93A5AF; --line: #2A3A44;
  --accent: #4CC3CC; --accent-ink: #0F171C; --accent-soft: #163C41; --free: #1F2D35; --bad: #FF8A80; --bad-soft: #3A1E1C;
  --s1: #3DB6BF; --s2: #7095E6; --s3: #B38BE8; --s4: #E3995A; --s5: #7DBF68; --s6: #E07BA9; --s7: #8FAFC2; --s8: #CDBB52;
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0F171C; --panel: #16222A; --ink: #E3ECEF; --muted: #93A5AF; --line: #2A3A44;
  --accent: #4CC3CC; --accent-ink: #0F171C; --accent-soft: #163C41; --free: #1F2D35; --bad: #FF8A80; --bad-soft: #3A1E1C;
  --s1: #3DB6BF; --s2: #7095E6; --s3: #B38BE8; --s4: #E3995A; --s5: #7DBF68; --s6: #E07BA9; --s7: #8FAFC2; --s8: #CDBB52;
  color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55; }
img { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap { max-width: 1180px; margin: 0 auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--panel); padding: 8px 12px; border-radius: 6px; z-index: 20; }
.skip:focus { left: 16px; }

/* Header */
.site-header { background: var(--panel); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.brand-mark { display: inline-grid; grid-template-columns: repeat(4, 5px); gap: 3px; }
.brand-mark i { width: 5px; height: 12px; border-radius: 1px; background: var(--accent); }
.brand-mark i:nth-child(2) { opacity: 0.7; } .brand-mark i:nth-child(3) { opacity: 0.45; } .brand-mark i:nth-child(4) { opacity: 0.25; }
.nav { display: flex; gap: 4px 18px; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px; padding: 4px 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }

/* Type */
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; line-height: 1.2; margin: 0; }
h1 { font-size: clamp(30px, 5vw, 46px); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(22px, 3vw, 28px); font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 18px; font-weight: 600; }
.lead { font-size: 18px; color: var(--muted); max-width: 62ch; margin: 14px 0 0; }
.muted { color: var(--muted); }
code, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

main { display: flex; flex-direction: column; gap: 56px; padding-block: 40px 64px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.section-head p { margin: 6px 0 0; color: var(--muted); max-width: 60ch; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  border: 1px solid var(--accent); background: transparent; color: var(--accent); padding: 10px 18px; border-radius: 6px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn:hover { filter: brightness(1.08); }
.btn.small { padding: 7px 12px; font-size: 14px; }
.hero-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; font-family: var(--mono); font-size: 13.5px; min-width: 0; }
.hero-card .row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.hero-card .row:last-child { border-bottom: 0; }
.hero-card .row span:first-child { display: flex; align-items: center; gap: 8px; font-family: var(--body); font-size: 14px; }
.hero-card .bar { display: flex; height: 22px; border-radius: 4px; overflow: hidden; margin-bottom: 12px; border: 1px solid var(--line); }
.hero-card .bar i { height: 100%; }
.trust { display: flex; gap: 8px 24px; flex-wrap: wrap; margin-top: 22px; color: var(--muted); font-size: 14px; }
.trust span { display: inline-flex; align-items: center; gap: 8px; }
.trust span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card .card-foot { margin-top: auto; padding-top: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
a.card { text-decoration: none; color: inherit; }
a.card:hover { border-color: var(--accent); }
.card.live { border-color: var(--accent); }
.tag { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; background: var(--free); color: var(--muted); }
.tag.on { background: var(--accent-soft); color: var(--accent); }
.price { font-family: var(--mono); font-weight: 500; font-size: 18px; font-variant-numeric: tabular-nums; }
.includes { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }

.band { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 28px; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }
@media (max-width: 700px) { .band { grid-template-columns: 1fr; padding: 20px; } }
.band p { margin: 8px 0 0; color: var(--muted); max-width: 60ch; }

/* Prose pages */
.prose { max-width: 70ch; }
.prose h2 { margin-top: 36px; margin-bottom: 8px; font-size: 22px; }
.prose h3 { margin-top: 24px; margin-bottom: 6px; }
.prose p, .prose li { color: var(--ink); }
.prose ul, .prose ol { padding-left: 22px; }
.note { background: var(--accent-soft); border-radius: 8px; padding: 14px 16px; font-size: 15px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--panel); }
.site-footer .wrap { padding-block: 28px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.site-footer nav { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }

/* Tool layout */
.tool-grid { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .tool-grid { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; min-width: 0; }
.panel h2 { font-size: 17px; font-weight: 600; margin: 0 0 12px; }
label, .label { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
input { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; width: 100%; min-width: 0; }
input.mono { font-family: var(--mono); font-size: 14px; }
input[aria-invalid="true"] { border-color: var(--bad); background: var(--bad-soft); }
.field { display: flex; flex-direction: column; gap: 4px; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.hint.bad { color: var(--bad); }
.reqs { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.req-head, .req { display: grid; grid-template-columns: 14px 1fr 84px 34px; gap: 8px; align-items: center; }
.req-head span { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; }
.icon-btn { font: inherit; cursor: pointer; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--muted); width: 34px; height: 38px; font-size: 18px; line-height: 1; }
.icon-btn:hover { color: var(--bad); border-color: var(--bad); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat .k { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.stat .v { font-family: var(--mono); font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat .v.small { font-size: 15px; }
.map { display: flex; height: 34px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: var(--free); margin-top: 18px;
  background-image: repeating-linear-gradient(135deg, transparent 0 6px, var(--line) 6px 7px); }
.seg { height: 100%; border-right: 1px solid var(--panel); min-width: 2px; }
.map-scale { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 6px; gap: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.table-scroll { overflow-x: auto; margin-top: 18px; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 9px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 600; background: var(--bg); }
td.mono { font-size: 13.5px; }
td.num, th.num { text-align: right; }
tbody tr:last-child td { border-bottom: 0; }
.name-cell { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--bad-soft); color: var(--bad); margin-right: 6px; }
.bench-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.bench-head h2 { margin: 0; }
.bench-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toast { font-size: 13px; color: var(--accent); min-height: 1.4em; }
.cta-strip { margin-top: 18px; background: var(--accent-soft); border-radius: 8px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 15px; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 8px 0 0; color: var(--muted); }
.example { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; font-family: var(--mono); font-size: 13.5px; line-height: 1.7; white-space: pre; }

/* Segment colours (classes, so no inline styles are needed under the CSP) */
.c1 { background: var(--s1); } .c2 { background: var(--s2); } .c3 { background: var(--s3); } .c4 { background: var(--s4); }
.c5 { background: var(--s5); } .c6 { background: var(--s6); } .c7 { background: var(--s7); } .c8 { background: var(--s8); }
.cfree { background: var(--free); border: 1px solid var(--line); }
.w25 { flex: 0 0 25%; } .w12 { flex: 0 0 12.5%; } .w3 { flex: 0 0 3.125%; } .w0 { flex: 0 0 0.6%; }
@media (prefers-reduced-motion: no-preference) { .seg { transition: flex-basis 0.25s ease; } }
.stack { display: flex; flex-direction: column; gap: 56px; }
.mt { margin-top: 16px; }
.stack > *, .prose > * { min-width: 0; max-width: 100%; }
.tool-grid > * { min-width: 0; }
main > .wrap { min-width: 0; width: 100%; }
.consult { background: var(--accent-soft); border-top: 1px solid var(--line); }
.consult .wrap { padding-block: 18px; }
.consult p { margin: 0; max-width: 80ch; }
.consult a { font-weight: 600; overflow-wrap: anywhere; }

/* Lookup tools */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lookup-form { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.lookup-form .grow { flex: 1 1 260px; min-width: 0; }
select { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; min-width: 110px; }
select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.examples { margin: 8px 0 0; font-size: 14px; color: var(--muted); display: flex; gap: 6px 14px; flex-wrap: wrap; }
.examples a { font-family: var(--mono); }
.source { overflow-wrap: anywhere; }
.ip-panel h2.label { margin: 0 0 8px; }
.ip-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ip-big { font-size: clamp(24px, 5vw, 38px); font-weight: 500; letter-spacing: -0.01em; overflow-wrap: anywhere; min-width: 0; }
.ip-panel .hint { margin-top: 8px; }
table.kv th { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--muted); background: transparent; width: 34%; white-space: nowrap; vertical-align: top; }
table.kv td { white-space: normal; overflow-wrap: anywhere; }
table.kv:empty, tbody:empty { display: none; }
.table-scroll:has(tbody:empty):not(:has(tbody:not(:empty))) { display: none; }
.wrap-cell { white-space: normal !important; overflow-wrap: anywhere; min-width: 220px; }

/* Glossary */
.gl-controls { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.gl-controls .field { max-width: 420px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: 14px; cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 5px 12px; border-radius: 99px; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.term { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; min-width: 0; scroll-margin-top: 16px; }
.term:target { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.term-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.term h2 { font-size: 19px; font-weight: 700; }
.term .full { display: block; font-family: var(--body); font-size: 14px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.term p { margin: 10px 0 0; font-size: 15px; }
.term .practice { color: var(--muted); }
.term .practice strong { color: var(--ink); font-weight: 600; }
@media (max-width: 400px) { .terms { grid-template-columns: 1fr; } }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
#tools { scroll-margin-top: 16px; }

/* IP calculator */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.tab { font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; border: 0; background: transparent; color: var(--muted); padding: 6px 16px; border-radius: 6px; }
.tab[aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bits { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; overflow-x: auto; }
.bitrow { display: grid; grid-template-columns: 110px auto; gap: 12px; align-items: baseline; }
.bitlabel { font-size: 13px; color: var(--muted); }
.bitval { font-size: 14px; letter-spacing: 0.04em; white-space: nowrap; }
.nb { color: var(--accent); font-weight: 600; }
.hb { color: var(--muted); }
.dot { color: var(--muted); padding: 0 2px; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; margin: 0 4px 0 8px; }
.key:first-child { margin-left: 0; }
.nb-key { background: var(--accent); }
.hb-key { background: var(--line); }
.split-field { max-width: 360px; }
.wrap-any { overflow-wrap: anywhere; }
.panel h3 { font-size: 16px; }
@media (max-width: 520px) { .bitrow { grid-template-columns: 1fr; gap: 2px; } }

/* Email sign-up */
.signup-form { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; max-width: 560px; }
.signup-row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.signup-row .grow { flex: 1 1 220px; min-width: 0; }
.signup-row input { background: var(--panel); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.consent input { width: 18px; height: 18px; flex: none; margin: 2px 0 0; accent-color: var(--accent); }
.consent label { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 400; color: var(--muted); margin: 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.signup-status:empty { display: none; }
.signup-done { margin-top: 18px; background: var(--accent-soft); border-radius: 8px; padding: 14px 16px; max-width: 560px; }
.signup-done p { margin: 0; }
.signup-done-title { font-weight: 700; margin-bottom: 4px !important; }
.cheat-band { grid-template-columns: 1fr 1fr; align-items: start; }
.cheat-band .eyebrow { margin-bottom: 6px; }
.cheat-form .signup-form { margin-top: 0; }
@media (max-width: 860px) { .cheat-band { grid-template-columns: 1fr; } }
.checks { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-direction: column; gap: 8px; }
.checks li { position: relative; padding-left: 26px; }
.checks li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 12px; height: 7px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.cheat-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cheat-preview img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: 0 1px 2px rgba(20, 33, 43, 0.08); }
