:root {
  --navy: #061a2f;
  --navy-2: #0a2847;
  --blue: #1373e6;
  --blue-2: #0b5fc7;
  --cyan: #25a7ff;
  --green: #20b96b;
  --green-soft: #e7f8ef;
  --orange: #f59e0b;
  --red: #dc4c4c;
  --ink: #12223a;
  --muted: #66758b;
  --line: #dce4ee;
  --panel: #ffffff;
  --bg: #f3f7fb;
  --shadow: 0 18px 44px rgba(13, 38, 68, 0.11);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 252px; z-index: 40; display: flex; flex-direction: column; padding: 24px 12px 18px; color: white; background: linear-gradient(180deg, #04182d 0%, #062644 55%, #031629 100%); box-shadow: 16px 0 32px rgba(2, 19, 36, .16); }
.brand-wrap { position: relative; display: flex; align-items: center; gap: 12px; padding: 2px 8px 24px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-mark { width: 43px; height: 43px; }
.brand-title { font-size: 20px; font-weight: 900; line-height: .95; letter-spacing: .02em; }
.brand-subtitle { margin-top: 8px; font-size: 12px; color: #b7c9dc; }
.nav-list { display: grid; gap: 7px; margin-top: 22px; }
.nav-button { display: flex; align-items: center; gap: 13px; width: 100%; padding: 13px 14px; border: 0; border-radius: 11px; color: #d5e1ec; background: transparent; text-align: left; transition: .18s ease; }
.nav-button svg { width: 19px; height: 19px; }
.nav-button:hover { background: rgba(255,255,255,.07); color: white; }
.nav-button.active { color: white; background: linear-gradient(135deg, #0f75e7, #0a5dc3); box-shadow: 0 10px 24px rgba(5, 91, 193, .35); }
.sidebar-card { margin-top: auto; padding: 17px; border: 1px solid rgba(255,255,255,.09); border-radius: 14px; background: rgba(18, 77, 125, .42); }
.sidebar-card strong { display: block; margin-top: 9px; }
.sidebar-card p { margin: 7px 0 0; color: #c6d7e7; font-size: 12px; line-height: 1.5; }
.main-area { grid-column: 2; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; height: 76px; display: flex; align-items: center; gap: 14px; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.93); backdrop-filter: blur(14px); }
.topbar-title { display: flex; flex-direction: column; }
.topbar-title strong { font-size: 17px; }
.topbar-title span { color: var(--muted); font-size: 12px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.pill-button, .trainer-chip { min-height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); }
.pill-button.active { color: var(--blue); border-color: #9dc7f7; background: #f2f8ff; }
.trainer-chip { color: white; border-color: #09213a; background: var(--navy); }
.trainer-chip input { width: 86px; border: 0; outline: none; color: white; background: transparent; font-weight: 700; }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); }
.menu-button, .mobile-close { display: none; }
.page-content { padding: 24px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(280px, .75fr); gap: 16px; }
.hero-card, .stats-card, .wide-card, .lesson-panel, .course-outline, .scenario-list, .simulator-stage, .knowledge-card, .controlled-hero, .protocol-steps, .controlled-library, .do-not-stage, .progress-summary, .locked-certificate { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: 0 8px 24px rgba(13,38,68,.05); }
.hero-card { position: relative; min-height: 276px; grid-column: 1; overflow: hidden; display: flex; align-items: center; padding: 34px; color: white; background: radial-gradient(circle at 60% 30%, rgba(34, 118, 190, .55), transparent 30%), linear-gradient(115deg, #071f39 0%, #0c3f69 62%, #071d34 100%); }
.hero-copy { position: relative; z-index: 5; width: 47%; }
.hero-copy h1 { margin: 8px 0 12px; font-size: clamp(28px, 3vw, 42px); line-height: 1.03; }
.hero-copy p { margin: 0 0 22px; color: #d6e6f4; line-height: 1.6; }
.eyebrow { color: var(--blue); font-size: 11px; font-weight: 900; letter-spacing: .11em; }
.hero-card .eyebrow { color: #62c6ff; }
.primary-button, .secondary-button, .danger-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border-radius: 10px; font-weight: 800; transition: .15s ease; }
.primary-button { border: 1px solid var(--blue); color: white; background: linear-gradient(135deg, var(--blue), var(--blue-2)); box-shadow: 0 10px 22px rgba(19,115,230,.22); }
.primary-button:hover { transform: translateY(-1px); }
.secondary-button { border: 1px solid var(--line); color: var(--ink); background: white; }
.danger-button { border: 1px solid #efb6b6; color: #b52f2f; background: #fff5f5; }
.hero-scene { position: absolute; inset: 0 0 0 42%; overflow: hidden; }
.road { position: absolute; left: 0; right: -20px; bottom: 0; height: 38%; background: linear-gradient(180deg, #5b6470, #313a45); transform: skewX(-8deg); }
.road:before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; background: repeating-linear-gradient(90deg, #f8e69b 0 26px, transparent 26px 52px); }
.van-illustration { position: absolute; right: 18%; bottom: 19%; width: 225px; height: 96px; border-radius: 22px 28px 13px 15px; color: white; background: linear-gradient(155deg, #0a2b50, #0b5b98); box-shadow: 0 18px 32px rgba(0,0,0,.35); }
.van-illustration:before { content: ""; position: absolute; right: 12px; top: 12px; width: 56px; height: 38px; border-radius: 8px 16px 4px 4px; background: #8bb9d5; transform: skewX(-8deg); }
.van-illustration:after { content: ""; position: absolute; left: 28px; right: 26px; bottom: -15px; height: 30px; background: radial-gradient(circle at 15% 50%, #111 0 13px, transparent 14px), radial-gradient(circle at 85% 50%, #111 0 13px, transparent 14px); }
.van-illustration span { position: absolute; left: 26px; top: 34px; font-size: 22px; font-weight: 900; }
.trainer-figure { position: absolute; right: 2%; bottom: 10%; width: 66px; height: 145px; }
.figure-head { position: absolute; top: 0; left: 17px; width: 32px; height: 32px; border-radius: 50%; background: #b87043; }
.figure-body { position: absolute; top: 28px; left: 3px; width: 60px; height: 102px; border-radius: 18px 18px 6px 6px; background: #0b1e31; }
.trainee-group { position: absolute; left: 18%; bottom: 7%; display: flex; align-items: end; gap: 4px; }
.trainee-group i { display: block; width: 34px; height: 82px; border-radius: 16px 16px 4px 4px; background: #172d44; box-shadow: inset 0 -22px #0c1c2e; }
.progress-ring { --progress: 0deg; position: absolute; right: 2.5%; top: 7%; width: 96px; height: 96px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--green) var(--progress), rgba(255,255,255,.16) 0); box-shadow: 0 9px 24px rgba(0,0,0,.2); }
.progress-ring:after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #0b2844; }
.progress-ring div { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; }
.progress-ring strong { font-size: 22px; }
.progress-ring span { color: #bcd0e2; font-size: 10px; }
.stats-card { grid-column: 2; padding: 22px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading h2 { margin: 3px 0 0; font-size: 19px; }
.section-heading > span { color: var(--muted); font-size: 12px; }
.large-stat { display: flex; align-items: baseline; gap: 9px; margin: 24px 0 12px; }
.large-stat strong { font-size: 38px; }
.large-stat span { color: var(--muted); }
.progress-track { height: 8px; overflow: hidden; border-radius: 99px; background: #e8edf3; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.stat-row { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 9px; margin-top: 19px; color: var(--muted); font-size: 13px; }
.stat-row svg { color: var(--green); }
.stat-row strong { color: var(--ink); }
.wide-card { grid-column: 1 / -1; padding: 18px; }
.module-strip { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 12px; margin-top: 15px; overflow-x: auto; padding-bottom: 4px; }
.module-card { position: relative; min-height: 172px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: white; text-align: center; }
.module-card:hover { border-color: #91bdf1; box-shadow: 0 10px 24px rgba(12,93,185,.09); }
.module-card.complete { border-color: #69c990; box-shadow: inset 0 -5px var(--green); }
.module-number { position: absolute; left: 10px; top: 10px; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--blue); font-size: 12px; font-weight: 900; }
.module-card.complete .module-number { background: var(--green); }
.module-card > svg { color: var(--blue); }
.module-card strong { min-height: 39px; font-size: 13px; }
.module-card > span { color: var(--muted); font-size: 11px; }
.mini-progress { width: 100%; height: 4px; overflow: hidden; border-radius: 99px; background: #e8edf3; }
.mini-progress i { display: block; height: 100%; background: var(--blue); }
.scenario-grid.compact { display: grid; grid-template-columns: repeat(5, minmax(170px, 1fr)); gap: 12px; margin-top: 15px; overflow-x: auto; }
.scenario-preview { position: relative; overflow: hidden; padding: 0; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: white; text-align: left; }
.scenario-preview > div:nth-child(2) { display: flex; flex-direction: column; gap: 4px; padding: 11px; }
.scenario-preview strong { font-size: 12px; }
.scenario-preview span { color: var(--muted); font-size: 10px; }
.preview-play { position: absolute; right: 9px; top: 74px; padding: 7px; width: 34px; height: 34px; border-radius: 50%; color: white; background: var(--blue); box-shadow: 0 6px 14px rgba(0,0,0,.22); }
.scenario-thumb { position: relative; height: 92px; overflow: hidden; background: linear-gradient(#87c9ef 0 45%, #72a865 45% 70%, #545b65 70%); }
.scenario-thumb span, .scenario-thumb i, .scenario-thumb b { position: absolute; display: block; }
.thumb-blue-dot span, .thumb-package-match span, .thumb-group-stop span { left: 18px; bottom: 28px; width: 48px; height: 36px; background: #e7ddd0; box-shadow: 82px 0 #d9e2e8; }
.thumb-blue-dot i { right: 35px; top: 20px; width: 16px; height: 16px; border-radius: 50% 50% 50% 0; background: #ec4545; transform: rotate(-45deg); }
.thumb-blue-dot b { left: 38px; bottom: 22px; width: 13px; height: 13px; border: 3px solid white; border-radius: 50%; background: var(--blue); }
.thumb-van-parking span { left: 48px; bottom: 23px; width: 82px; height: 34px; border-radius: 8px; background: #0c4d86; box-shadow: inset -18px 8px #7fb6d6; }
.thumb-van-parking i { left: 36px; right: 0; bottom: 18px; height: 3px; background: #f8e69b; }
.thumb-package-match i, .thumb-group-stop i { left: 78px; bottom: 22px; width: 28px; height: 25px; background: #c58a53; box-shadow: inset 0 8px rgba(255,255,255,.25); }
.thumb-contact-order { background: #eaf4ff; }
.thumb-contact-order span, .thumb-contact-order i, .thumb-contact-order b { left: 18px; right: 18px; height: 12px; border-radius: 5px; background: var(--blue); }
.thumb-contact-order span { top: 17px; }.thumb-contact-order i { top: 39px; background: #5aa2ee; }.thumb-contact-order b { top: 61px; background: #9cc7f4; }
.thumb-exception-choice { background: linear-gradient(#aedcf8 0 50%, #7bad64 50%); }
.thumb-exception-choice span { left: 24px; bottom: 15px; width: 60px; height: 45px; background: #d8d0c1; }
.thumb-exception-choice i { right: 32px; bottom: 19px; width: 25px; height: 25px; border-radius: 50%; background: #9b6b3e; box-shadow: 10px 3px 0 -4px #6f472b; }

.course-layout, .simulator-layout { display: grid; grid-template-columns: 245px minmax(0, 1fr); gap: 16px; align-items: start; }
.course-outline, .scenario-list { position: sticky; top: 100px; padding: 13px; }
.outline-title { display: flex; align-items: center; gap: 10px; padding: 7px 6px 14px; border-bottom: 1px solid var(--line); }
.outline-title div { display: flex; flex-direction: column; }
.outline-title span { color: var(--muted); font-size: 10px; }
.outline-module { width: 100%; display: flex; align-items: center; gap: 9px; padding: 9px; margin-top: 5px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; text-align: left; font-size: 12px; }
.outline-module.active { color: var(--blue); background: #edf6ff; font-weight: 800; }
.outline-number { flex: 0 0 auto; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: white; background: #8a98aa; font-size: 11px; font-weight: 900; }
.outline-module.active .outline-number { background: var(--blue); }
.lesson-panel, .simulator-stage { min-width: 0; padding: 24px; }
.lesson-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.lesson-header h1 { margin: 6px 0 7px; font-size: clamp(25px, 3vw, 36px); }
.lesson-header p { margin: 0; color: var(--muted); line-height: 1.55; }
.complete-badge { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 99px; color: #107a45; background: var(--green-soft); font-size: 11px; font-weight: 800; white-space: nowrap; }
.narration-card { display: flex; align-items: center; gap: 12px; margin-top: 21px; padding: 13px; border: 1px solid #b9d8fa; border-radius: 13px; background: linear-gradient(90deg, #f1f8ff, #fbfdff); }
.narrator-avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: white; background: linear-gradient(135deg, var(--blue), #32a9ff); }
.narrator-copy { display: flex; flex-direction: column; }
.narrator-copy span { color: var(--muted); font-size: 11px; }
.round-control { margin-left: auto; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; color: white; background: var(--blue); }
.rate-control { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.rate-control select { padding: 6px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.lesson-content-card { display: grid; grid-template-columns: minmax(260px, .9fr) minmax(300px, 1.1fr); gap: 22px; margin-top: 18px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdff; }
.lesson-visual { min-height: 330px; overflow: hidden; border-radius: 12px; background: #eaf3fb; }
.lesson-copy { padding: 4px 4px 4px 0; }
.lead-copy { margin: 0; font-size: 17px; line-height: 1.65; }
.lesson-copy h3 { margin-top: 24px; }
.lesson-copy ul { display: grid; gap: 12px; padding: 0; list-style: none; }
.lesson-copy li { display: flex; align-items: flex-start; gap: 9px; color: #43536a; line-height: 1.45; }
.lesson-copy li svg { flex: 0 0 auto; color: var(--green); margin-top: 2px; }
.knowledge-card { margin-top: 18px; padding: 20px; box-shadow: none; }
.option-list { display: grid; gap: 9px; margin: 16px 0; }
.answer-option { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; text-align: left; }
.answer-option > span { flex: 0 0 auto; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); background: #edf1f5; font-weight: 900; }
.answer-option.selected { border-color: #78b4f3; background: #f2f8ff; }
.answer-option.correct { border-color: #64c78d; background: #eefbf3; }
.answer-option.incorrect { border-color: #e58888; background: #fff2f2; }
.feedback { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0; padding: 13px; border-radius: 10px; line-height: 1.45; }
.feedback svg { flex: 0 0 auto; margin-top: 1px; }
.feedback.success { color: #166c41; background: #eaf9f1; border: 1px solid #9cd8b7; }
.feedback.warning { color: #8b4f0a; background: #fff6e8; border: 1px solid #f2ca87; }
.lesson-switcher { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; }
.lesson-tabs { display: flex; gap: 7px; flex-wrap: wrap; }
.lesson-tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: white; font-size: 11px; }
.lesson-tabs button.active { color: var(--blue); border-color: #a8cef6; background: #f2f8ff; }
.lesson-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.mini-map, .address-visual, .sequence-visual, .coach-visual, .trainer-roles { position: relative; width: 100%; height: 100%; }
.mini-map { background: linear-gradient(90deg, transparent 47%, #8b939c 47% 57%, transparent 57%), linear-gradient(transparent 44%, #8b939c 44% 55%, transparent 55%), #9ccb8d; }
.mini-house { position: absolute; width: 78px; height: 68px; display: grid; place-items: center; color: white; background: #e7e2d9; border: 9px solid #bd8160; font-weight: 900; box-shadow: 0 8px 0 #8e5d46; }
.mini-house.h1 { left: 16%; top: 14%; }.mini-house.h2 { right: 12%; bottom: 14%; }
.mini-pin { position: absolute; right: 22%; top: 28%; color: #e84f4f; }
.mini-dot { position: absolute; left: 23%; bottom: 20%; width: 23px; height: 23px; border: 5px solid white; border-radius: 50%; background: var(--blue); box-shadow: 0 3px 12px rgba(0,0,0,.25); }
.mini-path { position: absolute; left: 29%; top: 60%; width: 42%; border-top: 4px dashed rgba(255,255,255,.9); transform: rotate(-24deg); }
.address-visual { background: linear-gradient(#a9dcf7 0 50%, #73a765 50%); }
.address-house { position: absolute; left: 12%; bottom: 16%; width: 110px; height: 105px; display: grid; place-items: center; background: #e4d8ca; box-shadow: inset 0 0 0 9px #a45f45; font-size: 28px; font-weight: 900; }
.address-house.wrong { left: auto; right: 12%; background: #d9e0e6; box-shadow: inset 0 0 0 9px #5e7182; }
.package-box { position: absolute; left: 40%; top: 34%; width: 60px; height: 52px; display: grid; place-items: center; color: #5b351c; background: #c78b52; font-weight: 900; box-shadow: inset 0 12px rgba(255,255,255,.18); }
.verify-line { position: absolute; left: 46%; right: 23%; top: 48%; border-top: 4px dashed white; }
.sequence-visual { display: grid; align-content: center; gap: 10px; padding: 28px; background: #eaf3fb; }
.sequence-visual div { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 9px; color: var(--navy); background: white; box-shadow: 0 5px 14px rgba(13,38,68,.08); font-weight: 900; }
.sequence-visual span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--blue); }
.coach-visual { background: linear-gradient(#b9def4 0 55%, #718e63 55%); }
.coach-person, .trainee-person { position: absolute; bottom: 30px; width: 52px; height: 105px; border-radius: 22px 22px 8px 8px; background: #09233c; }
.coach-person { left: 20%; }.trainee-person { right: 18%; background: #154e79; }
.coach-person:before, .trainee-person:before { content: ""; position: absolute; left: 11px; top: -29px; width: 30px; height: 30px; border-radius: 50%; background: #a96b42; }
.speech-bubble { position: absolute; left: 34%; right: 8%; top: 17%; padding: 15px; border-radius: 15px 15px 15px 2px; background: white; box-shadow: var(--shadow); font-weight: 800; line-height: 1.4; }
.trainer-roles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; align-content: center; padding: 24px; background: linear-gradient(145deg, #09243e, #0b4f80); }
.trainer-roles div { display: flex; align-items: center; gap: 8px; padding: 15px; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; color: white; background: rgba(255,255,255,.08); font-size: 11px; font-weight: 900; }

.scenario-list-button { width: 100%; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 9px; padding: 10px 8px; margin-top: 6px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; text-align: left; }
.scenario-list-button > span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: white; background: #8090a4; font-size: 11px; font-weight: 900; }
.scenario-list-button div { display: flex; flex-direction: column; gap: 3px; }
.scenario-list-button strong { color: var(--ink); font-size: 11px; }.scenario-list-button small { font-size: 9px; }
.scenario-list-button.active { background: #edf6ff; }.scenario-list-button.active > span { background: var(--blue); }.scenario-list-button.active strong { color: var(--blue); }
.scenario-list-button > svg { color: var(--green); }
.scenario-shell { margin-top: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fbfdff; }
.instruction-banner { display: flex; align-items: center; gap: 10px; padding: 14px 16px; color: #0a4f91; background: #e9f5ff; border-bottom: 1px solid #b8daf7; font-weight: 800; }
.scenario-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 16px; border-top: 1px solid var(--line); background: white; }
.parking-scene { position: relative; height: 500px; overflow: hidden; background: linear-gradient(#abd8ee 0 34%, #73a969 34% 57%, #606975 57% 100%); }
.parking-house { position: absolute; left: 10%; top: 14%; width: 170px; height: 125px; display: grid; place-items: center; background: #e8ddd0; box-shadow: inset 0 0 0 13px #a36348; font-size: 34px; font-weight: 900; }
.parking-driveway { position: absolute; left: 22%; top: 44%; width: 24%; height: 42%; background: #9aa0a6; transform: rotate(3deg); }
.parking-road { position: absolute; left: 0; right: 0; bottom: 0; height: 37%; background: #4f5863; }
.parking-road:before { content: ""; position: absolute; left: 0; right: 0; top: 49%; height: 4px; background: repeating-linear-gradient(90deg, #f8e79d 0 35px, transparent 35px 68px); }
.parking-ditch { position: absolute; left: 0; right: 0; top: 54%; height: 34px; padding-left: 54%; color: rgba(255,255,255,.65); background: #486d3d; font-size: 10px; line-height: 34px; letter-spacing: .12em; }
.parking-intersection { position: absolute; right: -3%; bottom: 0; width: 26%; height: 100%; background: rgba(79,88,99,.9); transform: rotate(-8deg); }
.parking-spot { position: absolute; width: 120px; height: 58px; border: 2px dashed rgba(255,255,255,.9); border-radius: 10px; color: white; background: rgba(19,115,230,.12); }
.parking-spot span { display: inline-block; padding: 5px 7px; border-radius: 6px; background: rgba(4,25,45,.75); font-size: 10px; }
.parking-spot.selected { border-style: solid; background: rgba(19,115,230,.35); box-shadow: 0 0 0 4px rgba(255,255,255,.25); }
.spot-driveway { left: 27%; top: 51%; }.spot-curb { left: 49%; bottom: 10%; }.spot-ditch { left: 50%; top: 48%; }.spot-intersection { right: 6%; bottom: 12%; }
.draggable-van { position: absolute; left: 9%; bottom: 8%; width: 126px; height: 55px; display: grid; place-items: center; border-radius: 10px 14px 7px 7px; color: white; background: #0c4e86; box-shadow: 0 8px 16px rgba(0,0,0,.3); transition: .4s ease; font-weight: 900; }
.draggable-van:before { content: ""; position: absolute; right: 8px; top: 8px; width: 30px; height: 20px; border-radius: 4px; background: #8bbbd9; }
.van-driveway { left: 28%; bottom: 25%; transform: rotate(3deg); }.van-curb { left: 50%; bottom: 12%; }.van-ditch { left: 51%; bottom: 36%; }.van-intersection { left: 77%; bottom: 13%; transform: rotate(-8deg); }
.blue-dot-map { position: relative; height: 500px; overflow: hidden; touch-action: none; background: #8cc77f; }
.map-road { position: absolute; background: #606975; }.road-one { left: 0; right: 0; top: 44%; height: 18%; }.road-two { top: 0; bottom: 0; left: 45%; width: 14%; }
.map-house { position: absolute; width: 105px; height: 82px; display: grid; place-items: center; border: 10px solid #9a654d; background: #e8ded2; font-size: 27px; font-weight: 900; box-shadow: 0 6px 0 rgba(0,0,0,.12); }
.house-42 { right: 14%; top: 11%; }.house-44 { left: 13%; top: 13%; }.house-50 { right: 15%; bottom: 11%; }
.delivery-pin { position: absolute; display: flex; flex-direction: column; align-items: center; color: #e23e43; transform: translate(-50%, -100%); }
.delivery-pin span { margin-top: -2px; padding: 4px 6px; border-radius: 5px; color: white; background: #b52d31; font-size: 9px; font-weight: 900; }
.blue-dot { position: absolute; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: transparent; transform: translate(-50%, -50%); touch-action: none; }
.blue-dot span { width: 25px; height: 25px; border: 5px solid white; border-radius: 50%; background: var(--blue); box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.blue-dot small { position: absolute; top: 40px; padding: 3px 5px; border-radius: 4px; color: white; background: var(--blue); font-size: 8px; font-weight: 900; }
.map-van { position: absolute; left: 14%; bottom: 14%; width: 84px; height: 37px; display: grid; place-items: center; border-radius: 7px; color: white; background: #0b4e84; font-size: 10px; font-weight: 900; }
.package-scenario { min-height: 460px; display: grid; grid-template-columns: 280px 1fr; gap: 18px; padding: 22px; }
.package-bank { padding: 16px; border-radius: 12px; background: #eef4f9; }.package-bank h3 { margin-top: 0; }
.package-item { width: 100%; display: flex; flex-direction: column; gap: 5px; margin-top: 10px; padding: 14px; border: 2px solid #b98552; border-radius: 9px; color: #5e3a20; background: linear-gradient(145deg, #d8a36d, #c3874f); text-align: left; box-shadow: inset 0 10px rgba(255,255,255,.15); }
.package-item.selected { outline: 4px solid rgba(19,115,230,.25); border-color: var(--blue); }.package-item.used { opacity: .38; }
.barcode { width: 75px; height: 13px; background: repeating-linear-gradient(90deg, #322317 0 2px, transparent 2px 4px); }
.package-item small { color: #6b4429; font-size: 9px; }
.door-bank { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: end; }
.delivery-door { min-height: 330px; position: relative; padding: 18px 12px; border: 2px solid transparent; border-radius: 12px; color: var(--ink); background: linear-gradient(#c9d9e6 0 25%, #e4d7c6 25%); }
.delivery-door.correct { border-color: var(--green); background: linear-gradient(#c9d9e6 0 25%, #e8f8ee 25%); }.delivery-door.incorrect { border-color: var(--red); background: linear-gradient(#c9d9e6 0 25%, #fff0f0 25%); }
.door-frame { position: absolute; left: 25%; right: 25%; bottom: 54px; height: 160px; background: #6a4637; box-shadow: inset 0 0 0 9px #9a6c54; }
.door-number { position: relative; z-index: 2; display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; color: white; background: var(--navy); font-size: 20px; font-weight: 900; }
.delivery-door small { position: absolute; left: 10px; right: 10px; bottom: 14px; }
.group-stop-scene { position: relative; height: 500px; overflow: hidden; background: linear-gradient(#a9d8ef 0 38%, #76a969 38% 68%, #5e6670 68%); }
.group-map-label { position: absolute; left: 20px; top: 20px; padding: 8px 10px; border-radius: 8px; color: white; background: var(--navy); font-size: 10px; font-weight: 900; }
.group-packages { position: absolute; left: 20px; bottom: 25px; display: flex; gap: 8px; z-index: 4; }
.group-package { padding: 14px 18px; border: 2px solid #9c693e; border-radius: 8px; color: #5b371f; background: #c9905d; font-weight: 900; }.group-package.selected { outline: 4px solid #a8d0f8; border-color: var(--blue); }.group-package.used { opacity: .35; }
.group-location { position: absolute; top: 23%; width: 200px; height: 245px; border: 3px solid transparent; border-radius: 12px; color: var(--ink); background: rgba(255,255,255,.18); }
.location-a { left: 23%; }.location-b { right: 13%; }.group-location.correct { border-color: var(--green); }.group-location.incorrect { border-color: var(--red); }
.building-shape { position: absolute; left: 15px; right: 15px; bottom: 52px; height: 150px; background: #dadfe4; box-shadow: inset 0 0 0 11px #677a8a; }
.building-shape:after { content: ""; position: absolute; left: 45%; bottom: 0; width: 42px; height: 68px; background: #5e4338; }
.building-number { position: relative; z-index: 2; display: inline-grid; place-items: center; width: 45px; height: 45px; border-radius: 50%; color: white; background: var(--blue); font-weight: 900; }
.group-location small, .group-location strong { position: absolute; left: 10px; right: 10px; z-index: 2; }.group-location small { bottom: 30px; }.group-location strong { bottom: 10px; font-size: 10px; }
.group-flex-card { position: absolute; right: 18px; top: 18px; max-width: 245px; display: flex; gap: 9px; padding: 11px; border-radius: 10px; background: white; box-shadow: var(--shadow); }.group-flex-card span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.sequence-builder { min-height: 450px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 22px; }
.sequence-pool, .sequence-answer { padding: 18px; border-radius: 12px; background: #eef4f9; }.sequence-pool h3, .sequence-answer h3 { margin-top: 0; }
.sequence-pool button { width: 100%; display: flex; align-items: center; gap: 10px; margin-top: 9px; padding: 13px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: white; text-align: left; }
.sequence-pool button span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--blue); }
.sequence-slot { min-height: 54px; display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 9px; margin-top: 9px; padding: 8px; border: 1px dashed #9ba9b8; border-radius: 9px; background: white; }
.sequence-slot > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: white; background: #8391a1; font-weight: 900; }
.sequence-slot button { min-height: 36px; border: 0; border-radius: 7px; color: var(--ink); background: #edf3f8; text-align: left; padding: 7px 10px; }.sequence-slot em { color: #9aa6b4; font-size: 11px; }
.sequence-slot.correct { border-style: solid; border-color: var(--green); background: #f0fbf4; }.sequence-slot.incorrect { border-style: solid; border-color: var(--red); background: #fff3f3; }
.exception-card { max-width: 780px; margin: 26px auto; padding: 28px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: var(--shadow); }.exception-card h2 { font-size: 28px; }.exception-card > .primary-button { margin-top: 8px; }
.result-card { min-height: 440px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px; }.result-card svg { color: var(--orange); }.result-card h2 { margin: 12px 0 0; font-size: 52px; }.result-card p { max-width: 540px; color: var(--muted); }

.controlled-page { display: grid; gap: 16px; }
.controlled-hero { min-height: 280px; display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; gap: 20px; padding: 34px; overflow: hidden; color: white; background: radial-gradient(circle at 80% 30%, #1265a2, transparent 34%), linear-gradient(120deg, #061c33, #0a3e68); }
.controlled-hero h1 { margin: 8px 0 12px; max-width: 700px; font-size: clamp(29px, 4vw, 46px); }.controlled-hero p { max-width: 690px; color: #d1e2f1; line-height: 1.6; }
.protocol-wheel { position: relative; width: 250px; height: 250px; margin: auto; border: 25px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255,255,255,.2); }
.protocol-wheel:after { content: "SAFE PRACTICE"; position: absolute; inset: 58px; display: grid; place-items: center; border-radius: 50%; background: var(--blue); font-size: 13px; font-weight: 900; text-align: center; }
.protocol-wheel span { --i: 0; position: absolute; left: 50%; top: 50%; width: 84px; margin: -10px -42px; transform: rotate(calc(var(--i) * 72deg)) translateY(-118px) rotate(calc(var(--i) * -72deg)); font-size: 9px; font-weight: 900; text-align: center; }
.protocol-steps { display: grid; grid-template-columns: repeat(5, 1fr); padding: 17px; }
.protocol-steps > div { padding: 16px; border-right: 1px solid var(--line); }.protocol-steps > div:last-child { border-right: 0; }
.protocol-steps span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--blue); font-weight: 900; }.protocol-steps strong { display: block; margin-top: 10px; }.protocol-steps p { color: var(--muted); font-size: 11px; line-height: 1.5; }
.controlled-library { padding: 20px; }.controlled-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 15px; }
.controlled-grid article { position: relative; overflow: hidden; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdff; }.controlled-grid h3 { margin-top: 24px; }.controlled-grid p { color: var(--muted); font-size: 12px; line-height: 1.5; }
.error-index { position: absolute; right: 12px; top: 8px; color: #dce9f7; font-size: 38px; font-weight: 900; }.key-message { display: flex; gap: 7px; margin-top: 14px; padding: 9px; border-radius: 8px; color: #0e6d3e; background: var(--green-soft); font-size: 10px; font-weight: 800; }
.do-not-stage { display: flex; align-items: center; gap: 16px; padding: 20px; color: #8a4c08; background: #fff8ea; border-color: #f0cc8a; }.do-not-stage h3 { margin: 0; }.do-not-stage p { margin: 5px 0 0; line-height: 1.5; }

.progress-page { display: grid; gap: 16px; }.progress-summary { display: flex; align-items: center; gap: 28px; padding: 28px; }.progress-ring.large { position: relative; flex: 0 0 auto; right: auto; top: auto; width: 140px; height: 140px; }.progress-ring.large:after { background: white; }.progress-ring.large strong { color: var(--ink); font-size: 31px; }.progress-ring.large span { color: var(--muted); }.progress-summary h1 { margin: 6px 0; }.progress-summary p { color: var(--muted); }.progress-actions { display: flex; gap: 9px; margin-top: 16px; }
.progress-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }.progress-columns .wide-card { grid-column: auto; }
.progress-list, .score-list { display: grid; gap: 8px; margin-top: 15px; }.progress-list button, .score-list button { display: grid; align-items: center; gap: 11px; width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; text-align: left; }.progress-list button { grid-template-columns: 32px 1fr 45px; }.progress-list button > div { display: grid; gap: 7px; }.progress-list b { text-align: right; }
.score-list button { grid-template-columns: 1fr auto; }.score-list button div { display: flex; flex-direction: column; }.score-list span { color: var(--muted); font-size: 10px; }.score-list b { min-width: 54px; padding: 8px; border-radius: 8px; color: #8c5b12; background: #fff5e6; text-align: center; }.score-list b.pass { color: #0f7843; background: var(--green-soft); }
.locked-certificate { min-height: 600px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; text-align: center; }.locked-certificate svg { color: #9dadbf; }.locked-certificate p { max-width: 560px; color: var(--muted); line-height: 1.55; }
.certificate-page { display: flex; flex-direction: column; align-items: center; gap: 16px; }.certificate { width: min(100%, 1000px); padding: 22px; background: white; box-shadow: var(--shadow); }.certificate-border { position: relative; min-height: 680px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 55px; border: 5px double #123c64; text-align: center; background: radial-gradient(circle at center, white 0 58%, #f3f8fc 100%); }.certificate-border:before, .certificate-border:after { content: ""; position: absolute; width: 90px; height: 90px; border: 2px solid #caa446; }.certificate-border:before { left: 20px; top: 20px; border-right: 0; border-bottom: 0; }.certificate-border:after { right: 20px; bottom: 20px; border-left: 0; border-top: 0; }
.certificate img { width: 72px; }.certificate h1 { margin: 12px 0 0; font-family: Georgia, serif; font-size: 48px; color: #0b3153; }.certificate h2 { margin: 4px 0 25px; color: #b38a2c; font-family: Georgia, serif; font-weight: 500; }.certificate p { max-width: 650px; color: #4e6073; line-height: 1.6; }.certificate-name { margin: 5px 0 14px; padding: 0 42px 8px; border-bottom: 2px solid #b38a2c; font-family: Georgia, serif; font-size: 36px; color: #0b3153; }.certificate-seal { width: 130px; height: 130px; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 20px; border: 7px double #b38a2c; border-radius: 50%; color: #8e6816; font-size: 11px; font-weight: 900; }.signature-row { width: 78%; display: grid; grid-template-columns: 1fr 1fr; gap: 80px; margin-top: 22px; }.signature-row div { display: flex; flex-direction: column; border-top: 1px solid #5d6873; padding-top: 7px; }.signature-row small { color: var(--muted); }.print-button { margin-bottom: 30px; }

@media (max-width: 1180px) {
  .dashboard-grid { grid-template-columns: 1fr; }.hero-card, .stats-card { grid-column: 1; }.module-strip { grid-template-columns: repeat(6, 165px); }.scenario-grid.compact { grid-template-columns: repeat(5, 190px); }
  .controlled-grid { grid-template-columns: repeat(3, 1fr); }.protocol-steps { grid-template-columns: repeat(3, 1fr); }.protocol-steps > div { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 900px) {
  .app-shell { display: block; }.main-area { grid-column: auto; }.sidebar { transform: translateX(-110%); transition: .22s ease; }.sidebar.sidebar-open { transform: translateX(0); }.scrim { position: fixed; inset: 0; z-index: 35; border: 0; background: rgba(2,17,31,.55); }.menu-button, .mobile-close { display: grid; }.mobile-close { margin-left: auto; color: white; border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.08); }
  .course-layout, .simulator-layout { grid-template-columns: 1fr; }.course-outline, .scenario-list { position: static; }.course-outline { display: none; }
  .lesson-content-card { grid-template-columns: 1fr; }.lesson-visual { min-height: 280px; }.package-scenario { grid-template-columns: 1fr; }.door-bank { min-height: 350px; }.sequence-builder { grid-template-columns: 1fr; }
  .controlled-hero { grid-template-columns: 1fr; }.protocol-wheel { display: none; }.controlled-grid { grid-template-columns: repeat(2, 1fr); }.progress-columns { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar { height: 68px; padding: 0 12px; }.topbar-title span, .desktop-only { display: none; }.trainer-chip input { width: 64px; }.page-content { padding: 12px; }
  .hero-card { min-height: 390px; align-items: flex-start; padding: 25px; }.hero-copy { width: 100%; }.hero-scene { inset: 46% 0 0 0; }.progress-ring { right: 18px; top: auto; bottom: 18px; }.van-illustration { right: 20%; transform: scale(.82); }
  .lesson-panel, .simulator-stage { padding: 15px; }.lesson-header { flex-direction: column; }.narration-card { flex-wrap: wrap; }.rate-control { width: 100%; justify-content: flex-end; }.lesson-switcher { align-items: stretch; flex-direction: column; }.lesson-actions { justify-content: stretch; }.lesson-actions button { flex: 1; }.scenario-list { overflow-x: auto; }.scenario-list-button { min-width: 240px; }
  .parking-scene, .blue-dot-map, .group-stop-scene { height: 430px; }.parking-spot { width: 88px; }.spot-driveway { left: 19%; }.spot-curb { left: 38%; }.spot-ditch { left: 43%; }.draggable-van { transform: scale(.8); transform-origin: left bottom; }.van-driveway { transform: scale(.8) rotate(3deg); }.van-intersection { transform: scale(.8) rotate(-8deg); }
  .map-house { width: 77px; height: 64px; border-width: 7px; }.door-bank { grid-template-columns: 1fr; }.delivery-door { min-height: 235px; }.door-frame { height: 115px; }.group-location { width: 145px; }.location-a { left: 7%; }.location-b { right: 7%; }.group-flex-card { left: 15px; right: 15px; top: 62px; max-width: none; }.group-location { top: 36%; }
  .protocol-steps, .controlled-grid { grid-template-columns: 1fr; }.progress-summary { flex-direction: column; text-align: center; }.progress-actions { justify-content: center; flex-wrap: wrap; }.certificate-border { min-height: 600px; padding: 34px 20px; }.certificate h1 { font-size: 35px; }.certificate-name { font-size: 28px; }.signature-row { width: 100%; gap: 22px; }
}

@media print {
  body { background: white; }.sidebar, .topbar, .print-button { display: none !important; }.main-area { display: block; }.page-content { padding: 0; }.certificate-page { display: block; }.certificate { width: 100%; padding: 0; box-shadow: none; }.certificate-border { min-height: 96vh; }
}
/* Standalone app additions */
#app { min-height: 100vh; }
.emoji-icon { width: 22px; text-align: center; font-size: 18px; }
.nav-button .emoji-icon { filter: saturate(.8); }
.lesson-visual-label { position: absolute; left: 16px; bottom: 16px; padding: 7px 10px; border-radius: 8px; color: #fff; background: rgba(6,26,47,.82); font-size: 11px; font-weight: 800; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 100; max-width: 360px; padding: 13px 16px; border-radius: 11px; color: #fff; background: #0c3153; box-shadow: 0 16px 40px rgba(0,0,0,.25); animation: toast-in .25s ease; }
.toast.success { background: #137544; }.toast.warning { background: #9b5b0b; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
.clickable-package { user-select: none; touch-action: none; }
.package-item[draggable="true"], .group-package[draggable="true"], .sequence-pool button[draggable="true"] { cursor: grab; }
.drop-highlight { outline: 4px solid rgba(19,115,230,.35) !important; }
.narrator-dock { position: fixed; left: 270px; right: 18px; bottom: 14px; z-index: 26; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid #aacdf1; border-radius: 13px; background: rgba(4,29,54,.96); color: #fff; box-shadow: 0 14px 32px rgba(5,26,47,.28); backdrop-filter: blur(10px); }
.narrator-dock .avatar { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; background: #1478e5; }
.narrator-dock .dock-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.narrator-dock .dock-copy strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }.narrator-dock .dock-copy span { color: #bdd0e1; font-size: 10px; }
.narrator-dock button, .narrator-dock select { min-height: 34px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; color: #fff; background: rgba(255,255,255,.08); }
.narrator-dock button { width: 38px; }.narrator-dock select { padding: 0 8px; }
.drag-van { cursor: grab; touch-action: none; }
.drag-van.dragging { cursor: grabbing; transition: none !important; }
.score-pill { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 99px; color: #0d7542; background: #e7f8ef; font-size: 11px; font-weight: 800; }
.welcome-modal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 18px; background: rgba(2,18,33,.72); backdrop-filter: blur(8px); }
.welcome-card { width: min(100%, 620px); padding: 30px; border-radius: 18px; background: #fff; box-shadow: 0 30px 70px rgba(0,0,0,.32); }
.welcome-card h1 { margin: 8px 0 10px; }.welcome-card p { color: #66758b; line-height: 1.6; }.welcome-card label { display: grid; gap: 6px; margin: 18px 0; font-weight: 800; }.welcome-card input { min-height: 46px; padding: 0 13px; border: 1px solid #dce4ee; border-radius: 10px; }
.install-note { margin-top: 14px; padding: 11px; border-radius: 10px; color: #315372; background: #edf6ff; font-size: 11px; line-height: 1.5; }
@media (max-width: 900px) { .narrator-dock { left: 12px; right: 12px; bottom: 10px; } }
@media print { .narrator-dock, .toast, .welcome-modal { display: none !important; } }
.page-content { padding-bottom: 104px; }

/* Narration controls v2 */
.voice-control { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.voice-control select, .voice-preview-button { min-height: 34px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.voice-control select { width: min(260px, 28vw); color: #16324d; }
.voice-preview-button { color: var(--blue); font-size: 10px; font-weight: 800; }
.auto-narrate-switch { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid #b9d8fa; border-radius: 999px; color: #1a5d9f; background: #fff; font-size: 10px; font-weight: 800; }
.auto-narrate-switch input { accent-color: var(--blue); }
.voice-select-dock { width: min(280px, 30vw); }
.narrator-dock .voice-select-dock { color: #fff; }

@media (max-width: 900px) {
  .voice-control { flex: 1 1 260px; }
  .voice-control select { width: 100%; }
  .voice-select-dock { width: min(220px, 28vw); }
}

@media (max-width: 640px) {
  .narration-card { align-items: stretch; }
  .narrator-copy { flex: 1; }
  .round-control { margin-left: 0; }
  .voice-control { width: 100%; flex: 1 1 100%; }
  .voice-control select { width: 100%; }
  .voice-preview-button { flex: 1; }
  .rate-control { width: auto; flex: 1; justify-content: flex-end; }
  .narrator-dock { gap: 7px; }
  .narrator-dock .dock-copy { display: none; }
  .voice-select-dock { flex: 1; width: auto; min-width: 0; }
}


/* Mobile polish v3 */
.lesson-header-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.compact-button { min-height: 38px; padding: 0 12px; }
.instruction-banner { justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.instruction-copy { display:flex; align-items:center; gap:10px; min-width:0; flex:1; }
.instruction-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.banner-button { min-height: 38px; padding: 0 12px; border:1px solid #9ec6ec; border-radius: 10px; color:#0a4f91; background:#fff; font-weight:800; }
.tap-chip { display:inline-flex; align-items:center; padding: 6px 10px; border-radius: 999px; color:#0b4f86; background:#fff; border:1px solid #bfd8f1; font-size:11px; font-weight:800; }
.mobile-helper { padding: 11px 14px; border-bottom: 1px solid var(--line); color:#30526f; background:#f5faff; font-size:13px; line-height:1.45; }
.parking-scene { touch-action: none; }
.parking-spot { border: 0; text-align:left; cursor:pointer; }
.parking-spot:focus-visible, .delivery-pin-button:focus-visible, .group-location:focus-visible, .delivery-door:focus-visible, .package-item:focus-visible, .group-package:focus-visible { outline: 4px solid rgba(19,115,230,.35); }
.delivery-pin-button { border:0; background:transparent; cursor:pointer; }
body.drag-lock { overflow:hidden; overscroll-behavior:none; touch-action:none; }
.scenario-shell:fullscreen { width:100%; height:100%; border-radius:0; display:flex; flex-direction:column; }
.scenario-shell:fullscreen .parking-scene,
.scenario-shell:fullscreen .blue-dot-map,
.scenario-shell:fullscreen .group-stop-scene,
.scenario-shell:fullscreen .package-scenario,
.scenario-shell:fullscreen .sequence-builder,
.scenario-shell:fullscreen .exception-card,
.scenario-shell:fullscreen .result-card { flex:1; }
.scenario-shell:fullscreen .scenario-footer { margin-top:auto; }
.controlled-grid-images { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.controlled-grid-images article { overflow:hidden; padding:0; display:flex; flex-direction:column; }
.controlled-grid-images article img { width:100%; aspect-ratio: 4 / 3; object-fit:contain; object-position:center; display:block; background:#0a2741; }
.controlled-card-copy { padding: 16px; display:flex; flex-direction:column; gap:10px; }
.controlled-card-copy h3 { margin:0; }
.controlled-card-copy p { margin:0; }

@media (max-width: 900px) {
  .simulator-stage { padding-bottom: 22px; }
  .lesson-header-actions { justify-content:flex-start; }
}

@media (max-width: 640px) {
  .scenario-footer { flex-direction: column-reverse; }
  .scenario-footer button, .banner-button, .compact-button { width: 100%; min-height: 44px; }
  .instruction-actions { width:100%; }
  .tap-chip { order:2; }
  .parking-scene, .blue-dot-map, .group-stop-scene { height: 480px; }
  .parking-spot { width: 110px; min-height: 66px; display:flex; align-items:flex-start; justify-content:flex-start; }
  .parking-spot span { font-size: 11px; line-height: 1.2; }
  .draggable-van { width: 138px; height: 64px; transform: none !important; }
  .blue-dot { width: 58px; height: 58px; }
  .blue-dot span { width: 28px; height: 28px; }
  .blue-dot small { top: 47px; font-size:9px; }
  .package-item, .group-package, .sequence-pool button, .answer-option, .delivery-door, .group-location { min-height: 50px; }
  .package-item { padding: 16px; }
  .group-package { padding: 15px 19px; }
  .door-bank { gap: 12px; }
  .delivery-door { min-height: 255px; }
  .group-location { width: 46%; min-height: 240px; }
  .location-a { left: 2%; }
  .location-b { right: 2%; }
  .group-flex-card { top: 12px; }
}


/* Controlled-error image correction v4 */
@media (max-width: 1100px) {
  .controlled-grid-images { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .controlled-grid-images { grid-template-columns: 1fr; }
  .controlled-grid-images article img { aspect-ratio: 4 / 3; object-fit: contain; }
}


.controlled-image-button { position: relative; display:block; width:100%; padding:0; border:0; background:#0a2741; cursor: zoom-in; }
.controlled-image-button img { width:100%; aspect-ratio:4/3; object-fit:contain; object-position:center; display:block; background:#0a2741; }
.zoom-hint { position:absolute; right:10px; bottom:10px; padding:6px 9px; border-radius:999px; color:#fff; background:rgba(4,29,54,.78); font-size:11px; font-weight:800; }
.image-zoom-modal { position:fixed; inset:0; z-index:140; display:grid; place-items:center; padding:18px; background:rgba(2,18,33,.82); backdrop-filter:blur(8px); }
.image-zoom-card { position:relative; width:min(96vw, 1200px); max-height:92vh; display:flex; flex-direction:column; gap:10px; padding:14px; border-radius:18px; background:#fff; box-shadow:0 30px 70px rgba(0,0,0,.35); }
.image-zoom-card img { width:100%; max-height:78vh; object-fit:contain; background:#0a2741; border-radius:12px; }
.image-zoom-caption { display:flex; justify-content:space-between; gap:10px; align-items:center; color:#4b5e74; font-size:13px; }
.image-zoom-caption strong { color:#102c4b; font-size:18px; }
.image-zoom-close { position:absolute; top:10px; right:10px; width:40px; height:40px; border:0; border-radius:50%; color:#fff; background:rgba(4,29,54,.82); font-size:20px; cursor:pointer; }
@media (max-width: 640px) {
  .image-zoom-modal { padding:10px; }
  .image-zoom-card { width:100%; max-height:95vh; padding:10px; }
  .image-zoom-card img { max-height:82vh; }
  .image-zoom-caption { flex-direction:column; align-items:flex-start; }
}
@media print { .image-zoom-modal { display:none !important; } }
