/* ==========================================================================
   CraftQuote — stylesheet
   Warm paper, ink and terracotta. Numbers stay tabular so they can be read
   from across a workbench.
   ========================================================================== */

:root {
  --paper: #f6f1e8;
  --paper-deep: #efe7d9;
  --card: #fffdf9;
  --ink: #1a1713;
  --ink-soft: #3b342c;
  --muted: #6f6456;
  --line: #e3d9c8;
  --line-strong: #d3c6b0;
  --accent: #b8481d;
  --accent-deep: #96370f;
  --accent-soft: #f8e4d9;
  --green: #2c6647;
  --green-soft: #e2efe6;
  --amber: #8f5d0f;
  --amber-soft: #fbeed3;
  --shadow-sm: 0 1px 2px rgba(38, 28, 16, 0.06), 0 2px 8px rgba(38, 28, 16, 0.04);
  --shadow-md: 0 2px 6px rgba(38, 28, 16, 0.06), 0 18px 40px -16px rgba(38, 28, 16, 0.22);
  --radius: 18px;
  --radius-sm: 11px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 82% -8%, rgba(184, 72, 29, 0.07), transparent 65%),
    radial-gradient(900px 460px at 4% 4%, rgba(44, 102, 71, 0.05), transparent 60%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

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

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 50;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 12px;
}

/* Keyboard focus: one visible ring everywhere that is not a text input
   (inputs show their own accent border + glow). Never remove the ring
   without replacing it. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 2px;
}

.btn:focus-visible {
  outline-offset: 3px;
}

@media (forced-colors: active) {
  a:focus-visible,
  button:focus-visible,
  summary:focus-visible,
  select:focus-visible {
    outline: 3px solid Highlight;
  }
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(16px, 4vw, 44px);
  background: rgba(246, 241, 232, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(211, 198, 176, 0.6);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 38px;
  height: 38px;
  color: var(--accent);
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
  font-size: 14.5px;
}

.site-nav a,
.linkish {
  color: var(--ink-soft);
  text-decoration: none;
  background: none;
  border: 0;
  padding: 4px 0;
  cursor: pointer;
  position: relative;
}

.site-nav a:hover,
.linkish:hover {
  color: var(--accent-deep);
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.site-nav a:hover::after {
  transform: scaleX(1);
}

.pill {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--paper-deep);
  border: 1px solid var(--line-strong);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.tier-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}

.tier-badge.is-pro {
  border-color: rgba(44, 102, 71, 0.35);
  background: var(--green-soft);
  color: var(--green);
}

.tier-badge.is-pro::before {
  background: var(--green);
}

.license-status {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.01em;
  max-width: 190px;
  line-height: 1.3;
}

.license-status[hidden] {
  display: none;
}

/* `hidden` must win over the grid layout the field class sets. */
.field[hidden] {
  display: none;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 12px 22px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-sm {
  padding: 8px 15px;
  font-size: 13.5px;
}

.btn-primary {
  background: var(--accent);
  color: #fff9f4;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 8px 18px -10px rgba(150, 55, 15, 0.9);
}

.btn-primary:hover {
  background: var(--accent-deep);
}

.btn-ink {
  background: var(--ink);
  color: #fbf7f1;
}

.btn-ink:hover {
  background: #000;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

.btn-ghost:hover {
  border-color: var(--ink-soft);
  background: rgba(255, 253, 249, 0.7);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.lock {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--amber-soft);
  color: var(--amber);
}

.lock.is-unlocked {
  display: none;
}

/* ---------- intro ---------- */

main {
  width: min(1180px, 100% - clamp(28px, 6vw, 80px));
  margin: 0 auto;
  padding-bottom: 72px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding: clamp(36px, 6vw, 76px) 0 clamp(24px, 3vw, 40px);
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.intro h1 {
  font-size: clamp(38px, 5.6vw, 66px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.intro h1 em {
  font-style: italic;
  color: var(--accent);
}

.lede {
  margin-top: 18px;
  max-width: 54ch;
  color: var(--ink-soft);
  font-size: clamp(15.5px, 1.5vw, 17.5px);
}

.intro-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
}

.intro-chips li {
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 253, 249, 0.65);
  color: var(--ink-soft);
}

.intro-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  box-shadow: var(--shadow-md);
  transform: rotate(-1.4deg);
  margin: 0;
}

.mini-label {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line-strong);
  margin-bottom: 12px;
}

.mini-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  font-size: 14px;
  color: var(--muted);
}

.mini-row strong {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.mini-row .accent {
  color: var(--accent);
}

.mini-bar {
  display: flex;
  gap: 3px;
  height: 8px;
  margin: 14px 0 10px;
}

.mini-bar span {
  border-radius: 99px;
  background: var(--ink);
  opacity: 0.16;
}

.mini-bar span:nth-child(2) {
  background: var(--accent);
  opacity: 0.85;
}

.mini-bar span:nth-child(3) {
  background: var(--green);
  opacity: 0.75;
}

.intro-card figcaption {
  font-size: 12px;
  color: var(--muted);
}

/* ---------- workspace ---------- */

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  gap: clamp(18px, 2.4vw, 30px);
  align-items: start;
}

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

.panel {
  padding: clamp(20px, 2.6vw, 30px);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.panel-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.panel-head h3,
.result-head h3 {
  font-size: 23px;
}

.subhead {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.craft-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 6px;
  border: 0;
  padding: 4px;
  margin: 20px 0 10px;
  background: var(--paper-deep);
  border-radius: 14px;
}

.craft-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 11px 4px 9px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.craft-icon {
  font-size: 17px;
  line-height: 1;
  color: var(--accent);
  opacity: 0.75;
}

.craft-tab:hover {
  color: var(--ink);
}

.craft-tab.is-active {
  background: var(--card);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.craft-blurb {
  font-size: 13px;
  color: var(--muted);
  min-height: 20px;
  margin-bottom: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

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

.label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  display: flex;
  align-items: baseline;
  gap: 5px;
  justify-content: space-between;
}

.hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 11.5px;
}

.input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 0 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184, 72, 29, 0.13);
}

.input-wrap .prefix,
.input-wrap .suffix {
  color: var(--muted);
  font-size: 12.5px;
  flex: none;
}

.input-wrap .prefix {
  margin-right: 2px;
}

.input-wrap .suffix {
  margin-left: 2px;
}

input[type="number"],
input[type="text"],
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 10px 12px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-wrap input {
  border: 0;
  background: transparent;
  padding: 10px 4px;
  box-shadow: none;
  font-weight: 600;
}

.input-wrap input:focus {
  outline: none;
  box-shadow: none;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% + 1px), calc(100% - 13px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
  cursor: pointer;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184, 72, 29, 0.13);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 26px;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent) var(--fill, 45%), var(--paper-deep) var(--fill, 45%));
  border: 1px solid var(--line-strong);
}

input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 99px;
  background: var(--paper-deep);
  border: 1px solid var(--line-strong);
}

input[type="range"]::-moz-range-progress {
  height: 6px;
  border-radius: 99px;
  background: var(--accent);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--accent);
  box-shadow: var(--shadow-sm);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--accent);
}

.range-scale {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}

.margin-value {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-size: 13.5px;
}

.advanced {
  margin-top: 18px;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}

.advanced summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
}

.advanced summary::-webkit-details-marker {
  display: none;
}

.advanced summary::before {
  content: "+ ";
  color: var(--accent);
}

.advanced[open] summary::before {
  content: "− ";
}

.advanced .form-grid {
  margin-top: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* brand block (Pro) */

.brand-block {
  margin-top: 22px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: rgba(246, 241, 232, 0.5);
}

.brand-block-head {
  margin-bottom: 12px;
}

.brand-block-head .label {
  justify-content: flex-start;
  gap: 8px;
  font-size: 13px;
}

.brand-block input[type="file"] {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 7px 10px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
}

.brand-block input:disabled {
  background: var(--paper-deep);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.8;
}

input[type="date"] {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 9px 12px;
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}

/* ---------- results ---------- */

.results {
  position: sticky;
  top: 82px;
}

.result-card {
  padding: clamp(20px, 2.4vw, 26px);
  background:
    linear-gradient(180deg, rgba(255, 253, 249, 1), rgba(253, 248, 240, 1));
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.result-head {
  display: block;
}

.kpi-hero {
  margin: 18px 0 4px;
  padding: 20px 20px 18px;
  border-radius: 14px;
  background:
    radial-gradient(420px 120px at 100% 0%, rgba(184, 72, 29, 0.16), transparent 70%),
    var(--paper-deep);
  border: 1px solid var(--line-strong);
}

.kpi-hero-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.kpi-hero-value {
  font-family: var(--serif);
  font-size: clamp(40px, 5vw, 54px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  margin: 4px 0 2px;
}

.kpi-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.kpi {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 11px 13px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kpi-label {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.kpi strong {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.kpi-note {
  font-size: 11px;
  color: var(--muted);
}

.cost-mix {
  display: flex;
  gap: 2px;
  height: 9px;
  margin: 18px 0 6px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--paper-deep);
}

.cost-mix span {
  display: block;
  height: 100%;
}

.mix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.mix-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 5px;
}

.breakdown {
  margin-top: 8px;
  border-top: 1px dashed var(--line-strong);
  padding-top: 10px;
}

.breakdown summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  list-style: none;
}

.breakdown summary::-webkit-details-marker {
  display: none;
}

.breakdown summary::after {
  content: " ▾";
  color: var(--muted);
}

.breakdown[open] summary::after {
  content: " ▴";
}

.breakdown-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  font-size: 13px;
}

.breakdown-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(227, 217, 200, 0.6);
  font-variant-numeric: tabular-nums;
}

.breakdown-list li:last-child {
  border-bottom: 0;
}

.breakdown-list li span:first-child {
  color: var(--muted);
}

.breakdown-list li span:last-child {
  font-weight: 600;
}

.breakdown-list li.is-total {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 0;
}

.breakdown-list li.is-total span {
  color: var(--ink);
  font-weight: 700;
}

.warnings {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.warnings li {
  font-size: 12px;
  line-height: 1.45;
  padding: 8px 11px;
  border-radius: 9px;
  background: var(--amber-soft);
  color: #6d4808;
  border: 1px solid rgba(154, 102, 18, 0.18);
}

.warnings li::before {
  content: "!";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  margin-right: 7px;
  border-radius: 50%;
  background: rgba(154, 102, 18, 0.16);
  font-size: 10px;
  font-weight: 800;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.result-actions .btn {
  flex: 1 1 auto;
  padding: 11px 14px;
  font-size: 13.5px;
}

.quota-line {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--muted);
}

.quota-line.is-warning {
  color: var(--amber);
  font-weight: 600;
}

/* ---------- band / how ---------- */

.band {
  margin-top: clamp(48px, 7vw, 88px);
  background: var(--ink);
  color: #f4ede2;
  border-radius: 24px;
  padding: clamp(28px, 4vw, 52px);
}

.band h2 {
  font-size: clamp(26px, 3.4vw, 36px);
  color: #fbf6ee;
  margin-bottom: 26px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}

.steps li {
  border-top: 1px solid rgba(244, 237, 226, 0.22);
  padding-top: 16px;
}

.step-no {
  font-family: var(--mono);
  font-size: 12px;
  color: #e3a183;
  letter-spacing: 0.08em;
}

.steps h3 {
  font-size: 19px;
  margin: 6px 0 8px;
  color: #fbf6ee;
}

.steps p {
  font-size: 14px;
  color: rgba(244, 237, 226, 0.74);
}

/* ---------- pricing ---------- */

.pricing {
  margin-top: clamp(48px, 7vw, 88px);
}

.pricing-head {
  max-width: 62ch;
  margin-bottom: 26px;
}

.pricing-head h2 {
  font-size: clamp(28px, 3.6vw, 40px);
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.plan {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.plan h3 {
  font-size: 22px;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--muted);
}

.plan-price strong {
  font-family: var(--serif);
  font-size: 44px;
  color: var(--ink);
  letter-spacing: -0.03em;
}

.plan ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-soft);
}

.plan ul li::before {
  content: "✓";
  color: var(--green);
  font-weight: 700;
  margin-right: 8px;
}

.plan .btn {
  margin-top: auto;
}

.plan-pro {
  border-color: var(--ink);
  box-shadow: var(--shadow-md);
  background:
    radial-gradient(600px 200px at 100% 0%, rgba(184, 72, 29, 0.1), transparent 65%),
    var(--card);
}

.plan-flag {
  position: absolute;
  top: -12px;
  right: 22px;
  background: var(--accent);
  color: #fff8f3;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
}

/* ---------- value proof strip ---------- */

.proof-strip {
  width: min(1180px, 100% - clamp(28px, 6vw, 80px));
  margin: clamp(18px, 3vw, 30px) auto 0;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.proof-cell {
  flex: 1 1 220px;
  background: var(--card);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.proof-num {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.2;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.proof-per {
  font-size: 14px;
  color: var(--muted);
}

.proof-label {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.proof-cta {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
}

.proof-cta:hover,
.proof-cta:focus-visible {
  background: var(--accent-deep);
}

/* ---------- disclaimer / privacy ---------- */

.compliance-note {
  border-top: 1px solid var(--line);
  background: var(--paper-deep);
}

.compliance-inner {
  width: min(1180px, 100% - clamp(28px, 6vw, 80px));
  margin: 0 auto;
  padding: clamp(22px, 4vw, 34px) 0;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 18px clamp(22px, 5vw, 56px);
  font-size: 13px;
  color: var(--ink-soft);
}

.compliance-inner h2 {
  font-size: 19px;
  margin: 2px 0 6px;
}

.compliance-inner p {
  margin-top: 4px;
}

#disclaimer-checked {
  white-space: nowrap;
}

.inline-link {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-links a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 820px) {
  .compliance-inner {
    grid-template-columns: 1fr;
  }

  .proof-cta {
    flex-basis: 100%;
    justify-content: center;
  }
}

/* ---------- document page (terms / privacy) ---------- */

.doc-page {
  width: min(760px, 100% - clamp(28px, 6vw, 80px));
  margin: 0 auto;
  padding: clamp(26px, 5vw, 52px) 0 clamp(40px, 6vw, 70px);
}

.doc-page h1 {
  font-size: clamp(28px, 4.4vw, 38px);
  line-height: 1.15;
  margin: 4px 0 10px;
}

.doc-page .lede {
  font-size: 16.5px;
  color: var(--ink-soft);
  max-width: 62ch;
}

.doc-page section {
  margin-top: clamp(22px, 3.6vw, 32px);
  padding-top: clamp(16px, 2.6vw, 22px);
  border-top: 1px solid var(--line);
}

.doc-page h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.doc-page p,
.doc-page li {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.doc-page p + p {
  margin-top: 9px;
}

.doc-page ul {
  margin: 9px 0 0;
  padding-left: 20px;
}

.doc-page li + li {
  margin-top: 6px;
}

.doc-page code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--paper-deep);
  padding: 1px 5px;
  border-radius: 5px;
}

.doc-foot {
  margin-top: clamp(26px, 4vw, 38px);
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.doc-foot a {
  color: var(--accent-deep);
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.55);
}

.footer-inner {
  width: min(1180px, 100% - clamp(28px, 6vw, 80px));
  margin: 0 auto;
  padding: 22px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  font-size: 12.5px;
  color: var(--muted);
}

.footer-meta {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
}

/* ---------- dialogs ---------- */

.dialog {
  border: 0;
  padding: 0;
  border-radius: 20px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 30px 90px -30px rgba(20, 14, 6, 0.6);
  max-height: min(92vh, 980px);
  width: min(720px, calc(100vw - 28px));
}

.dialog::backdrop {
  background: rgba(26, 23, 19, 0.5);
  backdrop-filter: blur(3px);
}

.dialog-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  z-index: 2;
}

.dialog-bar h2 {
  font-size: 20px;
}

.dialog-bar-actions {
  display: flex;
  gap: 8px;
}

.dialog-body {
  padding: 20px;
}

.dialog-sheet {
  width: min(880px, calc(100vw - 20px));
}

.dialog-saved {
  width: min(760px, calc(100vw - 20px));
}

.dialog-tiers {
  width: min(820px, calc(100vw - 20px));
}

.dialog-message {
  width: min(680px, calc(100vw - 20px));
}

.message-preview {
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  resize: vertical;
  min-height: 240px;
}

.sheet-scroll {
  padding: 18px;
  background: var(--paper-deep);
  max-height: calc(92vh - 68px);
  overflow: auto;
  border-radius: 0 0 20px 20px;
}

.pro-list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 14.5px;
}

.pro-list li::before {
  content: "✓";
  color: var(--green);
  font-weight: 700;
  margin-right: 9px;
}

.buy-line {
  padding: 16px;
  border-radius: 14px;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  display: grid;
  gap: 10px;
  justify-items: start;
}

.micro {
  font-size: 12.5px;
  color: var(--muted);
}

.license-form {
  margin-top: 20px;
  display: grid;
  gap: 12px;
  justify-items: start;
}

.license-form .field {
  width: 100%;
}

.license-form .input-wrap input {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  font-weight: 500;
}

.form-note {
  font-size: 12px;
  color: var(--muted);
}

.form-error {
  min-height: 18px;
  font-size: 12.5px;
  color: var(--accent-deep);
  font-weight: 600;
  margin-top: 8px;
}

.saved-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.tier-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
}

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

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

.tier-table thead th {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.tier-table th.num,
.tier-table td.num {
  text-align: right;
}

.tier-table tbody th {
  font-weight: 600;
}

.tier-table .masked {
  color: var(--line-strong);
  letter-spacing: 0.12em;
}

#tier-warnings {
  margin-top: 12px;
}

.history-lock,
.lock-banner {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--amber);
  border-radius: 12px;
  background: var(--amber-soft);
  margin-bottom: 6px;
}

.history-lock[hidden],
.lock-banner[hidden] {
  display: none;
}

.history-lock strong,
.lock-banner strong {
  font-size: 14px;
}

.history-lock p,
.lock-banner p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.history-head {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 52px 84px auto;
  gap: 10px;
  margin-top: 16px;
  padding: 0 14px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.saved-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 52px 84px auto;
  grid-template-areas: "date main qty total actions";
  gap: 4px 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.saved-date {
  grid-area: date;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.saved-main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.saved-qty {
  grid-area: qty;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.saved-qty em {
  font-style: normal;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 2px;
}

.saved-total {
  grid-area: total;
  text-align: right;
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.saved-title {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-meta {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.saved-actions {
  grid-area: actions;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill.is-pro {
  background: var(--green-soft);
  border-color: #bcd6c4;
  color: var(--green);
  font-weight: 700;
}

.icon-btn.is-clone {
  border-color: var(--green);
  color: var(--green);
}

.icon-btn .lock {
  display: none;
}

.icon-btn.is-locked {
  border-color: var(--line-strong);
  color: var(--muted);
  border-style: dashed;
}

.icon-btn.is-locked .lock {
  display: inline-block;
  margin-left: 4px;
}

.icon-btn.is-clone:not(.is-locked):hover {
  background: var(--green-soft);
}

.icon-btn {
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 9px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  color: var(--ink-soft);
}

.icon-btn:hover {
  border-color: var(--ink-soft);
}

.icon-btn.is-danger:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
}

.empty-state {
  padding: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  margin-top: 14px;
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: #fbf6ee;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 60;
  max-width: min(90vw, 520px);
  text-align: center;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- quote sheet ---------- */

.sheet {
  background: #fff;
  color: #16130f;
  border-radius: 6px;
  padding: 34px 36px 30px;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(20, 14, 6, 0.14);
  max-width: 760px;
  margin: 0 auto;
}

/* Theme + accent: the wrapper carries --sheet-accent / --sheet-accent-ink from
   app.js (normaliseBrandColor + brandInkFor). Defaults keep a sheet readable
   even if the variables are missing. */
.sheet-inner {
  --sheet-accent: #16130f;
  --sheet-accent-ink: #ffffff;
}

.sheet-inner .sheet-brand-name {
  display: inline-block;
  border-bottom: 2px solid var(--sheet-accent);
  padding-bottom: 2px;
  line-height: 1.15;
}

.sheet-inner .sheet-totals div.grand {
  border-top-color: var(--sheet-accent);
}

/* Classic: a thin accent rule under the header, everything else stays quiet. */
.sheet-inner.sheet--classic .sheet-head {
  border-bottom-color: var(--sheet-accent);
}

/* Modern: accent banner behind the table head and a coloured quote title. */
.sheet-inner.sheet--modern .sheet-head {
  border-bottom: 3px solid var(--sheet-accent);
}

.sheet-inner.sheet--modern .sheet-title h2 {
  color: var(--sheet-accent);
  letter-spacing: 0.04em;
}

.sheet-inner.sheet--modern .sheet-table th {
  background: var(--sheet-accent);
  color: var(--sheet-accent-ink);
  border-bottom-color: var(--sheet-accent);
}

/* The filled header needs breathing room, so the modern table is pulled out by
   the same padding — first and last columns stay aligned with the sheet edges. */
.sheet-inner.sheet--modern .sheet-table {
  width: calc(100% + 20px);
  margin: 18px -10px 14px;
}

.sheet-inner.sheet--modern .sheet-table th {
  padding: 8px 10px;
}

.sheet-inner.sheet--modern .sheet-table td {
  padding: 10px;
}

.sheet-inner.sheet--modern .sheet-block-label {
  color: var(--sheet-accent);
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 2px solid #16130f;
}

.sheet-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sheet-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid #e5e0d8;
  background: #fff;
}

.sheet-brand-name {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sheet-brand-line {
  font-size: 12px;
  color: #6a6257;
}

.sheet-title {
  text-align: right;
}

.sheet-title h2 {
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0;
}

.sheet-ref {
  font-family: var(--mono);
  font-size: 11.5px;
  color: #6a6257;
  margin-top: 4px;
}

.sheet-meta {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid #e5e0d8;
}

.sheet-block-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8b8174;
  margin-bottom: 5px;
  font-weight: 700;
}

.sheet-block strong {
  font-size: 14px;
}

.sheet-block p {
  font-size: 12.5px;
  color: #524a3f;
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 14px;
  font-variant-numeric: tabular-nums;
}

.sheet-table th {
  text-align: left;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8b8174;
  padding: 0 0 8px;
  border-bottom: 1px solid #16130f;
}

.sheet-table th.num,
.sheet-table td.num {
  text-align: right;
}

.sheet-table td {
  padding: 10px 0;
  border-bottom: 1px solid #eee9e1;
  vertical-align: top;
}

.sheet-table td.desc small {
  display: block;
  color: #6a6257;
  font-size: 11.5px;
  margin-top: 2px;
}

.sheet-totals {
  margin-left: auto;
  width: min(320px, 100%);
  display: grid;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}

.sheet-totals div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: #524a3f;
}

.sheet-totals div.grand {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 2px solid #16130f;
  font-size: 18px;
  font-weight: 700;
  color: #16130f;
}

.sheet-terms {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid #e5e0d8;
  font-size: 11.5px;
  color: #524a3f;
  white-space: pre-wrap;
}

.sheet-foot {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 10.5px;
  color: #8b8174;
}

.sheet-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
  background: #fff;
  border-radius: 6px;
}

/* ---------- print ---------- */

#print-root {
  display: none;
}

@media print {
  @page {
    size: letter;
    margin: 14mm;
  }

  html,
  body {
    background: #fff !important;
  }

  body > *:not(#print-root) {
    display: none !important;
  }

  #print-root {
    display: block !important;
  }

  #print-root .sheet {
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    max-width: none;
    font-size: 11.5pt;
  }

  #print-root .sheet-table td,
  #print-root .sheet-table th {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  #print-root .sheet-head {
    border-bottom-width: 2px;
  }
}

/* ---------- responsive ---------- */

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

  .results {
    position: static;
  }

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

  .intro-card {
    max-width: 380px;
    transform: none;
  }
}

@media (max-width: 820px) {
  .site-nav {
    display: none;
  }

  .intro-card {
    display: none;
  }

  .header-actions {
    margin-left: auto;
  }

  .tier-badge {
    display: none;
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 18px;
  }

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

  .band {
    border-radius: 18px;
  }
}

@media (max-width: 540px) {
  .brand-sub {
    display: none;
  }

  .site-header {
    gap: 8px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .header-actions {
    gap: 6px;
  }

  .lang-picker select {
    max-width: 76px;
    padding: 5px 20px 5px 7px;
    font-size: 11.5px;
  }

  .header-actions .btn-sm {
    padding: 8px 10px;
    font-size: 12px;
    white-space: nowrap;
  }

  .tier-table .col-extra {
    display: none;
  }

  .tier-table th,
  .tier-table td {
    padding: 9px 4px;
    font-size: 12.5px;
    white-space: normal;
  }

  .tier-table thead th {
    font-size: 9.5px;
    letter-spacing: 0.03em;
  }

  .dialog-bar {
    flex-wrap: wrap;
    row-gap: 8px;
    padding: 14px 16px;
  }

  .dialog-bar h2 {
    font-size: 18px;
    flex: 1 1 100%;
  }

  .dialog-bar-actions {
    flex: 1 1 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .dialog-bar-actions .btn {
    padding: 9px 12px;
  }

  .history-head {
    display: none;
  }

  .saved-item {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "date total"
      "main main"
      "qty actions";
    row-gap: 6px;
  }

  .saved-qty {
    text-align: left;
  }

  .saved-total {
    text-align: right;
  }

  .craft-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .sheet {
    padding: 22px 18px;
  }

  .sheet-head {
    flex-direction: column;
  }

  .sheet-title {
    text-align: left;
  }

  .sheet-meta {
    grid-template-columns: 1fr;
  }
}

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

/* ==========================================================================
   SEO landing pages — one long-form guide per craft.
   Reuses the tokens above so a landing page reads as the same shop.
   ========================================================================== */

/* Anchors land below the sticky header instead of under it. */
section[id],
main[id] {
  scroll-margin-top: 84px;
}

.breadcrumb {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 20px;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.lp-main {
  padding-top: clamp(22px, 3vw, 38px);
}

.lp-hero h1 {
  font-size: clamp(32px, 4.6vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.028em;
  max-width: 22ch;
}

.lp-hero .lede {
  max-width: 68ch;
}

.lp-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 22px 0 4px;
}

.lp-cta .micro {
  margin: 0;
  max-width: 34ch;
}

.lp-section {
  margin-top: clamp(34px, 4.6vw, 58px);
}

.lp-section > h2 {
  font-size: clamp(24px, 3vw, 33px);
  line-height: 1.15;
  margin-bottom: 14px;
  max-width: 30ch;
}

.lp-prose p {
  max-width: 74ch;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

.lp-prose h3 {
  font-size: 20px;
  margin: 26px 0 8px;
}

.lp-steps {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.lp-steps li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}

.lp-steps h3 {
  font-size: 17px;
  margin: 6px 0 6px;
}

.lp-steps p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.table-wrap {
  overflow-x: auto;
  margin: 18px 0 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

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

.cost-table caption {
  caption-side: top;
  text-align: left;
  padding: 14px 16px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.cost-table thead th {
  background: var(--paper-deep);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

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

.cost-table th:first-child,
.cost-table td:first-child {
  text-align: left;
}

.cost-table tbody tr:last-child td {
  border-bottom: 0;
}

.cost-table td.is-price {
  font-weight: 700;
  color: var(--accent-deep);
}

.table-note {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0;
  max-width: 74ch;
}

/* ---------- language picker ---------- */

.lang-picker select {
  width: auto;
  min-width: 64px;
  padding: 6px 26px 6px 10px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 999px;
  background-color: transparent;
}

@media (max-width: 540px) {
  .lang-picker select {
    padding: 5px 22px 5px 8px;
    font-size: 12px;
  }
}

/* ---------- unit converter & sheet cutting ---------- */

.conv-block {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--card);
}

.conv-row {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 0.9fr) auto minmax(0, 0.9fr) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.conv-row input,
.conv-row select {
  width: 100%;
  padding: 8px 10px;
  font-size: 13.5px;
}

.conv-arrow {
  color: var(--muted);
  font-size: 14px;
}

.conv-result {
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--green);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conv-result.is-error {
  color: var(--muted);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 11.5px;
  white-space: normal;
}

.sheet-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 10px;
}

.sheet-block .label {
  flex-wrap: wrap;
  row-gap: 2px;
}

.sheet-block .label .hint {
  text-align: right;
}

.sheet-result {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
}

@media (max-width: 540px) {
  .conv-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
  }

  .conv-row .conv-arrow {
    display: none;
  }

  .conv-result {
    grid-column: 1 / -1;
    text-align: left;
  }
}

/* ---------- fee calculator page ---------- */

.fee-section .micro {
  max-width: 74ch;
}

.fee-calc {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: 22px;
  margin-top: 16px;
  align-items: start;
}

.fee-calc .results {
  position: static;
}

.check-field {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-deep);
  font-size: 13.5px;
  line-height: 1.45;
}

.check-field input[type="checkbox"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.check-field .hint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
}

.kpi-hero-value.is-negative {
  color: var(--accent-deep);
}

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

.callout {
  margin: 20px 0;
  padding: 13px 17px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent-soft);
  color: var(--ink-soft);
  font-size: 13.5px;
  max-width: 76ch;
}

.callout strong {
  color: var(--ink);
}

.faq {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  max-width: 78ch;
}

.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}

.faq summary {
  cursor: pointer;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.faq p {
  margin: 9px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.next-guides {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.next-guides a {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.next-guides a:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.next-guides span {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--muted);
}

/* index.html — guide hub */

.guide-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.guide-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.guide-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.guide-card .guide-icon {
  font-size: 18px;
  color: var(--accent);
}

.guide-card strong {
  font-family: var(--serif);
  font-size: 17px;
}

.guide-card span {
  font-size: 12.5px;
  color: var(--muted);
}

.guide-card em {
  margin-top: auto;
  padding-top: 8px;
  font-style: normal;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
}

@media (max-width: 820px) {
  .lp-steps,
  .next-guides {
    grid-template-columns: 1fr;
  }

  .guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

/* ==========================================================================
   Blog — long-form article on a landing-page skeleton.
   Same paper, same type scale; the additions are for prose reading only.
   ========================================================================== */

.article-meta {
  font-size: 12.5px;
  color: var(--muted);
  margin: 14px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.article-meta span + span::before {
  content: "·";
  margin-right: 10px;
  color: var(--line-strong);
}

.lp-prose ul,
.lp-prose ol {
  margin: 0 0 16px;
  padding-left: 22px;
  max-width: 74ch;
  color: var(--ink-soft);
}

.lp-prose li {
  margin: 0 0 8px;
}

.lp-prose li strong {
  color: var(--ink);
}

.lp-prose code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--paper-deep);
  border-radius: 5px;
  padding: 1px 5px;
  white-space: nowrap;
}

.lp-prose .formula {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 14px 0 18px;
  overflow-x: auto;
  max-width: 74ch;
}

.sources-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  gap: 10px;
  max-width: 74ch;
}

.sources-list li {
  font-size: 13.5px;
  color: var(--ink-soft);
  border-left: 2px solid var(--line);
  padding: 2px 0 2px 12px;
}

.sources-list a {
  color: var(--accent-deep);
}

/* ---------- free micro tools (/tools/...) ---------- */

.pro-bridge {
  margin: clamp(34px, 4.6vw, 58px) 0 0;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-deep);
}

.pro-bridge h2 {
  font-size: clamp(20px, 2.4vw, 26px);
  line-height: 1.2;
  margin: 0 0 10px;
  max-width: 36ch;
}

.pro-bridge p {
  max-width: 72ch;
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0 0 14px;
}

.pro-bridge .micro {
  margin: 10px 0 0;
}

.cmp-table th,
.cmp-table td {
  white-space: nowrap;
}

.cmp-table tr.is-best th,
.cmp-table tr.is-best td {
  background: var(--accent-soft);
  font-weight: 650;
}

.cmp-table .micro {
  font-weight: 400;
  color: var(--muted);
}

@media (max-width: 560px) {
  .pro-bridge {
    padding: 18px 16px;
  }
}

/* Long CTA labels wrap instead of pushing the page sideways at 360px. */
.lp-cta .btn,
.pro-bridge .btn {
  white-space: normal;
  text-align: center;
  max-width: 100%;
}

/* ==========================================================================
   FeedDocket — product layer on top of the CraftQuote sheet tokens.
   The label preview is the one place that must look like a printed box,
   so it uses its own type scale and hairlines instead of card styling.
   ========================================================================== */

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--paper-deep);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.plan-badge.is-pro {
  background: var(--green-soft);
  border-color: #bcd6c6;
  color: var(--green);
}

.section {
  padding: clamp(48px, 7vw, 88px) 0 0;
  max-width: 1180px;
  margin: 0 auto;
  padding-left: clamp(16px, 4vw, 44px);
  padding-right: clamp(16px, 4vw, 44px);
  scroll-margin-top: 74px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.section-head h2 {
  font-size: clamp(24px, 3vw, 33px);
  letter-spacing: -0.02em;
}

.section-sub {
  margin-top: 8px;
  max-width: 66ch;
  color: var(--ink-soft);
  font-size: 14.8px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12.8px;
  color: var(--muted);
}

.hero-facts li {
  position: relative;
  padding-left: 13px;
}

.hero-facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.55;
}

.hero-facts strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.intro-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 22px 22px 18px;
}

.intro-card-quote {
  font-family: var(--serif);
  font-size: 18.5px;
  line-height: 1.4;
  color: var(--ink);
  margin: 4px 0 12px;
}

.intro-card-foot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--accent-deep);
  font-weight: 600;
}

.panel-title {
  font-size: 18px;
}

.form-note {
  margin: 10px 0 4px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}

.toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border: 0;
  padding: 0;
  margin: 14px 0 0;
}

.radio-row legend {
  width: 100%;
  margin-bottom: 2px;
}

.radio-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
}

.radio-chip:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 600;
}

.radio-chip input {
  accent-color: var(--accent);
}

/* ---------------------------------------------------------- label preview */

.pnf-wrap {
  position: relative;
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background:
    repeating-linear-gradient(0deg, rgba(211, 198, 176, 0.18) 0 1px, transparent 1px 8px),
    var(--paper-deep);
}

.pnf {
  background: #fff;
  color: #111;
  border: 2.5px solid #111;
  border-radius: 2px;
  padding: 8px 10px 10px;
  font-family: var(--sans);
  font-size: 12.5px;
  max-width: 380px;
  margin: 0 auto;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}

.pnf.is-empty {
  border-style: dashed;
  border-color: var(--line-strong);
  color: var(--muted);
  text-align: center;
  padding: 28px 14px;
}

.pnf-product {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  color: #444;
  border-bottom: 1px solid #111;
  padding-bottom: 4px;
  margin-bottom: 6px;
}

.pnf-title {
  text-align: center;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.1;
  padding-bottom: 5px;
  border-bottom: 4px solid #111;
}

.pnf-unit {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
  padding: 5px 0;
  border-bottom: 1px solid #111;
  font-variant-numeric: tabular-nums;
}

.pnf-calorie {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0 2px;
  font-weight: 700;
}

.pnf-from {
  padding: 0 0 6px 14px;
  border-bottom: 4px solid #111;
  font-size: 11.5px;
  color: #222;
}

.pnf-cols {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0 10px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 0 3px;
  border-bottom: 1px solid #111;
  color: #333;
}

.pnf-cols span:nth-child(n + 2) {
  text-align: right;
}

.pnf-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0 10px;
  padding: 3.5px 0;
  border-bottom: 1px solid #ccc;
  font-variant-numeric: tabular-nums;
}

.pnf-row span:nth-child(n + 2) {
  text-align: right;
  font-weight: 600;
}

.pnf-row.is-sub {
  padding-left: 12px;
  font-size: 11.5px;
  color: #333;
}

.pnf-row.is-strong {
  font-weight: 700;
}

.pnf-foot {
  margin-top: 6px;
  font-size: 10px;
  line-height: 1.35;
  color: #333;
}

.pnf-foot .pnf-dagger {
  color: #111;
}

.pnf-watermark {
  position: static;
  margin: 10px auto 0;
  width: fit-content;
  padding: 4px 12px;
  border: 1px solid rgba(184, 72, 29, 0.45);
  border-radius: 999px;
  color: var(--accent-deep);
  background: rgba(255, 253, 249, 0.9);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
}

/* ------------------------------------------------------------ review guard */

.trap-block {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.trap-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.trap {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 13px;
  line-height: 1.45;
}

.trap.is-error {
  border-color: #e7c4b4;
  background: var(--accent-soft);
}

.trap.is-warn {
  border-color: #ecdcb8;
  background: var(--amber-soft);
}

.trap.is-ok {
  border-color: #cfe3d6;
  background: var(--green-soft);
}

.trap-icon {
  font-weight: 800;
  font-size: 13px;
  line-height: 1.35;
}

.trap.is-error .trap-icon { color: var(--accent-deep); }
.trap.is-warn .trap-icon { color: var(--amber); }
.trap.is-ok .trap-icon { color: var(--green); }

.trap strong {
  display: block;
  font-size: 13px;
  margin-bottom: 1px;
}

.trap span {
  color: var(--ink-soft);
}

/* --------------------------------------------------------- calculation steps */

.calc-panel {
  margin-top: 18px;
}

.calc-steps {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
  counter-reset: calc;
}

.calc-steps li {
  position: relative;
  padding: 10px 12px 10px 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  font-size: 13px;
  line-height: 1.5;
  counter-increment: calc;
}

.calc-steps li::before {
  content: counter(calc);
  position: absolute;
  left: 11px;
  top: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.calc-steps code {
  font-family: var(--mono);
  font-size: 12px;
  background: rgba(26, 23, 19, 0.06);
  padding: 1px 4px;
  border-radius: 4px;
}

.calc-steps .step-result {
  display: block;
  margin-top: 3px;
  font-weight: 700;
  color: var(--accent-deep);
}

.calc-steps li.is-locked {
  color: var(--muted);
  background: repeating-linear-gradient(135deg, var(--paper-deep) 0 8px, var(--paper) 8px 16px);
}

/* ------------------------------------------------------------- cost layout */

.cost-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: clamp(18px, 2.4vw, 28px);
  align-items: start;
}

.cost-side {
  display: grid;
  gap: 16px;
}

.state-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 18px 0 8px;
}

.linkish {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent-deep);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 6px;
}

.state-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 7px 4px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.1s ease;
  font-variant-numeric: tabular-nums;
}

.state-chip small {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
  text-transform: none;
}

.state-chip:hover {
  border-color: var(--accent);
}

.state-chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.state-chip[aria-pressed="true"] small {
  color: #d9cbb6;
}

.state-chip.is-locked {
  opacity: 0.45;
  cursor: not-allowed;
}

.pending-box {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--paper);
  font-size: 13px;
}

.pending-box summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-soft);
}

.pending-box p {
  margin-top: 8px;
}

.kpi-hero-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.kpi-hero-value {
  font-family: var(--serif);
  font-size: clamp(38px, 6vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 6px 0 4px;
  font-variant-numeric: tabular-nums;
}

.kpi-hero-meta {
  font-size: 13px;
  color: var(--ink-soft);
}

.fine-print {
  margin: 12px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 7px;
  font-size: 12.8px;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------- fee table */

.table-wrap-flush {
  margin: 12px 0 0;
}

.state-table,
.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.state-table th,
.state-table td,
.matrix-table th,
.matrix-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.state-table thead th,
.matrix-table thead th {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  background: var(--paper);
  position: sticky;
  top: 0;
}

.state-table .num,
.matrix-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

.state-code {
  font-weight: 800;
  letter-spacing: 0.04em;
}

.state-agency {
  display: block;
  font-weight: 400;
  font-size: 11px;
  color: var(--muted);
  max-width: 28ch;
}

.state-name {
  display: block;
  font-weight: 400;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.state-table td:first-child {
  min-width: 104px;
}

.src-link {
  display: inline-block;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.fee-line {
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
}

.fee-flag {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--amber);
}

.empty-cell {
  text-align: center;
  color: var(--muted);
  padding: 22px 12px;
}

.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge.pf5-mandatory { background: var(--accent-soft); color: var(--accent-deep); }
.badge.pf5-discretionary { background: var(--amber-soft); color: var(--amber); }
.badge.pf5-unverified { background: var(--paper-deep); color: var(--muted); border: 1px solid var(--line-strong); }
.badge.pf5-hybrid_required { background: var(--green-soft); color: var(--green); }

/* ---------------------------------------------------------------- calendar */

.calendar-panel {
  margin-top: 18px;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.cal-cell {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  padding: 7px 8px;
}

.cal-cell.is-now {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(184, 72, 29, 0.25);
}

.cal-head {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.cal-items {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 6px;
}

.cal-item {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--line-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: default;
}

.cal-item small {
  font-weight: 500;
  color: var(--muted);
  font-size: 9.5px;
}

.cal-item.is-soon {
  border-color: var(--accent);
  color: var(--accent-deep);
}

.cal-empty {
  margin-top: 8px;
  font-size: 11px;
  color: var(--line-strong);
}

/* ------------------------------------------------------------------ matrix */

.matrix-panel {
  margin-top: 18px;
}

.matrix-table th.row-head {
  text-align: left;
  font-size: 12.5px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  background: var(--card);
  position: static;
}

.matrix-cell {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 7px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  background: #fff;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.matrix-cell.is-filed {
  background: var(--green-soft);
  border-color: #bcd6c6;
  color: var(--green);
  font-weight: 700;
}

.matrix-cell:hover {
  border-color: var(--accent);
}

/* -------------------------------------------------------------------- data */

.data-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.data-kpi {
  font-family: var(--serif);
  font-size: 34px;
  letter-spacing: -0.02em;
  margin: 6px 0 10px;
}

/* ------------------------------------------------------------------- print */

.print-doc {
  display: none;
}

@media print {
  body {
    background: #fff;
  }

  body > *:not(.print-doc) {
    display: none !important;
  }

  .print-doc {
    display: block;
    padding: 0;
    color: #000;
    font-size: 11.5px;
  }

  .print-doc h1 {
    font-size: 20px;
    margin-bottom: 2px;
  }

  .print-doc h2 {
    font-size: 14px;
    margin: 18px 0 6px;
    border-bottom: 1px solid #000;
    padding-bottom: 3px;
    page-break-after: avoid;
  }

  .print-doc .trap,
  .print-doc .pnf {
    page-break-inside: avoid;
  }

  .print-doc table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10.5px;
  }

  .print-doc th,
  .print-doc td {
    border: 1px solid #999;
    padding: 4px 6px;
    text-align: left;
    vertical-align: top;
  }

  .print-doc th {
    white-space: nowrap;
  }

  .print-doc .print-meta {
    font-size: 10px;
    color: #333;
  }

  .print-doc .pnf {
    box-shadow: none;
    margin: 8px 0;
    max-width: 95mm;
  }

  .print-doc .calc-steps {
    display: block;
    margin: 8px 0 0;
    padding-left: 20px;
    list-style: decimal;
    counter-reset: none;
  }

  .print-doc .calc-steps li {
    display: list-item;
    padding: 3px 0;
    border: 0;
    background: none;
  }

  .print-doc .calc-steps li::before {
    content: none;
  }

  .print-doc .calc-steps code {
    display: block;
    font-family: var(--mono);
    font-size: 10px;
    background: none;
    padding: 1px 0;
  }

  .print-doc .calc-steps .step-result {
    display: block;
    font-weight: 700;
  }

  .print-doc .trap-list {
    display: block;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .print-doc .trap {
    display: block;
    margin: 0 0 5px;
    padding: 5px 8px;
    background: #fff;
    border: 1px solid #bbb;
  }

  .print-doc .trap strong {
    display: block;
    margin-bottom: 2px;
  }
}

/* ------------------------------------------------------------- responsive */

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

  .workspace,
  .cost-layout,
  .data-grid {
    grid-template-columns: 1fr;
  }

  .results {
    position: static;
  }

  .calendar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .site-nav {
    gap: 14px;
    font-size: 13.5px;
  }
}

@media (max-width: 720px) {
  .site-header {
    flex-wrap: wrap;
    gap: 10px 14px;
    padding: 10px 16px;
  }

  .site-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  .header-actions {
    margin-left: auto;
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .state-table thead th:nth-child(2),
  .state-table tbody td:nth-child(2) {
    display: none;
  }

  .kpi-hero-value {
    font-size: 40px;
  }
}

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

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

  .cal-cell {
    min-height: 0;
  }

  .state-grid {
    grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
  }

  .section-head {
    align-items: flex-start;
  }

  .pnf {
    font-size: 12px;
  }

  .pnf-title {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* The base sheet hides the nav under 820 px (it was a landing page). This app
   is a tool: the section links stay reachable on a phone. */
@media (max-width: 900px) {
  .site-nav {
    display: flex;
    flex-wrap: nowrap;
  }
}

@media (max-width: 720px) {
  .site-nav a {
    white-space: nowrap;
  }

  .intro h1 {
    font-size: clamp(30px, 8.2vw, 42px);
  }
}

/* On a phone the fee table becomes one card per state: a five-column table at
   360 px squeezes the renewal line into a ribbon. */
@media (max-width: 720px) {
  .state-table thead {
    display: none;
  }

  .state-table,
  .state-table tbody,
  .state-table tr,
  .state-table td {
    display: block;
    width: auto;
  }

  .state-table tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }

  .state-table tr:last-child {
    border-bottom: 0;
  }

  .state-table tbody td,
  .state-table tbody td:nth-child(2) {
    display: block;
    border: 0;
    padding: 3px 0;
    text-align: left;
  }

  .state-table .state-agency {
    max-width: none;
  }

  .state-table tbody td.num {
    text-align: left;
  }

  .state-table td:nth-child(3)::before { content: "Year one · "; font-weight: 700; }
  .state-table td:nth-child(4)::before { content: "Renews · "; font-weight: 700; }
  .state-table td:nth-child(5)::before { content: "PF5 · "; font-weight: 700; }
  .state-table td:nth-child(3),
  .state-table td:nth-child(5) {
    font-size: 13px;
  }
}
