:root {
  --red-950: #52000d;
  --red-800: #8c0016;
  --red-700: #b3001b;
  --red-600: #d20b2a;
  --red-100: #ffe2e7;
  --red-50: #fff4f6;
  --ink-950: #16181d;
  --ink-800: #30343b;
  --ink-600: #5d6470;
  --ink-400: #9299a3;
  --line: #dfe2e7;
  --paper: #ffffff;
  --soft: #f5f6f8;
  --warm: #fff6e8;
  --green: #147a4a;
  --green-soft: #e6f6ee;
  --amber: #9a5b00;
  --amber-soft: #fff1cf;
  --blue: #1f5f99;
  --blue-soft: #e7f1fb;
  --shadow: 0 16px 40px rgba(30, 35, 45, 0.09);
  --radius: 5px;
  --sidebar: 238px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink-950);
  background: var(--soft);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

button, input, select { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }

:focus-visible {
  outline: 3px solid rgba(179, 0, 27, 0.34);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 5px;
  color: white;
  background: var(--ink-950);
}
.skip-link:focus { top: 12px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 78px;
  padding: 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: white;
  background: linear-gradient(105deg, var(--red-950) 0%, var(--red-800) 58%, var(--red-700) 100%);
  box-shadow: 0 6px 24px rgba(82, 0, 13, 0.24);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  padding: 0;
  border: 0;
  color: inherit;
  text-align: left;
  background: transparent;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.04rem; letter-spacing: 0.01em; }
.brand small { opacity: 0.78; font-size: 0.78rem; }

.brand-mark {
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 4px;
  border-radius: 5px;
  background: white;
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
}
.brand-mark img { width: 100%; height: 100%; display: block; border-radius: 5px; }

.top-stats { display: flex; gap: 10px; margin-left: auto; }
.top-stats > div {
  min-width: 92px;
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 5px;
  text-align: center;
  background: rgba(255,255,255,.08);
}
.top-stats span, .top-stats small { display: block; }
.top-stats span { font-weight: 800; font-size: .9rem; }
.top-stats small { opacity: .75; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; }

.menu-toggle {
  display: none;
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 5px;
  color: white;
  background: rgba(255,255,255,.08);
}

.app-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: calc(100vh - 78px); }

.side-nav {
  position: sticky;
  top: 78px;
  height: calc(100vh - 78px);
  align-self: start;
  padding: 22px 14px;
  border-right: 1px solid var(--line);
  background: var(--paper);
  overflow-y: auto;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 3px 0;
  padding: 12px 13px;
  border: 0;
  border-radius: 5px;
  color: var(--ink-600);
  text-align: left;
  background: transparent;
  transition: .18s ease;
}
.nav-item span { font-size: .68rem; font-weight: 800; letter-spacing: .08em; color: var(--ink-400); }
.nav-item:hover { color: var(--ink-950); background: var(--soft); }
.nav-item.active { color: var(--red-800); font-weight: 800; background: var(--red-50); }
.nav-item.active span { color: var(--red-600); }

main { min-width: 0; padding: 34px clamp(20px, 4vw, 58px) 60px; }
.view { display: none; max-width: 1260px; margin: 0 auto; animation: viewIn .25s ease; }
.view.active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr);
  gap: 24px;
  padding: clamp(28px, 5vw, 64px);
  border-radius: 5px;
  color: white;
  background:
    radial-gradient(circle at 85% 20%, rgba(255,255,255,.17), transparent 28%),
    linear-gradient(125deg, #5d0010 0%, #9a0018 52%, #d20b2a 100%);
  box-shadow: var(--shadow);
}

.eyebrow, .card-kicker {
  margin: 0 0 7px;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.eyebrow { color: var(--red-600); }
.hero .eyebrow { color: #ffd7df; }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 14px; font-size: clamp(2rem, 5vw, 4.4rem); line-height: 1.02; letter-spacing: -.045em; }
h2 { line-height: 1.18; letter-spacing: -.02em; }
.hero-text { max-width: 750px; margin-bottom: 24px; font-size: clamp(1rem, 1.5vw, 1.18rem); color: rgba(255,255,255,.86); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; }
.offline-note { margin: 19px 0 0; color: rgba(255,255,255,.65); font-size: .82rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-weight: 800;
  transition: .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { color: var(--red-800); background: white; }
.button.secondary { color: var(--ink-950); border-color: var(--line); background: white; }
.button.danger { color: var(--red-800); border-color: #f0b4bf; background: var(--red-50); }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.text-button, .back-button {
  padding: 0;
  border: 0;
  color: var(--red-700);
  font-weight: 850;
  background: transparent;
}
.text-button:hover, .back-button:hover { text-decoration: underline; }
.back-button { margin-bottom: 16px; }

.hero-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 5px;
  background: rgba(28, 0, 6, .23);
  backdrop-filter: blur(3px);
}
.hero-panel h2 { margin: 12px 0; }
.hero-panel p { margin: 12px 0 0; color: rgba(255,255,255,.7); font-size: .82rem; }
.pulse-ring {
  width: 76px; height: 76px;
  display: grid; place-items: center;
  border: 8px solid rgba(255,255,255,.2);
  border-radius: 50%;
  box-shadow: 0 0 0 8px rgba(255,255,255,.08);
  font-size: 1.4rem; font-weight: 950;
}
.weight-bar { display: flex; height: 60px; gap: 3px; border-radius: 5px; overflow: hidden; }
.weight-bar span { width: var(--size); display: grid; place-items: center; padding: 4px; color: white; background: rgba(255,255,255,.13); font-size: .68rem; font-weight: 800; text-align: center; }
.weight-bar span:first-child { background: rgba(255,255,255,.28); }

.dashboard-grid { display: grid; grid-template-columns: 1.4fr .8fr .8fr; gap: 16px; margin-top: 18px; }
.dashboard-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 8px 24px rgba(30,35,45,.04);
}
.dashboard-card h2 { margin-bottom: 9px; }
.dashboard-card p { color: var(--ink-600); }
.focus-card { grid-row: span 2; display: flex; flex-direction: column; justify-content: center; background: linear-gradient(145deg, white, var(--red-50)); }
.focus-card .text-button { align-self: flex-start; }
.emergency-card { grid-column: 2 / -1; color: #663b00; border-color: #f0d4a1; background: var(--warm); }
.emergency-card p { color: #7a5a25; }
.card-kicker { color: var(--ink-400); }
.metric { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.metric strong { color: var(--red-700); font-size: 2rem; }
.metric span { color: var(--ink-600); }
.progress-track { height: 9px; overflow: hidden; border-radius: 5px; background: var(--line); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--red-600); transition: width .4s ease; }

.priority-section { margin-top: 42px; }
.section-heading, .page-heading { display: flex; justify-content: space-between; gap: 22px; align-items: flex-end; margin-bottom: 21px; }
.page-heading h1 { margin: 0 0 8px; font-size: clamp(2.1rem, 4vw, 3.6rem); }
.page-heading p { max-width: 760px; margin-bottom: 0; color: var(--ink-600); }
.priority-preview { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; }
.priority-tile {
  min-height: 180px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 5px;
  text-align: left;
  background: white;
}
.priority-tile:hover { border-color: #d0a1aa; box-shadow: 0 10px 28px rgba(82,0,13,.08); }
.priority-tile .priority-number { display: block; margin-bottom: 25px; color: var(--red-600); font-weight: 950; }
.priority-tile small { color: var(--ink-400); }

.compact-select, .search-field { display: grid; gap: 5px; color: var(--ink-600); font-size: .78rem; font-weight: 800; }
select, input[type="search"] { min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink-950); background: white; }
.search-field { min-width: min(360px, 100%); }

.module-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.module-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 270px;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  background: white;
  overflow: hidden;
}
.module-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--tier); }
.module-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.module-card[data-tier="critical"] { --tier: var(--red-600); }
.module-card[data-tier="urgent"] { --tier: #d38100; }
.module-card[data-tier="support"] { --tier: var(--blue); }
.module-card .module-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--ink-400); font-size: .73rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.module-card h2 { margin: 25px 0 9px; font-size: 1.35rem; }
.module-card p { color: var(--ink-600); }
.module-card .module-footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
.priority-dots { display: flex; gap: 4px; }
.priority-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.priority-dots i.on { background: var(--tier); }
.completed-badge { color: var(--green); font-size: .75rem; font-weight: 900; }

.module-detail { overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: white; box-shadow: var(--shadow); }
.module-hero { padding: clamp(26px,5vw,54px); color: white; background: linear-gradient(125deg, var(--module-dark, #5d0010), var(--module-color, #d20b2a)); }
.module-hero h1 { max-width: 900px; font-size: clamp(2.3rem,5vw,4.3rem); }
.module-hero p { max-width: 820px; color: rgba(255,255,255,.82); font-size: 1.05rem; }
.module-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.module-hero-meta span { padding: 5px 9px; border: 1px solid rgba(255,255,255,.25); border-radius: 5px; font-size: .72rem; font-weight: 800; background: rgba(255,255,255,.1); }
.module-body { padding: clamp(24px,4vw,48px); }
.key-message { padding: 19px 21px; border-left: 5px solid var(--red-600); border-radius: 5px; color: var(--red-950); background: var(--red-50); font-size: 1.12rem; font-weight: 800; }
.content-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 17px; margin: 23px 0; }
.content-block { padding: 20px; border: 1px solid var(--line); border-radius: 5px; background: var(--soft); }
.content-block h2 { margin-bottom: 12px; font-size: 1.12rem; }
.content-block ul, .step-list { margin: 0; padding-left: 20px; }
.content-block li, .step-list li { margin: 7px 0; }
.step-list { counter-reset: step; padding: 0; list-style: none; }
.step-list li { position: relative; min-height: 44px; padding: 10px 10px 10px 48px; border-bottom: 1px solid var(--line); }
.step-list li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 8px; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--red-700); font-weight: 900; }
.mnemonic { padding: 20px; border-radius: 5px; background: var(--blue-soft); color: #153e62; }
.mnemonic strong { display: block; margin-bottom: 5px; }
.source-note { color: var(--ink-400); font-size: .78rem; }
.module-check { margin-top: 26px; padding: 22px; border-radius: 5px; background: var(--ink-950); color: white; }
.module-check h2 { margin-bottom: 8px; }
.practice-intro { margin: 0 0 15px; color: rgba(255,255,255,.72); }
.practice-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 15px 0 20px; }
.practice-tab { padding: 9px 12px; border: 1px solid rgba(255,255,255,.24); border-radius: 5px; color: white; background: rgba(255,255,255,.07); font-weight: 800; }
.practice-tab:hover, .practice-tab.active { border-color: #8fd7cf; background: rgba(30,120,144,.48); }
.practice-panel { padding-top: 2px; }
.practice-help { margin: 0 0 14px; color: rgba(255,255,255,.74); }
.sequence-practice-list { display: grid; gap: 9px; margin: 16px 0; }
.sequence-practice-item { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 11px; border: 1px solid rgba(255,255,255,.18); border-radius: 5px; background: rgba(255,255,255,.07); }
.sequence-practice-item > span:first-child { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-950); background: white; font-weight: 900; }
.sequence-move { display: flex; gap: 5px; }
.sequence-move button { width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.2); border-radius: 5px; color: white; background: rgba(255,255,255,.08); }
.sequence-move button:disabled { opacity: .32; cursor: not-allowed; }
.practice-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 15px; }
.practice-actions .button { min-height: 44px; }
.practice-result { margin: 14px 0 0; padding: 13px 14px; border-radius: 5px; background: rgba(255,255,255,.09); }
.practice-result.correct { color: #b8f4d6; background: rgba(20,122,74,.36); }
.practice-result.retry { color: #ffe1a8; background: rgba(154,91,0,.30); }
.correct-sequence { margin: 9px 0 0; padding-left: 20px; color: rgba(255,255,255,.8); }
.recall-box { padding: 20px; border: 1px solid rgba(255,255,255,.18); border-radius: 5px; text-align: center; background: rgba(255,255,255,.06); }
.recall-timer { display: grid; place-items: center; width: 92px; height: 92px; margin: 15px auto; border: 5px solid #8fd7cf; border-radius: 50%; font-size: 2rem; font-weight: 950; }
.recall-solution { margin-top: 16px; padding: 16px; border-radius: 5px; color: var(--ink-950); text-align: left; background: white; }
.recall-solution strong { display: block; margin-bottom: 5px; color: #123b5d; }
.module-complete-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.next-module-button { min-width: min(100%, 340px); display: grid; gap: 1px; text-align: left; background: linear-gradient(110deg, #116b63, #1e7890); }
.next-module-button span { font-size: .72rem; opacity: .82; text-transform: uppercase; letter-spacing: .05em; }
.next-module-button strong { font-size: .92rem; line-height: 1.25; }
.answer-grid { display: grid; gap: 9px; margin: 16px 0; }
.answer-button { padding: 13px 15px; border: 1px solid rgba(255,255,255,.2); border-radius: 5px; color: white; text-align: left; background: rgba(255,255,255,.07); }
.answer-button:hover { background: rgba(255,255,255,.14); }
.answer-button.correct { border-color: #58d095; background: rgba(20,122,74,.45); }
.answer-button.wrong { border-color: #ff8b9d; background: rgba(179,0,27,.5); }
.module-complete-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; }

.scenario-stage, .quiz-area, .flashcard-area { min-height: 470px; }
.scenario-card, .quiz-card {
  padding: clamp(24px,4vw,45px);
  border: 1px solid var(--line);
  border-radius: 5px;
  background: white;
  box-shadow: var(--shadow);
}
.scenario-card { display: grid; grid-template-columns: minmax(220px,.7fr) minmax(0,1.3fr); gap: 34px; }
.scene-visual { min-height: 330px; display: flex; flex-direction: column; justify-content: space-between; padding: 24px; border-radius: 5px; color: white; background: linear-gradient(145deg, var(--scene-a, #5d0010), var(--scene-b, #d20b2a)); }
.scene-visual .scene-code { font-size: .72rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; opacity: .82; }
.scene-question-mark { width: clamp(86px, 12vw, 132px); aspect-ratio: 1; display: grid; place-items: center; border: 2px solid rgba(255,255,255,.42); border-radius: 50%; font-size: clamp(3.5rem,8vw,6.5rem); line-height: 1; font-weight: 950; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 10px rgba(255,255,255,.035); }
.scene-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.scene-meta span { display: inline-flex; align-items: center; min-height: 30px; padding: 6px 10px; border: 1px solid rgba(255,255,255,.28); border-radius: 5px; background: rgba(0,0,0,.12); color: white; font-size: .76rem; font-weight: 850; }
.scene-visual p { margin: 0; color: rgba(255,255,255,.84); font-size: .9rem; }
.case-takeaway { display: grid; gap: 4px; margin-top: 13px; padding-top: 13px; border-top: 1px solid currentColor; border-top-color: color-mix(in srgb, currentColor 24%, transparent); }
.case-takeaway span { font-size: .7rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; opacity: .72; }
.case-takeaway strong { font-size: .96rem; line-height: 1.45; }
.scenario-actions { flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.scenario-actions .button { min-height: 46px; }
.scene-content h2 { font-size: clamp(1.7rem,3vw,2.6rem); }
.scene-content > p { color: var(--ink-600); }
.option-list { display: grid; gap: 10px; margin-top: 20px; }
.option-button { display: grid; grid-template-columns: 32px 1fr; gap: 11px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 5px; text-align: left; background: white; }
.option-button span { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-600); background: var(--soft); font-weight: 900; }
.option-button:hover { border-color: #c996a0; }
.option-button.correct { border-color: #7bc8a4; background: var(--green-soft); }
.option-button.wrong { border-color: #e694a2; background: var(--red-50); }
.feedback-box { margin-top: 18px; padding: 16px; border-radius: 5px; background: var(--soft); }
.feedback-box.correct { color: #0e5e39; background: var(--green-soft); }
.feedback-box.wrong { color: #7d0014; background: var(--red-50); }
.next-row { display: flex; justify-content: flex-end; margin-top: 16px; }
.scenario-score { display: grid; min-width: 80px; text-align: right; }
.scenario-score strong { color: var(--red-700); font-size: 1.8rem; line-height: 1; }
.scenario-score span { color: var(--ink-400); font-size: .72rem; font-weight: 800; text-transform: uppercase; }

.flashcard-wrap { max-width: 820px; margin: 0 auto; }
.flashcard-progress { display: flex; justify-content: space-between; margin-bottom: 12px; color: var(--ink-600); font-size: .85rem; }
.flashcard {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px,6vw,65px);
  border: 1px solid var(--line);
  border-radius: 5px;
  background: white;
  box-shadow: var(--shadow);
  text-align: center;
}
.flashcard .tag { align-self: center; padding: 5px 9px; border-radius: 5px; color: var(--red-800); background: var(--red-50); font-size: .72rem; font-weight: 900; }
.flashcard h2 { margin: 28px auto; max-width: 670px; font-size: clamp(1.5rem,3vw,2.4rem); }
.flashcard-answer { max-width: 680px; margin: 0 auto; color: var(--ink-600); }
.card-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 18px; }
.card-rating { min-width: 130px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 5px; background: white; font-weight: 800; }
.card-rating.again { color: var(--red-800); background: var(--red-50); }
.card-rating.hard { color: var(--amber); background: var(--amber-soft); }
.card-rating.good { color: var(--green); background: var(--green-soft); }
.empty-state { padding: 45px; border: 1px dashed #b8bdc6; border-radius: 5px; text-align: center; color: var(--ink-600); background: white; }

.quiz-progress-row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 15px; color: var(--ink-600); font-weight: 800; }
.quiz-card h2 { max-width: 850px; font-size: clamp(1.5rem,3vw,2.3rem); }
.quiz-result { text-align: center; }
.quiz-result .result-ring { width: 155px; height: 155px; margin: 0 auto 22px; display: grid; place-items: center; border: 13px solid var(--red-100); border-top-color: var(--red-600); border-radius: 50%; color: var(--red-800); font-size: 2rem; font-weight: 950; transform: rotate(-35deg); }
.quiz-result .result-ring span { transform: rotate(35deg); }
.review-list { max-width: 830px; margin: 22px auto; text-align: left; }
.review-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.review-item strong { display: block; }
.review-item small { color: var(--ink-600); }

.cpr-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cpr-trainer, .sequence-trainer { padding: clamp(24px,4vw,42px); border: 1px solid var(--line); border-radius: 5px; background: white; box-shadow: var(--shadow); }
.cpr-trainer { text-align: center; }
.cpr-pulse { width: 180px; height: 180px; margin: 0 auto 22px; display: grid; place-items: center; border-radius: 50%; color: white; background: radial-gradient(circle at 35% 30%, #e93a54, var(--red-800)); box-shadow: 0 0 0 18px var(--red-50); transition: transform .1s ease, box-shadow .1s ease; }
.cpr-pulse.beat { transform: scale(.88); box-shadow: 0 0 0 8px var(--red-100); }
.cpr-pulse.breath { background: radial-gradient(circle at 35% 30%, #5697d1, #1c4f7b); box-shadow: 0 0 0 18px var(--blue-soft); }
.cpr-pulse span { font-size: 4rem; font-weight: 950; }
.cpr-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 20px 0; }
.cpr-controls label { display: grid; gap: 4px; color: var(--ink-600); font-size: .75rem; font-weight: 800; }
.sequence-pool { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.sequence-chip { padding: 9px 11px; border: 1px solid var(--line); border-radius: 5px; background: var(--soft); text-align: left; }
.sequence-chip:disabled { opacity: .35; }
.sequence-answer { min-height: 180px; margin: 0; padding: 16px 16px 16px 43px; border: 1px dashed #b8bdc6; border-radius: 5px; background: #fafafa; }
.sequence-answer li { margin: 8px 0; padding: 6px 8px; border-radius: 5px; background: white; }
.sequence-answer button { float: right; border: 0; color: var(--red-700); background: transparent; }
.sequence-actions { display: flex; gap: 14px; align-items: center; margin-top: 14px; }
.feedback { min-height: 24px; margin: 12px 0 0; font-weight: 800; }

.reference-list { display: grid; gap: 11px; }
.reference-item { border: 1px solid var(--line); border-radius: 5px; background: white; overflow: hidden; }
.reference-item summary { position: relative; padding: 18px 50px 18px 20px; cursor: pointer; list-style: none; font-weight: 850; }
.reference-item summary::-webkit-details-marker { display: none; }
.reference-item summary::after { content: "+"; position: absolute; right: 20px; top: 13px; color: var(--red-600); font-size: 1.6rem; }
.reference-item[open] summary::after { content: "−"; }
.reference-content { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 0 20px 20px; color: var(--ink-600); }
.reference-content h3 { color: var(--ink-950); font-size: 1rem; }
.reference-content ul { margin: 0; padding-left: 18px; }
.reference-alert { grid-column: 1 / -1; padding: 12px; border-radius: 5px; color: var(--red-950); background: var(--red-50); font-weight: 800; }

.progress-dashboard { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.stat-card { padding: 23px; border: 1px solid var(--line); border-radius: 5px; background: white; }
.stat-card strong { display: block; margin: 8px 0; color: var(--red-700); font-size: 2.1rem; }
.stat-card p { color: var(--ink-600); }
.stat-card.wide { grid-column: span 2; }
.mastery-list { display: grid; gap: 11px; }
.mastery-row { display: grid; grid-template-columns: minmax(150px,1fr) 2fr 50px; gap: 10px; align-items: center; }
.mastery-row .bar { height: 8px; border-radius: 5px; background: var(--line); overflow: hidden; }
.mastery-row .bar span { display: block; height: 100%; border-radius: inherit; background: var(--red-600); }
.mastery-row small { text-align: right; color: var(--ink-600); }
.history-list { margin: 0; padding-left: 20px; color: var(--ink-600); }

.footer { padding: 24px max(20px, calc((100vw - 1260px) / 2)); border-top: 1px solid var(--line); color: var(--ink-600); background: white; font-size: .78rem; }
.footer p { margin: 3px 0; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 300; max-width: 350px; padding: 13px 16px; border-radius: 5px; color: white; background: var(--ink-950); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(12px); transition: .2s ease; }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 1050px) {
  .hero { grid-template-columns: 1fr; }
  .hero-panel { max-width: 650px; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .focus-card { grid-row: auto; }
  .emergency-card { grid-column: 1 / -1; }
  .priority-preview { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .module-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .scenario-card { grid-template-columns: 1fr; }
  .scene-visual { min-height: 220px; }
  .cpr-layout { grid-template-columns: 1fr; }
  .progress-dashboard { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 780px) {
  .topbar { height: 70px; padding: 0 15px; }
  .brand small { display: none; }
  .top-stats > div { min-width: 70px; padding: 6px; }
  .top-stats > div:last-child { display: none; }
  .menu-toggle { display: block; }
  .app-shell { display: block; }
  .side-nav {
    position: fixed;
    top: 70px;
    left: 0;
    z-index: 90;
    width: min(310px, 88vw);
    height: calc(100vh - 70px);
    transform: translateX(-105%);
    transition: .22s ease;
    box-shadow: var(--shadow);
  }
  .side-nav.open { transform: none; }
  main { padding: 22px 14px 45px; }
  h1 { font-size: clamp(2rem,10vw,3.3rem); }
  .hero { padding: 28px 21px; }
  .dashboard-grid, .module-grid, .progress-dashboard { grid-template-columns: 1fr; }
  .emergency-card, .stat-card.wide { grid-column: auto; }
  .priority-preview { grid-template-columns: 1fr; }
  .section-heading, .page-heading { align-items: stretch; flex-direction: column; }
  .compact-select, .search-field { width: 100%; min-width: 0; }
  .content-grid, .reference-content { grid-template-columns: 1fr; }
  .reference-alert { grid-column: auto; }
  .scenario-card { padding: 18px; gap: 20px; }
  .cpr-pulse { width: 145px; height: 145px; }
  .cpr-pulse span { font-size: 3.2rem; }
  .mastery-row { grid-template-columns: 1fr 44px; }
  .mastery-row .bar { grid-column: 1 / -1; grid-row: 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Serverversion: klare Navigation, Benutzerkonto und mobile Optimierungen */
:root { --sidebar: 270px; }

.button.primary { color: white; background: var(--red-700); }
.hero .button.primary { color: var(--red-800); background: white; }

.account-area { display: flex; align-items: center; gap: 9px; }
.username-label { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; font-weight: 800; }
.logout-button {
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 5px;
  color: white;
  background: rgba(255,255,255,.08);
  font-weight: 800;
}
.logout-button:hover { background: rgba(255,255,255,.16); }
.logout-button:disabled { opacity: .55; }

.nav-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 1px;
  align-items: center;
}
.nav-item > span { grid-row: 1 / 3; }
.nav-item > strong { font-size: .91rem; line-height: 1.2; }
.nav-item > small { color: var(--ink-400); font-size: .7rem; line-height: 1.25; }
.nav-item.active > small { color: #a34a59; }

.hero-steps { margin: 7px 0 0; padding-left: 22px; color: rgba(255,255,255,.84); }
.hero-steps li { margin: 9px 0; padding-left: 3px; }

.getting-started { margin-top: 38px; }
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 15px; }
.guide-card {
  position: relative;
  min-height: 190px;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 8px 24px rgba(30,35,45,.04);
}
.guide-card > span {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border-radius: 50%;
  color: white;
  background: var(--red-700);
  font-weight: 900;
}
.guide-card h3 { margin-bottom: 8px; }
.guide-card p { margin-bottom: 0; color: var(--ink-600); }

.startup-error {
  max-width: 1260px;
  margin: 0 auto 18px;
  padding: 13px 15px;
  border: 1px solid #e7a7b2;
  border-radius: 5px;
  color: var(--red-800);
  background: var(--red-50);
  font-weight: 800;
}

@media (max-width: 1050px) {
  .guide-grid { grid-template-columns: 1fr; }
  .guide-card { min-height: 0; }
}

@media (max-width: 780px) {
  .topbar { gap: 8px; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .top-stats { display: none; }
  .account-area { margin-left: auto; }
  .username-label { display: none; }
  .logout-button { min-height: 40px; padding: 7px 9px; font-size: .78rem; }
  .side-nav { padding-bottom: max(22px, env(safe-area-inset-bottom)); }
  main { padding-bottom: max(45px, calc(25px + env(safe-area-inset-bottom))); }
  .hero-text { font-size: 1rem; }
  .hero-panel { padding: 20px; }
  .getting-started { margin-top: 28px; }
  .guide-grid { gap: 11px; }
  .guide-card { padding: 19px; }
  .guide-card > span { margin-bottom: 16px; }
}

@media (max-width: 520px) {
  .brand > span:last-child { display: none; }
  .topbar { height: 66px; }
  .side-nav { top: 66px; height: calc(100vh - 66px); width: min(330px, 92vw); }
  .hero { border-radius: 5px; padding: 25px 18px; }
  .hero h1 { font-size: clamp(2rem, 11vw, 3rem); }
  .hero-actions { display: grid; grid-template-columns: 1fr; }
  .hero-actions .button { width: 100%; }
  .dashboard-card, .guide-card, .module-card, .cpr-trainer, .sequence-trainer { border-radius: 5px; }
  .flashcard { min-height: 285px; padding: 28px 19px; }
  .card-actions > * { width: 100%; }
  .sequence-actions { align-items: stretch; flex-direction: column; }
  .sequence-actions .button { width: 100%; }
  .option-button { min-height: 52px; }
  .toast { left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); max-width: none; }
}


/* Anmeldung der lokalen Demo */
.auth-root[hidden], .app-root[hidden] { display: none !important; }
body.auth-mode {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: #f4f5f7;
}
body.app-mode { display: block; padding: 0; }
.auth-root { width: min(100%, 410px); }
.auth-shell { width: 100%; }
.auth-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  box-shadow: 0 18px 50px rgba(30, 35, 45, .09);
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 18px;
  padding: 4px;
  border-radius: 5px;
  background: #f1f2f4;
}
.auth-tab {
  min-height: 44px;
  border: 0;
  border-radius: 5px;
  color: var(--ink-600);
  background: transparent;
  font-weight: 800;
}
.auth-tab.active { color: var(--red-800); background: white; box-shadow: 0 2px 9px rgba(30, 35, 45, .08); }
.auth-card form { display: grid; gap: 12px; }
.auth-card input {
  width: 100%;
  min-height: 52px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink-950);
  background: white;
}
.auth-card input:focus { border-color: #bd7280; }
.submit-button {
  min-height: 52px;
  border: 0;
  border-radius: 5px;
  color: white;
  background: linear-gradient(110deg, var(--red-950), var(--red-700));
  font-weight: 850;
}
.submit-button:disabled { opacity: .65; cursor: wait; }
.auth-message { min-height: 21px; margin: 0; color: var(--red-800); font-size: .85rem; }
.hidden { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 480px) {
  body.auth-mode { place-items: start center; padding-top: max(12vh, env(safe-area-inset-top)); }
  .auth-card { padding: 16px; border-radius: 5px; }
}

@media (max-width: 700px) {
  .module-complete-row { align-items: stretch; flex-direction: column; }
  .module-complete-actions { justify-content: stretch; }
  .module-complete-actions .button, .next-module-button { width: 100%; }
  .sequence-practice-item { grid-template-columns: 34px minmax(0,1fr); }
  .sequence-move { grid-column: 2; }
}

@media (max-width: 620px) {
  .scenario-actions { display: grid; grid-template-columns: 1fr; }
  .scenario-actions .button { width: 100%; }
  .scene-question-mark { width: 88px; }
}


/* Feedbackbogen und lokale Testauswertung */
.feedback-status {
  min-width: 150px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 5px;
  text-align: center;
  background: white;
}
.feedback-status strong, .feedback-status span { display: block; }
.feedback-status strong { color: var(--red-700); font-size: 1.55rem; }
.feedback-status span { color: var(--ink-600); font-size: .74rem; font-weight: 800; }

.feedback-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 20px;
  align-items: start;
}
.feedback-form { display: grid; gap: 17px; }
.feedback-intro-card,
.feedback-section,
.feedback-side-card,
.feedback-admin {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 8px 24px rgba(30,35,45,.04);
}
.feedback-intro-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, .45fr);
  gap: 18px;
  align-items: center;
  padding: 22px;
}
.feedback-intro-card h2 { margin-bottom: 8px; }
.feedback-intro-card p:last-child { margin-bottom: 0; color: var(--ink-600); }
.feedback-progress-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 8px;
}
.feedback-progress-summary span {
  padding: 10px;
  border-radius: 5px;
  color: var(--ink-600);
  background: var(--soft);
  text-align: center;
  font-size: .75rem;
}
.feedback-progress-summary strong { display: block; color: var(--red-700); font-size: 1.25rem; }

.feedback-section { min-width: 0; margin: 0; padding: 22px; }
.feedback-section legend {
  padding: 0 8px;
  color: var(--red-800);
  font-size: 1.05rem;
  font-weight: 900;
}
.feedback-help { margin: 0 0 15px; color: var(--ink-600); font-size: .88rem; }
.feedback-field-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; }
.feedback-field-grid > label,
.full-field,
.range-field { display: grid; gap: 7px; color: var(--ink-800); font-size: .83rem; font-weight: 800; }
.feedback-section select,
.feedback-section textarea,
.feedback-section input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink-950);
  background: white;
}
.feedback-section select { min-height: 48px; padding: 10px 12px; }
.feedback-section textarea { resize: vertical; min-height: 92px; padding: 12px; font-weight: 500; }
.feedback-section select:focus,
.feedback-section textarea:focus { border-color: #bd7280; }
.full-field { margin-top: 18px; }
.required-field::after { content: "Pflichtfeld"; width: fit-content; color: var(--red-700); font-size: .68rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }

.rating-legend {
  display: grid;
  grid-template-columns: minmax(240px,1fr) repeat(6, 58px);
  gap: 4px;
  margin-bottom: 6px;
  color: var(--ink-600);
  text-align: center;
  font-size: .72rem;
  font-weight: 800;
}
.rating-legend::before { content: "Aussage"; text-align: left; }
.rating-legend small { font-size: .56rem; font-weight: 700; }
.rating-matrix { display: grid; gap: 6px; }
.rating-row {
  display: grid;
  grid-template-columns: minmax(240px,1fr) repeat(6, 58px);
  gap: 4px;
  align-items: stretch;
  padding: 7px;
  border-radius: 5px;
  background: var(--soft);
}
.rating-question { display: flex; align-items: center; padding: 6px 8px; font-size: .87rem; font-weight: 750; }
.rating-option { position: relative; display: grid; place-items: center; min-height: 42px; border: 1px solid transparent; border-radius: 5px; background: white; }
.rating-option:hover { border-color: #dc9daa; }
.rating-option input { width: 18px; height: 18px; accent-color: var(--red-700); }
.rating-option span { display: none; }

.checkbox-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.checkbox-grid label,
.choice-row label,
.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fafafa;
  font-size: .82rem;
  font-weight: 700;
}
.checkbox-grid input,
.choice-row input,
.consent-check input { flex: 0 0 auto; margin-top: 3px; accent-color: var(--red-700); }
.feedback-question-block + .feedback-question-block { margin-top: 18px; }
.question-label { display: block; margin-bottom: 9px; font-weight: 850; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-row label { background: white; }
.range-field { grid-column: span 2; }
.range-line { display: flex; align-items: center; gap: 13px; min-height: 48px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 5px; }
.range-line input { width: 100%; accent-color: var(--red-700); }
.range-line output { min-width: 72px; color: var(--red-800); font-weight: 900; text-align: right; }
.consent-check { margin-top: 18px; background: var(--red-50); }
.feedback-submit-row { display: flex; align-items: center; gap: 15px; padding: 5px 2px 15px; }
.feedback-submit-row .button.primary { color: white; background: var(--red-700); }
.feedback-form-message { min-height: 24px; margin: 0; color: var(--green); font-weight: 850; }
.feedback-form-message.error { color: var(--red-800); }

.feedback-side { position: sticky; top: 98px; display: grid; gap: 15px; }
.feedback-side-card { padding: 20px; }
.feedback-side-card h2 { font-size: 1.12rem; }
.feedback-side-card p { color: var(--ink-600); font-size: .86rem; }
.feedback-side-card .button { width: 100%; }

.feedback-admin { margin-top: 32px; padding: 24px; }
.admin-toolbar { display: flex; flex-wrap: wrap; gap: 9px; margin: 18px 0 22px; }
.import-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 10px 17px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: white;
  font-weight: 800;
  cursor: pointer;
}
.import-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.feedback-admin-dashboard { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 11px; }
.feedback-kpi { padding: 17px; border-radius: 5px; background: var(--soft); }
.feedback-kpi strong { display: block; color: var(--red-700); font-size: 1.75rem; }
.feedback-kpi span { color: var(--ink-600); font-size: .76rem; font-weight: 800; }
.feedback-rating-summary { grid-column: 1 / -1; overflow-x: auto; margin-top: 4px; }
.feedback-rating-summary table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.feedback-rating-summary th,
.feedback-rating-summary td { padding: 9px; border-bottom: 1px solid var(--line); text-align: left; }
.feedback-rating-summary td:last-child { text-align: right; font-weight: 900; }
.feedback-admin-list { display: grid; gap: 10px; margin-top: 20px; }
.feedback-record {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: white;
}
.feedback-record h3 { margin-bottom: 3px; font-size: 1rem; }
.feedback-record p { margin: 0; color: var(--ink-600); font-size: .8rem; }
.feedback-record blockquote { margin: 9px 0 0; color: var(--ink-800); font-size: .84rem; }
.feedback-record-actions { display: flex; gap: 7px; }
.feedback-record-actions button { padding: 7px 9px; border: 1px solid var(--line); border-radius: 5px; background: white; font-size: .75rem; font-weight: 800; }
.feedback-empty { padding: 25px; border: 1px dashed #b8bdc6; border-radius: 5px; color: var(--ink-600); text-align: center; }

@media (max-width: 1050px) {
  .feedback-layout { grid-template-columns: 1fr; }
  .feedback-side { position: static; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .feedback-admin-dashboard { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 780px) {
  .feedback-intro-card { grid-template-columns: 1fr; }
  .feedback-field-grid { grid-template-columns: 1fr; }
  .range-field { grid-column: auto; }
  .checkbox-grid { grid-template-columns: 1fr 1fr; }
  .rating-legend { display: none; }
  .rating-row { grid-template-columns: repeat(6,minmax(0,1fr)); gap: 5px; padding: 10px; }
  .rating-question { grid-column: 1 / -1; padding: 3px 2px 8px; }
  .rating-option { min-height: 48px; }
  .rating-option span { display: block; margin-top: 2px; color: var(--ink-600); font-size: .58rem; }
  .feedback-record { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .feedback-status { width: 100%; }
  .feedback-section, .feedback-admin { padding: 17px; border-radius: 5px; }
  .feedback-side { grid-template-columns: 1fr; }
  .checkbox-grid { grid-template-columns: 1fr; }
  .choice-row { display: grid; grid-template-columns: 1fr; }
  .feedback-submit-row { align-items: stretch; flex-direction: column; }
  .feedback-submit-row .button { width: 100%; }
  .feedback-admin-dashboard { grid-template-columns: 1fr; }
  .feedback-rating-summary { grid-column: auto; }
  .admin-toolbar > * { width: 100%; }
  .feedback-record-actions { display: grid; grid-template-columns: 1fr 1fr; }
}


/* Hinweis zur Testversion und anonyme Rückmeldung */
.test-version-notice { max-width:760px; margin:20px 0; padding:16px 18px; border:1px solid rgba(255,255,255,.28); border-radius: 5px; background:rgba(255,255,255,.11); box-shadow:inset 0 1px 0 rgba(255,255,255,.08); }
.test-version-notice strong { display:block; margin-bottom:5px; color:#fff; font-size:1rem; }
.test-version-notice p { margin:0; color:rgba(255,255,255,.88); font-size:.92rem; }
.test-version-link { margin-top:11px; padding:0; border:0; color:#fff; font:inherit; font-size:.88rem; font-weight:900; text-decoration:underline; text-underline-offset:3px; background:transparent; cursor:pointer; }
.recommendation-scale { display:block; color:var(--ink-600); font-size:.78rem; font-weight:600; line-height:1.45; }
.recommendation-scale strong { color:var(--red-800); }
.feedback-progress-summary small { grid-column:1 / -1; display:block; margin-top:4px; color:var(--ink-600); font-size:.72rem; line-height:1.35; }
@media (max-width:640px) { .test-version-notice { padding:15px; } .recommendation-scale { font-size:.75rem; } }

/* Server-Backend */
.backend-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.backend-kpi,
.backend-panel,
.backend-user-card {
  background: var(--surface, #fff);
  border: 1px solid var(--line, #dde1e7);
  border-radius: 5px;
  box-shadow: 0 12px 30px rgba(51, 24, 29, .07);
}

.backend-kpi {
  padding: 20px;
}

.backend-kpi strong {
  display: block;
  color: #9f1028;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  line-height: 1;
  margin-bottom: 8px;
}

.backend-kpi span {
  color: #5d6470;
  font-size: .9rem;
}

.backend-panel {
  padding: clamp(18px, 3vw, 28px);
  margin: 20px 0;
}

.backend-user-list {
  display: grid;
  gap: 12px;
}

.backend-user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  box-shadow: none;
}

.backend-user-card h3 {
  margin: 0 0 5px;
}

.backend-user-card p {
  margin: 0;
  color: #68707c;
  font-size: .84rem;
}

.backend-user-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(62px, 1fr));
  gap: 8px;
}

.backend-user-progress span {
  min-width: 64px;
  padding: 9px 10px;
  border-radius: 5px;
  background: #f8f2f3;
  color: #6e3540;
  text-align: center;
  font-size: .72rem;
}

.backend-user-progress strong {
  display: block;
  color: #8c0016;
  font-size: 1rem;
}

.role-badge {
  display: inline-block;
  margin-left: 7px;
  padding: 3px 7px;
  border-radius: 5px;
  background: #8c0016;
  color: white;
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  vertical-align: middle;
}

@media (max-width: 900px) {
  .backend-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .backend-user-card { align-items: flex-start; flex-direction: column; }
  .backend-user-progress { width: 100%; }
}

@media (max-width: 560px) {
  .backend-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .backend-kpi { padding: 15px; }
  .backend-user-progress { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-toolbar .button { width: 100%; }
}

/* System-Backup im Administrator-Backend */
.backup-panel { overflow: hidden; }
.backup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}
.backup-card {
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line, #dedfe3);
  border-radius: 5px;
  background: #fff;
}
.backup-card h3 { margin: 3px 0 7px; }
.backup-card p { margin: 0; }
.backup-card label {
  display: block;
  font-weight: 750;
  color: var(--ink, #252525);
}
.backup-card input[type="password"],
.backup-card input[type="text"],
.backup-card input[type="file"] {
  width: 100%;
  margin-top: 7px;
  padding: 11px 12px;
  border: 1px solid #b9bcc3;
  border-radius: 5px;
  background: #fff;
  color: inherit;
  font: inherit;
}
.backup-card input[type="file"] { padding: 9px; }
.backup-card input:focus {
  outline: 3px solid rgba(140, 0, 22, .14);
  border-color: var(--red-700, #8c0016);
}
.backup-restore-card {
  border-color: #e5b4bc;
  background: #fffafb;
}
.field-help {
  display: block;
  margin-top: 6px;
  color: var(--muted, #60646d);
  font-size: .86rem;
  font-weight: 450;
  line-height: 1.45;
}
.backup-message {
  min-height: 1.4em;
  color: var(--muted, #60646d);
  font-weight: 650;
}
.backup-message.error { color: #8c0016; }
.backup-message.success { color: #17643b; }
.backup-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-left: 4px solid var(--red-700, #8c0016);
  border-radius: 5px;
  background: var(--red-50, #fff1f3);
  line-height: 1.55;
}
.backup-note code {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255,255,255,.7);
}
@media (max-width: 850px) {
  .backup-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .backup-card { padding: 16px; border-radius: 5px; }
  .backup-card .button { width: 100%; }
}

/* Zugang ohne Registrierung */
/*
   Bei aktiviertem Gastzugang bleiben Anmelden und Registrieren nebeneinander.
   Der Gastzugang erhält bewusst eine eigene, volle Zeile. So bleiben alle drei
   Optionen auch auf schmalen Smartphones gut lesbar und berühren sich nicht.
*/
.auth-tabs.has-guest-access {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto auto;
}
.auth-tabs.has-guest-access #loginTab {
  grid-column: 1;
  grid-row: 1;
}
.auth-tabs.has-guest-access #registerTab {
  grid-column: 2;
  grid-row: 1;
}
.auth-tabs.has-guest-access #guestTab {
  grid-column: 1 / -1;
  grid-row: 2;
}
.auth-tabs.has-guest-access .auth-tab {
  width: 100%;
  min-width: 0;
  padding: 10px 8px;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}
.guest-login-hint {
  margin: 0;
  padding: 10px 12px;
  border-radius: 5px;
  background: #f8f2f3;
  color: var(--ink-600);
  font-size: .78rem;
  line-height: 1.45;
}
@media (max-width: 420px) {
  .auth-tabs { gap: 4px; padding: 4px; }
  .auth-tabs .auth-tab {
    min-height: 44px;
    padding: 9px 6px;
    font-size: .82rem;
    line-height: 1.18;
  }
  .auth-tabs.has-guest-access #guestTab {
    min-height: 46px;
    font-size: .84rem;
  }
}

.guest-access-panel { overflow: hidden; }
.guest-access-status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 5px;
  background: #f1f2f4;
  color: #626b76;
  font-size: .78rem;
  font-weight: 850;
  white-space: nowrap;
}
.guest-access-status.active { background: #e8f5ec; color: #246637; }
.guest-access-status.inactive { background: #f6edef; color: #7a3844; }
.guest-access-form { display: grid; gap: 18px; margin-top: 14px; }
.guest-access-toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fbf8f7;
  cursor: pointer;
}
.guest-access-toggle input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--red-800); }
.guest-access-toggle span { display: grid; gap: 3px; }
.guest-access-toggle small { color: var(--ink-600); font-weight: 550; line-height: 1.4; }
.guest-password-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.guest-password-grid label { display: grid; gap: 7px; font-weight: 800; }
.guest-password-grid input {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink-950);
  background: white;
}
.guest-access-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.guest-access-actions .backup-message { flex: 1 1 260px; }
@media (max-width: 720px) {
  .guest-access-panel .section-heading { align-items: flex-start; }
  .guest-password-grid { grid-template-columns: 1fr; }
  .guest-access-actions { align-items: stretch; flex-direction: column; }
  .guest-access-actions .button { width: 100%; }
  .guest-access-actions .backup-message { flex-basis: auto; }
}


/* CSP-sichere Modulfarben */
.module-hero[data-tier="critical"] { --module-dark:#5d0010; --module-color:#d20b2a; }
.module-hero[data-tier="urgent"] { --module-dark:#704000; --module-color:#d38100; }
.module-hero[data-tier="support"] { --module-dark:#173e61; --module-color:#2c75ad; }

/* CSP-sichere Farben der Praxisfälle */
.scene-visual[data-scenario="collapse"] { --scene-a:#52000d; --scene-b:#d20b2a; }
.scene-visual[data-scenario="unconscious-breathing"] { --scene-a:#153e62; --scene-b:#2d79b8; }
.scene-visual[data-scenario="aed-analysis"] { --scene-a:#3f173f; --scene-b:#7a397a; }
.scene-visual[data-scenario="cpr-hands-only"] { --scene-a:#4c1016; --scene-b:#9d2432; }
.scene-visual[data-scenario="choke-adult"] { --scene-a:#684000; --scene-b:#d38100; }
.scene-visual[data-scenario="choke-mild"] { --scene-a:#315416; --scene-b:#65993a; }
.scene-visual[data-scenario="infant-choke"] { --scene-a:#17465c; --scene-b:#2e8cad; }
.scene-visual[data-scenario="bleeding"] { --scene-a:#5e0715; --scene-b:#a8172f; }
.scene-visual[data-scenario="foreign-object-wound"] { --scene-a:#4a2730; --scene-b:#8b4a5b; }
.scene-visual[data-scenario="stroke"] { --scene-a:#2d1647; --scene-b:#74439a; }
.scene-visual[data-scenario="heart-attack"] { --scene-a:#551217; --scene-b:#aa2c37; }
.scene-visual[data-scenario="seizure"] { --scene-a:#163e36; --scene-b:#23836e; }
.scene-visual[data-scenario="hypo"] { --scene-a:#4b4010; --scene-b:#9a841d; }
.scene-visual[data-scenario="hypo-unconscious"] { --scene-a:#273f4a; --scene-b:#517e91; }
.scene-visual[data-scenario="asthma"] { --scene-a:#17445b; --scene-b:#2d7d9f; }
.scene-visual[data-scenario="allergic-reaction"] { --scene-a:#5c3300; --scene-b:#b86b08; }
.scene-visual[data-scenario="sepsis"] { --scene-a:#34214a; --scene-b:#735293; }
.scene-visual[data-scenario="burn"] { --scene-a:#6b2700; --scene-b:#db6a00; }
.scene-visual[data-scenario="heatstroke"] { --scene-a:#6c2e00; --scene-b:#ca5b00; }
.scene-visual[data-scenario="hypothermia"] { --scene-a:#143a55; --scene-b:#2b709a; }
.scene-visual[data-scenario="poison-child"] { --scene-a:#334711; --scene-b:#6c8e2c; }
.scene-visual[data-scenario="chemical-eye"] { --scene-a:#1f4c4a; --scene-b:#3e8f88; }
.scene-visual[data-scenario="poison"] { --scene-a:#22252a; --scene-b:#5d6470; }
.scene-visual[data-scenario="electric-shock"] { --scene-a:#514400; --scene-b:#a88e00; }
.scene-visual[data-scenario="fracture"] { --scene-a:#394153; --scene-b:#6d7890; }
.scene-visual[data-scenario="concussion"] { --scene-a:#2e3a4c; --scene-b:#62738c; }
.scene-visual[data-scenario="abdominal-injury"] { --scene-a:#4a2921; --scene-b:#8b5545; }
.scene-visual[data-scenario="road-safety"] { --scene-a:#593600; --scene-b:#a86a05; }
.scene-visual[data-scenario="helmet"] { --scene-a:#28343d; --scene-b:#536b7b; }
.scene-visual[data-scenario="child-resuscitation"] { --scene-a:#18445c; --scene-b:#347f9e; }

/* CSP-sichere Fortschrittsbreiten */
.percent-0 { width:0% !important; }
.percent-1 { width:1% !important; }
.percent-2 { width:2% !important; }
.percent-3 { width:3% !important; }
.percent-4 { width:4% !important; }
.percent-5 { width:5% !important; }
.percent-6 { width:6% !important; }
.percent-7 { width:7% !important; }
.percent-8 { width:8% !important; }
.percent-9 { width:9% !important; }
.percent-10 { width:10% !important; }
.percent-11 { width:11% !important; }
.percent-12 { width:12% !important; }
.percent-13 { width:13% !important; }
.percent-14 { width:14% !important; }
.percent-15 { width:15% !important; }
.percent-16 { width:16% !important; }
.percent-17 { width:17% !important; }
.percent-18 { width:18% !important; }
.percent-19 { width:19% !important; }
.percent-20 { width:20% !important; }
.percent-21 { width:21% !important; }
.percent-22 { width:22% !important; }
.percent-23 { width:23% !important; }
.percent-24 { width:24% !important; }
.percent-25 { width:25% !important; }
.percent-26 { width:26% !important; }
.percent-27 { width:27% !important; }
.percent-28 { width:28% !important; }
.percent-29 { width:29% !important; }
.percent-30 { width:30% !important; }
.percent-31 { width:31% !important; }
.percent-32 { width:32% !important; }
.percent-33 { width:33% !important; }
.percent-34 { width:34% !important; }
.percent-35 { width:35% !important; }
.percent-36 { width:36% !important; }
.percent-37 { width:37% !important; }
.percent-38 { width:38% !important; }
.percent-39 { width:39% !important; }
.percent-40 { width:40% !important; }
.percent-41 { width:41% !important; }
.percent-42 { width:42% !important; }
.percent-43 { width:43% !important; }
.percent-44 { width:44% !important; }
.percent-45 { width:45% !important; }
.percent-46 { width:46% !important; }
.percent-47 { width:47% !important; }
.percent-48 { width:48% !important; }
.percent-49 { width:49% !important; }
.percent-50 { width:50% !important; }
.percent-51 { width:51% !important; }
.percent-52 { width:52% !important; }
.percent-53 { width:53% !important; }
.percent-54 { width:54% !important; }
.percent-55 { width:55% !important; }
.percent-56 { width:56% !important; }
.percent-57 { width:57% !important; }
.percent-58 { width:58% !important; }
.percent-59 { width:59% !important; }
.percent-60 { width:60% !important; }
.percent-61 { width:61% !important; }
.percent-62 { width:62% !important; }
.percent-63 { width:63% !important; }
.percent-64 { width:64% !important; }
.percent-65 { width:65% !important; }
.percent-66 { width:66% !important; }
.percent-67 { width:67% !important; }
.percent-68 { width:68% !important; }
.percent-69 { width:69% !important; }
.percent-70 { width:70% !important; }
.percent-71 { width:71% !important; }
.percent-72 { width:72% !important; }
.percent-73 { width:73% !important; }
.percent-74 { width:74% !important; }
.percent-75 { width:75% !important; }
.percent-76 { width:76% !important; }
.percent-77 { width:77% !important; }
.percent-78 { width:78% !important; }
.percent-79 { width:79% !important; }
.percent-80 { width:80% !important; }
.percent-81 { width:81% !important; }
.percent-82 { width:82% !important; }
.percent-83 { width:83% !important; }
.percent-84 { width:84% !important; }
.percent-85 { width:85% !important; }
.percent-86 { width:86% !important; }
.percent-87 { width:87% !important; }
.percent-88 { width:88% !important; }
.percent-89 { width:89% !important; }
.percent-90 { width:90% !important; }
.percent-91 { width:91% !important; }
.percent-92 { width:92% !important; }
.percent-93 { width:93% !important; }
.percent-94 { width:94% !important; }
.percent-95 { width:95% !important; }
.percent-96 { width:96% !important; }
.percent-97 { width:97% !important; }
.percent-98 { width:98% !important; }
.percent-99 { width:99% !important; }
.percent-100 { width:100% !important; }


/* Lernvideos */
.module-videos { margin: 28px 0; padding: 22px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.module-video-heading { margin-bottom: 15px; }
.module-video-heading h2 { margin-bottom: 6px; }
.module-video-heading p { margin: 0; color: var(--ink-600); }
.module-video-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.training-video-card { overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--soft); }
.video-consent { min-height: 270px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 11px; padding: 22px; }
.video-consent strong, .video-consent span { display: block; }
.video-consent strong { font-size: 1.05rem; }
.video-consent span { margin-top: 2px; color: var(--ink-600); font-size: .84rem; }
.video-consent p { margin: 0; color: var(--ink-600); font-size: .86rem; }
.video-play-symbol { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--red-700); }
.video-frame-wrap { position: relative; width: 100%; aspect-ratio: 16/9; background: #111; }
.video-frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Quellen */
.sources-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.source-card, .source-list-section, .source-note-box { padding: 22px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.source-card-primary { border-left: 5px solid var(--red-700); }
.source-card p { color: var(--ink-600); }
.source-card strong { color: var(--ink-950); }
.source-link, .video-source-item a { color: var(--red-800); font-weight: 850; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.source-list-section, .source-note-box { margin-top: 18px; }
.video-source-list { display: grid; gap: 9px; }
.video-source-item { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 5px; background: var(--soft); }
.video-source-item strong, .video-source-item span { display: block; }
.video-source-item span { margin-top: 2px; color: var(--ink-600); font-size: .82rem; }
.source-note-box { background: var(--warm); }
.source-note-box p:last-child { margin-bottom: 0; }
.footer-source-link { padding: 0; border: 0; color: inherit; background: transparent; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 760px) {
  .module-video-grid, .sources-grid { grid-template-columns: 1fr; }
  .video-source-item { align-items: flex-start; flex-direction: column; }
  .video-consent { min-height: 230px; padding: 18px; }
}

/* Freiwillige Feedback-Kontextauswertung im Adminbereich */
.backend-feedback-context {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.backend-feedback-context section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--soft);
}
.backend-feedback-context h3 { margin: 0 0 8px; font-size: .95rem; }
.backend-feedback-context ul { margin: 0; padding-left: 19px; color: var(--ink-700); }
@media (max-width: 760px) {
  .backend-feedback-context { grid-template-columns: 1fr; }
}


/* Registrierung: E-Mail und Kontodaten */
.auth-field-help {
  display: block;
  margin: 6px 2px 0;
  color: var(--ink-500);
  font-size: .76rem;
  line-height: 1.35;
}
.account-email-panel {
  display: grid;
  grid-template-columns: minmax(0,1.2fr) minmax(280px,.8fr);
  gap: 24px;
  align-items: start;
  margin-top: 20px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}
.account-email-panel h2 { margin-bottom: 7px; }
.account-email-panel p { color: var(--ink-600); }
.account-email-form {
  display: grid;
  gap: 10px;
}
.account-email-form label span {
  display: block;
  margin-bottom: 6px;
  font-weight: 850;
}
.account-email-form input { width: 100%; }
.account-email-message {
  min-height: 1.3em;
  margin: 0;
  color: var(--ink-600);
  font-size: .82rem;
}

/* Direkter Abschluss und Weiterlernen */
.module-forward-button {
  min-width: min(100%, 390px);
  display: grid;
  gap: 1px;
  text-align: left;
  white-space: normal;
  line-height: 1.2;
  background: linear-gradient(110deg, #116b63, #1e7890);
}
.module-forward-button span {
  font-size: .75rem;
  opacity: .88;
}
.module-forward-button strong {
  font-size: .94rem;
  line-height: 1.25;
}
.module-overview-button {
  white-space: normal;
  font-weight: 900;
}

@media (max-width: 760px) {
  .account-email-panel { grid-template-columns: 1fr; }
  .module-forward-button,
  .module-overview-button { width: 100%; }
}
.account-email-panel[hidden] { display: none; }

.video-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.video-original-link {
  text-decoration: none;
}
@media (max-width: 560px) {
  .video-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }
  .video-actions .button {
    width: 100%;
  }
}


/* Wenige, gezielte Motivationsmomente */
.motivation-banner {
  position: fixed;
  z-index: 1200;
  top: 22px;
  left: 50%;
  width: min(560px, calc(100% - 28px));
  transform: translate(-50%, -16px);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 18px 18px 20px;
  border: 1px solid #b8d9d4;
  border-left: 5px solid #116b63;
  border-radius: 5px;
  background: #f5fbfa;
  box-shadow: 0 16px 42px rgba(22, 55, 59, .18);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.motivation-banner.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.motivation-banner-text {
  min-width: 0;
  flex: 1;
}
.motivation-kicker {
  display: block;
  margin-bottom: 4px;
  color: #116b63;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.motivation-banner strong {
  display: block;
  color: var(--ink-950);
  font-size: 1.05rem;
  line-height: 1.25;
}
.motivation-banner p {
  margin: 6px 0 0;
  color: var(--ink-600);
  font-size: .9rem;
  line-height: 1.45;
}
.motivation-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #c8dedb;
  border-radius: 5px;
  background: #fff;
  color: var(--ink-700);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.motivation-close:hover {
  background: #edf7f5;
}

@media (max-width: 560px) {
  .motivation-banner {
    top: 12px;
    width: calc(100% - 20px);
    padding: 15px;
  }
  .motivation-banner strong {
    font-size: .98rem;
  }
  .motivation-banner p {
    font-size: .84rem;
  }
}
