:root {
  --paper: #F5F1E8;
  --white: #FFFFFF;
  --ink: #2B2420;
  --ink-soft: #5B4F42;
  --ink-faint: #A69A8A;
  --label: #8A7C6B;
  --accent: #B1552F;
  --accent-hover: #8F4324;
  --accent-tint: #F5E6DA;
  --border-soft: rgba(43, 36, 32, 0.25);
  --border-hair: rgba(43, 36, 32, 0.12);
  --border-faint: rgba(43, 36, 32, 0.09);
  --tint-04: rgba(43, 36, 32, 0.045);
  --tint-06: rgba(43, 36, 32, 0.06);
  --tint-07: rgba(43, 36, 32, 0.07);
  --strength-bg: #2B2420;
  --strength-fg: #FAF6EF;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Source Sans 3', system-ui, -apple-system, sans-serif;
}

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

::selection { background: #E7D2BC; }

button, input { font-family: inherit; }

.page {
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 64px 20px 96px;
}

.wrap {
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 52px;
}

/* Header */
.header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border-hair);
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--label);
}
.h1 {
  margin: 0;
  font-family: 'Lora', Georgia, serif;
  font-weight: 500;
  font-size: 44px;
  line-height: 1.15;
  color: var(--ink);
}
.subtitle {
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  font-size: 19px;
  color: var(--ink-soft);
}
.lede {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 520px;
  margin: 0 auto;
}
.byline {
  font-size: 13px;
  color: var(--label);
  margin-top: 8px;
}

/* Cards */
.card {
  background: var(--white);
  border: 1px solid var(--border-hair);
  border-radius: 6px;
  padding: 32px;
}

/* Intro / metadata */
.meta-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.field {
  flex: 1;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--label);
}
.field input {
  border: none;
  border-bottom: 1px solid var(--border-soft);
  background: transparent;
  padding: 6px 2px;
  font-size: 16px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}
.field input:focus { border-bottom-color: var(--accent); }

.context-row { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.pills { display: flex; gap: 10px; flex-wrap: wrap; }
.pill {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid var(--border-soft);
  background: var(--white);
  color: var(--ink-soft);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.pill:hover { border-color: var(--accent); }
.pill.selected { background: var(--accent-tint); border-color: var(--accent); color: var(--accent); }

.intro-note {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-soft);
  padding-top: 14px;
  border-top: 1px solid var(--border-hair);
}

/* Progress */
.progress { display: flex; flex-direction: column; gap: 8px; }
.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--label);
}
.progress-track {
  width: 100%;
  height: 6px;
  background: var(--tint-06);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.2s ease;
}
.reset-link {
  align-self: flex-start;
  font-size: 12px;
  color: var(--ink-faint);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.reset-link:hover { color: var(--accent); }

/* Domain */
.domain { display: flex; flex-direction: column; gap: 24px; padding-top: 8px; }
.domain-head { display: flex; gap: 20px; align-items: flex-start; }
.domain-icon {
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.domain-meta { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.domain-eyebrow { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--label); }
.domain-title {
  margin: 0;
  font-family: 'Lora', Georgia, serif;
  font-weight: 500;
  font-size: 25px;
  color: var(--ink);
}
.domain-title .domain-sub { font-style: italic; font-weight: 400; color: var(--ink-soft); }
.domain-anchor { font-family: 'Lora', Georgia, serif; font-style: italic; font-size: 14px; color: var(--label); }

.legend { font-size: 12px; color: var(--label); padding: 10px 14px; background: var(--tint-04); border-radius: 4px; }

.items-card { background: var(--white); border: 1px solid var(--border-hair); border-radius: 6px; padding: 8px 28px; }
.item { padding: 18px 0; border-bottom: 1px solid var(--border-faint); display: flex; flex-direction: column; gap: 14px; }
.item:last-child { border-bottom: none; }
.item-text { font-size: 16px; line-height: 1.55; color: var(--ink); }
.item-cite { font-size: 12px; color: var(--ink-faint); margin-top: 4px; }
.options { display: flex; gap: 10px; }
.opt-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  border: 1.5px solid var(--border-soft);
  background: var(--white);
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.1s;
}
.opt-btn:hover { border-color: var(--accent); }
.opt-btn:active { transform: scale(0.94); }
.opt-btn.selected { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Domain score */
.score-card { display: flex; flex-direction: column; gap: 16px; }
.score-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.score-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--label); }
.score-value-row { display: flex; align-items: baseline; gap: 8px; }
.score-value { font-family: 'Lora', Georgia, serif; font-size: 30px; color: var(--ink); }
.score-max { font-size: 13px; color: var(--label); }
.score-hint { font-size: 13px; color: var(--ink-faint); }

.bands { display: flex; flex-direction: column; gap: 8px; }
.band-row { display: flex; gap: 12px; padding: 10px 12px; border-radius: 4px; background: transparent; }
.band-row.active { background: var(--accent-tint); }
.band-range { font-size: 12px; font-weight: 600; color: var(--ink-faint); flex-shrink: 0; width: 60px; }
.band-row.active .band-range { color: var(--accent); }
.band-text { font-size: 13px; color: var(--ink-faint); line-height: 1.5; }
.band-row.active .band-text { color: var(--ink); }

.recommendation {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 16px;
  margin-top: 4px;
  border-top: 1px solid var(--border-hair);
}
.recommendation-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  font-weight: 600;
}
.recommendation-text {
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
}

/* Synthesis */
.synthesis { display: flex; flex-direction: column; gap: 24px; padding-top: 16px; border-top: 1px solid var(--border-hair); }
.synthesis-head { display: flex; flex-direction: column; gap: 6px; text-align: center; }
.synthesis-title { margin: 0; font-family: 'Lora', Georgia, serif; font-weight: 500; font-size: 28px; color: var(--ink); }
.synthesis-sub { font-size: 14px; color: var(--label); }
.synthesis-table { background: var(--white); border: 1px solid var(--border-hair); border-radius: 6px; overflow: hidden; }
.synthesis-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--border-faint); }
.synthesis-row:last-child { border-bottom: none; }
.synthesis-name { font-size: 15px; color: var(--ink); }
.synthesis-name .domain-sub { color: var(--label); font-style: italic; }
.synthesis-right { display: flex; align-items: center; gap: 16px; }
.synthesis-score { font-family: 'Lora', Georgia, serif; font-size: 17px; color: var(--ink); width: 58px; text-align: right; }
.status-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  min-width: 96px;
  text-align: center;
}
.status-badge[data-status="priority"] { background: var(--accent-tint); color: var(--accent); }
.status-badge[data-status="developing"] { background: var(--tint-07); color: var(--ink-soft); }
.status-badge[data-status="strength"] { background: var(--strength-bg); color: var(--strength-fg); }
.status-badge[data-status="incomplete"] { background: var(--tint-06); color: var(--ink-faint); }

.synthesis-note { font-size: 14px; text-align: center; color: var(--label); }
.synthesis-note.complete { color: var(--ink-soft); font-style: italic; }

.download-row { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 8px; }
.download-btn {
  padding: 12px 28px;
  border-radius: 4px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.download-btn:hover { background: var(--accent-hover); }
.download-btn:disabled { background: var(--tint-06); color: var(--ink-faint); cursor: not-allowed; }
.download-hint { font-size: 12px; color: var(--ink-faint); text-align: center; max-width: 380px; }

/* Scoring reference */
.reference { background: var(--tint-04); border-radius: 6px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.reference-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--label); }
.reference-rows { display: flex; flex-direction: column; gap: 8px; }
.reference-row { display: flex; gap: 12px; }
.reference-range { font-size: 12px; font-weight: 600; color: var(--ink-soft); flex-shrink: 0; width: 64px; }
.reference-text { font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.reference-footnote { font-size: 12px; color: var(--ink-faint); padding-top: 10px; border-top: 1px solid var(--border-hair); line-height: 1.6; }

/* Footer */
.footer { text-align: center; font-size: 12px; color: var(--ink-faint); padding-top: 8px; }

@media (max-width: 480px) {
  .h1 { font-size: 34px; }
  .card { padding: 22px; }
  .items-card { padding: 6px 18px; }
}

@media print {
  body { background: #fff; }
  .page { padding: 0; }
  .reset-link { display: none; }
  .download-row { display: none; }
  .opt-btn { border: 1px solid #000; color: #000; }
  .opt-btn.selected { background: #ddd; border-color: #000; color: #000; }
}
