:root {
  --ink: #241039;
  --muted: #51485a;
  --paper: #fff8ed;
  --cream: #fff8ed;
  --blush: #ffd9e9;
  --gold: #f6b71b;
  --teal: #ec0874;
  --teal-dark: #4d2188;
  --violet: #7134bd;
  --rose: #ec0874;
  --line: #241039;
  --white: #ffffff;
  --shadow: 8px 8px 0 var(--blush);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.site-header {
  min-height: 76px;
  padding: 12px clamp(20px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 8px solid var(--teal);
  border-bottom: 2px solid var(--line);
  background: rgba(255, 248, 237, .97);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; border: 2px solid var(--ink); background: var(--teal); box-shadow: 4px 4px 0 var(--gold); color: var(--white); font-weight: 950; letter-spacing: -.05em; }
.brand strong, .brand small { display: block; }
.brand strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.15rem; }
.brand strong em { color: var(--teal); font-style: normal; }
.brand small { color: var(--muted); font-size: .78rem; }
.save-state { color: var(--teal-dark); font-size: .82rem; font-weight: 700; }

.app-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); max-width: 1440px; margin: 0 auto; }
.sidebar { min-height: calc(100vh - 76px); padding: 42px 24px; border-right: 2px solid var(--line); background: var(--white); }
.eyebrow { margin: 0 0 8px; color: var(--teal); font-weight: 950; font-size: .75rem; letter-spacing: .13em; text-transform: uppercase; }
nav { display: grid; gap: 8px; }
nav a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; color: var(--ink); text-decoration: none; border-radius: 12px; font-weight: 700; }
nav a span { width: 26px; height: 26px; display: grid; place-items: center; border: 2px solid var(--ink); background: var(--cream); font-size: .78rem; }
nav a:hover, nav a.active { background: var(--blush); color: var(--ink); }
nav a.active span { background: var(--teal); color: white; }
.sidebar-note { margin-top: 34px; padding: 16px; border: 2px solid var(--ink); background: var(--blush); box-shadow: 5px 5px 0 var(--gold); font-size: .8rem; }
.sidebar-note p { margin: 5px 0 0; color: var(--muted); }

main { min-width: 0; padding: clamp(36px, 6vw, 76px); }
.view { max-width: 980px; margin: 0 auto; }
.hero { padding: clamp(28px, 5vw, 56px); margin-bottom: 32px; color: var(--ink); border: 2px solid var(--ink); background: linear-gradient(135deg, var(--white) 0 74%, var(--blush) 74%); box-shadow: 10px 10px 0 var(--teal); }
.hero.compact { padding: 34px 40px; }
.hero .eyebrow { color: var(--teal); }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 3.7rem); line-height: 1.04; letter-spacing: -.035em; }
.hero p:last-child { max-width: 700px; margin: 18px 0 0; color: var(--muted); font-size: 1.08rem; }
.lede { max-width: 760px; margin: 8px 0 26px; color: var(--muted); font-size: 1.05rem; }
.panel { padding: clamp(22px, 4vw, 38px); border: 2px solid var(--line); background: var(--white); box-shadow: var(--shadow); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
label, legend { font-weight: 800; }
select, input[type="text"], input[type="date"], textarea { width: 100%; margin-top: 8px; padding: 12px 13px; color: var(--ink); background: var(--white); border: 2px solid var(--ink); border-radius: 0; }
select:focus, input:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(22,123,120,.25); outline-offset: 2px; }
fieldset { margin: 0; padding: 0; border: 0; }
.full-width { grid-column: 1 / -1; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin-top: 10px; }
.check-grid label { padding: 12px; border: 2px solid var(--ink); background: var(--cream); font-weight: 600; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--teal); }
.button-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.button { padding: 11px 18px; border: 2px solid var(--ink); border-radius: 0; cursor: pointer; font-weight: 950; }
.button.primary { color: white; background: var(--teal); box-shadow: 5px 5px 0 var(--gold); }
.button.primary:hover { background: var(--teal-dark); }
.button.secondary { color: var(--ink); background: var(--white); box-shadow: 4px 4px 0 var(--blush); }
.button.danger { color: var(--ink); background: var(--blush); }
.microcopy { color: var(--muted); font-size: .79rem; }

.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.score-card { min-width: 105px; padding: 13px; text-align: center; border: 2px solid var(--ink); background: var(--blush); box-shadow: 4px 4px 0 var(--gold); }
.score-card strong, .score-card span { display: block; }
.score-card strong { color: var(--teal-dark); font-size: 1.5rem; }
.score-card span { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.question-list { display: grid; gap: 14px; }
.question-card { padding: 22px; border: 2px solid var(--line); background: white; }
.question-card legend { margin-bottom: 12px; font-size: 1.03rem; }
.question-card p { margin: -7px 0 14px; color: var(--muted); font-size: .86rem; }
.answer-row { display: flex; gap: 8px; flex-wrap: wrap; }
.answer-row label { padding: 8px 12px; border: 2px solid var(--line); font-size: .84rem; font-weight: 700; cursor: pointer; }
.answer-row label:has(input:checked) { border-color: var(--ink); background: var(--blush); color: var(--ink); box-shadow: 3px 3px 0 var(--teal); }
.sticky-actions { position: sticky; bottom: 14px; margin-top: 22px; padding: 14px; border: 2px solid var(--line); background: rgba(255,248,237,.97); box-shadow: var(--shadow); }

.topic-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.topic-filter button { padding: 8px 12px; border: 2px solid var(--line); background: white; cursor: pointer; font-weight: 800; color: var(--ink); }
.topic-filter button.active { background: var(--teal); color: white; border-color: var(--ink); box-shadow: 3px 3px 0 var(--gold); }
.resource-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.resource-card { padding: 22px; border: 2px solid var(--line); background: white; box-shadow: 5px 5px 0 var(--blush); }
.resource-card .tag { display: inline-block; margin-bottom: 8px; color: var(--teal-dark); font-size: .7rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.resource-card h2 { margin: 0 0 8px; font-family: Georgia, serif; font-size: 1.25rem; }
.resource-card p { color: var(--muted); font-size: .88rem; }
.resource-card a { color: var(--teal-dark); font-weight: 900; }
.verified { display: block; margin-top: 14px; color: var(--muted); font-size: .7rem; }
.boundary-box { margin-top: 24px; padding: 20px 22px; border: 2px solid var(--ink); border-left: 9px solid var(--teal); background: var(--blush); }
.boundary-box p { margin: 6px 0 0; color: var(--muted); }

.summary-strip { display: flex; gap: 16px; flex-wrap: wrap; margin: 20px 0; }
.summary-strip div { min-width: 150px; padding: 14px 18px; border: 2px solid var(--ink); background: var(--blush); box-shadow: 4px 4px 0 var(--gold); }
.summary-strip strong, .summary-strip span { display: block; }
.summary-strip strong { font-size: 1.4rem; }
.summary-strip span { color: var(--muted); font-size: .75rem; }
.plan-list { display: grid; gap: 14px; }
.plan-item { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; padding: 20px; border: 2px solid var(--line); background: white; box-shadow: 5px 5px 0 var(--blush); }
.plan-item.done { opacity: .62; }
.plan-item.done h2 { text-decoration: line-through; }
.plan-item h2 { margin: 0 0 4px; font-size: 1.05rem; }
.plan-item p { margin: 0; color: var(--muted); font-size: .87rem; }
.plan-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 15px; }
.plan-fields label { font-size: .76rem; }
.plan-fields .wide { grid-column: 1 / -1; }
.plan-fields select, .plan-fields input, .plan-fields textarea { padding: 8px 10px; font-size: .82rem; }
.priority { padding: 5px 8px; color: white; background: var(--rose); border: 2px solid var(--ink); font-size: .68rem; font-weight: 900; text-transform: uppercase; }
.priority.medium { background: var(--gold); color: var(--ink); }
.empty-state { padding: 38px; text-align: center; border: 2px dashed var(--ink); color: var(--muted); }
.data-tools { display: flex; justify-content: space-between; gap: 24px; align-items: center; margin-top: 32px; padding: 22px; border: 2px solid var(--ink); background: var(--white); box-shadow: 5px 5px 0 var(--gold); }
.data-tools h2 { margin: 0 0 4px; font-family: Georgia, serif; }
.data-tools p { margin: 0; color: var(--muted); font-size: .85rem; }

footer { padding: 28px clamp(20px, 4vw, 56px); border-top: 2px solid var(--line); background: var(--blush); color: var(--ink); font-size: .78rem; }
footer p { max-width: 1100px; margin: 0 auto; }

@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { min-height: 0; padding: 14px 18px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .sidebar > .eyebrow, .sidebar-note { display: none; }
  nav { display: flex; min-width: 650px; }
  main { padding: 30px 18px 54px; }
  .form-grid, .resource-grid { grid-template-columns: 1fr; }
  .check-grid { grid-template-columns: 1fr; }
  .plan-item { grid-template-columns: auto 1fr; }
  .plan-item .priority { grid-column: 2; justify-self: start; }
  .plan-fields { grid-template-columns: 1fr; }
  .plan-fields .wide { grid-column: auto; }
  .data-tools { display: block; }
  .data-tools .button-row { margin-top: 16px; }
  .site-header { padding: 10px 18px; }
  .save-state { display: none; }
}

@media print {
  .site-header, .sidebar, .button, footer, #profile, #health-check, #resources { display: none !important; }
  .app-shell { display: block; }
  main { padding: 0; }
  #action-plan { display: block !important; }
  .plan-item { break-inside: avoid; }
}
