:root {
  color-scheme: light;
  --ink: #1c2d27;
  --muted: #5d6c65;
  --forest: #174c3c;
  --forest-2: #24664f;
  --sage: #dfe9df;
  --cream: #f7f5ed;
  --paper: #fffef9;
  --line: #d6ddd6;
  --amber: #d58c22;
  --amber-pale: #fff1d5;
  --blue: #2d6383;
  --blue-pale: #e9f3f7;
  --low: #587166;
  --danger: #a23a30;
  --danger-pale: #fff0ed;
  --shadow: 0 18px 50px rgba(28, 45, 39, 0.09);
  --radius-lg: 22px;
  --radius-md: 14px;
  --content: 1120px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 5% 5%, rgba(213, 140, 34, 0.08), transparent 26rem),
    linear-gradient(180deg, #f7f5ed 0, #f3f5f0 100%);
  line-height: 1.55;
}

button, input { font: inherit; }
a { color: var(--forest-2); }
a:hover { color: var(--forest); }

.skip-link {
  position: fixed;
  z-index: 100;
  left: 1rem;
  top: -5rem;
  padding: .75rem 1rem;
  border-radius: 8px;
  color: white;
  background: var(--forest);
}
.skip-link:focus { top: 1rem; }

.site-header {
  background: rgba(255, 254, 249, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.header-inner, .site-footer {
  width: min(calc(100% - 2rem), var(--content));
  margin: 0 auto;
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50% 50% 50% 12px;
  color: white;
  background: var(--forest);
  font-weight: 800;
  letter-spacing: .04em;
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 1rem; letter-spacing: -.01em; }
.brand small { color: var(--muted); font-size: .8rem; }

.review-badge {
  padding: .4rem .7rem;
  border: 1px solid #e8c98f;
  border-radius: 999px;
  color: #724810;
  background: var(--amber-pale);
  font-size: .78rem;
  font-weight: 750;
}

main {
  width: min(calc(100% - 2rem), var(--content));
  min-height: calc(100vh - 190px);
  margin: 0 auto;
  padding: 3rem 0 5rem;
}
main:focus { outline: none; }

.loading-card, .error-page {
  min-height: 280px;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow);
  text-align: center;
}

.loader {
  width: 34px;
  height: 34px;
  border: 3px solid var(--sage);
  border-top-color: var(--forest);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loader { animation: none; } }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr);
  gap: 1.5rem;
}

.hero-main, .hero-side, .panel, .result-card, .summary-card {
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.hero-main {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4.5rem);
  border-radius: 30px;
}


  pointer-events: none;

.eyebrow {
  margin: 0 0 .75rem;
  color: var(--forest-2);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

h1, h2, h3 { margin-top: 0; line-height: 1.15; letter-spacing: -.025em; }
h1 { max-width: 13ch; margin-bottom: 1.1rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.45rem, 6vw, 4.7rem); font-weight: 500; }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h3 { font-size: 1.18rem; }

.lede { max-width: 62ch; color: #44564e; font-size: 1.08rem; }

.hero-actions, .button-row, .results-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  margin-top: 1.75rem;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .72rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
}

.button-primary { color: white; background: var(--forest); box-shadow: 0 8px 20px rgba(23, 76, 60, .18); }
.button-primary:hover { color: white; background: #0f3e30; }
.button-secondary { color: var(--ink); background: white; border-color: #bfc9c1; }
.button-secondary:hover { background: #f3f6f3; }
.button-quiet { color: var(--forest); background: transparent; border-color: transparent; }
.button-danger { color: var(--danger); background: white; border-color: #e1b6b0; }
.button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid rgba(45, 99, 131, .32); outline-offset: 2px; }

.hero-side {
  display: flex;
  flex-direction: column;
  padding: 1.7rem;
  border-radius: 24px;
}

.hero-side h2 { font-size: 1.25rem; }
.expect-list { display: grid; gap: 1rem; margin: .5rem 0 1.5rem; padding: 0; list-style: none; }
.expect-list li { display: grid; grid-template-columns: 32px 1fr; gap: .7rem; }
.expect-list span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--forest);
  background: var(--sage);
  font-weight: 800;
}
.privacy-note { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem; }

.workflow {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.progress-panel {
  position: sticky;
  top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 254, 249, .82);
}
.progress-panel p { margin: 0 0 .75rem; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.progress-list { display: grid; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.progress-list li { display: flex; gap: .65rem; align-items: center; padding: .5rem; border-radius: 9px; color: var(--muted); font-size: .86rem; }
.progress-list .step-dot { width: 22px; height: 22px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #bdc8c0; border-radius: 50%; font-size: .7rem; }
.progress-list .current { color: var(--forest); background: var(--sage); font-weight: 750; }
.progress-list .current .step-dot { color: white; border-color: var(--forest); background: var(--forest); }
.progress-list .complete .step-dot { color: white; border-color: var(--forest-2); background: var(--forest-2); }

.panel { padding: clamp(1.25rem, 4vw, 2.5rem); border-radius: var(--radius-lg); }
.panel-header { margin-bottom: 2rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.panel-header h1 { max-width: none; margin: 0 0 .6rem; font-family: inherit; font-size: clamp(1.85rem, 4vw, 2.65rem); font-weight: 750; }
.panel-header p:last-child { margin-bottom: 0; color: var(--muted); }

.question-list { display: grid; gap: 1.75rem; }
.question { margin: 0; padding: 0 0 1.75rem; border: 0; border-bottom: 1px solid #e6eae6; }
.question:last-child { padding-bottom: 0; border-bottom: 0; }
.question legend { width: 100%; margin-bottom: .75rem; padding: 0; font-size: 1.05rem; font-weight: 760; }
.required-mark { margin-left: .25rem; color: var(--danger); }
.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.option { position: relative; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option label {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: .7rem .85rem .7rem 2.5rem;
  border: 1px solid #cbd3cc;
  border-radius: 11px;
  background: white;
  cursor: pointer;
}
.option label::before { content: ""; position: absolute; left: .9rem; width: 16px; height: 16px; border: 2px solid #95a39b; border-radius: 50%; }
.option input:checked + label { border-color: var(--forest-2); background: #edf5ef; box-shadow: inset 0 0 0 1px var(--forest-2); }
.option input:checked + label::before { border: 5px solid var(--forest-2); background: white; }
.option input:focus-visible + label { outline: 3px solid rgba(45, 99, 131, .32); outline-offset: 2px; }

.number-row, .text-row { display: flex; flex-wrap: wrap; gap: .65rem; align-items: stretch; }
.number-row input, .text-row input {
  min-height: 48px;
  width: min(100%, 250px);
  padding: .7rem .8rem;
  border: 1px solid #aebbb2;
  border-radius: 10px;
  color: var(--ink);
  background: white;
}
.unknown-toggle[aria-pressed="true"] { color: var(--forest); border-color: var(--forest); background: var(--sage); }

.why { margin: .7rem 0 0; color: var(--muted); font-size: .88rem; }
.why strong { color: var(--ink); }
.field-error, .form-alert {
  margin: .65rem 0 0;
  padding: .65rem .8rem;
  border-left: 4px solid var(--danger);
  color: #722c24;
  background: var(--danger-pale);
  font-size: .9rem;
}
.form-alert { margin-bottom: 1rem; border: 1px solid #e3b2ac; border-left-width: 5px; border-radius: 9px; }
.form-alert ul { margin: .4rem 0 0; padding-left: 1.2rem; }

.button-row { justify-content: space-between; padding-top: 1.8rem; border-top: 1px solid var(--line); }
.button-row .right { display: flex; gap: .65rem; margin-left: auto; }

.review-grid { display: grid; gap: 1rem; }
.review-section { padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 13px; background: #fbfcf9; }
.review-section header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.review-section h2 { margin: 0; font-size: 1.05rem; }
.review-section dl { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(120px, .8fr); gap: .45rem 1rem; margin: .85rem 0 0; }
.review-section dt { color: var(--muted); }
.review-section dd { margin: 0; font-weight: 700; text-align: right; }
.unknown-summary { margin: 1.25rem 0; padding: 1rem; border: 1px solid #c8dce6; border-radius: 12px; background: var(--blue-pale); }
.unknown-summary h2 { margin-bottom: .35rem; font-size: 1.05rem; }
.unknown-summary p { margin: 0; color: #37586a; }

.results-header { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: end; margin-bottom: 1.5rem; }
.results-header h1 { max-width: 16ch; }
.scope-banner { margin: 0 0 1.5rem; padding: 1rem 1.1rem; border: 1px solid #e5c68d; border-radius: 12px; background: var(--amber-pale); color: #604219; }
.scope-banner strong { display: block; color: #4d320e; }
.summary-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin: 0 0 2rem; }
.summary-card { padding: 1rem; border-radius: 14px; box-shadow: none; }
.summary-card strong { display: block; font-size: 1.8rem; line-height: 1; }
.summary-card span { color: var(--muted); font-size: .85rem; }

.result-group { margin-top: 2.5rem; }
.group-heading { display: flex; align-items: center; gap: .7rem; margin-bottom: .8rem; }
.group-heading h2 { margin: 0; font-size: 1.4rem; }
.tier-pill { display: inline-flex; align-items: center; padding: .3rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.tier-high { color: #714711; background: var(--amber-pale); }
.tier-potential { color: #27556e; background: var(--blue-pale); }
.tier-low { color: #42584e; background: #edf2ee; }
.tier-not_applicable { color: #59645f; background: #f1f2f1; }

.results-list { display: grid; gap: .85rem; }
.result-card { overflow: hidden; border-radius: var(--radius-md); box-shadow: 0 8px 28px rgba(28, 45, 39, .06); }
.result-card-main { padding: 1.25rem; }
.result-card-top { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.result-card h3 { margin: .35rem 0 .55rem; }
.result-card .ecm-id { color: var(--muted); font-size: .75rem; font-weight: 800; letter-spacing: .07em; }
.result-card .summary { margin: 0; color: var(--muted); }
.reason-list { margin: 1rem 0 0; padding: 0; list-style: none; }
.reason-list li { position: relative; margin-top: .45rem; padding-left: 1.25rem; }
.reason-list li::before { content: "→"; position: absolute; left: 0; color: var(--forest-2); font-weight: 800; }
.next-step { margin: 1rem 0 0; padding: .9rem 1rem; border-left: 4px solid var(--forest-2); background: #f1f6f2; }
.next-step strong { display: block; margin-bottom: .2rem; }
.result-details { border-top: 1px solid var(--line); background: #fbfcf9; }
.result-details summary { padding: .8rem 1.25rem; cursor: pointer; font-weight: 700; }
.detail-body { padding: 0 1.25rem 1.2rem; }
.detail-body h4 { margin: 1rem 0 .35rem; }
.detail-body ul { margin-top: .35rem; padding-left: 1.2rem; }
.source-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.source-link { display: inline-block; padding: .35rem .55rem; border: 1px solid #cbd6ce; border-radius: 7px; background: white; font-size: .78rem; font-weight: 700; text-decoration: none; }
.not-applicable-list .result-card { box-shadow: none; background: #fafafa; }

.closing-note { margin-top: 2rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); }
.closing-note h2 { font-size: 1.2rem; }
.closing-note p:last-child { margin-bottom: 0; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .8rem;
}
.site-footer p { max-width: 70ch; margin: .25rem 0 0; }
.site-footer .version { white-space: nowrap; }

@media (max-width: 820px) {
  .hero, .workflow { grid-template-columns: 1fr; }
  .progress-panel { position: static; overflow-x: auto; }
  .progress-list { display: flex; min-width: max-content; }
  .progress-list li { min-width: max-content; }
  .results-header { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  main { width: min(calc(100% - 1rem), var(--content)); padding-top: 1.5rem; }
  .header-inner { width: min(calc(100% - 1rem), var(--content)); }
  .review-badge { display: none; }
  .hero-main, .hero-side, .panel { border-radius: 16px; }
  .hero-main { padding: 1.5rem; }
  h1 { font-size: 2.55rem; }
  .options, .summary-row { grid-template-columns: 1fr; }
  .button-row { align-items: stretch; }
  .button-row .right, .button-row .button { width: 100%; }
  .review-section dl { grid-template-columns: 1fr; }
  .review-section dd { margin-bottom: .5rem; text-align: left; }
  .result-card-top { display: block; }
  .tier-pill { margin-top: .4rem; }
  .site-footer { width: calc(100% - 1rem); flex-direction: column; gap: .5rem; }
}

@media print {
  body { background: white; }
  .site-header, .site-footer, .progress-panel, .results-actions, .button, .review-badge { display: none !important; }
  main { width: 100%; padding: 0; }
  .result-card, .summary-card, .panel { break-inside: avoid; box-shadow: none; }
  .result-details > * { display: block; }
}

/* Integrated start screen: facility-type dropdown */
.sector-select-form { margin-top: 1.5rem; }
.sector-select-form label { display: block; font-weight: 700; margin-bottom: 0.5rem; color: var(--ink); }
.select-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.select-row select { flex: 1 1 16rem; min-height: 2.75rem; padding: 0.5rem 0.75rem; font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 0.375rem; }
.select-row select:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
.sector-status { margin: 0.75rem 0 0; color: var(--muted); }
