/* ==========================================================================
   Overtime Hours Calculator — shared design system
   Tokens, layout, header/footer, forms, results, prose. No build step.
   ========================================================================== */

:root {
  --paper:        #f6f5f1;
  --surface:      #ffffff;
  --surface-sunk: #faf9f6;
  --ink:          #10171f;
  --ink-soft:     #3f4c59;
  --ink-faint:    #6a7683;
  --line:         #e0ddd4;
  --line-strong:  #c9c5b9;
  --accent:       #0b6153;
  --accent-deep:  #074338;
  --accent-tint:  #e7f1ee;
  --flag:         #97540c;
  --flag-tint:    #fbf1e2;
  --danger:       #9d2224;
  --danger-tint:  #fbeceb;

  --radius:    10px;
  --radius-sm: 6px;
  --shadow:    0 1px 2px rgba(16, 23, 31, .05), 0 8px 24px -16px rgba(16, 23, 31, .35);

  --wrap: 1080px;
  --gap:  clamp(1rem, 3vw, 1.75rem);

  --sans: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

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

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

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

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

h1, h2, h3 { line-height: 1.2; letter-spacing: -.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.7rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.7rem); }
h3 { font-size: 1.1rem; }
p  { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }

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

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 20;
  background: var(--surface); color: var(--ink);
  padding: .6rem 1rem; border-radius: var(--radius-sm);
  font-weight: 600; transition: top .15s ease;
}
.skip-link:focus { top: 1rem; }

/* --- Header ------------------------------------------------------------- */

.site-header {
  background: var(--ink);
  color: #eef1f3;
  border-bottom: 3px solid var(--accent);
}
.header-top {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem;
  padding-block: .85rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  color: #fff; text-decoration: none; font-weight: 700;
  letter-spacing: -.02em; font-size: 1.05rem;
}
.brand:hover { color: #fff; }
.brand:hover .brand-mark { background: var(--accent); color: #fff; }
.brand-mark {
  display: grid; place-items: center;
  width: 2.4rem; height: 2.4rem; flex: none;
  background: #fff; color: var(--ink);
  border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: .85rem; font-weight: 700;
  transition: background .15s ease, color .15s ease;
}
.brand-name { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name small {
  font-weight: 500; font-size: .72rem; letter-spacing: .08em;
  text-transform: uppercase; color: #9fb0ae;
}

.site-nav { border-top: 1px solid rgba(255, 255, 255, .12); }
.site-nav ul {
  display: flex; gap: .35rem; margin: 0; padding: .5rem 0;
  list-style: none; overflow-x: auto; scrollbar-width: thin;
}
.site-nav a {
  display: block; white-space: nowrap;
  padding: .35rem .7rem; border-radius: 999px;
  color: #d6dde1; text-decoration: none; font-size: .9rem; font-weight: 500;
  border: 1px solid transparent;
}
.site-nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.site-nav a[aria-current="page"] {
  background: var(--accent); color: #fff; border-color: #14806d;
}
@media (min-width: 800px) {
  .site-nav ul { flex-wrap: wrap; overflow-x: visible; }
}

/* --- Layout ------------------------------------------------------------- */

main { display: block; padding-block: clamp(1.5rem, 4vw, 2.75rem) clamp(2rem, 6vw, 3.5rem); }

.page-intro { max-width: 62ch; }
.page-intro .lede { font-size: 1.1rem; color: var(--ink-soft); }

.eyebrow {
  display: inline-block; margin-bottom: .6rem;
  font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent);
}

.section { margin-top: clamp(2rem, 5vw, 3rem); }
.section > p, .section > ul, .section > ol { max-width: 70ch; }
.section > h3 { margin-top: 1.75rem; }
.section > h2 + h3 { margin-top: 1rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* --- Calculator shell --------------------------------------------------- */

.calc {
  margin-top: clamp(1.25rem, 3vw, 2rem);
  display: grid; gap: 0;
  grid-template-columns: 1fr;
  overflow: hidden;
}
@media (min-width: 900px) {
  .calc { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
}

.calc-form { padding: clamp(1.1rem, 3vw, 1.75rem); }
.calc-output {
  padding: clamp(1.1rem, 3vw, 1.75rem);
  background: var(--surface-sunk);
  border-top: 1px solid var(--line);
}
@media (min-width: 900px) {
  .calc-output { border-top: 0; border-left: 1px solid var(--line); }
}

/* --- Forms -------------------------------------------------------------- */

fieldset { margin: 0 0 1.35rem; padding: 0; border: 0; }
fieldset:last-of-type { margin-bottom: 1rem; }

legend {
  padding: 0; margin-bottom: .6rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint);
}

.mode-choices { display: grid; gap: .5rem; }
@media (min-width: 480px) { .mode-choices { grid-template-columns: 1fr 1fr; } }

.mode-choice {
  display: flex; gap: .6rem; align-items: flex-start;
  padding: .7rem .85rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer;
}
.mode-choice:hover { border-color: var(--accent); }
.mode-choice input { margin: .25rem 0 0; accent-color: var(--accent); flex: none; }
.mode-choice-text { display: flex; flex-direction: column; }
.mode-choice-text strong { font-size: .95rem; }
.mode-choice-text span { font-size: .82rem; color: var(--ink-faint); line-height: 1.4; }
.mode-choice:has(input:checked) {
  border-color: var(--accent); background: var(--accent-tint);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.mode-choice:has(input:focus-visible) { outline: 3px solid var(--flag); outline-offset: 2px; }

.field-grid { display: grid; gap: 1rem; }
@media (min-width: 520px) { .field-grid { grid-template-columns: 1fr 1fr; } }

.field { display: flex; flex-direction: column; min-width: 0; }
.field > label { font-weight: 600; font-size: .93rem; margin-bottom: .3rem; }
.field .hint { font-size: .8rem; color: var(--ink-faint); margin: .3rem 0 0; }
.field .optional { font-weight: 500; color: var(--ink-faint); }

.input-shell {
  display: flex; align-items: center;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface);
}
.input-shell:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.input-shell .affix {
  padding: 0 .55rem; color: var(--ink-faint);
  font-family: var(--mono); font-size: .9rem; user-select: none;
}
.input-shell .affix + input { padding-left: 0; }

.input-shell input {
  flex: 1; min-width: 0;
  padding: .6rem .7rem;
  border: 0; background: transparent; color: inherit;
  font: inherit; font-variant-numeric: tabular-nums;
  border-radius: var(--radius-sm);
}
.input-shell input:focus { outline: none; }

.input-shell select {
  flex: 1; min-width: 0;
  padding: .6rem .7rem;
  border: 0; background: transparent; color: inherit;
  font: inherit;
  border-radius: var(--radius-sm);
  appearance: none; -webkit-appearance: none;
  cursor: pointer;
}
.input-shell select:focus { outline: none; }
.input-shell select + .affix { pointer-events: none; }

.field.is-invalid .input-shell { border-color: var(--danger); background: var(--danger-tint); }
.field.is-invalid .input-shell:focus-within { box-shadow: 0 0 0 3px #f6d6d5; }

.field-error {
  display: none;
  margin: .35rem 0 0; padding-left: 1.1rem; position: relative;
  color: var(--danger); font-size: .84rem; font-weight: 500;
}
.field-error::before { content: "!"; position: absolute; left: 0; font-weight: 700; }
.field.is-invalid .field-error { display: block; }

.form-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

.btn {
  font: inherit; font-weight: 600; font-size: .92rem;
  padding: .55rem 1.05rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  cursor: pointer;
}
a.btn { text-decoration: none; display: inline-block; }
.btn:hover { border-color: var(--ink-faint); background: #f1efe9; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.action-note { font-size: .84rem; color: var(--accent-deep); font-weight: 600; min-height: 1.2em; }

/* --- Results ------------------------------------------------------------ */

.result-headline {
  display: flex; flex-direction: column; gap: .1rem;
  padding-bottom: 1rem; margin-bottom: 1rem;
  border-bottom: 2px solid var(--ink);
}
.result-headline .label {
  font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint);
}
.result-headline .value {
  font-family: var(--mono); font-size: clamp(2rem, 1.4rem + 2.4vw, 2.9rem);
  font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums;
}
.result-headline .sub { font-size: .88rem; color: var(--ink-soft); }
/* Free-text pay period label sitting inside the uppercase result label. */
.result-headline .label .period {
  text-transform: none; letter-spacing: .01em; color: var(--ink-soft);
  font-size: .82rem; font-weight: 600;
}
.result-headline .label .period:empty { display: none; }

.result-rows { display: grid; gap: 0; margin: 0 0 1.15rem; }
.result-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: .55rem 0; border-bottom: 1px solid var(--line);
}
.result-row dt { color: var(--ink-soft); font-size: .93rem; }
.result-row dd {
  margin: 0; font-family: var(--mono); font-weight: 600;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.result-row.is-highlight dd { color: var(--flag); }

.breakdown {
  margin: 0; padding: .85rem 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.breakdown > h3 {
  margin: 0 0 .55rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint);
}
.breakdown ol { margin: 0; padding-left: 1.2rem; }
.breakdown li { margin-bottom: .4rem; font-size: .88rem; line-height: 1.5; }
.breakdown li:last-child { margin-bottom: 0; }
.breakdown code, .formula code, code {
  font-family: var(--mono); font-size: .88em;
  background: var(--surface-sunk); border: 1px solid var(--line);
  border-radius: 4px; padding: .05em .3em;
  font-variant-numeric: tabular-nums;
}
.breakdown code { background: var(--accent-tint); border-color: #cadfd9; }

.result-alert {
  display: none;
  margin-bottom: 1rem; padding: .7rem .85rem;
  background: var(--danger-tint); border: 1px solid #e8bbb9; border-left: 4px solid var(--danger);
  border-radius: var(--radius-sm);
  color: #7d1c1e; font-size: .9rem; font-weight: 500;
}
.calc.has-errors .result-alert { display: block; }
.calc.has-errors .result-body { opacity: .45; }

.result-footnote {
  margin: .9rem 0 0;
  font-size: .84rem; line-height: 1.5; color: var(--ink-faint);
}

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

/* --- Prose blocks ------------------------------------------------------- */

.formula {
  margin: 1rem 0; padding: .9rem 1.1rem;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--accent); border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: .93rem; line-height: 1.9;
  overflow-x: auto;
}
.formula strong { font-family: var(--sans); }
.formula code { background: none; border: 0; padding: 0; }

.callout {
  margin: 1.25rem 0; padding: 1rem 1.15rem;
  background: var(--flag-tint); border: 1px solid #ecd6b3; border-left: 4px solid var(--flag);
  border-radius: var(--radius-sm);
}
.callout h2, .callout h3 { margin-bottom: .4rem; }
.callout p { font-size: .95rem; }

.example {
  margin: 1rem 0; padding: 1rem 1.15rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.example ol { margin: .5rem 0 0; padding-left: 1.25rem; }
.example li { margin-bottom: .35rem; }
.example .example-total {
  margin-top: .85rem; padding-top: .7rem; border-top: 1px solid var(--line);
  font-family: var(--mono); font-weight: 700; font-size: 1.05rem;
}

.checklist {
  margin: 1rem 0; padding: 0; list-style: none;
  display: grid; gap: .55rem;
  max-width: 70ch;
}
.checklist li {
  position: relative; padding-left: 1.6rem;
  font-size: .95rem;
}
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .55em;
  width: .5rem; height: .5rem;
  background: var(--accent); border-radius: 2px;
}

.source-list {
  margin: 1rem 0 0; padding: 0; list-style: none;
  display: grid; gap: .55rem; max-width: 70ch;
}
.source-list li {
  padding: .7rem .9rem;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--accent); border-radius: var(--radius-sm);
  font-size: .93rem;
}

.faq { margin: 0; }
.faq > div { border-bottom: 1px solid var(--line); padding: .9rem 0; }
.faq > div:first-child { border-top: 1px solid var(--line); }
.faq dt { font-weight: 600; margin-bottom: .35rem; }
.faq dd { margin: 0; color: var(--ink-soft); max-width: 70ch; }

.tool-grid { display: grid; gap: .75rem; padding: 0; margin: 1rem 0 0; list-style: none; }
@media (min-width: 600px) { .tool-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .tool-grid { grid-template-columns: repeat(3, 1fr); } }

.tool-card {
  display: block; height: 100%;
  padding: .85rem 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  text-decoration: none; color: var(--ink);
}
.tool-card:hover { border-color: var(--accent); background: var(--accent-tint); color: var(--ink); }
.tool-card strong { display: block; font-size: .98rem; }
.tool-card span { display: block; font-size: .85rem; color: var(--ink-faint); line-height: 1.45; }

/* --- Time card (biweekly) ----------------------------------------------- */

/* The 14-row card is too wide for the two-column calculator shell. */
.calc--stacked { grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .calc--stacked { grid-template-columns: 1fr; }
  .calc--stacked .calc-output { border-top: 1px solid var(--line); border-left: 0; }
}

.week-fieldset { margin-bottom: 1.6rem; }
.week-fieldset legend {
  font-size: .9rem; letter-spacing: .06em; color: var(--ink);
}
.week-fieldset legend .week-dates { color: var(--ink-faint); font-weight: 600; letter-spacing: .02em; }

.tc-table {
  width: 100%; border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.tc-table thead th {
  padding: 0 .4rem .4rem;
  text-align: left; vertical-align: bottom;
  font-size: .73rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--line-strong);
}
.tc-table tbody th {
  padding: .45rem .5rem .45rem 0;
  text-align: left; vertical-align: middle;
  font-size: .92rem; font-weight: 600; white-space: nowrap;
}
.tc-table tbody td { padding: .3rem .4rem .3rem 0; vertical-align: middle; }
.tc-table tbody tr + tr { border-top: 1px solid var(--line); }

.tc-table input {
  width: 100%; min-width: 0;
  padding: .42rem .5rem;
  font: inherit; font-size: .92rem; font-variant-numeric: tabular-nums;
  color: inherit; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}
.tc-table input:focus { border-color: var(--accent); }
.tc-table input[aria-invalid="true"] {
  border-color: var(--danger); background: var(--danger-tint);
}

.tc-table input[type="time"] { max-width: 9.5rem; }

/* Fixed columns so week 1 and week 2 line up even when a row shows an error. */
@media (min-width: 720px) {
  .tc-table { table-layout: fixed; }
  .tc-table thead th:nth-child(1) { width: 4.5rem; }
  .tc-table thead th:nth-child(2),
  .tc-table thead th:nth-child(3) { width: 10.5rem; }
  .tc-table thead th:nth-child(4) { width: 8.5rem; }
}

.tc-break { display: flex; align-items: center; gap: .35rem; }
.tc-break input { max-width: 5.5rem; }
.tc-unit { font-size: .8rem; color: var(--ink-faint); }

.tc-result { min-width: 12rem; }
.tc-hours { font-family: var(--mono); font-weight: 600; font-size: .95rem; }
.tc-hours.is-blank { color: var(--ink-faint); font-weight: 400; }
.tc-note { display: block; font-size: .76rem; color: var(--flag); font-weight: 600; }
.tc-note:empty { display: none; }
.tc-error { display: block; font-size: .8rem; color: var(--danger); font-weight: 500; line-height: 1.35; }
.tc-error:empty { display: none; }

.tc-week-total {
  margin: .7rem 0 0; padding: .55rem .75rem;
  background: var(--surface-sunk); border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: .9rem; font-variant-numeric: tabular-nums;
}
.tc-week-total strong { font-family: var(--mono); }

@media (max-width: 719px) {
  .tc-table thead { display: none; }
  .tc-table, .tc-table tbody, .tc-table tr, .tc-table tbody th, .tc-table tbody td { display: block; width: 100%; }
  .tc-table tr {
    padding: .6rem .75rem; margin-bottom: .6rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  }
  .tc-table tbody tr + tr { border-top: 1px solid var(--line); }
  .tc-table tbody th { padding: 0 0 .35rem; font-size: .95rem; }
  .tc-table tbody td {
    display: grid; grid-template-columns: 7.5rem minmax(0, 1fr);
    align-items: center; gap: .5rem; padding: .2rem 0;
  }
  .tc-table tbody td::before {
    content: attr(data-label);
    font-size: .8rem; color: var(--ink-faint);
    align-self: start;
  }
  /* Keep the note and the error under the value, not under the label. */
  .tc-table tbody td .tc-note, .tc-table tbody td .tc-error { grid-column: 2; }
}

.week-cols { display: grid; gap: 1rem; margin-bottom: 1.15rem; }
@media (min-width: 620px) { .week-cols { grid-template-columns: 1fr 1fr; } }

.week-card {
  padding: .85rem 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.week-card h3 {
  margin: 0 0 .4rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint);
}
.week-card .result-rows { margin-bottom: 0; }
.week-card .result-row { padding: .4rem 0; }
.week-card .result-row:last-child { border-bottom: 0; }
.week-card .result-row dt { font-size: .88rem; }
.week-card .result-row dd { font-size: .92rem; }

.result-rows .result-row[hidden] { display: none; }

/* --- Time to decimal ---------------------------------------------------- */

/* The precision the user picked, marked inside a list of all three. */
.result-row.is-selected {
  background: var(--accent-tint);
  border-bottom-color: #cadfd9;
  padding-inline: .55rem;
  margin-inline: -.55rem;
}
.result-row.is-selected dt { color: var(--ink); font-weight: 600; }
.result-row.is-selected dd { color: var(--accent-deep); }

.table-scroll { overflow-x: auto; margin: 1rem 0; }

.data-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.data-table caption {
  caption-side: bottom; padding-top: .6rem;
  text-align: left; font-size: .84rem; color: var(--ink-faint);
}
.data-table th, .data-table td {
  padding: .5rem .7rem; text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table thead th {
  background: var(--surface-sunk);
  border-bottom: 1px solid var(--line-strong);
  font-size: .73rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-faint);
}
.data-table tbody th { font-weight: 600; }
.data-table tbody td { font-family: var(--mono); font-size: .9rem; }
.data-table tbody td.note-cell { font-family: var(--sans); font-size: .88rem; color: var(--ink-faint); }
.data-table tbody tr:last-child th, .data-table tbody tr:last-child td { border-bottom: 0; }

/* --- Add time (multi-row durations) ------------------------------------- */

.at-table {
  width: 100%; border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.at-table thead th {
  padding: 0 .4rem .4rem;
  text-align: left; vertical-align: bottom;
  font-size: .73rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--line-strong);
}
.at-table tbody th {
  padding: .5rem .5rem .5rem 0;
  text-align: left; vertical-align: middle;
  font-size: .92rem; font-weight: 600; white-space: nowrap;
}
.at-table tbody td { padding: .35rem .4rem .35rem 0; vertical-align: middle; }
.at-table tbody tr + tr { border-top: 1px solid var(--line); }

.at-table input {
  width: 100%; min-width: 0;
  padding: .42rem .5rem;
  font: inherit; font-size: .92rem; font-variant-numeric: tabular-nums;
  color: inherit; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}
.at-table input:focus { border-color: var(--accent); }
.at-table input[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-tint); }

@media (min-width: 720px) {
  .at-table { table-layout: fixed; }
  .at-table thead th:nth-child(1) { width: 5.5rem; }
  .at-table thead th:nth-child(2),
  .at-table thead th:nth-child(3) { width: 7.5rem; }
  .at-table thead th:nth-child(5) { width: 7rem; }
}

.at-hours { display: block; font-family: var(--mono); font-weight: 600; font-size: .92rem; }
.at-hours.is-blank { font-family: var(--sans); font-weight: 400; font-size: .88rem; color: var(--ink-faint); }
.at-error { display: block; font-size: .8rem; color: var(--danger); font-weight: 500; line-height: 1.35; }
.at-error:empty { display: none; }

.at-remove-cell { text-align: right; }
.at-remove { padding: .35rem .7rem; font-size: .82rem; }

.at-row-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem;
  margin-top: .9rem;
}
.at-count { font-size: .84rem; color: var(--ink-faint); }
.at-rules { max-width: 74ch; margin-top: .75rem; }

@media (max-width: 719px) {
  .at-table thead { display: none; }
  .at-table, .at-table tbody, .at-table tr, .at-table tbody th, .at-table tbody td { display: block; width: 100%; }
  .at-table tr {
    padding: .6rem .75rem; margin-bottom: .6rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  }
  .at-table tbody tr + tr { border-top: 1px solid var(--line); }
  .at-table tbody th { padding: 0 0 .35rem; font-size: .95rem; }
  .at-table tbody td {
    display: grid; grid-template-columns: 7.5rem minmax(0, 1fr);
    align-items: center; gap: .5rem; padding: .2rem 0;
  }
  .at-table tbody td::before {
    content: attr(data-label);
    font-size: .8rem; color: var(--ink-faint);
    align-self: start;
  }
  /* Keep the readout and the error under the value, not under the label. */
  .at-table tbody td .at-hours, .at-table tbody td .at-error { grid-column: 2; }
  .at-table tbody td.at-remove-cell { display: block; text-align: left; padding-top: .55rem; }
}

/* --- Minutes to decimal chart ------------------------------------------- */

/* The 0-60 chart is split into four blocks so it reads as a reference card
   instead of one 61-row column. */
.chart-grid {
  display: grid; gap: 1rem;
  margin: 1.25rem 0 1rem;
}
@media (min-width: 560px) { .chart-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .chart-grid { grid-template-columns: repeat(4, 1fr); } }

.pick-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.pick-row + .hint { margin: .5rem 0 0; font-size: .8rem; color: var(--ink-faint); }
.pick { padding: .4rem .7rem; font-size: .86rem; font-family: var(--mono); }
.pick.is-on {
  background: var(--accent-tint); border-color: var(--accent); color: var(--accent-deep);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.chart-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.chart-table caption {
  caption-side: top;
  padding: .5rem .7rem;
  background: var(--ink); color: #eef1f3;
  text-align: left;
  font-size: .8rem; font-weight: 700; letter-spacing: .06em;
}
.chart-table thead th {
  padding: .45rem .6rem;
  text-align: left; vertical-align: bottom;
  background: var(--surface-sunk);
  border-bottom: 1px solid var(--line-strong);
  font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-faint); line-height: 1.3;
}
.chart-table thead th:first-child { width: 4.5rem; }
.chart-table tbody th {
  padding: .3rem .6rem;
  text-align: left;
  font-family: var(--mono); font-size: .9rem; font-weight: 700;
}
.chart-table tbody td {
  padding: .3rem .6rem;
  font-family: var(--mono); font-size: .88rem;
  white-space: nowrap;
}
.chart-table tbody tr + tr th, .chart-table tbody tr + tr td {
  border-top: 1px solid var(--line);
}
.chart-table tbody tr:nth-child(even) { background: #fbfaf7; }

/* Marks a value that repeats forever and had to be rounded. */
.approx { color: var(--flag); font-weight: 700; padding-right: .1em; }

/* The row the converter is currently showing. */
.chart-table tbody tr.is-hit {
  background: var(--accent-tint);
  box-shadow: inset 3px 0 0 var(--accent);
}
.chart-table tbody tr.is-hit th, .chart-table tbody tr.is-hit td { color: var(--accent-deep); }

.chart-key, .chart-note {
  max-width: 74ch;
  font-size: .9rem; color: var(--ink-soft);
}

/* --- Contact ------------------------------------------------------------ */

.contact-card {
  display: grid; gap: 1rem 2rem; align-items: center;
  margin: clamp(1.25rem, 3vw, 2rem) 0 0;
  padding: clamp(1.1rem, 3vw, 1.6rem);
  background: var(--surface);
  border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
@media (min-width: 760px) {
  .contact-card { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
}

.contact-card .label {
  display: block; margin-bottom: .2rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint);
}

.contact-address {
  display: inline-block;
  font-family: var(--mono); font-weight: 700;
  font-size: clamp(1.05rem, .8rem + 1.4vw, 1.5rem);
  letter-spacing: -.02em;
  /* The address is one long token on a narrow phone. */
  overflow-wrap: anywhere;
}

.contact-note { margin: .7rem 0 0; font-size: .88rem; color: var(--ink-soft); }

.contact-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.contact-actions .action-note { flex-basis: 100%; margin: 0; }

.callout .checklist { margin-bottom: 0; }
.callout .checklist li::before { background: var(--flag); }

/* --- Legal pages -------------------------------------------------------- */

/* The effective date of a policy, sitting under the intro paragraph. */
.policy-date {
  margin-top: 1rem;
  padding-top: .75rem;
  border-top: 1px solid var(--line);
  font-size: .9rem; color: var(--ink-soft);
}

/* --- 404 ---------------------------------------------------------------- */

.error-hero {
  display: grid; gap: clamp(1rem, 3vw, 2rem); align-items: center;
  padding: clamp(1.1rem, 3.5vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--line); border-left: 4px solid var(--flag);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
@media (min-width: 720px) {
  .error-hero { grid-template-columns: auto minmax(0, 1fr); }
}

.error-code {
  margin: 0; padding: .3em .35em;
  background: var(--flag-tint); border-radius: var(--radius);
  color: var(--flag); text-align: center;
  font-family: var(--mono); font-weight: 700;
  font-size: clamp(2.6rem, 1.6rem + 5vw, 4.6rem);
  line-height: 1; letter-spacing: -.05em;
}

.error-body { max-width: 60ch; }
.error-body h1 { margin-bottom: .35em; }
.error-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.15rem; }

/* --- Footer ------------------------------------------------------------- */

.site-footer {
  background: var(--ink); color: #c8d0d6;
  padding-block: clamp(1.75rem, 4vw, 2.5rem);
  font-size: .92rem;
}
.footer-grid { display: grid; gap: 1.5rem; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h2 {
  font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: #8e9ba3; margin-bottom: .6rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.site-footer a { color: #e6ebee; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer p { color: #97a3ab; max-width: 40ch; }
.footer-legal {
  margin-top: 1.75rem; padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, .14);
  display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; justify-content: space-between;
  font-size: .85rem; color: #8e9ba3;
}
