/* ==========================================================================
   IT Tools — design system
   Neutral surfaces, one teal accent, hairline borders. Light + dark.
   ========================================================================== */

:root {
  --font: "Google Sans", "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Google Sans Code", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --bg: #F6F6F3;
  --surface: #FFFFFF;
  --surface-2: #F1F1EE;
  --surface-3: #E9E9E5;
  --border: #E3E3DE;
  --border-strong: #D2D2CC;
  --text: #16171A;
  --text-2: #565A61;
  --text-3: #8B9098;
  --accent: #0E8A7C;
  --accent-hover: #0B7468;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(14, 138, 124, .10);
  --ring: rgba(14, 138, 124, .28);

  --ok: #1F9D55;    --ok-soft: rgba(31, 157, 85, .12);
  --warn: #C27C0E;  --warn-soft: rgba(194, 124, 14, .13);
  --bad: #D2433A;   --bad-soft: rgba(210, 67, 58, .11);
  --info: #2F6FD6;  --info-soft: rgba(47, 111, 214, .11);

  --cat-networking: #0E8A7C;
  --cat-dcplanner: #C27C0E;
  --cat-converters: #2F6FD6;
  --cat-utilities: #C2416B;

  --shadow-sm: 0 1px 2px rgba(20, 20, 18, .05);
  --shadow: 0 1px 2px rgba(20, 20, 18, .04), 0 8px 24px -12px rgba(20, 20, 18, .12);
  --shadow-lg: 0 24px 64px -16px rgba(20, 20, 18, .28);

  --r-sm: 8px;
  --r: 10px;
  --r-lg: 16px;
  --r-xl: 20px;

  --header-h: 60px;
  --rail-w: 232px;
  --content-w: 1120px;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0D0E10;
  --surface: #15171A;
  --surface-2: #1B1E22;
  --surface-3: #23272C;
  --border: #262A2F;
  --border-strong: #353A41;
  --text: #ECEDEF;
  --text-2: #A3A8B0;
  --text-3: #6E747D;
  --accent: #33CDB8;
  --accent-hover: #5ADBC9;
  --accent-ink: #062A25;
  --accent-soft: rgba(51, 205, 184, .12);
  --ring: rgba(51, 205, 184, .30);

  --ok: #3FCB7E;    --ok-soft: rgba(63, 203, 126, .13);
  --warn: #F0B24A;  --warn-soft: rgba(240, 178, 74, .13);
  --bad: #FF6B61;   --bad-soft: rgba(255, 107, 97, .13);
  --info: #6EA4FF;  --info-soft: rgba(110, 164, 255, .13);

  --cat-networking: #33CDB8;
  --cat-dcplanner: #F0B24A;
  --cat-converters: #6EA4FF;
  --cat-utilities: #F27AA0;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 64px -16px rgba(0, 0, 0, .7);

  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 0;
}
img, svg, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -.015em; line-height: 1.2; }
p { margin: 0; }
code, kbd, .mono { font-family: var(--mono); font-size: .92em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  font-size: 11px; color: var(--text-3);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px;
}

/* ---------- Header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.hdr__in { height: 100%; display: flex; align-items: center; gap: 16px; padding: 0 20px; max-width: 1440px; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 500; font-size: 16px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--text); color: var(--bg);
}
.brand__mark svg { width: 17px; height: 17px; }
.brand small { color: var(--text-3); font-weight: 400; font-size: 13px; margin-left: 2px; }

.hdr__search {
  flex: 1; max-width: 440px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 8px 0 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  color: var(--text-3); font-size: 14px; cursor: pointer; text-align: left;
  transition: border-color .15s, box-shadow .15s;
}
.hdr__search:hover { border-color: var(--border-strong); }
.hdr__search svg { width: 16px; height: 16px; flex: none; }
.hdr__search span { flex: 1; }
.hdr__actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center;
  border: 1px solid transparent; border-radius: var(--r); background: transparent;
  color: var(--text-2); cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn--sm { width: 28px; height: 28px; border-radius: 7px; }
.icon-btn--sm svg { width: 14px; height: 14px; }
.hdr__menu { display: none; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); max-width: 1440px; margin: 0 auto; }
.layout--home { display: block; }

.rail {
  position: sticky; top: var(--header-h); align-self: start;
  height: calc(100vh - var(--header-h)); overflow-y: auto;
  padding: 24px 12px 40px 20px;
  border-right: 1px solid var(--border);
  scrollbar-width: thin;
}
.rail__group + .rail__group { margin-top: 22px; }
.rail__label { display: flex; align-items: center; gap: 8px; padding: 0 10px 6px; font-size: 12px; font-weight: 500; color: var(--text-3); letter-spacing: .02em; }
.rail__dot { width: 6px; height: 6px; border-radius: 50%; }
.rail a {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border-radius: var(--r-sm);
  color: var(--text-2); font-size: 14px;
  transition: background .12s, color .12s;
}
.rail a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.rail a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--border); font-weight: 500; }
.rail a svg { width: 16px; height: 16px; flex: none; opacity: .8; }

.main { min-width: 0; padding: 32px 32px 80px; }
.page { max-width: var(--content-w); margin: 0 auto; }

/* ---------- Tool head ---------- */
.tool-head { margin-bottom: 24px; }
.crumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); margin-bottom: 10px; }
.crumb a { color: var(--text-3); }
.crumb a:hover { color: var(--text); }
.tool-head h1 { font-size: clamp(26px, 3vw, 32px); }
.tool-head p { margin-top: 8px; color: var(--text-2); max-width: 64ch; }
.tool-head__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border);
}
.pill svg { width: 12px; height: 12px; }
.pill--accent { color: var(--accent); background: var(--accent-soft); border-color: transparent; }

/* ---------- Workbench (inputs | results) ---------- */
.wb { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 20px; align-items: start; }
.wb > .card:first-child { position: sticky; top: calc(var(--header-h) + 20px); }
.wb--wide { grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); }
.wb--even { grid-template-columns: 1fr 1fr; }
.stack { display: grid; gap: 20px; }
.stack--sm { display: grid; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row > * { flex: 1 1 140px; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.card__title { font-size: 14px; font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 8px; }
.card__title small { color: var(--text-3); font-weight: 400; font-size: 13px; }
.card__body { padding: 16px 20px 20px; }
.card__body--flush { padding: 12px 0 0; }
.card__foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card--hero { background: linear-gradient(180deg, var(--accent-soft), transparent 70%), var(--surface); overflow: hidden; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field + .field { margin-top: 14px; }
.label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.label small { font-weight: 400; color: var(--text-3); }
.hint { font-size: 12px; color: var(--text-3); }
.err { font-size: 12px; color: var(--bad); min-height: 0; }
.err:empty { display: none; }

.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r);
  font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 120px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.input.mono { font-size: 14px; letter-spacing: .01em; }
.input--lg { height: 48px; font-size: 17px; }
.field.is-invalid .input, .field.is-invalid .select, .input.is-invalid { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238B9098' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.select option { background: var(--surface); color: var(--text); }

/* input with unit suffix */
.affix { display: flex; align-items: stretch; }
.affix .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.affix > .addon, .affix > .select {
  flex: none; width: auto; display: flex; align-items: center; padding: 0 12px;
  font-size: 13px; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border-strong); border-left: 0;
  border-radius: 0 var(--r) var(--r) 0;
}
.affix > .select { padding-right: 30px; background-position: right 8px center; background-color: var(--surface-2); }

input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* checkbox / switch */
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }

/* range */
.range { width: 100%; accent-color: var(--accent); height: 20px; }

/* segmented control — <div class="seg"><button aria-pressed="true">…</button></div> */
.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r);
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.seg--block { display: flex; width: 100%; }
.seg--block > button { flex: 1; }
.seg > button {
  height: 32px; padding: 0 12px; border: 0; border-radius: 7px;
  background: transparent; color: var(--text-2); font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: background .12s, color .12s;
}
.seg > button:hover { color: var(--text); }
.seg > button[aria-pressed="true"], .seg > button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }

/* tabs (underline) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs > button {
  position: relative; height: 40px; padding: 0 14px; border: 0; background: none;
  color: var(--text-2); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.tabs > button:hover { color: var(--text); }
.tabs > button[aria-selected="true"] { color: var(--text); }
.tabs > button[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--danger { color: var(--bad); }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn--block { width: 100%; }

/* quick-pick chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips__label { font-size: 12px; color: var(--text-3); margin-right: 2px; }
.chip {
  height: 28px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font-size: 12.5px; cursor: pointer; transition: border-color .12s, color .12s, background .12s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.mono { font-family: var(--mono); font-size: 12px; }

/* ---------- Results ---------- */
/* Hero result: the one number that matters */
.hero-result { padding: 22px 22px 20px; }
.hero-result__label { font-size: 13px; color: var(--text-2); }
.hero-result__value { margin-top: 4px; font-size: clamp(30px, 4.4vw, 44px); font-weight: 500; letter-spacing: -.025em; line-height: 1.1; font-variant-numeric: tabular-nums; word-break: break-word; }
.hero-result__value small { font-size: .45em; color: var(--text-2); font-weight: 400; letter-spacing: 0; margin-left: 4px; }
.hero-result__sub { margin-top: 6px; font-size: 13px; color: var(--text-2); }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); background: var(--surface); border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); }
/* hairline dividers via shadows so empty trailing cells stay surface-coloured */
.stat { position: relative; background: var(--surface); padding: 14px 16px; min-width: 0; box-shadow: 1px 0 0 var(--border), 0 1px 0 var(--border); }
.stat__label { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.stat__value { margin-top: 4px; font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -.01em; word-break: break-all; }
.stat__value.mono { font-size: 15px; letter-spacing: 0; }
.stat__sub { margin-top: 2px; font-size: 12px; color: var(--text-3); }
.stat .copy { position: absolute; top: 8px; right: 8px; opacity: 0; }
.stat:hover .copy, .stat:focus-within .copy { opacity: 1; }
@media (hover: none) { .stat .copy { opacity: .7; } }

/* key/value list */
.kv { display: grid; }
.kv__row { display: grid; grid-template-columns: minmax(110px, 34%) 1fr auto; align-items: center; gap: 12px; padding: 10px 20px; border-top: 1px solid var(--border); min-height: 44px; }
.kv__row:first-child { border-top: 0; }
.kv__k { font-size: 13px; color: var(--text-2); }
.kv__v { font-size: 14px; min-width: 0; word-break: break-word; font-variant-numeric: tabular-nums; }
.kv__v.mono { font-size: 13.5px; }
.kv__row .copy { opacity: 0; }
.kv__row:hover .copy, .kv__row:focus-within .copy { opacity: 1; }
@media (hover: none) { .kv__row .copy { opacity: .7; } }
.kv__sep { padding: 10px 20px 6px; font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); border-top: 1px solid var(--border); background: var(--surface-2); }

/* table */
.table-wrap { overflow-x: auto; border-radius: inherit; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); position: sticky; top: 0; }
.table td { padding: 9px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tr.is-active td { background: var(--accent-soft); }
.table td.mono, .table th.mono { font-family: var(--mono); font-size: 12.5px; }
.table .r { text-align: right; }
.table-scroll { max-height: 520px; overflow: auto; }

/* badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--surface-2); color: var(--text-2);
}
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--bad { background: var(--bad-soft); color: var(--bad); }
.badge--info { background: var(--info-soft); color: var(--info); }
.badge--accent { background: var(--accent-soft); color: var(--accent); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* meter */
.meter { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .35s cubic-bezier(.2,.8,.2,1), background .2s; }
.meter--ok > span { background: var(--ok); }
.meter--warn > span { background: var(--warn); }
.meter--bad > span { background: var(--bad); }
.meter--lg { height: 12px; }

/* callout */
.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r); font-size: 13.5px; background: var(--surface-2); color: var(--text-2); }
.callout svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.callout--info { background: var(--info-soft); color: var(--text); }
.callout--info svg { color: var(--info); }
.callout--warn { background: var(--warn-soft); color: var(--text); }
.callout--warn svg { color: var(--warn); }
.callout--bad { background: var(--bad-soft); color: var(--text); }
.callout--bad svg { color: var(--bad); }
.callout--ok { background: var(--ok-soft); color: var(--text); }
.callout--ok svg { color: var(--ok); }

/* empty state */
.empty { display: grid; place-items: center; text-align: center; gap: 8px; padding: 48px 24px; color: var(--text-3); }
.empty svg { width: 36px; height: 36px; stroke-width: 1.5; }
.empty strong { font-weight: 500; color: var(--text-2); font-size: 15px; }
.empty p { font-size: 13px; max-width: 36ch; }

/* explainer (formula / reference) — native <details class="explain"> */
.explain { margin-top: 20px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.explain > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; font-size: 14px; font-weight: 500; color: var(--text-2);
}
.explain > summary::-webkit-details-marker { display: none; }
.explain > summary svg { width: 16px; height: 16px; }
.explain > summary::after {
  content: ""; margin-left: auto; width: 16px; height: 16px; transition: transform .2s;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.explain[open] > summary::after { transform: rotate(180deg); }
.explain > summary:hover { color: var(--text); }
.explain__body { padding: 0 20px 20px; font-size: 14px; color: var(--text-2); display: grid; gap: 12px; }
.code {
  margin: 0; padding: 14px 16px; overflow-x: auto;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r);
  white-space: pre;
}

/* dropzone */
.drop {
  display: grid; place-items: center; gap: 10px; text-align: center;
  padding: 32px 20px; border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg);
  background: var(--surface-2); color: var(--text-2); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.drop svg { width: 28px; height: 28px; color: var(--text-3); }
.drop strong { font-weight: 500; color: var(--text); }
.drop small { font-size: 12px; color: var(--text-3); }

/* swatch */
.swatch { width: 40px; height: 40px; border-radius: var(--r); border: 1px solid var(--border-strong); flex: none; overflow: hidden; padding: 0; cursor: pointer; background: none; }
.swatch::-webkit-color-swatch-wrapper { padding: 0; }
.swatch::-webkit-color-swatch { border: 0; border-radius: 0; }
.swatch::-moz-color-swatch { border: 0; }

/* copy button inside results */
.copy { color: var(--text-3); }
.copy:hover { color: var(--text); }
.copy.is-done { color: var(--ok); }

/* binary bits (subnet tools) */
.bits { font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em; white-space: nowrap; }
.bits .n { color: var(--accent); }
.bits .h { color: var(--text-3); }
.bits .d { color: var(--text-3); opacity: .6; margin: 0 1px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px;
  background: var(--text); color: var(--bg); font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  transition: opacity .2s, transform .2s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 16px; height: 16px; }

/* spinner / progress */
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Command palette ---------- */
.cmdk { position: fixed; inset: 0; z-index: 90; display: none; }
.cmdk.is-open { display: block; }
.cmdk__scrim { position: absolute; inset: 0; background: rgba(10, 10, 12, .38); backdrop-filter: blur(2px); animation: fade .15s; }
.cmdk__panel {
  position: relative; width: min(620px, calc(100% - 24px)); margin: 12vh auto 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .16s cubic-bezier(.2,.8,.2,1);
}
.cmdk__in { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.cmdk__in svg { width: 18px; height: 18px; color: var(--text-3); flex: none; }
.cmdk__in input { flex: 1; height: 56px; border: 0; outline: 0; background: transparent; font-size: 16px; }
.cmdk__list { max-height: min(420px, 60vh); overflow-y: auto; padding: 8px; }
.cmdk__group { padding: 10px 10px 4px; font-size: 11.5px; font-weight: 500; color: var(--text-3); letter-spacing: .04em; text-transform: uppercase; }
.cmdk__item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r); color: var(--text); cursor: pointer; }
.cmdk__item:hover { text-decoration: none; }
.cmdk__item[aria-selected="true"] { background: var(--surface-2); }
.cmdk__icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--surface-2); border: 1px solid var(--border); }
.cmdk__icon svg { width: 16px; height: 16px; }
.cmdk__item[aria-selected="true"] .cmdk__icon { background: var(--surface); }
.cmdk__txt { min-width: 0; flex: 1; }
.cmdk__txt b { display: block; font-weight: 500; font-size: 14px; }
.cmdk__txt span { display: block; font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk__foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.cmdk__foot span { display: inline-flex; align-items: center; gap: 6px; }
.cmdk__none { padding: 36px 16px; text-align: center; color: var(--text-3); font-size: 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.985); } }

/* ---------- Home ---------- */
.home { max-width: 1200px; margin: 0 auto; padding: 56px 24px 96px; }
.home__hero { max-width: 720px; }
.home__eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.home__eyebrow .dot { color: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.home h1 { margin-top: 16px; font-size: clamp(34px, 5.4vw, 56px); letter-spacing: -.035em; line-height: 1.05; }
.home h1 span { color: var(--text-3); }
.home__lead { margin-top: 16px; font-size: 17px; color: var(--text-2); max-width: 56ch; }
.home__search {
  margin-top: 28px; display: flex; align-items: center; gap: 12px; width: 100%; max-width: 560px;
  height: 52px; padding: 0 10px 0 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  color: var(--text-3); font-size: 15px; cursor: text; text-align: left;
}
.home__search:hover { border-color: var(--text-3); }
.home__search svg { width: 18px; height: 18px; }
.home__search span { flex: 1; }
.home__stats { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 28px; font-size: 13px; color: var(--text-3); }
.home__stats b { display: block; font-size: 22px; font-weight: 500; color: var(--text); letter-spacing: -.02em; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 56px 0 20px; }
.filters button {
  height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); font-size: 13.5px; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.filters button:hover { color: var(--text); border-color: var(--border-strong); }
.filters button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.filters button em { font-style: normal; font-size: 12px; opacity: .6; }

.cat-block + .cat-block { margin-top: 40px; }
.cat-block__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.cat-block__head h2 { font-size: 18px; }
.cat-block__head p { font-size: 13.5px; color: var(--text-3); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  padding: 18px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.tile:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.tile__icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.tile__icon svg { width: 19px; height: 19px; }
.tile b { font-weight: 500; font-size: 15px; display: block; }
.tile p { margin-top: 3px; font-size: 13px; color: var(--text-2); line-height: 1.45; }
.tile__go { position: absolute; top: 18px; right: 18px; width: 16px; height: 16px; color: var(--text-3); opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .15s; }
.tile:hover .tile__go { opacity: 1; transform: none; }

/* related tools at page end */
.related { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }
.related h2 { font-size: 15px; margin-bottom: 12px; color: var(--text-2); }

/* footer */
.ftr { border-top: 1px solid var(--border); color: var(--text-3); font-size: 13px; }
.ftr__in { max-width: 1440px; margin: 0 auto; padding: 20px 24px; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .wb, .wb--wide { grid-template-columns: 1fr; }
  .wb > .card:first-child { position: static; }
}
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .rail {
    position: fixed; z-index: 70; top: 0; left: 0; bottom: 0; width: min(300px, 86vw); height: 100vh;
    background: var(--bg); border-right: 1px solid var(--border); box-shadow: var(--shadow-lg);
    transform: translateX(-102%); transition: transform .22s cubic-bezier(.2,.8,.2,1);
    padding-top: 20px;
  }
  .rail.is-open { transform: none; }
  .rail-scrim { position: fixed; inset: 0; z-index: 65; background: rgba(10,10,12,.35); }
  .hdr__menu { display: inline-grid; }
  .main { padding: 24px 16px 64px; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .hdr__in { padding: 0 12px; gap: 8px; }
  .brand small { display: none; }
  .hdr__search { height: 36px; }
  .hdr__search kbd { display: none; }
  .wb--even, .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .card__head { padding: 14px 16px 0; }
  .card__body { padding: 14px 16px 16px; }
  .kv__row { padding: 10px 16px; grid-template-columns: minmax(96px, 38%) 1fr auto; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home { padding: 36px 16px 72px; }
  .tiles { grid-template-columns: 1fr; }
  .explain > summary { padding: 14px 16px; }
  .explain__body { padding: 0 16px 16px; }
  .cmdk__panel { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.stats--flush { border-radius: 0; border: 0; border-top: 1px solid var(--border); }
@media (max-width: 640px) {
  .kv__row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .kv__k { grid-column: 1; grid-row: 1; font-size: 12px; }
  .kv__v { grid-column: 1; grid-row: 2; }
  .kv__row .copy { grid-column: 2; grid-row: 1 / span 2; }
  .bits { font-size: 11.5px; letter-spacing: .02em; }
}
