/* RigMath — base stylesheet
   Mobile-first. Drivers use phones; everything must work at 360px. */

:root {
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --accent: #b45309;
  --accent-soft: #fef3c7;
  --blue: #1d4ed8;
  --green: #047857;
  --red: #b91c1c;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }

/* ---------- header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -.02em;
}
.brand-mark {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
}
.site-nav { display: flex; gap: 4px; overflow-x: auto; }
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  padding: 7px 10px;
  border-radius: 7px;
  white-space: nowrap;
}
.site-nav a:hover { background: var(--bg-soft); color: var(--ink); }
.site-nav a[aria-current="page"] { background: var(--ink); color: #fff; }

/* ---------- hero ---------- */
.hero { padding: 40px 0 32px; border-bottom: 1px solid var(--line); }
.hero h1 {
  font-size: clamp(26px, 5vw, 40px);
  line-height: 1.15;
  letter-spacing: -.03em;
  margin: 0 0 12px;
  font-weight: 800;
}
.hero p.lead {
  font-size: clamp(16px, 2.4vw, 18px);
  color: var(--ink-soft);
  margin: 0 0 20px;
  max-width: 660px;
}
.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 9px;
  border-radius: 5px;
  margin-bottom: 14px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 11px 18px;
  border-radius: 8px;
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: opacity .15s;
}
.btn:hover { opacity: .88; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn.small { font-size: 13px; padding: 7px 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- cards / grid ---------- */
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: 1fr; }
.grid.cols-3 { grid-template-columns: 1fr; }
@media (min-width: 700px) {
  .grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: #fff;
}
.card h3 { margin: 0 0 6px; font-size: 16px; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.card a.card-link { text-decoration: none; color: inherit; display: block; }
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }

section.band { padding: 36px 0; border-bottom: 1px solid var(--line); }
section.band h2 {
  font-size: clamp(20px, 3vw, 26px);
  letter-spacing: -.02em;
  margin: 0 0 8px;
}
section.band p.sub { color: var(--muted); margin: 0 0 20px; max-width: 640px; }

/* ---------- tool / form ---------- */
.tool {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.tool-head {
  padding: 14px 16px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.tool-head h2 { margin: 0; font-size: 16px; }
.tool-body { padding: 16px; }

label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 5px; }
input[type="number"], input[type="text"], select {
  width: 100%;
  font-family: var(--font);
  font-size: 15px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
input[readonly] { background: var(--bg-soft); color: var(--muted); }

.field { margin-bottom: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* jurisdiction rows */
.jrow {
  display: grid;
  grid-template-columns: 1fr 88px 88px 32px;
  gap: 8px;
  align-items: end;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.jrow:last-of-type { border-bottom: none; }
.jrow .rate { font-size: 12px; color: var(--muted); text-align: right; padding-bottom: 10px; }
.jrow .del {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 18px; line-height: 1; padding: 0 0 10px; height: 38px;
}
.jrow .del:hover { color: var(--red); }
@media (max-width: 520px) {
  .jrow { grid-template-columns: 1fr 76px 76px 28px; gap: 6px; }
  .jrow .rate { display: none; }
}

/* results */
.results { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
.res-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px;
}
.res-row:last-child { border-bottom: none; }
.res-row .k { color: var(--ink-soft); }
.res-row .v { font-variant-numeric: tabular-nums; font-weight: 600; }
.res-total {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 10px; padding: 14px 16px;
  background: var(--bg-soft); border-radius: 9px;
  border: 1px solid var(--line);
}
.res-total .k { font-weight: 700; font-size: 15px; }
.res-total .v { font-size: clamp(20px, 4vw, 26px); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.owe { color: var(--red); }
.refund { color: var(--green); }
.zero { color: var(--muted); }

.breakdown { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13px; }
.breakdown th, .breakdown td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.breakdown th:first-child, .breakdown td:first-child { text-align: left; }
.breakdown th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.breakdown td { font-variant-numeric: tabular-nums; }

/* ---------- data table ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 420px; }
table.data th, table.data td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; }
table.data th { background: var(--bg-soft); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); position: sticky; top: 0; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 13px; }
table.data tr:hover td { background: #fcfcfd; }
table.data td.na { color: var(--muted); font-style: italic; font-family: var(--font); }
.tag { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line); }

/* ---------- notes / callouts ---------- */
.note {
  border-left: 3px solid var(--accent);
  background: #fffdf7;
  padding: 12px 14px;
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  color: var(--ink-soft);
  margin: 16px 0;
}
.note strong { color: var(--ink); }
.note.warn { border-left-color: var(--red); background: #fff7f7; }
.note.info { border-left-color: var(--blue); background: #f6f9ff; }

.src {
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 18px;
}
.src a { color: var(--blue); }

/* ---------- prose ---------- */
.prose h2 { font-size: 22px; letter-spacing: -.02em; margin: 32px 0 10px; }
.prose h3 { font-size: 17px; margin: 24px 0 8px; }
.prose p, .prose li { color: var(--ink-soft); font-size: 15.5px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--blue); }
.prose code { background: var(--bg-soft); padding: 1px 5px; border-radius: 4px; font-family: var(--mono); font-size: 13.5px; }

/* ---------- faq ---------- */
details.faq {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 13px 15px;
  margin-bottom: 9px;
  background: #fff;
}
details.faq summary { cursor: pointer; font-weight: 600; font-size: 15px; }
details.faq[open] summary { margin-bottom: 8px; }
details.faq p { margin: 0; color: var(--ink-soft); font-size: 14.5px; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  background: var(--bg-soft);
  font-size: 13px;
  color: var(--muted);
}
.site-footer .cols { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .site-footer .cols { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer a { color: var(--ink-soft); text-decoration: none; display: block; margin-bottom: 5px; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.site-footer h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); margin: 0 0 9px; }
.site-footer .legal { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line-strong); font-size: 12px; }

.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;
}

/* ---------- article additions ---------- */
.formula {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  background: var(--bg-soft);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  margin: 10px 0 14px;
  border-radius: 0 6px 6px 0;
  overflow-x: auto;
  white-space: nowrap;
}

.cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 8px; }

table.data tfoot td {
  border-top: 2px solid var(--line-strong);
  border-bottom: none;
  background: var(--bg-soft);
  padding-top: 11px;
}

table.data td.num.owe { color: var(--red); }
table.data td.num.refund { color: var(--green); }
table.data td.num.na { color: var(--muted); font-style: italic; font-size: 12.5px; }

