/* WireGauge — Spec sheet visual system. Tokens first; components below. */
:root {
  --bg: #f7f7f5; --panel: #ffffff; --ink: #1d2125; --muted: #5d6570; --line: #dfe2e5;
  --copper: #9c5326; --copper-soft: #f6e9df; --steel: #4a5a6a; --err: #b42318;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 6px;
  font-family: var(--sans);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181b; --panel: #1d2125; --ink: #e8eaec; --muted: #9aa3ad; --line: #2f353b;
    --copper: #e08a4f; --copper-soft: #3a2a1f; --steel: #9fb0c0; --err: #ff8a80;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.55; }
a { color: var(--copper); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 1.9rem; margin: 1.25rem 0 1rem; }
h2 { font-size: 1.3rem; margin: 2rem 0 .75rem; }

/* Header */
.site-header { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: baseline; justify-content: space-between;
  max-width: 76rem; margin: 0 auto; padding: 1rem; border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; font-size: 1.35rem; text-decoration: none; color: var(--ink); }
.brand::before { content: ""; display: inline-block; width: .8em; height: .8em; margin-right: .35em; border-radius: 50%;
  background: var(--copper); box-shadow: 0 0 0 .14em var(--bg), 0 0 0 .3em var(--steel); vertical-align: -.05em; }
.site-nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.site-nav a { text-decoration: none; color: var(--muted); font-weight: 600; }
.site-nav a:hover, .site-nav .nav-all { color: var(--copper); }

.container { max-width: 76rem; margin: 0 auto; padding: 0 1rem 2rem; }
.lede { color: var(--muted); font-size: 1.05rem; max-width: 44rem; }

/* Forms */
.calc { display: grid; gap: 1rem; padding: 1.25rem; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); max-width: 44rem; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
legend { font-weight: 600; margin-bottom: .25rem; }
.field { display: grid; gap: .25rem; }
.field label { font-weight: 600; }
.row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.hint { font-weight: 400; color: var(--muted); font-size: .9rem; }
input[type=text], select { font: inherit; padding: .55rem .65rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: inherit; width: 100%; font-variant-numeric: tabular-nums; }
input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--copper); outline-offset: 2px; }
.error { color: var(--err); margin: 0; min-height: 1.2em; font-size: .9rem; }

/* Result */
.result { display: block; font-variant-numeric: tabular-nums; }
.result:empty { display: none; }
.result .answer { font-size: 1.5rem; font-weight: 800; color: var(--copper); margin: 0 0 .25rem; }
.result p { margin: .25rem 0; }

/* Tables */
.table-wrap { overflow: auto; max-height: 85vh; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.spec { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .95rem; }
.spec caption { text-align: left; padding: .75rem .6rem .35rem; color: var(--muted); }
.spec th, .spec td { text-align: right; padding: .35rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.spec th:first-child, .spec td:first-child { text-align: left; }
.spec thead th { position: sticky; top: 0; background: var(--panel); color: var(--steel); font-weight: 700;
  border-bottom: 2px solid var(--steel); }
.spec tbody th { font-weight: 800; }
.spec tbody tr:hover { background: var(--copper-soft); }
.spec tr.is-target { background: var(--copper-soft); outline: 2px solid var(--copper); outline-offset: -2px; }
.chart { min-width: 52rem; }
.table-note { color: var(--muted); font-size: .9rem; max-width: 50rem; }

/* Chart controls */
.chart-tools { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: end; margin: 0 0 1rem; }
.chart-tools .field { min-width: 12rem; }
button { font: inherit; font-weight: 600; padding: .55rem .9rem; border: 1px solid var(--steel); border-radius: var(--radius);
  background: var(--panel); color: var(--ink); cursor: pointer; }
button:hover { border-color: var(--copper); color: var(--copper); }
button:focus-visible { outline: 3px solid var(--copper); outline-offset: 2px; }

/* Use this next / tools hub cards */
.next-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.next-card { display: grid; gap: .2rem; padding: 1rem; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.next-card strong { color: var(--copper); }
.next-card span { color: var(--muted); font-size: .95rem; }
.next-card:hover { border-color: var(--copper); }

/* Copy */
.content, .faq, .prose, .safety { margin-top: 2rem; max-width: 44rem; }
.faq h3 { font-size: 1.05rem; margin-bottom: .25rem; }
.safety { border-left: 4px solid var(--steel); padding: .5rem 1rem; background: var(--panel); color: var(--muted); }
.code-ref { color: var(--steel); }

/* Reserved ad positions: hidden until ads are enabled (then give them a min-height). */
.ad-slot { display: none; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); padding: 2rem 1rem; font-size: .95rem;
  max-width: 76rem; margin: 2rem auto 0; }
.footer-tools { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.footer-tools h2 { font-size: 1rem; margin: 0 0 .4rem; color: var(--ink); }
.footer-tools ul { list-style: none; margin: 0; padding: 0; }
.footer-trust { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 1.5rem 0 .5rem; }

/* Print: the chart on paper, nothing else. */
@media print {
  :root { --bg: #fff; --panel: #fff; --ink: #000; --muted: #333; --line: #bbb; --copper: #000; --steel: #000; }
  @page { margin: 10mm; }
  .site-header .site-nav, .site-footer, .chart-tools, .next, .faq, .content, .safety, .ad-slot, form, .lede, .result { display: none !important; }
  .site-header { padding: 0 0 2pt; border: 0; }
  .container { max-width: none; padding: 0; }
  .table-wrap { border: 0; overflow: visible; max-height: none; }
  .chart { min-width: 0; font-size: 7pt; line-height: 1.15; }
  .spec caption { padding: 0 0 2pt; font-size: 7pt; }
  .spec th, .spec td { padding: 0 4px; }
  .table-note { font-size: 6.5pt; margin: 2pt 0 0; }
  .spec thead th { position: static; }
  h1 { font-size: 14pt; margin: 0 0 4pt; }
}
