/* =========================================================================
   Netvorx Tools - design system
   Dark technical UI. No frameworks, no web fonts, no runtime CSS.
   ========================================================================= */

:root {
  color-scheme: dark;

  /* surfaces */
  --bg: #080c12;
  --bg-soft: #0b111a;
  --surface: #0f1721;
  --surface-2: #141e2b;
  --surface-3: #1a2635;
  --border: #1d2937;
  --border-strong: #2a3a4d;

  /* text */
  --text: #e8eff7;
  --text-2: #b3c2d3;
  --muted: #7e90a6;
  --faint: #8494a8; /* 6.3:1 on --bg, 5.8:1 on --surface - WCAG AA for body text */

  /* brand */
  --accent: #23cf88;
  --accent-hi: #45e5a3;
  --accent-dim: rgba(35, 207, 136, 0.12);
  --accent-line: rgba(35, 207, 136, 0.32);
  --info: #4fa9f5;
  --warn: #f2b036;
  --danger: #f4626c;

  /* type */
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  /* metrics */
  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 14px;
  --wrap: 1220px;
  --gap: 20px;
  --header-h: 62px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 28px rgba(0, 0, 0, 0.28);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.22; font-weight: 650; letter-spacing: -0.015em; }
h1 { font-size: clamp(1.85rem, 1.3rem + 2vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); }
h3 { font-size: 1.09rem; }
h4 { font-size: 0.98rem; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); text-decoration: underline; text-underline-offset: 3px; }

code, kbd, pre, samp, .mono { font-family: var(--mono); font-size: 0.925em; }
:not(pre) > code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.1em 0.38em;
  color: var(--text-2);
  white-space: nowrap;
}

hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

img, svg { max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

::selection { background: var(--accent-dim); color: var(--accent-hi); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #04120b; padding: 10px 16px; border-radius: 0 0 8px 0; font-weight: 600;
}
.skip-link:focus { left: 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------- header */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8, 12, 18, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex; align-items: center; gap: 18px;
  height: var(--header-h);
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-weight: 680; letter-spacing: -0.02em; font-size: 1.02rem; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand__mark {
  width: 26px; height: 26px; border-radius: 7px; flex: 0 0 auto;
  background: linear-gradient(145deg, var(--accent) 0%, #0f9c66 100%);
  display: grid; place-items: center; color: #04120b;
}
.brand__name span { color: var(--accent); }
.brand__sub { color: var(--faint); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; display: block; line-height: 1; margin-top: 2px; }

.main-nav { display: flex; align-items: center; gap: 4px; margin-left: 6px; }
.main-nav a {
  color: var(--text-2); font-size: 0.9rem; font-weight: 500;
  padding: 7px 11px; border-radius: var(--radius-sm);
}
.main-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.main-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-dim); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.header-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 9px; min-width: 216px;
  color: var(--muted); font-size: 0.86rem; cursor: pointer;
}
.header-search:hover { border-color: var(--border-strong); color: var(--text-2); text-decoration: none; }
.header-search kbd {
  margin-left: auto; background: var(--surface-3); border: 1px solid var(--border-strong);
  border-radius: 4px; padding: 1px 5px; font-size: 0.72rem; color: var(--muted);
}

.nav-toggle {
  display: none; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm); padding: 7px 9px; cursor: pointer;
}

@media (max-width: 980px) {
  .main-nav { display: none; }
  .header-search { min-width: 0; }
  .header-search span, .header-search kbd { display: none; }
  .nav-toggle { display: inline-flex; }
  .site-header.is-open .main-nav {
    display: flex; position: absolute; left: 0; right: 0; top: var(--header-h);
    flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 20px 16px;
    background: var(--bg-soft); border-bottom: 1px solid var(--border);
  }
}

/* -------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 0.92rem; font-weight: 600; line-height: 1;
  padding: 11px 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--accent); color: #04120b; }
.btn--primary:hover { background: var(--accent-hi); color: #04120b; }
.btn--ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--accent-line); color: var(--text); }
.btn--sm { padding: 7px 12px; font-size: 0.84rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.copy-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  border-radius: 6px; padding: 3px 7px; font: inherit; font-size: 0.74rem; cursor: pointer;
  transition: color 0.14s ease, border-color 0.14s ease;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent-line); }
.copy-btn.is-done { color: var(--accent); border-color: var(--accent-line); }

/* ---------------------------------------------------------------- hero */

.hero { padding: 68px 0 46px; border-bottom: 1px solid var(--border); background:
  radial-gradient(900px 380px at 12% -10%, rgba(35, 207, 136, 0.09), transparent 65%),
  radial-gradient(700px 320px at 85% 0%, rgba(79, 169, 245, 0.06), transparent 60%); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 44px; align-items: center; }
.hero h1 { margin-bottom: 16px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero__lead { color: var(--text-2); font-size: 1.05rem; max-width: 56ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 26px; color: var(--muted); font-size: 0.84rem; }
.hero__meta strong { color: var(--text); font-weight: 620; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px;
  color: var(--accent); background: var(--accent-dim); border: 1px solid var(--accent-line);
  border-radius: 999px; padding: 4px 11px; font-size: 0.76rem; font-weight: 600; letter-spacing: 0.03em;
}
@media (max-width: 900px) {
  .hero { padding: 44px 0 34px; }
  .hero__grid { grid-template-columns: 1fr; gap: 28px; }
}

/* --------------------------------------------------------------- panels */

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.panel__head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-bottom: 1px solid var(--border);
  color: var(--muted); font-size: 0.78rem; letter-spacing: 0.09em; text-transform: uppercase;
}
.panel__body { padding: 18px; }
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); display: block; }
.dots i:first-child { background: #35404e; }

.section { padding: 62px 0; }
.section--alt { background: var(--bg-soft); border-block: 1px solid var(--border); }
.section__head { max-width: 62ch; margin-bottom: 30px; }
.section__head--center { margin-inline: auto; text-align: center; }
.section__head p { color: var(--muted); margin: 0; }
.section__label { color: var(--accent); font-size: 0.76rem; font-weight: 650; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 10px; }

/* ---------------------------------------------------------------- cards */

.card-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); }
.card-grid--wide { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

.tool-card {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 16px; color: var(--text);
  transition: border-color 0.14s ease, background-color 0.14s ease, transform 0.14s ease;
}
.tool-card:hover { border-color: var(--accent-line); background: var(--surface-2); text-decoration: none; color: var(--text); transform: translateY(-1px); }
.tool-card__top { display: flex; align-items: center; gap: 9px; }
.tool-card__icon {
  width: 28px; height: 28px; border-radius: 7px; flex: 0 0 auto;
  background: var(--surface-3); color: var(--accent); display: grid; place-items: center;
}
.tool-card__name { font-weight: 620; font-size: 0.96rem; letter-spacing: -0.01em; }
.tool-card__desc { color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.tool-card__foot { margin-top: auto; padding-top: 8px; display: flex; align-items: center; gap: 8px; }

.badge {
  display: inline-block; border-radius: 999px; padding: 2px 8px;
  font-size: 0.68rem; font-weight: 640; letter-spacing: 0.05em; text-transform: uppercase;
  border: 1px solid var(--border-strong); color: var(--muted); background: var(--surface-2);
}
.badge--accent { color: var(--accent); border-color: var(--accent-line); background: var(--accent-dim); }
.badge--info { color: var(--info); border-color: rgba(79, 169, 245, 0.3); background: rgba(79, 169, 245, 0.1); }
.badge--warn { color: var(--warn); border-color: rgba(242, 176, 54, 0.3); background: rgba(242, 176, 54, 0.1); }

.cat-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; color: var(--text);
  transition: border-color 0.14s ease, background-color 0.14s ease;
}
.cat-card:hover { border-color: var(--accent-line); background: var(--surface-2); text-decoration: none; color: var(--text); }
.cat-card__head { display: flex; align-items: center; gap: 10px; }
.cat-card__icon { width: 32px; height: 32px; border-radius: 8px; background: var(--accent-dim); color: var(--accent); display: grid; place-items: center; flex: 0 0 auto; }
.cat-card h3 { margin: 0; font-size: 1rem; }
.cat-card p { color: var(--muted); font-size: 0.86rem; margin: 0; }
.cat-card__count { color: var(--faint); font-size: 0.78rem; margin-top: auto; padding-top: 6px; }

.feature-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.split-panel {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 30px; align-items: center; padding: 30px;
}
@media (max-width: 800px) { .split-panel { grid-template-columns: 1fr; gap: 22px; padding: 22px; } }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
}
.feature h3 { display: flex; align-items: center; gap: 9px; font-size: 0.98rem; margin-bottom: 6px; }
.feature h3 svg { color: var(--accent); }
.feature p { color: var(--muted); font-size: 0.88rem; margin: 0; }

/* -------------------------------------------------------- tool directory */

.directory { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 34px; align-items: start; }
.dir-side { position: sticky; top: calc(var(--header-h) + 18px); }
.dir-side h2 { font-size: 0.76rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.dir-side ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.dir-side a {
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
  color: var(--text-2); font-size: 0.87rem; padding: 6px 9px; border-radius: 6px;
}
.dir-side a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.dir-side a[aria-current] { background: var(--accent-dim); color: var(--accent); }
.dir-side a span { color: var(--faint); font-size: 0.76rem; }
@media (max-width: 900px) { .directory { grid-template-columns: 1fr; } .dir-side { position: static; } }

.dir-group { margin-bottom: 34px; scroll-margin-top: calc(var(--header-h) + 16px); }
.dir-group__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.dir-group__head h2 { margin: 0; font-size: 1.08rem; }
.dir-group__head span { color: var(--faint); font-size: 0.8rem; }
.dir-group__head a { margin-left: auto; font-size: 0.82rem; }

.searchbar { position: relative; display: flex; align-items: center; }
.searchbar svg { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.searchbar input {
  width: 100%; font: inherit; font-size: 0.95rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 12px 14px 12px 40px;
}
.searchbar input::placeholder { color: var(--faint); }
.searchbar input:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-dim); }

.filter-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.chip {
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
  border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 0.82rem; cursor: pointer;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); text-decoration: none; }
.chip[aria-pressed="true"], .chip.is-active { background: var(--accent-dim); border-color: var(--accent-line); color: var(--accent); }

.empty-state { text-align: center; padding: 54px 20px; color: var(--muted); }
.empty-state h3 { color: var(--text); }

/* ------------------------------------------------------------- tool page */

.breadcrumb { font-size: 0.82rem; color: var(--muted); padding: 18px 0 0; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 0; padding: 0; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb li:not(:last-child)::after { content: "/"; margin-left: 7px; color: var(--faint); }
.breadcrumb [aria-current] { color: var(--text-2); }

.tool-head { padding: 14px 0 26px; }
.tool-head h1 { margin-bottom: 10px; }
.tool-head__lead { color: var(--text-2); max-width: 74ch; font-size: 1.02rem; margin: 0; }
.tool-head__tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }

.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) 288px; gap: 30px; align-items: start; padding-bottom: 64px; }
@media (max-width: 1040px) { .tool-layout { grid-template-columns: 1fr; } }
.tool-aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--header-h) + 18px); }
@media (max-width: 1040px) { .tool-aside { position: static; } }

.aside-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.aside-card h2 { font-size: 0.76rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.aside-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.aside-card li a { display: block; color: var(--text-2); font-size: 0.88rem; padding: 6px 8px; border-radius: 6px; }
.aside-card li a:hover { background: var(--surface-2); color: var(--accent); text-decoration: none; }
.aside-card p { color: var(--muted); font-size: 0.86rem; }

/* ----------------------------------------------------------------- forms */

.tool-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; }
.field-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; grid-column: span 6; min-width: 0; }
.field--half { grid-column: span 3; }
.field--third { grid-column: span 2; }
.field--twothirds { grid-column: span 4; }
@media (max-width: 720px) { .field--half, .field--third, .field--twothirds { grid-column: span 6; } }

.field label { font-size: 0.83rem; font-weight: 600; color: var(--text-2); }
.field__help { font-size: 0.79rem; color: var(--faint); }
.field input[type="text"], .field input[type="number"], .field select, .field textarea {
  width: 100%; font: inherit; font-size: 0.94rem; color: var(--text);
  background: var(--bg-soft); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.field input.mono, .field textarea.mono { font-family: var(--mono); font-size: 0.9rem; }
.field textarea { min-height: 118px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-dim);
}
/* Keyboard focus keeps a real outline; the box-shadow alone is too subtle. */
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible,
.searchbar input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5 6 8.5l4-4' fill='none' stroke='%237e90a6' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 12px; padding-right: 32px;
}
.field--checkbox { flex-direction: row; align-items: center; gap: 9px; }
.field--checkbox input { width: 16px; height: 16px; accent-color: var(--accent); }
.field--checkbox label { font-weight: 500; color: var(--text-2); }

.presets { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.presets__label { color: var(--faint); font-size: 0.78rem; align-self: center; margin-right: 2px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.form-actions .spacer { flex: 1 1 auto; }

/* --------------------------------------------------------------- results */

.results { margin-top: 20px; display: flex; flex-direction: column; gap: 18px; }
.results__head { display: flex; align-items: center; gap: 10px; }
.results__head h2 { margin: 0; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.results__head .live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.block { min-width: 0; }
.block__title { font-size: 0.86rem; color: var(--text-2); margin-bottom: 10px; font-weight: 620; }
.block__note { color: var(--faint); font-size: 0.82rem; margin: 8px 0 0; }

.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.stat--wide { grid-column: 1 / -1; }
.stat__label { font-size: 0.72rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.stat__row { display: flex; align-items: center; gap: 8px; }
.stat__value { font-family: var(--mono); font-size: 1.02rem; color: var(--text); word-break: break-all; line-height: 1.4; }
.stat__sub { color: var(--faint); font-size: 0.79rem; margin-top: 4px; }
.stat--accent .stat__value { color: var(--accent); }
.stat--warn .stat__value { color: var(--warn); }
.stat--danger .stat__value { color: var(--danger); }
.stat--info .stat__value { color: var(--info); }
.stat .copy-btn { margin-left: auto; opacity: 0; }
.stat:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
@media (hover: none) {
  .stat .copy-btn { opacity: 1; }
  /* WCAG 2.2 target size: give every control a comfortable touch area */
  .copy-btn { min-height: 32px; min-width: 32px; padding: 6px 10px; }
  .chip { min-height: 32px; padding: 7px 14px; }
  .main-nav a, .footer-col a, .aside-card li a, .dir-side a { min-height: 32px; display: flex; align-items: center; }
}

.codeblock { margin: 0; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.codeblock__bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  font-size: 0.76rem; color: var(--muted);
}
.codeblock__name { font-family: var(--mono); letter-spacing: 0.02em; }
.codeblock__bar .copy-btn { margin-left: auto; }
.codeblock__pre { margin: 0; padding: 14px; overflow-x: auto; font-size: 0.86rem; line-height: 1.62; }
.codeblock__pre code { color: var(--text-2); white-space: pre; }
.c-com { color: var(--faint); font-style: italic; }
.c-str { color: #8fd694; }
.c-ip { color: var(--accent); }
.c-num { color: #d7a8f0; }
.c-key { color: #6fb8f0; }
.c-kw { color: #f0b36a; font-weight: 600; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th {
  text-align: left; background: var(--surface-2); color: var(--muted);
  font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 620;
  padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: top; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: var(--surface); }
.data-table td.mono { font-family: var(--mono); font-size: 0.84rem; color: var(--text); white-space: nowrap; }

.callout { border: 1px solid var(--border); border-left-width: 3px; border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface); font-size: 0.9rem; }
.callout__title { display: block; margin-bottom: 3px; font-size: 0.86rem; }
.callout__body { color: var(--text-2); }
.callout--info { border-left-color: var(--info); }
.callout--info .callout__title { color: var(--info); }
.callout--warn { border-left-color: var(--warn); }
.callout--warn .callout__title { color: var(--warn); }
.callout--danger { border-left-color: var(--danger); }
.callout--danger .callout__title { color: var(--danger); }
.callout--ok { border-left-color: var(--accent); }
.callout--ok .callout__title { color: var(--accent); }

.kv { display: grid; gap: 0; margin: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.kv__row { display: grid; grid-template-columns: minmax(140px, 34%) 1fr; gap: 12px; padding: 8px 13px; border-bottom: 1px solid var(--border); }
.kv__row:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); font-size: 0.84rem; }
.kv dd { margin: 0; color: var(--text); font-size: 0.88rem; word-break: break-all; }
@media (max-width: 560px) { .kv__row { grid-template-columns: 1fr; gap: 2px; } }

.block-list { margin: 0; padding-left: 20px; color: var(--text-2); font-size: 0.9rem; }
.block-list li { margin-bottom: 4px; }

.meters { display: flex; flex-direction: column; gap: 12px; }
.meter__head { display: flex; justify-content: space-between; font-size: 0.84rem; color: var(--text-2); margin-bottom: 5px; }
.meter__track { height: 7px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.meter__fill { height: 100%; background: var(--accent); border-radius: 4px; }
.meter__fill--warn { background: var(--warn); }
.meter__fill--danger { background: var(--danger); }
.meter__fill--info { background: var(--info); }

/* ---------------------------------------------------------- tool content */

.tool-content { margin-top: 40px; display: flex; flex-direction: column; gap: 30px; }
.prose { max-width: 74ch; color: var(--text-2); }
.prose h2 { color: var(--text); margin-top: 0; }
.prose h3 { color: var(--text); margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 21px; margin: 0 0 1em; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--text); font-weight: 620; }
.prose table { width: 100%; border-collapse: collapse; margin-bottom: 1em; }

.faq { display: flex; flex-direction: column; gap: 8px; }
.faq details {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 15px;
}
.faq summary {
  cursor: pointer; padding: 13px 0; font-weight: 600; color: var(--text); font-size: 0.94rem;
  list-style: none; display: flex; align-items: center; gap: 10px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: ""; width: 8px; height: 8px; flex: 0 0 auto;
  border-right: 1.6px solid var(--accent); border-bottom: 1.6px solid var(--accent);
  transform: rotate(-45deg); transition: transform 0.16s ease; margin-left: 2px;
}
.faq details[open] summary::before { transform: rotate(45deg); }
.faq .faq__body { padding: 0 0 14px 18px; color: var(--text-2); font-size: 0.92rem; }

/* --------------------------------------------------------------- footer */

.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); padding: 48px 0 26px; margin-top: auto; }
.footer-top { display: grid; grid-template-columns: minmax(0, 250px) minmax(0, 1fr); gap: 40px; }
@media (max-width: 860px) { .footer-top { grid-template-columns: 1fr; gap: 26px; } }
.footer-brand p { color: var(--muted); font-size: 0.86rem; margin-top: 12px; max-width: 34ch; }
.footer-cols { display: grid; gap: 26px 22px; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); }
.footer-col h3 { font-size: 0.72rem; letter-spacing: 0.11em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.footer-col a { color: var(--text-2); font-size: 0.85rem; }
.footer-col a:hover { color: var(--accent); text-decoration: none; }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  margin-top: 38px; padding-top: 18px; border-top: 1px solid var(--border);
  color: var(--faint); font-size: 0.82rem;
}
.footer-bottom nav { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-bottom a { color: var(--faint); }

/* ------------------------------------------------------------ utilities */

.page { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1 0 auto; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.nowrap { white-space: nowrap; }
.js-hidden { display: none; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text);
  padding: 9px 16px; border-radius: 999px; font-size: 0.86rem; z-index: 90;
  opacity: 0; pointer-events: none; transition: opacity 0.18s ease;
}
.toast.is-visible { opacity: 1; }

.spinner {
  width: 15px; height: 15px; border: 2px solid var(--border-strong); border-top-color: var(--accent);
  border-radius: 50%; display: inline-block; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media print {
  .site-header, .site-footer, .tool-aside, .form-actions, .copy-btn { display: none !important; }
  body { background: #fff; color: #000; }
}
