:root {
  --ink: #1a2420;
  --ink-soft: #3c4741;
  --paper: #f3efe4;
  --paper-deep: #e7e1d1;
  --card: #fbf8f1;
  --line: #d3cbb8;
  --pine: #1f4d3a;
  --pine-deep: #143528;
  --copper: #7a3c1a;
  --copper-bright: #9a4e24;
  --danger: #8c2f2f;
  --danger-bg: #f8ece6;
  --warn-bg: #f6edd8;
  --ok-bg: #e7f0ea;
  --unknown-bg: #eceae4;
  --shadow: 0 1px 0 rgba(26, 36, 32, 0.04);
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  --wrap: 1120px;
  --space: 1.25rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}

body::before {
  content: "";
  display: block;
  height: 8px;
  background: linear-gradient(90deg, var(--pine) 0 72%, var(--copper-bright) 72% 100%);
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: white;
  padding: 0.6rem 0.9rem;
  z-index: 10;
}

.skip:focus {
  top: 0.75rem;
}

:focus-visible {
  outline: 3px solid var(--copper-bright);
  outline-offset: 2px;
}

a {
  color: var(--pine);
  text-underline-offset: 0.16em;
}

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

img {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.wrap {
  width: min(var(--wrap), calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(243, 239, 228, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
  width: min(var(--wrap), calc(100% - 2rem));
  margin-inline: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 2.1rem;
  height: 2.1rem;
  background:
    linear-gradient(var(--copper-bright), var(--copper-bright)) center 62% / 70% 3px no-repeat,
    var(--pine);
  flex: none;
}

.brand-name {
  display: block;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.brand-tag {
  display: block;
  color: var(--ink-soft);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-toggle {
  display: none;
  min-height: 2.75rem;
  padding: 0.4rem 0.8rem;
  background: transparent;
  border: 1px solid var(--pine);
  color: var(--pine);
  font: inherit;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.98rem;
}

.site-nav a[aria-current="page"] {
  color: var(--pine);
  box-shadow: inset 0 -2px 0 var(--copper-bright);
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 2.5rem;
  align-items: end;
  padding: 3.2rem 0 2.2rem;
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--copper);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.3rem, 5vw, 4.1rem);
}

h2 {
  margin: 0 0 0.8rem;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
}

h3 {
  margin: 0 0 0.45rem;
  font-size: 1.35rem;
}

.lede {
  font-size: 1.2rem;
  color: var(--ink-soft);
  max-width: 42rem;
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

.button,
button,
input,
select,
textarea {
  font: inherit;
}

.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--pine);
  background: var(--pine);
  color: #f7f4ec;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary,
button.secondary {
  background: transparent;
  color: var(--pine-deep);
}

.button:hover,
button.button:hover {
  background: var(--pine-deep);
  color: white;
}

.button.secondary:hover,
button.secondary:hover {
  background: var(--pine);
  color: white;
}

.source-card,
.panel,
.tool-card,
.product-card,
.note,
.result-card {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.source-card {
  padding: 1.2rem 1.2rem 1rem;
}

.source-card p {
  margin: 0.35rem 0;
}

.kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--copper);
}

.section {
  padding: 1.2rem 0 2.4rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.grid-3,
.grid-2 {
  display: grid;
  gap: 1rem;
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-2 {
  grid-template-columns: 1.2fr 0.8fr;
}

.tool-card,
.product-card,
.panel {
  padding: 1.15rem 1.15rem 1.2rem;
}

.tool-card ol,
.product-card ul,
.panel ul,
.panel ol {
  margin: 0.4rem 0 0;
  padding-left: 1.15rem;
}

.index-num {
  font-family: var(--serif);
  color: var(--copper);
  font-size: 1.4rem;
}

.rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0.5rem 0 1.5rem;
}

.chip {
  display: inline-block;
  margin: 0 0.35rem 0.35rem 0;
  padding: 0.12rem 0.45rem;
  border: 1px solid currentColor;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
}

.chip-verified {
  color: var(--pine);
  background: var(--ok-bg);
}

.chip-plan {
  color: #5c3b08;
  background: var(--warn-bg);
}

.chip-claim {
  color: var(--copper);
  background: #f8efe8;
  border-style: dashed;
}

.chip-unknown {
  color: #33404a;
  background: var(--unknown-bg);
  border-style: dashed;
}

.compare-block {
  margin: 0 0 1.6rem;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}

.compare-grid article {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 1rem;
}

.compare-grid p:last-child,
.tool-card p:last-child,
.product-card p:last-child {
  margin-bottom: 0;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--card);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 0.98rem;
}

caption {
  caption-side: bottom;
  padding: 0.7rem 0.8rem 0.85rem;
  text-align: left;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

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

th {
  background: var(--paper-deep);
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.callout {
  border-left: 4px solid var(--copper-bright);
  background: #f8f3e8;
  padding: 0.9rem 1rem;
  margin: 1rem 0;
}

.callout strong {
  font-family: var(--serif);
}

.site-footer {
  margin-top: 2rem;
  padding: 1.6rem 0 2rem;
  background: var(--pine-deep);
  color: #efe8da;
}

.site-footer a {
  color: #f4e2cf;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1rem;
}

.footer-brand {
  margin: 0 0 0.35rem;
  font-family: var(--serif);
  font-size: 1.25rem;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li {
  margin: 0.25rem 0;
}

.footer-meta {
  width: min(var(--wrap), calc(100% - 2rem));
  margin: 1rem auto 0;
  color: #d9d0c0;
  font-size: 0.92rem;
}

form {
  display: grid;
  gap: 1rem;
}

fieldset {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--card);
}

legend {
  padding: 0 0.35rem;
  font-family: var(--serif);
  font-size: 1.25rem;
}

.fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.field.wide,
.span-2 {
  grid-column: 1 / -1;
}

label,
.field-label {
  font-weight: 650;
}

.hint,
.field-error,
.meta {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.field-error:empty {
  display: none;
}

.field-error {
  color: var(--danger);
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--danger);
  background: var(--danger-bg);
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.8rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid #b7ad98;
  background: white;
  color: var(--ink);
}

input[type="radio"],
input[type="checkbox"] {
  width: 1.15rem;
  min-width: 1.15rem;
  min-height: 1.15rem;
  margin-top: 0.28rem;
  accent-color: var(--pine);
}

fieldset .field > label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  min-height: 2.5rem;
  font-weight: 550;
}

textarea {
  min-height: 7rem;
  resize: vertical;
}

.summary-preview,
.results {
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.45;
  background: #221f1a;
  color: #f4efe4;
  padding: 1rem;
  overflow: auto;
  max-height: 36rem;
}

.results {
  white-space: normal;
  font-family: var(--sans);
  font-size: 1rem;
  background: var(--card);
  color: var(--ink);
  padding: 0;
}

.result-card {
  padding: 1rem;
  margin-bottom: 0.8rem;
}

.result-card.lowest {
  border-color: var(--pine);
  box-shadow: inset 4px 0 0 var(--pine);
}

.bar {
  height: 0.55rem;
  background: var(--paper-deep);
  margin: 0.6rem 0;
}

.bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--copper-bright);
}

.bar span[data-level="1"] { width: 10%; }
.bar span[data-level="2"] { width: 20%; }
.bar span[data-level="3"] { width: 30%; }
.bar span[data-level="4"] { width: 40%; }
.bar span[data-level="5"] { width: 50%; }
.bar span[data-level="6"] { width: 60%; }
.bar span[data-level="7"] { width: 70%; }
.bar span[data-level="8"] { width: 80%; }
.bar span[data-level="9"] { width: 90%; }
.bar span[data-level="10"] { width: 100%; }

.formula {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
}

.alert {
  padding: 0.8rem 0.9rem;
  background: var(--danger-bg);
  border: 1px solid #e2c2b6;
}

.alert:empty,
.notice:empty {
  display: none;
}

.notice {
  padding: 0.75rem 0.9rem;
  background: var(--warn-bg);
  border: 1px solid #e4d3a4;
}

.noscript {
  padding: 0.8rem 1rem;
  background: var(--warn-bg);
  border: 1px solid #e4d3a4;
}

.page-intro {
  padding: 2.2rem 0 0.4rem;
}

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.9rem;
  padding: 0;
  margin: 0 0 1rem;
  list-style: none;
}

.small {
  font-size: 0.92rem;
  color: var(--ink-soft);
}

dl.facts {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 0.35rem 0.8rem;
  margin: 0;
}

dl.facts dt {
  color: var(--ink-soft);
}

dl.facts dd {
  margin: 0;
}

@media (max-width: 860px) {
  .hero,
  .grid-3,
  .grid-2,
  .compare-grid,
  .footer-grid,
  .fields {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 0.4rem 1rem 0.9rem;
  }

  .site-nav.is-open {
    display: block;
  }

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

  .site-nav a {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
  }

  dl.facts {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media print {
  body::before,
  .site-header,
  .site-footer,
  .button-row,
  .nav-toggle,
  .no-print {
    display: none !important;
  }

  body,
  .source-card,
  .panel,
  .tool-card,
  .summary-preview {
    background: white;
    color: black;
  }

  .summary-preview {
    max-height: none;
    overflow: visible;
  }

  a {
    color: black;
  }
}
