:root {
  --ink: #17201d;
  --muted: #5d6863;
  --paper: #f7f8f4;
  --surface: #ffffff;
  --line: #d9ded9;
  --green: #176b4d;
  --green-dark: #0e4d37;
  --green-soft: #dcefe5;
  --yellow: #f1c64b;
  --coral: #e46f51;
  --blue: #437ea3;
  --shadow: 0 16px 40px rgba(23, 32, 29, 0.1);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  line-height: 1.55;
}

a {
  color: inherit;
}

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

button,
input {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  transform: translateY(-160%);
  padding: 8px 12px;
  background: var(--ink);
  color: white;
}

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

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(217, 222, 217, 0.9);
  background: rgba(247, 248, 244, 0.96);
  backdrop-filter: blur(12px);
}

.nav-shell,
.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.nav-shell {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--green-dark);
  border-radius: 6px;
  background: var(--green);
  color: white;
  font-size: 12px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-links a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.nav-links .nav-action {
  padding: 9px 14px;
  border-radius: 6px;
  background: var(--ink);
  color: white;
}

.hero {
  min-height: calc(100vh - 68px);
  display: grid;
  align-items: center;
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(23, 107, 77, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(23, 107, 77, 0.07) 1px, transparent 1px),
    var(--paper);
  background-size: 48px 48px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(460px, 1.1fr);
  gap: 64px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 76px;
  line-height: 0.98;
  font-weight: 700;
}

h2 {
  margin-bottom: 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 40px;
  line-height: 1.08;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 1.25;
}

.hero-copy {
  max-width: 650px;
  margin-bottom: 28px;
  color: #3f4b46;
  font-size: 19px;
}

.action-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border: 1px solid var(--green);
  border-radius: 6px;
  background: var(--green);
  color: white;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--green-dark);
  color: white;
}

.button.secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

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

.hero-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.diagnostic-preview {
  border: 1px solid #cfd7d1;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.preview-head strong {
  font-size: 14px;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.status-dot::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  content: "";
}

.preview-body {
  padding: 24px;
}

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

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

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

.metric strong {
  display: block;
  margin-top: 2px;
  font-size: 25px;
}

.funnel {
  display: grid;
  gap: 13px;
}

.funnel-row {
  display: grid;
  grid-template-columns: 138px 1fr 52px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 2px;
  background: #edf0ed;
}

.bar {
  width: var(--bar-width);
  height: 100%;
  background: var(--bar-color, var(--green));
}

.bar-w31 { width: 31%; background: var(--green); }
.bar-w42 { width: 42%; background: var(--blue); }
.bar-w17 { width: 17%; background: var(--yellow); }
.bar-w10 { width: 10%; background: var(--coral); }

.accent-green { --accent: var(--green); }
.accent-blue { --accent: var(--blue); }
.accent-coral { --accent: var(--coral); }

.preview-insight {
  margin-top: 24px;
  padding: 15px 16px;
  border-left: 4px solid var(--yellow);
  background: #fff9e7;
  font-size: 13px;
}

.band {
  padding: 88px 0;
  border-bottom: 1px solid var(--line);
}

.band.white {
  background: var(--surface);
}

.section-head {
  max-width: 700px;
  margin-bottom: 40px;
}

.section-head p,
.prose p,
.prose li {
  color: var(--muted);
}

.feature-grid,
.scope-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.feature {
  padding-top: 18px;
  border-top: 3px solid var(--accent, var(--green));
}

.feature-index {
  display: block;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.feature p,
.scope-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
}

.boundary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  background: var(--surface);
}

.boundary-panel {
  padding: 32px;
}

.boundary-panel + .boundary-panel {
  border-left: 1px solid var(--line);
}

.boundary-panel ul,
.check-list {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.boundary-panel li,
.check-list li {
  position: relative;
  margin: 10px 0;
  padding-left: 24px;
  color: var(--muted);
}

.boundary-panel li::before,
.check-list li::before {
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 900;
  content: "✓";
}

.boundary-panel.prohibited li::before {
  color: var(--coral);
  content: "×";
}

.price-strip {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 40px;
  padding: 38px 0;
}

.price {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 58px;
  line-height: 1;
}

.page-hero {
  padding: 72px 0 48px;
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  max-width: 900px;
  font-size: 60px;
}

.prose {
  width: min(760px, 100%);
  padding: 64px 0 96px;
}

.prose h2 {
  margin-top: 48px;
  font-size: 28px;
}

.prose h3 {
  margin-top: 30px;
}

.prose li + li {
  margin-top: 8px;
}

.notice {
  padding: 16px 18px;
  border: 1px solid #d7c175;
  border-radius: 6px;
  background: #fff9e7;
  color: #594915;
}

.calculator-layout {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  min-height: calc(100vh - 68px);
}

.calculator-controls {
  padding: 36px 32px 64px max(32px, calc((100vw - 1180px) / 2));
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.calculator-output {
  padding: 36px max(32px, calc((100vw - 1180px) / 2)) 64px 40px;
}

.compact-title {
  margin-bottom: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  line-height: 1.1;
}

.compact-copy {
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 14px;
}

.field {
  margin-bottom: 20px;
}

.field label,
.field legend {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 750;
}

.field input[type="date"],
.field input[type="file"] {
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid #b9c2bc;
  border-radius: 5px;
  background: white;
}

.file-zone {
  padding: 18px;
  border: 1px dashed #9daaa2;
  border-radius: 6px;
  background: var(--paper);
}

.field-hint {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.checkbox-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 13px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
}

.control-actions {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.control-actions .button {
  width: 100%;
}

.button:disabled {
  border-color: #aab2ad;
  background: #aab2ad;
  cursor: not-allowed;
}

.local-badge {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.shield {
  flex: 0 0 auto;
  width: 24px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 2px solid var(--green);
  border-radius: 12px 12px 8px 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.empty-state {
  min-height: 520px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(23, 107, 77, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(23, 107, 77, 0.05) 1px, transparent 1px),
    var(--surface);
  background-size: 36px 36px;
  text-align: center;
}

.empty-state-inner {
  max-width: 430px;
  padding: 32px;
}

.empty-chart {
  height: 110px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 9px;
  margin-bottom: 26px;
}

.empty-chart span {
  width: 24px;
  height: var(--height);
  background: var(--color);
}

.chart-green { --height: 48px; --color: var(--green); }
.chart-blue { --height: 84px; --color: var(--blue); }
.chart-yellow { --height: 62px; --color: var(--yellow); }
.chart-coral { --height: 34px; --color: var(--coral); }

.funnel-progress {
  width: 100%;
  height: 12px;
  border: 0;
  border-radius: 2px;
  background: #edf0ed;
}

.funnel-progress::-webkit-progress-bar {
  border-radius: 2px;
  background: #edf0ed;
}

.funnel-progress::-webkit-progress-value { background: var(--progress-color); }
.funnel-progress::-moz-progress-bar { background: var(--progress-color); }
.progress-won { --progress-color: var(--green); }
.progress-viewed_unresolved { --progress-color: var(--blue); }
.progress-never_viewed_unresolved { --progress-color: var(--yellow); }
.progress-archived { --progress-color: var(--coral); }
.progress-unclassified { --progress-color: #8c9690; }

.error-summary {
  margin-bottom: 24px;
  padding: 16px 18px;
  border: 1px solid #c9543b;
  border-radius: 6px;
  background: #fff0ec;
}

.error-summary h2 {
  margin-bottom: 8px;
  font-family: inherit;
  font-size: 17px;
}

.error-summary ul {
  margin-bottom: 0;
}

.results[hidden],
.error-summary[hidden],
.empty-state[hidden] {
  display: none;
}

.result-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.result-status {
  padding: 5px 9px;
  border: 1px solid #92bba8;
  border-radius: 4px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.result-status.not-eligible {
  border-color: #d6bc67;
  background: #fff4cb;
  color: #594915;
}

.result-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.result-section h3 {
  font-size: 15px;
}

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

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

.data-table th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.site-footer {
  padding: 40px 0;
  background: var(--ink);
  color: #dbe1dd;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: start;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a {
  color: #dbe1dd;
  font-size: 13px;
}

.seller-disclosure {
  max-width: 640px;
  margin: 14px 0 0;
  color: #aeb8b2;
  font-size: 12px;
}

@media (max-width: 900px) {
  h1 {
    font-size: 60px;
  }
  .hero {
    min-height: auto;
  }

  .hero-grid,
  .calculator-layout {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    gap: 44px;
  }

  .calculator-controls {
    padding: 32px 24px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .calculator-output {
    padding: 32px 24px 64px;
  }

  .feature-grid,
  .scope-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .nav-shell,
  .shell {
    width: min(100% - 28px, 1180px);
  }

  .nav-links a:not(.nav-action) {
    display: none;
  }

  .hero {
    padding: 52px 0 44px;
  }

  h1,
  .page-hero h1 {
    font-size: 44px;
  }

  h2 {
    font-size: 33px;
  }

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

  .diagnostic-preview {
    min-width: 0;
  }

  .metric-grid,
  .feature-grid,
  .scope-grid,
  .boundary-grid,
  .price-strip,
  .footer-grid {
    grid-template-columns: 1fr;
  }

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

  .metric {
    padding: 12px 9px;
  }

  .metric strong {
    font-size: 20px;
  }

  .funnel-row {
    grid-template-columns: 112px minmax(0, 1fr) 38px;
    gap: 8px;
  }

  .boundary-panel + .boundary-panel {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .band {
    padding: 64px 0;
  }

  .page-hero {
    padding: 52px 0 38px;
  }

  .result-head {
    display: block;
  }

  .result-status {
    display: inline-block;
    margin-top: 8px;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
