:root {
  color-scheme: light;
  --ink: #383839;
  --muted: #65737b;
  --sage: #2d99cd;
  --sage-dark: #217ba7;
  --sage-light: #e5f3fa;
  --cream: #f5f8f7;
  --paper: #fff;
  --line: #dce6ea;
  --gold: #99ca3c;
  --shadow: 0 16px 48px rgba(31, 74, 91, .08);
  font-family: "Aptos", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(ellipse at 8% 0%, #e8f5fb 0, transparent 38rem), var(--cream);
}
button, input { font: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
.site-header {
  min-height: 72px;
  padding: 0 clamp(20px, 5vw, 70px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(45, 153, 205, .15);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: .01em; }
.brand-logo { display: block; width: auto; height: 42px; max-width: 34px; object-fit: contain; }
.brand-label { font-size: .95rem; }
.header-note, .site-footer { color: var(--muted); font-size: .86rem; }
.app-shell { width: min(860px, calc(100% - 32px)); margin: 42px auto 56px; }
.loading-card, .intro-card, .question-card, .results-card, .email-card { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.loading-card { padding: 40px; color: var(--muted); }
.intro-card { padding: clamp(28px, 6vw, 60px); overflow: hidden; position: relative; }
.intro-card::after { content: ""; position: absolute; width: 200px; height: 200px; border-radius: 50%; border: 1px solid #d8e9ba; right: -76px; top: -78px; box-shadow: 0 0 0 22px rgba(153, 202, 60, .13), 0 0 0 46px rgba(153, 202, 60, .07); }
.eyebrow { color: var(--sage); font-size: .76rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 620px; margin: 16px 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.2rem, 6vw, 4.1rem); font-weight: 500; line-height: 1.04; letter-spacing: -.04em; }
.intro-lead { max-width: 560px; margin: 0 0 26px; color: #53646b; font-size: 1.1rem; line-height: 1.65; }
.intro-meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 30px; }
.meta-pill { display: inline-flex; gap: 8px; align-items: center; padding: 9px 12px; border: 1px solid var(--line); border-radius: 99px; color: #53646b; background: #fbfdfe; font-size: .88rem; }
.meta-dot { width: 7px; height: 7px; border-radius: 99px; background: var(--gold); }
.privacy-note { max-width: 530px; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.participant-section { margin-top: 28px; padding-top: 25px; border-top: 1px solid var(--line); }
.participant-section h2 { margin: 0 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; font-weight: 500; }
.participant-explanation { max-width: 680px; margin-bottom: 17px; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.participant-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 670px; }
.consent-line { display: flex; align-items: flex-start; gap: 10px; max-width: 670px; margin: 16px 0 20px; color: #53646b; font-size: .86rem; line-height: 1.5; }
.consent-line input { flex: 0 0 auto; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--sage); }
.primary-button, .secondary-button { min-height: 48px; padding: 0 20px; border: 0; border-radius: 12px; font-weight: 700; cursor: pointer; transition: transform .15s ease, background .15s ease; }
.primary-button { color: white; background: var(--sage); box-shadow: 0 7px 18px rgba(45, 153, 205, .2); }
.primary-button:hover { background: var(--sage-dark); transform: translateY(-1px); }
.primary-button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.secondary-button { color: var(--sage-dark); background: var(--sage-light); }
.secondary-button:hover { background: #d6edf7; }
.question-wrap { display: grid; gap: 18px; }
.progress-card { padding: 20px 24px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 254, 250, .78); }
.progress-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; color: var(--muted); font-size: .9rem; }
.progress-title { color: var(--ink); font-weight: 700; }
.progress-track { height: 8px; margin-top: 13px; overflow: hidden; border-radius: 99px; background: #e7edf0; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--sage), var(--gold)); transition: width .2s ease; }
.question-card { padding: clamp(24px, 5vw, 40px); }
.question-card h2, .results-card h2, .email-card h2 { margin-bottom: 8px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.8rem, 4vw, 2.45rem); font-weight: 500; letter-spacing: -.025em; }
.section-intro { margin-bottom: 26px; color: var(--muted); line-height: 1.55; }
.question-list { display: grid; gap: 12px; }
.question-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px; border: 1px solid #e2e9eb; border-radius: 13px; background: #fff; }
.question-text { margin: 0; font-size: .98rem; line-height: 1.48; }
.question-number { margin-right: 7px; color: var(--sage); font-size: .8rem; font-weight: 800; }
.rating-options { display: flex; flex-wrap: wrap; gap: 7px; }
.rating-option { position: relative; }
.rating-option input { position: absolute; opacity: 0; pointer-events: none; }
.rating-option span { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 10px; border: 1px solid #dfe6ea; border-radius: 99px; color: #5c6a70; background: #fcfdfe; cursor: pointer; font-size: .78rem; transition: .15s ease; }
.rating-option input:checked + span { color: white; border-color: var(--sage); background: var(--sage); }
.rating-option input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.question-error { min-height: 20px; margin: 16px 0 0; color: #a63e31; font-size: .88rem; }
.nav-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 2px 4px; }
.quiet-button { border: 0; padding: 12px 8px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 650; }
.quiet-button:disabled { opacity: .4; cursor: default; }
.results-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0 30px; }
.top-gift { min-height: 0; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg, #f2f9fc, #f5f9eb); }
.rank { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-bottom: 17px; border-radius: 99px; color: #385f12; background: #e2f0c7; font-size: .82rem; font-weight: 800; }
.top-gift:nth-child(1) .rank { color: #385f12; background: #d9edb2; }
.top-gift h3 { margin-bottom: 8px; font-family: Georgia, "Times New Roman", serif; font-size: 1.23rem; font-weight: 600; }
.score-label { color: var(--muted); font-size: .86rem; }
.gift-summary { margin: 13px 0 10px; color: #56636a; font-size: .87rem; line-height: 1.5; }
.gift-action { margin: 0; color: #56636a; font-size: .82rem; line-height: 1.5; }
.gift-action strong { color: var(--ink); }
.full-score { margin: 30px 0; padding-top: 26px; border-top: 1px solid var(--line); }
.full-score h3, .email-card h3 { margin-bottom: 16px; font-size: 1rem; }
.score-list { display: grid; gap: 13px; }
.score-line { display: grid; grid-template-columns: minmax(150px, 1.2fr) minmax(100px, 3fr) 48px; gap: 12px; align-items: center; font-size: .87rem; }
.score-meter { height: 8px; overflow: hidden; border-radius: 99px; background: #e6edf0; }
.score-meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2d99cd, #5cb5cf); }
.score-number { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.reflection-note { padding: 15px 17px; border-left: 3px solid var(--gold); border-radius: 0 10px 10px 0; color: #56636a; background: #f7faef; font-size: .9rem; line-height: 1.55; }
.save-status { margin: 18px 0 4px; padding: 12px 15px; border-radius: 10px; color: #425a64; background: #eef7fa; font-size: .9rem; line-height: 1.5; }
.save-status.success { color: #315b36; background: #eff7e5; }
.save-status.error { color: #8a342b; background: #fff1ed; }
.save-retry { padding-left: 0; }
.practice-section { margin-top: 30px; padding: 26px 0 0; border-top: 1px solid var(--line); }
.practice-section h3 { margin: 8px 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.55rem; font-weight: 500; }
.practice-intro { max-width: 690px; margin: 0 0 18px; color: var(--muted); font-size: .92rem; line-height: 1.55; }
.reflection-fields { display: grid; gap: 13px; }
.reflection-field { display: grid; gap: 8px; color: var(--ink); font-size: .9rem; font-weight: 650; }
.reflection-field textarea { width: 100%; min-height: 78px; padding: 11px 12px; border: 1px solid #d8e3e8; border-radius: 10px; color: var(--ink); background: white; font: inherit; font-weight: 400; line-height: 1.45; resize: vertical; }
.reflection-field textarea::placeholder { color: #87959b; }
.reflection-privacy { margin: 12px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.email-card { margin-top: 18px; padding: clamp(22px, 4vw, 32px); }
.email-card p { color: var(--muted); line-height: 1.55; }
.email-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, .7fr) auto; gap: 10px; align-items: end; margin: 18px 0 0; }
.field { display: grid; gap: 7px; }
.field label { font-size: .82rem; font-weight: 700; }
.field input { width: 100%; min-height: 46px; padding: 0 12px; border: 1px solid #d8e3e8; border-radius: 10px; color: var(--ink); background: white; }
.form-status { min-height: 20px; margin: 12px 0 0 !important; font-size: .88rem; }
.form-status.error { color: #a63e31; }
.form-status.success { color: var(--sage-dark); }
.email-unavailable { margin-top: 18px; padding: 18px 20px; border: 1px dashed #cddfe6; border-radius: 14px; background: #f5fafc; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.site-footer { padding: 18px 24px 32px; text-align: center; }
.print-report { display: none; }
.report-title { margin: 0 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 30px; font-weight: 500; }
.print-report h2 { margin: 20px 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 19px; font-weight: 500; }
.report-subtitle { margin: 0 0 22px; color: #5f6c72; }
.report-top { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0; }
.report-top-card { padding: 14px; border: 1px solid #d5e3e8; border-radius: 10px; }
.report-top-card strong { display: block; margin: 8px 0 4px; font-family: Georgia, "Times New Roman", serif; font-size: 18px; }
.report-section { margin: 18px 0; padding-top: 14px; border-top: 1px solid #dce6ea; break-inside: avoid; }
.report-section h3 { margin: 0 0 6px; font-family: Georgia, "Times New Roman", serif; font-size: 18px; }
.report-section p { margin: 0 0 8px; line-height: 1.45; }
.report-reflection-section { break-inside: auto; }
.report-reflection { margin: 13px 0; break-inside: avoid; }
.report-reflection h3 { margin: 0 0 5px; font-size: 12pt; }
.report-reflection p { margin: 0; padding: 9px 10px; border-left: 2px solid #99ca3c; background: #f5f8f7; white-space: pre-wrap; }
.report-writing-lines { height: 48px; background: repeating-linear-gradient(to bottom, transparent 0 22px, #dce6ea 22px 23px); }
.report-small { color: #5f6c72; font-size: 10pt; }
@media (max-width: 680px) {
  .site-header { min-height: 62px; padding: 0 16px; }
  .header-note { display: none; }
  .brand { gap: 9px; }
  .brand-logo { height: 36px; max-width: 28px; }
  .brand-label { font-size: .82rem; }
  .app-shell { margin: 22px auto 38px; }
  .results-grid { grid-template-columns: 1fr; }
  .top-gift { min-height: 0; }
  .rank { margin-bottom: 10px; }
  .email-form { grid-template-columns: 1fr; }
  .email-form button { width: 100%; }
  .participant-fields { grid-template-columns: 1fr; }
  .participant-section .primary-button { width: 100%; }
  .score-line { grid-template-columns: minmax(125px, 1.2fr) minmax(55px, 2fr) 42px; gap: 8px; font-size: .8rem; }
}
@media (max-width: 360px) {
  .brand { gap: 7px; }
  .brand-logo { height: 31px; max-width: 24px; }
  .brand-label { font-size: .76rem; }
}
@media print {
  @page { size: letter; margin: .65in; }
  body { color: #383839; background: white; font-size: 10pt; }
  body > *:not(#print-report) { display: none !important; }
  #print-report { display: block !important; padding: 0; }
  .report-title { font-size: 25pt; }
  .report-top-card, .report-section { break-inside: avoid; }
  .report-top { gap: 8px; }
}
