:root {
  color-scheme: light;
  --ink: #102a36;
  --ink-soft: #4d626c;
  --navy: #0b2838;
  --navy-light: #153d4e;
  --teal: #0f766e;
  --teal-dark: #0c5c57;
  --teal-pale: #e0f1ed;
  --mint: #bfe1d8;
  --blue-pale: #e7f0f4;
  --amber: #a64b16;
  --amber-pale: #fff2df;
  --red: #a53030;
  --red-pale: #fff0ed;
  --paper: #ffffff;
  --canvas: #f2f5f4;
  --line: #d3dedc;
  --line-dark: #a9bdbc;
  --shadow-sm: 0 1px 2px rgb(8 33 44 / 7%);
  --shadow-md: 0 16px 40px rgb(8 33 44 / 10%);
  --radius-sm: 0.55rem;
  --radius: 0.9rem;
  --radius-lg: 1.35rem;
  --content: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--teal-dark);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--navy);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--navy);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

h1 {
  font-size: clamp(2.3rem, 5vw, 4.8rem);
}

h2 {
  font-size: clamp(1.7rem, 3vw, 2.55rem);
}

h3 {
  font-size: 1.16rem;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  color: white;
  background: var(--navy);
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid #e99b43;
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  color: white;
  background: rgb(11 40 56 / 96%);
  border-bottom: 1px solid rgb(255 255 255 / 12%);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(120px, 1fr);
  gap: 1.5rem;
  align-items: center;
  width: min(var(--content), calc(100% - 2rem));
  min-height: 72px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  gap: 0.7rem;
  align-items: center;
  width: fit-content;
  color: white;
  text-decoration: none;
}

.brand:hover {
  color: white;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  color: var(--navy);
  background: var(--mint);
  border-radius: 0.55rem;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.05em;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.15;
}

.brand strong {
  font-size: 0.92rem;
}

.brand small {
  margin-top: 0.17rem;
  color: #bcd0d7;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.primary-nav {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: rgb(255 255 255 / 7%);
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 0.75rem;
}

.primary-nav a {
  padding: 0.48rem 0.72rem;
  color: #c8d9de;
  border-radius: 0.5rem;
  font-size: 0.86rem;
  font-weight: 650;
  text-decoration: none;
}

.primary-nav a:hover {
  color: white;
  background: rgb(255 255 255 / 7%);
}

.primary-nav a[aria-current="page"] {
  color: var(--navy);
  background: white;
}

.header-repo-link {
  justify-self: end;
  padding: 0.55rem 0.8rem;
  color: white;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 0.6rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.header-repo-link:hover {
  color: var(--navy);
  background: white;
}

main {
  min-height: calc(100vh - 150px);
}

.page {
  width: min(var(--content), calc(100% - 2rem));
  margin: 0 auto;
  padding: 4.5rem 0 5.5rem;
}

.page.overview-page {
  width: 100%;
  padding-top: 0;
}

.overview-page > :not(.hero) {
  width: min(var(--content), calc(100% - 2rem));
  margin-inline: auto;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: clamp(2.5rem, 7vw, 7rem);
  align-items: center;
  min-height: 620px;
  margin-inline: 0;
  padding: 6rem max(1rem, calc((100% - var(--content)) / 2));
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 88% 30%, rgb(37 128 115 / 32%), transparent 31%),
    radial-gradient(circle at 4% 100%, rgb(82 122 137 / 24%), transparent 32%),
    var(--navy);
}

.hero::after {
  position: absolute;
  right: -5rem;
  bottom: -10rem;
  width: 30rem;
  height: 30rem;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 50%;
  box-shadow:
    0 0 0 4rem rgb(255 255 255 / 2%),
    0 0 0 9rem rgb(255 255 255 / 1.5%);
  content: "";
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 740px;
}

.eyebrow,
.section-kicker,
.tool-tag {
  margin-bottom: 0.8rem;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #8bd2c2;
}

.hero h1 {
  max-width: 780px;
  margin-bottom: 1.4rem;
  color: white;
}

.hero-lede {
  max-width: 680px;
  margin-bottom: 2rem;
  color: #c9d8dd;
  font-size: clamp(1.05rem, 1.7vw, 1.27rem);
}

.hero-actions,
.form-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  color: var(--ink-soft);
  background: #eef2f1;
  border-color: var(--line);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.button-primary {
  color: white;
  background: var(--teal);
  border-color: var(--teal);
  box-shadow: 0 6px 16px rgb(4 95 86 / 18%);
}

.button-primary:hover {
  color: white;
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.hero .button-primary {
  color: var(--navy);
  background: #a9dfd3;
  border-color: #a9dfd3;
}

.hero .button-primary:hover {
  background: #cef0e8;
  border-color: #cef0e8;
}

.button-secondary {
  color: var(--navy);
  background: white;
  border-color: var(--line-dark);
}

.button-secondary:hover {
  color: var(--navy);
  border-color: var(--navy);
}

.hero .button-secondary {
  color: white;
  background: transparent;
  border-color: rgb(255 255 255 / 30%);
}

.hero .button-secondary:hover {
  color: var(--navy);
  background: white;
}

.button-quiet {
  color: var(--teal-dark);
  background: transparent;
  border-color: var(--line);
}

.button-quiet:hover {
  color: var(--navy);
  background: var(--teal-pale);
  border-color: var(--mint);
}

.privacy-line {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  margin: 1.45rem 0 0;
  color: #aac1c8;
  font-size: 0.83rem;
}

.privacy-line span {
  color: #68c4af;
  font-size: 0.62rem;
}

.hero-proof {
  position: relative;
  z-index: 1;
  padding: 1rem;
  color: var(--ink);
  background: rgb(255 255 255 / 96%);
  border: 1px solid rgb(255 255 255 / 30%);
  border-radius: var(--radius-lg);
  box-shadow: 0 28px 70px rgb(0 0 0 / 23%);
  transform: rotate(1deg);
}

.proof-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.45rem 0.95rem;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.proof-status {
  padding: 0.25rem 0.5rem;
  color: var(--teal-dark);
  background: var(--teal-pale);
  border-radius: 99px;
  font-size: 0.65rem;
}

.hero-proof dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 0;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}

.hero-proof dl div {
  padding: 1rem;
  background: white;
}

.hero-proof dt {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.hero-proof dd {
  margin: 0.22rem 0 0;
  color: var(--navy);
  font-size: 1rem;
  font-weight: 800;
}

.proof-rule {
  margin-top: 0.85rem;
  padding: 1rem;
  background: var(--navy);
  border-radius: 0.75rem;
}

.proof-rule span,
.proof-rule strong {
  display: block;
}

.proof-rule span {
  margin-bottom: 0.3rem;
  color: #9db5bd;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.proof-rule strong {
  color: white;
  font-size: 0.95rem;
}

.tool-intro {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 3rem;
  align-items: end;
  margin: 5.5rem 0 2rem;
}

.tool-intro h2 {
  margin-bottom: 0;
}

.tool-intro > p {
  margin-bottom: 0.4rem;
  color: var(--ink-soft);
}

.tool-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 420px;
  padding: 1.6rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.tool-card::before {
  position: absolute;
  top: 0;
  right: 1.6rem;
  left: 1.6rem;
  height: 3px;
  background: var(--teal);
  border-radius: 0 0 4px 4px;
  content: "";
}

.featured-card {
  background:
    linear-gradient(180deg, rgb(224 241 237 / 60%), transparent 48%),
    white;
  border-color: #b8d7d0;
}

.tool-number {
  margin: 0.5rem 0 2.2rem;
  color: #61757d;
  font-size: 2.8rem;
  font-weight: 300;
  letter-spacing: -0.06em;
  line-height: 1;
}

.tool-tag {
  margin-bottom: 0.5rem;
}

.tool-card h3 {
  margin-bottom: 0.85rem;
  font-size: 1.35rem;
}

.tool-card p:not(.tool-tag) {
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.tool-card ul {
  display: grid;
  gap: 0.3rem;
  margin: 0.5rem 0 1.6rem;
  padding-left: 1.2rem;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.tool-card > a {
  margin-top: auto;
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.tool-card > a span {
  margin-left: 0.25rem;
  transition: margin-left 140ms ease;
}

.tool-card > a:hover span {
  margin-left: 0.5rem;
}

.receipt-utility-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: center;
  margin-top: 1.2rem;
  padding: 1.5rem 1.7rem;
  background: white;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.receipt-utility-card h2 {
  margin-bottom: 0.45rem;
  font-size: clamp(1.3rem, 2.4vw, 1.85rem);
}

.receipt-utility-card p:last-child {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.receipt-utility-card .button {
  white-space: nowrap;
}

.boundary-panel {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 4rem;
  margin-top: 4.5rem;
  padding: 2.5rem;
  background: var(--blue-pale);
  border: 1px solid #cbdce2;
  border-radius: var(--radius-lg);
}

.boundary-panel h2 {
  margin-bottom: 0;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
}

.boundary-panel p {
  color: #455c67;
}

.boundary-panel p:last-child {
  margin-bottom: 0;
}

.tool-page {
  padding-top: 3.8rem;
}

.tool-page-header {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 4rem;
  align-items: end;
  margin-bottom: 2rem;
}

.tool-page-header h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(2.2rem, 4vw, 3.7rem);
}

.tool-page-header > div:first-child > p:last-child {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.header-note {
  padding: 1rem 1.15rem;
  background: var(--blue-pale);
  border-left: 3px solid #567d8e;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.header-note strong,
.header-note span {
  display: block;
}

.header-note strong {
  margin-bottom: 0.25rem;
  color: var(--navy);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.header-note span {
  color: #506670;
  font-size: 0.84rem;
}

.local-note {
  background: var(--teal-pale);
  border-color: var(--teal);
}

.caution-note {
  background: var(--amber-pale);
  border-color: var(--amber);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 1.15rem;
  align-items: start;
}

.input-panel,
.result-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.input-panel {
  position: sticky;
  top: 88px;
  padding: 1.35rem;
}

.result-panel {
  min-height: 570px;
  padding: 1.35rem;
  box-shadow: var(--shadow-md);
}

.panel-heading {
  margin-bottom: 1.3rem;
}

.panel-heading h2 {
  margin: 0.35rem 0 0;
  font-size: 1.25rem;
}

.result-heading {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}

.step-badge {
  display: inline-block;
  padding: 0.2rem 0.48rem;
  color: var(--teal-dark);
  background: var(--teal-pale);
  border-radius: 99px;
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.result-context {
  max-width: 240px;
  padding: 0.35rem 0.58rem;
  color: var(--ink-soft);
  background: var(--canvas);
  border-radius: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: right;
}

.field,
.field-pair {
  margin-bottom: 1rem;
}

.field-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.field-pair .field {
  margin-bottom: 0;
}

.field label,
.file-field label > span {
  display: block;
  margin-bottom: 0.38rem;
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 750;
}

.field small,
.file-field small,
.check-field small {
  display: block;
  margin-top: 0.35rem;
  color: #586d75;
  font-size: 0.75rem;
  line-height: 1.4;
}

input[type="text"],
input[type="date"],
input[type="number"],
select {
  width: 100%;
  min-height: 2.7rem;
  padding: 0.6rem 0.7rem;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line-dark);
  border-radius: 0.55rem;
}

input:hover,
select:hover {
  border-color: #779593;
}

input:focus,
select:focus {
  border-color: var(--teal);
  outline: 3px solid rgb(15 118 110 / 13%);
}

.input-suffix {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
}

.input-suffix input {
  border-radius: 0.55rem 0 0 0.55rem;
}

.input-suffix span {
  display: grid;
  place-items: center;
  padding: 0 0.6rem;
  color: var(--ink-soft);
  background: var(--canvas);
  border: 1px solid var(--line-dark);
  border-left: 0;
  border-radius: 0 0.55rem 0.55rem 0;
  font-size: 0.72rem;
}

.file-field {
  margin-bottom: 0.8rem;
  padding: 0.9rem;
  background: var(--canvas);
  border: 1px dashed var(--line-dark);
  border-radius: 0.65rem;
}

.file-field label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.6rem;
}

.file-field label > span {
  margin: 0;
}

.file-field label small {
  max-width: 175px;
  margin: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

input[type="file"] {
  width: 100%;
  color: var(--ink-soft);
  font-size: 0.74rem;
}

input[type="file"]::file-selector-button {
  margin-right: 0.65rem;
  padding: 0.45rem 0.6rem;
  color: var(--navy);
  background: white;
  border: 1px solid var(--line-dark);
  border-radius: 0.45rem;
  font-weight: 700;
  cursor: pointer;
}

.check-field {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  margin: 0.8rem 0 1rem;
  padding: 0.75rem;
  background: var(--canvas);
  border-radius: 0.55rem;
  cursor: pointer;
}

.check-field input {
  width: 1rem;
  height: 1rem;
  margin-top: 0.2rem;
  accent-color: var(--teal);
}

.check-field strong {
  display: block;
  color: var(--navy);
  font-size: 0.78rem;
}

.check-field small {
  margin-top: 0.15rem;
}

.form-actions {
  margin-top: 1.2rem;
}

.form-actions .button-primary {
  flex: 1;
}

.checker-actions .button-primary {
  flex-basis: 100%;
}

.contract-meta {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding: 0.75rem;
  background: var(--teal-pale);
  border: 1px solid var(--mint);
  border-radius: 0.55rem;
}

.contract-meta span,
.contract-meta strong {
  display: block;
}

.contract-meta span {
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
}

.contract-meta strong {
  margin-top: 0.1rem;
  color: var(--navy);
  font-size: 0.8rem;
}

.contract-meta code {
  color: #416168;
  font-size: 0.66rem;
  overflow-wrap: anywhere;
}

.contract-meta a {
  width: fit-content;
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 750;
}

.form-error {
  margin: 0.9rem 0;
  padding: 0.7rem 0.8rem;
  color: #7f2929;
  background: var(--red-pale);
  border: 1px solid #efc5bd;
  border-radius: 0.55rem;
  font-size: 0.8rem;
  font-weight: 650;
}

.operation-progress {
  display: grid;
  gap: 0.45rem;
  margin: 0.9rem 0;
  padding: 0.75rem;
  color: var(--navy);
  background: var(--teal-pale);
  border: 1px solid var(--mint);
  border-radius: 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.operation-progress progress {
  width: 100%;
  height: 0.65rem;
  accent-color: var(--teal);
}

.input-limit {
  margin: 0.85rem 0 0;
  color: #536970;
  font-size: 0.75rem;
  text-align: center;
}

.download-note {
  min-height: 1.1rem;
  margin: -0.45rem 0 0.8rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
  text-align: right;
}

.empty-state {
  display: grid;
  place-items: center;
  max-width: 460px;
  min-height: 390px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  margin-bottom: 1.2rem;
  color: var(--teal-dark);
  background: var(--teal-pale);
  border: 1px solid var(--mint);
  border-radius: 1.2rem;
  font-size: 1.65rem;
  font-weight: 700;
}

.empty-state h3 {
  margin-bottom: 0.5rem;
  font-size: 1.35rem;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.period-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin: 1rem 0;
}

.period-card {
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
}

.current-period {
  background: var(--teal-pale);
  border-color: var(--mint);
}

.comparison-period {
  background: var(--blue-pale);
  border-color: #cbdde4;
}

.period-card p {
  margin-bottom: 0.75rem;
  color: var(--ink-soft);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.period-card strong,
.period-card span {
  display: block;
}

.period-card strong {
  margin-bottom: 0.32rem;
  color: var(--navy);
  font-size: 1.03rem;
}

.period-card span {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.result-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}

.tall-table {
  max-height: 350px;
  overflow: auto;
}

.compact-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.compact-table th,
.compact-table td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.compact-table thead th {
  position: sticky;
  z-index: 1;
  top: 0;
  color: #52666d;
  background: #f7f9f8;
  font-size: 0.68rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.compact-table tbody th {
  color: var(--navy);
}

.compact-table tbody tr:last-child th,
.compact-table tbody tr:last-child td {
  border-bottom: 0;
}

.compact-table tbody tr:hover {
  background: #f8faf9;
}

.warning-box {
  margin-top: 0.9rem;
  padding: 0.8rem 0.9rem;
  color: #704014;
  background: var(--amber-pale);
  border: 1px solid #edc795;
  border-radius: 0.6rem;
  font-size: 0.78rem;
}

.warning-box strong {
  display: block;
  margin-bottom: 0.3rem;
}

.warning-box ul {
  margin: 0;
  padding-left: 1.2rem;
}

.result-actions {
  margin-top: 1rem;
}

.action-status {
  color: var(--teal-dark);
  font-size: 0.75rem;
  font-weight: 700;
}

.receipt-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem 1rem;
  align-items: center;
  margin-top: 1rem;
  padding: 0.9rem;
  background: var(--blue-pale);
  border: 1px solid #cbdde4;
  border-radius: 0.65rem;
}

.receipt-panel strong,
.receipt-panel span {
  display: block;
}

.receipt-panel strong {
  color: var(--navy);
  font-size: 0.8rem;
}

.receipt-panel > div span {
  margin-top: 0.2rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.receipt-panel .action-status {
  grid-column: 1 / -1;
}

.source-verification-panel {
  margin: 1rem 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.source-verification-panel h3 {
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.source-verification-panel > p {
  margin-bottom: 0.8rem;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.receipt-metrics strong {
  overflow-wrap: anywhere;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.receipt-check-panel,
.receipt-source-results {
  margin-top: 1.1rem;
  padding: 1rem;
  background: #fbfcfc;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
}

.receipt-check-panel .table-heading,
.receipt-source-results .table-heading {
  margin-bottom: 0.7rem;
}

.receipt-check-list {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.receipt-check-list li {
  position: relative;
  padding: 0.65rem 0.75rem 0.65rem 2rem;
  color: var(--ink-soft);
  background: white;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  font-size: 0.78rem;
}

.receipt-check-list li::before {
  position: absolute;
  top: 0.66rem;
  left: 0.7rem;
  font-weight: 900;
  content: "•";
}

.receipt-check-list .check-pass::before {
  color: var(--teal-dark);
  content: "✓";
}

.receipt-check-list .check-fail::before {
  color: var(--red);
  content: "×";
}

.receipt-check-list .check-info::before {
  color: var(--amber);
  content: "i";
}

.receipt-source-results .compact-table td:last-child {
  font-weight: 800;
}

.receipt-source-results .source-match {
  color: var(--teal-dark);
}

.receipt-source-results .source-mismatch {
  color: var(--red);
}

.receipt-source-results .source-unchecked {
  color: var(--amber);
}

.receipt-boundary-note {
  margin-top: 1.1rem;
}

.receipt-boundary-note p {
  margin-bottom: 0;
}

.table-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
  align-items: center;
}

.table-action-group .button {
  min-height: 2.5rem;
  padding: 0.55rem 0.7rem;
  font-size: 0.78rem;
}

.assumption-box {
  margin-top: 1.1rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.assumption-box summary {
  padding: 1rem 1.2rem;
  color: var(--navy);
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.assumption-box > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 0 1.2rem 1.1rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.assumption-box p {
  margin-bottom: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin: 1rem 0;
}

.metric-grid article {
  padding: 0.85rem;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}

.metric-grid span,
.metric-grid strong,
.metric-grid small {
  display: block;
}

.metric-grid span {
  min-height: 2.2em;
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 750;
}

.metric-grid strong {
  margin: 0.25rem 0 0.1rem;
  color: var(--navy);
  font-size: 1.65rem;
  letter-spacing: -0.04em;
}

.metric-grid small {
  color: #586d75;
  font-size: 0.75rem;
}

.schema-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.schema-grid article {
  padding: 0.95rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}

.schema-grid h3 {
  margin-bottom: 0.7rem;
  font-size: 0.88rem;
}

.schema-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
}

.schema-list div {
  display: flex;
  gap: 0.8rem;
  justify-content: space-between;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid #e6ecea;
}

.schema-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.schema-list dt,
.schema-list dd {
  font-size: 0.72rem;
}

.schema-list dt {
  color: var(--ink-soft);
}

.schema-list dd {
  max-width: 60%;
  margin: 0;
  color: var(--navy);
  font-weight: 750;
  text-align: right;
  overflow-wrap: anywhere;
}

.table-heading,
.chart-heading {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: end;
  margin: 1.1rem 0 0.55rem;
}

.table-heading h3,
.chart-heading h3 {
  margin-bottom: 0.12rem;
  font-size: 0.92rem;
}

.table-heading p,
.chart-heading p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.table-heading .artifact-warning {
  max-width: 520px;
  margin-top: 0.25rem;
  color: #7b4b12;
}

.change-table td:first-child {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
}

.status-label {
  display: inline-block;
  padding: 0.2rem 0.42rem;
  border-radius: 99px;
  font-size: 0.64rem;
  font-weight: 850;
  text-transform: uppercase;
}

.status-added {
  color: #15603f;
  background: #ddf3e8;
}

.status-removed {
  color: #8a3131;
  background: #fae5e2;
}

.status-changed {
  color: #7b4b12;
  background: #fff0d2;
}

.status-missing,
.status-unexpected,
.status-value {
  color: #7b3b16;
  background: #fff0d2;
}

.result-explanation {
  margin: 0.8rem 0 1.1rem;
  padding: 0.8rem 0.9rem;
  color: #455f68;
  background: var(--blue-pale);
  border-left: 3px solid #567d8e;
  border-radius: 0 0.55rem 0.55rem 0;
  font-size: 0.8rem;
}

.checker-diagnostics td:nth-child(2),
.checker-diagnostics td:nth-child(4),
.checker-diagnostics td:nth-child(5) {
  overflow-wrap: anywhere;
}

.checker-diagnostics td:nth-child(2) {
  min-width: 180px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
}

.case-context-panel {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 2rem;
  margin-top: 1.1rem;
  padding: 1.4rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.case-context-heading h2 {
  margin: 0.25rem 0 0.45rem;
  font-size: 1.3rem;
}

.case-context-heading > p:last-child,
.case-context-grid p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.case-context-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.case-context-grid article {
  padding: 0.9rem;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}

.case-context-grid h3 {
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
}

.tutorial-box ol {
  margin: 0;
  padding-left: 1.2rem;
}

.tutorial-box li {
  margin-bottom: 0.35rem;
}

.capacity-grid {
  grid-template-columns: minmax(310px, 380px) minmax(0, 1fr);
}

.status-pill {
  display: inline-block;
  padding: 0.35rem 0.6rem;
  color: var(--ink-soft);
  background: var(--canvas);
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 850;
}

.status-pill.on-track {
  color: #155d42;
  background: #ddf3e8;
}

.status-pill.off-track {
  color: #863d18;
  background: var(--amber-pale);
}

.chart-panel {
  margin-top: 0.5rem;
  padding: 0.85rem;
  background: #fbfcfc;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
}

.chart-heading {
  margin: 0 0 0.3rem;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.chart-legend span::before {
  display: inline-block;
  width: 0.7rem;
  height: 3px;
  margin-right: 0.3rem;
  vertical-align: middle;
  background: currentcolor;
  content: "";
}

.legend-current {
  color: #b45309;
}

.chart-legend .legend-current::before {
  height: 0;
  background: none;
  border-top: 3px dashed currentcolor;
}

.legend-plan {
  color: var(--teal);
}

.legend-target {
  color: #61757d;
}

#capacity-chart {
  display: block;
  width: 100%;
  min-height: 220px;
  overflow: visible;
}

.noscript-message {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  z-index: 50;
  padding: 1rem;
  color: white;
  background: var(--red);
  border-radius: var(--radius-sm);
  text-align: center;
}

.site-footer {
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  align-items: center;
  min-height: 92px;
  padding: 1.4rem max(1rem, calc((100vw - var(--content)) / 2));
  color: #afc2c8;
  background: var(--navy);
}

.site-footer strong,
.site-footer > div:first-child span {
  display: block;
}

.site-footer strong {
  color: white;
  font-size: 0.86rem;
}

.site-footer > div:first-child span {
  margin-top: 0.2rem;
  font-size: 0.72rem;
}

.footer-links {
  display: flex;
  gap: 1rem;
  align-items: center;
  font-size: 0.74rem;
}

.footer-links a {
  color: #d7e4e7;
}

.footer-feedback-boundary {
  max-width: 390px;
  margin: 0;
  color: #afc2c8;
  font-size: 0.7rem;
  line-height: 1.45;
}

@media (max-width: 960px) {
  .header-inner {
    grid-template-columns: 1fr auto;
  }

  .primary-nav {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-content: center;
    margin-bottom: 0.6rem;
  }

  .site-header {
    position: static;
  }

  .header-repo-link {
    grid-column: 2;
    grid-row: 1;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-block: 5rem;
  }

  .hero-proof {
    max-width: 520px;
    transform: none;
  }

  .tool-card-grid {
    grid-template-columns: 1fr 1fr;
  }

  .workspace-grid,
  .capacity-grid {
    grid-template-columns: 1fr;
  }

  .input-panel {
    position: static;
  }

  .result-panel {
    min-height: 0;
  }
}

@media (max-width: 720px) {
  html {
    scroll-behavior: auto;
  }

  .header-inner {
    gap: 0.7rem;
    width: min(var(--content), calc(100% - 1.2rem));
    padding-top: 0.6rem;
  }

  .brand strong {
    font-size: 0.8rem;
  }

  .brand small {
    display: none;
  }

  .header-repo-link {
    padding: 0.48rem 0.58rem;
    font-size: 0.73rem;
  }

  .primary-nav {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.12rem;
  }

  .primary-nav a {
    flex: 1 1 calc(33.333% - 0.12rem);
    min-width: 0;
    padding: 0.44rem 0.28rem;
    font-size: 0.7rem;
    text-align: center;
  }

  .page {
    width: min(var(--content), calc(100% - 1.2rem));
    padding-block: 2.7rem 4rem;
  }

  .overview-page > :not(.hero) {
    width: min(var(--content), calc(100% - 1.2rem));
  }

  .hero {
    gap: 3rem;
    padding-block: 4rem;
  }

  .hero h1 {
    font-size: clamp(2.4rem, 13vw, 3.7rem);
  }

  .hero-proof {
    padding: 0.75rem;
  }

  .tool-intro,
  .tool-page-header,
  .boundary-panel,
  .receipt-utility-card {
    grid-template-columns: 1fr;
    gap: 1.3rem;
  }

  .tool-intro {
    margin-top: 3.8rem;
  }

  .tool-card-grid {
    grid-template-columns: 1fr;
  }

  .tool-card {
    min-height: 380px;
  }

  .boundary-panel {
    padding: 1.5rem;
  }

  .receipt-utility-card .button {
    width: fit-content;
  }

  .tool-page-header {
    align-items: start;
  }

  .field-pair,
  .period-grid,
  .schema-grid,
  .case-context-panel,
  .case-context-grid,
  .assumption-box > div {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .result-heading,
  .table-heading,
  .chart-heading {
    align-items: flex-start;
  }

  .result-context {
    max-width: 130px;
  }

  .chart-heading {
    flex-direction: column;
  }

  .table-action-group {
    justify-content: flex-start;
  }

  .chart-legend {
    justify-content: flex-start;
  }

  #capacity-chart {
    min-height: 180px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 430px) {
  .brand-mark {
    width: 2.1rem;
    height: 2.1rem;
  }

  .brand strong {
    max-width: 130px;
  }

  .hero-actions .button,
  .form-actions .button {
    width: 100%;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .result-panel,
  .input-panel {
    padding: 1rem;
  }

  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .receipt-panel {
    grid-template-columns: 1fr;
  }

  .receipt-utility-card .button {
    width: 100%;
  }

  .receipt-panel .action-status {
    grid-column: auto;
  }

  .table-action-group {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }
}

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

@media print {
  .site-header,
  .site-footer,
  .input-panel,
  .result-actions,
  .receipt-panel,
  .table-action-group,
  .button,
  .assumption-box:not([open]) {
    display: none !important;
  }

  body,
  .result-panel,
  .chart-panel {
    background: white;
  }

  .page {
    width: 100%;
    padding: 0;
  }

  .workspace-grid {
    display: block;
  }

  .result-panel {
    border: 0;
    box-shadow: none;
  }
}
