:root {
  color-scheme: light;
  --ink: #172d3a;
  --muted: #637681;
  --navy: #122b3a;
  --navy-soft: #1c3b4b;
  --teal: #167e78;
  --teal-light: #e4f4f1;
  --paper: #f6f8f6;
  --line: #e2e9e6;
  --white: #fff;
  --gold: #efbd67;
  --shadow: 0 16px 38px rgba(27, 56, 64, .07);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; }
button { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid #e8ad4c; outline-offset: 3px; }
.app-shell { min-height: 100vh; display: flex; }

.sidebar { width: 286px; flex: 0 0 286px; background: var(--navy); color: #e6f0ee; display: flex; flex-direction: column; padding: 27px 18px 22px; min-height: 100vh; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; padding: 0 10px 31px; }
.brand-mark { width: 43px; height: 43px; display: grid; place-items: center; background: var(--gold); border-radius: 13px; color: var(--navy); font: 800 17px Manrope, sans-serif; letter-spacing: -.08em; }
.brand strong { display: block; font: 800 18px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.04em; }
.brand small { display: block; margin-top: 2px; color: #a7bdc2; font-size: 11px; }
.course-label { padding: 0 11px 12px; color: #819ba3; font-size: 10px; font-weight: 700; letter-spacing: .13em; }
.lesson-nav { display: grid; gap: 5px; }
.lesson-link { width: 100%; border: 0; background: transparent; color: #c4d2d3; cursor: pointer; display: flex; align-items: center; gap: 12px; text-align: left; padding: 11px 12px; border-radius: 9px; transition: background .16s, color .16s; }
.lesson-link:hover { background: rgba(255,255,255,.07); color: white; }
.lesson-link.active { background: #254553; color: white; }
.lesson-number { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid #496572; border-radius: 50%; color: #9fb3b8; font-size: 10px; flex: 0 0 24px; }
.lesson-link.done .lesson-number { border-color: #6bc7a7; background: #6bc7a7; color: #153c3a; }
.lesson-name { font-size: 12px; font-weight: 600; }
.sidebar-bottom { margin-top: auto; padding: 19px 10px 0; border-top: 1px solid rgba(255,255,255,.12); }
.progress-label { display: flex; justify-content: space-between; font-size: 11px; color: #a5b8bc; }
.progress-label strong { color: #e9f2ef; font-size: 12px; }
.progress-track { height: 5px; margin-top: 10px; border-radius: 99px; overflow: hidden; background: #36515b; }
.progress-track span { display: block; height: 100%; width: 0; border-radius: inherit; background: #62c29f; transition: width .3s ease; }
.reset-progress { border: 0; padding: 12px 0 0; background: transparent; color: #8ca5ab; cursor: pointer; font-size: 11px; }
.reset-progress:hover { color: white; }

.main-content { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(22px, 5vw, 72px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.76); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.topbar-label { font-size: 10px; font-weight: 700; letter-spacing: .13em; color: #73848a; }
.top-quiz-button { border: 1px solid #d5e4e0; background: white; border-radius: 8px; padding: 9px 13px; color: var(--teal); cursor: pointer; font-size: 12px; font-weight: 700; }
.top-quiz-button:hover { background: var(--teal-light); }
.menu-toggle { display: none; border: 0; background: transparent; color: var(--navy); font-size: 20px; cursor: pointer; }
.view { width: min(920px, 100%); margin: 0 auto; padding: 43px clamp(22px, 5vw, 70px) 65px; flex: 1; }
.site-footer { display: flex; justify-content: space-between; gap: 18px; padding: 15px clamp(22px, 5vw, 72px) 18px; border-top: 1px solid var(--line); color: #849196; font-size: 10px; }

.welcome { padding: 13px 0 27px; }
.eyebrow { color: var(--teal); font-weight: 700; font-size: 10px; letter-spacing: .15em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 12px 0 14px; font: 800 clamp(30px, 4vw, 47px)/1.13 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.055em; }
.welcome h1 { max-width: 650px; }
.lead { max-width: 640px; color: var(--muted); line-height: 1.75; font-size: 16px; }
.hero-card { background: var(--navy); color: white; border-radius: 15px; padding: 23px 26px; display: flex; align-items: center; justify-content: space-between; gap: 24px; box-shadow: var(--shadow); }
.hero-card h2 { margin: 0 0 5px; font: 700 17px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.hero-card p { margin: 0; color: #afc1c4; font-size: 12px; line-height: 1.55; }
.primary-button { border: 0; border-radius: 8px; padding: 12px 16px; background: var(--gold); color: var(--navy); font-weight: 700; cursor: pointer; white-space: nowrap; }
.primary-button:hover { background: #f5ca7f; }
.primary-button:disabled, .secondary-button:disabled { opacity: .55; cursor: not-allowed; }
.section-heading { margin: 34px 0 14px; font: 700 16px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.practice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.practice-card { min-width: 0; display: flex; align-items: flex-start; gap: 11px; border: 1px solid var(--line); border-radius: 11px; background: white; padding: 15px 13px; text-align: left; cursor: pointer; transition: transform .16s, box-shadow .16s, border-color .16s; }
.practice-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #9fc9bd; }
.practice-icon { flex: 0 0 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: #edf6f1; color: var(--teal); font-weight: 800; font-size: 16px; }
.flash-card .practice-icon { background: #f2effa; color: #69599c; }
.quiz-card .practice-icon { background: #fbf3e5; color: #a47220; }
.practice-copy { display: grid; gap: 5px; }
.practice-copy strong { font: 700 12px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.practice-copy small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.practice-arrow { margin-left: auto; color: #92a4a8; font-size: 16px; }
.lesson-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lesson-card { display: flex; align-items: flex-start; gap: 14px; border: 1px solid var(--line); background: white; border-radius: 11px; padding: 17px; text-align: left; cursor: pointer; transition: border-color .16s, transform .16s, box-shadow .16s; }
.lesson-card:hover { border-color: #9fc9bd; transform: translateY(-2px); box-shadow: var(--shadow); }
.lesson-card .lesson-number { width: 31px; height: 31px; flex-basis: 31px; border-color: #d7e8e1; background: #edf6f1; color: var(--teal); font-size: 11px; }
.lesson-card h3 { margin: 2px 0 5px; font: 700 13px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.lesson-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.card-arrow { margin-left: auto; color: #92a4a8; font-size: 18px; }
.source-note { margin-top: 25px; padding: 15px 17px; border-left: 3px solid var(--gold); background: #fbf7ed; color: #70694e; font-size: 11px; line-height: 1.6; }

.lesson-header { margin-bottom: 27px; }
.lesson-header .lead { font-size: 15px; }
.lesson-section { padding: 21px 23px; margin-bottom: 12px; border: 1px solid var(--line); background: white; border-radius: 11px; }
.lesson-section h2 { margin-bottom: 9px; font: 700 16px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.02em; }
.lesson-section p { color: #526771; line-height: 1.7; margin-bottom: 11px; font-size: 13px; }
.lesson-section ul { padding-left: 19px; margin: 0; color: #405862; font-size: 12px; line-height: 1.85; }
.lesson-section li { padding-left: 2px; }
.lesson-callout { display: flex; gap: 12px; margin: 17px 0 24px; padding: 16px 18px; background: var(--teal-light); border-radius: 10px; color: #245c58; font-size: 12px; line-height: 1.6; }
.callout-label { flex: 0 0 auto; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding-top: 2px; }
.lesson-actions { display: flex; justify-content: space-between; gap: 12px; }
.secondary-button { border: 1px solid #cfddda; border-radius: 8px; padding: 11px 15px; background: white; color: var(--ink); cursor: pointer; font-size: 12px; font-weight: 600; }
.secondary-button:hover { border-color: var(--teal); color: var(--teal); }

.quiz-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.quiz-head h1 { font-size: 34px; margin-bottom: 6px; }
.quiz-meta { color: var(--muted); font-size: 12px; }
.quiz-progress { height: 5px; margin: 0 0 22px; border-radius: 50px; background: #e2e9e6; overflow: hidden; }
.quiz-progress span { height: 100%; display: block; background: var(--teal); transition: width .25s ease; }
.question-card { padding: 26px; border: 1px solid var(--line); background: white; border-radius: 12px; box-shadow: var(--shadow); }
.question-number { color: var(--teal); text-transform: uppercase; letter-spacing: .12em; font-weight: 700; font-size: 10px; }
.question-text { margin: 11px 0 20px; font: 700 20px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.03em; }
.answer-list { display: grid; gap: 9px; }
.answer-option { width: 100%; display: flex; gap: 12px; align-items: center; border: 1px solid #dfe8e5; border-radius: 8px; padding: 13px 14px; color: #3b525d; background: white; text-align: left; cursor: pointer; font-size: 13px; }
.answer-option:hover:not(:disabled) { border-color: #75b1a3; background: #f7fbf9; }
.answer-letter { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 24px; border-radius: 50%; background: #f0f4f2; color: #708189; font-size: 10px; font-weight: 700; }
.answer-option.correct { border-color: #5da88d; background: #eef8f3; color: #235a48; }
.answer-option.correct .answer-letter { background: #5da88d; color: white; }
.answer-option.incorrect { border-color: #dd887d; background: #fff3f1; color: #89483f; }
.answer-option.incorrect .answer-letter { background: #dd887d; color: white; }
.answer-option:disabled { cursor: default; }
.feedback { display: none; margin-top: 17px; padding: 13px 15px; border-radius: 8px; font-size: 12px; line-height: 1.6; }
.feedback.visible { display: block; }
.feedback.good { background: #edf7f1; color: #285d4a; }
.feedback.bad { background: #fff2ef; color: #7e4c43; }
.quiz-controls { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; }
.quiz-controls .primary-button { display: none; padding: 11px 18px; }
.quiz-controls .primary-button.visible { display: inline-block; }
.score-card { text-align: center; border: 1px solid var(--line); background: white; border-radius: 14px; padding: 38px 28px; box-shadow: var(--shadow); }
.score-number { display: grid; place-items: center; width: 96px; height: 96px; margin: 3px auto 20px; border-radius: 50%; background: var(--teal-light); color: var(--teal); font: 800 27px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.score-card h2 { font: 800 25px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.04em; margin-bottom: 8px; }
.score-card p { max-width: 460px; margin: 0 auto 21px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.score-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }

.scenario-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin: 25px 0 21px; }
.scenario-card { min-height: 205px; display: flex; flex-direction: column; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 20px; background: white; color: var(--ink); text-align: left; cursor: pointer; transition: border-color .16s, transform .16s, box-shadow .16s; }
.scenario-card:hover { border-color: #82b8aa; transform: translateY(-2px); box-shadow: var(--shadow); }
.scenario-tag { margin-bottom: 12px; padding: 5px 8px; border-radius: 99px; background: var(--teal-light); color: var(--teal); font-size: 9px; font-weight: 800; letter-spacing: .09em; }
.scenario-card h2 { margin: 0 0 7px; font: 700 16px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.scenario-card p { margin: 0 0 18px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.scenario-start { display: flex; width: 100%; justify-content: space-between; margin-top: auto; color: var(--teal); font-size: 11px; font-weight: 700; }
.simulation-note { padding: 13px 15px; border: 1px solid #efdfb9; border-radius: 9px; background: #fbf7ed; color: #716445; font-size: 11px; line-height: 1.6; }
.back-button { display: block; margin-top: 20px; }
.simulation-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 11px; }
.simulation-header h1 { margin-bottom: 0; font-size: 32px; }
.simulation-brief { margin: 0 0 18px; font-size: 13px; }
.scenario-progress, .flash-progress { height: 6px; margin: 0 0 20px; border-radius: 50px; background: #e2e9e6; overflow: hidden; }
.scenario-progress span, .flash-progress span { height: 100%; display: block; border-radius: inherit; background: var(--teal); transition: width .25s ease; }
.exchange-layout { display: grid; grid-template-columns: minmax(0, 1fr) 205px; align-items: start; gap: 14px; }
.exchange-panel { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
.exchange-label { display: flex; align-items: center; justify-content: space-between; color: #8a9a9e; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.exchange-label span { font-size: 10px; letter-spacing: normal; }
.station-message { display: flex; gap: 11px; margin: 17px 0 21px; padding: 15px; border-radius: 9px; background: #f0f5f4; }
.station-dot { flex: 0 0 8px; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px #d5ebe5; }
.station-message small { display: block; margin-bottom: 5px; color: #6a8185; font-size: 10px; font-weight: 700; }
.station-message p { margin: 0; color: #233d48; font-size: 13px; font-weight: 600; line-height: 1.55; }
.reply-heading { margin-bottom: 9px; color: #8a9a9e; font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.scenario-options { display: grid; gap: 8px; }
.scenario-option { display: flex; align-items: flex-start; gap: 10px; width: 100%; border: 1px solid #dfe8e5; border-radius: 8px; padding: 12px; background: white; color: #3b525d; text-align: left; cursor: pointer; font-size: 12px; line-height: 1.55; transition: border-color .15s, background .15s; }
.scenario-option:hover:not(:disabled) { border-color: #75b1a3; background: #f7fbf9; }
.scenario-option:disabled { cursor: default; }
.scenario-option.correct { border-color: #5da88d; background: #eef8f3; color: #235a48; }
.scenario-option.incorrect { border-color: #dd887d; background: #fff3f1; color: #89483f; }
.scenario-option-mark { flex: 0 0 22px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #f0f4f2; color: #708189; font-size: 10px; font-weight: 800; }
.scenario-option.correct .scenario-option-mark { background: #5da88d; color: white; }
.scenario-option.incorrect .scenario-option-mark { background: #dd887d; color: white; }
.scenario-feedback { display: none; margin-top: 14px; padding: 12px 13px; border-radius: 8px; font-size: 11px; line-height: 1.6; }
.scenario-feedback.visible { display: block; }
.scenario-feedback.good { background: #edf7f1; color: #285d4a; }
.scenario-feedback.bad { background: #fff2ef; color: #7e4c43; }
.scenario-controls { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 15px; }
.scenario-controls .primary-button { display: none; padding: 10px 14px; }
.scenario-controls .primary-button.visible { display: inline-block; }
.pilot-note { padding: 16px; border: 1px solid #dce8e4; border-radius: 10px; background: #edf6f2; color: #315e53; }
.pilot-note-icon { display: block; margin-bottom: 9px; color: var(--teal); font-size: 18px; }
.pilot-note strong { font: 700 12px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.pilot-note p { margin: 7px 0 0; color: #55746d; font-size: 10px; line-height: 1.6; }
.scenario-result { margin-top: 20px; padding: 36px 25px; border: 1px solid var(--line); border-radius: 14px; background: white; text-align: center; box-shadow: var(--shadow); }
.scenario-score { display: grid; place-items: center; width: 90px; height: 90px; margin: 0 auto 18px; border-radius: 50%; background: var(--teal-light); color: var(--teal); font: 800 29px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.scenario-score small { margin-left: 1px; font-size: 13px; }
.scenario-result h1 { margin-bottom: 8px; font-size: 28px; }
.scenario-result > p { max-width: 490px; margin: 0 auto 20px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.scenario-result-actions { display: flex; justify-content: center; gap: 9px; flex-wrap: wrap; }
.flash-start-grid { display: grid; gap: 10px; margin: 24px 0 16px; }
.flash-start-card { display: flex; align-items: center; gap: 14px; width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 15px; background: white; color: var(--ink); text-align: left; cursor: pointer; transition: border-color .15s, transform .15s; }
.flash-start-card:hover:not(:disabled) { border-color: #9fc9bd; transform: translateY(-1px); }
.flash-start-card > span:nth-child(2) { display: grid; gap: 4px; }
.flash-start-card strong { font: 700 13px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.flash-start-card small { color: var(--muted); font-size: 11px; }
.flash-start-card.disabled-card { opacity: .55; cursor: not-allowed; }
.deck-count { flex: 0 0 40px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: #f2effa; color: #69599c; font-size: 11px; font-weight: 800; }
.flash-progress-row { display: flex; justify-content: space-between; margin: 25px 0 8px; color: var(--muted); font-size: 11px; }
.flash-progress { margin-bottom: 16px; }
.flashcard { width: 100%; min-height: 280px; display: grid; place-items: center; padding: 30px; border: 1px solid #cfe2dc; border-radius: 16px; background: linear-gradient(140deg, #fff 0%, #eff8f4 100%); color: var(--ink); text-align: center; cursor: pointer; box-shadow: var(--shadow); transition: transform .2s, border-color .2s, background .2s; }
.flashcard:hover { transform: translateY(-2px); border-color: #83b9aa; }
.flashcard.is-flipped { border-color: #d7ceec; background: linear-gradient(140deg, #fff 0%, #f5f1fc 100%); }
.flashcard-inner { display: flex; flex-direction: column; align-items: center; gap: 15px; max-width: 590px; }
.flash-face-label { color: var(--teal); font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.flashcard.is-flipped .flash-face-label { color: #69599c; }
.flashcard-inner > strong { font: 700 clamp(18px, 3vw, 24px)/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.025em; }
.flash-hint { color: #89999d; font-size: 11px; }
.flash-why { max-width: 490px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.flash-rating { margin-top: 18px; text-align: center; }
.flash-rating > p { margin: 0 0 10px; color: var(--muted); font-size: 11px; }
.flash-rating > div { display: flex; justify-content: center; gap: 9px; }
.review-button, .know-button { border: 1px solid #ddc9c4; border-radius: 8px; padding: 11px 15px; background: white; color: #85584f; font-weight: 700; font-size: 11px; cursor: pointer; }
.review-button:hover { background: #fff2ef; }
.know-button { border-color: #b7d9ca; color: #28644d; }
.know-button:hover { background: #eef8f3; }
.flash-instruction { margin: 12px 0 0; color: var(--muted); text-align: center; font-size: 11px; }

@media (max-width: 790px) {
  .sidebar { position: fixed; z-index: 5; top: 0; bottom: 0; left: 0; transform: translateX(-100%); transition: transform .22s ease; box-shadow: 12px 0 40px rgba(15,35,44,.2); }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: block; }
  .topbar { gap: 10px; height: 60px; padding: 0 18px; }
  .topbar-label { margin-right: auto; font-size: 9px; }
  .top-actions { gap: 5px; }
  .top-quiz-button { padding: 8px 9px; font-size: 10px; }
  .practice-grid { grid-template-columns: 1fr; }
  .practice-card { align-items: center; }
  .exchange-layout { grid-template-columns: 1fr; }
  .pilot-note { display: none; }
  .view { padding-top: 30px; }
  .site-footer { flex-direction: column; gap: 5px; padding-right: 20px; }
}
@media (max-width: 540px) {
  .lesson-grid { grid-template-columns: 1fr; }
  .hero-card { align-items: flex-start; flex-direction: column; }
  .hero-card .primary-button { width: 100%; }
  .lesson-actions { flex-direction: column-reverse; }
  .lesson-actions button { width: 100%; }
  .quiz-head { align-items: flex-start; flex-direction: column; }
  .quiz-head h1 { font-size: 29px; }
  .question-card { padding: 20px 16px; }
  .question-text { font-size: 18px; }
  .quiz-controls { gap: 10px; }
  .quiz-controls button { flex: 1; }
  .topbar { padding: 0 11px; gap: 6px; }
  .topbar-label { max-width: 100px; line-height: 1.4; font-size: 8px; }
  .top-actions { gap: 4px; }
  .top-quiz-button { padding: 7px 7px; font-size: 9px; }
  .top-quiz-button span { display: none; }
  .scenario-grid { grid-template-columns: 1fr; }
  .scenario-card { min-height: 175px; }
  .simulation-header { align-items: flex-start; }
  .simulation-header h1 { font-size: 26px; }
  .simulation-header > .secondary-button { padding: 9px; font-size: 10px; }
  .exchange-panel { padding: 15px 12px; }
  .scenario-controls { align-items: flex-end; }
  .scenario-controls .quiz-meta { max-width: 120px; line-height: 1.45; }
  .scenario-result-actions { flex-direction: column; }
  .scenario-result-actions button { width: 100%; }
  .flashcard { min-height: 245px; padding: 22px 16px; }
  .flash-rating > div { flex-direction: column; }
}
