:root {
  --ink: #0e1916;
  --ink-soft: #344740;
  --ink-muted: #65756f;
  --paper: #f7f5ef;
  --paper-warm: #eee9de;
  --surface: #fffefa;
  --surface-strong: #ffffff;
  --moss: #2f6b54;
  --moss-hover: #245743;
  --moss-deep: #143b30;
  --mint: #a8d5c2;
  --mint-pale: #e0efe7;
  --sun: #d89524;
  --sun-pale: #fff0cf;
  --ember: #b84d3a;
  --ember-pale: #fbe4df;
  --blue: #4e7fa5;
  --lavender: #b9a4cf;
  --line: rgba(20, 59, 48, 0.15);
  --line-strong: rgba(20, 59, 48, 0.28);
  --shadow-sm: 0 1px 2px rgba(20, 59, 48, 0.06), 0 8px 24px -20px rgba(20, 59, 48, 0.35);
  --shadow-lg: 0 1px 0 rgba(20, 59, 48, 0.06), 0 30px 70px -36px rgba(20, 59, 48, 0.42);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 30px;
  --sans: "Inter Tight", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --serif: "Source Han Serif SC", "Songti SC", "STSong", Georgia, serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a,
select,
input[type="radio"],
input[type="checkbox"] {
  touch-action: manipulation;
}

a {
  color: inherit;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

[hidden] {
  display: none !important;
}

.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;
  z-index: 999;
  top: 8px;
  left: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--moss-deep);
  color: white;
  transform: translateY(-140%);
  transition: transform 180ms ease-out;
}

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

:focus-visible {
  outline: 3px solid rgba(78, 127, 165, 0.55);
  outline-offset: 3px;
}

.site-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 48px));
  min-height: 76px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  background: var(--moss-deep);
  color: var(--paper);
  box-shadow: var(--shadow-sm);
}

.brand-mark svg {
  width: 26px;
}

.brand > span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand strong {
  font-size: 15px;
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 12px;
}

.site-header nav {
  display: flex;
  gap: 28px;
}

.site-header nav a {
  position: relative;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.site-header nav a::after {
  position: absolute;
  right: 0;
  bottom: -6px;
  left: 0;
  height: 2px;
  background: var(--moss);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease-out;
}

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

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.72fr);
  gap: clamp(44px, 7vw, 104px);
  align-items: center;
  width: min(1180px, calc(100% - 48px));
  min-height: 670px;
  margin: 0 auto;
  padding: 76px 0 110px;
}

.hero-glow {
  position: absolute;
  z-index: -1;
  inset: -80px 0 0;
  overflow: hidden;
  pointer-events: none;
}

.glow {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(78px);
  mix-blend-mode: multiply;
  opacity: 0.45;
}

.glow-one {
  top: 6%;
  right: 6%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--mint), transparent 68%);
  animation: drift-one 19s ease-in-out infinite;
}

.glow-two {
  bottom: 0;
  left: -4%;
  width: 430px;
  height: 430px;
  background: radial-gradient(circle, rgba(240, 179, 74, 0.55), transparent 70%);
  animation: drift-two 23s ease-in-out infinite;
}

.glow-three {
  top: 30%;
  left: 40%;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(123, 179, 232, 0.42), transparent 69%);
  animation: drift-three 21s ease-in-out infinite;
}

@keyframes drift-one {
  50% { transform: translate(-38px, 24px) scale(1.04); }
}

@keyframes drift-two {
  50% { transform: translate(46px, -28px) scale(0.96); }
}

@keyframes drift-three {
  50% { transform: translate(20px, 40px); }
}

.eyebrow {
  margin: 0 0 15px;
  color: var(--moss);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(44px, 6.3vw, 78px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.gradient-word {
  padding-right: 0.14em;
  background: linear-gradient(105deg, var(--moss) 0%, #3fa889 52%, #7f67a0 100%);
  background-clip: text;
  box-decoration-break: clone;
  color: transparent;
  font-style: italic;
  -webkit-background-clip: text;
  -webkit-box-decoration-break: clone;
}

.hero-lede {
  max-width: 650px;
  margin: 28px 0 0;
  color: var(--ink-soft);
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.8;
}

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

.hero-actions {
  margin-top: 34px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 13px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 180ms ease-out, border-color 180ms ease-out, color 180ms ease-out, transform 180ms ease-out, box-shadow 180ms ease-out;
}

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

.button:active {
  transform: translateY(0);
}

.button svg {
  width: 20px;
}

.button-primary {
  background: var(--moss-deep);
  color: white;
  box-shadow: 0 14px 30px -20px rgba(20, 59, 48, 0.8);
}

.button-primary:hover {
  background: var(--moss-hover);
  box-shadow: 0 18px 34px -20px rgba(20, 59, 48, 0.9);
}

.button-secondary {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.button-secondary:hover {
  border-color: var(--moss);
  background: white;
}

.text-link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  padding: 0 10px;
  color: var(--moss-deep);
  font-weight: 700;
  text-underline-offset: 5px;
}

.privacy-note {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 24px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.privacy-note svg {
  width: 18px;
  flex: 0 0 auto;
  color: var(--moss);
}

.hero-flow {
  position: relative;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 28px;
  background: rgba(255, 254, 250, 0.78);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
  transform: perspective(1000px) rotateY(-3deg) rotateX(1deg);
  transition: transform 350ms ease-out;
}

.hero-flow:hover {
  transform: perspective(1000px) rotateY(0) rotateX(0) translateY(-4px);
}

.flow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.flow-head b {
  color: var(--moss);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.hero-flow ol {
  display: grid;
  gap: 3px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.hero-flow li {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 13px;
  align-items: center;
  min-height: 72px;
  padding: 10px 11px;
  border-radius: 16px;
  transition: background-color 180ms ease-out;
}

.hero-flow li:not(:last-child)::after {
  position: absolute;
  bottom: -7px;
  left: 32px;
  width: 1px;
  height: 18px;
  background: var(--line-strong);
  content: "";
}

.hero-flow li:hover {
  background: var(--mint-pale);
}

.hero-flow li > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  color: var(--moss);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}

.hero-flow li div {
  display: flex;
  flex-direction: column;
}

.hero-flow li strong {
  font-size: 15px;
}

.hero-flow li small {
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 12px;
}

.calculator-section,
.boundary-section {
  width: min(1100px, calc(100% - 48px));
  margin: 0 auto;
  padding: 110px 0;
}

.calculator-section {
  padding-top: 60px;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 38px;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(32px, 4.5vw, 52px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.section-heading > p:last-child {
  margin: 16px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 600px;
  margin: 0 0 24px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--paper-warm);
}

.mode-switch label {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.mode-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-switch span {
  display: flex;
  min-height: 64px;
  flex-direction: column;
  justify-content: center;
  padding: 8px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--ink-soft);
  transition: background-color 180ms ease-out, border-color 180ms ease-out, box-shadow 180ms ease-out;
}

.mode-switch input:checked + span {
  border-color: var(--line);
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.mode-switch input:focus-visible + span {
  outline: 3px solid rgba(78, 127, 165, 0.55);
  outline-offset: 3px;
}

.mode-switch strong {
  font-size: 15px;
}

.mode-switch small {
  color: var(--ink-muted);
  font-size: 12px;
}

.error-summary {
  margin-bottom: 20px;
  padding: 15px 18px;
  border: 1px solid rgba(184, 77, 58, 0.35);
  border-radius: var(--radius-sm);
  background: var(--ember-pale);
  color: #742e22;
  font-weight: 650;
}

.form-card {
  margin-top: 18px;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card-heading {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 15px;
  align-items: start;
  margin-bottom: 30px;
}

.step-number {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 15px;
  background: var(--moss-deep);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.card-heading h3,
.result-body h3,
.result-basis h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.015em;
}

.card-heading p {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: 14px;
}

.field-grid {
  display: grid;
  gap: 20px;
}

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

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

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

.field > span:first-child,
.data-stage h4 {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 750;
}

.field small {
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.5;
}

input[type="number"],
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: white;
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease-out, box-shadow 160ms ease-out;
}

input[type="number"] {
  padding: 0 13px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

select {
  padding: 0 38px 0 13px;
  cursor: pointer;
}

input[type="number"]:focus,
select:focus {
  border-color: var(--moss);
  box-shadow: 0 0 0 4px rgba(47, 107, 84, 0.12);
}

input[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--ember);
  box-shadow: 0 0 0 3px rgba(184, 77, 58, 0.1);
}

.input-suffix {
  position: relative;
  display: block;
}

.input-suffix input {
  padding-right: 54px;
}

.input-suffix b {
  position: absolute;
  top: 50%;
  right: 14px;
  color: var(--ink-muted);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 650;
  transform: translateY(-50%);
  pointer-events: none;
}

.source-alert {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  margin-top: 24px;
  padding: 16px 18px;
  border: 1px solid rgba(216, 149, 36, 0.3);
  border-radius: 13px;
  background: var(--sun-pale);
  color: #5e4516;
}

.source-alert svg {
  width: 22px;
  margin-top: 2px;
}

.source-alert p {
  display: flex;
  flex-direction: column;
  margin: 0;
  font-size: 13px;
}

.source-alert span {
  margin-top: 2px;
}

.advanced-options {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}

.advanced-options summary {
  min-height: 50px;
  padding: 13px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.details-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  padding: 8px 16px 18px;
}

.check-field {
  display: flex;
  min-height: 54px;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  cursor: pointer;
}

.check-field input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin: 2px 0 0;
  accent-color: var(--moss);
}

.check-field span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.check-field strong {
  font-size: 13px;
}

.check-field small {
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.5;
}

.review-check {
  margin-top: 26px;
  background: var(--paper);
}

.data-stage h4 {
  margin: 0 0 12px;
  color: var(--moss);
  font-family: var(--mono);
  letter-spacing: 0.08em;
}

.stage-divider {
  display: grid;
  grid-template-columns: 1fr 32px 1fr;
  gap: 8px;
  align-items: center;
  margin: 25px 0;
  color: var(--moss);
}

.stage-divider span {
  height: 1px;
  background: var(--line);
}

.stage-divider svg {
  width: 24px;
  margin: auto;
}

.form-actions {
  justify-content: flex-end;
  margin-top: 24px;
}

.calculate-button {
  min-width: 236px;
}

.result-panel {
  margin-top: 48px;
  overflow: hidden;
  border: 1px solid rgba(20, 59, 48, 0.2);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.result-status {
  padding: clamp(28px, 5vw, 50px);
  background: var(--moss-deep);
  color: white;
}

.result-status .eyebrow {
  color: var(--mint);
}

.result-status h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.2;
}

.result-status p:last-child {
  max-width: 760px;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.78);
}

.result-panel[data-status="excess"] .result-status,
.result-panel[data-status="review"] .result-status {
  background: #69382f;
}

.result-panel[data-status="quota-needed"] .result-status {
  background: #735715;
}

.result-panel[data-status="surplus"] .result-status {
  background: #315a72;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.metric {
  min-width: 0;
  padding: 24px;
  background: var(--surface);
}

.metric span {
  display: block;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 650;
}

.metric strong {
  display: block;
  margin-top: 5px;
  color: var(--moss-deep);
  font-family: var(--mono);
  font-size: clamp(21px, 2.7vw, 31px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.045em;
  white-space: nowrap;
}

.metric small {
  display: block;
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 11px;
}

.result-body {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 36px;
  padding: clamp(28px, 5vw, 50px);
}

.calculation-steps {
  display: grid;
  gap: 12px;
  margin: 20px 0 0;
  padding: 0;
  counter-reset: result-step;
  list-style: none;
}

.calculation-steps li {
  position: relative;
  padding: 16px 16px 16px 54px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  counter-increment: result-step;
}

.calculation-steps li::before {
  position: absolute;
  top: 16px;
  left: 16px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 9px;
  background: var(--moss-deep);
  color: white;
  content: counter(result-step);
  font-family: var(--mono);
  font-size: 11px;
}

.calculation-steps strong {
  display: block;
  font-size: 14px;
}

.calculation-steps code {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 5px;
  color: var(--moss-deep);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
}

.calculation-steps p {
  margin: 5px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
}

.result-basis {
  align-self: start;
  padding: 22px;
  border-radius: 16px;
  background: var(--mint-pale);
}

.result-basis-content,
#result-basis-content {
  margin-top: 15px;
}

#result-basis-content p {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 13px;
}

#result-basis-content a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--moss-deep);
  font-size: 13px;
  font-weight: 750;
  text-underline-offset: 4px;
}

.result-actions {
  padding: 0 clamp(28px, 5vw, 50px) 24px;
}

.result-disclaimer {
  margin: 0;
  padding: 20px clamp(28px, 5vw, 50px) 28px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 12px;
}

.regulations-section {
  padding: 110px max(24px, calc((100vw - 1100px) / 2));
  background: var(--moss-deep);
  color: white;
}

.section-heading-light .eyebrow {
  color: var(--mint);
}

.section-heading-light > p:last-child {
  color: rgba(255, 255, 255, 0.7);
}

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

.regulation-card {
  display: flex;
  min-height: 320px;
  flex-direction: column;
  padding: clamp(24px, 4vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.065);
  transition: border-color 180ms ease-out, background-color 180ms ease-out, transform 180ms ease-out;
}

.regulation-card-featured {
  grid-row: span 2;
  min-height: 658px;
  background: radial-gradient(circle at 85% 15%, rgba(168, 213, 194, 0.19), transparent 40%), rgba(255, 255, 255, 0.085);
}

.regulation-card:hover {
  border-color: rgba(168, 213, 194, 0.52);
  background-color: rgba(255, 255, 255, 0.09);
  transform: translateY(-3px);
}

.regulation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  color: var(--mint);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.regulation-meta b {
  padding: 5px 9px;
  border: 1px solid rgba(168, 213, 194, 0.28);
  border-radius: 999px;
  font-weight: 650;
}

.regulation-card h3 {
  margin: 26px 0 0;
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.35;
}

.regulation-card p {
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.72);
}

.regulation-card ul {
  display: grid;
  gap: 10px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.regulation-card li {
  position: relative;
  padding-left: 22px;
  color: rgba(255, 255, 255, 0.86);
}

.regulation-card li::before {
  position: absolute;
  top: 0.72em;
  left: 2px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--mint);
  border-radius: 50%;
  content: "";
  transform: translateY(-50%);
}

.regulation-card a {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  align-self: flex-start;
  margin-top: auto;
  padding-top: 22px;
  color: var(--mint);
  font-weight: 750;
  text-underline-offset: 5px;
}

.validity-note {
  margin-top: 18px;
  padding: 13px 15px;
  border: 1px solid rgba(240, 179, 74, 0.32);
  border-radius: 12px;
  background: rgba(240, 179, 74, 0.09);
  color: #f7d89b;
  font-size: 13px;
}

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

.boundary-grid article {
  padding: 26px;
  border-top: 2px solid var(--moss);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.boundary-grid article > span {
  color: var(--moss);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 750;
}

.boundary-grid h3 {
  margin: 18px 0 0;
  font-size: 18px;
}

.boundary-grid p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 42px max(24px, calc((100vw - 1100px) / 2));
  border-top: 1px solid var(--line);
  background: var(--paper-warm);
  color: var(--ink-soft);
}

footer strong {
  color: var(--ink);
}

footer p {
  margin: 4px 0 0;
  font-size: 12px;
}

.toast {
  position: fixed;
  z-index: 200;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 13px 18px;
  border-radius: 12px;
  background: var(--moss-deep);
  color: white;
  box-shadow: var(--shadow-lg);
  font-size: 14px;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 68px;
  }

  .hero-flow {
    width: min(620px, 100%);
    transform: none;
  }

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

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

  .result-body {
    grid-template-columns: 1fr;
  }

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

  .regulation-card-featured {
    grid-row: auto;
    min-height: 420px;
  }

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

@media (max-width: 680px) {
  .site-header {
    width: min(100% - 32px, 1180px);
    min-height: 68px;
  }

  .brand small,
  .site-header nav {
    display: none;
  }

  .hero,
  .calculator-section,
  .boundary-section {
    width: min(100% - 32px, 1100px);
  }

  .hero {
    gap: 42px;
    padding: 54px 0 86px;
  }

  .hero h1 {
    font-size: clamp(41px, 13vw, 60px);
    line-height: 1.12;
  }

  .hero-lede {
    font-size: 17px;
  }

  .hero-actions,
  .hero-actions .button,
  .hero-actions .text-link {
    width: 100%;
    justify-content: center;
  }

  .hero-flow {
    padding: 18px;
    border-radius: 22px;
  }

  .hero-flow li {
    grid-template-columns: 40px 1fr;
    min-height: 68px;
    padding-inline: 6px;
  }

  .hero-flow li > span {
    width: 38px;
    height: 38px;
  }

  .calculator-section,
  .boundary-section,
  .regulations-section {
    padding-top: 82px;
    padding-bottom: 82px;
  }

  .section-heading {
    margin-bottom: 28px;
  }

  .mode-switch {
    max-width: none;
  }

  .mode-switch span {
    min-height: 68px;
    padding-inline: 13px;
  }

  .form-card {
    border-radius: 17px;
  }

  .card-heading {
    grid-template-columns: 42px 1fr;
  }

  .step-number {
    width: 42px;
    height: 42px;
  }

  .field-grid-four,
  .field-grid-three,
  .details-body {
    grid-template-columns: 1fr;
  }

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

  .form-actions .calculate-button {
    order: -1;
  }

  .result-panel {
    border-radius: 22px;
  }

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

  .metric {
    padding: 18px 16px;
  }

  .metric strong {
    font-size: 21px;
    white-space: normal;
  }

  .result-body {
    gap: 28px;
  }

  .regulations-section {
    padding-right: 16px;
    padding-left: 16px;
  }

  .regulation-card {
    min-height: 0;
    border-radius: 17px;
  }

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

@media (max-width: 390px) {
  .mode-switch {
    grid-template-columns: 1fr;
  }

  .mode-switch span {
    min-height: 56px;
  }

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

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body {
    background: white;
  }

  .site-header,
  .hero,
  #calculator-form,
  .section-heading,
  .regulations-section,
  .boundary-section,
  footer,
  .result-actions,
  .toast {
    display: none !important;
  }

  .calculator-section {
    width: 100%;
    padding: 0;
  }

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

  .result-status {
    background: white !important;
    color: black;
  }

  .result-status .eyebrow,
  .result-status p:last-child {
    color: #333;
  }

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