:root {
  --brand: #b51f17;
  --brand-dark: #8f1711;
  --brand-soft: #fff5f3;
  --ink: #1f2937;
  --muted: #667085;
  --line: #e8e8e8;
  --success: #16834a;
  --warning: #b86b00;
  --student: #175cd3;
  --parent: #7a3db8;
  --radius: 20px;
  --shadow: 0 18px 45px rgba(35, 20, 17, .12);
}

* { box-sizing: border-box; }
html { background: #f5f5f5; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(181,31,23,.08), transparent 28%),
    linear-gradient(180deg, #fff 0%, #f7f7f7 100%);
}
button, input { font: inherit; }
button { cursor: pointer; }

.app-shell { width: min(980px, 100%); margin: 0 auto; padding: 20px 16px 40px; }
.site-header { position: relative; display: flex; align-items: center; justify-content: center; min-height: 90px; margin-bottom: 18px; }
.brand-logo { display: block; width: min(520px, 78vw); height: auto; object-fit: contain; margin: 0 auto; }
.site-header .offline-indicator { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.offline-indicator {
  display: none;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff2cc;
  color: #7b4d00;
  font-size: 13px;
  font-weight: 700;
}
.offline-indicator.visible { display: inline-flex; }

.main-card {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero { padding: 34px; background: linear-gradient(135deg, var(--brand), #d42d22); color: white; }
.eyebrow { margin: 0 0 10px; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .9; }
h1 { margin: 0; font-size: clamp(34px, 6vw, 58px); line-height: .98; letter-spacing: -.04em; }
.hero p { max-width: 760px; margin: 18px 0 0; font-size: 18px; line-height: 1.55; color: rgba(255,255,255,.92); }
.content { padding: 30px 34px 36px; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btn {
  border: 0;
  border-radius: 14px;
  padding: 14px 19px;
  font-weight: 800;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: white; box-shadow: 0 8px 20px rgba(181,31,23,.22); }
.btn-secondary { background: #f2f4f7; color: #344054; }
.btn-ghost { background: transparent; color: var(--brand); border: 1px solid #e9b7b3; }
.btn-danger { background: #fff1f0; color: #a51d16; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

.intro-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 26px; }
.intro-card { border: 1px solid var(--line); border-radius: 18px; padding: 18px; background: #fff; }
.intro-card strong { display: block; margin-bottom: 7px; font-size: 16px; }
.intro-card p { margin: 0; color: var(--muted); line-height: 1.5; }

.progress-wrap { padding: 22px 34px 0; }
.progress-meta { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 8px; font-size: 14px; font-weight: 700; color: var(--muted); }
.progress { height: 9px; background: #f0f1f3; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: inherit; transition: width .2s ease; }

.question { padding: 28px 34px 34px; }
.question-number { color: var(--brand); font-weight: 800; font-size: 14px; margin-bottom: 8px; }
.question h2 { margin: 0; font-size: clamp(25px, 4vw, 36px); line-height: 1.15; letter-spacing: -.025em; }
.question-help { margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 74px;
  padding: 16px;
  border: 1.5px solid #dedede;
  border-radius: 15px;
  background: white;
  text-align: left;
  color: var(--ink);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.option:hover { border-color: #c6c6c6; }
.option.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(181,31,23,.07); }
.check {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 2px solid #c8c8c8;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 14px;
  font-weight: 900;
}
.option.selected .check { background: var(--brand); border-color: var(--brand); }
.option.locked, .option:disabled { opacity: .42; cursor: not-allowed; background: #f7f7f7; border-color: #e5e5e5; }
.option.locked:hover, .option:disabled:hover { border-color: #e5e5e5; }
.option-label { font-weight: 700; line-height: 1.35; }

.handoff { padding: 36px 34px; text-align: center; }
.handoff-badge { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 30px; margin: 0 auto 18px; }
.handoff h2 { font-size: 34px; margin: 0; }
.handoff p { max-width: 620px; margin: 12px auto 0; color: var(--muted); line-height: 1.6; }

.result-hero { padding: 30px 34px 26px; background: linear-gradient(135deg, #fff8f7, white); border-bottom: 1px solid var(--line); }
.result-top { display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.score { font-size: clamp(50px, 10vw, 82px); line-height: 1; font-weight: 900; color: var(--brand); letter-spacing: -.06em; }
.score-label { margin-top: 7px; color: var(--muted); font-weight: 700; }
.result-message h2 { margin: 0 0 7px; font-size: 29px; }
.result-message p { margin: 0; color: var(--muted); line-height: 1.5; }

.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 22px 34px 0; }
.summary-card { border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.summary-card h3 { margin: 0 0 10px; font-size: 17px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; padding: 7px 10px; border-radius: 999px; font-size: 13px; font-weight: 800; }
.chip-agree { color: #0f6a3b; background: #eaf8f0; }
.chip-discuss { color: #8a5200; background: #fff4dd; }
.chip-student { color: #164b9b; background: #eaf2ff; }
.chip-parent { color: #63308e; background: #f2eafb; }
.chip-empty { color: #667085; background: #f2f4f7; }

.counsellor-title { padding: 28px 34px 14px; }
.counsellor-title h2 { margin: 0; font-size: 30px; }
.counsellor-title p { margin: 8px 0 0; color: var(--muted); }
.comparison-list { padding: 0 34px 30px; display: grid; gap: 14px; }
.comparison-card { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.comparison-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 16px 18px; background: #fafafa; border-bottom: 1px solid var(--line); }
.comparison-head h3 { margin: 0; font-size: 17px; line-height: 1.35; }
.status { flex: 0 0 auto; border-radius: 999px; padding: 6px 9px; font-size: 12px; font-weight: 900; }
.status-full { background: #eaf8f0; color: #0f6a3b; }
.status-partial { background: #fff4dd; color: #8a5200; }
.status-different { background: #fff0ee; color: #a51d16; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.compare-col { padding: 16px 18px 18px; min-width: 0; }
.compare-col + .compare-col { border-left: 1px solid var(--line); }
.compare-label { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.compare-label.agree { color: var(--success); }
.compare-label.student { color: var(--student); }
.compare-label.parent { color: var(--parent); }
.compare-col ul { margin: 0; padding-left: 18px; color: #344054; }
.compare-col li + li { margin-top: 7px; }
.empty { margin: 0; color: #98a2b3; font-style: italic; font-size: 14px; }

.result-actions { padding: 0 34px 34px; display: flex; flex-wrap: wrap; gap: 12px; }
.storage-note { margin: 0 34px 28px; padding: 14px 16px; border-radius: 14px; background: #f8f9fb; color: #59636f; line-height: 1.5; font-size: 14px; }

.site-footer { display: flex; align-items: center; gap: 12px; color: #777; font-size: 12px; padding: 18px 4px 0; }
.site-footer img { width: 30px; height: 40px; object-fit: contain; }

@media (max-width: 720px) {
  .app-shell { padding: 12px 10px 28px; }
  .site-header { min-height: 76px; margin-bottom: 12px; padding: 0 42px; }
  .brand-logo { width: min(500px, 88vw); }
  .site-header .offline-indicator { right: 0; font-size: 11px; padding: 6px 9px; }
  .hero, .content, .question, .handoff, .result-hero { padding-left: 20px; padding-right: 20px; }
  .progress-wrap { padding-left: 20px; padding-right: 20px; }
  .intro-grid, .summary-grid { grid-template-columns: 1fr; }
  .summary-grid, .counsellor-title, .comparison-list, .result-actions { padding-left: 20px; padding-right: 20px; }
  .option-grid { grid-template-columns: 1fr; }
  .result-top { align-items: flex-start; flex-direction: column; }
  .compare-grid { grid-template-columns: 1fr; }
  .compare-col + .compare-col { border-left: 0; border-top: 1px solid var(--line); }
  .comparison-head { flex-direction: column; }
  .storage-note { margin-left: 20px; margin-right: 20px; }
}

@media print {
  body { background: white; }
  .site-header, .site-footer, .result-actions, .storage-note { display: none !important; }
  .app-shell { width: 100%; padding: 0; }
  .main-card { box-shadow: none; border: 0; }
  .comparison-card { break-inside: avoid; }
}
