/* ===============================
   ONDECK COLOR PALETTE
=============================== */
:root {
  --color-bg: #F0F4F8;          /* light page background */
  --color-card: #E2E9ED;        /* lightened secondary for cards */
  --color-border: #D0D9DD;      /* subtle border for separation */
  --color-accent: #56B2BB;      /* buttons / toggles / highlights */
  --color-text: #1D2233;        /* main text */
  --color-dark: #0A0F22;        /* nav/footer background */
}

/* ===============================
   GLOBAL LAYOUT
=============================== */
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;
  -webkit-font-smoothing: antialiased;
}

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

body.ios-standalone .bottom-nav {
  padding: 24px 16px calc(36px + 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;
  background: radial-gradient(circle at 15% 15%, rgba(86, 178, 187, 0.18), transparent 45%),
              radial-gradient(circle at 85% 10%, rgba(86, 178, 187, 0.12), transparent 50%),
              #0b172a;
  color: #f5faff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: calc(48px + env(safe-area-inset-top, 0)) calc(48px + env(safe-area-inset-right, 0)) calc(48px + env(safe-area-inset-bottom, 0)) calc(48px + env(safe-area-inset-left, 0));
  z-index: 300;
  text-align: center;
}

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

.welcome-content {
  position: relative;
  max-width: 520px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.welcome-content h1 {
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  margin: 0;
  letter-spacing: 0.04em;
}

.welcome-content p {
  margin: 0;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  color: rgba(245, 250, 255, 0.75);
}

.welcome-yacht {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fefefe;
}

.welcome-primary {
  margin: 0 auto;
  margin-top: 12px;
  background: linear-gradient(135deg, #4aa9b3, #5fc6cf);
  color: #0b172a;
  border: none;
  border-radius: 26px;
  padding: 18px 42px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 24px 40px rgba(10, 15, 34, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.welcome-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 28px 60px rgba(10, 15, 34, 0.55);
}

.welcome-screen .ondeck-wave--back { bottom: -40px; }
.welcome-screen .ondeck-wave--mid { bottom: -18px; }
.welcome-screen .ondeck-wave--front { bottom: 6px; }

main {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

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

/* ===============================
   CREW LIST
=============================== */
/* ===============================
   CREW LIST — balanced inset layout
=============================== */
.crew-grid {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.5rem 2rem;     /* ⬅️ equal spacing on both sides */
  width: 100%;
  max-width: 100%;          /* stay inside viewport */
  box-sizing: border-box;
  padding-bottom: 6rem;     /* keep final card clear of fixed bottom navigation */
}

.crew-section-header {
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: #6b7a8d;
  padding: 0.2rem 0.2rem 0;
  margin-top: 0.4rem;
}

.crew-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--color-card);
  border-radius: 12px;
  padding: 1rem 1.4rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
  transition: background 0.25s ease, transform 0.1s ease;
}

.crew-card:hover {
  background-color: #e9eff2;
}

.visitor-card {
  align-items: stretch;
}

.visitor-meta {
  font-size: 0.85rem;
  color: #6b7280;
  opacity: 0.85;
}

.visitor-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
}

.visitor-activity {
  font-size: 0.75rem;
  color: #6b7280;
}

.visitor-return-chip {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 193, 59, 0.18);
  color: #8c5d00;
}

.floating-action-btn {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 20;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 14px 28px rgba(0,0,0,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;
}

@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;
}

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

.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-checkbox {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.95rem;
  color: var(--color-text);
}

.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;
}

.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);
}

/* ===============================
   BOTTOM NAVIGATION
=============================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  background: var(--color-dark);
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 14px;
  padding: 18px 18px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.25);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 10;
}

.bottom-nav button {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 16px 0;
  min-height: 52px;
  border-radius: 24px;
  transition: color 0.25s ease, transform 0.25s ease, background 0.25s ease;
  touch-action: manipulation;
}

.bottom-nav button:hover:not(:disabled) {
  color: var(--color-accent);
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.bottom-nav button.active {
  color: var(--color-accent);
  text-decoration: underline;
}

.bottom-nav button:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
  background: rgba(255, 255, 255, 0.06);
}

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

.safety-board__intro {
  position: relative;
  padding-top: 110px;
  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: -110px;
  margin-bottom: 18px;
  padding: 0 4px;
  z-index: 2;
}

.safety-contacts {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(210px, 240px);
  gap: 12px;
  padding: 12px 4px 6px;
  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: 0 14px 32px rgba(9, 30, 66, 0.12);
  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: 0 20px 36px rgba(9, 30, 66, 0.16);
  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: 200;
  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;
}

.safety-pdfjs-viewer {
  flex: 1;
  width: 100%;
  height: 100%;
  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;
}

.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: 16px;
  padding: 1.5rem 1.75rem calc(7rem + env(safe-area-inset-bottom, 0));
  box-sizing: border-box;
}

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

.muster-header__actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.muster-activate-btn {
  background: linear-gradient(135deg, #f97316, #f43f5e);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(244, 63, 94, 0.3);
}

.muster-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.05);
  padding: 10px 14px;
}

.muster-roster {
  list-style: none;
  padding: 0 0 220px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.muster-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.muster-check {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(15, 23, 42, 0.2);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.muster-check.is-mustered {
  background: #22c55e;
  border-color: #22c55e;
  color: #fff;
  box-shadow: 0 8px 20px rgba(34, 197, 94, 0.35);
}

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

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

.muster-card__meta {
  margin: 0;
  font-size: 0.85rem;
  color: #6b7280;
}

.muster-section {
  margin: 16px 0 6px;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
}

.muster-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  position: sticky;
  bottom: calc(130px + env(safe-area-inset-bottom, 0));
  z-index: 5;
  background: rgba(240, 244, 248, 0.96);
  border-radius: 24px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15);
  backdrop-filter: blur(6px);
}

.muster-record-btn,
.muster-restart-btn,
.muster-cancel-btn {
  border: none;
  border-radius: 16px;
  padding: 12px;
  font-weight: 600;
  cursor: pointer;
}

.muster-record-btn {
  background: #22c55e;
  color: #fff;
  box-shadow: 0 14px 30px rgba(34, 197, 94, 0.35);
}

.muster-record-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.muster-restart-btn {
  background: #facc15;
  color: #4a2c00;
  font-weight: 700;
  min-height: 62px;
  padding: 18px 16px;
  font-size: 1rem;
  box-shadow: 0 14px 30px rgba(250, 204, 21, 0.35);
}

.muster-cancel-btn {
  background: rgba(224, 86, 86, 0.15);
  color: #7a1f1f;
}

.muster-complete-btn {
  background: #34d399;
  color: #064e3b;
  border: none;
  border-radius: 16px;
  padding: 18px 16px;
  min-height: 62px;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 14px 30px rgba(52, 211, 153, 0.35);
  cursor: pointer;
}

.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: 18px;
  width: min(360px, 90vw);
  text-align: center;
  box-shadow: 0 30px 60px rgba(10, 15, 34, 0.35);
}

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

.confirm-modal__btn {
  flex: 1;
  padding: 14px;
  border: none;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.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;
}

@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; }
.active { display: block; }

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

  .bottom-nav button {
    font-size: 14px;
    min-height: 48px;
  }

  h2 {
    font-size: 1.2em;
  }
}
/* ===============================
   Splash / Access Code Modal
=============================== */
.splash-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-dark, #0A0F22);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.splash-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 40px 32px;
  max-width: 340px;
  width: 80%;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  animation: fadeIn 0.4s ease;
}

.splash-card h2 {
  margin: 0 0 10px;
  color: var(--color-dark, #0A0F22);
}

.splash-card p {
  color: var(--color-text, #1D2233);
  font-size: 0.95em;
}

.splash-card input {
  width: 100%;
  padding: 10px 12px;
  margin: 20px 0 12px;
  font-size: 1em;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.splash-card button {
  width: 100%;
  padding: 10px;
  font-size: 1em;
  font-weight: 600;
  color: #fff;
  background: var(--color-accent, #56B2BB);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.25s;
}

.splash-card button:hover {
  background: #49a0a8;
}

.status-msg {
  margin-top: 10px;
  font-size: 0.9em;
  color: var(--color-text, #1D2233);
}
.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;
}
