:root {
  --ink: #182831;
  --deep: #111d25;
  --mint: #a9e6c9;
  --mint-dark: #2c7057;
  --lavender: #c9b9f3;
  --paper: #f4f7f5;
  --line: #d9e3df;
  --muted: #52666a;
  --red: #9e3f3a;
  font-family: Inter, "Avenir Next", Avenir, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
button, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, textarea:focus-visible, input:focus-visible, .map-scroll:focus-visible {
  outline: 3px solid #806bc1;
  outline-offset: 3px;
}
[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; }
h1, h2, h3, p { margin-top: 0; }

.masthead {
  min-height: 70px;
  padding: 12px clamp(20px, 3vw, 54px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #fff;
  background: var(--deep);
  border-bottom: 1px solid #40545a;
}
.brand { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 850; line-height: 1; letter-spacing: .14em; }
.brand small { color: var(--mint); font-size: 8px; letter-spacing: .21em; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border: 2px solid var(--mint); border-radius: 10px; color: var(--mint); font: italic 25px Georgia, serif; letter-spacing: 0; }
.masthead-label { color: #b8cdca; font-size: 10px; font-weight: 800; letter-spacing: .2em; }

.intro {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 38px;
  padding: 30px clamp(20px, 3vw, 54px) 34px;
  color: #fff;
  background: linear-gradient(115deg, var(--deep) 52%, #243d43);
}
.intro::before, .intro::after { content: ""; position: absolute; width: 300px; height: 300px; border: 1px solid rgba(169,230,201,.22); border-radius: 50%; right: 15%; top: -215px; pointer-events: none; }
.intro::after { width: 390px; height: 390px; right: -110px; top: -120px; border-color: rgba(201,185,243,.2); }
.intro > * { position: relative; z-index: 1; }
.intro > div:first-child { max-width: 740px; }
.eyebrow { margin-bottom: 8px; color: var(--mint-dark); font-size: 10px; font-weight: 850; letter-spacing: .18em; text-transform: uppercase; }
.intro .eyebrow { color: var(--mint); }
h1 { margin-bottom: 10px; font-size: clamp(34px, 4vw, 54px); line-height: 1.04; letter-spacing: -.05em; }
.intro p:not(.eyebrow) { margin-bottom: 0; color: #d6e2df; font-size: 15px; line-height: 1.5; }
.case-facts { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; max-width: 500px; }
.case-facts span { padding: 8px 11px; border: 1px solid #49616a; border-radius: 100px; color: #dbeae5; font-size: 11px; white-space: nowrap; }

.taskbar {
  position: sticky;
  z-index: 8;
  top: 0;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 220px auto auto;
  align-items: center;
  gap: 18px;
  padding: 13px clamp(20px, 3vw, 54px);
  background: rgba(250,252,250,.97);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(18,40,40,.06);
}
.taskbar > p { max-width: 600px; margin: 0; font-size: 14px; line-height: 1.4; font-weight: 650; }
.budget { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 1px 8px; font-size: 10px; color: var(--muted); }
.budget strong { color: #24694e; font-size: 24px; letter-spacing: -.05em; }
.budget-used { grid-column: 1 / -1; }
.budget-track { grid-column: 1 / -1; height: 5px; margin-top: 5px; overflow: hidden; border-radius: 10px; background: #d9e6df; }
.budget-track div { width: 0; height: 100%; background: #39966f; transition: width .2s; }
.button { min-height: 43px; padding: 10px 15px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button-primary { color: #102821; background: var(--mint); }
.button-primary:hover { background: #88dcb5; }
.button-quiet { color: #3c5458; border-color: #c5d3cd; background: transparent; }
.button-outline { color: #285b49; border-color: #8dbba5; background: #fff; }

.map-section { max-width: 1700px; margin: 0 auto; padding: 34px clamp(20px, 3vw, 54px) 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.section-heading h2 { margin: 0; font-size: clamp(25px, 2.3vw, 34px); line-height: 1.1; letter-spacing: -.04em; }
.section-heading > p { margin: 0; color: var(--muted); font-size: 12px; }
.map-hint { margin: 13px 0 17px; color: var(--muted); font-size: 12px; }
.map-scroll { overflow: auto; overscroll-behavior-x: contain; border: 1px solid #c9d7d2; border-radius: 15px; background: #fff; box-shadow: 0 16px 38px rgba(20,42,43,.08); }
.map-canvas { position: relative; width: 100%; }
.map-canvas.is-zoomed { width: max(100%, 2600px); }
.map-canvas img { display: block; width: 100%; height: auto; }
.risk-pin {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 3px solid #fff;
  border-radius: 50%;
  color: #231a45;
  background: var(--lavender);
  box-shadow: 0 2px 0 #6d5da0, 0 2px 14px rgba(37,35,60,.25);
  font-size: 17px;
  font-weight: 850;
  z-index: 2;
}
.risk-pin:hover, .risk-pin:focus-visible { background: #b8a5f1; transform: translate(-50%, -50%) scale(1.1); }
.risk-pin.has-selection { color: #103628; background: var(--mint); box-shadow: 0 2px 0 #31765a, 0 2px 14px rgba(27,79,57,.25); }

.lower-sections { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 34px; max-width: 1700px; margin: 0 auto; padding: 40px clamp(20px, 3vw, 54px) 70px; }
.test-placeholder, .test-result { min-height: 150px; margin-top: 19px; padding: 21px 23px; border: 1px solid #cddbd6; border-radius: 13px; background: #eaf0ed; }
.test-placeholder p { margin: 0; color: var(--muted); font-size: 14px; }
.test-result h3 { margin: 0 0 10px; font-size: 20px; letter-spacing: -.02em; }
.test-result p { margin: 0 0 10px; color: #31474b; font-size: 13px; line-height: 1.5; }
.test-result p:last-child { margin-bottom: 0; }
.test-result.fail { background: #fff0ec; border-color: #e3b9b1; }
.test-result.pass { background: #e6f6ec; border-color: #aed8bd; }
.result-label { color: var(--red) !important; font-size: 10px !important; font-weight: 900; letter-spacing: .15em; }
.pass .result-label { color: #286f50 !important; }
.consequence { font-weight: 700; }
.success-reasons { display: grid; gap: 9px; margin: 14px 0 0; padding: 0; list-style: none; }
.success-reasons li { padding-top: 9px; border-top: 1px solid #c1dec9; color: #28483b; font-size: 12px; line-height: 1.5; }
.success-reasons strong { display: block; color: #183b2d; }
.review-locked { min-height: 150px; margin: 19px 0 0; padding: 21px 23px; border: 1px solid #cddbd6; border-radius: 13px; color: var(--muted); background: #eaf0ed; font-size: 14px; }
.review-transition { margin: 19px 0 13px; padding: 13px 15px; border: 1px solid #aed8bd; border-radius: 10px; background: #e6f6ec; }
.review-transition p { margin: 0; color: #274b3b; font-size: 13px; line-height: 1.5; }
.review-transition .review-step { margin-bottom: 4px; color: #286f50; font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.review-instructions { margin: 0 0 13px; color: #31474b; font-size: 13px; line-height: 1.5; }
.tolerance-note { margin-bottom: 16px; padding: 12px 14px; border-left: 4px solid #7cba9e; border-radius: 8px; background: #e6f1eb; }
.tolerance-note strong { display: block; margin-bottom: 4px; color: #245b42; font-size: 12px; }
.tolerance-note p { margin: 0; color: #37534a; font-size: 12px; line-height: 1.5; }
.review-items { display: grid; gap: 10px; }
.review-item { min-width: 0; margin: 0; padding: 12px 13px 11px; border: 1px solid #cadad3; border-radius: 10px; background: #fff; }
.review-question { margin: 0; color: #203a3d; font-size: 13px; font-weight: 700; line-height: 1.4; }
.review-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-top: 9px; }
.review-choice { display: flex; align-items: center; gap: 6px; min-height: 37px; padding: 7px 8px; border: 1px solid #d5e1db; border-radius: 7px; color: #385652; background: #f9fbf9; cursor: pointer; font-size: 11px; line-height: 1.2; }
.review-choice:has(input:checked) { border-color: #367a5c; color: #194a33; background: #e5f5eb; font-weight: 750; }
.review-choice input { flex: none; width: 13px; height: 13px; margin: 0; accent-color: #2d7654; }
.review-item.review-correct { border-color: #7fba96; }
.review-item.review-incorrect { border-color: #d19186; background: #fff7f5; }
.review-item-feedback { margin: 9px 0 0; color: #32544a; font-size: 11px; line-height: 1.45; }
.review-incorrect .review-item-feedback { color: #8a3d37; }
.review-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 15px; }
.review-status { min-height: 18px; margin: 10px 0 0; color: #365c52; font-size: 12px; line-height: 1.4; }
.review-status.needs-review { color: #8a3d37; }
.review-status.complete { color: #256b4e; font-weight: 700; }

.modal-open { overflow: hidden; }
.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(5,18,22,.77); }
.modal { width: min(720px, 100%); max-height: min(92vh, 850px); overflow: auto; padding: 24px 26px 22px; border-radius: 16px; background: #fbfcfa; box-shadow: 0 32px 88px rgba(0,0,0,.3); }
.modal-top { display: flex; justify-content: space-between; gap: 18px; }
.modal-top h2 { margin-bottom: 13px; font-size: 28px; letter-spacing: -.04em; }
.modal-close { flex: none; width: 38px; height: 38px; border: 1px solid #c6d3ce; border-radius: 50%; color: #3b5154; background: #fff; font-size: 27px; line-height: 1; }
.modal-description { margin-bottom: 10px; color: #31494e; font-size: 13px; line-height: 1.5; }
.case-evidence { margin-bottom: 18px; padding: 10px 12px; border-left: 3px solid #76bd9e; border-radius: 6px; color: #3d5752; background: #e9f3ed; font-size: 12px; line-height: 1.5; }
.modal-options { display: grid; gap: 9px; }
.option-card { display: flex; align-items: start; gap: 11px; padding: 12px 14px; border: 1.5px solid #cedbd5; border-radius: 10px; background: #fff; cursor: pointer; }
.option-card:hover { border-color: #81ad97; }
.option-card.selected { border-color: #39845f; background: #edf8f1; }
.option-card.unavailable { opacity: .56; cursor: not-allowed; }
.option-card input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: #2d7654; }
.option-body { display: block; width: 100%; }
.option-head { display: flex; justify-content: space-between; gap: 15px; font-size: 13px; line-height: 1.35; }
.option-head b { color: #286b4f; white-space: nowrap; }
.option-detail { display: block; margin-top: 4px; color: #52666a; font-size: 11px; line-height: 1.45; }
.option-unavailable { display: block; margin-top: 5px; color: var(--red); font-size: 10px; font-weight: 800; }
.modal-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding-top: 15px; border-top: 1px solid #dbe5df; color: #315b49; font-size: 13px; font-weight: 800; }

@media (max-width: 1080px) {
  .intro { align-items: start; flex-direction: column; gap: 16px; }
  .case-facts { justify-content: start; max-width: none; }
  .taskbar { grid-template-columns: minmax(0,1fr) 210px auto auto; gap: 10px; }
}
@media (max-width: 790px) {
  .taskbar { grid-template-columns: minmax(0,1fr) auto auto; }
  .taskbar > p { grid-column: 1 / -1; }
  .lower-sections { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .masthead { min-height: 61px; }
  .masthead-label { display: none; }
  .intro { padding-top: 24px; padding-bottom: 26px; }
  .intro p:not(.eyebrow) { font-size: 13px; }
  .case-facts span { font-size: 10px; }
  .taskbar { grid-template-columns: 1fr 1fr; gap: 9px; }
  .taskbar > p, .budget { grid-column: 1 / -1; }
  .taskbar > p { font-size: 12px; }
  .budget { grid-template-columns: 1fr auto 1fr; align-items: center; }
  .budget-used { grid-column: 3; text-align: right; }
  .budget-track { grid-column: 1 / -1; }
  .taskbar .button { padding: 9px; font-size: 11px; }
  .map-section { padding-top: 26px; }
  .section-heading h2 { font-size: 25px; }
  .map-hint { font-size: 11px; }
  .map-canvas { width: 1600px; }
  .map-canvas.is-zoomed { width: 2300px; }
  .risk-pin { width: 39px; height: 39px; }
  .lower-sections { padding-top: 32px; }
  .review-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .review-choice { align-items: start; flex-direction: column; font-size: 11px; }
  .modal { padding: 21px 17px 16px; }
  .modal-top h2 { font-size: 24px; }
  .option-head { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .budget-track div { transition: none; }
}
