@import url("https://fonts.googleapis.com/css2?family=Bodoni+Moda:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Dancing+Script:wght@400;500;600;700&family=Oswald:wght@400;500;600;700&family=Raleway:wght@100;200;300;400&display=swap");

/* ===============================
   ONDECK COLOR PALETTE
=============================== */
:root {
  --color-bg: #f5f7f9;          /* light page background */
  --color-card: #f8fafc;        /* card surface */
  --color-card-active: #effaf4; /* subtle active tint */
  --color-border: #e2e8f0;      /* subtle border for separation */
  --color-accent: #56b2bb;      /* buttons / toggles / highlights */
  --color-text: #1f2937;        /* main text */
  --color-muted: #64748b;       /* secondary text */
  --color-dark: #0b1426;        /* nav/footer background */
  --color-nav: rgba(11, 20, 38, 0.85);
  --color-nav-border: rgba(255, 255, 255, 0.12);
  --status-in: #22c55e;
  --status-in-light: #5de292;
  --status-out: #94a3b8;
  --splash-bg: #0b1220;
  --splash-foreground: #ffffff;
  --splash-muted: rgba(148, 163, 184, 0.9);
  --splash-accent: #28b7bf;
  --splash-glow: #18aeb4;
  --board-edge: clamp(36px, 5vw, 72px);
  --shadow-card: 0 2px 8px -2px rgba(15, 23, 42, 0.08),
                 0 10px 24px -12px rgba(15, 23, 42, 0.14);
}

/* ===============================
   GLOBAL LAYOUT
=============================== */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body {
  margin: 0;
  font-family: "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  -webkit-font-smoothing: antialiased;
  font-optical-sizing: auto;
  font-synthesis: none;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

body.safety-modal-open {
  overflow: hidden;
}

body.visitor-wizard-open {
  overflow: hidden;
}

body.visitor-wizard-open main,
body.visitor-wizard-open .board-shell {
  visibility: hidden;
}

body.visitor-wizard-open .floating-nav,
body.visitor-wizard-open .floating-action-btn {
  display: none;
}

body.ios-standalone .floating-nav {
  bottom: calc(16px + env(safe-area-inset-bottom, 0));
}

.ondock-waves {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ondock-waves::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(86, 178, 187, 0.28), rgba(86, 178, 187, 0.12));
  background-repeat: repeat;
  background-size: cover;
  opacity: 0.3;
}

.ondeck-wave {
  position: absolute;
  width: 140%;
  height: 220px;
  left: -20%;
  border-radius: 50%;
  opacity: 0.6;
  animation: ondeck-drift 22s infinite ease-in-out;
}

.ondeck-wave--back {
  bottom: -70px;
  background: linear-gradient(90deg, transparent, rgba(86, 178, 187, 0.18), transparent);
  animation-duration: 28s;
}

.ondeck-wave--mid {
  bottom: -40px;
  background: linear-gradient(90deg, transparent, rgba(86, 178, 187, 0.3), transparent);
}

.ondeck-wave--front {
  bottom: -20px;
  background: linear-gradient(90deg, transparent, rgba(86, 178, 187, 0.45), transparent);
  animation-duration: 16s;
}

@keyframes ondeck-drift {
  0%, 100% { transform: translateY(0) translateX(0) scaleX(1); }
  50% { transform: translateY(-35px) translateX(25px) scaleX(1.04); }
}


.welcome-screen {
  position: fixed;
  inset: 0;
  z-index: 300;
  color: #f5faff;
  display: flex;
  align-items: stretch;
  justify-content: center;
  text-align: center;
  opacity: 1;
  transition: opacity 0.18s ease;
  /* Fallback gradient while background images load */
  background: linear-gradient(135deg, #0b1e2e 0%, #0d2a3d 50%, #0f3347 100%);
  /* --ui-unit = the on-screen size of one "reference pixel". Every
     welcome-screen dimension below is sized as calc(<reference px> *
     var(--ui-unit)), so the whole composition scales as ONE proportional
     unit and looks identical on every iPad regardless of logical
     resolution. Reference design is a 1024x768 (classic landscape iPad);
     min() picks the limiting dimension so it "contains" in either
     orientation. At exactly 1024x768, --ui-unit == 1px (look unchanged);
     on a 13" (1366x1024 landscape) it's ~1.33, on a Mini ~0.97, etc.
     The admin preview sets the same variable from its box size so the
     preview is faithful. Plan: roll this --ui-unit pattern out to the
     rest of the iPad app — see ipad-ui-scale-unification memory. */
  --ui-unit: min(calc(100vw / 1024), calc(100vh / 768));
  /* Default pill chrome (used by .welcome-security and any future pill).
     Each design can override via its own --w-pill-* tokens; these defaults
     match Classic (frosted white, suitable over the photo). */
  --w-pill-bg: rgba(255, 255, 255, 0.14);
  --w-pill-border: rgba(255, 255, 255, 0.22);
  --w-pill-fg: #fff;
}

.welcome-screen.hidden {
  display: none;
}

.welcome-screen.is-fading {
  opacity: 0;
}

.welcome-screen__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: #0b172a;
  opacity: 0;
  transition: none;
}

.welcome-screen__bg.is-visible {
  opacity: 1;
}

.welcome-screen__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.05) 45%, rgba(0, 0, 0, 0.6));
}

.welcome-screen__content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: calc(1100 * var(--ui-unit));
  padding: calc(32 * var(--ui-unit) + env(safe-area-inset-top, 0))
    calc(36 * var(--ui-unit) + env(safe-area-inset-right, 0))
    calc(28 * var(--ui-unit) + env(safe-area-inset-bottom, 0))
    calc(36 * var(--ui-unit) + env(safe-area-inset-left, 0));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: calc(20 * var(--ui-unit));
  margin: 0 auto;
}

/* ========== Security level pill — ONE reusable design across every welcome
   screen. Tappable read-only badge for the current ISPS level. The pill
   chrome (background / border / label colour) comes from --w-pill-*
   tokens set per design; the level indicator (dot + filled number badge)
   is coloured by --sl-color (the live security-level colour set by JS).
   Sits in flow at the top of the welcome content. Horizontal placement
   is controlled by --left/--center/--right via align-self. */
.welcome-security {
  position: static;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: calc(10 * var(--ui-unit));
  padding: calc(5 * var(--ui-unit)) calc(6 * var(--ui-unit)) calc(5 * var(--ui-unit)) calc(14 * var(--ui-unit));
  border-radius: 999px;
  background: var(--w-pill-bg, rgba(255, 255, 255, 0.14));
  border: 1px solid var(--w-pill-border, rgba(255, 255, 255, 0.22));
  color: var(--w-pill-fg, #fff);
  backdrop-filter: blur(calc(14 * var(--ui-unit)));
  -webkit-backdrop-filter: blur(calc(14 * var(--ui-unit)));
  box-shadow: none;
  cursor: pointer;
}
.welcome-security:active { transform: scale(0.97); }
.welcome-security.hidden { display: none; }
/* Horizontal placement (in flow now) — set from welcome-config security_position. */
.welcome-security--left   { align-self: flex-start; }
.welcome-security--center { align-self: center; }
.welcome-security--right  { align-self: flex-end; }
/* Glass/solid modifiers no longer drive the chrome (tokens do); kept as
   no-ops for backwards-compat with the JS that still toggles them. */
.welcome-security--glass, .welcome-security--solid { /* no-op */ }
/* Small coloured dot at the start of the pill (security level colour). */
.welcome-security::before {
  content: "";
  width: calc(8 * var(--ui-unit));
  height: calc(8 * var(--ui-unit));
  border-radius: 50%;
  background: var(--sl-color, #10b981);
  flex: none;
}
.welcome-security__meta {
  display: inline-flex;
  align-items: center;
}
.welcome-security__label {
  font-size: calc(11 * var(--ui-unit));
  letter-spacing: calc(1.6 * var(--ui-unit));
  text-transform: uppercase;
  font-weight: 600;
  color: inherit;
}
/* Filled rounded badge with the level number — the prominent indicator. */
.welcome-security__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  place-items: center;
  min-width: calc(26 * var(--ui-unit));
  height: calc(26 * var(--ui-unit));
  padding: 0 calc(7 * var(--ui-unit));
  border-radius: 999px;
  background: var(--sl-color, #10b981);
  color: #fff;
  font-size: calc(13 * var(--ui-unit));
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: 0 calc(1 * var(--ui-unit)) calc(3 * var(--ui-unit)) rgba(0, 0, 0, 0.12);
}
.welcome-security__num::before { content: none !important; }

/* ISPS security notice modal — opened by tapping the security-level
   badge. Permanent legal compliance statement. Dark glass to match the
   welcome screen; sized via its own --ui-unit so it's identical on
   every iPad (it sits above the welcome screen at a higher z-index). */
.isps-notice {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 12, 24, 0.66);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  --ui-unit: min(calc(100vw / 1024), calc(100vh / 768));
}
.isps-notice.hidden { display: none; }
.isps-notice__inner {
  width: min(calc(560 * var(--ui-unit)), 92vw);
  background: linear-gradient(160deg, rgba(18, 32, 52, 0.97), rgba(11, 22, 38, 0.97));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: calc(24 * var(--ui-unit));
  padding: calc(38 * var(--ui-unit)) calc(36 * var(--ui-unit)) calc(32 * var(--ui-unit));
  color: #f5faff;
  text-align: center;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
}
.isps-notice__crest {
  display: inline-flex;
  align-items: center;
  gap: calc(12 * var(--ui-unit));
  margin-bottom: calc(18 * var(--ui-unit));
}
.isps-notice__num {
  display: grid;
  place-items: center;
  width: calc(48 * var(--ui-unit));
  height: calc(48 * var(--ui-unit));
  border-radius: calc(14 * var(--ui-unit));
  background: var(--sl-color, #16A34A);
  color: #fff;
  font-size: calc(26 * var(--ui-unit));
  font-weight: 800;
  letter-spacing: -0.02em;
}
.isps-notice__crest-label {
  font-size: calc(13 * var(--ui-unit));
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.72);
}
.isps-notice__title {
  margin: 0 0 calc(14 * var(--ui-unit));
  font-size: calc(30 * var(--ui-unit));
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #F9522E;   /* brand coral / signal red — was inheriting an invisible blue */
}
.isps-notice__body {
  margin: 0;
  font-size: calc(16 * var(--ui-unit));
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.86);
}
.isps-notice__body strong { color: #fff; font-weight: 700; }
.isps-notice__close {
  margin-top: calc(28 * var(--ui-unit));
  padding: calc(12 * var(--ui-unit)) calc(40 * var(--ui-unit));
  border-radius: calc(14 * var(--ui-unit));
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: calc(16 * var(--ui-unit));
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.isps-notice__close:active { transform: scale(0.97); }

.welcome-screen__branding {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(16 * var(--ui-unit));
}

.welcome-screen__logo {
  max-width: calc(360 * var(--ui-unit));
  max-height: calc(200 * var(--ui-unit));
  object-fit: contain;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.45));
}

/* Headline font is driven by data-welcome-font (the admin font picker) so the
   choice applies on EVERY design. Each font sets its own family + natural
   weight/style/transform; the design controls size/colour/spacing. Default =
   Bricolage Grotesque. The 4 admin fonts + Serif are all selectable. */
.welcome-screen[data-welcome-font="default"] { --w-headline-font: "Bricolage Grotesque", Inter, sans-serif; --w-headline-weight: 600; --w-headline-style: normal; --w-headline-transform: none; }
.welcome-screen[data-welcome-font="classic"] { --w-headline-font: "Bodoni Moda", "Times New Roman", serif; --w-headline-weight: 500; --w-headline-style: italic; --w-headline-transform: none; }
.welcome-screen[data-welcome-font="modern"]  { --w-headline-font: "Raleway", "Helvetica Neue", Arial, sans-serif; --w-headline-weight: 700; --w-headline-style: normal; --w-headline-transform: none; }
.welcome-screen[data-welcome-font="bold"]    { --w-headline-font: "Oswald", "Helvetica Neue", Arial, sans-serif; --w-headline-weight: 600; --w-headline-style: normal; --w-headline-transform: uppercase; }
.welcome-screen[data-welcome-font="script"]  { --w-headline-font: "Dancing Script", "Brush Script MT", cursive; --w-headline-weight: 600; --w-headline-style: normal; --w-headline-transform: none; }
.welcome-screen[data-welcome-font="serif"]   { --w-headline-font: "Fraunces", "Instrument Serif", serif; --w-headline-weight: 400; --w-headline-style: italic; --w-headline-transform: none; }

.welcome-screen__title {
  margin: 0;
  font-family: var(--w-headline-font, "Bricolage Grotesque", Inter, sans-serif);
  font-weight: var(--w-headline-weight, 600);
  font-style: var(--w-headline-style, normal);
  text-transform: var(--w-headline-transform, none);
  font-size: calc(var(--welcome-title-scale, 1) * 60 * var(--ui-unit));
  letter-spacing: 0.06em;
  text-shadow: 0 18px 30px rgba(0, 0, 0, 0.45);
}

.welcome-yacht {
  font-size: calc(24 * var(--ui-unit));
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.welcome-screen__cta {
  display: flex;
  justify-content: center;
}

.welcome-cta {
  --welcome-cta-scale: 1;
  border: 1px solid transparent;
  border-radius: calc(22 * var(--ui-unit) * var(--welcome-cta-scale));
  padding: calc(12 * var(--ui-unit) * var(--welcome-cta-scale)) calc(26 * var(--ui-unit) * var(--welcome-cta-scale));
  font-size: calc(16 * var(--ui-unit) * var(--welcome-cta-scale));
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.welcome-cta--glass {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 18px 28px rgba(15, 23, 42, 0.35);
}

.welcome-cta--solid {
  background: #fff;
  color: #334155;
  border-color: rgba(226, 232, 240, 0.9);
  box-shadow: 0 18px 28px rgba(15, 23, 42, 0.3);
}

.welcome-screen__actions {
  width: 100%;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: calc(24 * var(--ui-unit));
  padding-bottom: calc(10 * var(--ui-unit));
}

/* Crew-only device mode: strip the visitor buttons; the whole
   screen becomes a tap target to enter the app. Branding,
   background, ship's time and the security badge stay. */
.welcome-screen--crew .welcome-screen__cta,
.welcome-screen--crew .welcome-screen__actions {
  display: none;
}
.welcome-screen--crew { cursor: pointer; }
.welcome-screen--crew .welcome-screen__content::after {
  content: "Tap anywhere to open";
  margin-top: 16px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

/* Crew display — rotating glass panels (notices + weather) */
.crew-display { position: relative; width: min(640px, 86vw); margin: 8px auto 0; }
.crew-display.hidden { display: none; }
.crew-panel {
  display: none;
  flex-direction: column;
  gap: 12px;
  min-height: 168px;
  padding: 26px 28px;
  border-radius: 20px;
  text-align: left;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
}
.crew-panel.is-active { display: flex; animation: crewFade 0.35s ease; }
@keyframes crewFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.crew-panel--pinned { border-color: rgba(255, 255, 255, 0.55); }
.crew-panel__kicker {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}
.crew-panel__body {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.crew-panel__meta {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: auto;
}
.crew-wx { display: flex; flex-wrap: wrap; gap: 16px 30px; }
.crew-wx__item { display: flex; flex-direction: column; gap: 3px; }
.crew-wx__v { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; }
.crew-wx__l {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.62);
}
.crew-display__dots {
  display: flex;
  gap: 7px;
  justify-content: center;
  margin-top: 14px;
}
.crew-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
}
.crew-dot.is-on { background: #fff; }

/* Tide curve panel (glass) */
.crew-tide { width: 100%; height: 132px; display: block; overflow: visible; }
.crew-tide__area { fill: rgba(255, 255, 255, 0.18); stroke: none; }
.crew-tide__line {
  fill: none;
  stroke: #fff;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.crew-tide__ex-dot { fill: rgba(255, 255, 255, 0.85); }
.crew-tide__nowline {
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 1.5;
  stroke-dasharray: 3 4;
  vector-effect: non-scaling-stroke;
}
.crew-tide__now {
  fill: var(--color-accent, #2DBDC6);
  stroke: #fff;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}
.crew-tide__exrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 12px;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.85);
}
.crew-tide__ex b {
  font-weight: 800;
  color: #fff;
  margin-right: 4px;
}

.welcome-action {
  width: calc(110 * var(--ui-unit));
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(8 * var(--ui-unit));
  font-size: calc(15 * var(--ui-unit));
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.14s ease, opacity 0.14s ease;
  transform: translateY(0) scale(1);
  opacity: 1;
}

.welcome-action.is-pressed {
  transform: translateY(2px) scale(0.96);
  opacity: 0.75;
}

.welcome-action__icon svg {
  width: calc(26 * var(--ui-unit));
  height: calc(26 * var(--ui-unit));
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.welcome-action--glass {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: calc(16 * var(--ui-unit));
  padding: calc(10 * var(--ui-unit)) calc(16 * var(--ui-unit));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.welcome-action--solid {
  background: #fff;
  color: #334155;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: calc(16 * var(--ui-unit));
  padding: calc(10 * var(--ui-unit)) calc(16 * var(--ui-unit));
}

.font-classic {
  font-family: "Bodoni Moda", "Times New Roman", serif;
  font-style: italic;
}

.font-modern {
  font-family: "Raleway", "Helvetica Neue", Arial, sans-serif;
}

.font-bold-display {
  font-family: "Oswald", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.font-script {
  font-family: "Dancing Script", "Brush Script MT", cursive;
  font-weight: 600;
}

.font-default {
  font-family: "Bricolage Grotesque", Inter, sans-serif;
  font-weight: 600;
}

.font-serif {
  font-family: "Fraunces", "Instrument Serif", serif;
  font-style: italic;
}

/* (Removed the max-width:720px web-era overrides — the app is iPad-only
   now and --ui-unit handles all sizing proportionally, so the fixed-px
   overrides here were both dead for iPads and contradicted the scale
   approach.) */

/* ==========================================================
   WELCOME SCREEN DESIGN THEMES (Types 1-4)
   Classic = the photo/carousel screen above (no data attribute).
   The four below are CSS skins keyed on [data-welcome-design], over the
   SAME markup + behaviour. Every size uses --ui-unit so each design is
   identical on every iPad. Per-design colours live in CSS-var tokens
   (--w-*) so the shared structural rules stay DRY. See
   ipad-welcome-designs memory. Glass vs solid = [data-welcome-glass].
   ========================================================== */

/* The enriched markup's extra bits are hidden by default (Classic). The
   two column wrappers are display:contents everywhere except Color, so
   on Classic + the single-column designs they're layout-transparent and
   their children behave exactly as if the wrappers weren't there. */
.welcome-col { display: contents; }
.welcome-action__text,
.welcome-cta__text { display: contents; }
.welcome-action__sub,
.welcome-action__arrow,
.welcome-cta__arrow,
.welcome-cta__sub,
.welcome-cta__icon { display: none; }

/* ---------- Per-design colour tokens ---------- */
.welcome-screen[data-welcome-design="light"] {
  --w-bg: radial-gradient(120% 80% at 50% 0%, #ffffff 0%, #f2f4f7 100%);
  --w-text: #0f172a; --w-muted: #475569; --w-dot: #10b981;
  --w-pill-fg: #475569; --w-pill-bg: rgba(15,23,42,0.04); --w-pill-border: rgba(15,23,42,0.08);
  --w-card-bg: #ffffff; --w-card-border: rgba(0,0,0,0.08); --w-card-backdrop: none;
  --w-icon-bg: rgba(15,23,42,0.05);
  --w-cta-bg: #0f172a; --w-cta-fg: #ffffff; --w-cta-shadow: 0 calc(14*var(--ui-unit)) calc(40*var(--ui-unit)) rgba(15,23,42,0.25);
  --w-headline-size: 84;  /* headline font now via data-welcome-font */
  --w-body-font: Inter, sans-serif; --w-label-font: Inter, sans-serif; --w-label-style: normal;
}
.welcome-screen[data-welcome-design="light"][data-welcome-glass="true"] {
  --w-card-bg: rgba(255,255,255,0.6); --w-card-border: rgba(0,0,0,0.06); --w-card-backdrop: blur(calc(14*var(--ui-unit)));
}
.welcome-screen[data-welcome-design="dark"] {
  --w-bg: radial-gradient(120% 80% at 50% 0%, #16181d 0%, #0a0b0d 100%);
  --w-text: #f1f5f9; --w-muted: #94a3b8; --w-dot: #34d399;
  --w-pill-fg: #cbd5e1; --w-pill-bg: rgba(255,255,255,0.06); --w-pill-border: rgba(255,255,255,0.10);
  --w-card-bg: #15171c; --w-card-border: rgba(255,255,255,0.07); --w-card-backdrop: none;
  --w-icon-bg: rgba(255,255,255,0.06);
  --w-cta-bg: #f1f5f9; --w-cta-fg: #0a0b0d; --w-cta-shadow: 0 calc(14*var(--ui-unit)) calc(40*var(--ui-unit)) rgba(0,0,0,0.5);
  --w-headline-size: 84;  /* headline font now via data-welcome-font */
  --w-body-font: Inter, sans-serif; --w-label-font: Inter, sans-serif; --w-label-style: normal;
}
.welcome-screen[data-welcome-design="dark"][data-welcome-glass="true"] {
  --w-card-bg: rgba(255,255,255,0.04); --w-card-border: rgba(255,255,255,0.08); --w-card-backdrop: blur(calc(14*var(--ui-unit)));
}
.welcome-screen[data-welcome-design="serif"] {
  --w-bg: radial-gradient(120% 80% at 50% 0%, #fbf5e9 0%, #f1e7d2 100%);
  --w-text: #1c1814; --w-muted: rgba(28,24,20,0.65); --w-dot: #b45309;
  --w-pill-fg: #475569; --w-pill-bg: rgba(15,23,42,0.04); --w-pill-border: rgba(15,23,42,0.08);
  --w-card-bg: #fffaf2; --w-card-border: rgba(60,40,30,0.10); --w-card-backdrop: none;
  --w-icon-bg: rgba(28,24,20,0.06);
  --w-cta-bg: #1c1814; --w-cta-fg: #fbf5e9; --w-cta-shadow: 0 calc(14*var(--ui-unit)) calc(36*var(--ui-unit)) rgba(28,24,20,0.25);
  --w-headline-size: 84;  /* unified with Light/Dark so all designs share one headline size */
  --w-body-font: "Fraunces", serif; --w-label-font: "Fraunces", serif; --w-label-style: italic;
}
.welcome-screen[data-welcome-design="serif"][data-welcome-glass="true"] {
  --w-card-bg: rgba(255,255,255,0.55); --w-card-border: rgba(60,40,30,0.08); --w-card-backdrop: blur(calc(14*var(--ui-unit)));
}

/* ---------- Shared single-column layout (Light/Dark/Serif) ---------- */
.welcome-screen:is([data-welcome-design="light"],[data-welcome-design="dark"],[data-welcome-design="serif"]) {
  background: var(--w-bg);
  color: var(--w-text);
}
.welcome-screen:is([data-welcome-design="light"],[data-welcome-design="dark"],[data-welcome-design="serif"]) .welcome-screen__bg,
.welcome-screen:is([data-welcome-design="light"],[data-welcome-design="dark"],[data-welcome-design="serif"]) .welcome-screen__overlay {
  display: none;  /* these designs use a gradient, not the photo */
}
.welcome-screen:is([data-welcome-design="light"],[data-welcome-design="dark"],[data-welcome-design="serif"]) .welcome-screen__content {
  justify-content: flex-start;
  gap: 0;
  padding: calc(48 * var(--ui-unit) + env(safe-area-inset-top, 0))
           calc(80 * var(--ui-unit) + env(safe-area-inset-right, 0))
           calc(48 * var(--ui-unit) + env(safe-area-inset-bottom, 0))
           calc(80 * var(--ui-unit) + env(safe-area-inset-left, 0));
}
/* security pill — spec look: dot + LABEL · N */
/* (Light/Dark/Serif security overrides removed — the unified base pill
   uses each design's --w-pill-* tokens directly.) */
/* branding + headline + body */
.welcome-screen:is([data-welcome-design="light"],[data-welcome-design="dark"],[data-welcome-design="serif"]) .welcome-screen__branding {
  flex: 0 0 auto; margin-top: calc(36 * var(--ui-unit)); gap: calc(14 * var(--ui-unit));
}
.welcome-screen:is([data-welcome-design="light"],[data-welcome-design="dark"],[data-welcome-design="serif"]) .welcome-screen__title {
  font-family: var(--w-headline-font); font-weight: var(--w-headline-weight); font-style: var(--w-headline-style);
  text-transform: var(--w-headline-transform, none);
  font-size: calc(var(--welcome-title-scale, 1) * var(--w-headline-size) * var(--ui-unit));
  letter-spacing: -0.04em; line-height: 0.95; color: var(--w-text); text-shadow: none;
  max-width: 100%; overflow-wrap: break-word;
}
/* (Removed the decorative "." that the original handoff appended via ::after
   — users couldn't delete it from the welcome text input.) */
.welcome-screen:is([data-welcome-design="light"],[data-welcome-design="dark"],[data-welcome-design="serif"]) .welcome-body {
  display: block; margin: 0; max-width: calc(540 * var(--ui-unit));
  font-family: var(--w-body-font); font-size: calc(18 * var(--ui-unit)); line-height: 1.5;
  color: var(--w-muted); text-align: center;
}
/* primary CTA — pill + trailing arrow */
.welcome-screen:is([data-welcome-design="light"],[data-welcome-design="dark"],[data-welcome-design="serif"]) .welcome-screen__cta {
  margin-top: calc(36 * var(--ui-unit));
}
.welcome-screen:is([data-welcome-design="light"],[data-welcome-design="dark"],[data-welcome-design="serif"]) .welcome-cta {
  background: var(--w-cta-bg) !important; color: var(--w-cta-fg);
  border: none; border-radius: 999px; opacity: 1 !important;
  padding: calc(20 * var(--ui-unit)) calc(40 * var(--ui-unit));
  font-family: var(--w-body-font); font-size: calc(20 * var(--ui-unit)); font-weight: 600;
  display: inline-flex; align-items: center; gap: calc(14 * var(--ui-unit));
  backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: var(--w-cta-shadow);
}
.welcome-screen:is([data-welcome-design="light"],[data-welcome-design="dark"],[data-welcome-design="serif"]) .welcome-cta__arrow {
  display: inline-flex;
}
.welcome-screen:is([data-welcome-design="light"],[data-welcome-design="dark"],[data-welcome-design="serif"]) .welcome-cta__arrow svg {
  width: calc(20 * var(--ui-unit)); height: calc(20 * var(--ui-unit));
  stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
/* bottom 2-card row */
.welcome-screen:is([data-welcome-design="light"],[data-welcome-design="dark"],[data-welcome-design="serif"]) .welcome-screen__actions {
  margin-top: auto; gap: calc(18 * var(--ui-unit)); width: 100%; max-width: calc(720 * var(--ui-unit));
  align-self: center;
}
.welcome-screen:is([data-welcome-design="light"],[data-welcome-design="dark"],[data-welcome-design="serif"]) .welcome-action {
  flex: 1; flex-direction: row; align-items: center; gap: calc(16 * var(--ui-unit));
  width: auto; text-align: left; opacity: 1 !important;
  background: var(--w-card-bg); border: 1px solid var(--w-card-border);
  backdrop-filter: var(--w-card-backdrop); -webkit-backdrop-filter: var(--w-card-backdrop);
  border-radius: calc(18 * var(--ui-unit)); padding: calc(20 * var(--ui-unit)) calc(22 * var(--ui-unit));
  color: var(--w-text);
}
.welcome-screen:is([data-welcome-design="light"],[data-welcome-design="dark"],[data-welcome-design="serif"]) .welcome-action__icon {
  width: calc(46 * var(--ui-unit)); height: calc(46 * var(--ui-unit)); border-radius: calc(14 * var(--ui-unit));
  background: var(--w-icon-bg); display: grid; place-items: center; flex: none;
}
.welcome-screen:is([data-welcome-design="light"],[data-welcome-design="dark"],[data-welcome-design="serif"]) .welcome-action__icon svg {
  width: calc(20 * var(--ui-unit)); height: calc(20 * var(--ui-unit));
}
.welcome-screen:is([data-welcome-design="light"],[data-welcome-design="dark"],[data-welcome-design="serif"]) .welcome-action__text {
  display: flex; flex-direction: column; align-items: flex-start; flex: 1; gap: calc(2 * var(--ui-unit));
}
.welcome-screen:is([data-welcome-design="light"],[data-welcome-design="dark"],[data-welcome-design="serif"]) .welcome-action__label {
  font-family: var(--w-label-font); font-style: var(--w-label-style);
  font-size: calc(18 * var(--ui-unit)); font-weight: 600; color: var(--w-text);
}
.welcome-screen[data-welcome-design="serif"] .welcome-action__label { font-size: calc(22 * var(--ui-unit)); font-weight: 400; }
.welcome-screen[data-welcome-design="serif"] .welcome-screen__title { font-variation-settings: "opsz" 144; }

/* ---------- Type 4 · Color (two-column accent layout) ---------- */
.welcome-screen[data-welcome-design="color"] { background: #fafafa; color: #0f172a; }
.welcome-screen[data-welcome-design="color"] .welcome-screen__bg,
.welcome-screen[data-welcome-design="color"] .welcome-screen__overlay { display: none; }
.welcome-screen[data-welcome-design="color"] .welcome-screen__content {
  display: grid; grid-template-columns: 0.85fr 1fr; grid-template-rows: 1fr;
  align-items: stretch; height: 100%; padding: 0; gap: 0; max-width: none;
}
/* the two wrappers become the real columns here (display:contents elsewhere) */
.welcome-screen[data-welcome-design="color"] .welcome-col { display: flex; flex-direction: column; }
.welcome-screen[data-welcome-design="color"] .welcome-col--left {
  background: #ff6a3d; color: #fff; position: relative; overflow: hidden;
  padding: calc(48 * var(--ui-unit) + env(safe-area-inset-top, 0))
           calc(44 * var(--ui-unit))
           calc(48 * var(--ui-unit) + env(safe-area-inset-bottom, 0))
           calc(44 * var(--ui-unit) + env(safe-area-inset-left, 0));
}
.welcome-screen[data-welcome-design="color"] .welcome-col--right {
  background: #fafafa; color: #0f172a;
  padding: calc(52 * var(--ui-unit) + env(safe-area-inset-top, 0))
           calc(56 * var(--ui-unit) + env(safe-area-inset-right, 0))
           calc(52 * var(--ui-unit) + env(safe-area-inset-bottom, 0))
           calc(56 * var(--ui-unit));
}
/* Color: anchor the unified pill to the left of the coral column (always),
   regardless of the user's security_position config — the rest of the
   pill chrome comes from --w-pill-* tokens. */
.welcome-screen[data-welcome-design="color"] .welcome-security {
  align-self: flex-start;
  z-index: 1;  /* sits above the decorative accent circle */
}
/* left: headline + body pushed to the bottom */
.welcome-screen[data-welcome-design="color"] .welcome-screen__branding {
  flex: 0 0 auto; margin-top: auto; align-items: flex-start; gap: calc(18 * var(--ui-unit)); z-index: 1;
}
.welcome-screen[data-welcome-design="color"] .welcome-screen__title {
  font-family: var(--w-headline-font); font-weight: var(--w-headline-weight); font-style: var(--w-headline-style);
  text-transform: var(--w-headline-transform, none);
  font-size: calc(var(--welcome-title-scale, 1) * 84 * var(--ui-unit));  /* unified across designs */
  letter-spacing: -0.05em; line-height: 0.9; color: #fff; text-align: left; text-shadow: none;
  max-width: 100%; overflow-wrap: break-word;
}
/* (Removed Color's decorative ::after "." too, for consistency.) */
.welcome-screen[data-welcome-design="color"] .welcome-body {
  display: block; margin: 0; max-width: calc(380 * var(--ui-unit)); text-align: left;
  font-family: Inter, sans-serif; font-size: calc(17 * var(--ui-unit)); line-height: 1.5; color: rgba(255,255,255,0.9);
}
.welcome-screen[data-welcome-design="color"] .welcome-accent-circle {
  display: block; position: absolute; right: calc(-120 * var(--ui-unit)); top: calc(-120 * var(--ui-unit));
  width: calc(320 * var(--ui-unit)); height: calc(320 * var(--ui-unit)); border-radius: 50%;
  background: rgba(255,255,255,0.12); z-index: 0;
}
/* right: welcome-message slot (above the CTA) + footer */
.welcome-screen[data-welcome-design="color"] .welcome-eyebrow {
  display: block;
  font-family: Inter, sans-serif;
  font-size: calc(18 * var(--ui-unit));
  line-height: 1.5;
  color: #64748b;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
  max-width: calc(540 * var(--ui-unit));
}
.welcome-eyebrow[hidden], .welcome-footer[hidden] { display: none !important; }
.welcome-screen[data-welcome-design="color"] .welcome-screen__cta,
.welcome-screen[data-welcome-design="color"] .welcome-screen__actions { display: contents; }
/* primary (visitor-in) card */
.welcome-screen[data-welcome-design="color"] .welcome-cta {
  width: 100%; margin-top: calc(24 * var(--ui-unit));
  background: #ff6a3d !important; color: #fff; border: none; opacity: 1 !important;
  border-radius: calc(18 * var(--ui-unit)); padding: calc(22 * var(--ui-unit)) calc(24 * var(--ui-unit));
  display: flex; align-items: center; gap: calc(18 * var(--ui-unit)); text-align: left;
  font-family: Inter, sans-serif; backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: 0 calc(14 * var(--ui-unit)) calc(36 * var(--ui-unit)) rgba(255,106,61,0.35);
}
.welcome-screen[data-welcome-design="color"] .welcome-cta__icon,
.welcome-screen[data-welcome-design="color"] .welcome-action__icon {
  display: grid; place-items: center; flex: none;
  width: calc(50 * var(--ui-unit)); height: calc(50 * var(--ui-unit)); border-radius: calc(14 * var(--ui-unit));
}
.welcome-screen[data-welcome-design="color"] .welcome-cta__icon { background: rgba(255,255,255,0.18); }
.welcome-screen[data-welcome-design="color"] .welcome-cta__icon svg { width: calc(22 * var(--ui-unit)); height: calc(22 * var(--ui-unit)); stroke: #fff; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.welcome-screen[data-welcome-design="color"] .welcome-cta__text { display: flex; flex-direction: column; align-items: flex-start; flex: 1; gap: calc(2 * var(--ui-unit)); }
.welcome-screen[data-welcome-design="color"] .welcome-cta__label { font-size: calc(21 * var(--ui-unit)); font-weight: 600; letter-spacing: -0.01em; }
.welcome-screen[data-welcome-design="color"] .welcome-cta__sub { display: block; font-size: calc(13 * var(--ui-unit)); opacity: 0.7; }
.welcome-screen[data-welcome-design="color"] .welcome-cta__arrow { display: inline-flex; flex: none; }
.welcome-screen[data-welcome-design="color"] .welcome-cta__arrow svg { width: calc(22 * var(--ui-unit)); height: calc(22 * var(--ui-unit)); stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* crew + visitor-out surface cards */
.welcome-screen[data-welcome-design="color"] .welcome-action {
  flex: none; width: 100%; flex-direction: row; align-items: center; gap: calc(18 * var(--ui-unit));
  text-align: left; opacity: 1 !important; color: #0f172a; margin-top: calc(14 * var(--ui-unit));
  background: #ffffff; border: 1px solid rgba(0,0,0,0.08);
  border-radius: calc(18 * var(--ui-unit)); padding: calc(22 * var(--ui-unit)) calc(24 * var(--ui-unit));
}
.welcome-screen[data-welcome-design="color"][data-welcome-glass="true"] .welcome-action {
  background: rgba(255,255,255,0.7); border-color: rgba(0,0,0,0.06);
  backdrop-filter: blur(calc(14 * var(--ui-unit))); -webkit-backdrop-filter: blur(calc(14 * var(--ui-unit)));
}
.welcome-screen[data-welcome-design="color"] .welcome-action__icon { background: rgba(15,23,42,0.05); }
.welcome-screen[data-welcome-design="color"] .welcome-action__icon svg { width: calc(22 * var(--ui-unit)); height: calc(22 * var(--ui-unit)); stroke: #0f172a; }
.welcome-screen[data-welcome-design="color"] .welcome-action__text { display: flex; flex-direction: column; align-items: flex-start; flex: 1; gap: calc(2 * var(--ui-unit)); }
.welcome-screen[data-welcome-design="color"] .welcome-action__label { font-family: Inter, sans-serif; font-style: normal; font-size: calc(21 * var(--ui-unit)); font-weight: 600; color: #0f172a; }
.welcome-screen[data-welcome-design="color"] .welcome-action__sub { display: block; font-size: calc(13 * var(--ui-unit)); color: #64748b; }
.welcome-screen[data-welcome-design="color"] .welcome-action__arrow { display: inline-flex; flex: none; color: #0f172a; }
.welcome-screen[data-welcome-design="color"] .welcome-action__arrow svg { width: calc(22 * var(--ui-unit)); height: calc(22 * var(--ui-unit)); stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* footer */
.welcome-screen[data-welcome-design="color"] .welcome-footer {
  display: flex; justify-content: space-between; align-items: center; margin-top: auto;
  padding-top: calc(20 * var(--ui-unit)); font-size: calc(12 * var(--ui-unit)); color: #94a3b8;
}
.welcome-screen:is([data-welcome-design="light"],[data-welcome-design="dark"],[data-welcome-design="serif"]) .welcome-action__sub {
  display: block; font-family: Inter, sans-serif; font-size: calc(13 * var(--ui-unit)); color: var(--w-muted);
}
.welcome-screen:is([data-welcome-design="light"],[data-welcome-design="dark"],[data-welcome-design="serif"]) .welcome-action__arrow {
  display: inline-flex; flex: none; color: var(--w-text);
}
.welcome-screen:is([data-welcome-design="light"],[data-welcome-design="dark"],[data-welcome-design="serif"]) .welcome-action__arrow svg {
  width: calc(20 * var(--ui-unit)); height: calc(20 * var(--ui-unit));
  stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Classic · photo background + Type 1/2 button treatment ----------
   Classic keeps the uploaded photo + overlay + centred title (only the
   welcome text/logo changes). The 3 buttons adopt the Type 1/2 look: a
   pill CTA (label + arrow) + two horizontal cards (icon-box + label + sub
   + arrow). Frosted glass is the ONLY style (no solid option — user
   decision); the admin opacity slider still works (inline opacity is left
   alone). Vertical layout mirrors Type 1/2/3 (title near the top, CTA
   below it, the 2-card row pinned to the bottom). All --ui-unit sized so
   it's identical on every iPad. See ipad-welcome-designs. */
/* Layout rhythm — identical to Type 1/2/3. */
.welcome-screen[data-welcome-design="classic"] .welcome-screen__content {
  justify-content: flex-start; gap: 0;
  padding: calc(48 * var(--ui-unit) + env(safe-area-inset-top, 0))
           calc(80 * var(--ui-unit) + env(safe-area-inset-right, 0))
           calc(48 * var(--ui-unit) + env(safe-area-inset-bottom, 0))
           calc(80 * var(--ui-unit) + env(safe-area-inset-left, 0));
}
.welcome-screen[data-welcome-design="classic"] .welcome-screen__branding { flex: 0 0 auto; margin-top: calc(36 * var(--ui-unit)); gap: calc(14 * var(--ui-unit)); }
/* Classic title — match Type 1/2/3 sizing + spacing so the font picker
   renders consistently across designs (base rule had 60 + 0.06em letter-
   spacing, which made the SAME font visibly different on Classic). Keep
   the heavier text-shadow for legibility over the photo. */
.welcome-screen[data-welcome-design="classic"] .welcome-screen__title {
  font-size: calc(var(--welcome-title-scale, 1) * 84 * var(--ui-unit));
  letter-spacing: -0.04em;
  line-height: 0.95;
  max-width: 100%;
  overflow-wrap: break-word;
}
.welcome-screen[data-welcome-design="classic"] .welcome-screen__cta { margin-top: calc(36 * var(--ui-unit)); }
/* Body line is opt-in (admin "Welcome message"). When blank the JS sets
   [hidden]; this !important guard beats the per-design `.welcome-body
   { display:block }` rules so an empty message truly collapses. */
.welcome-body[hidden] { display: none !important; }
/* Classic body line — white over the photo, centred under the title. */
.welcome-screen[data-welcome-design="classic"] .welcome-body {
  display: block; margin: calc(12 * var(--ui-unit)) auto 0; max-width: calc(560 * var(--ui-unit));
  font-family: Inter, sans-serif; font-size: calc(18 * var(--ui-unit)); line-height: 1.5;
  color: rgba(255, 255, 255, 0.92); text-align: center;
  text-shadow: 0 calc(2 * var(--ui-unit)) calc(12 * var(--ui-unit)) rgba(0, 0, 0, 0.5);
}
/* primary CTA — pill + trailing arrow */
.welcome-screen[data-welcome-design="classic"] .welcome-cta {
  border-radius: 999px;
  padding: calc(20 * var(--ui-unit)) calc(40 * var(--ui-unit));
  font-family: Inter, sans-serif; font-size: calc(20 * var(--ui-unit)); font-weight: 600;
  letter-spacing: 0.01em;
  display: inline-flex; align-items: center; gap: calc(14 * var(--ui-unit));
}
.welcome-screen[data-welcome-design="classic"] .welcome-cta__arrow { display: inline-flex; }
.welcome-screen[data-welcome-design="classic"] .welcome-cta__arrow svg {
  width: calc(20 * var(--ui-unit)); height: calc(20 * var(--ui-unit));
  stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
/* bottom 2-card row — pinned to the bottom like Type 1/2/3 */
.welcome-screen[data-welcome-design="classic"] .welcome-screen__actions {
  margin-top: auto; gap: calc(18 * var(--ui-unit)); width: 100%; max-width: calc(720 * var(--ui-unit));
  align-self: center; padding-bottom: 0;
}
.welcome-screen[data-welcome-design="classic"] .welcome-action {
  flex: 1; width: auto; flex-direction: row; align-items: center; gap: calc(16 * var(--ui-unit));
  text-align: left; letter-spacing: normal;
  border-radius: calc(18 * var(--ui-unit)); padding: calc(18 * var(--ui-unit)) calc(20 * var(--ui-unit));
}
.welcome-screen[data-welcome-design="classic"] .welcome-action__icon {
  width: calc(46 * var(--ui-unit)); height: calc(46 * var(--ui-unit)); border-radius: calc(14 * var(--ui-unit));
  display: grid; place-items: center; flex: none;
}
.welcome-screen[data-welcome-design="classic"] .welcome-action__icon svg {
  width: calc(20 * var(--ui-unit)); height: calc(20 * var(--ui-unit));
  stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.welcome-screen[data-welcome-design="classic"] .welcome-action__text {
  display: flex; flex-direction: column; align-items: flex-start; flex: 1; gap: calc(2 * var(--ui-unit));
}
.welcome-screen[data-welcome-design="classic"] .welcome-action__label {
  font-family: Inter, sans-serif; font-size: calc(18 * var(--ui-unit)); font-weight: 600; letter-spacing: normal;
}
.welcome-screen[data-welcome-design="classic"] .welcome-action__sub {
  display: block; font-family: Inter, sans-serif; font-size: calc(13 * var(--ui-unit));
}
.welcome-screen[data-welcome-design="classic"] .welcome-action__arrow { display: inline-flex; flex: none; }
.welcome-screen[data-welcome-design="classic"] .welcome-action__arrow svg {
  width: calc(20 * var(--ui-unit)); height: calc(20 * var(--ui-unit));
  stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
/* Classic surfaces: the 2 action cards + ISPS badge stay frosted glass; the
   primary CTA is a SOLID WHITE pill (dark text) so it drastically stands out
   over the photo, like the themed designs' primary. (Alternatives A "bolder
   frosted" and C "solid dark" are recorded in the ipad-welcome-designs memory.)
   Applied regardless of the glass/solid toggle. */
.welcome-screen[data-welcome-design="classic"] .welcome-cta {
  background: #ffffff !important; color: #0f172a;
  border: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: 0 calc(16 * var(--ui-unit)) calc(42 * var(--ui-unit)) rgba(0, 0, 0, 0.4);
}
.welcome-screen[data-welcome-design="classic"] .welcome-action {
  background: rgba(255, 255, 255, 0.12); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(calc(14 * var(--ui-unit))); -webkit-backdrop-filter: blur(calc(14 * var(--ui-unit)));
}
.welcome-screen[data-welcome-design="classic"] .welcome-action__icon { background: rgba(255, 255, 255, 0.16); }
.welcome-screen[data-welcome-design="classic"] .welcome-action__sub { color: rgba(255, 255, 255, 0.72); }

/* (Classic security overrides removed — uses the unified base pill with
   the default white-frosted --w-pill-* tokens, suitable over the photo.) */

main {
  flex: 1;
  overflow: hidden;
  padding: 0;
}

/* ===============================
   HEADINGS
=============================== */
h2 {
  padding: 20px;
  text-align: center;
  font-weight: 600;
  color: var(--color-dark);
  letter-spacing: 0.5px;
  margin: 0;
}

/* ===============================
   BOARD HEADER + SETTINGS
=============================== */
.board-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.board-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  overscroll-behavior-x: none;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

/* ── Pull-to-Refresh ── */
.pull-refresh-indicator {
  position: absolute;
  top: -60px;
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}

.pull-refresh-spinner {
  width: 24px;
  height: 24px;
  color: var(--color-accent, #56b2bb);
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.pull-refresh-indicator.is-pulling .pull-refresh-spinner {
  opacity: 1;
}

.pull-refresh-indicator.is-refreshing .pull-refresh-spinner {
  opacity: 1;
  animation: pull-refresh-spin 0.8s linear infinite;
}

@keyframes pull-refresh-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.board-section {
  padding: 24px calc(var(--board-edge) + env(safe-area-inset-right, 0px)) calc(140px + env(safe-area-inset-bottom, 0)) calc(var(--board-edge) + env(safe-area-inset-left, 0px));
  box-sizing: border-box;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.board-header {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  grid-template-rows: auto auto;
  align-items: center;
  padding: calc(30px + env(safe-area-inset-top, 0px)) calc(var(--board-edge) + env(safe-area-inset-right, 0px)) 12px calc(var(--board-edge) + env(safe-area-inset-left, 0px));
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.board-header h2 {
  grid-column: 2;
  grid-row: 1;
  padding: 0;
  margin: 0;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
}

/* ── Identity header (pilot: crew board) ─────────────────────────────
   Two-line vessel identity beside the existing home-button card —
   marketing-site typography on the light theme. Sizes use clamp() with
   px floors (NOT --ui-unit: that unit is referenced to 1024x768
   landscape and collapses in portrait — it shrank this header to 12px
   text on an iPad Mini, 2026-06-12). The home button keeps its own
   base styling: it is already the rounded white card of the design. */
.board-header--ident {
  grid-template-columns: auto 1fr 48px;
  column-gap: clamp(14px, 1.6vw, 22px);
}
.board-header--ident h2 { display: none; }
.board-ident {
  grid-column: 2;
  grid-row: 1;
  justify-self: start;
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: clamp(2px, 0.35vw, 5px);
  min-width: 0;
}
.board-ident[hidden] { display: none; }
.board-ident__line1 {
  display: flex;
  align-items: baseline;
  gap: clamp(7px, 0.8vw, 11px);
  min-width: 0;
}
.board-ident__vessel {
  font-size: clamp(17px, 1.8vw, 21px);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.board-ident__context {
  font-size: clamp(12px, 1.25vw, 14px);
  font-weight: 500;
  color: #94a3b8;
  white-space: nowrap;
}
.board-ident__context::before { content: "· "; }
.board-ident__line2 {
  display: flex;
  align-items: center;
  gap: clamp(7px, 0.8vw, 11px);
  font-size: clamp(12.5px, 1.3vw, 14.5px);
  line-height: 1.2;
}
.board-ident__page {
  font-weight: 650;
  letter-spacing: -0.005em;
  color: #334155;
}
.board-ident__status[hidden] { display: none; }
.board-ident__status {
  display: inline-flex;
  align-items: center;
  gap: clamp(5px, 0.55vw, 7px);
  font-weight: 600;
  color: #1f7a52;
}
.board-ident__status::before {
  content: "•";
  color: #cbd5e1;
  font-weight: 400;
  margin-right: clamp(2px, 0.3vw, 4px);
}
.board-ident__dot {
  width: clamp(6px, 0.65vw, 8px);
  height: clamp(6px, 0.65vw, 8px);
  border-radius: 50%;
  background: #2bb673;
}
/* Recording bar owns the header centre — identity steps aside like the h2. */
body.muster-recording .board-ident { visibility: hidden; }

.board-header__muster {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  margin-top: 0;
  padding-bottom: 0;
}

.board-header__muster .muster-emergency {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}

.board-header__muster .muster-emergency-card {
  min-height: 64px;
}

.muster-emergency--header {
  width: 100%;
}

.board-header--muster h2 {
  display: none;
}

.board-header--muster .board-header__muster {
  display: none;
}

.board-header--muster-active .board-header__muster {
  display: flex;
}

.board-header--muster-active .board-header__home,
.board-header--muster-active .board-header__settings {
  opacity: 0.4;
  pointer-events: none;
}

.board-header--muster-active {
  padding-top: calc(1.05rem + env(safe-area-inset-top, 0px));
  padding-bottom: 0.25rem;
}

.board-header--muster-active .board-header__home {
  display: none;
}

.muster-remote-alert {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 15, 25, 0.92);
  z-index: 2000;
  text-align: center;
}

.muster-remote-alert.hidden {
  display: none;
}

.muster-remote-alert__card {
  width: min(880px, 92vw);
  padding: 36px 40px;
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.65);
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 30px 70px rgba(5, 10, 20, 0.45);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.muster-remote-alert__kicker {
  font-size: clamp(1rem, 1.6vw + 0.8rem, 1.6rem);
  letter-spacing: 0.3rem;
  text-transform: uppercase;
  color: #fca5a5;
  font-weight: 700;
}

.muster-remote-alert__message {
  font-size: clamp(1.6rem, 3.4vw + 1rem, 3.4rem);
  text-transform: uppercase;
  color: #ffffff;
  font-weight: 800;
  line-height: 1.15;
}

.board-header__home,
.board-header__settings {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #ffffff;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.board-header__settings.hidden {
  display: none;
}

.board-header__home:active,
.board-header__settings:active {
  transform: scale(0.96);
}

/* ===============================
   CREW SETTINGS MODAL
=============================== */
.crew-settings-modal {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 0;
  z-index: 1000;
  pointer-events: none;
}

.crew-settings-modal.hidden {
  display: none;
}

.crew-settings-modal:not(.hidden) {
  pointer-events: auto;
}

.crew-settings-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: settingsFadeIn 0.2s ease-out;
}

@keyframes settingsFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes settingsSlideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.crew-settings-modal__inner {
  position: relative;
  width: min(360px, 100vw);
  height: 100vh;
  max-height: 100vh;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  box-shadow: -8px 0 40px rgba(15, 23, 42, 0.15);
  display: flex;
  flex-direction: column;
  animation: settingsSlideIn 0.25s ease-out;
}

.crew-settings-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 20px) + 12px) 20px 16px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  flex-shrink: 0;
}

.crew-settings-modal__header-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.crew-settings-modal__icon {
  color: var(--color-accent);
}

.crew-settings-modal__header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.crew-settings-modal__close {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: none;
  background: rgba(15, 23, 42, 0.06);
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  cursor: pointer;
}

.crew-settings-modal__close:hover {
  background: rgba(15, 23, 42, 0.1);
  color: #334155;
}

.crew-settings-modal__close:active {
  transform: scale(0.95);
}

.crew-settings-modal__tabs {
  display: flex;
  gap: 6px;
  padding: 12px 20px;
  background: rgba(241, 245, 249, 0.6);
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  flex-shrink: 0;
}

.crew-settings-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  transition: all 0.15s ease;
  cursor: pointer;
}

.crew-settings-tab svg {
  flex-shrink: 0;
}

.crew-settings-tab:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.8);
  color: #475569;
}

.crew-settings-tab.is-active {
  background: #ffffff;
  color: var(--color-accent);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.crew-settings-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 24px;
}

.crew-settings-modal__panel {
  display: none;
}

.crew-settings-modal__panel--active {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Settings Card */
.crew-settings-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(226, 232, 240, 0.7);
}

.crew-settings-card__header {
  margin-bottom: 14px;
}

.crew-settings-card__title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.crew-settings-card__desc {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.4;
  margin: 0;
}

.crew-settings-card--danger {
  border-color: rgba(220, 38, 38, 0.2);
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.3), rgba(254, 202, 202, 0.1));
}

/* Device info rows */
.crew-settings-device-info {
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.crew-settings-device-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(203, 213, 225, 0.5);
}

.crew-settings-device-row:last-child {
  border-bottom: none;
}

.crew-settings-device-label {
  font-size: 0.85rem;
  color: #64748b;
}

.crew-settings-device-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
}

.crew-settings-device-value--mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.75rem;
  color: #475569;
}

/* Status indicator */
.crew-settings-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
}

.crew-settings-status__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
}

.crew-settings-status__dot--online {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.crew-settings-status__dot--offline {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.crew-settings-status__dot--neutral {
  background: #94a3b8;
}

.crew-settings-status__detail {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.4;
}

/* Settings Field */
.crew-settings-field {
  margin: 14px 0 16px;
  display: grid;
  gap: 8px;
}

.crew-settings-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.crew-settings-select-wrap {
  position: relative;
}

.crew-settings-field select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(203, 213, 225, 0.8);
  padding: 12px 36px 12px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #0f172a;
  background: #f8fafc;
  appearance: none;
  -webkit-appearance: none;
  transition: all 0.15s ease;
  cursor: pointer;
}

.crew-settings-field select:focus {
  outline: none;
  border-color: var(--color-accent);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(86, 178, 187, 0.15);
}

.crew-settings-select-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  pointer-events: none;
}

.crew-settings-field__note {
  margin: 0;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.4;
}

/* Action buttons */
.crew-settings-actions {
  display: flex;
  gap: 10px;
}

.crew-settings-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  border-radius: 12px;
  border: none;
  padding: 12px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--color-accent) 0%, #4da8b3 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(86, 178, 187, 0.3);
  transition: all 0.15s ease;
  cursor: pointer;
}

.crew-settings-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(86, 178, 187, 0.35);
}

.crew-settings-btn:active {
  transform: translateY(0);
}

.crew-settings-btn--ghost {
  background: #f1f5f9;
  color: #334155;
  box-shadow: none;
  border: 1px solid rgba(203, 213, 225, 0.6);
}

.crew-settings-btn--ghost:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.crew-settings-btn--full {
  width: 100%;
  flex: none;
}

.crew-settings-btn--danger {
  background: #fee2e2;
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.3);
}

.crew-settings-btn--danger:hover {
  background: #fecaca;
  border-color: rgba(220, 38, 38, 0.5);
}

.crew-settings-btn--danger:active {
  background: #fca5a5;
}

.crew-settings-btn svg {
  flex-shrink: 0;
}

.crew-settings-helper {
  margin-top: 10px;
  font-size: 0.8rem;
  color: #64748b;
}

.crew-settings-helper:empty {
  display: none;
}

/* Printer/Visitor List */
.crew-settings-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.crew-settings-list.hidden {
  display: none;
}

.crew-settings-list__item {
  border: 1px solid rgba(203, 213, 225, 0.6);
  border-radius: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  text-align: left;
  color: #1e293b;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.15s ease;
  cursor: pointer;
}

.crew-settings-list__item:hover {
  background: #f1f5f9;
  border-color: rgba(148, 163, 184, 0.5);
}

.crew-settings-list__item span {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: #64748b;
  margin-top: 3px;
}

.crew-settings-list__name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.crew-settings-list__tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(86, 178, 187, 0.15);
  color: var(--color-accent);
}

.crew-settings-list__item.is-selected {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.crew-settings-list__item.is-selected .crew-settings-list__tag {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

/* Reprint list items */
.crew-settings-reprint__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.crew-settings-reprint__details {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.crew-settings-reprint__name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crew-settings-reprint__meta {
  font-size: 0.76rem;
  color: #64748b;
}

.crew-settings-reprint__btn {
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--color-accent) 0%, #4da8b3 100%);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.crew-settings-reprint__btn:hover {
  transform: scale(1.02);
}

.crew-settings-reprint__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ===============================
   CREW PIN MODAL
=============================== */
.crew-pin-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 34, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1001;
}

.crew-pin-modal.hidden {
  display: none;
}

.crew-pin-modal__inner {
  width: min(340px, 92vw);
  background: #ffffff;
  border-radius: 18px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.25);
}

.crew-pin-modal__subtitle {
  margin: 8px 0 14px;
  color: #64748b;
  font-size: 0.9rem;
}

.crew-pin-modal__input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 10px 12px;
  font-size: 1rem;
  text-align: center;
  margin-bottom: 8px;
}

.crew-pin-modal__error {
  margin: 0 0 10px;
  color: #dc2626;
  font-size: 0.85rem;
}

.crew-pin-modal__actions {
  display: flex;
  gap: 10px;
}

.crew-pin-modal__btn {
  flex: 1;
  border-radius: 999px;
  border: none;
  padding: 10px 12px;
  background: var(--color-accent);
  color: #ffffff;
  font-weight: 600;
}

.crew-pin-modal__btn--ghost {
  background: #e2e8f0;
  color: #1e293b;
}

/* ===============================
   CREW PHOTO MODAL
=============================== */
.crew-photo-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 34, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 45;
  padding: 16px;
  transition: background 0.25s ease-out;
}

.crew-photo-modal.is-open {
  background: rgba(10, 15, 34, 0.55);
}

.crew-photo-modal.is-closing {
  background: rgba(10, 15, 34, 0);
}

.crew-photo-modal.hidden {
  display: none;
}

.crew-photo-modal__inner {
  width: min(520px, 94%);
  background: #ffffff;
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.25);
  opacity: 0;
  transform: scale(0.92) translateY(20px);
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}

.crew-photo-modal.is-open .crew-photo-modal__inner {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.crew-photo-modal.is-closing .crew-photo-modal__inner {
  opacity: 0;
  transform: scale(0.95) translateY(10px);
}

.crew-photo-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.crew-photo-modal__header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #0f172a;
}

.crew-photo-modal__close {
  border: none;
  background: #e2e8f0;
  color: #1e293b;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
}

.crew-photo-modal__name {
  margin: 0;
  font-weight: 600;
  color: #1f2937;
}

.crew-photo-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crew-photo-flash {
  position: absolute;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
  pointer-events: none;
}

.crew-photo-flash.is-active {
  opacity: 0.85;
}

.crew-photo-countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 700;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.35);
  z-index: 3;
  pointer-events: none;
}

.crew-photo-frame video,
.crew-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.crew-photo-error {
  margin: 0;
  color: #dc2626;
  font-size: 0.9rem;
}

.crew-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.crew-photo-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
}

.crew-photo-btn--ghost {
  background: #e2e8f0;
  color: #1e293b;
}

.crew-photo-btn--timer {
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.crew-photo-btn--timer svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.crew-photo-btn.is-active {
  background: #cbd5f5;
}

.crew-photo-btn--primary {
  background: var(--color-accent);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.crew-photo-btn__icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.crew-photo-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ===============================
   CREW LIST
=============================== */
/* ===============================
   CREW LIST — balanced inset layout
=============================== */
.crew-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 100%;          /* stay inside viewport */
  box-sizing: border-box;
}

.crew-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.crew-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: none;
  background: transparent;
  padding: 4px 2px;
  min-height: 44px;
  cursor: pointer;
}

.crew-section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  font-weight: 600;
  color: #7c8aa0;
}

.crew-section-chevron {
  width: 16px;
  height: 16px;
  color: #94a3b8;
  transition: transform 0.2s ease;
}

.crew-section-toggle[aria-expanded="false"] .crew-section-chevron {
  transform: rotate(-90deg);
}

.crew-section-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: #7c8aa0;
}

.crew-section-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--status-out);
}

.crew-section-dot.is-active {
  background: var(--status-in);
}

.crew-section-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.crew-section-list.is-collapsed {
  display: none;
}

.crew-swipe-shell {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
}

.crew-swipe-shell[data-pending="1"] .crew-card {
  pointer-events: none;
}

.crew-swipe-shell[data-pending="1"] .crew-swipe-action {
  opacity: 0;
  pointer-events: none;
}

.crew-swipe-action {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 96px;
  border: none;
  border-radius: 18px 0 0 18px;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--status-in);
  opacity: 0;
  transform: scale(var(--action-scale, 0.82));
  transform-origin: right center;
  transition: opacity 0.38s ease, transform 0.38s ease;
}

.crew-action-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.crew-action-check {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.crew-swipe-action.is-out {
  background: #ef4444;
}

.crew-swipe-shell[data-revealed="1"] .crew-swipe-action,
.crew-swipe-shell[data-dragging="1"] .crew-swipe-action {
  opacity: 1;
  transform: scale(var(--action-scale, 0.92));
}

.crew-swipe-shell[data-action-pop="1"] .crew-swipe-action {
  animation: crew-action-pop 0.5s ease;
}

.crew-swipe-shell[data-action-confirm="1"][data-action-color="out"] .crew-swipe-action {
  background: #ef4444;
}

.crew-swipe-shell[data-action-confirm="1"][data-action-color="in"] .crew-swipe-action {
  background: var(--status-in);
}

.crew-swipe-shell[data-action-confirm="1"] .crew-action-label {
  opacity: 0;
}

.crew-swipe-shell[data-action-confirm="1"] .crew-action-check {
  opacity: 1;
  transform: scale(1);
  animation: crew-action-check 0.6s ease;
}

@keyframes crew-action-check {
  0% { transform: scale(0.72); }
  45% { transform: scale(1.2); }
  70% { transform: scale(0.98); }
  100% { transform: scale(1.04); }
}

@keyframes crew-action-pop {
  0% { transform: scale(0.86); }
  45% { transform: scale(1.18); }
  70% { transform: scale(0.98); }
  100% { transform: scale(1.06); }
}

.crew-card {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--color-card);
  border-radius: 18px;
  border: 1px solid var(--color-border);
  padding: 12px 14px;
  box-shadow: var(--shadow-card);
  transform: translate3d(0, 0, 0);
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.2s ease,
    background 0.2s ease;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.crew-card.is-active {
  background: var(--color-card-active);
  border-color: rgba(34, 197, 94, 0.2);
}

.crew-card.is-dragging {
  transition: none;
  cursor: grabbing;
}

.crew-card.is-snapping {
  transition-duration: 0.62s;
}

.crew-avatar {
  position: relative;
  width: 46px;
  height: 46px;
  box-sizing: border-box;
  border-radius: 999px;
  padding: 2px;
  background: var(--color-border);
  flex-shrink: 0;
  cursor: pointer;
}

.crew-avatar,
.crew-avatar * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.crew-avatar.is-active {
  background: linear-gradient(135deg, var(--status-in), var(--status-in-light));
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18), 0 10px 18px rgba(34, 197, 94, 0.2);
}

.crew-avatar img,
.crew-avatar .crew-avatar-initials {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 999px;
}

.crew-avatar img {
  object-fit: cover;
  background: #eef2f6;
  display: block;
  z-index: 0;
}

.crew-avatar .crew-avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef2f6;
  color: #475569;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  z-index: 1;
  transition: opacity 0.2s ease;
}

.crew-avatar.has-photo .crew-avatar-initials {
  opacity: 0;
}

.crew-avatar-check {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.85);
  color: #ffffff;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 3;
}

.crew-avatar.is-processing .crew-avatar-check {
  opacity: 1;
  transform: scale(1);
}

.crew-avatar-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--status-in);
  border: 2px solid #fff;
  display: block;
  z-index: 2;
}

.crew-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.crew-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crew-role {
  font-size: 0.78rem;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crew-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.crew-status-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--status-out);
}

.crew-status-label.is-active {
  color: var(--status-in);
}

.crew-status-time {
  font-size: 0.75rem;
  color: #7c8aa0;
}

.visitor-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-card);
  border-radius: 16px;
  border: 1px solid var(--color-border);
  padding: 12px 14px;
  box-shadow: var(--shadow-card);
}

.visitor-card[data-active="1"] {
  background: var(--color-card-active);
  border-color: rgba(34, 197, 94, 0.2);
}

.visitor-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.visitor-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visitor-meta {
  font-size: 0.76rem;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visitor-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  margin-right: 8px;
}

.visitor-status-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--status-out);
}

.visitor-status-label.is-active {
  color: var(--status-in);
}

.visitor-activity {
  font-size: 0.72rem;
  color: #7c8aa0;
}

.visitor-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.visitor-return-chip {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}

.floating-action-btn {
  position: fixed;
  bottom: calc(96px + env(safe-area-inset-bottom, 0));
  right: 28px;
  z-index: 30;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.2);
  cursor: pointer;
  transition: background 0.25s ease, transform 0.2s ease;
}

.floating-action-btn:hover {
  background: #49a0a8;
  transform: translateY(-2px);
}

.visitor-wizard {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 34, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  padding: 0 12px;
  transition: padding 0.25s ease, align-items 0.25s ease;
}

.visitor-wizard.keyboard-visible {
  align-items: flex-start;
  padding-top: 12px;
  padding-bottom: calc(env(safe-area-inset-bottom) + var(--keyboard-offset, 0px));
}

.wizard-dialog {
  background: #fff;
  border-radius: 18px;
  width: min(520px, 94%);
  padding: 32px 32px 24px;
  box-sizing: border-box;
  position: relative;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 90vh;
  overflow-y: auto;
}

.wizard-dialog.wizard-dialog--wide {
  width: min(640px, 94%);
}

@media (min-width: 1024px) {
  .wizard-dialog {
    width: min(600px, 80%);
  }

  .wizard-dialog.wizard-dialog--wide {
    width: min(780px, 78%);
  }
}

.wizard-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: #ffffffdd;
  border: 1px solid rgba(15, 23, 42, 0.15);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
}

.wizard-close:hover {
  background: #ffffff;
}

.wizard-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.wizard-welcome-yacht {
  color: var(--color-accent);
}

.wizard-welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

@media (min-width: 520px) {
  .wizard-welcome-actions {
    flex-direction: row;
  }
  .wizard-welcome-actions .wizard-primary,
  .wizard-welcome-actions .wizard-secondary {
    flex: 1;
  }
}

.wizard-name-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wizard-print-preview {
  display: flex;
  gap: 16px;
  align-items: center;
  background: #f5f7fb;
  border-radius: 16px;
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.wizard-print-preview__photo {
  width: 96px;
  height: 96px;
  border-radius: 14px;
  object-fit: cover;
  background: #e6ebf2;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.wizard-print-preview__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #1f2a37;
}

.wizard-print-preview__meta span {
  color: #667085;
  font-size: 0.95rem;
}

@media (min-width: 540px) {
  .wizard-name-grid {
    flex-direction: row;
  }
  .wizard-name-grid input {
    flex: 1;
  }
}

.visitor-depart-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 34, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 120;
}

.visitor-depart-modal.hidden {
  display: none;
}

.visitor-depart-modal__inner {
  background: #fff;
  border-radius: 24px;
  width: min(420px, 90vw);
  padding: 28px 24px;
  box-shadow: 0 28px 54px rgba(10, 15, 34, 0.4);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.visitor-depart-modal__buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.visitor-depart-btn {
  border: none;
  border-radius: 18px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(86, 178, 187, 0.18);
  color: #0b3d4a;
}

.visitor-depart-btn--danger {
  background: rgba(224, 86, 86, 0.18);
  color: #7a1f1f;
}

.visitor-depart-cancel {
  background: none;
  border: none;
  color: #0b3d4a;
  font-weight: 600;
  cursor: pointer;
}

.visitor-checkout-modal,
.visitor-scan-modal,
.visitor-checkout-success-modal {
  --wizard-bg: #f2f5f7;
  --wizard-card: #ffffff;
  --wizard-text: #1a2435;
  --wizard-muted: #6b7280;
  --wizard-border: #dbe1e7;
  --wizard-secondary: #e5e9ef;
  --wizard-muted-bg: #eef1f5;
  --wizard-card-shadow: 0 4px 20px -5px rgba(26, 36, 53, 0.15);
}

.visitor-checkout-modal,
.visitor-checkout-success-modal {
  --wizard-primary: #3b82f6;
  --wizard-primary-strong: #2563eb;
  --wizard-glow: 0 20px 60px -15px rgba(59, 130, 246, 0.4);
  --color-accent: var(--wizard-primary);
}

.visitor-scan-modal {
  --wizard-primary: #1fada2;
  --wizard-primary-strong: #178f86;
  --wizard-glow: 0 20px 60px -15px rgba(31, 173, 162, 0.4);
  --color-accent: var(--wizard-primary);
}

.visitor-checkout-modal {
  position: fixed;
  inset: 0;
  background: var(--wizard-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 24px clamp(16px, 4vw, 40px) calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 180;
}

.visitor-checkout-modal.hidden {
  display: none;
}

.visitor-checkout-modal__inner {
  background: transparent;
  border-radius: 0;
  width: min(720px, 96vw);
  padding: 16px clamp(18px, 5vw, 36px) clamp(24px, 5vh, 40px);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0 auto;
}

.visitor-checkout-modal__topbar {
  width: min(720px, 96vw);
  margin: 24px auto 0;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  height: 64px;
}

.visitor-checkout-modal__topbar h3 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.5rem);
  color: var(--wizard-text);
  text-align: center;
  width: 100%;
}

.visitor-checkout-modal__close {
  border: none;
  background: var(--wizard-card);
  color: var(--wizard-muted);
  border-radius: 16px;
  width: 64px;
  height: 64px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--wizard-card-shadow);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.visitor-checkout-modal__spacer {
  width: 64px;
  height: 64px;
  visibility: hidden;
}

.visitor-checkout-modal__close:hover {
  background: var(--wizard-muted-bg);
  color: var(--wizard-text);
  transform: translateY(-1px);
}

.visitor-checkout-modal__subtitle {
  margin: 0;
  color: var(--wizard-muted);
  font-size: 1rem;
  text-align: center;
}

.visitor-checkout-modal__search input {
  width: 100%;
  height: 52px;
  border-radius: 16px;
  border: 2px solid var(--wizard-border);
  padding: 0 18px;
  font-size: 1rem;
  background: var(--wizard-card);
  color: var(--wizard-text);
}

.visitor-checkout-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 4px 2px;
  max-height: min(420px, 55vh);
  overflow-y: auto;
}

.visitor-checkout-list::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

.visitor-checkout-list::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.35);
  border-radius: 999px;
}

.visitor-checkout-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--wizard-card);
  border-radius: 16px;
  border: 2px solid var(--wizard-border);
  padding: 16px;
  cursor: pointer;
  text-align: center;
  box-shadow: var(--wizard-card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.visitor-checkout-card:hover,
.visitor-checkout-card:focus-visible {
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-1px);
  outline: none;
}

.visitor-checkout-card:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.visitor-checkout-card .wizard-host-avatar {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: var(--wizard-muted-bg);
  color: var(--wizard-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  overflow: hidden;
  flex-shrink: 0;
}

.visitor-checkout-card .wizard-host-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.visitor-checkout-card__details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  text-align: center;
}

.visitor-checkout-card .wizard-host-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--wizard-primary);
  text-align: center;
}

.visitor-checkout-card .wizard-host-role {
  font-size: 0.75rem;
  color: var(--wizard-primary);
  opacity: 0.8;
  text-align: center;
}

.visitor-checkout-empty {
  margin: 0;
  color: var(--wizard-muted);
  font-size: 0.9rem;
}

.visitor-checkout-status {
  margin: 0;
  font-size: 0.85rem;
  color: var(--wizard-text);
}

.visitor-scan-modal {
  position: fixed;
  inset: 0;
  background: var(--wizard-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 24px clamp(16px, 4vw, 40px) calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 130;
}

.visitor-scan-modal.hidden {
  display: none;
}

.visitor-scan-modal__inner {
  background: transparent;
  border-radius: 0;
  width: min(860px, 90vw);
  margin: 0 auto;
  padding: clamp(28px, 6vh, 48px) clamp(18px, 4vw, 36px) clamp(24px, 5vh, 40px);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.visitor-scan-modal__topbar {
  width: min(860px, 90vw);
  margin: 24px auto 0;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  height: 64px;
}

.visitor-scan-modal__title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.1;
  font-weight: 700;
  color: var(--wizard-text);
  text-align: center;
}

.visitor-scan-modal .wizard-home {
  position: static;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  border: none;
  background: var(--wizard-card);
  color: var(--wizard-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--wizard-card-shadow);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.visitor-scan-modal .wizard-home:hover {
  background: var(--wizard-muted-bg);
  color: var(--wizard-text);
  transform: translateY(-1px);
}

.visitor-scan-modal__spacer {
  width: 64px;
  height: 64px;
  visibility: hidden;
}

.visitor-scan-modal__close {
  border: none;
  background: #e2e8f0;
  color: #0f172a;
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 600;
  cursor: pointer;
}

.visitor-scan-modal__subtitle {
  margin: 0;
  color: var(--wizard-muted);
  font-size: 0.9rem;
}

.visitor-scan-modal__frame {
  width: min(560px, 85vw);
  margin: 0 auto;
  aspect-ratio: 3 / 2;
  border-radius: 18px;
  background: #0f172a;
  overflow: hidden;
  position: relative;
}

.visitor-scan-modal__frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.visitor-scan-modal__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(148, 163, 184, 0.5);
  pointer-events: none;
}

.visitor-scan-modal__overlay svg {
  width: min(260px, 60%);
  height: auto;
}

.visitor-scan-modal__status {
  margin: 0;
  font-size: 0.9rem;
  color: var(--wizard-text);
  min-height: 1.2em;
  text-align: center;
}

.visitor-scan-modal__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: min(560px, 85vw);
}

.visitor-scan-modal .wizard-primary,
.visitor-scan-modal .wizard-secondary {
  height: 80px;
  min-height: 80px;
  padding: 0 36px;
  border-radius: 24px;
  font-size: 1.5rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.visitor-scan-modal .wizard-primary:active:not(:disabled),
.visitor-scan-modal .wizard-secondary:active:not(:disabled) {
  transform: scale(0.98);
}

.visitor-scan-modal .wizard-primary {
  background: var(--wizard-primary);
  color: #fff;
  box-shadow: var(--wizard-glow);
}

@media (hover: hover) and (pointer: fine) {
  .visitor-scan-modal .wizard-primary:hover:not(:disabled) {
    background: var(--wizard-primary-strong);
  }
}

.visitor-scan-modal .wizard-primary:disabled {
  opacity: 0.6;
  box-shadow: none;
  cursor: not-allowed;
}

.visitor-scan-modal .wizard-primary--full {
  width: 100%;
}

.visitor-scan-modal .wizard-secondary {
  background: var(--wizard-secondary);
  color: var(--wizard-text);
}

.visitor-checkout-success-modal {
  position: fixed;
  inset: 0;
  background: #f2f5f7;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 140;
  padding: 0 12px;
  animation: vrs-fade-in 0.5s ease-out both;
}

.visitor-checkout-success-modal.hidden {
  display: none;
}

.visitor-checkout-success-modal__inner {
  width: min(600px, 96vw);
  padding: 32px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.visitor-checkout-success-modal__name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: #f97316;
  animation: vrs-slide-up 0.5s ease-out 0.5s both;
}

.visitor-checkout-success-modal__subtitle {
  margin: 0;
  color: #64748b;
  font-size: 1.1rem;
  animation: vrs-slide-up 0.5s ease-out 0.6s both;
}

.visitor-checkout-success-modal .wizard-complete-icon {
  width: 128px;
  height: 128px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  animation: vrs-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

.visitor-checkout-success-modal .wizard-complete-icon svg {
  width: 48px;
  height: 48px;
}

.visitor-checkout-success-modal #visitorCheckoutSuccessTitle {
  margin: 0;
  font-size: 2.8rem;
  font-weight: 800;
  color: #1a2435;
  animation: vrs-slide-up 0.5s ease-out 0.4s both;
}

/* ── Vehicle Return Success Screen ── */
.vehicle-return-success {
  position: fixed;
  inset: 0;
  background: #f2f5f7;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 140;
  padding: 0 12px;
}

.vehicle-return-success.hidden { display: none; }

/* Reset class to restart child animations without hiding the modal */
.vehicle-return-success.vrs-no-anim * { animation: none !important; }

.vehicle-return-success__inner {
  width: min(600px, 96vw);
  padding: 32px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.vehicle-return-success__icon {
  width: 128px;
  height: 128px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  animation: vrs-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

.vehicle-return-success__icon svg {
  width: 48px;
  height: 48px;
}

.vehicle-return-success__title {
  margin: 0;
  font-size: 2.8rem;
  font-weight: 800;
  color: #1a2435;
  animation: vrs-slide-up 0.5s ease-out 0.4s both;
}

.vehicle-return-success__name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: #f97316;
  animation: vrs-slide-up 0.5s ease-out 0.5s both;
}

.vehicle-return-success__subtitle {
  margin: 0;
  color: #64748b;
  font-size: 1.1rem;
  animation: vrs-slide-up 0.5s ease-out 0.6s both;
}

@keyframes vrs-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes vrs-pop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

@keyframes vrs-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.wizard-step h3 {
  margin: 0 0 12px;
  font-size: 1.2rem;
  color: var(--color-dark);
  padding-right: 70px;
}

.wizard-step h3.wizard-section-title {
  margin-top: 18px;
}

.wizard-text {
  font-size: 0.95rem;
  color: #6b7280;
  margin: 0 0 12px;
}

.wizard-nda-link {
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: underline;
}

.wizard-nda-link.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.wizard-nda-missing {
  color: #b45309;
}

.wizard-step input[type="text"],
.wizard-step input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #d0d9dd;
  font-size: 1rem;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wizard-step input[type="text"]:focus,
.wizard-step input[type="password"]:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(86, 178, 187, 0.25);
}

.wizard-pill-input {
  width: 100%;
  border-radius: 30px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #f5f7fb;
  padding: 4px 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wizard-pill-input:focus-within {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(86, 178, 187, 0.15);
}

.wizard-pill-input input {
  border: none;
  background: transparent;
  width: 100%;
  padding: 10px 0;
  font-size: 1rem;
  outline: none;
  color: var(--color-text);
}

.wizard-crew-picker {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.wizard-crew-picker label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
}

.wizard-crew-list {
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 10px;
  background: #fefefe;
  max-height: min(200px, 35vh);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wizard-crew-list--hidden {
  display: none;
}

.wizard-crew-option {
  border: none;
  border-radius: 14px;
  padding: 12px;
  background: #ffffff;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(13, 23, 43, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wizard-crew-option:hover,
.wizard-crew-option:focus-visible {
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(13, 23, 43, 0.12);
}

.wizard-crew-option__name {
  font-weight: 600;
  color: var(--color-text);
}

.wizard-crew-option__meta {
  font-size: 0.85rem;
  color: #6b7280;
}

.wizard-crew-selected {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(86, 178, 187, 0.12);
  color: #0f172a;
}

.wizard-crew-selected.hidden {
  display: none;
}

.wizard-crew-empty {
  font-size: 0.9rem;
  color: #6b7280;
  text-align: center;
  padding: 8px 0;
}

.wizard-host-picker {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wizard-host-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.wizard-host-list--hidden {
  display: none;
}

.wizard-host-option {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 12px;
  background: #ffffff;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(13, 23, 43, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.wizard-host-option:hover,
.wizard-host-option:focus-visible {
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(13, 23, 43, 0.12);
  border-color: rgba(86, 178, 187, 0.5);
}

.wizard-host-option.is-selected {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(86, 178, 187, 0.2);
}

.wizard-host-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  overflow: hidden;
  font-weight: 600;
  color: #0f172a;
}

.wizard-host-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wizard-host-name {
  font-weight: 600;
  color: var(--color-text);
  display: block;
}

.wizard-host-role {
  font-size: 0.85rem;
  color: #6b7280;
  display: block;
}

.wizard-host-status {
  margin-top: 4px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--status-in);
  display: block;
}

.wizard-host-status--ashore {
  color: #ef4444;
}

.wizard-host-selected {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(86, 178, 187, 0.12);
  color: #0f172a;
}

.wizard-host-selected.hidden {
  display: none;
}

.wizard-host-empty {
  font-size: 0.9rem;
  color: #6b7280;
  text-align: center;
  padding: 6px 0;
}

.wizard-checkbox {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.95rem;
  color: var(--color-text);
}

.wizard-supplemental {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wizard-signature {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--color-text);
}

.wizard-signature span {
  font-weight: 600;
  color: var(--color-dark);
}

.signature-pad {
  position: relative;
  width: 100%;
  height: 180px;
  border: 1px dashed #cbd5f5;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  touch-action: none;
}

.signature-pad canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: transparent;
  cursor: crosshair;
  touch-action: none;
}

.signature-pad__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.95rem;
  pointer-events: none;
}

.signature-pad__placeholder.hidden {
  display: none;
}

.wizard-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  background: #0f172a;
}

.wizard-photo video,
.wizard-photo__still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.wizard-photo canvas {
  display: none;
}

.wizard-photo__actions {
  margin-top: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.wizard-photo__flash {
  position: absolute;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
  pointer-events: none;
}

.wizard-photo__flash.is-active {
  opacity: 0.85;
}

.wizard-photo__countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  font-weight: 700;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.35);
  z-index: 3;
  pointer-events: none;
}

.wizard-photo__still.hidden {
  display: none;
}

.wizard-security {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  width: 100%;
}

.wizard-security__icon {
  flex: 0 1 auto;
  max-width: 180px;
  width: 70%;
}

.wizard-security__icon img {
  width: 100%;
  height: auto;
  max-height: 200px;
  display: block;
  object-fit: contain;
}

.wizard-security__body {
  flex: 1 1 320px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

@media (min-width: 700px) {
  .wizard-security {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
  }

  .wizard-security__icon {
    max-width: 220px;
  }
}

.signature-pad__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.wizard-summary {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--color-text);
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.wizard-primary,
.wizard-secondary {
  flex: 1;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}

.wizard-primary {
  background: var(--color-accent);
  color: #fff;
}

.wizard-primary:disabled {
  background: #a9cdd1;
  cursor: not-allowed;
}

.wizard-secondary {
  background: #e2e8f0;
  color: var(--color-text);
}

.wizard-error {
  color: #d14343;
  font-size: 0.9rem;
  margin-top: 8px;
}

.wizard-step.hidden {
  display: none;
}
.crew-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  flex: 1;
  min-width: 0;              /* allow text to wrap inside flex row */
  padding-right: 1rem;       /* breathing room before the toggle */
  width: calc(100% - 3.5rem);/* ensure enough room for italic text on iOS devices */
}

.crew-name {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
  line-height: 1.2;
  word-break: break-word;
}

.crew-role {
  display: block;
  font-size: 0.9rem;
  font-style: italic;
  color: #6b7280;
  opacity: 0.9;
  line-height: 1.35;
  max-width: 100%;
  padding-inline-end: 0.75rem; /* provide room for italic overhang */
  word-break: break-word;      /* prevent clipping on long italicized roles */
  overflow-wrap: anywhere;
}

/* toggle on right */
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}



.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-border);
  border-radius: 28px;
  transition: background 0.25s, box-shadow 0.25s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: transform 0.25s;
}

input:checked + .slider {
  background-color: var(--color-accent);
  box-shadow: 0 0 6px rgba(86, 178, 187, 0.5);
}

input:checked + .slider:before {
  transform: translateX(24px);
}


/* ===============================
   TOGGLE SWITCH
=============================== */
.switch {
  position: relative;
  display: inline-block;
  width: 54px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-border);
  transition: 0.3s;
  border-radius: 28px;
  box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.1);
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: #fff;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
  background-color: var(--color-accent);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* ===============================
   FLOATING NAVIGATION DOCK
=============================== */
.floating-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 16px;
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 40;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.floating-nav--hidden {
  opacity: 0;
  transform: translateY(80px);
}

.floating-nav__inner {
  display: flex;
  gap: 6px;
  padding: 10px;
  border-radius: 20px;
  background: var(--color-nav);
  border: 1px solid var(--color-nav-border);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}

.floating-nav__btn {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  min-width: 86px;
  min-height: 56px;
  border-radius: 14px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.floating-nav__btn span {
  white-space: nowrap;
}

.floating-nav__btn svg {
  transition: transform 0.2s ease;
}

.floating-nav__btn[data-target="muster"] svg {
  color: #ef4444;
}

.floating-nav__btn[data-target="muster"].active svg {
  color: #ef4444;
}

.floating-nav__btn:hover:not(:disabled) {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.08);
}

.floating-nav__btn.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.floating-nav__btn.active svg {
  transform: scale(1.08);
}

.floating-nav__btn:disabled {
  opacity: 0.4;
  cursor: default;
}

body.muster-active .floating-nav {
  display: none;
}

/* ===============================
   SAFETY LIBRARY
=============================== */
.safety-board {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0;
  box-sizing: border-box;
}

.safety-board__intro {
  position: relative;
  padding-top: 70px;
  overflow: hidden;
}

.safety-board__intro .wave-top {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 120px;
  transform: translateY(-90%);
  pointer-events: none;
}

.safety-board__intro .wave-top path {
  animation: safety-wave-pan 18s infinite linear;
}

.safety-board__intro h3 {
  margin: 0 0 4px;
  font-size: 1.4rem;
  color: var(--color-dark);
}

.safety-contacts-rail {
  position: relative;
  margin-top: -70px;
  margin-bottom: 10px;
  padding: 6px 6px;
  background: #e7edf2;
  border-radius: 18px;
  z-index: 2;
}

.safety-contacts {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(210px, 240px);
  gap: 12px;
  padding: 6px 4px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}

.safety-contacts::-webkit-scrollbar {
  height: 6px;
}

.safety-contacts::-webkit-scrollbar-thumb {
  background: rgba(24, 154, 180, 0.4);
  border-radius: 999px;
}

.safety-contacts--empty {
  display: none;
}

.safety-contacts__empty {
  margin: 0 0 12px;
  color: #7a8899;
  font-size: 0.85rem;
  text-align: center;
}

.safety-contact-card {
  border: none;
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(245, 248, 250, 0.95));
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-snap-align: start;
  text-align: left;
  color: inherit;
  min-height: 150px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.safety-contact-card:focus,
.safety-contact-card:hover {
  transform: translateY(-2px);
  box-shadow: none;
  outline: none;
}

.safety-contact-card__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(24, 154, 180, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.safety-contact-card__icon img {
  width: 24px;
  height: 24px;
}

.safety-contact-card__role {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #189ab4;
  font-weight: 700;
}

.safety-contact-card__name {
  font-size: 1.05rem;
  color: var(--color-dark);
}

.safety-contact-card__phone {
  font-size: 0.95rem;
  color: #475467;
}

.safety-board__intro p {
  margin: 0;
  color: #6b7280;
  font-size: 0.95rem;
}

@keyframes safety-wave-pan {
  0% { transform: translateX(0); }
  100% { transform: translateX(-20%); }
}

.safety-board__layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.safety-board__folders,
.safety-board__details {
  background: #fff;
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.safety-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}

.safety-refresh-btn,
.safety-close-btn {
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 12px 22px rgba(86, 178, 187, 0.25);
  transition: background 0.2s ease, transform 0.15s ease;
}

.safety-refresh-btn:hover,
.safety-close-btn:hover {
  background: #49a0a8;
  transform: translateY(-1px);
}

.safety-close-btn {
  background: #e2e9ed;
  color: var(--color-dark);
  box-shadow: none;
}

.safety-storage-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(86, 178, 187, 0.12);
  color: var(--color-dark);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.85rem;
}

.safety-storage__used {
  font-weight: 700;
}

.safety-folder-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.safety-folder-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--color-card);
  border-radius: 16px;
  padding: 16px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 18px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s ease, border 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
  text-align: left;
  color: inherit;
  font: inherit;
}

.safety-folder-card:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 12px 22px rgba(15, 23, 42, 0.12);
}

.safety-folder-card.active {
  border-color: var(--color-accent);
  background: #dff3f5;
  box-shadow: inset 0 0 0 1px rgba(86, 178, 187, 0.35), 0 12px 22px rgba(15, 23, 42, 0.12);
}

.safety-folder-card img {
  width: 64px;
  height: 64px;
}

.safety-folder-card h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--color-dark);
}

.safety-folder-meta {
  margin: 0;
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.45;
}

.safety-empty-state {
  text-align: center;
  color: #6b7280;
  padding: 40px 20px;
}

.safety-empty-state h3 {
  margin-bottom: 8px;
  color: var(--color-dark);
}

.safety-empty-copy {
  text-align: center;
  color: #6b7280;
  font-size: 0.9rem;
  margin: 16px 0;
}

.safety-document-list .safety-empty-copy {
  padding: 24px 12px;
  background: var(--color-card);
  border-radius: 12px;
}

.safety-documents.hidden,
.safety-pdf-viewer.hidden {
  display: none;
}

.safety-documents {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.safety-documents__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.safety-documents__header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--color-dark);
}

.safety-documents__header p {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: #6b7280;
}

.safety-document-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.safety-document-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-card);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, border 0.2s ease;
}

.safety-document-item:hover {
  background: #e9eff2;
}

.safety-document-item.active {
  border-color: var(--color-accent);
  background: #dff3f5;
}

.safety-document-info h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--color-dark);
}

.safety-document-info span {
  display: block;
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 4px;
}

.safety-document-meta {
  font-size: 0.8rem;
  color: #6b7280;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: right;
}

.safety-viewer {
  background: #f6f8fb;
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 320px;
}

.safety-viewer__placeholder {
  text-align: center;
  color: #6b7280;
  padding: 40px 10px;
}

.safety-viewer__placeholder h4 {
  margin: 0 0 8px;
  color: var(--color-dark);
}

.safety-pdf-viewer {
  width: 100%;
  min-height: 400px;
  border: none;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.safety-viewer-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 34, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  padding: calc(24px + env(safe-area-inset-top, 0)) calc(24px + env(safe-area-inset-right, 0)) calc(24px + env(safe-area-inset-bottom, 0)) calc(24px + env(safe-area-inset-left, 0));
  backdrop-filter: blur(2px);
}

.safety-viewer-modal.hidden {
  display: none;
}

.safety-viewer-modal__inner {
  background: #fff;
  width: min(1080px, calc(100vw - 48px));
  height: min(900px, calc(100vh - 48px));
  max-height: calc(100vh - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0) - 32px);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.35);
  position: relative;
}

.safety-viewer-modal__header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 18px 22px;
  background: rgba(240, 244, 248, 0.94);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.safety-viewer-modal__header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--color-dark);
}

.safety-viewer-modal__loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--color-dark);
  font-weight: 600;
  text-align: center;
  z-index: 5;
  pointer-events: none;
}

.safety-viewer-modal__loading p {
  margin: 0;
  font-size: 1rem;
}

.safety-viewer-modal__spinner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 6px solid rgba(10, 15, 34, 0.12);
  border-top-color: var(--color-accent);
  animation: safety-spinner 0.85s linear infinite;
}

@keyframes safety-spinner {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.safety-viewer-modal__close {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 48px;
  height: 48px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: none;
  background: rgba(10, 15, 34, 0.92);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 20px 40px rgba(10, 15, 34, 0.45);
  padding: 0;
}

.safety-viewer-modal__close:hover {
  background: rgba(86, 178, 187, 0.9);
  color: #fff;
}

.safety-viewer-modal__close-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.safety-viewer-modal__close-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.safety-viewer-modal__frame {
  flex: 1;
  border: none;
  width: 100%;
  height: 100%;
  display: block;
  background: #fff;
}

/* Body wrapper: sidebar + viewer side by side */
.safety-viewer-modal__body {
  flex: 1;
  display: flex;
  min-height: 0;
  position: relative;
}
.safety-viewer-modal__body.hidden { display: none; }

.safety-pdfjs-viewer {
  flex: 1;
  width: 100%;
  min-width: 0;
  overflow-y: auto;
  padding: 24px clamp(16px, 4vw, 36px);
  box-sizing: border-box;
  background: #f9fafc;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.safety-pdfjs-viewer.hidden {
  display: none;
}

/* ── Outline / Chapter Sidebar (overlay drawer) ── */
.safety-outline-sidebar {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 300px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.97);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 8px 0 24px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}
.safety-outline-sidebar.hidden { display: none; }
.safety-outline-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(240, 244, 248, 0.6);
}
.safety-outline-sidebar__title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}
.safety-outline-sidebar__close {
  background: none; border: none; font-size: 20px;
  color: #94a3b8; cursor: pointer; padding: 0 4px; line-height: 1;
}
.safety-outline-sidebar__close:hover { color: #1a2435; }
.safety-outline-sidebar__nav {
  flex: 1; overflow-y: auto; padding: 8px 0;
  -webkit-overflow-scrolling: touch;
}
.safety-outline-item {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 8px 16px; font-size: 0.88rem; color: #334155;
  cursor: pointer; border: none; background: none;
  width: 100%; text-align: left; line-height: 1.35;
  transition: background 0.15s ease, color 0.15s ease;
}
.safety-outline-item:hover {
  background: rgba(86, 178, 187, 0.08); color: #0f766e;
}
.safety-outline-item--active {
  background: rgba(86, 178, 187, 0.12); color: #0f766e; font-weight: 600;
}
.safety-outline-item__title { flex: 1; min-width: 0; }
.safety-outline-item__page {
  flex-shrink: 0; font-size: 0.75rem; color: #94a3b8;
  min-width: 24px; text-align: right; padding-top: 1px;
}
.safety-outline-item[data-depth="1"] { padding-left: 32px; font-size: 0.84rem; }
.safety-outline-item[data-depth="2"] { padding-left: 48px; font-size: 0.82rem; color: #64748b; }
.safety-outline-item[data-depth="3"] { padding-left: 60px; font-size: 0.8rem; color: #94a3b8; }

/* ── Page Indicator Bar ── */
.safety-page-indicator {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  background: rgba(240, 244, 248, 0.94);
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  flex-shrink: 0;
}
.safety-page-indicator.hidden { display: none; }
.safety-page-indicator__toc {
  background: none; border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px; padding: 5px 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #64748b; transition: background 0.15s ease, color 0.15s ease;
}
.safety-page-indicator__toc:hover {
  background: rgba(86, 178, 187, 0.1); color: #0f766e;
}
.safety-page-indicator__toc--active {
  background: rgba(86, 178, 187, 0.12); color: #0f766e;
  border-color: rgba(86, 178, 187, 0.3);
}
.safety-page-indicator__toc--no-outline { display: none; }
.safety-page-indicator__label {
  font-size: 0.85rem; color: #64748b;
  cursor: pointer; user-select: none; -webkit-user-select: none;
}
.safety-page-indicator__input {
  width: 52px; padding: 4px 6px;
  border: 1px solid rgba(15, 23, 42, 0.15); border-radius: 6px;
  font-size: 0.85rem; text-align: center; color: #1a2435; outline: none;
}
.safety-page-indicator__input:focus {
  border-color: #56b2bb; box-shadow: 0 0 0 2px rgba(86, 178, 187, 0.2);
}
.safety-page-indicator__input.hidden { display: none; }

.safety-contact-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 220;
}

.safety-contact-modal__inner {
  background: #fff;
  border-radius: 24px;
  padding: 28px 24px 24px;
  width: min(360px, 92vw);
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.25);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.safety-contact-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(15, 23, 42, 0.05);
  border: none;
  border-radius: 999px;
  width: 32px;
  height: 32px;
  font-size: 1.4rem;
  color: #1f2933;
  cursor: pointer;
}

.safety-contact-modal__icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: rgba(24, 154, 180, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.safety-contact-modal__icon img {
  width: 40px;
  height: 40px;
}

.safety-contact-modal__role {
  margin: 0;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: #189ab4;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.safety-contact-modal__inner h3 {
  margin: 0;
  font-size: 1.4rem;
  color: var(--color-dark);
}

.safety-contact-modal__details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.safety-contact-modal__label {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
}

.safety-contact-modal__value {
  font-size: 1rem;
  color: #0f172a;
  text-decoration: none;
}

.safety-contact-modal__value:hover {
  text-decoration: underline;
}

.safety-contact-modal__notes {
  font-size: 0.9rem;
  color: #4b5563;
  margin: 0;
}

.safety-contact-modal__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.safety-contact-modal__action {
  flex: 1;
  text-align: center;
  border-radius: 999px;
  padding: 10px;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: #189ab4;
  box-shadow: 0 12px 24px rgba(24, 154, 180, 0.25);
}

.safety-contact-modal__action--ghost {
  background: rgba(24, 154, 180, 0.12);
  color: #189ab4;
  box-shadow: none;
}

.safety-contact-modal__action.disabled {
  opacity: 0.4;
  pointer-events: none;
}

body.contact-modal-open {
  overflow: hidden;
}

.muster-board {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0;
  box-sizing: border-box;
}

body.muster-active #muster-container {
  padding-top: 0;
}

.muster-shell {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-bottom: 190px;
}

.muster-state {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Pre-session: vertically centre the slider in the viewport so it sits
   in the middle of the iPad screen on every model. 100dvh accounts for
   iOS safe areas; subtracting ~240px covers the top board header and the
   floating bottom tab bar + padding. */
.muster-state--inactive {
  min-height: calc(100dvh - 240px);
  justify-content: center;
  align-items: center;
}

.muster-sticky {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: var(--color-bg);
  padding: 0 0 0.2rem;
}

.muster-slider {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 6px;
}

.muster-slider__track {
  position: relative;
  width: 280px;
  height: 64px;
  border-radius: 999px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.18), rgba(249, 115, 22, 0.18));
  overflow: hidden;
  --muster-progress: 0;
}

.muster-slider__shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  animation: muster-shimmer 2.2s linear infinite;
}

.muster-slider__fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.45), rgba(249, 115, 22, 0.45));
  transform-origin: left center;
  transform: scaleX(var(--muster-progress));
  transition: transform 0.2s ease;
  opacity: 0.6;
}

.muster-slider__text {
  position: absolute;
  /* Start just past the resting handle (handle is left:4px + 56px = 60px)
     so the text centres in the space to the right of the circle, not
     behind it. */
  top: 0;
  bottom: 0;
  left: 64px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.03em;
  transition: opacity 0.2s ease;
  opacity: calc(1 - var(--muster-progress));
  pointer-events: none;
}

.muster-slider__handle {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 18px 30px rgba(239, 68, 68, 0.35);
  cursor: grab;
  transition: transform 0.25s ease;
  touch-action: none;
}

.muster-slider__handle.is-dragging {
  cursor: grabbing;
  transition: none;
}

.muster-slider__note {
  font-size: 0.75rem;
  color: rgba(100, 116, 139, 0.9);
}

/* Header-takeover recording bar. Lives in the board-header title slot
   (grid-column 2, row 1) and replaces the boardTitle while a muster session
   is actively being recorded. Pulsing dot + mic icon + live MM:SS timer
   gives the captain strong visual confirmation on every tab. */
.muster-rec-bar {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  /* Wide enough to reach into the middle of Fire and Medical (the outer
     emergency cards below), scaling with viewport so it looks balanced on
     iPad Mini through iPad Pro 13". */
  width: clamp(360px, 45vw, 560px);
  margin-bottom: 10px; /* tiny breathing gap before the emergency cards */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 7px 22px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.95), rgba(254, 202, 202, 0.85));
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: #b91c1c;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  min-height: 36px;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.1);
}
.muster-rec-bar.hidden { display: none; }

.muster-rec-bar__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55);
  animation: muster-rec-bar-pulse 1.2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes muster-rec-bar-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); opacity: 1; }
  50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); opacity: 0.85; }
}

.muster-rec-bar__icon { color: #b91c1c; flex-shrink: 0; }
.muster-rec-bar__label { font-weight: 700; }
.muster-rec-bar__timer {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  font-size: 1rem;
  color: #7f1d1d;
  padding-left: 4px;
}

/* Hide the normal board title when the recording bar is up. Toggled
   alongside the bar by updateMusterRecordingIndicator() via the
   body.muster-recording class so older iPadOS (no :has() support)
   still renders correctly. */
body.muster-recording .board-header h2 { display: none; }
body.muster-recording .board-header {
  background: linear-gradient(180deg, rgba(254, 226, 226, 0.45), rgba(254, 226, 226, 0.12));
  border-bottom-color: rgba(220, 38, 38, 0.15);
}

.muster-emergency {
  display: flex;
  gap: 12px;
}

.muster-emergency-card {
  flex: 1;
  border: none;
  border-radius: 16px;
  padding: 12px;
  color: #fff;
  text-align: left;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.muster-emergency-card:active {
  transform: scale(0.97);
}

.muster-emergency-card__row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
}

.muster-emergency-card__sub {
  font-size: 0.7rem;
  opacity: 0.85;
}
.muster-emergency-card__phone {
  font-size: 0.62rem;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.muster-emergency-card--amber {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
}

.muster-emergency-card--teal {
  background: linear-gradient(135deg, #06b6d4, #14b8a6);
}

.muster-emergency-card--rose {
  background: linear-gradient(135deg, #f43f5e, #ef4444);
}

/* VoIP call states */
.muster-emergency-card--calling {
  animation: voip-pulse 1s ease-in-out infinite;
  opacity: 0.85;
}
.muster-emergency-card--connected {
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}
@keyframes voip-pulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.03); opacity: 1; }
}

/* ── Session Log: toggle pill in the sticky bar ── */
.muster-log-toggle {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  margin-top: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease;
}
.muster-log-toggle:hover { background: #f8fafc; }
.muster-log-toggle:active { transform: scale(0.97); }
.muster-log-toggle svg { color: #64748b; }
.muster-log-toggle__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ── Session Log drawer (slides in from the right) ── */
.muster-log-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.muster-log-backdrop.is-visible { opacity: 1; }
.muster-log-backdrop.hidden { display: none; }

.muster-log-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 92vw;
  background: #f8fafc;
  box-shadow: -20px 0 60px rgba(15, 23, 42, 0.18);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.muster-log-drawer.is-open { transform: translateX(0); }
.muster-log-drawer.hidden { display: none; }

.muster-log-drawer__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: calc(22px + env(safe-area-inset-top, 0px)) 22px 18px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}
.muster-log-drawer__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}
.muster-log-drawer__subtitle {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
}
.muster-log-drawer__close {
  border: none;
  background: rgba(226, 232, 240, 0.6);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #475569;
  transition: background 0.15s ease;
}
.muster-log-drawer__close:hover { background: rgba(226, 232, 240, 0.9); }
.muster-log-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px calc(32px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Event cards (inside the drawer) ── */
.muster-event-card {
  position: relative;
  padding: 12px 14px 12px 18px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.muster-event-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 4px;
  background: #94a3b8;
}
.muster-event-card__row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.muster-event-card__time {
  font-variant-numeric: tabular-nums;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.muster-event-card__type { flex: 1; }
.muster-event-card__body {
  margin-top: 6px;
  color: #1e293b;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.4;
}

/* Per-type accents (left border + type text colour) */
.muster-event-card--note::before { background: #f59e0b; }
.muster-event-card--note .muster-event-card__type { color: #b45309; }
.muster-event-card--note .muster-event-card__body {
  padding: 10px 12px;
  background: rgba(245, 158, 11, 0.08);
  border-radius: 8px;
  border-left: 3px solid rgba(245, 158, 11, 0.4);
  font-style: normal;
  white-space: pre-wrap;
  word-break: break-word;
}

.muster-event-card--call::before { background: #ef4444; }
.muster-event-card--call .muster-event-card__type { color: #b91c1c; }
.muster-event-card--call-end::before { background: #64748b; }
.muster-event-card--call-end .muster-event-card__type { color: #475569; }

.muster-event-card--action::before { background: #0891b2; }
.muster-event-card--action .muster-event-card__type { color: #0e7490; }

/* Small chip for call duration */
.muster-event-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Empty state inside the drawer */
.muster-log-empty {
  padding: 40px 20px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
}
.muster-log-empty__icon {
  opacity: 0.45;
  margin-bottom: 10px;
}

/* ── Muster FAB (Quick Actions) ── */
/* Log Event button (red/orange gradient, sits between Re-Muster and Complete) */
.muster-action-bar .muster-action--log {
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 16px 30px rgba(239, 68, 68, 0.3);
}

/* Log Event slide-up sheet */
.log-event-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 60;
  transition: opacity 0.25s ease;
}
.log-event-backdrop.hidden { display: none; }

.log-event-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 12px 20px calc(32px + env(safe-area-inset-bottom, 0));
  z-index: 65;
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.12);
  max-height: 60vh;
  overflow-y: auto;
}
.log-event-sheet.hidden {
  transform: translateY(100%);
  pointer-events: none;
}
.log-event-sheet__handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: #cbd5e1;
  margin: 0 auto 12px;
}
.log-event-sheet__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 16px;
  text-align: center;
}
.log-event-sheet__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.log-event-sheet__action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 0.92rem;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
}
.log-event-sheet__action:active {
  transform: scale(0.97);
  background: #e2e8f0;
}
.log-event-sheet__action svg {
  flex-shrink: 0;
}
.log-event-sheet__action--logged {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #059669;
  font-weight: 600;
}

/* Custom free-text note section inside the Log Event sheet. Sits below the
   admin-configured quick action buttons, separated by a divider, so the user
   can either tap a quick action OR type a custom note. */
.log-event-sheet__divider {
  height: 1px;
  background: #e2e8f0;
  margin: 18px -20px 14px;
}
.log-event-sheet__note-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin: 0 0 8px;
}
.log-event-sheet__note {
  width: 100%;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #0f172a;
  resize: none;
  box-sizing: border-box;
  min-height: 72px;
  line-height: 1.4;
  -webkit-appearance: none;
  appearance: none;
}
.log-event-sheet__note:focus {
  outline: none;
  border-color: #56b2bb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(86, 178, 187, 0.15);
}
.log-event-sheet__note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}
.log-event-sheet__note-counter {
  font-size: 0.78rem;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}
.log-event-sheet__note-counter--warn {
  color: #d97706;
}
.log-event-sheet__note-save {
  border: none;
  background: #0891b2;  /* deeper / more saturated than the brand teal so it doesn't blend with the textarea focus border */
  color: #ffffff;
  font-weight: 700;
  font-size: 1.02rem;
  padding: 14px 30px;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 16px rgba(8, 145, 178, 0.32);
  transition: transform 0.1s, background 0.15s, opacity 0.15s, box-shadow 0.15s;
}
.log-event-sheet__note-save:active {
  transform: scale(0.97);
  background: #0e7490;
  box-shadow: 0 3px 10px rgba(8, 145, 178, 0.4);
}
.log-event-sheet__note-save:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  opacity: 0.65;
  box-shadow: none;
}
.log-event-sheet__note-save--saved {
  background: #059669;
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.32);
}

.muster-progress {
  background: #fff;
  border-radius: 16px;
  padding: 10px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

.muster-progress__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 6px;
}

.muster-progress__missing {
  color: #ef4444;
}

.muster-progress__bar {
  position: relative;
  width: 100%;
  height: 0.25rem;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: visible;
}

.muster-progress__fill {
  position: absolute;
  left: 0;
  top: 50%;
  height: 0.46rem;
  width: 0%;
  background: linear-gradient(90deg, #10b981, #22c55e);
  border-radius: 999px;
  transform: translateY(-50%);
  transition: width 0.3s ease;
}

.muster-progress__fill::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 0.6rem;
  height: 0.6rem;
  background: #22c55e;
  border-radius: 999px;
  transform: translate(50%, -50%);
  box-shadow: 0 0 0 0.12rem rgba(255, 255, 255, 0.9),
    0 6px 12px rgba(16, 185, 129, 0.35);
}

.muster-progress__start {
  margin-top: 6px;
  font-size: 0.75rem;
  color: rgba(100, 116, 139, 0.9);
}

.muster-recording-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 8px;
}

.muster-recording-indicator__dot {
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  animation: muster-recording-pulse 1.5s ease-in-out infinite;
}

@keyframes muster-recording-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.muster-recording-indicator__text {
  font-size: 0.75rem;
  font-weight: 600;
  color: #ef4444;
}

.muster-filters {
  display: flex;
  gap: 10px;
}

.muster-filter {
  flex: 1;
  border: none;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(226, 232, 240, 0.7);
  color: rgba(71, 85, 105, 0.9);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

#musterFilterAll.is-active {
  background: #0f172a;
  color: #fff;
}

#musterFilterMissing {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

#musterFilterMissing.is-active {
  background: #ef4444;
  color: #fff;
}

#musterFilterPresent {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

#musterFilterPresent.is-active {
  background: #10b981;
  color: #fff;
}

.muster-roster {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.muster-roster--inactive {
  opacity: 0.6;
}

.muster-roster--inactive .muster-card {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(226, 232, 240, 0.7);
  box-shadow: none;
}

.muster-roster--inactive .muster-avatar img {
  filter: grayscale(1);
}

.muster-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.muster-group__header {
  position: sticky;
  top: var(--muster-sticky-offset, 0px);
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  /* Muster department background */
  background: rgba(51, 65, 85, 0.7);
  color: #fff;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}

.muster-group__header--inactive {
  position: static;
  background: transparent;
  color: rgba(100, 116, 139, 0.65);
  padding: 0 4px;
  letter-spacing: 0.12em;
  box-shadow: none;
  backdrop-filter: none;
}

.muster-group__header--inactive .muster-group__count {
  display: none;
}

.muster-group__count {
  background: rgba(239, 68, 68, 0.92);
  color: #fff;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: 700;
}

.muster-group__count.is-complete {
  background: rgba(16, 185, 129, 0.95);
}

.muster-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff;
  border: 2px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}

.muster-card:disabled {
  cursor: default;
  opacity: 1;
}

.muster-card:active:not(:disabled) {
  transform: scale(0.99);
}

.muster-card--present {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.08);
}

.muster-card--missing {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.08);
}

.muster-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(148, 163, 184, 0.6);
  background: rgba(226, 232, 240, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #475569;
  flex-shrink: 0;
}

.muster-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.muster-card--present .muster-avatar {
  border-color: rgba(16, 185, 129, 0.9);
}

.muster-card--missing .muster-avatar {
  border-color: rgba(239, 68, 68, 0.9);
}

.muster-avatar__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.muster-avatar__overlay--missing {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.muster-card__details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.muster-card__name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
}

.muster-card__meta {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(100, 116, 139, 0.9);
}

.muster-card__status {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.7);
  color: rgba(100, 116, 139, 0.9);
}

.muster-card__status.is-present {
  background: rgba(16, 185, 129, 0.18);
  color: #0f766e;
}

.muster-card__status.is-missing {
  background: rgba(239, 68, 68, 0.18);
  color: #b91c1c;
}

/* PRESENT / MISSING action buttons on muster cards */
.muster-card__actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.muster-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 76px;
  height: 48px;
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.muster-action-btn span {
  line-height: 1;
}

/* Present button — default (unselected) */
.muster-action-btn--present {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #0f766e;
}

/* Missing button — default (unselected) */
.muster-action-btn--missing {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #b91c1c;
}

/* Active (selected) states — filled */
.muster-action-btn--present.is-active {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}

.muster-action-btn--missing.is-active {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}

/* Dimmed — the other button when one is selected */
.muster-action-btn.is-dimmed {
  opacity: 0.3;
}

.muster-action-btn.is-dimmed:active {
  opacity: 0.7;
}

.muster-action-btn:active:not(.is-dimmed) {
  transform: scale(0.95);
}

.muster-empty {
  padding: 18px;
  border-radius: 14px;
  background: rgba(226, 232, 240, 0.5);
  color: rgba(100, 116, 139, 0.9);
  text-align: center;
  font-size: 0.85rem;
}

.muster-action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(110px + env(safe-area-inset-bottom, 0));
  padding: 14px 16px 18px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0), rgba(248, 250, 252, 0.9) 35%, rgba(248, 250, 252, 0.98));
  z-index: 35;
}

.muster-action-bar .muster-action {
  border: none;
  border-radius: 16px;
  padding: 14px 18px;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  cursor: pointer;
  transition: transform 0.15s ease;
  border: 2px solid #0f172a;
  box-sizing: border-box;
}

.muster-action-bar .muster-action:active {
  transform: scale(0.98);
}

.muster-action-bar .muster-action--secondary {
  background: rgba(226, 232, 240, 0.85);
  color: #0f172a;
  box-shadow: 0 14px 24px rgba(15, 23, 42, 0.12);
}

.muster-action-bar .muster-action--primary {
  background: #10b981;
  color: #fff;
  box-shadow: 0 16px 30px rgba(16, 185, 129, 0.35);
}

.muster-action-bar {
  display: flex;
  justify-content: center;
}

.muster-action-bar > .muster-action {
  flex: 1;
  max-width: 320px;
}

.muster-action-bar > .muster-action + .muster-action {
  margin-left: 12px;
}

body.muster-active .muster-action-bar {
  bottom: calc(16px + env(safe-area-inset-bottom, 0));
  padding: 6px 16px 14px;
  background: transparent;
}

.muster-action-bar {
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.muster-action-bar--hidden {
  opacity: 0;
  transform: translateY(80px);
  pointer-events: none;
}

@keyframes muster-shimmer {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

.confirm-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 34, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
}

.confirm-modal.hidden {
  display: none;
}

.confirm-modal__inner {
  background: #fff;
  border-radius: 20px;
  padding: 24px 24px 20px;
  width: min(420px, 90vw);
  text-align: center;
  box-shadow: 0 30px 60px rgba(10, 15, 34, 0.35);
}

.confirm-modal__inner p {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 4px;
}

.confirm-modal__buttons {
  display: flex;
  margin-top: 18px;
}

.confirm-modal__btn {
  flex: 1;
  padding: 18px 12px;
  border: none;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.confirm-modal__btn--cancel {
  background: rgba(224, 86, 86, 0.95);
  border-top-left-radius: 16px;
  border-bottom-left-radius: 16px;
}

.confirm-modal__btn--ok {
  background: rgba(34, 197, 94, 0.95);
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;
}

.confirm-modal--single .confirm-modal__buttons {
  justify-content: center;
}

.confirm-modal--single .confirm-modal__btn--cancel {
  display: none;
}

.confirm-modal--single .confirm-modal__btn--ok {
  border-radius: 16px;
  min-width: 160px;
}

@media (max-width: 900px) {
  .safety-contacts-rail {
    margin-top: -70px;
  }
}

@media (max-width: 600px) {
  .safety-contacts-rail {
    margin-top: -40px;
  }
}

.safety-pdfjs-viewer .pdfjs-page {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  flex: 0 0 auto;
  width: min(960px, 100%);
  margin: 0 auto;
}

.safety-pdfjs-viewer .pdfjs-page canvas {
  display: block;
  width: 100%;
  height: auto;
  flex: 0 0 auto;
}

.pdfjs-sentinel {
  height: 240px;
  width: 100%;
  pointer-events: none;
  flex: 0 0 auto;
}

@media (min-width: 900px) {
  .safety-board__layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
  }

  .safety-folder-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .safety-viewer {
    min-height: 420px;
  }
}

/* ===============================
   UTILITY CLASSES
=============================== */
.hidden { display: none !important; }
.active { display: block; }

/* ===============================
   RESPONSIVE TWEAKS
=============================== */
@media (max-width: 600px) {
  .crew-card {
    padding: 14px 16px;
  }

  .floating-nav__btn {
    font-size: 0.68rem;
    min-width: 72px;
    min-height: 52px;
  }

  h2 {
    font-size: 1.2em;
  }
}
/* ===============================
   Startup Companion Overlay
=============================== */
.startup-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--splash-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--splash-foreground);
  text-align: center;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.startup-overlay.startup-overlay--exiting {
  opacity: 0;
}

.startup-overlay__logo {
  margin-bottom: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.startup-overlay__logo img {
  height: 128px;
  width: auto;
}

.startup-overlay__progress {
  width: 260px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.startup-overlay__bar {
  height: 4px;
  width: 100%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.startup-overlay__fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--splash-accent), var(--splash-glow));
  transition: width 0.5s ease;
}

.startup-overlay__status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--splash-muted);
  min-height: 20px;
}

.startup-overlay__message {
  display: inline-block;
}

.startup-overlay__message--animate {
  animation: startup-fade-in-up 0.4s ease-out;
}

.startup-overlay__dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.startup-overlay__dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--splash-accent);
  opacity: 0.4;
}

.startup-overlay__dot--1 {
  animation: startup-dot-pulse 1.4s ease-in-out infinite;
}

.startup-overlay__dot--2 {
  animation: startup-dot-pulse 1.4s ease-in-out 0.2s infinite;
}

.startup-overlay__dot--3 {
  animation: startup-dot-pulse 1.4s ease-in-out 0.4s infinite;
}

.startup-overlay__footer {
  position: absolute;
  bottom: 32px;
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.5);
}

@keyframes startup-fade-in-up {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes startup-dot-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* ===============================
   Splash / Access Code Modal
=============================== */
.splash-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, #0b1220 0%, #0f1a2e 50%, #0a1525 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.splash-overlay.hidden {
  display: none;
}

.splash-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 48px 40px 40px;
  max-width: 380px;
  width: 85%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.2);
  animation: splashSlideUp 0.5s ease;
}

@keyframes splashSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.splash-card__logo {
  margin-bottom: 24px;
}

.splash-card__logo img {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.splash-card h2 {
  margin: 0 0 8px;
  font-size: 1.6rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.splash-card p {
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
}

.splash-card__form {
  margin-top: 28px;
  text-align: left;
}

.splash-card__label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.splash-card__input {
  width: 100%;
  padding: 14px 16px;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
  text-align: center;
}

.splash-card__input:focus {
  border-color: var(--color-accent, #56B2BB);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(86, 178, 187, 0.15);
}

.splash-card__input::placeholder {
  color: #94a3b8;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
}

.splash-card__btn {
  width: 100%;
  margin-top: 16px;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--color-accent, #56B2BB) 0%, #3da8b1 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(86, 178, 187, 0.3);
}

.splash-card__btn:hover {
  background: linear-gradient(135deg, #4fb0b9 0%, #38a1aa 100%);
  box-shadow: 0 6px 16px rgba(86, 178, 187, 0.4);
  transform: translateY(-1px);
}

.splash-card__btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(86, 178, 187, 0.3);
}

.splash-card__btn:disabled {
  background: #cbd5e1;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.splash-card__footer {
  margin-top: 24px;
  font-size: 0.8rem;
  color: #94a3b8;
}

.splash-card__intro {
  color: #94a3b8;
  margin-bottom: 24px;
}

.splash-card__permissions {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  text-align: left;
}

.splash-card__permissions-title {
  font-size: 0.85rem;
  color: #1e293b;
  margin-bottom: 12px;
  font-weight: 500;
}

.splash-card__permissions-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
  color: #1e293b;
}

.splash-card__permissions-list li {
  margin-bottom: 8px;
  padding-left: 20px;
  position: relative;
}

.splash-card__permissions-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #60a5fa;
}

.splash-card__permissions-list strong {
  color: #0f172a;
}

.splash-card__permissions-note {
  font-size: 0.75rem;
  color: #334155;
  margin-top: 12px;
  margin-bottom: 0;
}

.splash-card p.splash-card__legal {
  margin-top: 80px;
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.5;
}

.splash-card__legal a {
  color: #60a5fa;
  text-decoration: none;
}

.splash-card__legal a:hover {
  text-decoration: underline;
}

.status-msg {
  margin-top: 16px;
  padding: 10px 14px;
  font-size: 0.9rem;
  color: #1e293b;
  background: #f1f5f9;
  border-radius: 8px;
}

.status-msg:empty {
  display: none;
}

/* Splash step transitions */
.splash-step {
  animation: splashFadeIn 0.3s ease;
}

.splash-step.hidden {
  display: none;
}

@keyframes splashFadeIn {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.splash-card__input--name {
  text-transform: none;
  letter-spacing: normal;
  text-align: left;
}

.splash-card__hint {
  margin-top: 8px;
  font-size: 0.8rem;
  color: #94a3b8;
  text-align: center;
}

.splash-card__back {
  margin-top: 16px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #64748b;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.splash-card__back:hover {
  color: #0f172a;
}

/* Onboarding printer step */
.splash-card__printer-area {
  margin-top: 20px;
}

.splash-card__printer-status {
  font-size: 0.9rem;
  color: #64748b;
  margin: 0 0 12px;
  text-align: center;
}

/* Scanning animation */
.splash-card__scanning {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 0 20px;
  gap: 20px;
}

.splash-card__scanning-rings {
  position: relative;
  width: 64px;
  height: 64px;
}

.splash-card__scanning-rings .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  opacity: 0;
  animation: scan-pulse 2s ease-out infinite;
}

.splash-card__scanning-rings .ring:nth-child(2) {
  animation-delay: 0.5s;
}

.splash-card__scanning-rings .ring:nth-child(3) {
  animation-delay: 1s;
}

.splash-card__scanning-rings .ring-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--color-accent);
  animation: scan-dot 2s ease-in-out infinite;
}

@keyframes scan-pulse {
  0% {
    transform: scale(0.3);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.2);
    opacity: 0;
  }
}

@keyframes scan-dot {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

.splash-card__scanning-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: #475569;
  letter-spacing: 0.02em;
}

.splash-card__scanning-text .dot-anim {
  display: inline-block;
  width: 1.5em;
  text-align: left;
  overflow: hidden;
  animation: dot-cycle 1.5s steps(4, end) infinite;
}

@keyframes dot-cycle {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

/* Hack: animating content doesn't work, use width clipping instead */
.splash-card__scanning-text .dot-anim::after {
  content: "...";
  display: inline-block;
  animation: dot-width 1.5s steps(4, end) infinite;
}

@keyframes dot-width {
  0% { width: 0; }
  25% { width: 0.4em; }
  50% { width: 0.8em; }
  75% { width: 1.2em; }
  100% { width: 0; }
}

.splash-card__printer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.splash-card__printer-list.hidden {
  display: none;
}

.splash-card__printer-item {
  border: 1px solid rgba(203, 213, 225, 0.6);
  border-radius: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  text-align: left;
  color: #1e293b;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.15s ease;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}

.splash-card__printer-item:active {
  background: #f1f5f9;
}

.splash-card__printer-item.is-paired {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.splash-card__printer-item .printer-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(86, 178, 187, 0.15);
  color: var(--color-accent);
}

.splash-card__printer-item.is-paired .printer-tag {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

.splash-card__btn--ghost {
  background: transparent;
  color: #475569;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.splash-card__btn--ghost:active {
  background: #f1f5f9;
}

.splash-card__skip {
  display: block;
  width: 100%;
  margin: 12px auto 0;
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.splash-card__skip:hover {
  background: #e2e8f0;
  color: #475569;
}

.splash-card__skip:active {
  background: #e2e8f0;
  transform: translateY(0);
}

/* Permission steps (camera, microphone) */
.splash-card__permission-status {
  font-size: 0.85rem;
  text-align: center;
  margin: 12px 0 0;
  font-weight: 500;
}
.splash-card__permission-status.is-granted {
  color: #16a34a;
}
.splash-card__permission-status.is-denied {
  color: #dc2626;
}
.splash-card__intro--note {
  font-size: 0.8rem;
  color: #94a3b8;
  font-style: italic;
  margin-top: 4px;
}

.wizard-visit-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wizard-visit-grid label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  display: inline-block;
  margin-bottom: 6px;
}

/* Safety redesign */
.safety-board {
  gap: 24px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.board-section.hidden,
.safety-board.hidden {
  display: none;
}

.safety-view.hidden {
  display: none;
}

.safety-home {
  padding: 12px 0 28px;
}

.safety-home__stack {
  width: 100%;
  max-width: 448px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.safety-home-card {
  position: relative;
  width: 100%;
  padding: 20px 20px 20px 24px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 0 0 1px var(--accent-shadow, rgba(15, 23, 42, 0.08)), 0 4px 20px -4px var(--accent-shadow-strong, rgba(15, 23, 42, 0.12));
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.safety-home-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 4px;
  border-radius: 999px;
  background: var(--accent);
}

.safety-home-card:hover {
  transform: scale(1.02);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 1px var(--accent-shadow-strong, rgba(15, 23, 42, 0.12)), 0 6px 24px -4px var(--accent-shadow-strong, rgba(15, 23, 42, 0.16));
}

.safety-home-card:active {
  transform: scale(0.98);
}

.safety-home-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--accent-bg);
}

.safety-home-card__icon svg {
  transition: transform 0.2s ease;
}

.safety-home-card:hover .safety-home-card__icon svg {
  transform: scale(1.1);
}

.safety-home-card__title {
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
}

.safety-home-card[data-safety-target="documents"] {
  --accent: #3b82f6;
  --accent-bg: rgba(59, 130, 246, 0.14);
  --accent-shadow: rgba(59, 130, 246, 0.15);
  --accent-shadow-strong: rgba(59, 130, 246, 0.2);
}

.safety-home-card[data-safety-target="muster"] {
  --accent: #14b8a6;
  --accent-bg: rgba(20, 184, 166, 0.14);
  --accent-shadow: rgba(20, 184, 166, 0.15);
  --accent-shadow-strong: rgba(20, 184, 166, 0.2);
}

.safety-home-card[data-safety-target="contacts"] {
  --accent: #f59e0b;
  --accent-bg: rgba(245, 158, 11, 0.14);
  --accent-shadow: rgba(245, 158, 11, 0.15);
  --accent-shadow-strong: rgba(245, 158, 11, 0.2);
}

.safety-home-card[data-safety-target="checklists"] {
  --accent: #22c55e;
  --accent-bg: rgba(34, 197, 94, 0.14);
  --accent-shadow: rgba(34, 197, 94, 0.15);
  --accent-shadow-strong: rgba(34, 197, 94, 0.2);
}

.safety-home-card.is-offline {
  opacity: 0.5;
  pointer-events: none;
  filter: grayscale(0.6);
}

.safety-home-card__offline-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.15);
  border-radius: 6px;
}

.safety-home-card__offline-badge.hidden {
  display: none;
}

.safety-view {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.safety-view__header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.safety-view__header--spacious {
  padding-bottom: 16px;
}

.safety-back-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  transition: background 0.18s ease, color 0.18s ease;
}

.safety-back-btn:hover {
  background: rgba(148, 163, 184, 0.2);
  color: #0f172a;
}

.safety-view__title h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
}

.safety-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #7c8aa0;
  margin-top: 2px;
}

.safety-breadcrumbs__link {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  cursor: pointer;
}

.safety-breadcrumbs__link:hover {
  color: #0f172a;
}

.safety-breadcrumbs__chevron {
  display: inline-flex;
  align-items: center;
  color: #cbd5e1;
}

.safety-breadcrumbs__current {
  color: #0f172a;
  font-weight: 600;
}

/* ── Safety: Muster List View ── */
.safety-view__subtitle {
  font-size: 0.78rem;
  color: #64748b;
  margin: 2px 0 0;
}
.safety-home-card--red .safety-home-card__icon { background: rgba(239, 68, 68, 0.1); }
.safety-home-card--red .safety-home-card__icon svg { stroke: #ef4444; }
.safety-home-card--red::before { background: #ef4444; }

.muster-list-tabs {
  display: flex;
  gap: 8px;
  padding: 50px 20px;
  margin: -36px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
}
.muster-list-tabs::-webkit-scrollbar { display: none; }
.muster-list-tab {
  flex: 0 0 auto;
  min-width: calc(25% - 6px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 14px;
  border-radius: 12px;
  border: 1.5px solid transparent;
  background: var(--tab-bg, rgba(241, 245, 249, 0.7));
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--tab-color, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.muster-list-tab--active {
  background: var(--tab-active-bg, white);
  border-color: var(--tab-color, #56b2bb);
  color: var(--tab-color, #0f172a);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.muster-list-tab__name { line-height: 1.2; }

.muster-list-alarm {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 20px 10px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(226, 232, 240, 0.6);
  background: rgba(255,255,255,0.8);
}
.muster-list-alarm__bar { display: none; }
.muster-list-alarm__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
}
.muster-list-alarm__label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin: 0;
  white-space: nowrap;
}
.muster-list-alarm__signal { font-size: 0.88rem; font-weight: 800; margin: 0; }
.muster-list-alarm__pattern { display: flex; align-items: center; gap: 4px; margin: 0; }
.muster-list-alarm__dash { height: 7px; border-radius: 4px; background: currentColor; opacity: 0.85; }
.muster-list-alarm__dash--short { width: 10px; }
.muster-list-alarm__dash--long { width: 28px; }
.muster-list-alarm__dash--continuous { width: 60px; }

.muster-list-notes { padding: 0 20px 8px; }
.muster-list-liferaft-notes {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 20px 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
}
.muster-list-liferaft-notes svg { flex-shrink: 0; }
.muster-list-liferaft-notes.hidden { display: none; }
.muster-list-notes__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(226, 232, 240, 0.4);
  background: rgba(241, 245, 249, 0.3);
  font-size: 0.78rem;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
}
.muster-list-notes__toggle svg { transition: transform 0.2s; }
.muster-list-notes__body {
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(241, 245, 249, 0.2);
  border: 1px solid rgba(226, 232, 240, 0.25);
  margin-top: 6px;
}
.muster-list-notes__item { font-size: 0.75rem; color: #64748b; line-height: 1.6; padding: 1px 0; text-align: center; }
.muster-list-notes__item--important { color: #f59e0b; font-weight: 600; }

.muster-list-crew { padding: 0 20px calc(140px + env(safe-area-inset-bottom, 0)); }
.muster-list-dept { margin-bottom: 10px; }
.muster-list-dept__header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  margin-bottom: 4px;
}
.muster-list-dept__name { font-size: 0.7rem; font-weight: 700; color: #f8fafc; letter-spacing: 0.08em; }
.muster-list-dept__count { font-size: 0.65rem; font-weight: 500; color: rgba(248, 250, 252, 0.6); }

.muster-list-crew-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid rgba(226, 232, 240, 0.5);
  background: rgba(255, 255, 255, 0.8);
  margin-bottom: 3px;
  animation: musterRowIn 0.25s ease-out both;
}
@keyframes musterRowIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.muster-list-crew-row__avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.muster-list-crew-row__avatar.has-photo { background: transparent !important; }
.muster-list-crew-row__avatar img { width: 100%; height: 100%; object-fit: cover; }
.muster-list-crew-row__info { flex: 1; min-width: 0; }
.muster-list-crew-row__name { font-size: 0.85rem; font-weight: 600; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; margin: 0; }
.muster-list-crew-row__role { font-size: 0.72rem; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; margin: 0; }
.muster-list-crew-row--on-leave { opacity: 0.45; }
.muster-list-crew-row__assignment { flex: 1; min-width: 0; }
.muster-list-crew-row__station { display: flex; align-items: center; gap: 5px; }
.muster-list-crew-row__station svg { flex-shrink: 0; }
.muster-list-crew-row__station span { font-size: 0.78rem; color: #475569; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.muster-list-crew-row__duties { display: flex; align-items: flex-start; gap: 5px; margin-top: 2px; }
.muster-list-crew-row__duties svg { flex-shrink: 0; margin-top: 1px; }
.muster-list-crew-row__duties span { font-size: 0.76rem; color: rgba(15, 23, 42, 0.6); line-height: 1.3; }
.muster-list-raft {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  margin-top: 4px;
  margin-left: auto;
}
.muster-list-raft--port { background: rgba(239, 68, 68, 0.1); color: #dc2626; }
.muster-list-raft--stbd { background: rgba(34, 197, 94, 0.1); color: #16a34a; }

/* ── Safety: Abandon Ship Stations View ── */
.abandon-sides { display: flex; flex-direction: column; gap: 16px; padding: 16px 20px; }
.abandon-side-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-radius: 16px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.06), 0 4px 20px -4px rgba(239, 68, 68, 0.1);
  width: 100%;
  text-align: left;
}
.abandon-side-card:active { transform: scale(0.98); }
.abandon-side-card__icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: rgba(239, 68, 68, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.abandon-side-card__icon svg { stroke: #ef4444; }
.abandon-side-card__info { flex: 1; }
.abandon-side-card__info h3 { font-size: 1.25rem; font-weight: 700; color: #0f172a; margin: 0; }
.abandon-side-card__info p { font-size: 0.82rem; color: #64748b; margin: 4px 0 0; }
.abandon-side-card__chevron { color: #94a3b8; flex-shrink: 0; }
.abandon-side-card--starboard { border-color: rgba(34,197,94,0.2); box-shadow: 0 0 0 1px rgba(34,197,94,0.06), 0 4px 20px -4px rgba(34,197,94,0.1); }
.abandon-side-card--starboard .abandon-side-card__icon { background: rgba(34,197,94,0.1); }
.abandon-side-card--starboard .abandon-side-card__icon svg { stroke: #22c55e; }

.abandon-view-content { padding: 0 0 calc(140px + env(safe-area-inset-bottom, 0)); }
.abandon-station { padding: 16px 20px; border-bottom: 1px solid rgba(226, 232, 240, 0.4); }
.abandon-station:last-child { border-bottom: none; }
.abandon-station__header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.abandon-station__icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.abandon-station__info h3 { font-size: 0.9rem; font-weight: 700; color: #0f172a; margin: 0; }
.abandon-station__info p { font-size: 0.75rem; color: #64748b; margin: 2px 0 0; }
.abandon-station__empty { text-align: center; color: #94a3b8; font-size: 0.82rem; padding: 16px 0; }

.abandon-station__comments { padding: 0 0 8px; text-align: center; }
.abandon-station__comments-label { font-size: 0.7rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
.abandon-station__comment { font-size: 0.95rem; font-weight: 600; color: #0f172a; padding: 8px 16px; background: #f0f9ff; border-radius: 8px; border-left: 3px solid #56b2bb; margin-bottom: 4px; display: inline-block; text-align: left; }

.abandon-station__crew { display: flex; flex-direction: column; gap: 8px; }
.abandon-member {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.5);
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}
.abandon-member--leader { background: rgba(239, 68, 68, 0.05); border-color: rgba(239, 68, 68, 0.2); }
.abandon-member--on-leave { opacity: 0.7; }
.abandon-member__avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.abandon-member__avatar.has-photo { background: none; }
.abandon-member__avatar img { width: 100%; height: 100%; object-fit: cover; }
.abandon-member--leader .abandon-member__avatar { background: rgba(239, 68, 68, 0.2); }
.abandon-member__left { flex: 1; display: flex; align-items: center; gap: 12px; }
.abandon-member__right { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; border-left: 1px solid rgba(226, 232, 240, 0.6); padding-left: 16px; min-height: 40px; justify-content: center; }
.abandon-member__info { flex: 1; min-width: 0; text-align: right; }
.abandon-member__name { font-size: 1.05rem; font-weight: 700; color: #0f172a; line-height: 1.2; margin: 0; }
.abandon-member__leader {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}
.abandon-member__role { font-size: 0.85rem; color: #64748b; margin: 1px 0 0; }
.abandon-member__duty { display: flex; align-items: center; gap: 6px; }
.abandon-member__duty span { font-size: 0.78rem; font-weight: 500; color: rgba(15, 23, 42, 0.8); }
.abandon-member__equipment { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.abandon-member__equip-tag {
  font-size: 0.68rem;
  padding: 3px 10px;
  border-radius: 9999px;
  background: rgba(59, 130, 246, 0.08);
  color: #3b82f6;
}

.safety-search {
  position: relative;
  margin: 8px 24px 12px;
}

.safety-search__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}

.safety-search input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(148, 163, 184, 0.18);
  font-size: 0.875rem;
  color: #0f172a;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.safety-search input:focus {
  border-color: rgba(86, 178, 187, 0.35);
  background: rgba(148, 163, 184, 0.25);
}

.safety-docs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 24px 24px;
}

.safety-doc-card {
  position: relative;
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 0 0 1px var(--accent-shadow, rgba(15, 23, 42, 0.08)), 0 4px 20px -4px var(--accent-shadow-strong, rgba(15, 23, 42, 0.12));
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.safety-doc-card:hover {
  transform: scale(1.01);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 1px var(--accent-shadow-strong, rgba(15, 23, 42, 0.12)), 0 6px 24px -4px var(--accent-shadow-strong, rgba(15, 23, 42, 0.16));
}

.safety-doc-card:active {
  transform: scale(0.99);
}

.safety-doc-card__accent {
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 4px;
  border-radius: 999px;
  background: var(--accent);
}

.safety-doc-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  background: var(--accent-bg, rgba(15, 23, 42, 0.06));
  color: var(--accent);
}

.safety-doc-card__icon svg {
  transition: transform 0.2s ease;
}

.safety-doc-card:hover .safety-doc-card__icon svg {
  transform: scale(1.1);
}

.safety-doc-card__content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.safety-doc-card__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.safety-doc-card__meta {
  font-size: 0.75rem;
  color: #7c8aa0;
}

.safety-doc-card__chevron {
  color: #94a3b8;
}

/* Offline status indicator (right side of card) */
.safety-doc-card__offline-status {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.safety-doc-card__offline-status--cached {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.safety-doc-card__offline-status--not-cached {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  cursor: pointer;
}

.safety-doc-card__offline-status--not-cached:active {
  transform: scale(0.9);
  background: rgba(148, 163, 184, 0.2);
}

.safety-doc-card__offline-status--downloading {
  background: rgba(16, 185, 129, 0.08);
  color: #10b981;
  position: relative;
}

/* Spinning progress ring */
.safety-doc-card__offline-status--downloading svg.progress-ring {
  animation: safety-spin 1.2s linear infinite;
}

@keyframes safety-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Card highlight when fully cached (folder or document) */
.safety-doc-card--cached {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.25);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.1), 0 4px 20px -4px rgba(16, 185, 129, 0.1);
}

.safety-doc-card--cached:hover {
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.15), 0 6px 24px -4px rgba(16, 185, 129, 0.15);
}

/* Green accent bar for cached cards */
.safety-doc-card--cached .safety-doc-card__accent {
  background: #10b981;
}

/* "Available offline" text in meta */
.safety-doc-card__meta--offline {
  color: #10b981;
  font-weight: 500;
}

/* Greyed out unavailable card (offline + not cached) */
.safety-doc-card--unavailable {
  opacity: 0.4;
  filter: grayscale(0.6);
  pointer-events: none;
  cursor: default;
}

.safety-empty {
  padding: 48px 24px;
  text-align: center;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.safety-empty__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(148, 163, 184, 0.6);
}

.safety-loading {
  padding: 16px 0;
  color: #7c8aa0;
}

.safety-contacts-content {
  padding: 16px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.safety-contacts-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7c8aa0;
  font-weight: 600;
}

.safety-contacts-title__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 0;
  background: transparent;
  color: #f59e0b;
}

.safety-contacts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.safety-contact-card {
  position: relative;
  padding: 18px;
  min-height: 70px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 0 0 1px var(--accent-shadow, rgba(245, 158, 11, 0.1)), 0 4px 20px -4px var(--accent-shadow-strong, rgba(15, 23, 42, 0.12));
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.safety-contact-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 1px var(--accent-shadow-strong, rgba(245, 158, 11, 0.2)), 0 6px 24px -4px var(--accent-shadow-strong, rgba(15, 23, 42, 0.16));
}

.safety-contact-card__accent {
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 4px;
  border-radius: 999px;
  background: var(--accent, #f59e0b);
}

.safety-contact-card__star {
  position: absolute;
  top: 12px;
  right: 12px;
  color: #f59e0b;
  width: 16px;
  height: 16px;
}

.safety-contact-card__body {
  display: flex;
  gap: 16px;
  padding-left: 8px;
  align-items: center;
}

.safety-contact-card__avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-bg, rgba(245, 158, 11, 0.15));
  color: var(--accent, #f59e0b);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.safety-contact-card__info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.safety-contact-card__name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.safety-contact-card__role {
  font-size: 0.75rem;
  color: #7c8aa0;
}

.safety-contact-card__methods {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
  min-height: 18px;
}

.safety-contact-card__method {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: rgba(15, 23, 42, 0.8);
  text-decoration: none;
}

.safety-contact-card__method:hover {
  color: rgba(15, 23, 42, 1);
}

.safety-contact-card__method-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent, #f59e0b);
}

/* ===============================
   Visitor Check-In Wizard (Kiosk)
=============================== */
.visitor-wizard {
  --wizard-bg: #f2f5f7;
  --wizard-card: #ffffff;
  --wizard-text: #1a2435;
  --wizard-muted: #6b7280;
  --wizard-border: #dbe1e7;
  --wizard-primary: #1fada2;
  --wizard-primary-strong: #178f86;
  --wizard-secondary: #e5e9ef;
  --wizard-muted-bg: #eef1f5;
  --wizard-glow: 0 20px 60px -15px rgba(31, 173, 162, 0.4);
  --wizard-card-shadow: 0 4px 20px -5px rgba(26, 36, 53, 0.15);
  background: var(--wizard-bg);
  align-items: flex-start;
  justify-content: center;
  padding: 24px clamp(16px, 4vw, 40px) calc(24px + env(safe-area-inset-bottom, 0px) + var(--keyboard-offset, 0px));
  z-index: 200;
  opacity: 1;
  transition: opacity 0.4s ease;
}

/* Dark mode for camera scan steps — reduces glare on glossy cards */
.visitor-wizard.wizard--scan-dark {
  --wizard-bg: #0f172a;
  --wizard-text: #e2e8f0;
  --wizard-muted: #94a3b8;
  --wizard-card: transparent;
  --wizard-card-shadow: none;
  --wizard-border: rgba(255,255,255,0.08);
}

.visitor-wizard .wizard-primary--muted {
  background: rgba(148,163,184,0.18);
  color: #94a3b8;
  box-shadow: none;
  font-weight: 500;
}
.visitor-wizard .wizard-primary--muted:active {
  background: rgba(148,163,184,0.3);
}

.visitor-wizard.visitor-wizard--exiting {
  opacity: 0;
  pointer-events: none;
}

.visitor-wizard.keyboard-visible {
  align-items: flex-start;
  padding-top: 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px) + var(--keyboard-offset, 0px));
}

.visitor-wizard .wizard-dialog {
  width: min(1100px, 96vw);
  min-height: min(920px, 96vh);
  max-height: calc(100vh - 32px);
  background: transparent;
  box-shadow: none;
  border-radius: 32px;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.visitor-wizard .wizard-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Only vehicle wizards need flex:1 to vertically center the mileage/fuel steps */
#vehicleCheckoutWizard .wizard-content,
#vehicleCheckinPrompt .wizard-content {
  flex: 1;
}

.visitor-wizard .wizard-home {
  position: absolute;
  top: 40px; /* clear of the iOS status bar */
  left: 24px;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  border: none;
  background: var(--wizard-card);
  color: var(--wizard-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--wizard-card-shadow);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
  z-index: 2;
}

.visitor-wizard .wizard-home:hover {
  background: var(--wizard-muted-bg);
  color: var(--wizard-text);
  transform: translateY(-1px);
}

.visitor-wizard .wizard-home--close {
  left: auto;
  right: 24px;
}

.visitor-wizard .wizard-step {
  flex: 1;
  display: flex;
  align-items: stretch;
  width: 100%;
}

.visitor-wizard .wizard-step-inner {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(28px, 6vh, 48px) clamp(18px, 4vw, 36px) clamp(24px, 5vh, 40px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
}

/* Agreement step: scrollable PDF fills the viewport */
.visitor-wizard .wizard-step[data-step="4"] .wizard-step-inner {
  min-height: 0;
  position: relative;
}

/* Signature: animated reveal instead of display:none */
.visitor-wizard .wizard-signature.is-locked {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  margin: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, max-height 0.4s ease, margin 0.3s ease;
}

.visitor-wizard .wizard-signature:not(.is-locked) {
  opacity: 1;
  max-height: 280px;
  transition: opacity 0.4s ease 0.15s, max-height 0.5s ease, margin 0.4s ease;
}

/* Shrink scroll box when signature is revealed — push signature to mid-screen */
.visitor-wizard .wizard-step-inner.agreement-unlocked .wizard-agreement-scroll {
  height: 15vh;
}

.visitor-wizard .wizard-step-inner--top {
  max-width: 680px;
  text-align: center;
  align-items: center;
}

.visitor-wizard .wizard-step-inner--center {
  max-width: 600px;
  text-align: center;
  align-items: center;
  justify-content: center;
}

.visitor-wizard .wizard-step[data-step="3"] .wizard-step-inner {
  text-align: center;
}

.visitor-wizard .wizard-step[data-step="5"] .wizard-step-inner {
  text-align: center;
  align-items: center;
}

/* Contact step is clamp()-relative (anchored to iPad Mini landscape, 1024px,
   so 1vw = 10.24px there) — scales as one composition up to the 13" Pro.
   px floors keep portrait from collapsing; never --ui-unit here. */
.visitor-wizard .wizard-step[data-step="2"] .wizard-step-inner {
  max-width: min(84vw, 1150px);
  padding-top: clamp(44px, 8vh, 64px);
  padding-left: clamp(18px, 4vw, 36px);
  padding-right: clamp(18px, 4vw, 36px);
  gap: clamp(10px, 1.2vw, 16px);
  align-items: stretch;
}

.visitor-wizard .wizard-step[data-step="2"] .wizard-input-stack {
  margin-top: -6px;
  transform: none;
}

.visitor-wizard .wizard-step[data-step="2"] .wizard-input-stack input {
  box-sizing: border-box;
  height: clamp(56px, 6.25vw, 85px);
  font-size: clamp(17px, 1.95vw, 27px);
  border-radius: clamp(14px, 1.6vw, 21px);
}

.visitor-wizard .wizard-step[data-step="2"] .wizard-input-with-icon input {
  padding-left: clamp(48px, 5.5vw, 75px);
}

.visitor-wizard .wizard-step[data-step="2"] .wizard-input-icon {
  left: clamp(14px, 1.75vw, 24px);
}

.visitor-wizard .wizard-step[data-step="2"] .wizard-input-icon svg {
  width: clamp(20px, 2.15vw, 29px);
  height: clamp(20px, 2.15vw, 29px);
}

/* Keyboard-safe contact row: fields side by side, Continue docked at the end.
   Everything stays above the iPad Mini landscape keyboard fold (~368px).
   Selector carries .wizard-input-stack: the base stack rule (flex-direction:
   column) sits later in this file at equal specificity and would win. */
.visitor-wizard .wizard-input-stack.wizard-contact-row {
  flex-direction: row;
  align-items: center;
  gap: clamp(12px, 1.4vw, 19px);
}

.visitor-wizard .wizard-contact-row .wizard-input-with-icon {
  flex: 1;
  min-width: 0;
}

.visitor-wizard .wizard-contact-next {
  flex: 0 0 clamp(84px, 9.4vw, 128px);
  height: clamp(56px, 6.25vw, 85px);
  border-radius: clamp(14px, 1.6vw, 21px);
  border: none;
  background: var(--wizard-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 36px -10px rgba(31, 173, 162, 0.55);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.visitor-wizard .wizard-contact-next svg {
  width: clamp(24px, 2.75vw, 37px);
  height: clamp(24px, 2.75vw, 37px);
}

.visitor-wizard .wizard-contact-next:hover:not(:disabled) {
  background: var(--wizard-primary-strong);
  transform: translateY(-1px);
}

.visitor-wizard .wizard-contact-next:disabled {
  background: #c3cdd4;
  box-shadow: none;
  cursor: not-allowed;
}

.visitor-wizard .wizard-step[data-step="1"] .wizard-remember {
  width: 100%;
  justify-content: center;
}

.visitor-wizard .wizard-step[data-step="7"] .wizard-heading {
  width: 100%;
  justify-content: center;
}


.visitor-wizard .wizard-step[data-step="6"] .wizard-heading {
  gap: 8px;
}

.visitor-wizard .wizard-step[data-step="6"] .wizard-heading__icon {
  width: 36px;
  height: 36px;
}

.visitor-wizard .wizard-step[data-step="6"] .wizard-heading__icon svg {
  width: 36px;
  height: 36px;
}

.visitor-wizard .wizard-heading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.visitor-wizard .wizard-heading__icon {
  width: 32px;
  height: 32px;
  color: var(--wizard-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.visitor-wizard .wizard-heading__icon--shield {
  flex: 0 0 auto;
  opacity: 1;
}

.visitor-wizard .wizard-heading__icon svg {
  width: 32px;
  height: 32px;
}

.visitor-wizard .wizard-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.1;
  font-weight: 700;
  color: var(--wizard-text);
  /* Heading adjustment */
  width: 100%;
  text-align: center;
  transform: translateX(32px);
}

.visitor-wizard .wizard-step-inner--center .wizard-title {
  transform: none;
  padding-right: 0;
}

.visitor-wizard .wizard-step[data-step="6"] .wizard-title {
  transform: translateX(20px);
}

.visitor-wizard .wizard-step[data-step="7"] .wizard-title {
  width: auto;
  transform: translateX(0);
}

.visitor-wizard .wizard-title--security-standalone {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.1;
  font-weight: 700;
  color: #dc2626;
  text-align: center;
}

.visitor-wizard .wizard-step[data-step="2"] .wizard-title {
  padding-right: 0;
  transform: translateX(0);
}

.visitor-wizard .wizard-subtitle {
  margin: 0;
  font-size: 1rem;
  color: var(--wizard-muted);
}

.visitor-wizard .wizard-input-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.visitor-wizard .wizard-input-stack input {
  width: 100%;
  height: 64px;
  border-radius: 16px;
  border: 2px solid var(--wizard-border);
  background: var(--wizard-card);
  font-size: 1.5rem;
  text-align: center;
  color: var(--wizard-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.visitor-wizard .wizard-input-stack input:focus {
  outline: none;
  border-color: var(--wizard-primary);
  box-shadow: 0 0 0 4px rgba(31, 173, 162, 0.15);
}

.visitor-wizard .wizard-input-with-icon {
  position: relative;
  width: 100%;
}

.visitor-wizard .wizard-input-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--wizard-muted);
}

.visitor-wizard .wizard-input-with-icon input {
  padding-left: 56px;
}

.visitor-wizard .wizard-search-details {
  width: 100%;
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.visitor-wizard .wizard-field {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}

.visitor-wizard .wizard-field label {
  font-weight: 600;
  color: var(--wizard-text);
}

.visitor-wizard .wizard-select {
  width: 100%;
  height: 60px;
  border-radius: 16px;
  border: 2px solid var(--wizard-border);
  background: var(--wizard-card);
  font-size: 1.1rem;
  text-align: center;
  color: var(--wizard-text);
  padding: 0 18px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.visitor-wizard .wizard-select:focus {
  outline: none;
  border-color: var(--wizard-primary);
  box-shadow: 0 0 0 4px rgba(31, 173, 162, 0.15);
}

.visitor-wizard .wizard-id-type-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.visitor-wizard .wizard-id-type-btn {
  padding: 10px 20px;
  border-radius: 14px;
  border: 2px solid var(--wizard-border);
  background: var(--wizard-card);
  color: var(--wizard-text);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.visitor-wizard .wizard-id-type-btn:active {
  transform: scale(0.97);
}
.visitor-wizard .wizard-id-type-btn.is-selected {
  border-color: var(--wizard-primary);
  background: rgba(31, 173, 162, 0.08);
  color: var(--wizard-primary);
  font-weight: 600;
}

.visitor-wizard .wizard-company-suggestions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: min(220px, 30vh);
  overflow-y: auto;
  border: 2px solid var(--wizard-border);
  border-radius: 16px;
  background: var(--wizard-card);
  box-shadow: var(--wizard-card-shadow);
}
.visitor-wizard .wizard-company-suggestions.hidden { display: none; }
.visitor-wizard .wizard-company-suggestion {
  padding: 14px 18px;
  font-size: 1.1rem;
  color: var(--wizard-text);
  cursor: pointer;
  border-bottom: 1px solid var(--wizard-border);
  transition: background 0.15s;
}
.visitor-wizard .wizard-company-suggestion:last-child { border-bottom: none; }
.visitor-wizard .wizard-company-suggestion:first-child {
  background: rgba(31, 173, 162, 0.08);
}
.visitor-wizard .wizard-company-suggestion:active {
  background: rgba(31, 173, 162, 0.15);
}
.visitor-wizard .wizard-company-suggestion .company-match {
  font-weight: 600;
  color: var(--wizard-primary);
}
.visitor-wizard .wizard-company-suggestion--fuzzy {
  font-style: italic;
  color: var(--wizard-muted);
  font-size: 0.95rem;
}
.visitor-wizard .wizard-company-suggestion--fuzzy::before {
  content: "Did you mean: ";
  font-weight: 400;
}

.visitor-wizard .wizard-remembered-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: min(220px, 30vh);
  overflow-y: auto;
  border: 2px solid var(--wizard-border);
  border-radius: 16px;
  background: var(--wizard-card);
  box-shadow: var(--wizard-card-shadow);
}
.visitor-wizard .wizard-remembered-list.hidden { display: none; }

.visitor-wizard .wizard-remembered-list::-webkit-scrollbar {
  width: 8px;
}

.visitor-wizard .wizard-remembered-list::-webkit-scrollbar-thumb {
  background: rgba(31, 173, 162, 0.25);
  border-radius: 999px;
}

.visitor-wizard .wizard-remembered-item {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--wizard-border);
  background: transparent;
  box-shadow: none;
  padding: 14px 18px;
  text-align: center;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.visitor-wizard .wizard-remembered-item:last-child { border-bottom: none; }
.visitor-wizard .wizard-remembered-item:first-child {
  background: rgba(31, 173, 162, 0.08);
}
.visitor-wizard .wizard-remembered-item:active {
  background: rgba(31, 173, 162, 0.15);
}

.visitor-wizard .wizard-remembered-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--wizard-text);
}

.visitor-wizard .wizard-remembered-meta {
  font-size: 0.95rem;
  color: var(--wizard-muted);
}
.visitor-wizard .wizard-remembered-meta::before {
  content: "·";
  margin-right: 0;
}

.visitor-wizard .wizard-remembered-empty {
  margin: 0;
  text-align: center;
  color: var(--wizard-muted);
  font-size: 0.9rem;
}

.visitor-wizard .wizard-remember {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.05rem;
  color: var(--wizard-muted);
}

.visitor-wizard .wizard-remember input {
  width: 22px;
  height: 22px;
  accent-color: var(--wizard-primary);
}

.visitor-wizard .wizard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 4px 2px;
  max-height: min(420px, 55vh);
  overflow-y: auto;
}

.visitor-wizard .wizard-grid::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

.visitor-wizard .wizard-grid::-webkit-scrollbar-thumb {
  background: rgba(31, 173, 162, 0.35);
  border-radius: 999px;
}

.visitor-wizard .wizard-host-option,
.visitor-wizard .wizard-crew-option {
  border-radius: 16px;
  border: 2px solid var(--wizard-border);
  background: var(--wizard-card);
  box-shadow: var(--wizard-card-shadow);
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.visitor-wizard .wizard-host-option:hover,
.visitor-wizard .wizard-crew-option:hover {
  border-color: rgba(31, 173, 162, 0.5);
  transform: translateY(-1px);
}

.visitor-wizard .wizard-host-option.is-selected,
.visitor-wizard .wizard-crew-option.is-selected {
  border-color: var(--wizard-primary);
  background: rgba(31, 173, 162, 0.08);
  box-shadow: var(--wizard-glow);
}

.visitor-wizard .wizard-host-avatar,
.visitor-wizard .wizard-crew-avatar {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: var(--wizard-muted-bg);
  color: var(--wizard-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  overflow: hidden;
}

.visitor-wizard .wizard-crew-avatar .wizard-crew-initials {
  position: relative;
  z-index: 0;
}

.visitor-wizard .wizard-crew-avatar img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
  z-index: 1;
}

.visitor-wizard .wizard-host-option.is-selected .wizard-host-avatar,
.visitor-wizard .wizard-crew-option.is-selected .wizard-crew-avatar {
  background: var(--wizard-primary);
  color: #fff;
}

.visitor-wizard .wizard-host-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.visitor-wizard .wizard-host-name,
.visitor-wizard .wizard-crew-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--wizard-text);
}

.visitor-wizard .wizard-host-role,
.visitor-wizard .wizard-crew-role {
  font-size: 0.75rem;
  color: var(--wizard-muted);
}

.wizard-crew-ashore {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: rgba(244, 114, 100, 0.12);
  color: #f47264;
  padding: 1px 6px;
  border-radius: 6px;
}

.visitor-wizard .wizard-empty {
  text-align: center;
  color: var(--wizard-muted);
  padding: 12px 0;
}

.visitor-wizard .wizard-agreement-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

/* Agreement step: match visitor wizard — let content push button below fold */
#vehicleCheckoutWizard .wizard-step[data-step="1"] .wizard-step-inner {
  min-height: 0;
  position: relative;
}

.visitor-wizard .wizard-agreement-scroll {
  background: var(--wizard-card);
  border-radius: 16px;
  border: 2px solid var(--wizard-border);
  box-shadow: var(--wizard-card-shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  overflow-y: auto;
  color: var(--wizard-text);
  line-height: 1.6;
  height: calc(100vh - 320px);
  flex: none;
  transition: height 0.4s ease;
}

.visitor-wizard .wizard-agreement-placeholder {
  text-align: center;
  color: var(--wizard-muted);
  font-size: 0.95rem;
  padding: 18px 12px;
}

.visitor-wizard .wizard-agreement-viewer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.visitor-wizard .wizard-agreement-viewer .pdfjs-page {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  flex: 0 0 auto;
  width: min(960px, 100%);
  margin: 0 auto;
}

.visitor-wizard .wizard-agreement-viewer .pdfjs-page canvas {
  display: block;
  width: 100%;
  height: auto;
  flex: 0 0 auto;
}

.visitor-wizard .wizard-agreement-scroll h4,
.visitor-wizard .wizard-agreement-scroll h5 {
  margin: 16px 0 8px;
  font-weight: 700;
}

.visitor-wizard .wizard-agreement-footer {
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--wizard-muted-bg);
  border-radius: 12px;
  font-size: 0.9rem;
  color: var(--wizard-muted);
}

.visitor-wizard .wizard-agreement-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #e8725a;
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: -60px;
  position: relative;
  z-index: 2;
  background: linear-gradient(transparent, var(--wizard-bg) 65%);
  padding: 24px 20px 8px;
  width: 100%;
  box-sizing: border-box;
  transition: opacity 0.3s ease;
}

.visitor-wizard .wizard-agreement-hint.hidden {
  opacity: 0;
  pointer-events: none;
}

.visitor-wizard .wizard-agreement-hint__chevron {
  display: inline-flex;
  animation: wizard-hint-bounce 1.4s ease-in-out infinite;
}

.visitor-wizard .wizard-agreement-hint__chevron:last-child {
  animation-delay: 0.2s;
}

@keyframes wizard-hint-bounce {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.6;
  }
  50% {
    transform: translateY(6px);
    opacity: 1;
  }
}

@keyframes wizard-step-fade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.visitor-wizard .wizard-agreement-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.visitor-wizard .wizard-supplemental {
  align-items: center;
  text-align: center;
}

.visitor-wizard .wizard-checkbox {
  color: var(--wizard-text);
}

.visitor-wizard .wizard-nda-link {
  color: var(--wizard-primary);
  font-weight: 600;
  text-decoration: underline;
}

.visitor-wizard .wizard-nda-link.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.visitor-wizard .wizard-signature {
  margin-top: 8px;
}

.visitor-wizard .signature-pad {
  border: 2px dashed rgba(31, 173, 162, 0.35);
  border-radius: 18px;
  background: var(--wizard-card);
}

.visitor-wizard .signature-pad__actions .link-button {
  background: none;
  border: none;
  color: var(--wizard-primary);
  font-weight: 600;
  cursor: pointer;
}

.visitor-wizard .wizard-photo {
  background: #0f172a;
  border-radius: 20px;
  overflow: hidden;
}

.visitor-wizard .wizard-id-photo__note {
  font-size: 0.95rem;
  color: var(--wizard-muted);
  margin: 0;
}

.visitor-wizard .wizard-id-photo {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.visitor-wizard .wizard-id-photo__verified {
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(34, 197, 94, 0.14);
  color: #15803d;
  font-weight: 600;
  text-align: center;
}

.visitor-wizard .wizard-id-photo__frame {
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 24px;
  border: 2px solid var(--wizard-border);
  background: #0f172a;
  box-shadow: var(--wizard-card-shadow);
  position: relative;
  overflow: hidden;
}

.visitor-wizard .wizard-id-photo__verified-overlay {
  position: absolute;
  inset: 0;
  background: rgba(34, 197, 94, 0.9);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 4;
}

.visitor-wizard .wizard-id-photo__verified-overlay.is-active {
  opacity: 1;
  transform: scale(1);
  animation: id-verify-flash 0.45s ease-out;
}

.visitor-wizard .wizard-id-photo__verified-overlay svg {
  width: 72px;
  height: 72px;
  stroke: currentColor;
}

.visitor-wizard .wizard-id-photo__badge-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.visitor-wizard .wizard-id-photo__badge-overlay svg {
  opacity: 0.5;
}

.visitor-wizard .wizard-id-photo__frame video,
.visitor-wizard .wizard-id-photo__still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  z-index: 2;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.visitor-wizard .wizard-id-photo__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.visitor-wizard .wizard-id-photo__capture {
  width: 72px;
  padding: 0;
  margin-left: auto;
  background: var(--wizard-primary-strong);
}

.visitor-wizard .wizard-id-photo__capture svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.visitor-wizard .wizard-id-photo__retake {
  margin-left: auto;
}

.visitor-wizard .wizard-photo-btn--timer {
  gap: 8px;
  padding: 0 20px;
}

.visitor-wizard .wizard-photo-btn--timer svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.visitor-wizard .wizard-photo-btn--timer.is-active {
  background: rgba(31, 173, 162, 0.14);
  color: var(--wizard-primary);
}

.visitor-wizard .wizard-id-photo__countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  font-weight: 800;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.45);
  z-index: 10;
  pointer-events: none;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
}

.visitor-wizard .wizard-id-photo__flash {
  position: absolute;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 11;
  pointer-events: none;
}

.visitor-wizard .wizard-id-photo__flash.is-active {
  opacity: 0.85;
}

@keyframes id-verify-flash {
  0% {
    opacity: 0.3;
    filter: brightness(1.2);
  }
  100% {
    opacity: 1;
    filter: brightness(1);
  }
}

.visitor-wizard .wizard-photo__countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 700;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.35);
  z-index: 3;
  pointer-events: none;
}

.visitor-wizard .wizard-photo__flash {
  position: absolute;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
  pointer-events: none;
}

.visitor-wizard .wizard-photo__flash.is-active {
  opacity: 0.85;
}

@media (orientation: landscape) {
  .visitor-wizard .wizard-actions {
    padding-bottom: env(safe-area-inset-bottom, 12px);
  }

  .visitor-wizard .wizard-step[data-step="3"] .wizard-id-photo__frame {
    max-width: 720px;
    max-height: 45vh;
    margin: 0 auto;
  }

  .visitor-wizard .wizard-step[data-step="6"] .wizard-photo {
    max-width: 720px;
    max-height: 45vh;
    margin: 0 auto;
  }

}

/* Summary step is clamp()-relative (anchored to iPad Mini landscape, 1024px)
   and compact in both orientations — the clamp floors keep portrait sane. */
.visitor-wizard .wizard-step[data-step="9"] .wizard-step-inner {
  padding-top: clamp(10px, 1.6vh, 18px);
  padding-bottom: clamp(6px, 1.1vh, 12px);
  gap: clamp(8px, 1.3vh, 14px);
}

/* Compact review card: photo beside a 2x2 grid of details — landscape iPads
   have spare width, not height, so the card spends width to fit the Mini. */
.visitor-wizard .wizard-overview-card {
  background: var(--wizard-card);
  border-radius: clamp(20px, 2.35vw, 32px);
  border: 2px solid var(--wizard-border);
  box-shadow: var(--wizard-card-shadow);
  padding: clamp(14px, 1.6vw, 21px);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(14px, 1.6vw, 21px);
}

.visitor-wizard .wizard-overview-photo {
  position: relative;
  width: clamp(72px, 7.8vw, 107px);
  height: clamp(72px, 7.8vw, 107px);
  border-radius: 999px;
  background: var(--wizard-muted-bg);
  color: var(--wizard-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin: 0;
  flex: 0 0 auto;
  overflow: hidden;
}

.visitor-wizard .wizard-overview-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.visitor-wizard .wizard-overview-photo__fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wizard-muted);
}

.visitor-wizard .wizard-overview-list {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 1vw, 14px);
}

.visitor-wizard .wizard-overview-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: var(--wizard-muted-bg);
  border-radius: clamp(12px, 1.4vw, 19px);
  padding: clamp(10px, 1.2vw, 16px) clamp(12px, 1.4vw, 19px);
  gap: clamp(10px, 1.2vw, 16px);
  text-align: left;
}

.visitor-wizard .wizard-overview-icon {
  width: clamp(32px, 3.5vw, 48px);
  height: clamp(32px, 3.5vw, 48px);
  border-radius: clamp(10px, 1.2vw, 16px);
  background: #fff;
  color: var(--wizard-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(26, 36, 53, 0.08);
  flex-shrink: 0;
}

.visitor-wizard .wizard-overview-icon svg {
  width: clamp(18px, 2.15vw, 29px);
  height: clamp(18px, 2.15vw, 29px);
}

.visitor-wizard .wizard-overview-photo__fallback svg {
  width: clamp(28px, 3.5vw, 48px);
  height: clamp(28px, 3.5vw, 48px);
}

.visitor-wizard .wizard-overview-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.visitor-wizard .wizard-overview-label {
  margin: 0;
  font-size: clamp(12.5px, 1.4vw, 19px);
  color: var(--wizard-muted);
  text-transform: none;
  letter-spacing: 0;
}

.visitor-wizard .wizard-overview-value {
  margin: 0;
  font-size: clamp(15px, 1.75vw, 24px);
  font-weight: 600;
  color: var(--wizard-text);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  word-break: break-word;
}

.visitor-wizard .wizard-overview-role {
  font-size: clamp(12.5px, 1.4vw, 19px);
  font-weight: 500;
  color: var(--wizard-muted);
}

.visitor-wizard .wizard-pin-card {
  width: min(384px, 100%);
  margin: 0 auto;
  padding: 24px;
  border-radius: 24px;
  background: var(--wizard-card);
  border: 2px solid var(--wizard-border);
  box-shadow: var(--wizard-card-shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.visitor-wizard .wizard-pin-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--wizard-text);
}

.visitor-wizard .wizard-pin-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: var(--wizard-muted);
}

.visitor-wizard .wizard-pin-help {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: center;
  color: var(--wizard-muted);
}

.visitor-wizard .wizard-step[data-step="7"] .wizard-pin-help {
  display: flex;
}

.visitor-wizard .wizard-pin-help__line {
  width: 100%;
  height: 1px;
  background: var(--wizard-border);
}

.visitor-wizard .wizard-pin-help p {
  margin: 0;
}

.visitor-wizard .wizard-pin-card input {
  height: 64px;
  border-radius: 16px;
  border: 2px solid var(--wizard-border);
  font-size: 1.875rem;
  text-align: center;
  letter-spacing: 0.1em;
}

.visitor-wizard .wizard-pin-card input::placeholder {
  font-size: 1.1rem;
  letter-spacing: 0.18em;
  color: var(--wizard-muted);
}

.visitor-wizard .wizard-crew-search {
  width: 100%;
  margin-bottom: 16px;
}

.visitor-wizard .wizard-pill-input {
  border-radius: 999px;
  border: 2px solid var(--wizard-border);
  background: var(--wizard-card);
  padding: 4px 18px;
}

.visitor-wizard .wizard-pill-input input {
  font-size: 1rem;
  padding: 12px 0;
}

.visitor-wizard .wizard-print-preview {
  background: var(--wizard-card);
  border-radius: 24px;
  border: 2px solid var(--wizard-border);
  box-shadow: var(--wizard-card-shadow);
  padding: 18px;
}

.visitor-wizard .wizard-inline-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.visitor-wizard .wizard-primary,
.visitor-wizard .wizard-secondary {
  height: 64px;
  padding: 0 28px;
  border-radius: 16px;
  font-size: 1.25rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.visitor-wizard .wizard-primary:active:not(:disabled),
.visitor-wizard .wizard-secondary:active:not(:disabled) {
  transform: scale(0.98);
}

.visitor-wizard .wizard-primary {
  background: var(--wizard-primary);
  color: #fff;
  box-shadow: var(--wizard-glow);
}

.visitor-wizard .wizard-primary--assist {
  background: #22c55e;
  box-shadow: 0 20px 60px -15px rgba(34, 197, 94, 0.45);
}

@media (hover: hover) and (pointer: fine) {
  .visitor-wizard .wizard-primary--assist:hover:not(:disabled) {
    background: #16a34a;
  }

  .visitor-wizard .wizard-primary:hover:not(:disabled) {
    background: var(--wizard-primary-strong);
  }
}

.visitor-wizard .wizard-primary:disabled {
  background: #b0bec5;
  box-shadow: none;
  cursor: not-allowed;
}

.visitor-wizard .wizard-dialog.wizard-dialog--fade {
  animation: wizard-step-fade 0.24s ease-out;
}

.visitor-wizard .wizard-primary--full {
  width: 100%;
}

.visitor-wizard .wizard-primary--lg {
  height: 80px;
  border-radius: 24px;
  font-size: 1.5rem;
  padding: 0 36px;
}

.visitor-wizard .wizard-secondary {
  background: var(--wizard-secondary);
  color: var(--wizard-text);
}

.visitor-wizard .wizard-secondary--assist,
.visitor-wizard .wizard-secondary--home {
  width: 100%;
}

.visitor-wizard .wizard-actions {
  position: static;
  margin-top: auto;
  padding-top: 8px;
  width: 100%;
  background: none;
}

.visitor-wizard .wizard-actions--stacked {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 16px;
}

.visitor-wizard .wizard-actions--stacked .wizard-primary,
.visitor-wizard .wizard-actions--stacked .wizard-secondary {
  flex: 0 0 auto;
  width: 100%;
}

.visitor-wizard .wizard-step[data-step="7"] .wizard-actions {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 16px;
}

.visitor-wizard .wizard-step[data-step="7"] .wizard-actions .wizard-primary,
.visitor-wizard .wizard-step[data-step="7"] .wizard-actions .wizard-secondary {
  flex: 0 0 auto;
  width: 100%;
}

.visitor-wizard .wizard-next__label {
  flex: 1;
  text-align: center;
}

.visitor-wizard .wizard-next__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.visitor-wizard .wizard-error {
  color: #d14343;
  font-size: 0.95rem;
  text-align: center;
}

.wizard-skip-photo {
  display: block;
  margin: 12px auto 0;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #94a3b8;
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}
.wizard-skip-photo.hidden { display: none; }

.visitor-wizard .wizard-dialog--success .wizard-content {
  flex: 1;
}

.visitor-wizard .wizard-step[data-step="10"] {
  background: #f2f5f7;
}

.visitor-wizard .wizard-step[data-step="10"] .wizard-step-inner {
  flex: 1;
  justify-content: center;
}

.visitor-wizard .wizard-complete-icon {
  width: 128px;
  height: 128px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  animation: vrs-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

.visitor-wizard .wizard-complete-icon svg {
  width: 48px;
  height: 48px;
}

.visitor-wizard .wizard-step[data-step="10"] .wizard-title {
  margin: 0;
  font-size: 2.8rem;
  font-weight: 800;
  color: #1a2435;
  animation: vrs-slide-up 0.5s ease-out 0.4s both;
}

.visitor-wizard .wizard-step[data-step="10"] .wizard-subtitle {
  margin: 0;
  color: #64748b;
  font-size: 1.1rem;
  animation: vrs-slide-up 0.5s ease-out 0.5s both;
}

.visitor-wizard .wizard-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
  opacity: 0;
  transform: scale(0.98);
  pointer-events: none;
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.visitor-wizard .wizard-modal.wizard-modal--visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.visitor-wizard.wizard-modal-open .wizard-dialog,
.visitor-wizard.wizard-modal-open .wizard-actions {
  pointer-events: none;
}

.visitor-wizard .wizard-modal__card {
  width: min(600px, 92vw);
  background: var(--wizard-card);
  border-radius: 28px;
  padding: 36px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  gap: 16px;
  opacity: 0;
  transform: translateY(30px) scale(0.98);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
  will-change: transform, opacity;
}

.visitor-wizard .wizard-modal__card h3 {
  margin: 0;
  font-size: 1.6rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease-out, transform 0.45s ease-out;
  transition-delay: 0.1s;
  will-change: transform, opacity;
}

.visitor-wizard .wizard-modal__card p {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease-out, transform 0.45s ease-out;
  transition-delay: 0.2s;
  will-change: transform, opacity;
}

.visitor-wizard .wizard-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease-out, transform 0.45s ease-out;
  transition-delay: 0.2s;
  will-change: transform, opacity;
}

.visitor-wizard .wizard-modal.wizard-modal--visible .wizard-modal__card,
.visitor-wizard .wizard-modal.wizard-modal--visible .wizard-modal__card h3,
.visitor-wizard .wizard-modal.wizard-modal--visible .wizard-modal__card p,
.visitor-wizard .wizard-modal.wizard-modal--visible .wizard-modal__actions {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (min-width: 720px) {
  .visitor-wizard .wizard-modal__actions {
    flex-direction: row;
  }

  .visitor-wizard .wizard-modal__actions .wizard-primary,
  .visitor-wizard .wizard-modal__actions .wizard-secondary {
    flex: 1;
  }
}

@media (max-width: 900px) {
  .visitor-wizard .wizard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .visitor-checkout-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .visitor-wizard {
    padding: 18px 14px;
  }

  .visitor-wizard .wizard-dialog {
    min-height: auto;
  }

  .visitor-wizard .wizard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .visitor-checkout-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .visitor-scan-modal__title {
    font-size: 1.8rem;
  }

  .visitor-scan-modal .wizard-primary,
  .visitor-scan-modal .wizard-secondary {
    height: 72px;
    min-height: 72px;
    font-size: 1.3rem;
    border-radius: 20px;
  }

  .visitor-scan-modal__topbar,
  .visitor-scan-modal__inner {
    width: min(860px, 92vw);
    margin-left: auto;
    margin-right: auto;
  }

  .visitor-scan-modal__frame {
    width: min(520px, 85vw);
  }

  .visitor-scan-modal__actions {
    width: min(520px, 85vw);
  }

  .visitor-wizard .wizard-primary,
  .visitor-wizard .wizard-secondary {
    height: 60px;
    font-size: 1.05rem;
  }

  .visitor-wizard .wizard-primary--lg {
    height: 72px;
    font-size: 1.3rem;
    border-radius: 20px;
  }

  .visitor-wizard .wizard-title {
    font-size: 1.8rem;
  }
}

/* ========================================
   Offline Banner
======================================== */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: linear-gradient(135deg, #1e5a8a 0%, #2d7ab8 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  z-index: 99999;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.offline-banner svg {
  flex-shrink: 0;
  opacity: 0.9;
}

.offline-banner span {
  white-space: nowrap;
}

/* ========================================
   Printer Offline Banner
======================================== */
.printer-offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: linear-gradient(135deg, #92400e 0%, #b45309 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  z-index: 99998;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: opacity 0.3s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.printer-offline-banner svg {
  flex-shrink: 0;
  opacity: 0.9;
}

.printer-offline-banner span {
  white-space: nowrap;
}

/* When both banners show, push printer banner below network banner */
body.has-offline-banner .printer-offline-banner {
  top: 36px;
}

/* ========================================
   App Update Banner
======================================== */
.update-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: linear-gradient(135deg, #92400e 0%, #b45309 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  z-index: 99997;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.update-banner svg {
  flex-shrink: 0;
  opacity: 0.9;
}

.update-banner span {
  white-space: nowrap;
}

/* Stack update banner below other banners */
body.has-offline-banner .update-banner {
  top: 36px;
}
body.has-printer-banner .update-banner {
  top: 36px;
}
body.has-offline-banner.has-printer-banner .update-banner {
  top: 72px;
}

/* Banner dismiss — entire banner is tappable */
.banner-dismiss {
  display: none;
}

/* ============================================
   Tutorial Overlays
   ============================================ */

.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  animation: tutorialFadeIn 0.4s ease forwards;
}

.tutorial-overlay.is-closing {
  animation: tutorialFadeOut 0.3s ease forwards;
}

.tutorial-card {
  position: relative;
  width: 90%;
  max-width: 280px;
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 20px;
  padding: 28px 24px 20px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  animation: tutorialCardIn 0.4s 0.1s ease forwards;
}

.is-closing .tutorial-card {
  animation: tutorialCardOut 0.3s ease forwards;
}

.tutorial-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: rgba(148, 163, 184, 0.6);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tutorial-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.tutorial-text {
  text-align: center;
}

.tutorial-text h3 {
  font-size: 14px;
  font-weight: 600;
  color: #f1f5f9;
  margin: 0 0 6px;
}

.tutorial-text p {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
  margin: 0;
}

.tutorial-dismiss {
  font-size: 12px;
  font-weight: 500;
  color: rgba(148, 163, 184, 0.7);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 12px;
}

/* Swipe demo */
.tutorial-swipe-demo {
  position: relative;
  width: 100%;
  height: 56px;
  border-radius: 14px;
  background: rgba(51, 65, 85, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.15);
  overflow: hidden;
}

.tutorial-swipe-reveal {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  padding-right: 14px;
}

.tutorial-swipe-reveal span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(52, 211, 153, 0.8);
}

.tutorial-swipe-surface {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  animation: tutorialSwipeCard 3s ease-in-out 0.8s infinite;
}

.tutorial-swipe-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(51, 65, 85, 0.8);
  border: 2px solid rgba(148, 163, 184, 0.25);
  flex-shrink: 0;
}

.tutorial-swipe-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tutorial-swipe-lines .line1 {
  height: 8px;
  width: 64px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.2);
}

.tutorial-swipe-lines .line2 {
  height: 6px;
  width: 40px;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.1);
}

.tutorial-finger {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  animation: tutorialSwipeFinger 3s ease-in-out 0.8s infinite;
  opacity: 0;
}

.tutorial-finger svg {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Selfie/Photo demo */
.tutorial-photo-demo {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tutorial-ripple {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(99, 102, 241, 0.3);
  animation: tutorialRipple 2.5s ease-out 0.8s infinite;
}

.tutorial-ripple:nth-child(2) {
  border-color: rgba(99, 102, 241, 0.2);
  animation: tutorialRipple2 2.5s ease-out 0.95s infinite;
}

.tutorial-photo-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(51, 65, 85, 0.8);
  border: 2px solid rgba(148, 163, 184, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  animation: tutorialAvatarPulse 2.5s ease-in-out 0.8s infinite;
}

.tutorial-camera-icon {
  opacity: 0;
  animation: tutorialCameraFlash 2.5s ease-out 0.8s infinite;
}

.tutorial-camera-icon svg {
  width: 24px;
  height: 24px;
  color: rgba(99, 102, 241, 0.7);
  stroke: rgba(99, 102, 241, 0.7);
  fill: none;
}

.tutorial-photo-finger {
  position: absolute;
  opacity: 0;
  animation: tutorialTapFinger 2.5s ease-in-out 0.8s infinite;
}

.tutorial-photo-finger svg {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Keyframes */
@keyframes tutorialFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes tutorialFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes tutorialCardIn {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes tutorialCardOut {
  from { transform: scale(1) translateY(0); opacity: 1; }
  to { transform: scale(0.9) translateY(20px); opacity: 0; }
}

.tutorial-body {
  transition: opacity 0.25s ease;
}
.tutorial-body.tutorial-step-transition {
  opacity: 0;
}

@keyframes tutorialSwipeCard {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(-80px); }
  55%  { transform: translateX(-80px); }
  80%  { transform: translateX(0); }
  100% { transform: translateX(0); }
}

@keyframes tutorialSwipeFinger {
  0%   { right: -30px; opacity: 0; }
  10%  { opacity: 1; }
  25%  { right: 100px; opacity: 1; }
  55%  { right: 100px; opacity: 1; }
  70%  { right: 100px; opacity: 0; }
  100% { right: -30px; opacity: 0; }
}

@keyframes tutorialRipple {
  0%   { transform: scale(1); opacity: 0.5; }
  40%  { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}

@keyframes tutorialRipple2 {
  0%   { transform: scale(1); opacity: 0.3; }
  50%  { transform: scale(1.8); opacity: 0; }
  100% { transform: scale(1.8); opacity: 0; }
}

@keyframes tutorialAvatarPulse {
  0%   { transform: scale(1); }
  12%  { transform: scale(0.9); }
  24%  { transform: scale(1); }
  100% { transform: scale(1); }
}

@keyframes tutorialCameraFlash {
  0%   { opacity: 0; transform: scale(0.5); }
  15%  { opacity: 0; transform: scale(0.5); }
  25%  { opacity: 1; transform: scale(1); }
  55%  { opacity: 1; transform: scale(1); }
  70%  { opacity: 0; transform: scale(0.5); }
  100% { opacity: 0; transform: scale(0.5); }
}

@keyframes tutorialTapFinger {
  0%   { transform: translate(20px, 40px); opacity: 0; }
  10%  { opacity: 1; }
  15%  { transform: translate(0, 0); opacity: 1; }
  55%  { transform: translate(0, 0); opacity: 1; }
  70%  { transform: translate(20px, 40px); opacity: 0; }
  100% { transform: translate(20px, 40px); opacity: 0; }
}

/* ===============================
   VEHICLE BOARD
=============================== */

.vehicle-board {
  width: 100%;
}

.vehicle-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 24px;
  text-align: center;
  color: var(--color-muted);
}

.vehicle-empty svg {
  width: 48px;
  height: 48px;
  opacity: 0.4;
  stroke: var(--color-muted);
}

.vehicle-empty p {
  margin: 0;
  font-size: 1rem;
}

/* Vehicle signature pad — slightly taller */
#vehicleSignaturePadContainer {
  height: 200px;
}

/* Agreement scroll: smooth shrink when signature is revealed */
#vehicleAgreementScroll {
  transition: max-height 0.4s ease;
}

/* Signature section fade-in */
#vehicleSignatureSection.vehicle-sig-reveal {
  animation: vehicleSigFadeIn 0.4s ease-out;
}

@keyframes vehicleSigFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Vehicle avatar — car icon inside crew card */
.vehicle-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(86, 178, 187, 0.12) !important;
  color: var(--color-accent);
}

.vehicle-avatar.is-active {
  background: rgba(34, 197, 94, 0.12) !important;
  color: var(--status-in);
}

.vehicle-icon {
  width: 22px;
  height: 22px;
}

/* Mini driver avatar on vehicle card subtitle */
.vehicle-card .crew-role {
  display: flex;
  align-items: center;
}

.vehicle-driver-mini-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 5px;
  flex-shrink: 0;
}

/* Driver selection grid in checkout wizard */
.vehicle-driver-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  width: 100%;
  max-height: min(400px, 55vh);
  overflow-y: auto;
  padding: 4px;
}

.vehicle-driver-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: var(--wizard-card, rgba(255,255,255,0.06));
  border: 2px solid var(--wizard-border, rgba(255,255,255,0.1));
  border-radius: 16px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.vehicle-driver-item:active {
  transform: scale(0.97);
}

.vehicle-driver-item.selected {
  border-color: var(--wizard-primary, #56b2bb);
  background: rgba(86, 178, 187, 0.12);
}

.vehicle-driver-item__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(86, 178, 187, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vehicle-driver-item__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vehicle-driver-item__initials {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--wizard-text, #fff);
  opacity: 0.7;
}

.vehicle-driver-item__name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--wizard-text, #fff);
  text-align: center;
  line-height: 1.2;
}

.vehicle-driver-item__role {
  font-size: 0.78rem;
  color: var(--wizard-muted, rgba(255,255,255,0.5));
  text-align: center;
}

/* Mileage input section */
.vehicle-mileage-section {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  margin: 24px auto 0;
}

/* Mileage stepper with +/- buttons */
.vehicle-mileage-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 440px;
  margin: 16px auto 0;
}

.mileage-step-btn {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 2px solid var(--wizard-border, rgba(255,255,255,0.15));
  background: var(--wizard-card, rgba(255,255,255,0.06));
  color: var(--wizard-text, #fff);
  font-size: 1.5rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, border-color 0.15s;
}

.mileage-step-btn:active {
  background: rgba(86, 178, 187, 0.2);
  border-color: var(--wizard-primary, #56b2bb);
}

/* Greyed-out state when mileage hasn't been changed yet */
.vehicle-mileage-input.is-unchanged {
  opacity: 0.45;
}

.vehicle-mileage-input {
  flex: 1;
  padding: 14px 12px;
  border-radius: 14px;
  border: 2px solid var(--wizard-border, rgba(255,255,255,0.15));
  background: var(--wizard-card, rgba(255,255,255,0.06));
  color: var(--wizard-text, #fff);
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  -webkit-appearance: none;
  -moz-appearance: textfield;
  transition: opacity 0.2s;
}

.vehicle-mileage-input::placeholder {
  color: var(--wizard-muted, rgba(255,255,255,0.35));
  font-weight: 400;
  font-size: 1rem;
}

.vehicle-mileage-input:focus {
  outline: none;
  border-color: var(--wizard-primary, #56b2bb);
}

.vehicle-mileage-unit {
  font-size: 1rem;
  font-weight: 600;
  color: var(--wizard-muted, rgba(255,255,255,0.5));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Signature label in vehicle wizard */
.wizard-signature__label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--wizard-muted, rgba(255,255,255,0.6));
}

/* Vehicle card stats row (mileage + fuel) */
.vehicle-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 3px;
}

.vehicle-stat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  color: var(--color-muted);
  opacity: 0.7;
}

.vehicle-stat svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.vehicle-stat--low {
  color: #ef4444;
  opacity: 1;
  font-weight: 600;
}

/* Check-in form fields */
.vehicle-checkin-field {
  width: 100%;
  margin-top: 16px;
}

.vehicle-checkin-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--wizard-text, #fff);
  margin-bottom: 8px;
}

.vehicle-checkin-label svg {
  opacity: 0.6;
}

.vehicle-fuel-value {
  margin-left: auto;
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s;
}

/* Fuel slider */
.vehicle-fuel-slider-wrap {
  width: 100%;
  padding: 18px 0;
}

.vehicle-fuel-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  background: rgba(255,255,255,0.15);
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.vehicle-fuel-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  cursor: pointer;
  border: none;
}

.vehicle-fuel-slider::-moz-range-thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  cursor: pointer;
  border: none;
}

.vehicle-fuel-markers {
  display: flex;
  justify-content: space-between;
  padding: 4px 2px 0;
  font-size: 0.65rem;
  color: var(--wizard-muted, rgba(255,255,255,0.35));
  user-select: none;
}

/* Vehicle checkout wizard – keep button near content, not at page bottom.
   The shared .visitor-wizard .wizard-actions { margin-top: auto } pushes
   the button to the bottom of the 96vh dialog. That works for the visitor
   wizard (keyboard shrinks the viewport) but creates a huge gap for the
   vehicle wizard where there's no keyboard on most steps. */
#vehicleCheckoutWizard .wizard-actions {
  margin-top: 0;
}

/* Vehicle return wizard — full-screen multi-step (same as checkout) */
#vehicleCheckinPrompt .wizard-actions {
  margin-top: 0;
}

/* Soft fade-in when vehicle return wizard opens */
#vehicleCheckinPrompt.vehicle-return-enter {
  animation: vr-fade-in 0.35s ease-out both;
}
#vehicleCheckinPrompt.vehicle-return-enter .wizard-dialog {
  animation: vr-slide-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes vr-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes vr-slide-up {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Taller signature pad for vehicle return */
.signature-pad.vehicle-return-sig {
  height: 280px;
  max-width: 640px;
  margin: 0 auto;
}

/* Large centered fuel percentage display */
.vehicle-return-fuel-display {
  margin: 24px 0 8px;
  text-align: center;
}

.vehicle-return-fuel-pct {
  font-size: 4rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s;
  line-height: 1;
}

/* Wizard fade-out on submit (hides content before success screen) */
.wizard-dialog.is-submitting .wizard-content,
.wizard-dialog.is-submitting .wizard-actions,
.wizard-dialog.is-submitting .wizard-home,
.wizard-dialog.is-submitting .wizard-home--close {
  opacity: 0 !important;
  pointer-events: none;
}
/* Solid backdrop so nothing shows through while waiting for API */
.visitor-wizard .wizard-dialog.is-submitting {
  background: #f2f5f7;
}

/* Wider fuel slider for full-screen return step */
.vehicle-fuel-slider-wrap--return {
  max-width: 500px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 0;
}

/* Mileage unit label below stepper */
.vehicle-mileage-unit {
  display: block;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--wizard-muted, #64748b);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Vehicle Purpose Grid ───────────────────────── */
.vehicle-purpose-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  max-width: 440px;
  margin: 0 auto;
  padding: 16px 0;
}

.vehicle-purpose-btn {
  padding: 24px 16px;
  border-radius: 16px;
  border: 2.5px solid transparent;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.vehicle-purpose-btn:active {
  transform: scale(0.97);
}
.vehicle-purpose-btn.is-selected {
  border-color: currentColor;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.08);
  transform: scale(1.04);
}

/* 9 purpose colors — same palette as drill tags */
.purpose-color-0 { background: rgba(59,130,246,0.22);  color: #1d4ed8; }
.purpose-color-0.is-selected { background: rgba(59,130,246,0.38); }
.purpose-color-1 { background: rgba(34,197,94,0.22);   color: #15803d; }
.purpose-color-1.is-selected { background: rgba(34,197,94,0.38); }
.purpose-color-2 { background: rgba(251,146,60,0.22);  color: #c2410c; }
.purpose-color-2.is-selected { background: rgba(251,146,60,0.38); }
.purpose-color-3 { background: rgba(168,85,247,0.20);  color: #7c3aed; }
.purpose-color-3.is-selected { background: rgba(168,85,247,0.38); }
.purpose-color-4 { background: rgba(236,72,153,0.22);  color: #be185d; }
.purpose-color-4.is-selected { background: rgba(236,72,153,0.38); }
.purpose-color-5 { background: rgba(20,184,166,0.22);  color: #0f766e; }
.purpose-color-5.is-selected { background: rgba(20,184,166,0.38); }
.purpose-color-6 { background: rgba(239,68,68,0.22);   color: #b91c1c; }
.purpose-color-6.is-selected { background: rgba(239,68,68,0.38); }
.purpose-color-7 { background: rgba(250,204,21,0.22);  color: #a16207; }
.purpose-color-7.is-selected { background: rgba(250,204,21,0.38); }
.purpose-color-8 { background: rgba(148,163,184,0.22); color: #475569; }
.purpose-color-8.is-selected { background: rgba(148,163,184,0.38); }

/* Banner overlays on top - no content push */

/* ===========================================================
   Visitors screen — Visitors / Guests subtabs
   =========================================================== */
.board-subtabs {
  display: flex;
  gap: 8px;
  padding: 6px;
  margin: 0 24px 16px;
  background: #f1f5f9;
  border-radius: 12px;
  width: fit-content;
}
.board-subtab {
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: background 0.12s, color 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.board-subtab.is-active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.board-subtab__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: #F9522E;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

/* Guest cards on the Guests tab */
#guest-container {
  padding: 12px 24px 24px;
  display: grid;
  gap: 12px;
}
.guest-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px 22px;
}
.guest-card__name-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.guest-card__name {
  font-weight: 600;
  color: #0f172a;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.guest-card__badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: #e6f4f3;
  color: #0f6159;
  font-size: 12px;
  font-weight: 600;
}
.guest-card__meta {
  font-size: 14px;
  color: #475569;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.guest-card__meta-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.08em;
}
.guest-card__meta-val { color: #0f172a; font-weight: 500; }
.guest-card__notes {
  font-size: 13px;
  color: #64748b;
  margin-top: 6px;
  line-height: 1.45;
}
.guest-empty {
  padding: 60px 32px;
  text-align: center;
}
.guest-empty__title {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 8px;
}
.guest-empty__body {
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
  max-width: 420px;
  margin: 0 auto;
}

/* ============================================================
   Checklists — iPad runner (Phase 1A)
   Self-contained styles. All selectors prefixed .checklist- so
   nothing leaks into other screens.
   ============================================================ */
.checklist-board { padding: 18px 20px 100px; }
.checklist-view { display: block; }
.checklist-view.hidden { display: none; }

.checklist-breadcrumb {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 14px;
  font-size: 0.92rem; color: #64748b;
}
.checklist-back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: 0; cursor: pointer;
  color: #475569; font-size: 0.95rem; font-weight: 500;
  padding: 8px 4px; border-radius: 8px;
}
.checklist-back-btn:hover { color: #0f172a; }
.checklist-breadcrumb__folder { font-weight: 600; color: #0f172a; }

.checklist-list { display: flex; flex-direction: column; gap: 10px; }
.checklist-row {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left;
  padding: 16px 18px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, transform 80ms;
  font-family: inherit;
}
.checklist-row:hover { border-color: #cbd5e1; background: #f8fafc; }
.checklist-row:active { transform: scale(0.995); }
.checklist-row__icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: grid; place-items: center; flex-shrink: 0;
}
.checklist-row__icon--folder { background: #fef3c7; color: #b45309; }
.checklist-row__icon--template { background: #dcfce7; color: #15803d; }
.checklist-row__body { flex: 1; min-width: 0; }
.checklist-row__title { font-weight: 600; font-size: 1rem; color: #0f172a; }
.checklist-row__meta { font-size: 0.84rem; color: #64748b; margin-top: 2px; }
.checklist-row__chevron { color: #94a3b8; flex-shrink: 0; }

.checklist-empty {
  text-align: center; padding: 60px 20px;
  display: flex; flex-direction: column; align-items: center;
}

/* Run view */
/* Run-view header is positioned: Back pinned top-left, title block
   centred horizontally on the page. Looks balanced regardless of
   how short or long the title is. */
.checklist-run__header {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 0 80px;            /* leave room for the absolute Back button */
  margin-bottom: 12px;
  min-height: 44px;
}
.checklist-run__header > .checklist-back-btn {
  position: absolute;
  left: 0; top: 0;
}
.checklist-run__title {
  margin: 0;
  font-size: 1.4rem; font-weight: 600;
  color: #0f172a; letter-spacing: -0.01em;
  line-height: 1.2;
}
.checklist-run__description {
  margin: 4px 0 0;
  font-size: 0.88rem; color: #64748b;
  font-weight: 400;
  max-width: 640px;
}
.checklist-run__legend {
  display: flex; gap: 18px;
  padding: 10px 16px; margin-bottom: 14px;
  background: #f1f5f9; border-radius: 10px;
  font-size: 0.85rem; color: #475569;
}
.checklist-legend__item { display: inline-flex; align-items: center; gap: 6px; }
.checklist-legend__dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.checklist-legend__dot--pass { background: #16a34a; }
.checklist-legend__dot--na   { background: #94a3b8; }
.checklist-legend__dot--fail { background: #dc2626; }

.checklist-items { display: flex; flex-direction: column; gap: 10px; padding-bottom: 100px; }
.checklist-list-section {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.76rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: #64748b;
  padding: 4px 2px; margin: 16px 2px 8px;
}
.checklist-list-section:first-child { margin-top: 2px; }
.checklist-list-section svg { color: #f59e0b; flex-shrink: 0; }
.checklist-list-section--plain svg { display: none; }
.checklist-section {
  font-size: 0.82rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.09em;
  color: #64748b;
  padding: 6px 2px;
  margin: 18px 0 2px;
  border-bottom: 2px solid #e2e8f0;
}
.checklist-run-items > .checklist-section:first-child { margin-top: 0; }
.checklist-item {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
  overflow: hidden;
  transition: border-color 120ms;
}
.checklist-item[data-status="passed"] { border-color: #86efac; }
.checklist-item[data-status="na"] { border-color: #cbd5e1; }
.checklist-item[data-status="failed"] { border-color: #fca5a5; }
/* Item is answered but a required photo hasn't been attached — block submit
   and tell the user. Border + bottom flag pill make it impossible to miss. */
.checklist-item.needs-photo {
  border-color: #fbbf24;
  background: #fffbeb;
}
.checklist-item__flag {
  margin: 0 16px 14px 66px;
  padding: 8px 12px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 500;
}
.checklist-item__main {
  display: grid; grid-template-columns: 36px 1fr auto;
  gap: 14px; align-items: center;
  padding: 14px 16px;
}
.checklist-item__num {
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem; color: #94a3b8; font-weight: 600;
  letter-spacing: 0.04em;
}
.checklist-item__body { min-width: 0; }
.checklist-item__label {
  font-size: 1rem; font-weight: 500; color: #0f172a;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.checklist-item__crit-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #dc2626; display: inline-block; flex-shrink: 0;
}
.checklist-item__helper { font-size: 0.85rem; color: #64748b; margin-top: 2px; }
.checklist-item__buttons {
  display: flex; gap: 6px; flex-shrink: 0;
}
.checklist-btn {
  width: 48px; height: 48px;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  display: grid; place-items: center;
  transition: all 120ms;
  color: #94a3b8;
}
.checklist-btn:hover { border-color: #cbd5e1; }
.checklist-btn:active { transform: scale(0.95); }
.checklist-btn--pass.is-active { background: #16a34a; border-color: #16a34a; color: #fff; }
.checklist-btn--na.is-active   { background: #64748b; border-color: #64748b; color: #fff; }
.checklist-btn--fail.is-active { background: #dc2626; border-color: #dc2626; color: #fff; }
.checklist-btn--photo {
  margin-left: 6px;
  border-style: dashed;
  border-color: #cbd5e1;
  color: #64748b;
}
.checklist-btn--photo:hover { border-color: #94a3b8; color: #0f172a; background: #f8fafc; }

/* Single-tap "Mark complete" toggle for checkbox response type */
.checklist-btn--check {
  width: auto; min-width: 48px; padding: 0 14px;
  display: inline-flex; align-items: center; gap: 8px;
}
.checklist-btn--check.is-active {
  background: #0f172a; border-color: #0f172a; color: #fff;
}

/* Free-form text/number value input for those response types */
.checklist-item__value-wrap { margin-top: 10px; }
.checklist-item__value-input {
  width: 100%; box-sizing: border-box;
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0; border-radius: 10px;
  background: #fafbfc;
  font-family: inherit; font-size: 1rem; color: #0f172a;
  transition: border-color 120ms, box-shadow 120ms, background 120ms;
}
.checklist-item__value-input:focus {
  outline: none;
  border-color: #94a3b8;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(148,163,184,0.18);
}
.checklist-item__value-input.is-invalid {
  border-color: #fca5a5;
  background: #fef2f2;
}
.checklist-item--text .checklist-item__main,
.checklist-item--number .checklist-item__main {
  /* Text/number rows don't need the buttons column to take width */
  grid-template-columns: 36px 1fr auto;
}
.checklist-item--text[data-status="passed"],
.checklist-item--number[data-status="passed"] {
  border-color: #cbd5e1;
}

/* "+ Add note" pill — appears once status is set if note allowed */
.checklist-item__addons {
  padding: 0 16px 12px 66px;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.checklist-item__add-note {
  background: transparent; border: 1px dashed #cbd5e1;
  color: #64748b; font-family: inherit; font-size: 0.85rem; font-weight: 500;
  padding: 6px 12px; border-radius: 999px;
  cursor: pointer;
}
.checklist-item__add-note:hover { border-style: solid; color: #0f172a; border-color: #94a3b8; background: #f8fafc; }

/* Photo thumbnails grid */
.checklist-item__thumbs {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 0 16px 14px 66px;
}
.checklist-item__thumb {
  position: relative;
  width: 72px; height: 72px;
  border-radius: 10px; overflow: hidden;
  border: 1px solid #e2e8f0; background: #f1f5f9;
}
.checklist-item__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.checklist-item__thumb-x {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px;
  border: 0; border-radius: 50%;
  background: rgba(15,23,42,0.75); color: #fff;
  font-size: 1rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
  padding: 0;
}
.checklist-item__thumb-x:hover { background: #dc2626; }

/* Photo source action sheet */
.checklist-photo-sheet {
  position: fixed; inset: 0; z-index: 250;
  display: grid; place-items: end center;
  padding: 0 16px 24px;
}
.checklist-photo-sheet.hidden { display: none; }
.checklist-photo-sheet__backdrop {
  position: absolute; inset: 0;
  background: rgba(15,23,42,0.4);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.checklist-photo-sheet__panel {
  position: relative; z-index: 1;
  width: min(420px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 30px 80px rgba(15,23,42,0.3);
  animation: dv2-pop 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.checklist-photo-sheet__title {
  margin: 4px 0 8px; font-size: 0.85rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: #94a3b8; text-align: center; font-weight: 600;
}
.checklist-photo-sheet__btn {
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  padding: 16px 20px;
  background: #0f172a; color: #fff;
  border: 0; border-radius: 12px;
  font-family: inherit; font-size: 1rem; font-weight: 600;
  cursor: pointer;
}
.checklist-photo-sheet__btn:hover { background: #1e293b; }
.checklist-photo-sheet__btn--cancel {
  background: #f1f5f9; color: #475569; margin-top: 4px;
}
.checklist-photo-sheet__btn--cancel:hover { background: #e2e8f0; color: #0f172a; }

.checklist-item__note {
  padding: 0 16px 14px 66px;
  border-top: 1px dashed #e2e8f0;
  padding-top: 12px;
  margin-top: -1px;
}
.checklist-item__note textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid #e2e8f0; border-radius: 8px;
  font-family: inherit; font-size: 0.92rem; color: #0f172a;
  background: #fafbfc;
  resize: vertical; min-height: 56px;
  box-sizing: border-box;
}
.checklist-item__note textarea:focus { outline: 2px solid #94a3b8; outline-offset: 1px; }

.checklist-run__footer {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px max(14px, env(safe-area-inset-bottom)) 24px;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid #e2e8f0;
  z-index: 60;        /* above floating-nav (z-index: 40) just in case */
  gap: 16px;
}

/* While a checklist run is in progress, give the runner the whole
   screen — hide the global nav, the global topbar, and the Safety
   hub's own breadcrumb header. Same UX as the visitor wizard.
   Only the run view's own [Back] + title + items + footer are visible. */
body.checklist-running .floating-nav {
  opacity: 0;
  transform: translateY(80px);
  pointer-events: none;
}
body.checklist-running #boardHeader,
body.checklist-running #safetyChecklistsView > .safety-view__header {
  display: none;
}
/* With the chrome gone, give the runner a comfortable top safe-area
   margin (was previously provided by the global topbar) and breathing
   room beneath the status bar. */
body.checklist-running #checklist-container {
  padding-top: calc(env(safe-area-inset-top, 0px) + 18px);
}
body.checklist-running .checklist-run__header {
  padding-top: 4px;
  margin-bottom: 14px;
}
/* Legend can shrink — buttons are self-explanatory anyway */
body.checklist-running .checklist-run__legend {
  padding: 6px 14px;
  font-size: 0.78rem;
  margin-bottom: 10px;
}

/* Stronger Back button while running — was easy to miss as a small
   slate-grey text link. Now a clear outlined pill. */
body.checklist-running .checklist-run__header .checklist-back-btn {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 8px 14px 8px 10px;
  color: #0f172a;
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: 0 1px 2px rgba(15,23,42,0.06);
}
body.checklist-running .checklist-run__header .checklist-back-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}
body.checklist-running .checklist-run__header .checklist-back-btn svg {
  width: 18px; height: 18px;
}
.checklist-run__summary { font-size: 0.92rem; color: #475569; font-weight: 500; flex: 1; text-align: center; }
.checklist-run__cancel {
  background: transparent; color: #64748b;
  border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 12px 22px; font-size: 1rem; font-weight: 500;
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.checklist-run__cancel:hover { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.checklist-run__submit {
  background: #0f172a; color: #fff;
  border: 0; border-radius: 10px;
  padding: 12px 28px; font-size: 1rem; font-weight: 600;
  cursor: pointer;
  transition: background 120ms, opacity 120ms;
}
.checklist-run__submit:hover:not(:disabled) { background: #1e293b; }
.checklist-run__submit:disabled { opacity: 0.4; cursor: not-allowed; }

/* Submit modal */
.checklist-submit-modal {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
}
.checklist-submit-modal.hidden { display: none; }
.checklist-submit-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.checklist-submit-modal__panel {
  position: relative;
  width: min(720px, 96vw);
  max-height: 92vh;
  background: #fff;
  border-radius: 20px;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(15,23,42,0.28);
  overflow: hidden;
}
.checklist-submit-modal__header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px;
  padding: 22px 26px 18px;
  border-bottom: 1px solid #e2e8f0;
}
.checklist-submit-modal__header h3 { margin: 0 0 4px; font-size: 1.3rem; font-weight: 600; letter-spacing: -0.01em; color: #0f172a; }
.checklist-submit-modal__close {
  background: transparent; border: 0; font-size: 1.8rem; line-height: 1;
  cursor: pointer; color: #64748b;
  width: 36px; height: 36px; border-radius: 10px;
  flex-shrink: 0;
}
.checklist-submit-modal__close:hover { background: #f1f5f9; }
.checklist-submit-modal__body {
  padding: 20px 26px; overflow-y: auto; flex: 1;
  display: flex; flex-direction: column; gap: 22px;
}
.checklist-submit-modal__footer {
  padding: 16px 26px max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid #e2e8f0;
  display: flex; gap: 10px; justify-content: flex-end;
  background: #fafbfc;
}

.checklist-submit__summary {
  font-size: 0.85rem; color: #64748b; margin: 0;
}
.checklist-submit__section { display: flex; flex-direction: column; gap: 10px; }
.checklist-submit__section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 24px;
}
.checklist-submit__label {
  display: block; font-size: 0.74rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: #64748b; font-weight: 600; margin: 0;
}
.checklist-submit__selected-name {
  font-size: 0.9rem; color: #0f172a; font-weight: 500;
}

.checklist-submit__search-wrap {
  position: relative;
  display: flex; align-items: center;
}
.checklist-submit__search-icon {
  position: absolute; left: 14px; color: #94a3b8; pointer-events: none;
}
.checklist-submit__search {
  width: 100%; box-sizing: border-box;
  padding: 12px 14px 12px 42px;
  border: 1.5px solid #e2e8f0; border-radius: 12px;
  font-family: inherit; font-size: 0.95rem; color: #0f172a;
  background: #fff;
  transition: border-color 120ms, box-shadow 120ms;
}
.checklist-submit__search:focus {
  outline: none; border-color: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148,163,184,0.18);
}

.checklist-submit__crew-list {
  display: flex; flex-direction: column;
  gap: 4px;
  max-height: 320px; overflow-y: auto;
  padding: 2px;
  border: 1px solid #e2e8f0; border-radius: 12px;
  background: #fafbfc;
}
.checklist-submit__crew-row {
  display: grid;
  grid-template-columns: 40px 1fr 28px;
  gap: 12px; align-items: center;
  text-align: left;
  background: #fff; border: 1.5px solid transparent; border-radius: 10px;
  padding: 10px 12px; cursor: pointer;
  font-family: inherit;
  transition: background 100ms, border-color 100ms;
}
.checklist-submit__crew-row:hover { background: #f1f5f9; }
.checklist-submit__crew-row.is-selected {
  background: #0f172a; border-color: #0f172a;
}
.checklist-submit__crew-row.is-selected .checklist-submit__crew-name { color: #fff; }
.checklist-submit__crew-row.is-selected .checklist-submit__crew-role { color: #cbd5e1; }
.checklist-submit__crew-row.is-selected .checklist-submit__crew-check { color: #fff; opacity: 1; }
.checklist-submit__crew-row.is-selected .checklist-submit__crew-avatar:not(.checklist-submit__crew-avatar--photo) {
  background: rgba(255,255,255,0.18); color: #fff;
}
.checklist-submit__crew-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: #e2e8f0; color: #475569;
  display: grid; place-items: center;
  font-size: 0.85rem; font-weight: 600;
  flex-shrink: 0; overflow: hidden;
}
.checklist-submit__crew-avatar--photo { padding: 0; background: #e2e8f0; }
.checklist-submit__crew-avatar--photo img,
.checklist-submit__crew-avatar img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.checklist-submit__crew-meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.checklist-submit__crew-name { font-size: 0.95rem; font-weight: 500; color: #0f172a; line-height: 1.2; }
.checklist-submit__crew-role { font-size: 0.78rem; color: #64748b; line-height: 1.2; }
.checklist-submit__crew-check { color: transparent; opacity: 0; transition: opacity 100ms; display: grid; place-items: center; }
.checklist-submit__crew-empty {
  padding: 30px 24px; text-align: center; color: #94a3b8; font-size: 0.95rem;
  border: 1px dashed #e2e8f0; border-radius: 12px;
}

.checklist-submit__sig-wrap {
  position: relative;
  background: #fafbfc;
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  height: 220px; overflow: hidden;
}
.checklist-submit__sig-canvas {
  display: block;
  touch-action: none;
  cursor: crosshair;
  position: relative; z-index: 2;
  width: 100%; height: 100%;
}
.checklist-submit__sig-hint {
  position: absolute; left: 0; right: 0; top: 50%;
  transform: translateY(-50%);
  text-align: center;
  font-size: 0.95rem; color: #cbd5e1; font-style: italic;
  pointer-events: none; z-index: 1;
  transition: opacity 120ms;
}
.checklist-submit__sig-wrap.has-stroke .checklist-submit__sig-hint { opacity: 0; }
.checklist-submit__sig-wrap.has-stroke { border-style: solid; border-color: #94a3b8; }
.checklist-submit__sig-clear {
  background: transparent; border: 1px solid #e2e8f0;
  border-radius: 8px; padding: 5px 12px;
  font-size: 0.78rem; font-weight: 500;
  color: #475569; cursor: pointer;
}
.checklist-submit__sig-clear:hover { background: #f1f5f9; }

.checklist-submit__error {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fef2f2; color: #b91c1c;
  border-radius: 8px; font-size: 0.88rem;
}

.checklist-submit__btn {
  padding: 10px 20px;
  border-radius: 8px; border: 0;
  font-size: 0.95rem; font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.checklist-submit__btn--ghost {
  background: transparent; color: #475569;
  border: 1px solid #e2e8f0;
}
.checklist-submit__btn--ghost:hover { background: #f8fafc; }
.checklist-submit__btn--primary {
  background: #0f172a; color: #fff;
}
.checklist-submit__btn--primary:hover:not(:disabled) { background: #1e293b; }
.checklist-submit__btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Completion overlay */
.checklist-complete-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center;
  background: rgba(15,23,42,0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: dv2-fadein 180ms ease-out;
}
.checklist-complete-overlay.hidden { display: none; }
.checklist-complete-overlay__panel {
  background: #fff; border-radius: 18px;
  padding: 36px 44px; text-align: center;
  box-shadow: 0 24px 60px rgba(15,23,42,0.25);
  animation: dv2-pop 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.checklist-complete-overlay__icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: #dcfce7; color: #16a34a;
  display: grid; place-items: center;
  margin: 0 auto 16px;
}
.checklist-complete-overlay h3 { margin: 0 0 4px; font-size: 1.25rem; font-weight: 600; color: #0f172a; }
.checklist-complete-overlay p { margin: 0; color: #64748b; font-size: 0.92rem; }
@keyframes dv2-fadein { from { opacity: 0 } to { opacity: 1 } }
@keyframes dv2-pop { 0% { opacity: 0; transform: scale(0.8) } 100% { opacity: 1; transform: scale(1) } }

/* ── Asset category sections (vehicle/asset board) ── */
.asset-cat-section { margin-bottom: 14px; }
.asset-cat-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 6px 10px 4px;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: #475569;
}
.asset-cat-chev {
  flex: none;
  color: #94a3b8;
  transition: transform 0.18s ease;
}
.asset-cat-section.is-collapsed .asset-cat-chev { transform: rotate(-90deg); }
.asset-cat-name {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #1e293b;
}
.asset-cat-count {
  margin-left: auto;
  font-size: 0.76rem;
  font-weight: 600;
  color: #64748b;
  background: #eef2f8;
  padding: 3px 11px;
  border-radius: 999px;
}
.asset-cat-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.asset-cat-section.is-collapsed .asset-cat-body { display: none; }

/* ── Wizard note input (simple-category asset check-out, step 6) ── */
.wizard-note-input {
  width: 100%;
  max-width: 520px;
  min-height: 180px;
  padding: 18px 20px;
  border-radius: 16px;
  border: 2px solid var(--wizard-border);
  background: var(--wizard-card);
  color: var(--wizard-text);
  font: inherit;
  font-size: 1.05rem;
  line-height: 1.45;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}
.wizard-note-input:focus {
  outline: none;
  border-color: var(--wizard-primary);
  box-shadow: 0 0 0 4px rgba(31, 173, 162, 0.15);
}

/* =========================================================
   Muster scenario picker (post-slide-to-activate)
   Reuses the trip-purpose visual language (large coloured buttons)
   but rendered as a full-screen overlay so the slider stays intact
   underneath. Selection = confirmation; there is no separate yes/no
   gate. Cancel arrow returns to the slider.
   ========================================================= */
.muster-scenario-picker {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 28, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 250;
}
.muster-scenario-picker.hidden { display: none; }

.muster-scenario-picker__inner {
  background: #fff;
  border-radius: 24px;
  padding: 28px 28px 24px;
  width: min(640px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 40px 80px rgba(10, 15, 34, 0.5);
  position: relative;
}

.muster-scenario-picker__back {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.muster-scenario-picker__back:active { background: rgba(15, 23, 42, 0.12); }

.muster-scenario-picker__title {
  margin: 0 0 4px;
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
  text-align: center;
}
.muster-scenario-picker__hint {
  margin: 0 0 22px;
  font-size: 0.95rem;
  color: #64748b;
  text-align: center;
}

.muster-scenario-picker__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
@media (max-width: 480px) {
  .muster-scenario-picker__grid { grid-template-columns: 1fr; }
}

.muster-scenario-btn {
  --tab-color: #475569;
  appearance: none;
  border: 2px solid color-mix(in srgb, var(--tab-color) 30%, transparent);
  background: color-mix(in srgb, var(--tab-color) 12%, #fff);
  color: color-mix(in srgb, var(--tab-color) 75%, #0f172a);
  border-radius: 16px;
  padding: 24px 18px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}
.muster-scenario-btn:active {
  transform: scale(0.97);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--tab-color) 24%, transparent);
}

.muster-scenario-picker__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 14px;
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.muster-scenario-picker__divider::before,
.muster-scenario-picker__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(148, 163, 184, 0.35);
}

.muster-scenario-picker__real {
  width: 100%;
  appearance: none;
  border: none;
  border-radius: 16px;
  padding: 18px 18px 20px;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.32);
  -webkit-tap-highlight-color: transparent;
}
.muster-scenario-picker__real:active { transform: scale(0.985); }
.muster-scenario-picker__real-eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}
.muster-scenario-picker__real-label {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

