:root {
  --red: #c8102e;
  --red-dark: #980a22;
  --navy: #101c2c;
  --navy-2: #1c2a3d;
  --blue: #075da7;
  --blue-light: #eaf4fc;
  --ink: #17202c;
  --muted: #667386;
  --line: #dbe1e8;
  --surface: #ffffff;
  --canvas: #f3f5f7;
  --success: #16835f;
  --warning: #b85c00;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(16, 28, 44, .10);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, Aptos, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

/* Rapportarbejdet foregår på rapport.danni.dk. Kursussitet viser kun undervisning. */
#report { display: none !important; }

.portal-actions { display: flex; align-items: center; gap: 1rem; }
.portal-report-link { white-space: nowrap; }
.case-handoff { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin: 0 0 1.5rem; padding: 1rem 1.1rem; border: 1px solid #d9e0e8; border-radius: 1rem; background: #f7f9fb; }
.case-handoff div { display: grid; gap: .25rem; }
.case-handoff span { color: #536277; font-size: .94rem; line-height: 1.45; }
@media (max-width: 640px) {
  .portal-actions { align-items: flex-end; flex-direction: column; gap: .45rem; }
  .case-handoff { align-items: flex-start; flex-direction: column; }
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.course-portal {
  min-height: 100vh;
  padding: 0 clamp(20px, 5vw, 72px) 70px;
  color: #fff;
  background:
    radial-gradient(circle at 84% 8%, rgba(200,16,46,.35), transparent 27%),
    linear-gradient(145deg, #0b1522 0%, #14243a 58%, #0e1928 100%);
}
.portal-header { min-height: 105px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid rgba(255,255,255,.13); }
.portal-brand { display: flex; align-items: center; gap: 13px; }
.portal-brand > div { display: grid; }
.portal-brand strong { font-size: 1.25rem; letter-spacing: .09em; }
.portal-brand small { color: #b8c3d1; font-size: .85rem; }
.portal-label { color: #b8c3d1; font-size: .76rem; font-weight: 800; letter-spacing: .13em; }
.portal-intro { max-width: 720px; padding: clamp(45px, 8vw, 90px) 0 36px; }
.portal-intro .eyebrow { color: #e7a9b4; }
.portal-intro h1 { margin-top: 10px; font-size: clamp(2.6rem, 7vw, 5.3rem); letter-spacing: -.045em; }
.portal-intro p { max-width: 650px; margin: 18px 0 0; color: #c7d0dc; font-size: 1.08rem; }
.course-library { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.portal-course-card { min-height: 390px; padding: clamp(25px, 4vw, 42px); border: 1px solid rgba(255,255,255,.14); border-radius: 24px; display: flex; flex-direction: column; box-shadow: 0 24px 70px rgba(0,0,0,.24); }
.portal-course-card.featured { grid-column: 1 / -1; background: linear-gradient(135deg, #c8102e, #e32645); }
.portal-course-card.equipment-card { min-height: 360px; }
.portal-course-card.onboarding-card { grid-column: 1 / -1; background: linear-gradient(135deg, #34465d, #536a85); }
.portal-course-card.future { grid-column: 1 / -1; min-height: 240px; background: rgba(255,255,255,.07); }
.course-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: auto; }
.course-status { padding: 6px 9px; border: 1px solid rgba(255,255,255,.4); border-radius: 7px; font-size: .72rem; font-weight: 900; letter-spacing: .09em; }
.course-number { color: rgba(255,255,255,.4); font-size: 2.6rem; font-weight: 900; line-height: 1; }
.portal-course-card h2 { max-width: 680px; margin-top: 10px; font-size: clamp(1.75rem, 3vw, 2.8rem); }
.portal-course-card p { max-width: 680px; color: rgba(255,255,255,.76); }
.course-card-meta { margin: 22px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.course-card-meta span { padding: 6px 10px; border-radius: 99px; color: #fff; background: rgba(16,28,44,.23); font-size: .8rem; }
.portal-course-card .button { align-self: flex-start; }
.portal-course-card.future h2 { font-size: clamp(1.5rem, 2.2vw, 2rem); }
.portal-mode .prototype-banner,
.portal-mode .app-shell,
.portal-mode .mobile-nav,
.portal-mode .toast { display: none !important; }
body:not(.portal-mode) .course-portal { display: none; }
.portal-back { margin: 0 0 7px; padding: 0; border: 0; color: var(--red); background: transparent; font-size: .82rem; font-weight: 800; }

.onboarding-course { display: none; min-height: 100vh; background: #eef1f5; }
.onboarding-mode .course-portal,
.onboarding-mode .equipment-course,
.onboarding-mode .prototype-banner,
.onboarding-mode .app-shell,
.onboarding-mode .mobile-nav,
.onboarding-mode .toast { display: none !important; }
.onboarding-mode .onboarding-course { display: block; }
.onboarding-layout { min-height: calc(100vh - 90px); display: grid; grid-template-columns: minmax(280px, 330px) minmax(0, 1fr); }
.onboarding-sidebar { padding: 38px 26px; color: #fff; background: linear-gradient(180deg, #17263a, #0f1b2a); }
.onboarding-sidebar .eyebrow { color: #e8a6b1; }
.onboarding-sidebar h1 { margin: 8px 0; font-size: 2.25rem; }
.onboarding-sidebar > p { margin: 0 0 26px; color: #c4ceda; }
.onboarding-nav { display: grid; gap: 5px; }
.onboarding-nav > strong { margin: 16px 10px 5px; color: #8796a9; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.onboarding-nav button { width: 100%; padding: 11px 12px; border: 1px solid transparent; border-radius: 10px; display: grid; grid-template-columns: 28px 1fr; gap: 8px; color: #c8d2de; background: transparent; text-align: left; }
.onboarding-nav button span { color: #8290a2; font-size: .76rem; font-weight: 900; }
.onboarding-nav button:hover { color: #fff; background: rgba(255,255,255,.07); }
.onboarding-nav button.active { color: #fff; background: var(--red); }
.onboarding-nav button.active span { color: #fff; }
.onboarding-content { min-width: 0; padding: clamp(34px, 6vw, 72px); outline: none; }
.onboarding-page { max-width: 980px; }
.onboarding-page-head { margin-bottom: 32px; }
.onboarding-page-head h2 { margin: 8px 0 12px; font-size: clamp(2.25rem, 5vw, 4.4rem); letter-spacing: -.045em; }
.onboarding-page-head p { max-width: 760px; margin: 0; color: var(--muted); font-size: 1.08rem; }
.onboarding-hero { padding: clamp(28px, 5vw, 54px); border-radius: 24px; color: #fff; background: linear-gradient(135deg, #c8102e, #921027); box-shadow: var(--shadow); }
.onboarding-hero h3 { max-width: 700px; margin: 8px 0 14px; font-size: clamp(1.8rem, 4vw, 3rem); }
.onboarding-hero p { max-width: 720px; color: rgba(255,255,255,.82); }
.onboarding-copy-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.onboarding-copy-card { padding: 24px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: 0 10px 30px rgba(16,28,44,.07); }
.onboarding-copy-card h3 { margin: 0 0 9px; }
.onboarding-copy-card p { margin: 0; color: var(--muted); }
.onboarding-timeline { display: grid; gap: 14px; }
.onboarding-timeline article { padding: 22px 24px; border-left: 5px solid var(--red); border-radius: 0 14px 14px 0; background: #fff; box-shadow: 0 8px 25px rgba(16,28,44,.06); }
.onboarding-timeline strong { display: block; color: var(--red); font-size: 1.12rem; }
.onboarding-timeline p { margin: 6px 0 0; color: var(--muted); }
.area-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.area-card { min-height: 130px; padding: 18px 14px; border-radius: 14px; color: #fff; background: var(--navy-2); }
.area-card span { display: block; color: #e7a9b4; font-size: .72rem; font-weight: 900; letter-spacing: .08em; }
.area-card strong { display: block; margin-top: 26px; font-size: 1.05rem; }
.review-note { margin-top: 20px; padding: 16px 18px; border: 1px solid #efc47b; border-radius: 13px; color: #704006; background: #fff8e8; }
.onboarding-module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.onboarding-module { min-height: 220px; padding: 26px; border: 1px solid var(--line); border-radius: 18px; display: flex; flex-direction: column; align-items: flex-start; background: #fff; box-shadow: 0 12px 34px rgba(16,28,44,.08); text-align: left; }
.onboarding-module.available { border-top: 5px solid var(--red); }
.onboarding-module.pending { color: #5b6878; background: #f8f9fb; }
.onboarding-module .module-status { color: var(--red); font-size: .72rem; font-weight: 900; letter-spacing: .1em; }
.onboarding-module.pending .module-status { color: #7a8797; }
.onboarding-module strong { margin: auto 0 8px; color: var(--ink); font-size: 1.45rem; }
.onboarding-module small { color: var(--muted); font-size: .92rem; }
.onboarding-module .module-open { margin-top: 20px; color: var(--red); font-weight: 900; }
.onboarding-pager { max-width: 980px; margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
.onboarding-pager button { min-width: 130px; }

.equipment-course { display: none; min-height: 100vh; background: #eef1f5; }
.equipment-mode .course-portal,
.equipment-mode .onboarding-course,
.equipment-mode .prototype-banner,
.equipment-mode .app-shell,
.equipment-mode .mobile-nav,
.equipment-mode .toast { display: none !important; }
.equipment-mode .equipment-course { display: block; }
.equipment-header {
  min-height: 86px;
  padding: 0 clamp(20px, 4vw, 56px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  color: #fff;
  background: var(--navy);
  border-bottom: 4px solid var(--red);
}
.equipment-header .portal-brand { justify-self: center; }
.equipment-back { justify-self: start; padding: 10px 0; border: 0; color: #fff; background: transparent; font-weight: 800; }
.equipment-report-link { justify-self: end; }
.equipment-layout { min-height: calc(100vh - 90px); display: grid; grid-template-columns: minmax(270px, 320px) minmax(0, 1fr); }
.equipment-sidebar { padding: 40px 28px; color: #fff; background: linear-gradient(180deg, #17263a, #0f1b2a); }
.equipment-sidebar .eyebrow { color: #e8a6b1; }
.equipment-sidebar h1 { margin: 10px 0 14px; font-size: clamp(1.8rem, 3vw, 2.5rem); }
.equipment-sidebar > p { color: #c4ceda; }
.equipment-chapters { margin-top: 30px; display: grid; gap: 6px; }
.equipment-chapter {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid transparent;
  border-radius: 11px;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 9px;
  color: #c7d1dd;
  background: transparent;
  text-align: left;
}
.equipment-chapter span { color: #8e9caf; font-size: .78rem; font-weight: 900; }
.equipment-chapter strong { font-size: .9rem; }
.equipment-chapter:hover { color: #fff; background: rgba(255,255,255,.07); }
.equipment-chapter.active { color: #fff; background: var(--red); }
.equipment-chapter.active span { color: #fff; }
.equipment-main { min-width: 0; padding: clamp(24px, 4vw, 48px); }
.equipment-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.equipment-toolbar > div { display: grid; gap: 3px; }
.equipment-slide-title { font-size: 1.25rem; }
.equipment-counter { color: var(--muted); font-weight: 800; }
.equipment-progress { height: 5px; margin: 14px 0 22px; border-radius: 99px; background: #d9dfe6; overflow: hidden; }
.equipment-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--red); transition: width .2s ease; }
.equipment-stage { margin: 0; border-radius: 14px; background: #101c2c; box-shadow: 0 18px 48px rgba(16,28,44,.18); overflow: hidden; }
.equipment-stage img { width: 100%; height: auto; display: block; aspect-ratio: 16 / 9; object-fit: contain; }
.equipment-controls { margin-top: 22px; display: flex; justify-content: space-between; gap: 12px; }
.equipment-controls button { min-width: 145px; }
.equipment-controls button:disabled { opacity: .42; cursor: default; transform: none; }
.equipment-hint { margin: 12px 0 0; font-size: .84rem; text-align: center; }

.prototype-banner {
  height: 34px;
  padding: 0 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  color: #fff;
  background: var(--red);
  font-size: .82rem;
  letter-spacing: .02em;
}
.prototype-banner strong { letter-spacing: .11em; }

.app-shell { min-height: calc(100vh - 34px); display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: calc(100vh - 34px);
  display: flex;
  flex-direction: column;
  padding: 28px 18px 20px;
  color: #fff;
  background: var(--navy);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; }
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 50% 50% 50% 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--red);
  font-size: 1.35rem;
  font-weight: 900;
  transform: rotate(-5deg);
}
.brand > div:last-child { display: grid; }
.brand strong { font-size: 1.25rem; letter-spacing: .08em; }
.brand span { color: #bfc8d5; font-size: .82rem; }
.main-nav { display: grid; gap: 6px; }
.nav-item {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #c9d1dc;
  background: transparent;
  text-align: left;
  transition: .18s ease;
}
.nav-item span { width: 22px; text-align: center; font-size: 1.2rem; }
.nav-item:hover { color: #fff; background: #1b2a3d; }
.nav-item.active { color: #fff; background: var(--red); font-weight: 700; }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; display: flex; align-items: center; gap: 9px; color: #aeb9c8; font-size: .78rem; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #25b581; box-shadow: 0 0 0 4px rgba(37,181,129,.15); }

.main { min-width: 0; padding: 0 42px 60px; }
.topbar {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.eyebrow { color: var(--muted); font-size: .75rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1.08; }
h2 { margin-bottom: 8px; font-size: clamp(1.35rem, 2vw, 1.9rem); line-height: 1.15; }
h3 { margin-bottom: 8px; font-size: 1.08rem; }
p { color: var(--muted); }
.role-switch { display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.role-btn { border: 0; border-radius: 9px; padding: 9px 13px; color: var(--muted); background: transparent; font-size: .9rem; }
.role-btn.active[data-role="havariagent"] { color: #fff; background: var(--red); }
.role-btn.active[data-role="vejvagt"] { color: #fff; background: var(--blue); }

.view { display: none; padding-top: 32px; animation: rise .25s ease; }
.view.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.command-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; }
.command-card { min-height: 235px; padding: 30px; border-radius: var(--radius); display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow); }
.command-primary { color: #fff; background: linear-gradient(135deg, var(--red), #e32645); }
.command-dark { color: #fff; background: linear-gradient(135deg, var(--navy), #263b56); }
.command-card p { color: rgba(255,255,255,.78); }
.command-card h2 { margin-top: 7px; font-size: clamp(1.8rem, 3vw, 2.65rem); }
.card-kicker { font-size: .77rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.button { min-height: 44px; border: 0; border-radius: 11px; padding: 10px 16px; display: inline-flex; justify-content: center; align-items: center; gap: 7px; font-weight: 750; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-light { align-self: flex-start; color: var(--ink); background: #fff; }
.button-red { color: #fff; background: var(--red); }
.button-red:hover { background: var(--red-dark); }
.button-outline { color: var(--ink); background: #fff; border: 1px solid var(--line); }
.button-ghost { color: var(--muted); background: transparent; }
.text-button { border: 0; padding: 0; color: var(--red); background: none; font-weight: 700; }
.hidden { display: none !important; }

.role-map { margin-top: 20px; display: grid; grid-template-columns: 1fr 190px 1fr; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.role-panel { min-height: 205px; padding: 26px 30px; background: #fff; }
.role-panel ul { margin: 16px 0 0; padding-left: 20px; color: var(--muted); }
.role-panel li + li { margin-top: 7px; }
.role-label { display: inline-flex; padding: 5px 9px; border-radius: 6px; color: #fff; font-size: .72rem; font-weight: 900; letter-spacing: .09em; }
.role-ha .role-label { background: var(--red); }
.role-vv .role-label { background: var(--blue); }
.role-panel h3 { margin-top: 14px; font-size: 1.35rem; }
.role-center { padding: 22px 12px; display: grid; align-content: center; justify-items: center; gap: 10px; color: #fff; background: linear-gradient(145deg, var(--red) 0 48%, var(--blue) 52% 100%); text-align: center; }
.role-center span { padding: 4px 8px; border-radius: 5px; color: var(--navy); background: #fff; font-size: .69rem; font-weight: 900; letter-spacing: .1em; }
.role-center strong { line-height: 1.7; }
.role-map.focus-ha .role-vv { opacity: .4; }
.role-map.focus-vv .role-ha { opacity: .4; }

.dashboard-lower { margin-top: 20px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
.panel { padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.panel-head strong { color: var(--red); font-size: 2rem; }
.progress-track { height: 10px; margin: 18px 0 12px; overflow: hidden; border-radius: 99px; background: #e5e9ef; }
.progress-track span { display: block; width: 14%; height: 100%; border-radius: inherit; background: var(--red); transition: width .3s ease; }
.progress-meta { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: .88rem; }
.quick-card h2 { margin-top: 5px; }
.quick-link { width: 100%; padding: 12px 0; display: flex; justify-content: space-between; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: transparent; text-align: left; }
.quick-link span { color: var(--red); }

.section-intro, .report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 28px; }
.section-intro p, .report-head p { margin-bottom: 0; }
.course-score { min-width: 110px; padding: 14px; border-radius: 14px; color: #fff; background: var(--navy); display: grid; text-align: center; }
.course-score span { font-size: 1.6rem; font-weight: 850; }
.course-score small { color: #c0c9d5; }
.module-list { display: grid; gap: 12px; }
.module-item { width: 100%; min-height: 96px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 15px; display: grid; grid-template-columns: 50px 1fr auto; align-items: center; gap: 17px; color: var(--ink); background: #fff; text-align: left; transition: .18s ease; }
.module-item:hover { border-color: #aab4c2; box-shadow: 0 8px 24px rgba(16,28,44,.07); }
.module-number { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--navy); font-weight: 850; }
.module-item.complete .module-number { background: var(--success); }
.module-copy { display: grid; gap: 3px; }
.module-copy strong { font-size: 1.04rem; }
.module-copy span { color: var(--muted); font-size: .88rem; }
.module-status { color: var(--muted); font-size: .84rem; font-weight: 750; }
.module-item.complete .module-status { color: var(--success); }
.exam-card { margin-top: 22px; padding: 26px 30px; border-radius: var(--radius); display: flex; justify-content: space-between; align-items: center; gap: 24px; color: #fff; background: linear-gradient(120deg, var(--red), var(--red-dark)); }
.exam-card p { margin-bottom: 0; color: rgba(255,255,255,.78); }

.case-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.case-card { min-height: 310px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; background: #fff; box-shadow: 0 9px 30px rgba(16,28,44,.06); }
.case-card .case-code { align-self: flex-start; padding: 5px 8px; border-radius: 6px; color: var(--red); background: #fdebef; font-size: .72rem; font-weight: 850; letter-spacing: .08em; }
.case-card h3 { margin-top: 18px; font-size: 1.35rem; }
.case-card p { flex: 1; }
.case-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tag { padding: 5px 8px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: #f7f8fa; font-size: .76rem; }

.save-state { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .86rem; }
.stepper { margin-bottom: 24px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.step { padding: 12px 9px; border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted); background: #fff; font-size: .86rem; }
.step span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #9aa5b3; font-size: .77rem; font-weight: 800; }
.step.active { color: var(--red); border-color: #e8a2ae; background: #fff6f7; font-weight: 800; }
.step.active span, .step.done span { background: var(--red); }
.form-step { display: none; min-height: 400px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.form-step.active { display: block; }
.form-grid { display: grid; gap: 20px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.full { grid-column: 1 / -1; }
label { display: grid; gap: 7px; color: #3a4553; font-size: .87rem; font-weight: 750; }
input, select, textarea { width: 100%; border: 1px solid #cbd3dd; border-radius: 10px; padding: 11px 12px; color: var(--ink); background: #fff; outline: none; font-weight: 450; }
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(200,16,46,.09); }
textarea { resize: vertical; }
.role-choice { margin: 0; padding: 0; border: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.role-choice legend { margin-bottom: 9px; color: #3a4553; font-size: .87rem; font-weight: 750; }
.role-choice label { position: relative; display: block; }
.role-choice input { position: absolute; opacity: 0; pointer-events: none; }
.role-choice span { height: 100%; padding: 16px; border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 3px; background: #f8fafb; }
.role-choice small { color: var(--muted); font-weight: 450; }
.role-choice input:checked + span { color: var(--red); border-color: var(--red); background: #fff6f7; box-shadow: 0 0 0 2px rgba(200,16,46,.07); }
.subsection-head { margin: 30px 0 14px; display: flex; align-items: end; justify-content: space-between; gap: 14px; }
.subsection-head h3 { margin: 3px 0 0; font-size: 1.25rem; }
.dynamic-list { display: grid; gap: 10px; }
.dynamic-row { display: grid; grid-template-columns: 1.1fr .5fr 1.5fr 42px; gap: 10px; align-items: center; }
.remove-row { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 9px; color: var(--danger); background: #fff; }
.callout { margin-bottom: 24px; padding: 15px 17px; border-radius: 12px; }
.callout.blue { color: #0a4f85; border: 1px solid #add3f0; background: var(--blue-light); }
.resource-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.resource-table { width: 100%; min-width: 950px; border-collapse: collapse; }
.resource-table th { padding: 12px 10px; color: #fff; background: var(--navy); font-size: .78rem; text-align: left; }
.resource-table td { padding: 8px; border-top: 1px solid var(--line); }
.resource-table input, .resource-table select { min-width: 105px; padding: 9px; }
.resource-table td:nth-child(2) select { min-width: 145px; }
.resource-table td:nth-child(3) input { min-width: 210px; }
.photo-drop { min-height: 138px; padding: 22px; border: 2px dashed #bdc6d2; border-radius: 13px; display: grid; place-items: center; align-content: center; color: var(--ink); background: #f8fafb; text-align: center; }
.photo-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.photo-drop span { color: var(--red); }
.photo-drop small { color: var(--muted); font-weight: 450; }
.form-actions { padding: 20px 2px 0; display: flex; justify-content: space-between; gap: 16px; }
.form-actions > div { display: flex; gap: 10px; }
.validation { padding: 18px; border-radius: 13px; margin-bottom: 20px; }
.validation.success { color: #0d6247; border: 1px solid #9bd6bf; background: #effaf5; }
.validation.warning { color: #7c3c00; border: 1px solid #f1c08e; background: #fff7ed; }
.validation ul { margin-bottom: 0; }
.report-preview { padding: 25px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.preview-title { padding-bottom: 14px; border-bottom: 4px solid var(--red); display: flex; justify-content: space-between; gap: 15px; }
.preview-title h3 { font-size: 1.6rem; }
.preview-badge { align-self: flex-start; padding: 6px 10px; border-radius: 99px; color: #fff; background: var(--red); font-size: .75rem; font-weight: 800; }
.preview-grid { margin: 20px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.preview-item { padding: 11px; border-radius: 9px; background: #f3f5f7; }
.preview-item span { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; }
.preview-section { margin-top: 22px; }
.preview-section h4 { margin: 0 0 8px; color: var(--red); }
.preview-section p { margin-bottom: 0; color: var(--ink); white-space: pre-wrap; }
.preview-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.preview-table th, .preview-table td { padding: 8px; border: 1px solid var(--line); text-align: left; }
.preview-table th { background: #edf0f4; }

.vendor-controls { display: grid; grid-template-columns: 1fr 230px; gap: 12px; }
.search-box { position: relative; display: block; }
.search-box span { position: absolute; left: 14px; top: 10px; color: var(--muted); font-size: 1.2rem; }
.search-box input { padding-left: 42px; }
.capability-filters { margin: 16px 0 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip { border: 1px solid var(--line); border-radius: 99px; padding: 7px 11px; color: var(--muted); background: #fff; font-size: .8rem; }
.filter-chip.active { color: #fff; border-color: var(--red); background: var(--red); }
.vendor-list { display: grid; gap: 12px; }
.vendor-item { padding: 20px; border: 1px solid var(--line); border-radius: 14px; display: grid; grid-template-columns: 1fr auto; gap: 18px; background: #fff; }
.vendor-item h3 { margin-bottom: 4px; }
.vendor-item p { margin-bottom: 11px; font-size: .88rem; }
.vendor-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.vendor-phone { align-self: center; padding: 10px 13px; border-radius: 10px; color: var(--muted); background: #f1f3f6; font-weight: 750; }
.empty-state { padding: 34px; border: 1px dashed #b9c2ce; border-radius: 14px; color: var(--muted); background: #fff; text-align: center; }

.action-controls { margin-bottom: 20px; display: grid; gap: 12px; }
.action-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.action-card { min-height: 190px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; background: #fff; text-align: left; transition: .18s ease; }
.action-card:hover { border-color: var(--red); transform: translateY(-2px); box-shadow: var(--shadow); }
.action-card .action-index { color: var(--red); font-size: .76rem; font-weight: 900; letter-spacing: .09em; }
.action-card h3 { margin-top: 18px; font-size: 1.22rem; }
.action-card p { margin-bottom: 0; }
.action-open { margin-top: auto; padding-top: 18px; color: var(--red); font-size: .86rem; font-weight: 800; }
.action-empty { grid-column: 1 / -1; }
.action-alert { margin: 0 0 22px; padding: 16px 18px; border: 1px solid #e895a3; border-left: 6px solid var(--red); border-radius: 12px; display: grid; gap: 3px; color: #6f0719; background: #fff1f3; }
.action-alert strong { font-size: .76rem; letter-spacing: .08em; }
.action-sections { display: grid; gap: 22px; }
.action-section { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.action-section:last-child { padding-bottom: 0; border-bottom: 0; }
.action-section h3 { margin: 0 0 12px; display: flex; align-items: center; gap: 10px; font-size: 1.08rem; }
.action-section h3 span { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; background: var(--navy); font-size: .72rem; }
.action-section ul { margin: 0; padding-left: 23px; }
.action-section li + li { margin-top: 8px; }
.action-source { margin: 22px 0 0; padding: 12px 14px; border-radius: 10px; color: #5b4820; background: #fff8df; font-size: .82rem; }

dialog { width: min(720px, calc(100% - 30px)); max-height: 88vh; padding: 0; border: 0; border-radius: 20px; color: var(--ink); box-shadow: 0 28px 90px rgba(0,0,0,.3); overflow: auto; }
dialog::backdrop { background: rgba(6, 14, 24, .67); backdrop-filter: blur(3px); }
.dialog-close { position: sticky; z-index: 2; top: 14px; float: right; margin: 14px; width: 38px; height: 38px; border: 0; border-radius: 50%; color: var(--ink); background: #edf0f4; font-size: 1.5rem; }
#dialog-content { padding: 34px; }
.dialog-hero { margin: -34px -34px 26px; padding: 34px 80px 30px 34px; color: #fff; background: linear-gradient(125deg, var(--navy), #2c425f); }
.dialog-hero.red { background: linear-gradient(125deg, var(--red), var(--red-dark)); }
.dialog-hero.blue { background: linear-gradient(125deg, var(--blue), #0f79c7); }
.dialog-hero p { margin-bottom: 0; color: rgba(255,255,255,.78); }
.dialog-list { padding-left: 22px; }
.dialog-list li + li { margin-top: 11px; }
.dialog-actions { margin-top: 24px; display: flex; justify-content: flex-end; gap: 10px; }
.choice-list { display: grid; gap: 10px; margin-top: 20px; }
.choice { width: 100%; padding: 15px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; text-align: left; }
.choice:hover { border-color: var(--red); background: #fff7f8; }
.choice.correct { border-color: var(--success); background: #effaf5; }
.choice.wrong { border-color: var(--danger); background: #fff1f0; }
.feedback { margin-top: 16px; padding: 15px; border-radius: 12px; background: #f1f3f6; }
.toast { position: fixed; z-index: 20; right: 24px; bottom: 24px; padding: 12px 16px; border-radius: 10px; color: #fff; background: var(--navy); box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .22s ease; }
.toast.show { opacity: 1; transform: none; }
.mobile-nav { display: none; }

@media (max-width: 1040px) {
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .main { padding-inline: 28px; }
  .brand span { display: none; }
  .case-grid, .action-grid { grid-template-columns: repeat(2, 1fr); }
  .role-map { grid-template-columns: 1fr 150px 1fr; }
  .role-panel { padding: 24px 20px; }
}

@media (max-width: 760px) {
  body:not(.equipment-mode) { padding-bottom: 70px; }
  .prototype-banner { height: auto; min-height: 34px; padding: 7px 12px; flex-wrap: wrap; gap: 5px 10px; text-align: center; }
  .app-shell { display: block; min-height: auto; }
  .sidebar { display: none; }
  .main { padding: 0 16px 35px; }
  .topbar { min-height: 92px; align-items: end; padding: 18px 0 14px; }
  .topbar .eyebrow { display: none; }
  .topbar h1 { font-size: 1.65rem; }
  .role-switch { display: none; }
  .view { padding-top: 22px; }
  .command-grid, .dashboard-lower, .case-grid, .action-grid { grid-template-columns: 1fr; }
  .command-card { min-height: 210px; padding: 24px; }
  .role-map { grid-template-columns: 1fr; }
  .role-center { min-height: 130px; }
  .progress-meta { align-items: flex-start; flex-direction: column; }
  .section-intro, .report-head { align-items: stretch; }
  .course-score { min-width: 82px; }
  .module-item { grid-template-columns: 44px 1fr; }
  .module-status { grid-column: 2; }
  .exam-card { align-items: flex-start; flex-direction: column; }
  .stepper { grid-template-columns: repeat(5, 44px); justify-content: space-between; }
  .step { padding: 8px; }
  .step { font-size: 0; }
  .step span { font-size: .77rem; }
  .form-step { padding: 20px 16px; }
  .form-grid.two, .form-grid.three, .role-choice { grid-template-columns: 1fr; }
  .dynamic-row { grid-template-columns: 1fr 80px 1.3fr 42px; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions > div { display: grid; grid-template-columns: 1fr 1fr; }
  .form-actions > #prev-step { align-self: flex-start; }
  .preview-grid { grid-template-columns: 1fr 1fr; }
  .vendor-controls { grid-template-columns: 1fr; }
  .vendor-item { grid-template-columns: 1fr; }
  .vendor-phone { justify-self: start; }
  .mobile-nav { position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; height: 68px; padding: 5px 8px env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); background: rgba(255,255,255,.97); backdrop-filter: blur(12px); }
  .mobile-nav button { border: 0; display: grid; place-items: center; align-content: center; gap: 1px; color: var(--muted); background: transparent; font-size: .67rem; }
  .mobile-nav button span { font-size: 1.25rem; }
  .mobile-nav button.active { color: var(--red); font-weight: 800; }
  .toast { left: 15px; right: 15px; bottom: 82px; text-align: center; }
  .course-portal { padding: 0 18px 38px; }
  .portal-header { min-height: 86px; }
  .portal-label { display: none; }
  .portal-intro { padding: 38px 0 26px; }
  .portal-intro h1 { font-size: 2.65rem; }
  .course-library { grid-template-columns: 1fr; }
  .portal-course-card { min-height: 350px; border-radius: 20px; }
  .portal-course-card.future { min-height: 255px; }
  .onboarding-layout { display: block; }
  .onboarding-sidebar { padding: 23px 16px 14px; }
  .onboarding-sidebar h1 { font-size: 1.65rem; }
  .onboarding-sidebar > p { margin-bottom: 14px; }
  .onboarding-nav { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
  .onboarding-nav > strong { min-width: max-content; margin: 10px 2px 0; align-self: center; }
  .onboarding-nav button { min-width: max-content; grid-template-columns: 23px auto; scroll-snap-align: start; background: rgba(255,255,255,.05); }
  .onboarding-content { padding: 28px 15px 45px; }
  .onboarding-copy-grid, .onboarding-module-grid { grid-template-columns: 1fr; }
  .area-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .area-card:last-child { grid-column: 1 / -1; }
  .equipment-header { min-height: 76px; padding: 0 16px; grid-template-columns: 1fr auto; }
  .equipment-header .portal-brand { justify-self: end; }
  .equipment-header .portal-brand small,
  .equipment-report-link { display: none; }
  .equipment-layout { display: block; min-height: auto; }
  .equipment-sidebar { padding: 25px 18px 18px; }
  .equipment-sidebar h1 { margin-bottom: 8px; font-size: 1.75rem; }
  .equipment-sidebar > p { margin-bottom: 16px; }
  .equipment-chapters { margin-top: 18px; display: flex; gap: 8px; overflow-x: auto; padding-bottom: 5px; scroll-snap-type: x proximity; }
  .equipment-chapter { min-width: 185px; grid-template-columns: 25px 1fr; scroll-snap-align: start; background: rgba(255,255,255,.06); }
  .equipment-main { padding: 22px 12px 34px; }
  .equipment-toolbar { padding: 0 4px; align-items: center; }
  .equipment-slide-title { font-size: 1rem; }
  .equipment-toolbar .eyebrow { font-size: .65rem; }
  .equipment-stage { border-radius: 9px; }
  .equipment-controls { position: sticky; bottom: 8px; z-index: 4; margin-top: 15px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); box-shadow: 0 10px 35px rgba(16,28,44,.14); }
  .equipment-controls button { min-width: 0; flex: 1; }
}

@media (max-width: 480px) {
  .section-intro { flex-direction: column; }
  .course-score { align-self: flex-start; display: flex; gap: 6px; align-items: baseline; }
  .dynamic-row { grid-template-columns: 1fr 64px 42px; }
  .dynamic-row input:nth-child(3) { grid-column: 1 / -1; grid-row: 2; }
  .preview-grid { grid-template-columns: 1fr; }
  #dialog-content { padding: 25px 20px; }
  .dialog-hero { margin: -25px -20px 24px; padding: 28px 62px 26px 20px; }
  .action-card { min-height: 158px; }
  .action-alert { padding: 14px; }
}

@media print {
  body { background: #fff; }
  .course-portal, .equipment-course, .prototype-banner, .sidebar, .topbar, .mobile-nav, .stepper, .form-actions, .report-head, .form-step:not([data-form-step="5"]), #validation-summary { display: none !important; }
  .app-shell, .main { display: block; padding: 0; }
  .view { display: none !important; }
  #report.view, #report .form-step[data-form-step="5"] { display: block !important; padding: 0; border: 0; }
  .report-preview { padding: 0; border: 0; }
  .preview-table { font-size: 10pt; }
}
