@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,700;1,700&display=swap');

:root {
  --navy: #0f1f3d;
  --navy2: #1a3260;
  --accent: #e85d26;
  --accent2: #ff7a45;
  --gold: #c9a83c;
  --gold2: #e8c96a;
  --teal: #0f8a72;
  --teal2: #13b396;
  --green: #1a7a45;
  --green-bg: #edf7f2;
  --red: #c0392b;
  --red-bg: #fdf0ef;
  --amber: #b45309;
  --amber-bg: #fffbeb;
  --blue: #1d4ed8;
  --blue-bg: #eff6ff;
  --bg: #f2f4f8;
  --surface: #ffffff;
  --surface2: #f7f8fb;
  --border: #e2e6ef;
  --text: #111827;
  --muted: #6b7280;
  --light: #9ca3af;
  --header: 60px;
  --prog: 52px;
  --footer: 78px;
  --r: 14px;
  --r-sm: 8px;
  --sh: 0 2px 16px rgba(15,31,61,0.08);
  --sh-md: 0 6px 32px rgba(15,31,61,0.14);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; font-family: 'Outfit', sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.65; }

/* ── APP SHELL ── */
#app { display: flex; flex-direction: column; height: 100vh; min-height: 100dvh; overflow: hidden; }

/* ── HEADER ── */
#header {
  height: var(--header);
  background: var(--navy);
  display: flex; align-items: center;
  padding: 0 28px; gap: 14px;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  z-index: 100;
}

.hdr-logo { display: flex; align-items: center; gap: 10px; }
.hdr-logo-mark {
  width: 34px; height: 34px; background: var(--accent);
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: white; letter-spacing: -0.5px;
}
.hdr-logo-name { color: white; font-size: 14px; font-weight: 700; letter-spacing: 0.02em; }
.hdr-sep { width: 1px; height: 26px; background: rgba(255,255,255,0.15); }
.hdr-mod { flex: 1; color: rgba(255,255,255,0.6); font-size: 13px; }
.hdr-mod strong { color: white; }
.hdr-timer {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px; padding: 4px 14px;
  color: rgba(255,255,255,0.85); font-size: 13px; font-weight: 600;
  font-variant-numeric: tabular-nums; letter-spacing: 0.04em;
}

/* ── PROGRESS ── */
#progress-bar {
  height: var(--prog);
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 0;
  padding: 0 28px;
  flex-shrink: 0;
}

.prog-steps { display: flex; align-items: center; gap: 0; flex: 1; }

.nav-step {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600;
  color: var(--light); text-transform: uppercase; letter-spacing: 0.06em;
  position: relative;
}

.nav-step::after {
  content: ''; display: block;
  width: 24px; height: 2px;
  background: var(--border); margin: 0 8px;
  border-radius: 99px;
}

.nav-step:last-child::after { display: none; }

.ns-dot {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface2); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: var(--light);
  flex-shrink: 0;
}

.nav-step.active .ns-dot { background: var(--accent); border-color: var(--accent); color: white; }
.nav-step.active { color: var(--accent); }
.nav-step.done .ns-dot { background: var(--green); border-color: var(--green); color: white; }
.nav-step.done { color: var(--green); }
.nav-step.done::after { background: var(--green); }

.prog-right { display: flex; align-items: center; gap: 14px; margin-left: 20px; }

#prog-track { width: 140px; height: 6px; background: var(--surface2); border-radius: 99px; overflow: hidden; border: 1px solid var(--border); }
#prog-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 99px; transition: width 0.6s cubic-bezier(.4,0,.2,1); }
#prog-text { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }

/* ── CONTENT ── */
#content { flex: 1; overflow-y: auto; padding: 32px 28px; }

#slide-area { max-width: 920px; margin: 0 auto; }

.slide-in { animation: slideIn 0.38s cubic-bezier(.4,0,.2,1); }
@keyframes slideIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ── FOOTER ── */
#footer {
  height: var(--footer); background: var(--surface); border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 0 28px; flex-shrink: 0;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.05);
}

.footer-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
}

.footer-credit {
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted);
  font-weight: 500;
}

.nav-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 26px; border-radius: 10px;
  font-family: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all 0.2s; border: none;
}

#btn-prev { background: var(--surface2); color: var(--text); border: 1.5px solid var(--border); }
#btn-prev:hover:not(:disabled) { background: var(--border); }
#btn-prev:disabled { opacity: 0.38; cursor: not-allowed; }

#btn-next { background: var(--navy); color: white; }
#btn-next:hover:not(:disabled) { background: var(--navy2); transform: translateY(-1px); box-shadow: var(--sh-md); }
#btn-next:disabled { opacity: 0.38; cursor: not-allowed; }

/* ── SHARED SLIDE ELEMENTS ── */
.slide-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 8px;
}

.slide-h {
  font-family: 'Playfair Display', serif;
  font-size: 32px; color: var(--navy); line-height: 1.2; margin-bottom: 10px;
}

.slide-sub { font-size: 15px; color: var(--muted); margin-bottom: 28px; max-width: 700px; line-height: 1.7; }

/* ══ SLIDE: INTRO ══ */
.s-intro {
  background: var(--navy);
  border-radius: 20px; padding: 60px; min-height: 520px;
  position: relative; overflow: hidden; color: white;
}

.intro-bg-pattern {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 85% 20%, rgba(232,93,38,0.18) 0%, transparent 50%),
    radial-gradient(circle at 15% 80%, rgba(201,168,60,0.12) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.02) 0%, transparent 70%);
}

.intro-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(201,168,60,0.18); border: 1px solid rgba(201,168,60,0.4);
  color: var(--gold2); font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 5px 16px; border-radius: 99px; margin-bottom: 22px;
  position: relative; z-index: 1;
}

.badge-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold2); animation: pulse 2s ease infinite;
}

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.intro-mod-tag {
  font-size: 11px; font-weight: 700; letter-spacing: 0.2em;
  color: rgba(255,255,255,0.4); text-transform: uppercase;
  margin-bottom: 14px; position: relative; z-index: 1;
}

.intro-title {
  font-family: 'Playfair Display', serif; font-size: 52px; line-height: 1.1;
  color: white; margin-bottom: 20px; position: relative; z-index: 1;
}

.intro-title em { color: var(--accent2); font-style: italic; }

.intro-desc {
  font-size: 15px; color: rgba(255,255,255,0.7); max-width: 580px;
  line-height: 1.75; margin-bottom: 36px; position: relative; z-index: 1;
}

.intro-stats {
  display: flex; gap: 16px; flex-wrap: wrap;
  margin-bottom: 32px; position: relative; z-index: 1;
}

.stat-pill {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  padding: 12px 18px; border-radius: 12px;
}

.stat-icon { font-size: 22px; }
.stat-pill div { display: flex; flex-direction: column; gap: 1px; }
.stat-pill strong { font-size: 15px; color: white; font-weight: 700; }
.stat-pill span { font-size: 11px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.05em; }

.intro-topics {
  display: flex; flex-wrap: wrap; gap: 8px;
  position: relative; z-index: 1;
}

.topic-tag {
  background: rgba(232,93,38,0.15); border: 1px solid rgba(232,93,38,0.3);
  color: rgba(255,255,255,0.8); font-size: 12px; font-weight: 600;
  padding: 5px 14px; border-radius: 99px;
}

/* ══ SLIDE: OBJECTIVES ══ */
.obj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.obj-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 22px 20px; display: flex; gap: 16px; align-items: flex-start;
  transition: box-shadow 0.2s, transform 0.2s;
}

.obj-card:hover { box-shadow: var(--sh); transform: translateY(-2px); }

.obj-n {
  font-family: 'Playfair Display', serif; font-size: 30px;
  color: var(--accent); line-height: 1; flex-shrink: 0; opacity: 0.8;
}

.obj-card p { font-size: 14px; color: var(--text); line-height: 1.65; }

/* ══ SLIDE: LESSONS ══ */
.lesson-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}

.lesson-label span { color: var(--accent); }

/* Tabs */
.tabs-wrap { margin-top: 4px; }

.tabs-nav {
  display: flex; border-bottom: 2px solid var(--border);
  gap: 2px; margin-bottom: 0;
}

.tab-btn {
  padding: 10px 20px; background: none; border: none;
  font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--muted); cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  border-radius: 8px 8px 0 0; transition: all 0.18s;
}

.tab-btn:hover { color: var(--navy); background: var(--surface2); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); background: var(--surface); }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.lesson-body {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 0 var(--r) var(--r) var(--r); padding: 28px;
}

.rule-row { display: flex; gap: 20px; margin-bottom: 24px; align-items: flex-start; }
.rule-row:last-child { margin-bottom: 0; }

.rule-badge {
  background: var(--navy); color: white; font-size: 11px; font-weight: 700;
  padding: 5px 12px; border-radius: 6px; white-space: nowrap;
  text-transform: uppercase; letter-spacing: 0.06em; flex-shrink: 0; margin-top: 2px;
}

.rule-info { flex: 1; }
.rule-info p { font-size: 14px; color: var(--muted); margin-bottom: 10px; }

.eg { padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 7px; display: flex; align-items: baseline; gap: 10px; }
.eg.correct { background: var(--green-bg); color: #1a4a30; border-left: 3px solid var(--green); }
.eg.wrong { background: var(--red-bg); color: #7a1a12; border-left: 3px solid var(--red); }
.eg-note { font-size: 12px; opacity: 0.75; font-style: italic; }

.inner-h { font-size: 16px; font-weight: 700; color: var(--navy); margin-bottom: 16px; }

.error-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.error-card {
  background: var(--surface2); border-radius: 10px; padding: 16px 18px;
  border-left: 4px solid var(--accent);
}

.ec-wrong { color: var(--red); font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.ec-right { color: var(--green); font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.ec-note { font-size: 12px; color: var(--muted); line-height: 1.5; }

.callout {
  display: flex; gap: 12px; align-items: flex-start;
  border-radius: 10px; padding: 16px 18px; margin-top: 18px; font-size: 14px;
}

.callout.blue { background: var(--blue-bg); border: 1px solid #bfdbfe; color: #1e3a8a; }
.callout.amber { background: var(--amber-bg); border: 1px solid #fde68a; color: #78350f; }
.callout.green { background: var(--green-bg); border: 1px solid #a7f3d0; color: #065f46; }

/* Flip cards */
.flip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }

.flip-card {
  height: 200px; cursor: pointer;
  perspective: 1000px; position: relative;
}

.flip-front, .flip-back {
  position: absolute; inset: 0; backface-visibility: hidden;
  border-radius: var(--r); padding: 24px;
  transition: transform 0.55s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}

.flip-front {
  background: var(--navy); color: white;
  align-items: center; justify-content: center; text-align: center;
  border: 2px solid rgba(255,255,255,0.08);
}

.flip-back {
  background: var(--surface); border: 1.5px solid var(--border);
  transform: rotateY(180deg);
  justify-content: center;
}

.flip-card.flipped .flip-front { transform: rotateY(-180deg); }
.flip-card.flipped .flip-back { transform: rotateY(0); }

.flip-num { font-size: 40px; font-weight: 800; color: var(--accent2); margin-bottom: 8px; line-height: 1; }
.flip-title { font-size: 16px; font-weight: 700; color: white; margin-bottom: 8px; }
.flip-hint { font-size: 11px; color: rgba(255,255,255,0.4); }
.flip-rule { font-size: 14px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.flip-sub { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.flip-eg { font-size: 13px; font-style: italic; color: var(--green); background: var(--green-bg); padding: 8px 12px; border-radius: 7px; }

/* Article deck */
.article-deck { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.art-card { border-radius: var(--r); overflow: hidden; border: 1px solid var(--border); }
.art-header { padding: 14px 18px; font-size: 14px; font-weight: 800; letter-spacing: 0.08em; }
.art-card.navy .art-header { background: var(--navy); color: white; }
.art-card.orange .art-header { background: var(--accent); color: white; }
.art-card.teal .art-header { background: var(--teal); color: white; }
.art-body { padding: 16px 18px; background: var(--surface); }
.art-body p { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.art-body ul { padding-left: 0; list-style: none; margin-bottom: 12px; }
.art-body ul li { font-size: 12px; color: var(--text); padding: 3px 0 3px 16px; position: relative; }
.art-body ul li::before { content: '→'; position: absolute; left: 0; color: var(--accent); font-size: 11px; }
.art-body .eg { font-size: 12px; margin-bottom: 6px; }

/* Sentence types */
.sent-types { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }

.sent-card { border-radius: var(--r); overflow: hidden; border: 1px solid var(--border); }
.sent-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; }
.sent-card:nth-child(1) .sent-header { background: #e8f0fe; }
.sent-card:nth-child(2) .sent-header { background: #fff3e8; }
.sent-card:nth-child(3) .sent-header { background: #edf7f2; }
.sent-header span { font-size: 13px; font-weight: 800; color: var(--navy); letter-spacing: 0.05em; }
.sent-header code { font-family: 'Outfit', sans-serif; font-size: 12px; background: rgba(0,0,0,0.07); padding: 3px 10px; border-radius: 99px; color: var(--muted); }
.sent-body { padding: 18px 20px; background: var(--surface); }
.sent-body p { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.sent-eg { font-size: 14px; font-style: italic; color: var(--navy); padding: 8px 14px; background: var(--surface2); border-radius: 7px; margin-bottom: 7px; border-left: 3px solid var(--accent); }
.sent-use { font-size: 12px; color: var(--green); font-weight: 600; }

/* Modal grid */
.modal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }

.modal-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 18px; position: relative; overflow: hidden;
}

.modal-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 4px; height: 100%; background: currentColor;
}

.modal-card.neutral::before { background: var(--blue); }
.modal-card.formal::before { background: var(--green); }
.modal-card.advisory::before { background: var(--teal); }
.modal-card.strong::before { background: var(--red); }
.modal-card.v-formal::before { background: #7c3aed; }

.mc-word { font-size: 22px; font-style: italic; font-weight: 800; color: var(--navy); margin-bottom: 4px; }
.mc-use { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.mc-eg { font-size: 12px; font-style: italic; color: var(--text); margin-bottom: 10px; line-height: 1.5; }
.mc-level { font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 99px; letter-spacing: 0.06em; text-transform: uppercase; display: inline-block; }
.mc-level.neutral { background: #dbeafe; color: var(--blue); }
.mc-level.formal { background: var(--green-bg); color: var(--green); }
.mc-level.advisory { background: #ccfbf1; color: var(--teal); }
.mc-level.strong { background: var(--red-bg); color: var(--red); }
.mc-level.v-formal { background: #ede9fe; color: #6d28d9; }

.modal-compare {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 18px 22px;
}

.mc-bad { flex: 1; padding: 12px 16px; background: var(--red-bg); border-radius: 8px; font-size: 14px; color: #7a1a12; font-weight: 500; }
.mc-arrow { font-size: 22px; color: var(--muted); flex-shrink: 0; }
.mc-good { flex: 1; padding: 12px 16px; background: var(--green-bg); border-radius: 8px; font-size: 14px; color: #1a4a30; font-weight: 500; }

/* MTI Accordion */
.acc-list { display: flex; flex-direction: column; gap: 8px; }

.acc-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }

.acc-head {
  padding: 16px 20px; display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; transition: background 0.18s; user-select: none;
}

.acc-head:hover { background: var(--surface2); }
.acc-item.open .acc-head { background: #fdf0ef; }

.acc-wrong { font-size: 14px; font-weight: 600; color: var(--red); }
.acc-arrow { transition: transform 0.3s; color: var(--muted); font-size: 13px; }
.acc-item.open .acc-arrow { transform: rotate(180deg); }

.acc-body { display: none; padding: 0 20px 20px; }
.acc-item.open .acc-body { display: block; animation: fadeIn 0.2s ease; }

.acc-right { color: var(--green); font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.acc-why { font-size: 13px; color: var(--muted); background: var(--surface2); padding: 10px 14px; border-radius: 8px; line-height: 1.6; }

/* ══ SCENARIO ══ */
.s-scenario { padding: 4px 0; }

.sc-situation {
  background: var(--navy); color: rgba(255,255,255,0.85);
  border-radius: var(--r); padding: 18px 22px;
  font-size: 14px; margin-bottom: 24px; line-height: 1.7;
}

.sc-steps { display: flex; flex-direction: column; gap: 20px; }

.sc-step {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 24px; overflow: hidden;
}

.sc-step-num {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}

.sc-prompt {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface2); border-radius: 10px; padding: 16px;
  margin-bottom: 18px; border-left: 4px solid var(--navy);
}

.sc-prompt-icon { font-size: 22px; flex-shrink: 0; }
.sc-prompt-text { font-size: 14px; color: var(--text); line-height: 1.7; font-style: italic; }

.sc-choices { display: flex; flex-direction: column; gap: 10px; }

.sc-choice {
  text-align: left; padding: 14px 18px;
  border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--surface); font-family: inherit; font-size: 14px;
  color: var(--text); cursor: pointer; transition: all 0.2s; line-height: 1.6;
}

.sc-choice:hover:not(:disabled) { border-color: var(--navy); background: var(--surface2); transform: translateX(4px); }
.sc-choice:disabled { cursor: default; }
.sc-choice.selected.excellent { border-color: var(--green); background: var(--green-bg); color: #1a4a30; }
.sc-choice.selected.good { border-color: var(--teal); background: #f0fdf9; color: #0d5a4a; }
.sc-choice.selected.average { border-color: #d97706; background: #fffbeb; color: #78350f; }
.sc-choice.selected.poor { border-color: var(--red); background: var(--red-bg); color: #7a1a12; }

.sc-feedback { margin-top: 14px; }

.sc-fb-inner { padding: 14px 16px; border-radius: 8px; font-size: 14px; line-height: 1.65; font-weight: 500; }
.sc-fb-inner.excellent { background: var(--green-bg); color: #1a4a30; border-left: 3px solid var(--green); }
.sc-fb-inner.good { background: #f0fdf9; color: #0d5a4a; border-left: 3px solid var(--teal); }
.sc-fb-inner.average { background: var(--amber-bg); color: #78350f; border-left: 3px solid #d97706; }
.sc-fb-inner.poor { background: var(--red-bg); color: #7a1a12; border-left: 3px solid var(--red); }

.sc-complete-inner {
  background: linear-gradient(135deg, var(--navy), var(--navy2));
  color: white; border-radius: var(--r); padding: 28px; text-align: center;
}

.sc-complete-icon { font-size: 44px; margin-bottom: 12px; }
.sc-complete-title { font-family: 'Playfair Display', serif; font-size: 22px; margin-bottom: 8px; }
.sc-complete-sub { font-size: 14px; color: rgba(255,255,255,0.7); }

/* ══ PRACTICE ══ */
.s-practice { padding: 4px 0; }

.prac-group {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 24px; margin-bottom: 16px;
}

.prac-q { font-size: 15px; font-weight: 700; color: var(--navy); margin-bottom: 16px; }
.prac-opts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }

.prac-opt {
  padding: 13px 18px; border: 1.5px solid var(--border);
  border-radius: 9px; font-size: 14px; cursor: pointer;
  transition: all 0.2s; color: var(--text); background: var(--surface);
}

.prac-opt:hover:not(.answered) { border-color: var(--navy); background: var(--surface2); }
.prac-opt.correct { border-color: var(--green); background: var(--green-bg); color: #1a4a30; font-weight: 600; }
.prac-opt.wrong { border-color: var(--red); background: var(--red-bg); color: #7a1a12; text-decoration: line-through; }
.prac-opt.answered { cursor: default; }

.prac-fb {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px; border-radius: 9px; font-size: 14px;
  line-height: 1.65; font-weight: 500;
}

.prac-fb.correct { background: var(--green-bg); color: #1a4a30; border-left: 3px solid var(--green); }
.prac-fb.wrong { background: var(--red-bg); color: #7a1a12; border-left: 3px solid var(--red); }

/* ══ QUIZ ══ */
.s-quiz { padding: 4px 0; }

.quiz-warn {
  background: var(--amber-bg); border: 1px solid #fde68a; color: var(--amber);
  padding: 12px 18px; border-radius: 9px; font-size: 14px; font-weight: 600;
  margin-bottom: 18px;
}

@keyframes shake {
  0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); }
}

.quiz-qs { display: flex; flex-direction: column; gap: 18px; }

.quiz-q {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 24px;
}

.qq-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }

.qq-num {
  background: var(--accent); color: white; font-size: 12px; font-weight: 800;
  padding: 3px 12px; border-radius: 99px; letter-spacing: 0.04em;
}

.qq-num span { color: rgba(255,255,255,0.65); }

.qq-ctx {
  font-size: 12px; background: #f0f4ff; color: #3a4a7a;
  padding: 3px 12px; border-radius: 99px; font-weight: 600;
}

.qq-text { font-size: 15px; font-weight: 700; color: var(--navy); margin-bottom: 16px; line-height: 1.6; }

.qq-opts { display: flex; flex-direction: column; gap: 9px; }

.quiz-opt {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; border: 1.5px solid var(--border);
  border-radius: 9px; cursor: pointer; transition: all 0.18s;
}

.quiz-opt:hover { border-color: var(--navy); background: var(--surface2); }
.quiz-opt.selected { border-color: var(--accent); background: #fff5f0; }
.quiz-opt input { margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }

.qo-letter {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: var(--muted); flex-shrink: 0;
}

.quiz-opt.selected .qo-letter { background: var(--accent); border-color: var(--accent); color: white; }
.qo-text { font-size: 14px; color: var(--text); line-height: 1.55; }

.quiz-footer-note {
  margin-top: 22px; padding: 14px 18px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 9px; font-size: 13px; color: var(--muted);
}

/* ══ RESULTS ══ */
.s-results { padding: 4px 0; }

.res-banner {
  display: flex; align-items: center; gap: 20px;
  border-radius: var(--r) var(--r) 0 0; padding: 28px 32px;
}

.res-banner.pass { background: linear-gradient(135deg, #166534, #1a7a45); color: white; }
.res-banner.fail { background: linear-gradient(135deg, var(--navy), var(--navy2)); color: white; }

.res-icon { font-size: 22px; font-weight: 800; color: var(--navy); letter-spacing: 0.04em; }
.res-status { font-family: 'Playfair Display', serif; font-size: 28px; color: white; margin-bottom: 4px; }
.res-sub { font-size: 14px; color: rgba(255,255,255,0.75); }

.res-score-row {
  background: var(--surface); border: 1px solid var(--border); border-top: none;
  padding: 28px 32px; display: flex; align-items: center; gap: 40px; margin-bottom: 28px;
}

.res-circle {
  position: relative; width: 140px; height: 140px; flex-shrink: 0;
}

.res-circle svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rc-bg { fill: none; stroke: var(--surface2); stroke-width: 10; }
.rc-fill { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray 1.5s cubic-bezier(.4,0,.2,1); }
.rc-fill.pass { stroke: var(--green); }
.rc-fill.fail { stroke: var(--red); }

.rc-inner {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}

.rc-num { font-family: 'Playfair Display', serif; font-size: 34px; color: var(--navy); line-height: 1; }
.rc-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }

.res-stats { flex: 1; }

.rs-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}

.rs-row:last-child { border-bottom: none; }
.rs-row span { color: var(--muted); }
.rs-row strong { font-weight: 700; color: var(--navy); }
.pass-col { color: var(--green) !important; }
.fail-col { color: var(--red) !important; }

.res-review h3 { font-family: 'Playfair Display', serif; font-size: 22px; color: var(--navy); margin-bottom: 16px; }

.rv-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 20px; margin-bottom: 12px;
  border-left: 5px solid;
}

.rv-item.pass { border-left-color: var(--green); }
.rv-item.fail { border-left-color: var(--red); }

.rv-q { font-weight: 700; font-size: 14px; color: var(--navy); margin-bottom: 8px; }
.rv-ans { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.rv-ans em { color: var(--text); font-style: normal; font-weight: 600; }
.rv-correct { font-size: 13px; color: var(--green); font-weight: 700; margin-bottom: 8px; }
.rv-correct em { font-style: normal; }
.rv-why { font-size: 13px; background: var(--amber-bg); border: 1px solid #fde68a; padding: 10px 14px; border-radius: 8px; line-height: 1.65; color: #7a5000; }

/* ══ CERTIFICATE PROMPT ══ */
.s-cert-prompt {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 60px; text-align: center;
  max-width: 520px; margin: 0 auto;
}

.cp-icon { font-size: 60px; margin-bottom: 20px; }
.cp-title { font-family: 'Playfair Display', serif; font-size: 32px; color: var(--navy); margin-bottom: 14px; }
.cp-desc { font-size: 15px; color: var(--muted); margin-bottom: 32px; line-height: 1.7; }
.cp-form { display: flex; flex-direction: column; gap: 14px; }
.cp-label { font-size: 13px; font-weight: 700; color: var(--navy); text-align: left; }

.cp-input {
  padding: 14px 18px; border: 1.5px solid var(--border);
  border-radius: 10px; font-family: inherit; font-size: 15px;
  color: var(--text); transition: border-color 0.18s; outline: none;
}

.cp-input:focus { border-color: var(--accent); }

.cp-btn {
  padding: 14px 28px; background: var(--navy); color: white;
  border: none; border-radius: 10px; font-family: inherit;
  font-size: 15px; font-weight: 700; cursor: pointer; transition: all 0.2s;
}

.cp-btn:hover:not(:disabled) { background: var(--navy2); transform: translateY(-2px); box-shadow: var(--sh-md); }
.cp-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.cp-retry {
  margin-top: 16px; padding: 12px 16px; background: var(--amber-bg);
  border: 1px solid #fde68a; border-radius: 9px;
  font-size: 13px; color: var(--amber); line-height: 1.6;
}

/* ══ CERTIFICATE ══ */
.s-certificate { padding: 4px 0; }

.cert-wrap { display: flex; justify-content: center; margin-bottom: 24px; }

.cert-doc {
  width: 100%; max-width: 780px;
  background: white; border-radius: 16px;
  box-shadow: 0 8px 48px rgba(15,31,61,0.18), 0 0 0 1px rgba(0,0,0,0.06);
  overflow: hidden; position: relative;
}

.cert-top-bar {
  height: 10px;
  background: linear-gradient(90deg, var(--navy), var(--accent), var(--gold));
}

.cert-logo-row {
  display: flex; align-items: center; gap: 10px;
  padding: 24px 48px; border-bottom: 1px solid var(--border);
}

.cert-logo-mark {
  width: 38px; height: 38px; background: var(--navy);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900; color: white; letter-spacing: -1px;
}

.cert-logo-text { font-size: 16px; font-weight: 800; color: var(--navy); }

.cert-presents { text-align: center; font-size: 14px; color: var(--muted); padding: 36px 48px 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.cert-name { text-align: center; font-family: 'Playfair Display', serif; font-style: italic; font-size: 42px; color: var(--navy); padding: 0 48px 16px; }
.cert-has { text-align: center; font-size: 14px; color: var(--muted); padding: 0 48px 12px; letter-spacing: 0.04em; }
.cert-module { text-align: center; font-family: 'Playfair Display', serif; font-size: 22px; color: var(--accent); padding: 0 48px 8px; }
.cert-programme { text-align: center; font-size: 13px; color: var(--muted); padding: 0 48px 32px; letter-spacing: 0.06em; }

.cert-meta-row {
  display: flex; justify-content: center; gap: 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.cert-meta-item {
  flex: 1; padding: 18px; text-align: center;
  border-right: 1px solid var(--border);
}

.cert-meta-item:last-child { border-right: none; }
.cm-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 5px; font-weight: 700; }
.cm-val { font-size: 16px; font-weight: 800; color: var(--navy); }
.cm-val.pass { color: var(--green); }
.cm-val.fail { color: var(--muted); }

.cert-sigs { display: flex; align-items: flex-end; justify-content: space-around; padding: 32px 48px; }

.cert-sig { text-align: center; }
.cert-sig-line { width: 160px; height: 1px; background: var(--navy); margin-bottom: 8px; }
.cert-sig-name { font-size: 13px; font-weight: 700; color: var(--navy); }
.cert-sig-org { font-size: 11px; color: var(--muted); }

.cert-seal { display: flex; align-items: center; justify-content: center; }

.seal-outer {
  width: 90px; height: 90px; border-radius: 50%;
  border: 3px solid var(--gold); display: flex; align-items: center; justify-content: center;
  background: white;
  box-shadow: 0 0 0 6px rgba(201,168,60,0.15);
}

.seal-inner {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--navy); display: flex; align-items: center; justify-content: center;
}

.seal-text { font-size: 9px; font-weight: 900; color: var(--gold); text-align: center; letter-spacing: 0.08em; line-height: 1.5; }

.cert-bottom-bar { height: 6px; background: linear-gradient(90deg, var(--gold), var(--accent), var(--navy)); }

.cert-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }

.cert-print-btn {
  padding: 14px 32px; background: var(--navy); color: white;
  border: none; border-radius: 10px; font-family: inherit;
  font-size: 15px; font-weight: 700; cursor: pointer; transition: all 0.2s;
}

.cert-print-btn:hover { background: var(--navy2); transform: translateY(-2px); box-shadow: var(--sh-md); }
.cert-note { font-size: 13px; color: var(--muted); text-align: center; }

/* ── PRINT ── */
@media print {
  #header, #progress-bar, #footer, .cert-actions { display: none !important; }
  #content { overflow: visible !important; padding: 0 !important; }
  .cert-doc { box-shadow: none !important; border: 1px solid #ccc; }
  body { background: white !important; }
}

/* ── RESPONSIVE ── */
@media (max-width: 720px) {
  #header {
    height: auto;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "logo timer"
      "module module";
    display: grid;
    padding: 10px 14px;
    gap: 8px 12px;
  }
  .hdr-logo { grid-area: logo; min-width: 0; }
  .hdr-logo-name { font-size: 13px; }
  .hdr-sep { display: none; }
  .hdr-mod {
    grid-area: module;
    font-size: 11px;
    line-height: 1.35;
  }
  .hdr-timer {
    grid-area: timer;
    font-size: 12px;
    padding: 4px 10px;
    justify-self: end;
  }
  #progress-bar {
    height: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 14px;
  }
  .prog-steps { justify-content: space-between; }
  .nav-step::after {
    width: 12px;
    margin: 0 4px;
  }
  .s-intro {
    padding: 32px 24px;
    min-height: auto;
  }
  .intro-title { font-size: 34px; }
  .intro-desc { margin-bottom: 24px; }
  .intro-stats {
    flex-direction: column;
    gap: 10px;
  }
  .stat-pill { width: 100%; }
  .topic-tag {
    font-size: 11px;
    padding: 5px 10px;
  }
  #content { padding: 20px 14px; }
  .slide-h { font-size: 28px; }
  .slide-sub { font-size: 14px; }
  .slide-eyebrow { font-size: 10px; }
  .tone-slide-header { flex-direction: column; align-items: flex-start !important; }
  .prog-right {
    margin-left: 0;
    gap: 10px;
    justify-content: space-between;
  }
  #prog-track { width: auto; flex: 1; min-width: 0; }
  #prog-text { font-size: 11px; }
  .tabs-nav {
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .tabs-nav::-webkit-scrollbar { display: none; }
  .tab-btn {
    flex: 0 0 auto;
    padding: 10px 14px;
    white-space: nowrap;
  }
  .lesson-body,
  .sc-step,
  .prac-group,
  .quiz-q,
  .rv-item,
  .ai-panel,
  .ai-scorecard,
  .ai-chat-eval,
  .insight-panel-wrap,
  .ai-insight-card,
  .s-cert-prompt {
    padding: 18px;
  }
  .s-cert-prompt {
    max-width: none;
    border-radius: 16px;
  }
  .cp-title { font-size: 28px; }
  .cp-desc { font-size: 14px; margin-bottom: 24px; }
  .rule-row,
  .modal-compare,
  .sc-prompt,
  .personal-tip,
  .ai-tip-callout,
  .chat-input-row,
  .res-banner,
  .insight-section-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .acc-head,
  .sent-header {
    align-items: flex-start;
    gap: 8px;
  }
  .mc-arrow {
    align-self: center;
    transform: rotate(90deg);
  }
  .flip-card { height: 180px; }
  .obj-grid, .flip-grid, .error-cards, .modal-grid { grid-template-columns: 1fr; }
  .article-deck { grid-template-columns: 1fr; }
  .res-score-row {
    flex-direction: column;
    padding: 20px 18px;
    gap: 20px;
  }
  .res-banner {
    padding: 20px 18px;
    gap: 12px;
  }
  .res-status { font-size: 24px; }
  .res-circle {
    width: 120px;
    height: 120px;
  }
  .rs-row {
    align-items: flex-start;
    gap: 8px;
  }
  #footer {
    height: auto;
    padding: 10px 14px;
    gap: 10px;
  }
  .nav-btn {
    padding: 10px 14px;
    font-size: 13px;
  }
  .footer-meta { padding: 0 4px; }
  .footer-credit { font-size: 10px; line-height: 1.35; }
  .tone-scenario-card,
  .sc-situation {
    padding: 14px;
  }
  .tone-capture-hint,
  .tone-voice-status {
    max-width: none;
  }
  .ai-overall-band { font-size: 24px; }
  .tone-badge-wrap,
  .ai-tone-badge-row {
    flex-wrap: wrap;
    margin-bottom: 16px;
  }
  .persona-grid { grid-template-columns: 1fr; }
  .persona-card { padding: 16px 14px; }
  .voice-lab-link { white-space: normal; }
  .chat-bubble-wrap { max-width: 92%; }
  .chat-window {
    min-height: 220px;
    max-height: 320px;
    padding: 14px;
  }
  .chat-input-row { padding: 12px; }
  .chat-input-row textarea,
  .chat-textarea {
    width: 100%;
    min-height: 88px;
  }
  .chat-send-btn,
  .chat-input-row .btn-primary {
    width: 100%;
    justify-content: center;
  }
  .resolved-badge,
  .ai-resolved-yes,
  .ai-resolved-no {
    font-size: 14px;
    padding: 8px 14px;
  }
  .verdict-text,
  .ai-chat-verdict {
    font-size: 18px;
    padding: 12px 0 0;
  }
  .next-focus,
  .ai-next-focus {
    width: 100%;
    justify-content: center;
    text-align: center;
    white-space: normal;
  }
  .s-certificate { padding: 0; }
  .cert-doc { border-radius: 12px; }
  .cert-logo-row { padding: 18px 20px; }
  .cert-presents { padding: 28px 20px 10px; font-size: 12px; }
  .cert-name { font-size: 28px; padding: 0 20px 14px; }
  .cert-has { padding: 0 20px 10px; font-size: 13px; }
  .cert-module { padding: 0 20px 8px; font-size: 16px; line-height: 1.35; }
  .cert-programme { padding: 0 20px 22px; font-size: 12px; letter-spacing: 0.03em; }
  .cert-meta-row { display: grid; grid-template-columns: 1fr 1fr; }
  .cert-meta-item {
    padding: 16px 12px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .cert-meta-item:nth-child(2n) { border-right: none; }
  .cert-meta-item:nth-last-child(-n + 2) { border-bottom: none; }
  .cm-val { font-size: 15px; }
  .cert-sigs { padding: 24px 20px; }
  .cert-sig-line { width: 120px; }
  .seal-outer { width: 78px; height: 78px; }
  .seal-inner { width: 62px; height: 62px; }
  .cert-sigs { flex-direction: column; align-items: center; gap: 20px; }
  .cert-actions { align-items: stretch; }
  .cert-print-btn { width: 100%; }
  .cert-note { font-size: 12px; padding: 0 6px; }
  .nav-step span { display: none; }
}

@media (max-width: 480px) {
  #content { padding: 16px 10px; }
  .hdr-logo-mark {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }
  .hdr-logo-name { font-size: 12px; }
  .hdr-mod { font-size: 10px; }
  .ns-dot {
    width: 20px;
    height: 20px;
    font-size: 9px;
  }
  .nav-step::after {
    width: 8px;
    margin: 0 2px;
  }
  .prog-right {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  #prog-text { text-align: right; }
  #footer {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }
  .nav-btn {
    padding: 10px 12px;
    font-size: 12px;
  }
  .footer-credit { font-size: 9px; }
  .s-intro {
    padding: 24px 18px;
    border-radius: 16px;
  }
  .intro-title { font-size: 28px; }
  .intro-desc { font-size: 14px; }
  .lesson-body,
  .sc-step,
  .prac-group,
  .quiz-q,
  .rv-item,
  .ai-scorecard,
  .ai-chat-eval,
  .insight-panel-wrap,
  .ai-insight-card,
  .s-cert-prompt {
    padding: 16px;
    border-radius: 12px;
  }
  .rule-row { gap: 12px; }
  .sent-header,
  .acc-head,
  .sc-choice,
  .prac-opt,
  .quiz-opt {
    padding: 12px 14px;
  }
  .ai-overall-card { padding: 16px; }
  .ai-score-circle {
    width: 112px;
    height: 112px;
    flex-basis: 112px;
  }
  .ai-circle-score { font-size: 28px; }
  .ai-overall-band { font-size: 22px; }
  .ai-overall-kicker { font-size: 10px; }
  .res-circle {
    width: 112px;
    height: 112px;
  }
  .rc-num { font-size: 28px; }
  .cert-logo-text { font-size: 15px; }
  .cert-name { font-size: 24px; }
  .cert-module { font-size: 14px; }
  .cert-meta-row { grid-template-columns: 1fr; }
  .cert-meta-item {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .cert-meta-item:nth-last-child(-n + 2) { border-bottom: 1px solid var(--border); }
  .cert-meta-item:last-child { border-bottom: none; }
  .cm-label { font-size: 10px; }
  .cm-val { font-size: 14px; }
}

/* ══ AI PANEL BASE ══ */
.ai-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 28px; margin-top: 24px; }
.ai-loading { display: flex; align-items: center; gap: 14px; padding: 28px; justify-content: center; color: var(--muted); font-size: 14px; }
.ai-spinner { width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.ai-error { background: var(--red-bg); border: 1px solid #fca5a5; border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.ai-error-box { background: var(--red-bg); border: 1px solid #fca5a5; border-radius: var(--r); padding: 20px; margin-top: 16px; }
.ai-error-text { font-size: 14px; color: var(--red); margin: 0 0 12px; }
.ai-error-msg { font-size: 14px; color: var(--red); }
.ai-retry-btn { align-self: flex-start; padding: 8px 18px; background: var(--red); color: white; border: none; border-radius: 7px; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.ai-badge { display: inline-flex; align-items: center; gap: 5px; background: rgba(232,93,38,0.1); border: 1px solid rgba(232,93,38,0.25); color: var(--accent); font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 99px; letter-spacing: 0.04em; }
.ai-badge-small { font-size: 10px; padding: 2px 8px; background: rgba(232,93,38,0.1); border: 1px solid rgba(232,93,38,0.2); color: var(--accent); border-radius: 99px; font-weight: 700; white-space: nowrap; }
.skip-link { display: block; text-align: center; margin-top: 12px; font-size: 13px; color: var(--muted); text-decoration: underline; cursor: pointer; }
.skip-link:hover { color: var(--text); }

/* ══ TONE ANALYSER SCREEN ══ */
.tone-scenario-card { display: flex; gap: 14px; background: var(--surface2); border: 1px solid var(--border); border-left: 4px solid var(--navy); border-radius: var(--r); padding: 18px; margin-bottom: 20px; }
.tone-scenario-icon { font-size: 24px; flex-shrink: 0; }
.tone-scenario-text { font-size: 14px; font-style: italic; color: var(--text); line-height: 1.7; }
.tone-instructions { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.tone-textarea { width: 100%; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: 10px; font-family: inherit; font-size: 14px; color: var(--text); resize: vertical; transition: border-color 0.18s; outline: none; line-height: 1.65; box-sizing: border-box; }
.tone-textarea:focus { border-color: var(--accent); }
.char-counter { font-size: 12px; color: var(--muted); text-align: right; margin-top: 6px; }
.analyse-btn { width: 100%; padding: 14px; background: var(--navy); color: white; border: none; border-radius: 10px; font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer; transition: all 0.2s; margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.analyse-btn:hover:not(:disabled) { background: var(--navy2); transform: translateY(-1px); box-shadow: var(--sh-md); }
.analyse-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.tone-continue-msg { background: var(--green-bg); border: 1px solid #a7f3d0; border-radius: 10px; padding: 14px 18px; font-size: 14px; color: #065f46; font-weight: 600; text-align: center; margin-top: 16px; }

/* ══ TONE SCORECARD ══ */
.ai-scorecard {
  margin-top: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--sh);
}
.sc-overall-wrap, .ai-overall-circle-wrap { display: flex; justify-content: center; margin-bottom: 28px; }
.sc-overall-circle { position: relative; width: 120px; height: 120px; }
.sc-overall-circle svg { width: 100%; height: 100%; }
.ai-overall-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface2);
}
.ai-overall-circle-wrap { margin-bottom: 0; }
.ai-score-circle {
  width: 140px;
  height: 140px;
  flex: 0 0 140px;
}
.soc-bg, .ai-circle-bg { fill: none; stroke: var(--surface2); stroke-width: 10; }
.soc-fill, .ai-circle-fill { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1.2s cubic-bezier(.4,0,.2,1); }
.soc-fill.green, .ai-circle-fill.green { stroke: var(--green); }
.soc-fill.amber, .ai-circle-fill.amber { stroke: #d97706; }
.soc-fill.red, .ai-circle-fill.red { stroke: var(--red); }
.soc-inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.soc-num, .ai-circle-score { font-family: 'Playfair Display', serif; font-size: 34px; color: var(--navy); line-height: 1; }
.soc-lbl, .ai-circle-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }
.ai-overall-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.ai-overall-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.ai-overall-band {
  font-size: 28px;
  line-height: 1.1;
  font-weight: 800;
  color: var(--navy);
}
.ai-overall-copy {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 520px;
}
.scorecard-grid, .ai-bars-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.score-bar-item, .ai-bar-item { display: flex; flex-direction: column; gap: 6px; }
.score-bar-label, .ai-bar-label-row { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--navy); }
.score-bar-val, .ai-bar-score-val { color: var(--muted); }
.score-bar-track { height: 8px; background: var(--surface2); border-radius: 99px; overflow: hidden; border: 1px solid var(--border); }
.score-bar-fill { height: 100%; width: 0%; border-radius: 99px; transition: width 0.8s cubic-bezier(.4,0,.2,1); }
.score-bar-fill.green { background: var(--green); }
.score-bar-fill.amber { background: #d97706; }
.score-bar-fill.red { background: var(--red); }
.tone-badge-wrap, .ai-tone-badge-row { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.ai-tone-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.tone-badge-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.tone-badge-val, .ai-tone-pill { padding: 5px 16px; border-radius: 99px; font-size: 13px; font-weight: 700; }
.tone-badge-val.Excellent, .tone-badge-val.Warm, .ai-badge-green { background: var(--green-bg); color: var(--green); }
.tone-badge-val.Neutral, .ai-badge-blue { background: var(--blue-bg); color: var(--blue); }
.tone-badge-val.Defensive, .ai-badge-amber { background: var(--amber-bg); color: var(--amber); }
.tone-badge-val.Dismissive, .ai-badge-red { background: var(--red-bg); color: var(--red); }
.mti-section, .strength-section, .improvement-section, .ai-mti-section { margin-bottom: 18px; }
.sc-section-title, .ai-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 10px; }
.mti-none, .ai-mti-none { color: var(--green); font-size: 14px; font-weight: 600; }
.mti-pill, .ai-pill-red { display: inline-block; background: var(--red-bg); color: var(--red); border: 1px solid #fca5a5; padding: 3px 12px; border-radius: 99px; font-size: 13px; font-weight: 600; margin: 3px; }
.ai-pill-green { display: inline-block; background: var(--green-bg); color: var(--green); border: 1px solid #a7f3d0; padding: 3px 12px; border-radius: 99px; font-size: 12px; font-weight: 600; margin: 3px; }
.ai-pill-row { display: flex; flex-wrap: wrap; gap: 4px; }
.strength-item, .ai-check-list li { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: #065f46; margin-bottom: 6px; list-style: none; }
.improvement-item, .ai-warn-list li { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: #78350f; margin-bottom: 6px; list-style: none; }
.sc-two-col, .ai-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.sc-col-card { background: var(--surface2); border-radius: 10px; padding: 16px; }
.sc-col-card.green { background: var(--green-bg); border: 1px solid #a7f3d0; }
.sc-col-card.amber { background: var(--amber-bg); border: 1px solid #fde68a; }
.better-version-toggle, .ai-toggle-btn { width: 100%; padding: 12px 18px; background: var(--surface2); border: 1px solid var(--border); border-radius: 9px; font-family: inherit; font-size: 14px; font-weight: 600; color: var(--navy); cursor: pointer; text-align: left; transition: background 0.18s; margin-bottom: 0; }
.better-version-toggle:hover, .ai-toggle-btn:hover { background: var(--border); }
.better-version-panel, .ai-better-panel { display: none; background: #f0fdf4; border: 1px solid #a7f3d0; border-radius: 0 0 9px 9px; padding: 16px 18px; font-size: 14px; color: #065f46; line-height: 1.75; }
.better-version-panel.open { display: block; animation: fadeIn 0.2s ease; }
.lbl-item, .ai-line-item { margin-bottom: 14px; padding: 12px 14px; background: var(--surface2); border-radius: 8px; font-size: 13px; }
.lbl-original, .ai-line-original { color: var(--red); text-decoration: line-through; margin-bottom: 4px; }
.lbl-suggestion, .ai-line-suggestion { color: var(--green); font-weight: 600; margin-bottom: 4px; }
.lbl-issue, .ai-line-issue { color: var(--muted); font-style: italic; font-size: 12px; }

/* ══ EMAIL REWRITER ══ */
.email-card { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; margin-bottom: 20px; font-size: 13px; line-height: 1.75; }
.email-card-header { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.email-field { font-size: 12px; color: var(--muted); }
.email-field strong { color: var(--text); }
.email-body { color: var(--text); white-space: pre-wrap; }
.diff-container, .ai-diff-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.diff-col-header, .ai-diff-badge { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 8px 14px; border-radius: 6px 6px 0 0; display: inline-block; margin-bottom: 8px; }
.diff-col-header.original, .ai-diff-grey { background: var(--surface2); color: var(--muted); }
.diff-col-header.rewritten, .ai-diff-green { background: var(--green-bg); color: var(--green); }
.diff-col-body, .ai-diff-body { padding: 16px; border: 1px solid var(--border); border-radius: var(--r); font-size: 13px; line-height: 1.75; white-space: pre-wrap; min-height: 120px; background: var(--surface); }
.ai-diff-highlight { background: var(--surface2); }
.changes-list, .ai-changes-section { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.change-card, .ai-change-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.change-cat, .ai-cat-badge { display: inline-block; font-size: 10px; font-weight: 800; padding: 2px 9px; border-radius: 99px; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.change-cat.Grammar, .ai-cat-grammar { background: #dbeafe; color: var(--blue); }
.change-cat.MTI, .ai-cat-mti { background: var(--red-bg); color: var(--red); }
.change-cat.Tone, .ai-cat-tone { background: #ede9fe; color: #6d28d9; }
.change-cat.Professionalism, .ai-cat-pro { background: #e0e7ff; color: #3730a3; }
.change-cat.Clarity, .ai-cat-clarity { background: #ccfbf1; color: var(--teal); }
.change-orig, .ai-strike { font-size: 13px; color: var(--red); text-decoration: line-through; margin-bottom: 4px; }
.change-new, .ai-good { font-size: 13px; color: var(--green); font-weight: 600; margin-bottom: 6px; }
.change-reason, .ai-change-reason { font-size: 12px; color: var(--muted); }
.score-comparison, .ai-mini-scores { margin-bottom: 20px; }
.score-comp-item { text-align: center; }
.score-comp-label { font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.score-comp-val { font-size: 18px; font-weight: 800; color: var(--navy); }
.overall-improvement, .ai-overall-improvement { font-size: 15px; font-weight: 700; color: var(--navy); text-align: center; padding: 16px; background: var(--green-bg); border-radius: 10px; border: 1px solid #a7f3d0; margin-top: 16px; }

/* ══ SCENARIO CHAT ══ */
.persona-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.persona-card { border: 1.5px solid var(--border); border-radius: var(--r); padding: 20px 16px; cursor: pointer; transition: all 0.2s; text-align: center; background: var(--surface); }
.persona-card:hover { border-color: var(--navy); background: var(--surface2); transform: translateY(-2px); }
.persona-card.selected { border-color: var(--navy); background: #f0f4ff; box-shadow: var(--sh); }
.persona-num { width: 40px; height: 40px; margin: 0 auto 10px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 17px; font-weight: 800; line-height: 40px; text-align: center; }
.persona-name { font-size: 14px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.persona-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }
.scenario-start-btn { width: 100%; padding: 14px; background: var(--navy); color: white; border: none; border-radius: 10px; font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer; transition: all 0.2s; }
.scenario-start-btn:disabled { opacity: 0.38; cursor: not-allowed; }
.scenario-start-btn:hover:not(:disabled) { background: var(--navy2); }
.ai-chat-wrap { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; margin-top: 16px; }
.chat-header { display: flex; justify-content: flex-end; align-items: center; padding: 12px 16px; background: var(--navy); border-radius: var(--r) var(--r) 0 0; }
.chat-header-title { font-size: 14px; font-weight: 700; color: white; }
.exchange-counter, .chat-counter { font-size: 12px; color: rgba(255,255,255,0.85); font-weight: 600; }
.chat-window { min-height: 300px; max-height: 380px; overflow-y: auto; padding: 16px; background: var(--surface2); display: flex; flex-direction: column; gap: 14px; }
.chat-bubble-wrap { display: flex; flex-direction: column; max-width: 75%; }
.chat-bubble-wrap.customer { align-self: flex-start; }
.chat-bubble-wrap.agent { align-self: flex-end; align-items: flex-end; }
.bubble-label { font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.chat-bubble { padding: 12px 16px; border-radius: 16px; font-size: 14px; line-height: 1.6; max-width: 85%; }
.chat-bubble.customer, .chat-customer { background: white; border: 1px solid var(--border); border-radius: 4px 16px 16px 16px; color: var(--text); align-self: flex-start; margin-bottom: 10px; }
.chat-bubble.agent, .chat-agent { background: var(--navy); color: white; border-radius: 16px 4px 16px 16px; align-self: flex-end; margin-left: auto; margin-bottom: 10px; }
.chat-typing { font-size: 13px; color: var(--muted); font-style: italic; padding: 8px 16px; }
.typing-indicator { display: flex; align-items: center; gap: 5px; padding: 12px 16px; background: white; border: 1px solid var(--border); border-radius: 4px 16px 16px 16px; width: fit-content; }
.typing-dot { width: 8px; height: 8px; background: var(--muted); border-radius: 50%; animation: typingBounce 1.2s ease infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }
.chat-input-row { display: flex; gap: 10px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-top: none; align-items: flex-end; }
.chat-input-row textarea, .chat-textarea { flex: 1; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 9px; font-family: inherit; font-size: 14px; resize: none; outline: none; transition: border-color 0.18s; }
.chat-input-row textarea:focus, .chat-textarea:focus { border-color: var(--accent); }
.chat-send-btn, .btn-primary { padding: 10px 20px; background: var(--accent); color: white; border: none; border-radius: 9px; font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.18s; white-space: nowrap; }
.chat-send-btn:disabled, .btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.chat-complete-banner, .ai-chat-complete-banner { background: var(--green-bg); border: 1px solid #a7f3d0; border-radius: 9px; padding: 14px 18px; text-align: center; font-size: 14px; font-weight: 700; color: #065f46; margin: 12px; }
.chat-eval-wrap, .ai-chat-eval { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 24px; margin-top: 20px; border-top: 4px solid var(--accent); }
.resolved-badge, .ai-resolved-yes, .ai-resolved-no { display: inline-flex; align-items: center; gap: 8px; padding: 8px 20px; border-radius: 99px; font-size: 15px; font-weight: 800; margin-bottom: 20px; width: 100%; justify-content: center; box-sizing: border-box; }
.resolved-badge.yes, .ai-resolved-yes { background: var(--green-bg); color: var(--green); }
.resolved-badge.no, .ai-resolved-no { background: var(--red-bg); color: var(--red); }
.eval-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.eval-item-label, .ai-eval-list { font-size: 13px; margin-bottom: 12px; }
.eval-item-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 8px; }
.b2-moment-pill { display: inline-block; background: var(--green-bg); color: var(--green); border: 1px solid #a7f3d0; padding: 3px 12px; border-radius: 99px; font-size: 12px; font-weight: 600; margin: 3px; }
.grammar-error-pill { display: inline-block; background: var(--red-bg); color: var(--red); border: 1px solid #fca5a5; padding: 3px 12px; border-radius: 99px; font-size: 12px; font-weight: 600; margin: 3px; }
.verdict-text, .ai-chat-verdict { font-family: 'Playfair Display', serif; font-size: 20px; color: var(--navy); text-align: center; padding: 20px; font-style: italic; line-height: 1.5; }
.ai-fallback-msg { font-size: 14px; color: var(--muted); margin-bottom: 16px; }

/* ══ PROGRESS INSIGHT ══ */
.insight-section { margin-top: 32px; border-top: 2px solid var(--border); padding-top: 28px; }
.insight-section-header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.insight-section-icon { font-size: 28px; }
.insight-section-title { font-size: 17px; font-weight: 700; color: var(--navy); }
.insight-section-sub { font-size: 13px; color: var(--muted); }
.insight-panel-wrap, .ai-insight-card { background: linear-gradient(135deg, #f8faff, #f0f4ff); border: 1px solid #c7d2fe; border-radius: var(--r); padding: 28px; margin-top: 12px; }
.b2-status-badge, .ai-b2-badge { display: inline-block; padding: 6px 20px; border-radius: 99px; font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 16px; }
.b2-status-badge.b1-foundation, .ai-b2-red { background: var(--red-bg); color: var(--red); }
.b2-status-badge.b1-plus, .ai-b2-orange { background: var(--amber-bg); color: var(--amber); }
.b2-status-badge.b1-b2-transition, .ai-b2-blue { background: var(--blue-bg); color: var(--blue); }
.b2-status-badge.b2-ready, .ai-b2-green { background: var(--green-bg); color: var(--green); }
.insight-headline, .ai-insight-headline { font-family: 'Playfair Display', serif; font-size: 22px; color: var(--navy); margin-bottom: 20px; line-height: 1.3; }
.insight-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.insight-col, .ai-insight-card-green, .ai-insight-card-amber { border-radius: 10px; padding: 16px; }
.insight-col.strong, .ai-insight-card-green { background: var(--green-bg); border: 1px solid #a7f3d0; }
.insight-col.gap, .ai-insight-card-amber { background: var(--amber-bg); border: 1px solid #fde68a; }
.insight-col-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.insight-col.strong .insight-col-label { color: var(--green); }
.insight-col.gap .insight-col-label { color: var(--amber); }
.insight-col-text { font-size: 14px; font-weight: 600; color: var(--text); }
.personal-tip, .ai-tip-callout { display: flex; gap: 12px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 16px 18px; margin-bottom: 16px; }
.personal-tip-icon, .ai-tip-icon { font-size: 20px; flex-shrink: 0; }
.personal-tip-text { font-size: 14px; color: #78350f; line-height: 1.65; }
.next-focus, .ai-next-focus { display: inline-flex; align-items: center; gap: 8px; background: var(--navy); color: white; padding: 10px 18px; border-radius: 99px; font-size: 13px; font-weight: 700; margin-bottom: 16px; }
.encouragement, .ai-encouragement { font-size: 14px; font-style: italic; color: var(--muted); text-align: center; padding: 12px; }
.insight-fallback { padding: 16px; background: var(--surface2); border-radius: 10px; font-size: 14px; color: var(--muted); line-height: 1.7; text-align: center; }
.b2-status-on-cert { text-align: center; margin-bottom: 20px; font-size: 14px; color: var(--muted); }
.b2-badge-cert { display: inline-block; padding: 4px 14px; border-radius: 99px; font-weight: 800; font-size: 13px; margin-left: 6px; }
.b2-badge-cert.b1-foundation { background: var(--red-bg); color: var(--red); }
.b2-badge-cert.b1-plus { background: var(--amber-bg); color: var(--amber); }
.b2-badge-cert.b2-ready { background: var(--green-bg); color: var(--green); }
.b2-badge-cert.b1-b2-transition { background: var(--blue-bg); color: var(--blue); }
.ai-continue-btn { width: 100%; padding: 14px; background: var(--green); color: white; border: none; border-radius: 10px; font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer; margin-top: 16px; transition: all 0.2s; }
.ai-continue-btn:hover { filter: brightness(1.1); }

/* ══ TONE VOICE INPUT ══ */
.tone-voice-panel { display: flex; flex-direction: column; align-items: center; text-align: center; margin: 20px 0 8px; }
.tone-mic-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 120px; height: 120px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--navy); color: white; box-shadow: var(--sh-md);
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.tone-mic-btn:hover:not(:disabled) { background: var(--navy2); transform: translateY(-2px); }
.tone-mic-btn.listening {
  background: var(--red); animation: toneMicPulse 1.2s ease infinite;
}
.tone-mic-btn.unsupported { background: var(--muted); cursor: not-allowed; opacity: 0.85; }
@keyframes toneMicPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.45); }
  50% { box-shadow: 0 0 0 14px rgba(192, 57, 43, 0); }
}
.tone-mic-icon { font-size: 36px; line-height: 1; margin-bottom: 6px; }
.tone-mic-label { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; max-width: 90px; line-height: 1.3; }
.tone-voice-status { font-size: 13px; color: var(--muted); margin: 14px 0 6px; min-height: 1.4em; max-width: 420px; line-height: 1.5; }
.tone-type-toggle { font-size: 13px; color: var(--accent); text-decoration: underline; cursor: pointer; font-weight: 600; }
.tone-type-toggle:hover { color: var(--navy); }
.tone-capture-hint {
  font-size: 14px; font-weight: 600; color: var(--green); background: var(--green-bg);
  border: 1px solid #a7f3d0; border-radius: 10px; padding: 12px 16px; margin: 12px auto 4px;
  max-width: 420px;
}
.tone-transcript-wrap { margin-top: 8px; }
.tone-transcript-label {
  display: block; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted); margin-bottom: 8px;
}
.voice-lab-link {
  display: block; width: 100%; margin-top: 12px; background: none;
  border: 1px solid var(--border); padding: 10px 16px; border-radius: 8px;
  font-family: inherit; font-size: 13px; color: var(--muted); cursor: pointer;
  transition: border-color 0.18s, color 0.18s;
}
.voice-lab-link:hover { border-color: var(--navy); color: var(--navy); }

@media (max-width: 720px) {
  .persona-grid, .ai-diff-cols, .diff-container, .ai-two-col, .insight-two-col, .score-comparison { grid-template-columns: 1fr; }
  .tone-mic-btn { width: 100px; height: 100px; }
  .tone-mic-icon { font-size: 30px; }
  .ai-overall-card { grid-template-columns: 1fr; gap: 18px; text-align: center; }
  .ai-overall-summary { align-items: center; }
  .ai-overall-copy { max-width: none; }
  .ai-bars-grid { grid-template-columns: 1fr; }
  .diff-container, .ai-diff-cols { gap: 14px; }
  .ai-diff-body { min-height: 0; }
  .chat-eval-wrap, .ai-chat-eval { padding: 18px; }
  .eval-grid { grid-template-columns: 1fr; }
  .insight-headline, .ai-insight-headline { font-size: 20px; }
}
