/* Conduit Fill Calculator
   Enterprise tool, not a landing page. Numbers first, decoration never.
   Palette: near-black ink on paper white, one accent for the answer. */

:root {
  --ink: #14202e;
  --ink-soft: #4a5a6b;
  --line: #d8dee6;
  --paper: #ffffff;
  --paper-alt: #f6f8fa;
  --accent: #1a365d;
  --ok: #1c7a4a;
  --over: #b42318;
  --warn: #b45309;
  --radius: 4px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 0;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  z-index: 99;
}

/* ---------- header ---------- */
header.site {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  flex-wrap: wrap;
}

header.site .brand {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

header.site nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

header.site nav a {
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

header.site nav a:hover { color: var(--ink); }
header.site nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ---------- layout ---------- */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

main.nf { text-align: center; padding-top: 80px; }

h1 {
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  font-weight: 700;
}

h2 {
  font-size: 19px;
  letter-spacing: -0.01em;
  margin: 36px 0 10px;
  font-weight: 650;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

p { margin: 0 0 14px; }

a { color: var(--accent); }

.freshness {
  font-size: 13px;
  color: var(--ink-soft);
  background: var(--paper-alt);
  border-left: 3px solid var(--accent);
  padding: 8px 12px;
  margin: 0 0 22px;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.note {
  font-size: 13.5px;
  color: var(--ink-soft);
  background: var(--paper-alt);
  padding: 10px 12px;
  border-radius: var(--radius);
}

.pending {
  border: 1px dashed var(--line);
  padding: 20px;
  color: var(--ink-soft);
  border-radius: var(--radius);
}

/* ---------- form ---------- */
.calc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 0 0 24px;
}

@media (max-width: 640px) {
  .calc { grid-template-columns: 1fr; }
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
  margin: 0;
  background: var(--paper);
}

legend {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 0 6px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

label:last-child { margin-bottom: 0; }

select, input {
  display: block;
  width: 100%;
  margin-top: 4px;
  font-size: 16px;
  font-family: var(--mono);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 10px;
  -webkit-appearance: none;
  appearance: none;
}

select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%),
                    linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}

select:focus, input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}

/* ---------- result: the reason the page exists ---------- */
.result {
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 20px 16px;
  margin: 0 0 24px;
  background: var(--paper);
}

.result-main {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.result-main .ok { color: var(--ok); }
.result-main .over { color: var(--over); }

.result-detail {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 20px;
  margin: 0;
  font-size: 14px;
}

.result-detail dt {
  color: var(--ink-soft);
  font-size: 13px;
}

.result-detail dd {
  margin: 0;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* ---------- tables ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0 0 20px;
}

table.grid {
  border-collapse: collapse;
  width: 100%;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

table.grid th, table.grid td {
  padding: 7px 10px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.grid th:first-child, table.grid td:first-child,
table.grid th:nth-child(2), table.grid td:nth-child(2) {
  text-align: left;
}

table.grid thead th {
  background: var(--paper-alt);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  font-weight: 600;
  position: sticky;
  top: 0;
  border-bottom: 1px solid var(--line);
}

table.grid tbody th {
  font-weight: 600;
  background: var(--paper-alt);
}

table.grid tbody tr:hover { background: #f0f4f8; }
table.grid tbody tr.hit { background: #eaf5ee; }
table.grid tbody tr.hit td { font-weight: 650; }

/* ---------- deflist ---------- */
.deflist { margin: 0 0 20px; }
.deflist dt {
  font-weight: 650;
  font-size: 14px;
  margin-top: 12px;
}
.deflist dd {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 14.5px;
}

/* ---------- ads ---------- */
.ad-slot {
  margin: 24px 0;
  min-height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 0;
}

/* ---------- footer ---------- */
footer.site {
  border-top: 1px solid var(--line);
  padding: 22px 20px 32px;
  max-width: 960px;
  margin: 0 auto;
  font-size: 13px;
  color: var(--ink-soft);
}

footer.site p { margin: 0 0 6px; }
footer.site a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }
footer.site a:hover { color: var(--ink); }

/* ---------- print: the chart page must survive a printer ---------- */
@media print {
  header.site nav, footer.site, .ad-slot, .calc, .skip { display: none !important; }
  body { font-size: 11pt; }
  main { max-width: none; padding: 0; }
  h1 { font-size: 18pt; }
  h2 { font-size: 12pt; }
  .table-wrap { overflow: visible; border: 0; }
  table.grid { font-size: 8.5pt; }
  table.grid thead th {
    background: #fff !important;
    color: #000;
    border-bottom: 1.5px solid #000;
  }
  table.grid tbody th { background: #f2f2f2 !important; }
  table.grid tbody tr:hover { background: transparent; }
  table.grid tbody tr { page-break-inside: avoid; }
  .freshness { border-left: 2px solid #000; background: #fff; }
  a { color: #000; text-decoration: none; }
  @page { margin: 14mm; }
}
