/* ===== Knotty Pines BBP Training — Design tokens ===== */
:root {
  /* Brand */
  --terracotta: #B1775A;
  --terracotta-dark: #8E5C44;
  --terracotta-light: #D9A98E;
  --pine: #6B7152;
  --pine-dark: #4F5440;
  --pine-light: #969C7D;
  --cream: #F7E6D8;
  --cream-deep: #EFD6BF;
  --silver: #F7F6F4;
  --white: #ffffff;

  /* Surfaces (light) */
  --bg: #FBF8F4;
  --surface: #ffffff;
  --surface-2: var(--silver);
  --surface-3: var(--cream);
  --ink: #2B2723;
  --ink-2: #5C544C;
  --ink-3: #8C8278;
  --line: #E7E1D8;
  --line-strong: #D6CDBE;

  /* Status */
  --ok: #4A7A4F;
  --ok-bg: #E4ECE2;
  --warn: #B17A2E;
  --warn-bg: #F5E8D2;
  --err: #A14637;
  --err-bg: #F3DDD3;

  /* Type */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-base: 16px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-2xl: 28px;
  --fs-3xl: 36px;
  --fs-4xl: 48px;

  /* Layout */
  --sidebar-w: 304px;
  --header-h: 64px;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-1: 0 1px 2px rgba(43, 39, 35, 0.06), 0 2px 8px rgba(43, 39, 35, 0.04);
  --shadow-2: 0 4px 14px rgba(43, 39, 35, 0.08), 0 10px 30px rgba(43, 39, 35, 0.06);
  --shadow-focus: 0 0 0 3px rgba(177, 119, 90, 0.35);

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --motion-fast: 160ms;
  --motion: 280ms;
  --motion-slow: 500ms;
}

[data-theme="dark"] {
  --bg: #1B1A17;
  --surface: #25231F;
  --surface-2: #2D2A26;
  --surface-3: #34302B;
  --ink: #F1ECE3;
  --ink-2: #BFB6A8;
  --ink-3: #8C8278;
  --line: #3A3631;
  --line-strong: #4A453E;
  --cream: #34302B;
  --cream-deep: #3F3934;
  --silver: #2D2A26;
  --terracotta-light: #C68E70;
  --ok-bg: #2D3A2C;
  --warn-bg: #3F3320;
  --err-bg: #3F2A24;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
  --shadow-2: 0 4px 14px rgba(0,0,0,0.5), 0 10px 30px rgba(0,0,0,0.4);
}

[data-reduce-motion="true"] *, [data-reduce-motion="true"] *::before, [data-reduce-motion="true"] *::after {
  animation-duration: 0.001ms !important;
  animation-delay: 0ms !important;
  transition-duration: 0.001ms !important;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: var(--fs-base);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; padding: 0; }
img { max-width: 100%; display: block; }
:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: 6px; }

/* ============ App layout ============ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  transition: grid-template-columns var(--motion) var(--ease);
}
.app[data-sidebar="closed"] { grid-template-columns: 64px 1fr; }

/* ============ Sidebar ============ */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: hidden;
}
.sidebar-head {
  padding: 18px 20px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  min-height: var(--header-h);
}
.sidebar-logo {
  height: 36px;
  width: auto;
}
[data-theme="dark"] .sidebar-logo.light-only { display: none; }
.sidebar-logo.dark-only { display: none; }
[data-theme="dark"] .sidebar-logo.dark-only { display: block; }

.sidebar-toggle {
  margin-left: auto;
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  color: var(--ink-2);
  transition: background var(--motion-fast) var(--ease);
}
.sidebar-toggle:hover { background: var(--surface-2); color: var(--ink); }

.sidebar-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 18px 24px 8px;
}

.screen-map {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 16px;
}
.screen-map-item {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  width: 100%;
  text-align: left;
  color: var(--ink-2);
  font-size: var(--fs-sm);
  transition: background var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease);
  position: relative;
}
.screen-map-item:hover { background: var(--surface-2); color: var(--ink); }
.screen-map-item[data-active="true"] {
  background: var(--cream);
  color: var(--ink);
  font-weight: 600;
}
[data-theme="dark"] .screen-map-item[data-active="true"] { background: var(--surface-3); }
.screen-map-item[data-active="true"]::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px; bottom: 8px;
  width: 3px;
  background: var(--terracotta);
  border-radius: 2px;
}
.screen-map-num {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  background: var(--surface-2);
  border-radius: 6px;
  padding: 3px 6px;
  text-align: center;
  min-width: 26px;
}
.screen-map-item[data-active="true"] .screen-map-num,
.screen-map-item[data-completed="true"] .screen-map-num {
  background: var(--pine);
  color: white;
}
.screen-map-item[data-completed="true"]:not([data-active="true"]) { color: var(--ink); }
.screen-map-item .check {
  color: var(--pine);
  opacity: 0;
  transition: opacity var(--motion-fast) var(--ease);
}
.screen-map-item[data-completed="true"] .check { opacity: 1; }

.module-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 14px 22px 6px;
  display: flex; align-items: center; gap: 8px;
}
.module-label::before {
  content: '';
  height: 1px;
  flex: 1;
  background: var(--line);
}
.module-label::after {
  content: '';
  height: 1px;
  flex: 1;
  background: var(--line);
}

.sidebar-foot {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: background var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease);
}
.sidebar-btn:hover { background: var(--surface-2); color: var(--ink); }
.sidebar-btn .ic { width: 18px; height: 18px; display: grid; place-items: center; }

/* Collapsed sidebar */
.app[data-sidebar="closed"] .sidebar-logo,
.app[data-sidebar="closed"] .screen-map,
.app[data-sidebar="closed"] .sidebar-section-label,
.app[data-sidebar="closed"] .module-label,
.app[data-sidebar="closed"] .sidebar-btn span:not(.ic) { display: none; }
.app[data-sidebar="closed"] .sidebar-btn { justify-content: center; padding: 9px; }
.app[data-sidebar="closed"] .sidebar-head { padding: 18px 14px; justify-content: center; }
.app[data-sidebar="closed"] .sidebar-foot { padding: 14px 8px; }

/* ============ Main area ============ */
.main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}

.topbar {
  height: var(--header-h);
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-context {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink-2); font-size: var(--fs-sm);
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
}
.topbar-context > span:not(.pill) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-context .pill {
  background: var(--cream);
  color: var(--ink);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
}
[data-theme="dark"] .topbar-context .pill { background: var(--surface-3); }

.progress-wrap {
  flex: 1 1 200px;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 460px;
  min-width: 160px;
}
.progress-wrap[data-hidden="true"] { visibility: hidden; }
.progress-track {
  flex: 1 1 0;
  min-width: 0;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pine), var(--pine-light));
  border-radius: 999px;
  transition: width var(--motion) var(--ease);
}
.progress-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  min-width: 60px;
  text-align: right;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  color: var(--ink-2);
  transition: background var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease);
  position: relative;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn[data-on="true"] { color: var(--pine); background: var(--ok-bg); }

.learner-chip {
  margin-left: 12px;
  display: flex; align-items: center; gap: 10px;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  background: var(--surface-2);
}
.learner-chip .avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--pine);
  color: white;
  display: grid; place-items: center;
  font-weight: 700; font-size: 12px;
}
.learner-chip span { font-size: 13px; color: var(--ink); font-weight: 500; }

/* ============ Screen container ============ */
.screen {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 32px 28px 48px;
}
.screen-inner {
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: screen-in var(--motion) var(--ease);
}
@keyframes screen-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.screen-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.screen-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--terracotta);
}
.screen-eyebrow img { height: 18px; width: auto; }
.screen-title {
  font-size: var(--fs-3xl);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}
.screen-sub {
  color: var(--ink-2);
  font-size: var(--fs-lg);
  max-width: 720px;
  margin: 0;
}

/* ============ Cards ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.card.padless { padding: 0; overflow: hidden; }
.card-head-stripe {
  background: var(--pine);
  color: white;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex; align-items: center; gap: 8px;
}
.card-head-stripe.terracotta { background: var(--terracotta); }

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: var(--fs-base);
  transition: all var(--motion-fast) var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--terracotta);
  color: white;
  box-shadow: 0 1px 2px rgba(177, 119, 90, 0.4);
}
.btn-primary:hover { background: var(--terracotta-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(177, 119, 90, 0.3); }
.btn-primary:disabled { background: var(--line-strong); color: var(--ink-3); cursor: not-allowed; box-shadow: none; transform: none; }

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
}
.btn-secondary:hover { background: var(--surface-2); }

.btn-ghost { color: var(--ink-2); padding: 12px 16px; }
.btn-ghost:hover { color: var(--ink); background: var(--surface-2); }

.btn-pine {
  background: var(--pine);
  color: white;
}
.btn-pine:hover { background: var(--pine-dark); }

/* ============ Nav row ============ */
.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.nav-row .meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-3);
  font-size: var(--fs-sm);
}

/* ============ Settings panel ============ */
.settings-panel {
  position: fixed;
  top: 64px;
  right: 16px;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  z-index: 50;
  overflow: hidden;
  animation: panel-in var(--motion-fast) var(--ease);
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
.settings-panel h3 {
  margin: 0;
  padding: 16px 18px 12px;
  font-size: var(--fs-base);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row .label {
  font-size: var(--fs-sm);
  font-weight: 500;
}
.settings-row .desc {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}

/* Toggle switch */
.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background var(--motion-fast) var(--ease);
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  transition: transform var(--motion-fast) var(--ease);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle[data-on="true"] { background: var(--pine); }
.toggle[data-on="true"]::after { transform: translateX(18px); }

/* ============ Captions bar ============ */
.captions {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 760px;
  width: calc(100% - 80px);
  background: rgba(43, 39, 35, 0.92);
  color: white;
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 17px;
  line-height: 1.4;
  text-align: center;
  z-index: 40;
  animation: cap-in var(--motion-fast) var(--ease);
  backdrop-filter: blur(8px);
}
@keyframes cap-in {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ============ Modal ============ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(43, 39, 35, 0.5);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fade-in var(--motion-fast) var(--ease);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 460px;
  width: 100%;
  padding: 28px;
  box-shadow: var(--shadow-2);
  animation: modal-in var(--motion) var(--ease);
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: none; }
}
.modal h3 { margin: 0 0 12px; font-size: var(--fs-xl); font-weight: 700; }
.modal p { color: var(--ink-2); margin: 0 0 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ============ Screen 1 Title ============ */
.title-hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 0;
  background: var(--cream);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  position: relative;
  min-height: 480px;
}
[data-theme="dark"] .title-hero { background: var(--surface-2); }
.title-hero::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 8px;
  background: var(--pine);
}
.title-hero-text { padding: 56px 48px 48px 56px; display: flex; flex-direction: column; justify-content: center; }
.title-hero-img { background: var(--pine); position: relative; min-height: 320px; }
.title-hero-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.objectives-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.objectives-list li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: flex-start;
  font-size: var(--fs-lg);
  color: var(--ink);
  line-height: 1.4;
}
.objectives-list .pine-bullet {
  width: 20px;
  height: 24px;
  background: url('assets/pine-icons.png') no-repeat;
  background-size: 300% 100%;
  background-position: 0% 50%;
  flex-shrink: 0;
}

/* ============ Screen 2 cards ============ */
.intro-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.intro-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--motion-slow) var(--ease), transform var(--motion-slow) var(--ease);
}
.intro-card[data-visible="true"] { opacity: 1; transform: none; }
.intro-card .stripe { background: var(--pine); height: 6px; }
.intro-card .body { padding: 24px; }
.intro-card .num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--pine);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.intro-card .icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--cream);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  color: var(--pine);
}
[data-theme="dark"] .intro-card .icon { background: var(--surface-3); }
.intro-card h3 { margin: 0 0 8px; font-size: var(--fs-lg); font-weight: 600; }
.intro-card p { margin: 0; color: var(--ink-2); }

/* ============ Screen 3 transmission ============ */
.transmission-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
}
.transmission-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.transmission-center {
  width: 200px; height: 200px;
  border-radius: 50%;
  background: var(--pine);
  color: white;
  display: grid; place-items: center;
  text-align: center;
  padding: 20px;
  position: relative;
}
.transmission-center .label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
}
.transmission-center .title { font-size: 18px; font-weight: 700; margin-top: 4px; }
.transmission-routes {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.route-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}
.route-card[data-open="true"] { border-color: var(--pine-light); }
.route-card .header {
  display: grid;
  grid-template-columns: 50px 1fr 28px;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  width: 100%;
  text-align: left;
}
.route-card .header:hover { background: var(--surface-2); }
.route-card .num-circle {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--pine);
  display: grid; place-items: center;
  font-weight: 700;
}
.route-card[data-open="true"] .num-circle { background: var(--pine); color: white; }
.route-card h4 { margin: 0; font-size: 17px; font-weight: 600; }
.route-card .body {
  padding: 0 20px 0 84px;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--motion) var(--ease), padding var(--motion) var(--ease);
}
.route-card[data-open="true"] .body {
  max-height: 280px;
  padding: 0 20px 20px 84px;
}
.route-card .body p { margin: 0 0 8px; color: var(--ink-2); }
.route-card .example {
  background: var(--cream);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 14px;
  color: var(--ink);
}
[data-theme="dark"] .route-card .example { background: var(--surface-3); }
.route-card .example strong { color: var(--terracotta); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; display: block; margin-bottom: 2px; }

.chevron {
  transition: transform var(--motion-fast) var(--ease);
  color: var(--ink-3);
}
.route-card[data-open="true"] .chevron { transform: rotate(180deg); }

/* ============ Screen 4 scenario setup ============ */
.scenario-frame {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.scenario-img { background: var(--surface-2); position: relative; min-height: 340px; }
.scenario-img img { width: 100%; height: 100%; object-fit: cover; }
.scenario-text { padding: 36px 36px 32px; display: flex; flex-direction: column; gap: 16px; }
.scenario-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--terracotta);
  color: white;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  align-self: flex-start;
}
.scenario-text h2 {
  margin: 0;
  font-size: var(--fs-2xl);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.scenario-text p { margin: 0; color: var(--ink-2); font-size: var(--fs-lg); }
.scenario-callout {
  background: var(--cream);
  border-left: 3px solid var(--terracotta);
  padding: 14px 16px;
  border-radius: 8px;
  font-size: var(--fs-sm);
}
[data-theme="dark"] .scenario-callout { background: var(--surface-3); }

/* ============ Screen 5 PPE selection ============ */
.ppe-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  align-items: start;
}
.ppe-image-stack {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/9;
}
.ppe-image-stack img { width: 100%; height: 100%; object-fit: cover; transition: opacity var(--motion-slow) var(--ease); }
.ppe-image-stack .img-layer { position: absolute; inset: 0; opacity: 0; transition: opacity var(--motion-slow) var(--ease); }
.ppe-image-stack .img-layer[data-active="true"] { opacity: 1; }
.ppe-stack-caption {
  position: absolute;
  bottom: 12px; left: 12px; right: 12px;
  background: rgba(43, 39, 35, 0.78);
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(6px);
}

.ppe-checklist {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.ppe-checklist-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ppe-checklist-head h3 { margin: 0; font-size: var(--fs-base); font-weight: 600; }
.ppe-checklist-head .counter {
  font-size: 13px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.ppe-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  width: 100%;
  text-align: left;
  transition: background var(--motion-fast) var(--ease);
}
.ppe-item:last-child { border-bottom: none; }
.ppe-item:hover { background: var(--surface-2); }
.ppe-item[data-selected="true"] { background: var(--ok-bg); }
.ppe-item[data-missing="true"] { background: var(--err-bg); animation: shake 0.5s; }
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-3px); }
  40%, 60% { transform: translateX(3px); }
}
.ppe-checkbox {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 2px solid var(--line-strong);
  display: grid; place-items: center;
  transition: all var(--motion-fast) var(--ease);
}
.ppe-item[data-selected="true"] .ppe-checkbox {
  background: var(--pine);
  border-color: var(--pine);
  color: white;
}
.ppe-item .label-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ppe-item .label-text strong { font-size: var(--fs-base); font-weight: 600; }
.ppe-item .label-text .hint { font-size: 12px; color: var(--ink-3); }
.ppe-item .kbd-hint {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--ink-2);
  padding: 3px 7px;
  border-radius: 5px;
  border: 1px solid var(--line);
}
.ppe-item[data-selected="true"] .kbd-hint { background: var(--surface); }

.kb-banner {
  background: var(--cream);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
[data-theme="dark"] .kb-banner { background: var(--surface-3); }
.kb-banner .kb-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--pine);
  color: white;
  display: grid; place-items: center;
  flex-shrink: 0;
}

.feedback-banner {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 12px;
  align-items: flex-start;
}
.feedback-banner.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn); }
.feedback-banner.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok); }
.feedback-banner .icon { flex-shrink: 0; margin-top: 2px; }
.feedback-banner .content strong { display: block; font-size: var(--fs-base); margin-bottom: 2px; }
.feedback-banner .content p { margin: 0; color: var(--ink); font-size: var(--fs-sm); }

/* ============ Screen 6 PPE feedback ============ */
.ppe-feedback-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.ppe-result-img {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 16/9;
  position: relative;
  background: var(--surface);
}
.ppe-result-img img { width: 100%; height: 100%; object-fit: cover; }
.ppe-result-img .checkmark {
  position: absolute;
  top: 14px; right: 14px;
  background: var(--ok);
  color: white;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(74, 122, 79, 0.4);
}
.ppe-fb-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ppe-fb-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: flex-start;
}
.ppe-fb-card .check {
  width: 24px; height: 24px;
  background: var(--ok);
  color: white;
  border-radius: 50%;
  display: grid; place-items: center;
  margin-top: 2px;
}
.ppe-fb-card h4 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.ppe-fb-card p { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.osha-banner {
  margin-top: 20px;
  background: var(--pine);
  color: white;
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex;
  gap: 16px;
  align-items: center;
}
.osha-banner .osha-tag {
  background: rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.osha-banner p { margin: 0; font-size: var(--fs-sm); flex: 1; }

/* ============ Screen 7 room scan ============ */
.room-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
}
.room-scene {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  aspect-ratio: 16/9;
}
.room-scene img { width: 100%; height: 100%; object-fit: cover; display: block; }
.risk-hotspot {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid var(--terracotta);
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: all var(--motion-fast) var(--ease);
  z-index: 2;
}
.risk-hotspot::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--terracotta);
  opacity: 0.5;
  animation: pulse 1.6s infinite;
}
[data-reduce-motion="true"] .risk-hotspot::before { animation: none; opacity: 0.7; }
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.4); opacity: 0; }
}
.risk-hotspot[data-found="true"] {
  background: var(--terracotta);
  border-color: var(--terracotta-dark);
}
.risk-hotspot[data-found="true"]::before { display: none; }
.risk-hotspot:hover { transform: translate(-50%, -50%) scale(1.1); }
.risk-hotspot .num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--terracotta-dark);
  font-size: 16px;
}
.risk-hotspot[data-found="true"] .num { color: white; }

.room-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.room-counter {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.room-counter .big {
  font-size: 40px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--terracotta);
  letter-spacing: -0.02em;
}
.room-counter .big .small { color: var(--ink-3); font-size: 22px; font-weight: 500; }
.room-counter p { margin: 4px 0 0; color: var(--ink-2); font-size: var(--fs-sm); }

.kb-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.kb-list-head {
  padding: 12px 16px;
  background: var(--cream);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px;
}
[data-theme="dark"] .kb-list-head { background: var(--surface-3); }
.kb-list-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  padding: 11px 16px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  width: 100%;
  text-align: left;
  transition: background var(--motion-fast) var(--ease);
  font-size: 13px;
  line-height: 1.4;
}
.kb-list-item:last-child { border-bottom: none; }
.kb-list-item:hover { background: var(--surface-2); }
.kb-list-item[data-found="true"] { color: var(--ink); }
.kb-list-item[data-found="false"] { color: var(--ink-2); }
.kb-list-item .kb-checkbox {
  width: 20px; height: 20px;
  border: 2px solid var(--line-strong);
  border-radius: 5px;
  display: grid; place-items: center;
  margin-top: 1px;
  flex-shrink: 0;
}
.kb-list-item[data-found="true"] .kb-checkbox {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: white;
}

/* ============ Screen 8 room feedback ============ */
.room-fb-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fb-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.fb-card .header {
  width: 100%;
  display: grid;
  grid-template-columns: 36px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  text-align: left;
}
.fb-card .header:hover { background: var(--surface-2); }
.fb-card .num-badge {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--terracotta);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 13px;
}
.fb-card[data-found="true"] .num-badge {
  background: var(--pine);
  color: white;
}
.fb-card .header h4 { margin: 0; font-size: 15px; font-weight: 600; }
.fb-card .found-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--pine);
  background: var(--ok-bg);
  padding: 3px 8px;
  border-radius: 999px;
}
.fb-card .body {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--motion) var(--ease), padding var(--motion) var(--ease);
}
.fb-card[data-open="true"] .body {
  padding: 0 16px 16px 64px;
  max-height: 200px;
}
.fb-card .body p { margin: 0; color: var(--ink-2); font-size: 14px; }

/* ============ Screen 9 handwashing list ============ */
.hw-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.hw-list-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 28px 28px;
  text-align: center;
  position: relative;
  transition: border-color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}
.hw-list-row.is-highlight {
  background: var(--cream);
  border-color: var(--terracotta-light);
}
[data-theme="dark"] .hw-list-row.is-highlight { background: var(--surface-3); border-color: var(--terracotta); }
.hw-list-num {
  position: absolute;
  top: 20px;
  left: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--pine);
  color: white;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.hw-list-row.is-highlight .hw-list-num { background: var(--terracotta); }
.hw-list-img {
  width: 280px;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin-bottom: 18px;
}
.hw-list-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hw-list-text {
  max-width: 520px;
}
.hw-list-text h3 {
  margin: 0 0 8px;
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.hw-list-text p {
  margin: 0;
  color: var(--ink-2);
  font-size: var(--fs-base);
  line-height: 1.55;
  text-wrap: pretty;
}
.hw-list-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  background: var(--terracotta);
  color: white;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
}
.hw-list-pill strong { font-weight: 700; }
.hw-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.hw-image {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/5;
  position: relative;
  max-height: 520px;
  width: 100%;
  margin: 0 auto;
}
.hw-image img {
  width: 100%; height: 100%; object-fit: cover;
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity var(--motion-slow) var(--ease);
}
.hw-image img[data-active="true"] { opacity: 1; }
.hw-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.hw-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hw-step {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  width: 100%;
  text-align: left;
  transition: all var(--motion-fast) var(--ease);
}
.hw-step[data-active="true"] {
  border-color: var(--terracotta);
  background: var(--cream);
}
[data-theme="dark"] .hw-step[data-active="true"] { background: var(--surface-3); }
.hw-step[data-complete="true"] {
  background: var(--ok-bg);
  border-color: var(--ok);
  opacity: 0.85;
}
.hw-step-num {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-2);
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
}
.hw-step[data-active="true"] .hw-step-num { background: var(--terracotta); color: white; }
.hw-step[data-complete="true"] .hw-step-num { background: var(--ok); color: white; }
.hw-step h4 { margin: 0 0 2px; font-size: 14px; font-weight: 600; }
.hw-step p { margin: 0; font-size: 12px; color: var(--ink-2); }
.hw-step .arrow { color: var(--ink-3); }
.hw-step[data-active="true"] .arrow { color: var(--terracotta); }

.scrub-timer {
  background: var(--surface);
  border: 2px solid var(--terracotta);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.scrub-timer .ring-wrap {
  width: 120px; height: 120px;
  margin: 0 auto 14px;
  position: relative;
}
.scrub-timer .ring-time {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  font-size: 28px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--terracotta);
}
.scrub-timer p { margin: 8px 0 14px; color: var(--ink-2); font-size: 14px; }
.scrub-hold-btn {
  background: var(--terracotta);
  color: white;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 600;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.scrub-hold-btn[data-active="true"] {
  background: var(--terracotta-dark);
  box-shadow: 0 0 0 4px rgba(177, 119, 90, 0.25);
}

/* ============ Screen 10 hand zones ============ */
.hand-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}
.hand-canvas {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/9;
}
.hand-canvas img { width: 100%; height: 100%; object-fit: cover; }
.zone {
  position: absolute;
  border-radius: 50%;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: all var(--motion-fast) var(--ease);
  background: rgba(243, 178, 100, 0.0);
  border: 2px dashed transparent;
}
.zone:hover { background: rgba(243, 178, 100, 0.35); border-color: rgba(243, 178, 100, 0.8); }
.zone[data-selected="true"] {
  background: rgba(243, 178, 100, 0.55);
  border: 2px solid #E0A050;
}
.zone[data-reveal="true"] {
  background: rgba(177, 119, 90, 0.6);
  border: 2px solid var(--terracotta-dark);
  animation: zone-reveal 0.6s var(--ease);
}
@keyframes zone-reveal {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
.zone .zone-label {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(43, 39, 35, 0.92);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--motion-fast) var(--ease);
  pointer-events: none;
}
.zone[data-reveal="true"] .zone-label { opacity: 1; }

/* ============ Screen 11 branching ============ */
.branch-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.branch-prompt {
  background: var(--cream);
  border-left: 4px solid var(--terracotta);
  padding: 22px 26px;
  border-radius: 10px;
  font-size: var(--fs-lg);
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: 26px;
}
[data-theme="dark"] .branch-prompt { background: var(--surface-3); }
.branch-question { font-size: var(--fs-xl); font-weight: 700; margin: 0 0 18px; }
.branch-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.branch-opt {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 22px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  width: 100%;
  text-align: left;
  transition: all var(--motion-fast) var(--ease);
  font-size: var(--fs-base);
  line-height: 1.5;
}
.branch-opt:hover {
  border-color: var(--terracotta);
  background: var(--cream);
  transform: translateY(-1px);
}
[data-theme="dark"] .branch-opt:hover { background: var(--surface-3); }
.branch-opt[data-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.branch-opt-letter {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 13px;
}
.branch-consequence {
  background: var(--err-bg);
  border: 1px solid var(--err);
  border-radius: 12px;
  padding: 22px 24px;
  margin-top: 18px;
  animation: screen-in var(--motion) var(--ease);
}
.branch-consequence .label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--err);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.branch-consequence h4 { margin: 0 0 8px; font-size: var(--fs-lg); }
.branch-consequence p { margin: 0 0 16px; color: var(--ink); }

.branch-correct {
  background: var(--ok-bg);
  border: 1px solid var(--ok);
}
.branch-correct .label { color: var(--ok); }

/* ============ Screen 12 reporting steps ============ */
.steps-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.step-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 18px;
  align-items: stretch;
  background: var(--pine);
  color: white;
  border-radius: 12px;
  padding: 20px 24px;
}
.step-row .step-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 16px;
}
.step-row h4 { margin: 0 0 4px; font-size: var(--fs-base); font-weight: 600; }
.step-row p { margin: 0; font-size: 13px; opacity: 0.88; }

/* ============ Screen 13 KC ============ */
.kc-frame {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px;
}
.kc-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}
.kc-progress .dot {
  height: 6px;
  flex: 1;
  border-radius: 999px;
  background: var(--surface-2);
}
.kc-progress .dot[data-state="active"] { background: var(--terracotta); }
.kc-progress .dot[data-state="correct"] { background: var(--ok); }
.kc-progress .dot[data-state="wrong"] { background: var(--err); }
.kc-q {
  font-size: var(--fs-xl);
  font-weight: 600;
  margin: 0 0 20px;
  line-height: 1.35;
}
.kc-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kc-opt {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  width: 100%;
  text-align: left;
  transition: all var(--motion-fast) var(--ease);
  font-size: var(--fs-base);
}
.kc-opt:hover:not(:disabled) {
  border-color: var(--terracotta-light);
  background: var(--cream);
}
[data-theme="dark"] .kc-opt:hover:not(:disabled) { background: var(--surface-3); }
.kc-opt[data-state="selected"] {
  border-color: var(--terracotta);
  background: var(--cream);
}
[data-theme="dark"] .kc-opt[data-state="selected"] { background: var(--surface-3); }
.kc-opt[data-state="correct"] {
  border-color: var(--ok);
  background: var(--ok-bg);
  color: var(--ok);
}
.kc-opt[data-state="wrong"] {
  border-color: var(--err);
  background: var(--err-bg);
  color: var(--err);
}
.kc-opt[data-state="correct"] .kc-opt-letter,
.kc-opt[data-state="wrong"] .kc-opt-letter { background: currentColor; color: white; }
.kc-opt-letter {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--surface-2);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 13px;
}

/* Sequence question */
.seq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.seq-item {
  display: grid;
  grid-template-columns: 32px 32px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  cursor: move;
}
.seq-item .pos {
  font-weight: 700;
  color: var(--terracotta);
  font-variant-numeric: tabular-nums;
}
.seq-item .grip { color: var(--ink-3); }
.seq-item .seq-text { font-size: var(--fs-sm); }
.seq-item .seq-btns { display: flex; gap: 4px; }
.seq-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-2);
  display: grid; place-items: center;
}
.seq-btn:hover:not(:disabled) { background: var(--cream); color: var(--ink); }
.seq-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.kc-feedback {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px solid;
  animation: screen-in var(--motion) var(--ease);
}
.kc-feedback.ok { background: var(--ok-bg); border-color: var(--ok); color: var(--ink); }
.kc-feedback.err { background: var(--err-bg); border-color: var(--err); color: var(--ink); }
.kc-feedback strong { display: block; margin-bottom: 6px; font-size: var(--fs-base); }
.kc-feedback p { margin: 0; font-size: var(--fs-sm); }
.kc-feedback .review-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--terracotta);
  text-decoration: underline;
}

.kc-result {
  text-align: center;
  padding: 32px;
}
.kc-result .score-ring {
  width: 140px; height: 140px;
  margin: 0 auto 20px;
  position: relative;
}
.kc-result .score-ring .num {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  font-size: 36px;
  font-weight: 700;
  color: var(--pine);
}
.kc-result h2 { font-size: var(--fs-2xl); margin: 0 0 8px; }
.kc-result p { color: var(--ink-2); margin: 0 0 20px; }

/* ============ Screen 14 cert ============ */
.cert-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.cert-banner {
  background: var(--pine);
  color: white;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.cert-banner .pine-icon {
  width: 44px; height: 56px;
  background: url('assets/pine-icons.png') no-repeat;
  background-size: 300% 100%;
  background-position: 100% 50%;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
}
.cert-banner h2 { margin: 0; font-size: var(--fs-2xl); }
.cert-banner p { margin: 4px 0 0; opacity: 0.85; font-size: var(--fs-sm); }
.cert-body { padding: 40px 48px 32px; }
.cert-body h3 { font-size: 28px; margin: 0 0 12px; }
.cert-body > p { color: var(--ink-2); margin: 0 0 24px; font-size: var(--fs-lg); }
.cert-ack {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  margin: 24px 0;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 14px;
  align-items: flex-start;
}
[data-theme="dark"] .cert-ack { background: var(--surface-3); }
.cert-ack-check {
  width: 24px; height: 24px;
  border: 2px solid var(--line-strong);
  border-radius: 6px;
  margin-top: 2px;
  display: grid; place-items: center;
  background: var(--surface);
}
.cert-ack[data-checked="true"] .cert-ack-check {
  background: var(--pine);
  border-color: var(--pine);
  color: white;
}
.cert-ack p { margin: 0; font-size: var(--fs-sm); }

.cert-stage {
  background: linear-gradient(135deg, var(--cream) 0%, var(--silver) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  padding: 56px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
[data-theme="dark"] .cert-stage { background: linear-gradient(135deg, var(--surface-3) 0%, var(--surface-2) 100%); }
.cert-stage::before, .cert-stage::after {
  content: '';
  position: absolute;
  width: 80px; height: 100px;
  background: url('assets/pine-icons.png') no-repeat;
  background-size: 300% 100%;
  opacity: 0.5;
}
.cert-stage::before { top: 30px; left: 40px; background-position: 0% 50%; transform: rotate(-12deg); }
.cert-stage::after { bottom: 30px; right: 40px; background-position: 50% 50%; transform: rotate(12deg); }
.cert-stage img.cert-logo { height: 80px; margin: 0 auto 16px; }
.cert-stage .cert-label {
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  font-weight: 700; color: var(--terracotta); margin-bottom: 6px;
}
.cert-stage h2 {
  font-size: 36px; margin: 0 0 8px;
  font-weight: 700; letter-spacing: -0.01em;
}
.cert-stage .for { color: var(--ink-2); margin: 16px 0 4px; font-size: var(--fs-sm); letter-spacing: 0.05em; }
.cert-stage .name { font-size: 32px; font-weight: 700; color: var(--ink); margin: 0; font-family: 'Inter', sans-serif; }
.cert-stage .compliance { margin-top: 18px; font-size: 13px; color: var(--ink-2); }
.cert-stage .date-row {
  display: flex;
  justify-content: center;
  gap: 36px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.cert-stage .date-row .col .lbl { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.cert-stage .date-row .col .val { font-weight: 600; margin-top: 2px; color: var(--ink); }

/* ============ Misc ============ */
.divider {
  height: 1px;
  background: var(--line);
  margin: 16px 0;
}

/* Print */
@media print {
  body { background: white; }
  .sidebar, .topbar, .captions, .nav-row { display: none !important; }
  .app { grid-template-columns: 1fr !important; }
  .cert-stage { box-shadow: none; border: 2px solid var(--terracotta); page-break-inside: avoid; }
  .screen-inner > *:not(.cert-stage):not(.screen-head) { display: none !important; }
}

/* Responsive */
@media (max-width: 1100px) {
  .ppe-layout, .room-layout, .hw-layout, .scenario-frame, .title-hero, .ppe-feedback-grid, .hand-layout { grid-template-columns: 1fr; }
  .transmission-grid { grid-template-columns: 1fr; }
  .transmission-diagram { flex-direction: row; justify-content: center; }
  .intro-cards { grid-template-columns: 1fr; }
  /* Aspect-ratio + absolute-children elements need explicit width when their grid cell isn't sized */
  .hw-image, .title-hero-img, .ppe-image-stack, .ppe-result-img, .hand-canvas, .room-scene, .scenario-img { width: 100%; }
}
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr !important; }
  .sidebar { position: fixed; left: -100%; z-index: 60; }
  .app[data-sidebar="open"] .sidebar { left: 0; width: 280px; }
}
