:root {
  color-scheme: light;
  --bg: #f5f7fa; --surface: #ffffff; --surface-2: #f0f3f8; --ink: #0f172a; --ink-2: #334155; --muted: #64748b;
  --line: #e2e8f0; --accent: #2f5bea; --accent-ink: #ffffff; --accent-soft: #eaf0ff;
  --good: #047857; --good-soft: #ecfdf5; --warn: #b45309; --warn-soft: #fffbeb; --bad: #b91c1c; --bad-soft: #fef2f2;
  --phone: #0b1220; --phone-2: #151f33; --phone-ink: #e2e8f0;
  --radius: 14px; --shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 16px rgba(15,23,42,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 20px; padding: 10px 20px;
  background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-sub { color: var(--muted); font-weight: 600; }
.course-meta { flex: 1; display: flex; align-items: center; gap: 14px; min-width: 0; }
.course-title { font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { flex: 1; max-width: 260px; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .4s; }
.progress-label { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.exit { color: var(--muted); text-decoration: none; font-weight: 500; }

/* layout */
.layout { display: grid; grid-template-columns: 290px 1fr; min-height: calc(100vh - 53px); }
.sidebar { border-right: 1px solid var(--line); background: var(--surface); padding: 18px 12px; }
.sidebar ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.mod-btn { width: 100%; display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 10px 12px; border: 0; border-radius: 10px; background: none; }
.mod-btn:hover { background: var(--surface-2); }
.mod-btn[aria-current="step"] { background: var(--accent-soft); }
.mod-icon { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 1px; }
.mod-btn.done .mod-icon { background: var(--good); border-color: var(--good); color: #fff; }
.mod-btn[aria-current="step"] .mod-icon { border-color: var(--accent); color: var(--accent); }
.mod-text strong { display: block; font-weight: 600; font-size: 14px; }
.mod-text span { font-size: 12px; color: var(--muted); }
main { padding: 36px clamp(16px, 4vw, 56px) 64px; outline: none; }
.wrap { max-width: 860px; margin: 0 auto; }

/* typography & blocks */
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
h1 { font-size: clamp(26px, 3.2vw, 34px); line-height: 1.2; margin: 0 0 12px; letter-spacing: -.01em; }
h2 { font-size: 20px; margin: 0 0 8px; }
.lead { font-size: 17px; color: var(--ink-2); max-width: 680px; margin: 0 0 28px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card .label { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.card h3 { margin: 6px 0 6px; font-size: 16px; }
.card p { margin: 0; color: var(--ink-2); font-size: 14px; }
.reveal-card { cursor: pointer; text-align: left; width: 100%; font: inherit; }
.reveal-card .body { display: none; }
.reveal-card[aria-expanded="true"] .body { display: block; }
.reveal-card .hint { font-size: 12px; color: var(--muted); margin-top: 8px; }
.reveal-card[aria-expanded="true"] .hint { display: none; }
.takeaway { display: flex; gap: 14px; align-items: flex-start; background: var(--accent-soft); border-radius: var(--radius); padding: 16px 18px; margin: 8px 0 28px; }
.takeaway b { color: var(--accent); white-space: nowrap; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.btn { border: 0; border-radius: 10px; padding: 11px 20px; font-weight: 600; background: var(--accent); color: var(--accent-ink); }
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.big { padding: 14px 26px; font-size: 16px; }
.muted { color: var(--muted); }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); }
.pill.good { background: var(--good-soft); color: var(--good); } .pill.bad { background: var(--bad-soft); color: var(--bad); }

/* drill */
.drill { display: grid; gap: 18px; }
.clip { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.clip-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.player { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.play { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.bars { flex: 1; height: 40px; display: flex; align-items: center; gap: 3px; }
.bars i { flex: 1; max-width: 6px; height: 20%; background: var(--line); border-radius: 3px; transition: height .15s; }
.playing .bars i { background: var(--accent); animation: bar 0.9s ease-in-out infinite; }
@keyframes bar { 0%,100% { height: 20%; } 50% { height: 95%; } }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-row .btn { padding: 14px; }
.verdict { margin-top: 14px; padding: 12px 14px; border-radius: 10px; font-weight: 500; }
.verdict.good { background: var(--good-soft); color: var(--good); } .verdict.bad { background: var(--bad-soft); color: var(--bad); }

/* simulations: lure picker */
.lures { display: grid; gap: 14px; }
.lure { display: flex; gap: 18px; align-items: center; text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.lure:hover { border-color: var(--accent); }
.lure .avatar { width: 48px; height: 48px; font-size: 16px; }
.lure-text { flex: 1; min-width: 0; }
.lure-text strong { display: block; font-size: 16px; }
.lure-text p { margin: 2px 0 6px; color: var(--ink-2); font-size: 14px; }
.avatar { flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, #2f5bea, #22a3c9); }

/* phone */
.call { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 24px; align-items: start; }
.phone { background: var(--phone); color: var(--phone-ink); border-radius: 28px; padding: 26px 22px; box-shadow: 0 12px 40px rgba(2,6,23,.35); text-align: center; position: sticky; top: 76px; }
.phone .status { font-size: 13px; color: #94a3b8; letter-spacing: .04em; }
.phone .avatar { width: 84px; height: 84px; font-size: 28px; margin: 18px auto 12px; }
.phone .who { font-size: 20px; font-weight: 700; }
.phone .sub { font-size: 13px; color: #94a3b8; margin-top: 2px; }
.phone .timer { font-variant-numeric: tabular-nums; color: #94a3b8; margin-top: 10px; font-size: 14px; }
.phone .bars { height: 46px; margin: 18px 0 8px; justify-content: center; }
.phone .bars i { background: #334155; }
.phone.speaking .bars i { background: #60a5fa; animation: bar .8s ease-in-out infinite; }
.phone .ring { display: flex; justify-content: center; gap: 28px; margin-top: 22px; }
.round { width: 60px; height: 60px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; }
.round.answer { background: #16a34a; animation: pulse 1.4s infinite; } .round.decline { background: #dc2626; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,.6); } 100% { box-shadow: 0 0 0 18px rgba(22,163,74,0); } }
.phone .replay { margin-top: 10px; background: var(--phone-2); color: var(--phone-ink); border: 0; border-radius: 99px; padding: 6px 14px; font-size: 13px; }
.convo { display: grid; gap: 14px; }
.bubble { background: var(--surface); border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; padding: 14px 16px; box-shadow: var(--shadow); max-width: 92%; }
.bubble .from { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.bubble.me { justify-self: end; background: var(--accent-soft); border-color: transparent; border-radius: 16px 4px 16px 16px; }
.options { display: grid; gap: 10px; }
.option { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; font-weight: 500; }
.option:hover { border-color: var(--accent); background: var(--accent-soft); }
.option .k { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--surface-2); font-size: 12px; font-weight: 700; margin-right: 10px; color: var(--muted); }
.feedback { border-radius: 12px; padding: 12px 14px; font-size: 14px; border-left: 4px solid; }
.feedback.safe { background: var(--good-soft); border-color: var(--good); }
.feedback.partial { background: var(--warn-soft); border-color: var(--warn); }
.feedback.unsafe { background: var(--bad-soft); border-color: var(--bad); }
.feedback b { display: block; margin-bottom: 2px; }
.feedback.safe b { color: var(--good); } .feedback.partial b { color: var(--warn); } .feedback.unsafe b { color: var(--bad); }
.outcome { border-radius: var(--radius); padding: 24px; margin-bottom: 18px; }
.outcome.secure { background: var(--good-soft); } .outcome.compromised { background: var(--bad-soft); }
.outcome h2 { font-size: 24px; } .outcome.secure h2 { color: var(--good); } .outcome.compromised h2 { color: var(--bad); }
.flags { display: grid; gap: 8px; margin: 12px 0 18px; }
.flag { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.flag input { width: 18px; height: 18px; accent-color: var(--accent); }
.flag.right { border-color: var(--good); } .flag.wrong { border-color: var(--bad); }
.flag .mark { margin-left: auto; font-size: 13px; font-weight: 600; }
.flag.right .mark { color: var(--good); } .flag.wrong .mark { color: var(--bad); }

/* quiz */
.q { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.q h2 { font-size: 18px; line-height: 1.4; margin-bottom: 16px; }
.option.correct { border-color: var(--good); background: var(--good-soft); }
.option.incorrect { border-color: var(--bad); background: var(--bad-soft); }
.score { font-size: 48px; font-weight: 800; letter-spacing: -.02em; }

/* certificate */
.cert { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 48px 40px; text-align: center; box-shadow: var(--shadow); position: relative; }
.cert::before { content: ""; position: absolute; inset: 12px; border: 2px solid var(--accent-soft); border-radius: 12px; pointer-events: none; }
.cert .name { font-size: 34px; font-weight: 800; margin: 10px 0; letter-spacing: -.01em; }
.cert input { font: inherit; font-size: 18px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); width: min(360px, 100%); text-align: center; }
.credits { font-size: 12px; color: var(--muted); margin-top: 40px; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; align-content: start; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 10px; overflow-x: auto; }
  .sidebar ol { display: flex; gap: 6px; }
  .mod-btn { white-space: nowrap; padding: 8px 10px; }
  .mod-text span { display: none; }
  .course-title, .brand-sub { display: none; }
  .call { grid-template-columns: 1fr; }
  .phone { position: static; }
}
@media (max-width: 480px) { .choice-row { grid-template-columns: 1fr; } .topbar { gap: 12px; padding: 10px 14px; } main { padding-top: 24px; } }
@media print {
  .topbar, .sidebar, .actions, .no-print, .credits { display: none !important; }
  .layout { display: block; } main { padding: 0; }
  .cert { box-shadow: none; border: 2px solid #2f5bea; }
  body { background: #fff; color: #000; }
}
