/* ============ Tokens ============ */
:root {
  --navy-950: #0b0824;
  --navy-900: #120d36;
  --navy-800: #1b1550;
  --navy-700: #2a2270;
  --purple: #7c5cff;
  --purple-600: #6a48f5;
  --purple-100: #ece7ff;
  --blue: #3b82f6;
  --blue-100: #e3edff;
  --yellow: #ffc93c;
  --yellow-600: #f2b417;
  --yellow-100: #fff4d6;
  --green: #16a36a;
  --green-100: #dcf6ea;
  --amber: #e08a00;
  --amber-100: #fff0d4;
  --red: #e5484d;
  --red-100: #fde4e4;

  --surface: #ffffff;
  --surface-2: #f5f4fa;
  --line: #e6e3f0;
  --ink: #17132f;
  --ink-2: #4b4766;
  --ink-3: #7a7694;
  --on-dark: #f3f1ff;
  --on-dark-2: #b9b3e0;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 1px 2px rgba(18, 13, 54, 0.06), 0 8px 24px rgba(18, 13, 54, 0.08);
  --shadow-lg: 0 24px 60px rgba(5, 3, 20, 0.35);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", var(--font);
  --max: 1120px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--on-dark);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(124, 92, 255, 0.35), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(59, 130, 246, 0.18), transparent 60%),
    var(--navy-950);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ============ Top bar ============ */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11, 8, 36, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.topbar-inner {
  max-width: var(--max); margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.brand-logo { height: 48px; width: auto; }
.brand-divider { width: 1px; height: 28px; background: rgba(255, 255, 255, 0.2); }
.brand-product { font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--yellow); letter-spacing: 0.02em; white-space: nowrap; }
.print-brand { display: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--purple), var(--blue)); color: var(--yellow);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 13px; letter-spacing: 0.12em; }
.brand-text small { font-size: 12px; color: var(--on-dark-2); }
.topbar-score {
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px;
  border-radius: 999px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.1);
}
.pill-label { font-size: 12px; color: var(--on-dark-2); }
.pill-value {
  font-family: var(--display); font-weight: 700; font-size: 14px;
  background: var(--yellow); color: var(--navy-900); border-radius: 999px; padding: 2px 10px; min-width: 40px; text-align: center;
  transition: transform 0.3s var(--ease);
}
.pill-value.bump { transform: scale(1.15); }

/* Stepper */
.stepper {
  max-width: var(--max); margin: 0 auto; padding: 0 16px 12px;
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
}
.stepper::-webkit-scrollbar { display: none; }
.step {
  flex: 1 0 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px;
  background: none; border: 0; padding: 0; text-align: left; color: var(--on-dark-2); font-size: 12px; font-weight: 600;
}
.step:disabled { cursor: default; }
.step-bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.step-bar i { display: block; height: 100%; width: 0; background: var(--yellow); transition: width 0.5s var(--ease); }
.step.is-current { color: var(--on-dark); }
.step.is-done { color: var(--on-dark); }
.step.is-done .step-bar i { background: linear-gradient(90deg, var(--yellow), #ffe08a); }

/* ============ Layout ============ */
main { flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 28px 16px 48px; outline: none; }
.screen { animation: enter 0.45s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.footer {
  max-width: var(--max); width: 100%; margin: 0 auto; padding: 20px 16px 28px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font-size: 13px; color: var(--on-dark-2); border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.footer-tag { color: var(--yellow); font-weight: 600; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--yellow);
}
.eyebrow::before { content: ""; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(34px, 6vw, 60px); }
h2 { font-size: clamp(24px, 3.4vw, 34px); }
h3 { font-size: 18px; }
.lead { font-size: clamp(16px, 2vw, 19px); color: var(--on-dark-2); max-width: 620px; margin: 14px 0 0; }
.hl { color: var(--yellow); }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 22px; border-radius: 14px; border: 0;
  font-weight: 700; font-size: 15px; text-decoration: none;
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), background 0.2s, opacity 0.2s;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary { background: var(--yellow); color: var(--navy-900); box-shadow: 0 8px 24px rgba(255, 201, 60, 0.3); }
.btn-primary:hover { background: #ffd35e; box-shadow: 0 10px 30px rgba(255, 201, 60, 0.42); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: rgba(255, 255, 255, 0.08); color: var(--on-dark); border: 1px solid rgba(255, 255, 255, 0.14); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.14); }
.btn-light { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.btn-light:hover { background: #ecebf5; }
.btn-lg { min-height: 56px; padding: 14px 28px; font-size: 16px; border-radius: 16px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--purple-600); font-weight: 600; font-size: 14px; }
.link-btn:hover { text-decoration: underline; }

/* ============ Welcome ============ */
.welcome-hero { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center; margin-bottom: 40px; }
.welcome-hero h1 .hl { display: inline-block; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; align-items: center; }
.hero-note { font-size: 13px; color: var(--on-dark-2); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 32px; max-width: 520px; }
.stat {
  padding: 14px 16px; border-radius: var(--radius); background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08);
}
.stat b { display: block; font-family: var(--display); font-size: 28px; color: var(--on-dark); }
.stat span { font-size: 13px; color: var(--on-dark-2); }

.hero-art { position: relative; aspect-ratio: 1; max-width: 400px; justify-self: center; width: 100%; }
.hero-art .orb { position: absolute; inset: 8%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #8f74ff, var(--navy-700) 65%); box-shadow: inset 0 0 60px rgba(0,0,0,0.35), 0 30px 80px rgba(124,92,255,0.35); }
.hero-art .glass {
  position: absolute; left: 18%; top: 16%; width: 54%; aspect-ratio: 1; border-radius: 50%;
  border: 14px solid var(--yellow); background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 6px rgba(255,201,60,0.18), inset 0 0 30px rgba(255,255,255,0.15);
  animation: float 6s ease-in-out infinite;
}
.hero-art .glass::after {
  content: ""; position: absolute; width: 22%; height: 70%; right: -38%; bottom: -62%;
  background: var(--yellow); border-radius: 12px; transform: rotate(-45deg); transform-origin: top center;
}
.hero-art .chip {
  position: absolute; padding: 8px 12px; border-radius: 12px; font-size: 12px; font-weight: 700;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); display: flex; gap: 8px; align-items: center;
  animation: float 7s ease-in-out infinite;
}
.hero-art .chip i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chip.c1 { right: 0; top: 18%; animation-delay: -2s; }
.chip.c2 { left: -2%; bottom: 22%; animation-delay: -4s; }
.chip.c3 { right: 6%; bottom: 6%; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head p { margin: 6px 0 0; color: var(--on-dark-2); }

.mission-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.mission-card {
  position: relative; background: var(--surface); color: var(--ink); border-radius: var(--radius-lg); padding: 22px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  animation: enter 0.5s var(--ease) both;
}
.mission-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(5, 3, 20, 0.3); }
.mission-card .m-num { font-family: var(--display); font-size: 13px; font-weight: 700; color: var(--ink-3); letter-spacing: 0.08em; }
.mission-card h3 { font-size: 20px; }
.mission-card p { margin: 0; color: var(--ink-2); font-size: 14px; flex: 1; }
.mission-card .m-foot { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--ink-3); padding-top: 12px; border-top: 1px dashed var(--line); }
.points { font-family: var(--display); font-weight: 700; color: var(--ink); background: var(--yellow-100); border-radius: 999px; padding: 4px 10px; font-size: 13px; }

.m-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; }
.m-icon svg { width: 26px; height: 26px; }
.tone-purple { background: var(--purple-100); color: var(--purple-600); }
.tone-blue { background: var(--blue-100); color: var(--blue); }
.tone-yellow { background: var(--yellow-100); color: #b07800; }
.tone-green { background: var(--green-100); color: var(--green); }

.how { margin-top: 40px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.how-item { padding: 18px; border-radius: var(--radius); border: 1px solid rgba(255, 255, 255, 0.08); background: rgba(255, 255, 255, 0.04); }
.how-item b { display: block; margin-bottom: 4px; }
.how-item span { color: var(--on-dark-2); font-size: 14px; }
.how-item .n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--yellow); color: var(--navy-900); font-weight: 800; font-size: 13px; margin-bottom: 10px; }

/* ============ Cards / forms ============ */
.panel { background: var(--surface); color: var(--ink); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 28px; }
.case-layout { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 24px; align-items: start; margin-top: 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label, .field .label { font-weight: 700; font-size: 14px; color: var(--ink); }
.field .req { color: var(--red); }
.field .hint { font-size: 13px; color: var(--ink-3); }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--surface-2); color: var(--ink); transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.textarea { min-height: 84px; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: #cfcae3; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--purple); background: var(--surface); box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.15); }
.field.has-error .input, .field.has-error .textarea { border-color: var(--red); background: #fff8f8; }
.field .error { display: none; font-size: 13px; color: var(--red); font-weight: 600; }
.field.has-error .error { display: block; }

.type-group { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.type-opt { position: relative; }
.type-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.type-opt span {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface-2); font-size: 13px; font-weight: 600; text-align: center;
  transition: all 0.2s var(--ease);
}
.type-opt svg { width: 22px; height: 22px; color: var(--ink-3); }
.type-opt input:checked + span { border-color: var(--purple); background: var(--purple-100); color: var(--purple-600); }
.type-opt input:checked + span svg { color: var(--purple-600); }
.type-opt input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 2px; }

.upload {
  border: 2px dashed #d3cee6; border-radius: var(--radius); background: var(--surface-2); padding: 22px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.upload:hover, .upload.drag { border-color: var(--purple); background: var(--purple-100); }
.upload svg { width: 32px; height: 32px; color: var(--purple); }
.upload b { font-size: 14px; }
.upload small { color: var(--ink-3); font-size: 12px; }
.preview { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.preview img { width: 100%; max-height: 420px; object-fit: contain; cursor: zoom-in; }
.preview-actions { display: flex; justify-content: space-between; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--surface); font-size: 13px; }

.side-card { background: linear-gradient(160deg, var(--navy-800), var(--navy-900)); border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-lg); padding: 22px; color: var(--on-dark); }
.side-card h3 { margin-bottom: 10px; }
.side-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.side-card li { display: flex; gap: 10px; font-size: 14px; color: var(--on-dark-2); }
.side-card li b { color: var(--on-dark); }
.side-card .bullet { flex: none; width: 22px; height: 22px; border-radius: 7px; background: rgba(255,201,60,0.15); color: var(--yellow); display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

/* ============ Mission screen ============ */
.mission-head { display: flex; gap: 18px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.mission-head .m-icon { width: 60px; height: 60px; border-radius: 18px; }
.mission-head .m-icon svg { width: 32px; height: 32px; }
.mission-head-text { flex: 1; min-width: 220px; }
.mission-meter {
  display: flex; gap: 18px; align-items: center; padding: 12px 16px; border-radius: var(--radius);
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
}
.mission-meter div { display: flex; flex-direction: column; }
.mission-meter b { font-family: var(--display); font-size: 22px; }
.mission-meter span { font-size: 12px; color: var(--on-dark-2); }

.audit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; margin-top: 24px; }
.evidence { position: sticky; top: 130px; display: grid; gap: 14px; }
.evidence .side-card img { border-radius: 12px; cursor: zoom-in; max-height: 380px; width: 100%; object-fit: contain; background: rgba(0,0,0,0.25); }
.evidence dl { margin: 0; display: grid; gap: 10px; font-size: 13px; }
.evidence dt { color: var(--on-dark-2); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.evidence dd { margin: 2px 0 0; color: var(--on-dark); font-weight: 600; }

.questions { display: grid; gap: 16px; }
.qcard {
  background: var(--surface); color: var(--ink); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow);
  border: 2px solid transparent; transition: border-color 0.25s, transform 0.25s var(--ease);
  animation: enter 0.45s var(--ease) both;
}
.qcard.answered { border-color: rgba(124, 92, 255, 0.25); }
.qcard.flash { animation: shake 0.5s; border-color: var(--red); }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.q-top { display: flex; gap: 14px; align-items: flex-start; }
.q-num {
  flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--surface-2); font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--ink-2);
  transition: background 0.25s, color 0.25s;
}
.qcard.answered .q-num { background: var(--purple); color: #fff; }
.q-body { flex: 1; min-width: 0; }
.principle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--purple-600); background: var(--purple-100); padding: 4px 10px; border-radius: 999px; margin-bottom: 8px; }
.q-title { font-size: 18px; font-weight: 700; font-family: var(--font); line-height: 1.35; margin: 0 0 6px; }
.q-explain { margin: 0; color: var(--ink-2); font-size: 14px; }
.example { margin-top: 10px; font-size: 14px; }
.example summary { cursor: pointer; color: var(--purple-600); font-weight: 600; list-style: none; display: inline-flex; gap: 6px; align-items: center; }
.example summary::-webkit-details-marker { display: none; }
.example summary::before { content: "+"; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; background: var(--purple-100); font-size: 13px; }
.example[open] summary::before { content: "–"; }
.example p { margin: 8px 0 0; padding: 12px 14px; background: var(--yellow-100); border-radius: 12px; color: #5a4300; border-left: 3px solid var(--yellow-600); }

.options { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 8px; margin-top: 16px; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt label {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 12px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface-2); font-size: 14px; font-weight: 600; color: var(--ink-2);
  transition: all 0.2s var(--ease); user-select: none;
}
.opt label:hover { border-color: #c8c2e0; background: #fff; }
.opt .score-dot { flex: none; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-family: var(--display); font-weight: 700; background: #fff; border: 1.5px solid var(--line); color: var(--ink-2); transition: all 0.2s; }
.opt input:focus-visible + label { outline: 3px solid var(--yellow); outline-offset: 2px; }
.opt.red input:checked + label { border-color: var(--red); background: var(--red-100); color: #a3262b; }
.opt.red input:checked + label .score-dot { background: var(--red); border-color: var(--red); color: #fff; }
.opt.amber input:checked + label { border-color: var(--amber); background: var(--amber-100); color: #8a5500; }
.opt.amber input:checked + label .score-dot { background: var(--amber); border-color: var(--amber); color: #fff; }
.opt.green input:checked + label { border-color: var(--green); background: var(--green-100); color: #0c6b45; }
.opt.green input:checked + label .score-dot { background: var(--green); border-color: var(--green); color: #fff; }
.opt.na label { justify-content: center; min-width: 72px; color: var(--ink-3); }
.opt.na input:checked + label { border-color: var(--ink-3); background: #ebe9f2; color: var(--ink); }
.opt input:checked + label { animation: pop 0.3s var(--ease); }
@keyframes pop { 50% { transform: scale(1.03); } }
.na-hint { font-size: 12px; color: var(--ink-3); margin-top: 8px; }

.note-toggle { margin-top: 12px; }
.note-area { margin-top: 10px; }
.note-area .textarea { min-height: 70px; font-size: 14px; }

.mission-nav {
  position: sticky; bottom: 12px; margin-top: 24px; z-index: 5;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px; border-radius: 20px; background: rgba(27, 21, 80, 0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1); box-shadow: var(--shadow-lg);
}
.mission-nav .progress-text { font-size: 14px; color: var(--on-dark-2); }
.mission-nav .progress-text b { color: var(--on-dark); }
.mission-nav .nav-right { display: flex; gap: 10px; }

/* ============ Mission complete overlay ============ */
.celebrate {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px;
  background: rgba(8, 6, 26, 0.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fade 0.25s ease both;
}
.celebrate-card {
  width: min(420px, 100%); background: var(--surface); color: var(--ink); border-radius: var(--radius-lg); padding: 30px 26px; text-align: center;
  box-shadow: var(--shadow-lg); animation: rise 0.45s var(--ease) both;
}
.celebrate-card .badge-big { width: 88px; height: 88px; margin: 0 auto 14px; }
.celebrate-card h2 { font-size: 26px; margin-bottom: 6px; }
.celebrate-card p { color: var(--ink-2); margin: 0 0 20px; }
.celebrate-card .earned { font-family: var(--display); font-size: 40px; font-weight: 700; color: var(--purple-600); margin-bottom: 4px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(20px) scale(0.96); } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 41; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: drop 1.6s ease-in forwards; }
@keyframes drop { to { transform: translateY(105vh) rotate(720deg); opacity: 0.6; } }

/* ============ Report ============ */
.report-hero { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center; }
.report-hero.has-shot { grid-template-columns: auto 1fr minmax(180px, 260px); }
.report-shot { margin: 0; padding: 10px; border-radius: var(--radius-lg); background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); }
.report-shot img { width: 100%; max-height: 420px; object-fit: contain; border-radius: 14px; background: rgba(0,0,0,0.25); cursor: zoom-in; }
.report-shot figcaption { margin-top: 8px; font-size: 12px; color: var(--on-dark-2); text-align: center; }
.ring { position: relative; width: 200px; height: 200px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: rgba(255,255,255,0.12); }
.ring .val { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset 1.4s var(--ease); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-center b { font-family: var(--display); font-size: 48px; line-height: 1; }
.ring-center > span { font-size: 13px; color: var(--on-dark-2); margin-top: 6px; }
.rank-tag { display: inline-flex; align-items: center; gap: 8px; background: var(--yellow); color: var(--navy-900); padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: 14px; margin-bottom: 12px; }
.rank-tag svg { width: 18px; height: 18px; }
.case-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; font-size: 14px; color: var(--on-dark-2); }
.case-meta b { color: var(--on-dark); font-weight: 600; }

.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 32px; }
.report-grid .panel h3 { margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.report-grid .panel h3 small { margin-left: auto; font-family: var(--font); font-size: 13px; color: var(--ink-3); font-weight: 500; }
.span-2 { grid-column: 1 / -1; }

.cat { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; }
.cat + .cat { border-top: 1px solid var(--line); }
.cat .m-icon { width: 40px; height: 40px; border-radius: 12px; }
.cat .m-icon svg { width: 22px; height: 22px; }
.cat-name { font-weight: 700; font-size: 15px; }
.cat-sub { font-size: 12px; color: var(--ink-3); }
.bar { height: 8px; border-radius: 8px; background: var(--surface-2); margin-top: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 8px; transition: width 1.2s var(--ease); }
.cat-score { font-family: var(--display); font-weight: 700; font-size: 18px; text-align: right; }
.cat-score small { display: block; font-family: var(--font); font-size: 12px; color: var(--ink-3); font-weight: 500; }

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.badge { text-align: center; padding: 14px 10px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); }
.badge svg { width: 56px; height: 56px; margin: 0 auto 8px; display: block; }
.badge b { display: block; font-size: 13px; }
.badge span { font-size: 12px; color: var(--ink-3); }
.badge.locked { opacity: 0.45; filter: grayscale(1); }

.clue-list { display: grid; gap: 10px; }
.clue { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.clue .tag { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; white-space: nowrap; height: fit-content; }
.tag.red { background: var(--red-100); color: #a3262b; }
.tag.amber { background: var(--amber-100); color: #8a5500; }
.tag.green { background: var(--green-100); color: #0c6b45; }
.clue-q { font-weight: 700; font-size: 14px; }
.clue-p { font-size: 12px; color: var(--purple-600); font-weight: 700; margin-top: 2px; }
.clue-tip { font-size: 14px; color: var(--ink-2); margin-top: 6px; }
.clue-tip b { color: var(--ink); }
.clue-note { font-size: 13px; color: var(--ink-2); margin-top: 6px; padding: 8px 10px; background: #fff; border-radius: 10px; border-left: 3px solid var(--purple); }
.empty { text-align: center; padding: 18px; color: var(--ink-3); font-size: 14px; }

.sync-chip {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 24px; padding: 8px 14px; border-radius: 999px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); font-size: 14px; color: var(--on-dark-2);
}
.sync-chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--on-dark-2); flex: none; }
.sync-chip.saving i { background: var(--yellow); animation: pulse 1s ease-in-out infinite; }
.sync-chip.saved i { background: #3ddc97; }
.sync-chip.saved { color: var(--on-dark); }
.sync-chip.error i { background: var(--red); }
.sync-chip .link-btn { color: var(--yellow); }
@keyframes pulse { 50% { opacity: 0.3; } }
.report-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.summary-box { margin-top: 12px; }
.overall-note { margin-top: 0; }

/* ============ Toast & Lightbox ============ */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 50; opacity: 0; pointer-events: none;
  background: var(--surface); color: var(--ink); padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px;
  transition: opacity 0.25s, transform 0.25s var(--ease); max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(5, 3, 20, 0.9); display: grid; place-items: center; padding: 24px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 90vh; max-width: 100%; border-radius: 12px; }
.lightbox-close { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 12px; border: 0; background: rgba(255,255,255,0.12); color: #fff; font-size: 26px; }

/* ============ Responsive ============ */
@media (max-width: 1000px) {
  .mission-grid { grid-template-columns: repeat(2, 1fr); }
  .audit-layout { grid-template-columns: 1fr; }
  .evidence { position: static; order: -1; grid-template-columns: 1fr; }
  .evidence .side-card { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: start; }
  .evidence .side-card img { max-height: 200px; }
  .evidence .side-card.no-img { grid-template-columns: 1fr; }
  .case-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  main { padding-top: 20px; }
  .welcome-hero { grid-template-columns: 1fr; gap: 12px; }
  .hero-art { max-width: 240px; order: -1; }
  .how { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .type-group { grid-template-columns: repeat(2, 1fr); }
  .panel { padding: 20px; }
  .report-hero, .report-hero.has-shot { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .report-shot { width: min(320px, 100%); }
  .case-meta { justify-content: center; }
  .report-grid { grid-template-columns: 1fr; }
  .options { grid-template-columns: 1fr 1fr; }
  .opt.na { grid-column: 1 / -1; }
  .brand-logo { height: 34px; }
  .brand { gap: 10px; }
  .brand-divider { height: 22px; }
  .brand-product { font-size: 13px; }
}
@media (max-width: 520px) {
  .mission-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { padding: 12px; }
  .stat b { font-size: 22px; }
  .qcard { padding: 18px; }
  .q-top { gap: 10px; }
  .options { grid-template-columns: 1fr; }
  .evidence .side-card { grid-template-columns: 1fr; }
  .mission-nav { bottom: 8px; }
  .mission-nav .nav-right { width: 100%; }
  .mission-nav .nav-right .btn { flex: 1; }
  .ring { width: 170px; height: 170px; }
  .pill-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ============ Print (Save as PDF) ============ */
@media print {
  body { background: #fff; color: var(--ink); }
  .topbar, .footer, .report-actions, .sync-chip, .toast, .no-print, .celebrate, .confetti { display: none !important; }
  main { padding: 0; max-width: none; }
  .print-brand { display: flex !important; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 14px; margin-bottom: 20px; border-bottom: 2px solid var(--line); }
  .print-brand img { height: 52px; width: auto; }
  .print-brand span { font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--ink); text-align: right; }
  .print-brand small { display: block; font-family: var(--font); font-weight: 500; font-size: 12px; color: var(--ink-3); }
  .report-hero { color: var(--ink); }
  .report-hero.has-shot { grid-template-columns: auto 1fr 200px; }
  .report-shot { background: #fff; border: 1px solid var(--line); break-inside: avoid; }
  .report-shot img { max-height: 9cm; background: #f5f4fa; }
  .report-shot figcaption { color: var(--ink-3); }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ring .track { stroke: #eee; }
  .ring-center > span, .case-meta { color: var(--ink-2); }
  .case-meta b, .ring-center b { color: var(--ink); }
  .lead { color: var(--ink-2); }
  .eyebrow { color: var(--purple-600); }
  .panel { box-shadow: none; border: 1px solid var(--line); break-inside: avoid; }
  .report-grid { grid-template-columns: 1fr; }
  .screen { animation: none; }
}
