* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  scrollbar-color: rgba(255,255,255,0.35) rgba(255,255,255,0.08);
  scrollbar-width: thin;
}
datalist { display: none; }
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
*::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
}
*::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.35);
  border-radius: 10px;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.45);
}
    body {
      background: #020617;
      color: #e5e7eb;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      overflow: hidden;
    }
#ui {
  position: fixed;
  top: 12px;
  left: 12px;
      background: rgba(15,23,42,0.85);
      border-radius: 12px;
      padding: 10px 14px;
      border: 1px solid rgba(148,163,184,0.7);
      backdrop-filter: blur(8px);
      z-index: 10;
      display: flex;
      flex-wrap: wrap;
	      gap: 8px;
	      align-items: center;
	    }
#ui .ui-icon-btn {
  width: 72px;
  height: 72px;
  padding: 4px;
  border-radius: 12px;
  background: #d1d5db;
  border: 2px solid rgba(31,41,55,0.9);
  color: #111827;
  font-weight: 700;
  font-size: 11px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.7), 0 10px 18px rgba(0,0,0,0.35);
  display: grid;
  place-items: center;
}
#ui .ui-icon-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
#ui .ui-icon-btn[data-active="true"] {
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.7), 0 0 0 2px rgba(34,197,94,0.8);
}
#ui .ui-icon-btn:hover {
  background: #e5e7eb;
  transform: none;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.7), 0 12px 22px rgba(0,0,0,0.35);
}
#ui .ui-icon-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  filter: grayscale(0.2);
}

/* === HUD Clock (top-right) ======================================= */
.hud-top-right {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 11;
    pointer-events: auto;
    display: flex;
    gap: 8px;
    align-items: center;
    max-width: calc(100vw - 24px);
}
.hud-clock {
    position: static;
    display: grid;
    grid-template-columns: 1fr 36px;
    gap: 8px;
    align-items: center;
    justify-content: center;
    align-content: center;
    padding: 4px;
    border-radius: 14px;
    background: rgba(20, 32, 50, 0.92);
    border: 3px solid rgba(31, 41, 55, 0.95);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
    width: 150px;
    height: 48px;
    max-width: calc(100vw - 24px);
    pointer-events: none;
}
.hud-clock.hidden { display: none; }
.hud-vehicle {
    display: grid;
    grid-template-columns: repeat(2, 50px);
    gap: 6px;
    align-items: center;
    justify-content: center;
    align-content: center;
    justify-items: center;
    padding: 4px;
    border-radius: 12px;
    background: rgba(20, 32, 50, 0.92);
    border: 3px solid rgba(31, 41, 55, 0.95);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
    height: 48px;
    pointer-events: auto;
}
.hud-vehicle.hidden { display: none; }
.hud-vehicle-item {
  width: 50px;
  height: 38px;
  border-radius: 8px;
  border: 2px solid rgba(31,41,55,0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: #0f172a;
  background: #e2e8f0;
  text-align: center;
}
.hud-vehicle-status {
  color: #0f172a;
  cursor: pointer;
}
.hud-vehicle-speed {
  pointer-events: none;
}
.hud-vehicle-value {
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
}
.hud-vehicle-label {
  font-size: 8px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  line-height: 1;
  max-width: 46px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hud-vehicle-status.badge {
  width: 50px;
  height: 38px;
  min-width: 50px;
  border-radius: 8px;
  padding: 0;
  font-size: 14px;
}

/* === Vehicle Menu ================================================= */
.vehicle-panel {
  --vehicle-toggle-size: 72px;
  position: fixed;
  top: 110px;
  right: 12px;
  display: inline-block;
  width: fit-content;
  min-width: 0;
  text-align: center;
  max-width: calc(100vw - 24px);
  background: rgba(15,23,42,0.9);
  border: 2px solid rgba(148,163,184,0.7);
  border-radius: 16px;
  padding: 8px;
  z-index: 12;
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}
.vehicle-panel.hidden { display: none; }
.vehicle-panel-header {
  margin: 0 0 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border-radius: 10px;
  background: #f8fafc;
  border: 2px solid rgba(31,41,55,0.9);
  color: #142032;
  font-weight: 700;
  font-size: 12px;
  text-align: center;
  cursor: grab;
  user-select: none;
}
.vehicle-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, var(--vehicle-toggle-size));
  gap: 8px;
  justify-content: center;
}
#vehiclePanel .vehicle-toggle {
  width: var(--vehicle-toggle-size);
  height: var(--vehicle-toggle-size);
  border-radius: 12px;
  border: 2px solid rgba(31,41,55,0.95);
  background: #d1d5db;
  padding: 0;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.7), 0 6px 14px rgba(0,0,0,0.35);
  cursor: pointer;
}
#vehiclePanel .vehicle-toggle::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 46%;
  height: 12px;
  border-radius: 999px;
  background: rgba(15,23,42,0.55);
  z-index: 1;
  transition: background .15s ease, box-shadow .15s ease, opacity .15s ease;
  opacity: 0.6;
}
#vehiclePanel .vehicle-toggle[data-active="true"]::after {
  background: #22c55e;
  box-shadow: 0 0 12px rgba(34,197,94,0.8);
  opacity: 1;
}
#vehiclePanel .vehicle-toggle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 2;
  pointer-events: none;
}
#vehiclePanel .vehicle-toggle:hover {
  background: #e5e7eb;
  transform: none;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.7), 0 8px 16px rgba(0,0,0,0.4);
}
#vehiclePanel .vehicle-toggle:disabled {
  cursor: not-allowed;
  filter: grayscale(1) brightness(0.8);
  opacity: 0.7;
}
@media (max-width: 720px) {
  .vehicle-panel {
    --vehicle-toggle-size: 58px;
    top: 90px;
    right: 8px;
  }
  #ui .ui-icon-btn {
    width: 64px;
    height: 64px;
  }
  #ui .ui-icon-btn img {
    width: 100%;
    height: 100%;
  }
}
.hud-clock-text {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  text-align: right;
  gap: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.hud-clock-date,
.hud-clock-takt {
  font-weight: 800;
  letter-spacing: 0.6px;
  font-variant-numeric: tabular-nums;
  color: rgba(248, 250, 252, 0.97);
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
}
.hud-clock-time {
  font-weight: 800;
  letter-spacing: 0.6px;
  font-variant-numeric: tabular-nums;
  color: rgba(248, 250, 252, 0.99);
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}
.hud-clock-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: none;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hud-clock-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
    button {
      border-radius: 10px;
      padding: 6px 14px;
      border: 1px solid rgba(148,163,184,.6);
      background: radial-gradient(circle at top, rgba(55,65,81,.9), rgba(15,23,42,1));
      color: #e5e7eb;
      font-size: .8rem;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      box-shadow: 0 8px 24px rgba(0,0,0,0.55);
      transition: background .15s ease, transform .08s ease, box-shadow .08s ease;
    }
    button span.dot {
      width: 8px;
      height: 8px;
      border-radius: 999px;
      background: #22c55e;
      box-shadow: 0 0 8px rgba(34,197,94,0.9);
    }
    button[data-active="false"] span.dot {
      background: #ef4444;
      box-shadow: 0 0 6px rgba(239,68,68,0.9);
    }
    button:hover {
      background: rgba(37,99,235,.85);
      transform: translateY(-1px);
      box-shadow: 0 14px 32px rgba(37,99,235,0.6);
    }
    button:active {
      transform: translateY(1px) scale(.98);
      box-shadow: 0 6px 12px rgba(0,0,0,0.75);
    }
    #hint {
      font-size: .75rem;
      color: #9ca3af;
      margin-left: 4px;
    }
#game {
  width: 100vw;
  height: auto;
  display: block;
  /* Lobby background (shown until a session map is loaded) */
  background: url("assets/background.png") center / cover no-repeat #000;
}

/* Companion UI pages (/smartphone, /tablet) */
body.companion {
  overflow: hidden;
}
body.companion #game,
body.companion #hudClock,
body.companion #hudTopRight,
body.companion #hudVehicle,
body.companion #coordDisplay,
body.companion #modeDisplay,
body.companion #editPanel,
body.companion #placePanel,
body.companion #btnPhone,
body.companion #btnTablet,
body.companion #btnVehicle,
body.companion #vehiclePanel {
  display: none !important;
}
#coordDisplay, #modeDisplay {
  display: none;
  position: fixed;
  left: 12px;
  bottom: 12px;
  padding: 6px 10px;
  background: rgba(15,23,42,0.85);
  border: 1px solid rgba(148,163,184,0.6);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 14px;
  z-index: 25;
  pointer-events: none;
}
#modeDisplay {
  bottom: 44px;
}
#editPanel {
  position: fixed;
  top: 80px;
  left: 80px;
  width: 420px;
  max-width: 420px;
  background: rgba(15,23,42,0.95);
  border: 1px solid rgba(148,163,184,0.6);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  z-index: 14;
}
#editPanel.hidden { display: none; }
#editPanel .edit-header { cursor: grab; }
#placePanel {
  position: fixed;
  bottom: 60px;
  left: 12px;
  padding: 8px 10px;
  background: rgba(15,23,42,0.85);
  border: 1px solid rgba(148,163,184,0.6);
  border-radius: 10px;
  font-size: 0.8rem;
  color: #e5e7eb;
  z-index: 11;
  display: flex;
  gap: 8px;
  align-items: center;
  user-select: none;
}
#placePanel.hidden {
  display: none;
}
#vehicleModal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 12;
}
#vehicleModal .modal-content,
#playerModal .modal-content {
  background: rgba(15,23,42,0.95);
  border: 1px solid rgba(148,163,184,0.6);
  border-radius: 12px;
  padding: 16px;
  width: 420px;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  position: fixed;
  user-select: none;
}
#vehicleModal .close,
#playerModal .close,
.close,
.pager-close,
.radio-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e13232;
  border: none;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  box-shadow: 0 6px 14px rgba(0,0,0,0.35);
}
#vehicleModal h4,
#playerModal h4 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: #e5e7eb;
}
#vehicleModal .modal-header {
  cursor: grab;
}
#vehicleModal .list,
#playerModal .list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
}
#vehicleModal .place-controls {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  align-items: center;
}
#vehicleModal .place-controls span {
  text-align: center;
  font-weight: 700;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 8px;
  color: #e5e7eb;
}
#vehicleModal .place-controls button {
  width: 100%;
}
#vehicleModal .filters {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
#vehicleModal .filters input,
#vehicleModal .filters select {
  flex: 1;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(148,163,184,0.4);
  background: rgba(15,23,42,0.6);
  color: #e5e7eb;
}
#vehicleModal .list button,
#playerModal .list button {
  width: 100%;
  justify-content: flex-start;
  background: radial-gradient(circle at top, rgba(55,65,81,.9), rgba(15,23,42,1));
  display: flex;
  align-items: center;
  gap: 8px;
}
#vehicleModal .thumb,
#playerModal .thumb {
  width: 32px;
  height: 32px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 6px;
  border: 1px solid rgba(148,163,184,0.6);
}
#btnReleasePlayer {
  opacity: 0.9;
}
#playerModal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 12;
}
#loginModal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
}
#loginModal .modal-content {
  background: rgba(15,23,42,0.95);
  border: 1px solid rgba(148,163,184,0.6);
  border-radius: 12px;
  padding: 16px;
  width: 320px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

/* Loading Screen */
#loadingScreen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.75);
  z-index: 2000;
}
#loadingScreen .loading-card {
  width: min(420px, 90vw);
  background: rgba(15,23,42,0.95);
  border: 1px solid rgba(148,163,184,0.55);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.55);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 10px 12px;
  align-items: center;
}
#loadingScreen .loading-brand {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #e2e8f0;
}
#loadingScreen .loading-spinner {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid rgba(148,163,184,0.35);
  border-top-color: rgba(226,232,240,0.95);
  animation: loadingSpin 0.9s linear infinite;
}
#loadingScreen .loading-text {
  grid-column: 1 / 3;
  grid-row: 2 / 3;
  color: rgba(226,232,240,0.9);
  font-size: 14px;
  line-height: 1.25;
}
@keyframes loadingSpin {
  to { transform: rotate(360deg); }
}

/* Admin (Tablet App) */
#adminModal {
  position: absolute;
  inset: 0;
  background: transparent;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}
#adminModal .modal-content {
  width: 100%;
  height: 100%;
  max-height: none;
  overflow: auto;
  background: rgba(15,23,42,0.88);
  border: none;
  border-radius: 18px;
  padding: 14px;
  box-shadow: none;
}
#adminModal .modal-content.large {
  width: 100%;
  height: 100%;
  max-height: none;
  overflow: auto;
}
#adminItemModal .modal-content.large {
  width: 520px;
}
#itemsModal,
#spindModal,
#doorAccessModal,
#patientInfoModal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
}
#itemsModal .modal-content.large,
#spindModal .modal-content.large,
#doorAccessModal .modal-content.large,
#patientInfoModal .modal-content.large {
  width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: rgba(15,23,42,0.95);
  border: 1px solid rgba(148,163,184,0.6);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
#itemsModal .assign-grid,
#spindModal .assign-grid,
#doorAccessModal .assign-grid,
#patientInfoModal .assign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
#adminItemModal,
#spawnModal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
}
#adminItemModal .modal-content,
#spawnModal .modal-content {
  background: rgba(15,23,42,0.95);
  border: 1px solid rgba(148,163,184,0.6);
  border-radius: 12px;
  padding: 16px;
  width: 420px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
#itemsModal .col h5,
#spindModal .col h5,
#doorAccessModal .col h5,
#patientInfoModal .col h5 { margin: 0 0 6px; }
#itemsModal .assign-list,
#spindModal .assign-list,
#doorAccessModal .assign-list,
#patientInfoModal .assign-list {
  min-height: 120px;
  max-height: 300px;
  overflow-y: auto;
  background: rgba(30,41,59,0.5);
  border: 1px dashed rgba(148,163,184,0.6);
  border-radius: 8px;
  padding: 6px;
}
#itemsModal .assign-item,
#spindModal .assign-item,
#doorAccessModal .assign-item,
#patientInfoModal .assign-item {
  padding: 6px 8px;
  margin: 4px 0;
  background: rgba(55,65,81,0.9);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: grab;
}
#itemsModal .assign-item .thumb,
#spindModal .assign-item .thumb,
#doorAccessModal .assign-item .thumb,
#patientInfoModal .assign-item .thumb {
  width: 28px;
  height: 28px;
  background-size: cover;
  background-position: center;
  border-radius: 6px;
}

#spindModal .spind-rename {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 8px 0 12px;
}
#spindModal .spind-rename input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.5);
  background: rgba(30,41,59,0.8);
  color: rgba(248,250,252,0.95);
}

#patientInfoModal .patient-info-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  margin-bottom: 8px;
}

#patientInfoModal .patient-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

#patientInfoModal .assign-list {
  min-height: 180px;
}

#patientInfoModal .patient-info-value {
  display: flex;
  align-items: center;
  gap: 8px;
}

#patientInfoModal .patient-info-value .badge {
  margin-left: auto;
}

#patientInfoModal .patient-info-value.unknown {
  opacity: 0.9;
}

#patientInfoModal .patient-info-value.running {
  outline: 1px dashed rgba(59,130,246,0.7);
}
.panel {
  min-width: 220px;
  background: rgba(15,23,42,0.92);
  border: 1px solid rgba(148,163,184,0.5);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.5);
  z-index: 14;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.panel .scroll {
  max-height: 260px;
  overflow-y: auto;
}
.panel .scroll.small { max-height: 140px; }
.panel .scroll.medium { max-height: 200px; }
.panel .item {
  padding: 6px;
  background: rgba(30,41,59,0.7);
  border-radius: 8px;
  margin-bottom: 6px;
  border: 1px solid rgba(148,163,184,0.25);
}
.status-display {
  padding: 6px;
  background: rgba(30,41,59,0.9);
  border-radius: 8px;
  border: 1px solid rgba(94,234,212,0.4);
  margin-bottom: 6px;
  font-weight: 600;
}
.radio-quick button.warn {
  border-color: rgba(248,113,113,0.8);
  color: #fca5a5;
}
.pager-flash {
  animation: flash 0.9s ease-in-out infinite;
}
@keyframes flash {
  0%,100% { box-shadow: 0 0 0 rgba(255,255,255,0); }
  50% { box-shadow: 0 0 22px rgba(251,191,36,0.8); }
}
.pager-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #1f2937;
  border: 2px solid #111827;
  border-radius: 18px;
  padding: 8px;
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  height: 360px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.45);
  cursor: move;
  user-select: none;
}
.pager-screen {
  background: transparent;
  color: #0f172a;
  border-radius: 10px;
  flex: 1;
  min-height: 0;
  padding: 0;
  border: none;
  overflow: hidden;
}
.pager-page.hidden { display: none; }
.pager-screen {
  position: relative;
}
.pager-page {
  height: 100%;
  min-height: 0;
}
.pager-subs {
  background: #3d8c3d;
  border-radius: 10px;
  padding: 10px;
  color: #0f172a;
  height: 100%;
  border: none;
  overflow-y: auto;
}
.pager-subs input {
  width: 100%;
  color: #0f172a;
  background: rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.2);
  border-radius: 6px;
  padding: 4px 6px;
}
.pager-subs select {
  width: 100%;
  color: #0f172a;
  background: rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.2);
  border-radius: 6px;
  padding: 4px 6px;
}
.pager-actions {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.pager-actions button {
  flex: 1;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.6);
  background: #374151;
  color: #e5e7eb;
  font-weight: 700;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pager-actions button.accent {
  font-size: 18px;
  background: #4b5563;
  text-align: center;
}
.pager-nav {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  justify-content: center;
}
.pager-nav .square-btn {
  width: 70px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.6);
  background: #374151;
  color: #e5e7eb;
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.pager-single {
  background: #3d8c3d;
  border-radius: 10px;
  padding: 10px;
  color: #0f172a;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
}
.pager-time {
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}
.pager-date {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.1;
}
.pager-keyword {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.05;
}
.pager-line {
  font-size: 18px;
  font-weight: 900;
  line-height: 1.1;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.pager-details {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.1;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.pager-spacer {
  height: 8px;
}
.pager-single.alert {
  animation: pagerPulse 1s infinite alternate;
}
@keyframes pagerPulse {
  from { background: #3d8c3d; }
  to { background: #61c561; }
}
.pager-screen .item {
  background: transparent;
  border: none;
  color: #0f172a;
  padding: 2px 0;
}
.pager-close {
  position: absolute;
  right: 6px;
  top: 6px;
  border: none;
  background: #ef4444;
  color: white;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  z-index: 10;
}
.round {
  border-radius: 50% !important;
}
.radio-form {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}
#dispatchModal {
  position: absolute;
  inset: 0;
  background: transparent;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  /* Tablet-embedded Dispo-Skalierung */
  --disp-font: 12px;
  --disp-gap: 12px;
  --disp-radius: 24px;
  --disp-pad: 12px;
  --disp-panel-pad: 12px;
  --disp-border: 8px;
  --disp-input-h: 44px;
  --disp-btn-h: 40px;
  --disp-main-btn-h: 56px;
  --disp-btn-radius: 12px;
  font-size: var(--disp-font);
}
#dispatchModal .dispatch-shell {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  background: none;
  box-shadow: none;
  border-radius: 26px;
}
#dispatchModal .close {
  display: none;
}
.dispatch-patients-shell {
  width: 100%;
  height: 100%;
  background: #3a3a3a;
  border: 1px solid rgba(0,0,0,0.25);
  border-radius: 0;
  padding: var(--disp-pad, 14px);
  box-shadow: none;
  position: relative;
  user-select: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: calc(var(--disp-gap, 12px) * 0.6);
  line-height: 1.25;
}
#dispatchPatientsModal {
  position: absolute;
  inset: 0;
  background: transparent;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  /* gleiche Skalierung wie Dispo (embedded) */
  --disp-font: 12px;
  --disp-gap: 12px;
  --disp-radius: 24px;
  --disp-pad: 12px;
  --disp-input-h: 44px;
  --disp-btn-h: 40px;
  --disp-btn-radius: 12px;
  font-size: var(--disp-font);
}

@supports (font-size: 1cqh) {
  #dispatchModal,
  #dispatchPatientsModal {
    --disp-font: clamp(10px, 1.6cqh, 14px);
    --disp-gap: clamp(8px, 1.4cqh, 18px);
    --disp-radius: clamp(18px, 3.6cqh, 44px);
    --disp-pad: clamp(10px, 1.8cqh, 18px);
    --disp-panel-pad: clamp(10px, 1.8cqh, 18px);
    --disp-border: clamp(6px, 1.2cqh, 10px);
    --disp-input-h: clamp(36px, 6.2cqh, 56px);
    --disp-btn-h: clamp(32px, 5.6cqh, 46px);
    --disp-main-btn-h: clamp(44px, 7.5cqh, 64px);
    --disp-btn-radius: clamp(10px, 1.6cqh, 14px);
  }
}
.dispatch-patients-shell h4 {
  font-size: 1.2em;
  font-weight: 900;
}
.dispatch-patients-shell .close { display: none; }
.dispatch-patients-shell .field::placeholder {
  color: rgba(255,255,255,0.82);
  opacity: 1;
}
.dispatch-patients-shell .field {
  min-height: var(--disp-input-h);
  line-height: 1.2;
}
.dispatch-patients-shell input[type="date"] {
  color-scheme: dark;
}
.dispatch-patients-shell input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.85;
}
.dispatch-patients-shell .close {
  position: absolute;
  right: var(--disp-pad);
  top: var(--disp-pad);
  width: calc(var(--disp-btn-h) * 1.15);
  height: var(--disp-btn-h);
  border-radius: var(--disp-btn-radius);
  background: #cf3030;
  border: none;
  color: #fff;
  font-size: 1em;
  cursor: pointer;
}
.dispatch-patients-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--disp-gap);
  flex: 1;
  min-height: 0;
}
.dispatch-patients-left,
.dispatch-patients-right {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dispatch-patients-actions {
  display: flex;
  gap: calc(var(--disp-gap) * 0.55);
  align-items: center;
}
.dispatch-patients-actions .btn {
  border-radius: var(--disp-btn-radius);
  padding: 0.8em 1em;
  font-weight: 800;
}
.dispatch-patients-actions .btn.btn-danger { background: #cf3030; }
.dispatch-patients-actions .btn.btn-ghost { background: #5b5b5b; }
.dp-sort {
  padding: 10px;
  height: 44px;
  flex: 1;
  background: #707070;
  border: none;
  color: #e5e7eb;
  border-radius: var(--disp-btn-radius);
}
.dispatch-patients-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: #4b4b4b;
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: var(--disp-radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dp-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border-radius: var(--disp-btn-radius);
  background: #6a6a6a;
  border: 1px solid rgba(0,0,0,0.10);
  cursor: pointer;
}
.dp-row.active {
  outline: 2px solid rgba(94,234,212,0.55);
}
.dp-badge {
  width: 64px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #111827;
  letter-spacing: 0.5px;
}
.dp-badge.none { background: #a3a3a3; color: #111827; }
.dp-badge.rot { background: #ef4444; color: #111827; }
.dp-badge.gelb { background: #fbbf24; color: #111827; }
.dp-badge.gruen { background: #22c55e; color: #052e16; }
.dp-badge.blau { background: #60a5fa; color: #0b1220; }
.dp-badge.schwarz { background: #111827; color: #f9fafb; border: 1px solid rgba(255,255,255,0.25); }
.dp-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.dp-title {
  font-weight: 800;
  color: #e5e7eb;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.dp-subline {
  font-size: 0.85rem;
  color: rgba(226,232,240,0.85);
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.dispatch-patients-right .field {
  background: #707070;
  border: none;
  color: #f3f3f3;
  border-radius: var(--disp-btn-radius);
  padding: 0.85em 1em;
}
.dispatch-patients-right .field.textarea {
  height: clamp(90px, 18vh, 170px);
  background: #707070;
  resize: none;
}

.dp-form {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
}
.dp-form-grid {
  display: grid;
  grid-template-columns: 0.5fr 1fr;
  gap: 10px;
}
#dpPatientFirstName,
#dpPatientLastName {
  grid-column: 1 / span 2;
}
@media (min-width: 900px) {
  .dp-form-grid {
    grid-template-columns: 0.5fr 1fr 1fr 0.7fr;
  }
  #dpPatientFirstName { grid-column: 1 / span 2; }
  #dpPatientLastName { grid-column: 3 / span 2; }
  #dpPatientDob { grid-column: 1 / span 2; }
  #dpPatientAge { grid-column: 3 / span 1; }
  #dpPatientGender { grid-column: 4 / span 1; }
}
.dispatch-window {
  width: min(1350px, 96vw);
  height: min(760px, 92vh);
  background: #3a3a3a;
  border-radius: var(--disp-radius);
  box-shadow: 0 18px 60px rgba(0,0,0,.65);
  padding: var(--disp-pad);
  position: relative;
  overflow: hidden;
  border: var(--disp-border) solid rgba(0,0,0,0.22);
}
#dispatchModal .dispatch-window {
  width: 100%;
  height: 100%;
  border-radius: 0;
  box-shadow: none;
  border: none;
  padding: var(--disp-pad);
}
.dispatch-grid-new {
  position: absolute;
  inset: var(--disp-pad);
  display: grid;
  grid-template-columns: 1.05fr 1.55fr 0.85fr;
  grid-template-rows: 1fr 0.34fr;
  gap: var(--disp-gap);
}
.disp-left { grid-column: 1; grid-row: 1; }
.disp-center { grid-column: 2; grid-row: 1; }
.disp-right { grid-column: 3; grid-row: 1; }
.disp-bottom-left { grid-column: 1; grid-row: 2; }
.disp-bottom-center { grid-column: 2; grid-row: 2; }
.disp-bottom-right { grid-column: 3; grid-row: 2; }
.disp-panel {
  background: #4b4b4b;
  border-radius: var(--disp-radius);
  padding: var(--disp-panel-pad);
  display: flex;
  flex-direction: column;
  color: #f5f5f5;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -1px 0 rgba(0,0,0,0.25);
  overflow: hidden;
}
.disp-right { display: flex; flex-direction: column; }
.disp-title {
  font-weight: 900;
  font-size: 1.35em;
  margin-bottom: 0.8em;
  letter-spacing: 0.2px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
.field-group { margin: 0; }
.field-row { display: grid; grid-template-columns: 2fr 0.9fr; gap: 10px; }
#dispatch-einsatzmaske{
  height: 100%;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* Mehr Platz für "Details" (Rows 5-6), responsive Höhen für Eingaben/Buttons */
  grid-template-rows: auto var(--disp-input-h) var(--disp-input-h) var(--disp-input-h) 1.6fr 1.6fr var(--disp-btn-h) var(--disp-main-btn-h);
  gap: calc(var(--disp-gap) * 0.66);
}

.field {
  width: 100%;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 10px;
  padding: 14px;
  background: #8b8b8b;
  color: #f3f3f3;
  font-size: 1rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.field.textarea { resize: none; height: 130px; background: #7b7b7b; }
.field.select { appearance: none; }
.field-small { max-width: 120px; }
#dispatchModal .field {
  border: none;
  border-radius: var(--disp-btn-radius);
  padding: 0.85em 1em;
  background: #707070;
  color: #f3f3f3;
  font-size: 1em;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    inset 0 -1px 0 rgba(0,0,0,0.20);
}
#dispatchModal .field::placeholder { color: rgba(255,255,255,0.90); }
#dispatchModal .field.textarea {
  resize: none;
  height: 100%;
  background: #707070;
}
#dispatchModal .field.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='%23ffffff' fill-opacity='0.85' d='M5.5 7.5 10 12l4.5-4.5 1.4 1.4L10 14.8 4.1 8.9z'/%3E%3C/svg%3E");
  background-position: right 1em center;
  background-size: 1.1em 1.1em;
  background-repeat: no-repeat;
  padding-right: 3em;
}
#dispatchModal #dispatch-einsatzmaske input.field,
#dispatchModal #dispatch-einsatzmaske select.field {
  height: var(--disp-input-h);
}
#dispatchModal .field-small { max-width: 8em; text-align: center; }

#dispatchModal .btn,
#dispatchModal .square-btn,
#dispatchModal .micro-btn,
#dispatchModal .mission-remove,
#dispatchModal .incident-actions .btn-small {
  border: none;
  border-radius: var(--disp-btn-radius);
  padding: 0.8em 1em;
  background: #5b5b5b;
  color: #fff;
  font-weight: 800;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    inset 0 -1px 0 rgba(0,0,0,0.18);
  transition: transform 0.08s ease, filter 0.12s ease;
  cursor: pointer;
}
#dispatchModal .btn:hover,
#dispatchModal .square-btn:hover { filter: brightness(1.07); }
#dispatchModal .btn:active,
#dispatchModal .square-btn:active { transform: translateY(1px); }
#dispatchModal .btn-danger {
  background: #cf3030;
}
#dispatchModal .btn-ghost {
  background: #5b5b5b;
}
#dispatchModal #dispatchSend {
  font-size: 1.15em;
  height: var(--disp-main-btn-h);
}
#dispatchModal #patientBtn {
  line-height: 1.05;
  font-size: 0.9em;
  height: var(--disp-main-btn-h);
}
#dispatchModal #missionNew,
#dispatchModal #missionSaveMain,
#dispatchModal #missionDelete {
  height: var(--disp-btn-h);
  font-size: 0.9em;
}

#dispatchModal .unit-overview-row {
  background: #6a6a6a;
  border-radius: 1em;
  padding: 0.85em 1em;
  border: 1px solid rgba(0,0,0,0.10);
  font-weight: 800;
  font-size: 1em;
}
#dispatchModal .unit-overview-row .row-actions { gap: 0.75em; }
#dispatchModal .micro-btn {
  height: var(--disp-btn-h);
  padding: 0 1em;
  font-size: 0.92em;
  font-weight: 800;
  border-radius: var(--disp-btn-radius);
  background: #5b5b5b;
}
#dispatchModal .badge {
  min-width: 2.6em;
  height: 2.6em;
  border-radius: var(--disp-btn-radius);
  font-weight: 900;
  font-size: 1.05em;
}

/* Einsatzmittelübersicht: Liste soll "größer" sein, aber die Controls unten sichtbar lassen */
#dispatchModal .disp-center { min-height: 0; }
#dispatchModal #dispatchBoard {
  flex: 1;
  min-height: 0;
  margin-bottom: calc(var(--disp-gap) * 0.35);
  display: flex;
}
#dispatchModal #dispatchBoard .board-scroll {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}
#dispatchModal #dispatchBoard .board-list {
  flex: 1;
  min-height: 0;
}

/* Buttons im Dispo: abgerundete Rechtecke (keine Kreise) */
#dispatchModal .square-btn {
  width: calc(var(--disp-btn-h) * 1.15);
  height: var(--disp-btn-h);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--disp-btn-radius);
}

#dispatchModal .incident-card,
#dispatchModal .mission-unit,
#dispatchModal .status-alert {
  background: #6a6a6a;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.10);
}
#dispatchModal .status-alert.danger {
  background: #e13232;
  color: #fff;
  border-color: rgba(0,0,0,0.18);
}
.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.btn-row .btn { flex: 1; min-width: 110px; }
.mask-actions,
.mask-main-actions {
  grid-column: 1 / span 3;
  width: 100%;
}
.mask-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.mask-actions .btn { flex: none; min-width: 0; width: 100%; }
.mask-main-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 6px;
}
.mask-main-actions .btn { flex: none; min-width: 0; width: 100%; }
.mask-city,
.mask-street,
.mask-keyword,
.mask-notes {
  grid-column: 1 / span 3;
}
.btn,
.square-btn,
.micro-btn,
.mission-remove,
.incident-actions .btn-small {
  border: none;
  border-radius: 10px;
  padding: 12px 14px;
  background: #6a6a6a;
  color: #fff;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  transition: background 0.12s ease, transform 0.08s ease;
  cursor: pointer;
}
.btn:hover,
.square-btn:hover,
.micro-btn:hover,
.mission-remove:hover,
.incident-actions .btn-small:hover { background: #767676; }
.btn:active,
.square-btn:active,
.micro-btn:active,
.mission-remove:active,
.incident-actions .btn-small:active { transform: translateY(1px); }
.btn-danger { background: #e13232; }
.btn-danger:hover { background: #ed3f3f; }
.btn-ghost { background: #6a6a6a; }
.square-btn { width: 38px; height: 38px; padding: 0; font-size: 1.1rem; }
.micro-btn { padding: 8px 12px; font-size: .85rem; }
.mission-remove { width: 28px; height: 28px; padding: 0; font-size: 1rem; }
.subpanel {
  margin-top: 16px;
  background: #2f2f2f;
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(255,255,255,0.04);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.subpanel-title { font-size: .9rem; font-weight: 600; margin-bottom: 4px; }
.unit-bottom-row { display: flex; gap: 8px; align-items: center; }
.square-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: none;
  background: #555;
  color: #fff;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.35);
}
.board-add {
  background: #4b4f55;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #c7c7c7;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.05);
}
.middle-top {
  background: #3b3b3b;
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 360px;
  border: 1px solid rgba(255,255,255,0.04);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  overflow: hidden;
}
.middle-bottom {
  margin-top: 10px;
  background: #3b3b3b;
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid rgba(255,255,255,0.04);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  flex: 0 0 240px;
  overflow: hidden;
}
.unit-overview-row {
  background: #8a8a8a;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  border: 1px solid rgba(0,0,0,0.2);
}
.row-actions { display: flex; gap: 6px; align-items: center; }
.micro-btn {
  background: #5d5d5d;
  border-radius: 10px;
  border: none;
  padding: 6px 10px;
  font-size: .85rem;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.badge {
  min-width: 28px;
  height: 28px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  padding: 0 8px;
  color: #fff;
}
.badge.red { background: #cf3030; }
.badge.green { background: #49a64c; }
.badge.orange { background: #d27b2a; }
.badge.status { border-radius: 8px; }
.badge.status.s1,
.badge.status.s2 { background: #4caf50; }
.badge.status.s3 { background: #3b82f6; }
.badge.status.s4 { background: #e13232; }
.badge.status.s6 { background: #6b7280; }
.badge.status.s7 { background: #8b5cf6; }
.badge.status.s8 { background: #f97316; }
.badge.status.s9 { background: #facc15; color: #111; }
.badge.status.s0 { background: #e13232; }
.badge.status.s5 { background: #9ca3af; }

.badge-clickable {
  border: none;
  cursor: pointer;
}
.badge-clickable:hover { filter: brightness(1.05); }
.badge-clickable:active { transform: translateY(1px); }

.dispatch-status-popover {
  position: fixed;
  z-index: 40;
  background: rgba(40,40,40,0.98);
  border: 1px solid rgba(0,0,0,0.35);
  border-radius: 14px;
  padding: 10px;
  width: 220px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.55);
  user-select: none;
}
.dispatch-status-popover.hidden { display: none; }
.dispatch-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.dispatch-status-title {
  font-weight: 900;
  letter-spacing: 0.2px;
}
.dispatch-status-close {
  border: none;
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-radius: 10px;
  width: 34px;
  height: 34px;
  cursor: pointer;
}
.dispatch-status-unit {
  opacity: 0.9;
  font-size: 0.9rem;
  margin-bottom: 8px;
}
.dispatch-status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.dispatch-status-key {
  border: none;
  width: 100%;
  height: 44px;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
}

.notify-stack {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(420px, calc(100vw - 28px));
  pointer-events: none;
}
.notify {
  pointer-events: auto;
  background: rgba(35, 35, 35, 0.96);
  border: 1px solid rgba(0,0,0,0.35);
  border-left: 6px solid rgba(255,255,255,0.18);
  border-radius: 14px;
  padding: 10px 10px 10px 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.55);
  color: #fff;
}
.notify.info { border-left-color: #60a5fa; }
.notify.success { border-left-color: #22c55e; }
.notify.warn { border-left-color: #f97316; }
.notify.danger { border-left-color: #ef4444; }
.notify-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.notify-title {
  font-weight: 900;
  letter-spacing: 0.2px;
}
.notify-close {
  border: none;
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-radius: 10px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  flex: 0 0 auto;
}
.notify-msg {
  margin-top: 6px;
  line-height: 1.25;
  opacity: 0.95;
  white-space: pre-wrap;
}
.board-list { display: flex; flex-direction: column; gap: 8px; }
.board-scroll {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}
.board-card {
  background: #6a6a6a;
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(0,0,0,0.10);
}
.board-card .name { font-weight: 700; }
.board-card .status { font-size: 0.9rem; color: #e5e7eb; opacity: 0.9; }
.board { display: flex; flex-direction: column; gap: 10px; }
.board-wide { padding: 0; }
.board-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.board-scroll {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}
.board-head {
  background: #4f4f4f;
  padding: 10px;
  border-radius: 10px;
  font-weight: 700;
  color: #fff;
  border: 1px solid rgba(0,0,0,0.15);
}
.overview-footer,
.overview-top {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}
.overview-search {
  flex: 1;
  height: 44px;
  font-weight: 700;
  color: #f5f5f5;
  background: #6f6f6f;
  border: 1px solid rgba(0,0,0,0.2);
}
.overview-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.disp-center { display: flex; flex-direction: column; }
#dispatchBoard { flex: 1; margin-bottom: 8px; }
.overview-stack { margin-top: auto; }
.overview-row { display: flex; align-items: center; gap: 10px; }
.overview-btns { display: flex; gap: 8px; }
.overview-row .square-btn { width: 38px; height: 38px; padding: 0; }
#dispatchModal .overview-row .square-btn { width: var(--disp-btn-h); height: var(--disp-btn-h); font-size: 1.5em; }
.square-btn.danger {
  background: #e13232;
}
.helper-note {
  font-size: 0.85rem;
  color: #c7c7c7;
  opacity: 0.9;
}
.helper-note.slim-note { margin-top: 4px; font-size: 0.8rem; }
#assignMissionList {
  max-height: 160px;
  overflow-y: auto;
}
#missionList {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}
.status-alerts {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 16px;
  padding: 10px;
}
.status-alerts-title {
  font-weight: 700;
  margin-bottom: 6px;
}
.status-alerts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.main-actions .btn-danger { flex: 1; font-size: 1rem; }
.main-actions .btn-ghost { flex: 1; min-width: 150px; line-height: 1.2; }
.overview-add {
  background: #4b4f55;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #c7c7c7;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.05);
}
.plus-circle {
  width: 26px;
  height: 26px;
  border: 2px solid #c7c7c7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.service-row { display: flex; gap: 8px; align-items: center; }
.filter-select { min-width: 90px; }
.incident-list { display: flex; flex-direction: column; gap: 8px; }
.incident-card {
  background: #6b6b6b;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(0,0,0,0.15);
}
.incident-card.active {
  border: 2px solid rgba(255,255,255,0.5);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.1);
}
.incident-main { display: flex; flex-direction: column; gap: 4px; }
.incident-title { font-weight: 700; }
.incident-sub { font-size: .85rem; color: #c7c7c7; }
.incident-actions { display: flex; align-items: center; gap: 8px; }
.incident-actions .btn-small {
  background: #6a6a6a;
  padding: 8px 12px;
}
.mission-unit {
  background: #6f6f6f;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  border: 1px solid rgba(0,0,0,0.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07);
}
.mission-unit .left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}
.mission-remove {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: #444;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.status-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.status-entry {
  background: #6f6f6f;
  border-radius: 16px;
  padding: 14px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(0,0,0,0.10);
}
.status-entry-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#dispatchRadioList {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.status-alerts {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 16px;
  padding: 0;
  border: none;
  min-height: 80px;
}
.status-alerts-title {
  font-weight: 700;
  margin-bottom: 6px;
}
.status-alerts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.status-alerts-list.scroll {
  overflow-y: auto;
  padding-right: 4px;
}
.status-alerts-list.scroll.small { max-height: 220px; }
.status-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #6b6b6b;
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(0,0,0,0.15);
}
.status-alert.danger {
  background: #e13232;
  color: #fff;
}
.status-alert .left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.status-alert button {
  background: #374151;
  color: #e5e7eb;
  border: 1px solid rgba(148,163,184,0.6);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}

#loginModal input,
#adminModal input {
  width: 100%;
  padding: 8px;
  margin-bottom: 8px;
  border-radius: 8px;
  border: 1px solid rgba(148,163,184,0.4);
  background: rgba(15,23,42,0.7);
  color: #e5e7eb;
}
#loginModal .actions {
  display: flex;
  justify-content: flex-end;
}
#loginModal .error {
  color: #f87171;
  min-height: 18px;
}
#adminUserList {
  max-height: 240px;
  overflow: auto;
  margin-bottom: 10px;
}
#adminUserList .user-row {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 4px 0;
}
#adminUserList .user-row span {
  flex: 1;
}
#adminUserList button {
  padding: 4px 8px;
}
.hidden { display: none !important; }
#mainMenu {
  position: fixed;
  top: 70px;
  left: 12px;
  background: rgba(15,23,42,0.95);
  border: 1px solid rgba(148,163,184,0.7);
  border-radius: 10px;
  padding: 8px;
  z-index: 14;
  min-width: 200px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}
#mainMenu.hidden {
  display: none;
}
#mainMenu .menu-item {
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s ease, transform .08s ease;
}
#mainMenu .menu-item:hover {
  background: rgba(59,130,246,0.15);
  transform: translateY(-1px);
}
#touchControls {
  position: fixed;
  width: 100%;
  left: 0;
  bottom: 70px;
  display: none;
  justify-content: space-between;
  padding: 0 14px;
  z-index: 13;
  pointer-events: none;
}
#touchControls .touch-left,
#touchControls .touch-right {
  display: flex;
  gap: 6px;
  pointer-events: auto;
}
#touchControls .touch-left {
  flex-direction: column;
}
#touchControls .touch-right {
  flex-direction: row;
}
#touchControls .touch-action {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
  pointer-events: auto;
}
#touchControls button {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.6);
  background: radial-gradient(circle at top, rgba(55,65,81,.9), rgba(15,23,42,1));
  color: #e5e7eb;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (pointer: coarse), (max-width: 900px) {
  #touchControls {
    display: flex;
  }
  .desktop-only {
    display: none !important;
  }
}
@media (max-width: 720px) {
  #editPanel {
    max-width: 90vw;
  }
}
    #placePanel {
      position: fixed;
      bottom: 60px;
      left: 12px;
      padding: 8px 10px;
      background: rgba(15,23,42,0.85);
      border: 1px solid rgba(148,163,184,0.6);
      border-radius: 10px;
      font-size: 0.8rem;
      color: #e5e7eb;
      z-index: 11;
      display: flex;
      gap: 8px;
      align-items: center;
    }
    #editPanel {
      position: fixed;
      top: 12px;
      right: 12px;
      background: rgba(15,23,42,0.85);
      border: 1px solid rgba(148,163,184,0.7);
      border-radius: 12px;
      padding: 10px 14px;
      backdrop-filter: blur(8px);
      z-index: 10;
      display: flex;
      flex-direction: column;
      gap: 8px;
      min-width: 230px;
    }
    #editPanel.hidden {
      display: none;
}
#editPanel h3 {
  font-size: .95rem;
      font-weight: 600;
      margin-bottom: 2px;
    }
    #editPanel p {
      font-size: .78rem;
      color: #cbd5e1;
      line-height: 1.3;
    }
    #editPanel .row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }
    #editPanel button {
      flex: 1;
      justify-content: center;
    }
    #editPanel button.secondary {
      background: radial-gradient(circle at top, rgba(51,65,85,.85), rgba(15,23,42,1));
    }
    #editStatus {
      font-size: .78rem;
      color: #f8fafc;
    }
    #editStatus span.label {
      display: inline-block;
      padding: 2px 7px;
      border-radius: 999px;
      font-weight: 600;
      background: rgba(14,165,233,0.15);
      border: 1px solid rgba(14,165,233,0.5);
      color: #7dd3fc;
      margin-right: 6px;
    }
#adminAssign {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
#adminAssign .col {
  background: rgba(15,23,42,0.6);
  border: 1px solid rgba(148,163,184,0.4);
  border-radius: 8px;
  padding: 8px;
  min-height: 140px;
  max-height: 300px;
  overflow-y: auto;
}
#adminAssign h5 {
  margin: 0 0 6px;
  font-size: 0.9rem;
  color: #e5e7eb;
}
.assign-list {
  min-height: 100px;
  background: rgba(30,41,59,0.5);
  border: 1px dashed rgba(148,163,184,0.5);
  border-radius: 6px;
  padding: 6px;
  max-height: 220px;
  overflow-y: auto;
}
.assign-item {
  padding: 4px 6px;
  margin: 4px 0;
  background: rgba(55,65,81,0.9);
  border-radius: 6px;
  cursor: grab;
  display: flex;
  align-items: center;
  gap: 6px;
}
.assign-item .thumb {
  width: 24px;
  height: 24px;
  background-size: cover;
  background-position: center;
  border-radius: 4px;
}
.assign-item.selected {
  outline: 2px solid rgba(94,234,212,0.8);
}
.assign-item .mini {
  margin-left: auto;
  background: #444;
  color: #eee;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
}
.assign-item .mini.danger { background: #b91c1c; }
.assign-drop {
  min-height: 80px;
}
.assign-drop.drag-over {
  border-color: rgba(94,234,212,0.8);
  background: rgba(94,234,212,0.1);
}
#touchItemRotate {
  position: fixed;
  bottom: 140px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  gap: 10px;
  z-index: 14;
  pointer-events: none;
  align-items: center;
}
#touchItemRotate.active {
  display: flex;
}
#touchItemPreview {
  width: 64px;
  height: 64px;
  background: rgba(15,23,42,0.9);
  border: 1px solid rgba(148,163,184,0.6);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
#touchItemRotate button {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.6);
  background: radial-gradient(circle at top, rgba(55,65,81,.9), rgba(15,23,42,1));
  color: #e5e7eb;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}
#vehicleContext,
#doorContext,
#itemContext,
#abContext,
#patientContext,
#npcContext,
#playerContext,
#otherPlayerContext {
  position: fixed;
  z-index: 15;
  display: none;
  flex-direction: column;
  gap: 6px;
  background: rgba(15,23,42,0.95);
  border: 1px solid rgba(148,163,184,0.5);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
#vehicleContext {
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding-right: 6px;
  overscroll-behavior: contain;
}
#vehicleContext button,
#doorContext button,
#itemContext button,
#abContext button,
#patientContext button,
#npcContext button,
#playerContext button,
#otherPlayerContext button {
  min-width: 140px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148,163,184,0.6);
  background: radial-gradient(circle at top, rgba(55,65,81,.9), rgba(15,23,42,1));
  color: #e5e7eb;
  cursor: pointer;
  font-size: 14px;
}
#otherPlayerContext .danger {
  background: #991b1b;
  border-color: rgba(248,113,113,0.8);
}
#itemContext .danger {
  background: #991b1b;
  border-color: rgba(248,113,113,0.8);
}
#abContext .danger {
  background: #991b1b;
  border-color: rgba(248,113,113,0.8);
}
#doorContext .danger {
  background: #991b1b;
  border-color: rgba(248,113,113,0.8);
}
#npcContext .danger {
  background: #991b1b;
  border-color: rgba(248,113,113,0.8);
}
#npcContext .context-section {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(148,163,184,0.35);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(203,213,225,0.8);
}
#adminCreate {
  margin-top: 12px;
  border-top: 1px solid rgba(148,163,184,0.3);
  padding-top: 10px;
}
#adminCreate h5 { margin: 0 0 6px; }
#adminCreate .row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 6px;
}
#adminCreate input {
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(148,163,184,0.4);
  background: rgba(15,23,42,0.7);
  color: #e5e7eb;
}

#radioPanel {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
}
#pagerPanel.panel {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
}

/* === Smartphone (ersetzt TME/Funkgeräte) ======================== */
.phone-shell {
  --phone-w: 420px;
  --phone-h: calc(var(--phone-w) * 16 / 9);
  --phone-topbar-h: 56px;
  --phone-control-h: 58px;
  position: fixed;
  left: 16px;
  top: 64px;
  z-index: 60;
  width: var(--phone-w);
  height: var(--phone-h);
  border-radius: 26px;
  background: #2c3f64;
  border: 8px solid #223658;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  transform-origin: top left;
  touch-action: none;
  display: grid;
  grid-template-columns: 1fr calc(var(--phone-topbar-h) + 8px);
  grid-template-rows: var(--phone-topbar-h) 1fr;
  gap: 8px;
  padding: 8px;
}

/* === Tablet (Dispo/Patientenverwaltung) ========================= */
.tablet-shell {
  --tablet-w: 1080px;
  /* Taller ratio so 90vh fits without width-limiting on desktop */
  --tablet-h: calc(var(--tablet-w) * 10 / 16);
  --tablet-topbar-h: 56px;
  position: fixed;
  left: 16px;
  top: 64px;
  z-index: 65;
  width: var(--tablet-w);
  height: var(--tablet-h);
  border-radius: 44px;
  background: #3a3a3a;
  border: 10px solid #4b4b4b;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  transform-origin: top left;
  /* allow native scrolling inside tablet apps; drag is handled via topbar */
  touch-action: pan-x pan-y;
  display: grid;
  grid-template-columns: 1fr calc(var(--tablet-topbar-h) + 8px);
  grid-template-rows: var(--tablet-topbar-h) 1fr;
  gap: 10px;
  padding: 10px;
}
.tablet-shell.hidden { display: none; }
.tablet-topbar {
  grid-row: 1;
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #e0aa1a;
  color: #222;
  border: 3px solid #2a2a2a;
  border-radius: 16px;
  user-select: none;
  cursor: grab;
  touch-action: none;
}
.tablet-close {
  grid-row: 1;
  grid-column: 2;
  width: calc(var(--tablet-topbar-h) - 4px);
  height: calc(var(--tablet-topbar-h) - 4px);
  margin: 2px 2px 0 0;
  border: 3px solid #2a2a2a;
  background: #d12f2f;
  color: #fff;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 18px;
}
.tablet-shell button {
  box-shadow: none !important;
}
.tablet-screen {
  grid-row: 2;
  grid-column: 1 / 3;
  padding: 18px 16px;
  display: flex;
  overflow: hidden;
  background: #adadad;
  border-radius: 26px;
  border: 5px solid #474747;
  box-shadow: inset 0 10px 20px rgba(0,0,0,0.18);
  position: relative;
}
.tablet-mount {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.tablet-shell #tabletVehiclesMount .close,
.tablet-shell #tabletAdminItemsMount .close,
.tablet-shell #tabletPatientPlacementMount .close,
.tablet-shell #tabletEditMount .close {
  display: none !important;
}
.tablet-shell #tabletVehiclesMount .vehicle-shell,
.tablet-shell #tabletAdminItemsMount .modal-content,
.tablet-shell #tabletEditMount #editPanel,
.tablet-shell #tabletPatientPlacementMount .panel {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
}
.tablet-shell #tabletAdminItemsMount .modal-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.tablet-shell #tabletVehiclesMount .vehicle-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tablet-shell #tabletVehiclesMount #vehicleList {
  flex: 1;
  min-height: 0;
  max-height: none;
}
.tablet-shell #tabletAdminItemsMount #adminItemList {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.tablet-shell #tabletAdminItemsMount #adminItemList.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.tablet-shell #tabletPatientPlacementMount #patientPlacementList.scroll {
  max-height: none;
  overflow: auto;
}
.tablet-shell #tabletEditMount #editPanel {
  overflow: auto;
}
.tablet-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  background: transparent;
  padding: 0;
}
.tablet-page.hidden { display: none; }
.tablet-carrier { font-weight: 700; letter-spacing: 0.2px; font-size: 12px; }
.tablet-clock { font-variant-numeric: tabular-nums; opacity: 0.98; font-weight: 700; font-size: 12px; }

.tablet-app-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: auto;
  gap: 14px;
  align-items: start;
}
.tablet-app {
  min-height: 62px;
  border-radius: 18px;
  border: 4px solid #5a5a5a;
  background: #9d9d9d;
  color: rgba(255,255,255,0.95);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 12px;
  line-height: 1.05;
}
.tablet-app:active { transform: translateY(1px); }
.tablet-app[disabled] { opacity: 0.55; cursor: not-allowed; }

.tablet-modal-host {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 5px solid #6b6b6b;
  background: rgba(0,0,0,0.04);
  container-type: size;
}
.tablet-modal-host > .modal-content {
  width: 100%;
  height: 100%;
  max-height: none;
  overflow: auto;
  background: rgba(15,23,42,0.88);
  border: none;
  border-radius: 18px;
  padding: 14px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.tablet-bottom {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: stretch;
}
.tablet-bottom-pad {
  border-radius: 18px;
  border: 4px solid #6b6b6b;
  background: rgba(0,0,0,0.04);
}
.tablet-btn {
  min-width: 180px;
  border-radius: 18px;
  border: 4px solid #5a5a5a;
  background: #9d9d9d;
  color: rgba(255,255,255,0.95);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.2px;
  cursor: pointer;
}
.tablet-btn.secondary { background: #8c8c8c; }

.tablet-shortcuts-content { padding: 0; }
.tablet-shortcuts-viewer {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(0,0,0,0.08);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.tablet-shortcuts-stage {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.tablet-shortcuts-stage img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.tablet-shortcuts-toolbar {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 10px;
  z-index: 2;
}

.dp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.dp-mission {
  max-width: 360px;
}
.phone-shell.hidden { display: none; }
.phone-topbar {
  grid-row: 1;
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 12px;
  background: #a52507;
  color: rgba(246, 240, 234, 0.96);
  border: none;
  border-radius: 10px 10px 0 0;
  user-select: none;
  cursor: default;
  touch-action: auto;
}
.phone-carrier {
  font-weight: 400;
  letter-spacing: -0.02em;
  font-size: clamp(22px, 3.8vw, 38px);
  line-height: 1;
}
.phone-clock {
  display: none;
}
.phone-topbar-action {
  border: none;
  background: rgba(0, 0, 0, .5);
  border-radius: 5px;
  color: rgba(246, 240, 234, 0.96);
  font-weight: 400;
  font-size: clamp(16px, 2.5vw, 22px);
  padding: 4px;
  box-shadow: none !important;
}
.phone-topbar-action.hidden {
  display: none !important;
}
.phone-screen {
  grid-row: 2;
  grid-column: 1 / 3;
  padding: 0;
  display: flex;
  overflow: hidden;
  background: transparent;
  border-radius: 0 0 16px 16px;
  border: none;
  box-shadow: none;
  position: relative;
}
.phone-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  background: #9d9da0;
  padding: 0;
}
.phone-page.hidden { display: none; }

#phoneLogin {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto auto auto auto 1fr;
  gap: 10px;
  padding: 18px 16px;
  align-content: start;
}
.phone-login-logo {
  width: 100%;
  max-width: 380px;
  justify-self: center;
  object-fit: contain;
  height: auto;
  margin: 8px 0 2px;
}
.phone-login-title {
  font-size: 2.1em;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: rgba(15, 23, 42, 0.85);
}
.phone-login-error {
  min-height: 1.2em;
  font-size: 0.9em;
  color: #cf3030;
  font-weight: 600;
}

.phone-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 16px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: none;
}
.phone-loading-overlay.hidden { display: none; }
.phone-loading-inner {
  width: 100%;
  max-width: 360px;
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}
.phone-loading-logo {
  width: 100%;
  max-width: 320px;
  height: auto;
  object-fit: contain;
}
.phone-loading-title {
  font-size: 1.3em;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: rgba(248, 250, 252, 0.95);
}
.phone-loading-bar {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  border: 3px solid rgba(148, 163, 184, 0.55);
  background: rgba(2, 6, 23, 0.35);
  overflow: hidden;
}
.phone-loading-bar-fill {
  height: 100%;
  width: 0%;
  background: rgba(34, 197, 94, 0.9);
  border-radius: 999px;
  transition: width 120ms linear;
}
.phone-loading-progress {
  font-variant-numeric: tabular-nums;
  font-size: 0.95em;
  color: rgba(226, 232, 240, 0.92);
  font-weight: 600;
}

.loading-logo {
  width: min(280px, 70vw);
  height: auto;
  object-fit: contain;
  margin-bottom: 10px;
}
.phone-select {
  width: 100%;
  height: var(--phone-control-h);
  min-height: var(--phone-control-h);
  padding: 0 44px 0 16px;
  border-radius: 0;
  border: none;
  background: #7b7b80;
  color: rgba(255,255,255,0.96);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.2px;
  line-height: 1;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #223b66 50%),
    linear-gradient(135deg, #223b66 50%, transparent 50%);
  background-position:
    calc(100% - 22px) 50%,
    calc(100% - 14px) 50%;
  background-size: 8px 8px, 8px 8px;
  background-repeat: no-repeat;
}
.phone-select.phone-select-status {
  background: #7f7f84;
  color: rgba(255,255,255,0.96);
}
.phone-btn {
  height: var(--phone-control-h);
  min-height: var(--phone-control-h);
  padding: 0 12px;
  border-radius: 0;
  border: none;
  background: #173255;
  color: rgba(255,255,255,0.96);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.05;
}
.phone-btn.secondary { background: #173255; }
.phone-btn.danger {
  background: #b40038;
}

.phone-shell button {
  max-width: 100%;
  box-shadow: none !important;
  transition: none !important;
  transform: none !important;
}
.phone-shell button:hover,
.phone-shell button:active {
  box-shadow: none !important;
  transform: none !important;
}
.phone-btn:not(:disabled):hover,
.phone-btn:not(:disabled):active,
.tme-action:not(:disabled):hover,
.tme-action:not(:disabled):active,
.tme-bottom-btn:not(:disabled):hover,
.tme-bottom-btn:not(:disabled):active,
.funk-ptt:not(:disabled):hover,
.funk-ptt:not(:disabled):active {
  background: #29517f;
}
.phone-btn.danger:not(:disabled):hover,
.phone-btn.danger:not(:disabled):active,
.tme-action.danger:not(:disabled):hover,
.tme-action.danger:not(:disabled):active,
.phone-emergency-btn.danger:not(:disabled):hover,
.phone-emergency-btn.danger:not(:disabled):active,
.funk-card-close:not(:disabled):hover,
.funk-card-close:not(:disabled):active,
.chat-msg-delete:not(:disabled):hover,
.chat-msg-delete:not(:disabled):active {
  background: #d01853;
}
/* === Smartphone: Homescreen (Grid) ================================ */
.phone-home {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-x: hidden;
  overflow-y: hidden;
  padding: 0 0 10px;
  border-radius: 0;
}
.phone-home::before {
  content: "";
  display: block;
  height: 16px;
  background: #c2c2c4;
  flex: 0 0 16px;
}
.phone-home .phone-select {
  width: 100%;
  min-height: var(--phone-control-h);
}
#phoneHome .phone-select-unit {
  background: #59616d;
  color: #d7dae2;
}
#phoneHome .phone-select-status {
  background: #37980d;
  color: #dcebd8;
}
#phoneHome .phone-select,
#phoneHome .phone-emergency-btn {
  width: 100%;
  margin: 0;
}
#phoneHome .phone-select {
  background-size: 12px 12px, 12px 12px;
  background-position:
    calc(100% - 28px) 50%,
    calc(100% - 16px) 50%;
}
.phone-emergency {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 0 0 0;
  margin-top: auto;
}
.phone-status-spacer {
  flex: 1;
  min-height: 180px;
  background: #9d9da0;
  border-radius: 0;
}
.phone-emergency-btn {
  min-height: var(--phone-control-h);
  height: var(--phone-control-h);
  padding: 0 12px;
  border-radius: 0;
  white-space: normal;
  line-height: 1.05;
  text-align: center;
  flex-direction: column;
  overflow: visible;
  text-overflow: clip;
  font-size: 18px;
}
.phone-emergency-btn span {
  display: block;
  width: 100%;
}
.phone-emergency-btn.danger {
  background: #c4003a;
}
.phone-emergency-btn:not(.danger) {
  background: #173255;
  color: rgba(255,255,255,0.96);
}

/* === Smartphone: Menu ========================================== */
.phone-menu {
  flex: 1;
  min-height: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  background: #081c38;
  gap: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #0f2f57 #223e64;
  position: relative;
}
.phone-menu::-webkit-scrollbar {
  width: 10px;
}
.phone-menu::-webkit-scrollbar-track {
  background: #223e64;
}
.phone-menu::-webkit-scrollbar-thumb {
  background: #0f2f57;
}
.phone-menu > .phone-menu-item {
  width: 100%;
  height: var(--phone-control-h);
  min-height: var(--phone-control-h);
  padding: 0 22px;
  border: none;
  border-radius: 0;
  background: #05152b;
  color: #c6cfdd;
  font-size: clamp(22px, 3.2vw, 33px);
  font-weight: 400;
  display: flex;
  align-items: center;
  text-align: left;
  justify-content: flex-start;
  cursor: pointer;
  box-shadow: none !important;
  line-height: 1;
}
.phone-menu > .phone-menu-item + .phone-menu-item {
  margin-top: 10px;
}
.phone-menu-item:active {
  background: #3c5a86;
}
.phone-menu-item:disabled {
  opacity: 0.45;
}
.phone-menu-item:not(:disabled):hover {
  background: #3c5a86;
}
/* === TME App (Smartphone) ======================================= */
.tme-title {
  display: none;
}
.tme-body {
  grid-column: 1 / -1;
  flex: 1;
  min-height: 0;
  border-radius: 0;
  border: none;
  padding: 0;
  background: transparent;
  overflow: hidden;
}
.tme-page {
  height: 100%;
  min-height: 0;
}
.tme-list {
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-right: 0;
}
.tme-card {
  border-radius: 0;
  border: none;
  border-top: 4px solid #8f9093;
  background: #9d9da0;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr 128px;
  gap: 12px;
  color: #111;
}
.tme-card.acked {
  opacity: 0.75;
}
.tme-card-time {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.8;
  margin-bottom: 4px;
  color: #233552;
}
.tme-card-alarmid {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #233552;
}
.tme-card-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 2px;
  color: #111;
}
.tme-card-line {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.92;
  color: #1f2937;
}
.tme-card-details {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.9;
  color: #1f2937;
}
.tme-card-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}
.tme-action {
  width: 100%;
  height: var(--phone-control-h);
  min-height: var(--phone-control-h);
  padding: 0 10px;
  border-radius: 0;
  border: none;
  font-weight: 700;
  background: #173255;
  color: #eef1f7;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tme-action.danger {
  background: #c4003a;
  color: #fff;
}
.tme-action:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.tme-subs {
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-right: 0;
}
.tme-sub {
  border-radius: 0;
  border: none;
  border-top: 4px solid #8f9093;
  background: #9d9da0;
  padding: 14px 16px;
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  align-items: stretch;
  gap: 10px;
  color: #111;
}
.tme-sub-name {
  font-weight: 700;
  font-size: 14px;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tme-sub-right {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  justify-content: stretch;
  gap: 12px;
  width: 100%;
}
.tme-sub-select {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  border-radius: 0;
  border: none;
  background: #59616d;
  color: rgba(255,255,255,0.96);
  font-weight: 700;
  padding: 0 12px;
  font-size: 14px;
}
.tme-switch {
  position: relative;
  width: 72px;
  height: 40px;
  border-radius: 0;
  background: #59616d;
  border: none;
  flex: 0 0 auto;
}
.tme-switch::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.85);
  transition: transform 0.15s ease;
}
.tme-sub input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.tme-sub.on .tme-switch {
  background: #4caf50;
}
.tme-sub.on .tme-switch::after {
  transform: translateX(28px);
}
.tme-bottom {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px 0 0;
}
.tme-bottom-btn {
  width: 100%;
  height: var(--phone-control-h);
  min-height: var(--phone-control-h);
  padding: 0 12px;
  border-radius: 0;
  border: none;
  background: #173255;
  color: rgba(255,255,255,0.96);
  font-weight: 700;
  cursor: pointer;
  min-width: 120px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === Funk App (Smartphone) ====================================== */
.funk-title {
  display: none;
}
.funk-body {
  grid-column: 1 / -1;
  min-height: 0;
  border-radius: 0;
  border: none;
  padding: 0;
  background: transparent;
  overflow: hidden;
}
.funk-cards {
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-right: 0;
}
.funk-empty {
  border-radius: 0;
  border: none;
  border-top: 4px solid #8f9093;
  background: #9d9da0;
  padding: 14px 16px;
  font-weight: 600;
  color: rgba(17, 24, 39, 0.85);
}
.funk-card {
  position: relative;
  border-radius: 0;
  border: none;
  border-top: 4px solid #8f9093;
  background: #9d9da0;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  color: #111;
  cursor: default;
}
.funk-card.dragging {
  opacity: 0.6;
}
.funk-card.drag-over {
  outline: 3px dashed rgba(17, 24, 39, 0.6);
  outline-offset: 4px;
}
.funk-card-title {
  font-weight: 800;
  font-size: 20px;
  color: #111;
  padding-right: 54px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.funk-card-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border-radius: 0;
  border: none;
  background: #c4003a;
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.funk-card-speaklabel {
  font-size: 14px;
  font-weight: 700;
  color: rgba(17, 24, 39, 0.85);
}
.funk-card-speakname {
  font-size: 18px;
  font-weight: 800;
  color: #111;
}
.funk-ptt {
  border-radius: 0;
  border: none;
  background: #173255;
  color: rgba(255,255,255,0.96);
  font-weight: 800;
  font-size: 20px;
  height: var(--phone-control-h);
  min-height: var(--phone-control-h);
}
.funk-bottom {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  gap: 12px;
  padding-top: 12px;
}
.funk-bottom .phone-select {
  grid-column: 1;
  grid-row: 1;
  height: auto;
}
#phoneFunkGroupAdd {
  grid-column: 1;
  grid-row: 2;
}

/* === Chat App (Smartphone) ====================================== */
.chat-title {
  display: none;
}
#phoneChatRoomSelect {
  grid-column: 1 / -1;
}
.chat-body {
  grid-column: 1 / -1;
  min-height: 0;
  border-radius: 0;
  border: none;
  padding: 0;
  background: transparent;
  overflow: hidden;
}
.chat-messages {
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-right: 0;
}
.chat-empty {
  border-radius: 0;
  border: none;
  border-top: 4px solid #8f9093;
  background: #9d9da0;
  padding: 14px 16px;
  font-weight: 600;
  color: rgba(17, 24, 39, 0.85);
}
.chat-msg {
  position: relative;
  border-radius: 0;
  border: none;
  border-top: 4px solid #8f9093;
  background: #9d9da0;
  padding: 12px 16px;
  color: #111;
}
.chat-msg.me {
  border-top-color: #37980d;
  background: #a4b48f;
}
.chat-msg-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 0;
  border: none;
  background: #c4003a;
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.chat-msg-delete:disabled {
  opacity: 0.5;
}
.chat-msg-meta {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.9;
  margin-bottom: 4px;
}
.chat-msg-text {
  font-size: 14px;
  font-weight: 600;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-bottom {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 12px;
  padding-top: 12px;
  align-items: stretch;
}
.chat-input {
  grid-column: 1;
  grid-row: 1 / 3;
  width: 100%;
  resize: none;
  padding: 12px 16px;
  border-radius: 0;
  border: none;
  background: #59616d;
  color: rgba(255,255,255,0.96);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
}
#phoneChatSend {
  grid-column: 2;
  grid-row: 1;
}
.chat-bottom [data-phone-back] {
  grid-column: 2;
  grid-row: 2;
}

/* === Notizen App (Smartphone) =================================== */
.notes-title {
  display: none;
}
.notes-body {
  grid-column: 1 / -1;
  min-height: 0;
  border-radius: 0;
  border: none;
  padding: 0;
  background: transparent;
  overflow: hidden;
}
.notes-text {
  width: 100%;
  height: 100%;
  resize: none;
  padding: 14px 16px;
  border-radius: 0;
  border: none;
  background: #9d9da0;
  color: #111;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.25;
}

.impressum-text {
  width: 100%;
  height: 100%;
  padding: 14px 16px;
  border-radius: 0;
  border: none;
  background: #9d9da0;
  color: #111;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.25;
  overflow: auto;
  white-space: pre-line;
}
.notes-bottom {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 12px;
  align-items: stretch;
  padding-top: 12px;
}

/* === Admin Items App (Smartphone) =============================== */
#phoneAdminItems .notes-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#phoneAdminItemList {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0;
}
#phoneAdminItemList .phone-admin-item {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  cursor: default;
}
#phoneAdminItemList .phone-admin-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
#phoneAdminItemList .phone-admin-item-head .name {
  flex: 1;
  font-weight: 800;
  font-size: 18px;
  line-height: 1.15;
}
#phoneAdminItemList .phone-admin-item-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
#phoneAdminItemList .phone-admin-item-actions button {
  width: 100%;
}
.notes-pad {
  grid-column: 1;
  grid-row: 1 / 3;
  border-radius: 0;
  border: none;
  background: #9d9da0;
}
#phoneNotesSave {
  grid-column: 2;
  grid-row: 1;
}
.notes-bottom [data-phone-back] {
  grid-column: 2;
  grid-row: 2;
}

/* === Respawn App (Smartphone) =================================== */
.respawn-title {
  display: none;
}
#phoneRespawnSelect {
  grid-column: 1 / -1;
}
.respawn-body {
  grid-column: 1 / -1;
  min-height: 0;
  border-radius: 0;
  border: none;
  padding: 0;
  background: #9d9da0;
}
.respawn-bottom {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 12px;
  padding-top: 12px;
  align-items: stretch;
}
.respawn-pad {
  grid-column: 1;
  grid-row: 1 / 3;
  border-radius: 0;
  border: none;
  background: #9d9da0;
}
#phoneRespawnConfirm {
  grid-column: 2;
  grid-row: 1;
}
.respawn-bottom [data-phone-back] {
  grid-column: 2;
  grid-row: 2;
}

/* === Karte App (Smartphone) ===================================== */

/* === Sessions App (Smartphone) ================================== */
.sessions-title {
  display: none;
}
#phoneSessionsSelect {
  grid-column: 1 / -1;
}
.sessions-body {
  grid-column: 1 / -1;
  min-height: 0;
  border-radius: 0;
  border: none;
  padding: 0;
  background: transparent;
  overflow: hidden;
}
.sessions-info {
  height: 100%;
  overflow-y: auto;
  border-radius: 0;
  border: none;
  background: #9d9da0;
  padding: 14px 16px;
  color: rgba(17, 24, 39, 0.9);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.25;
  white-space: pre-wrap;
}
.sessions-bottom {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 12px;
  padding-top: 12px;
  align-items: stretch;
}
#phoneSessionsPassword {
  grid-column: 1;
  grid-row: 1 / 4;
  height: 100%;
}
#phoneSessionsJoin {
  grid-column: 2;
  grid-row: 1;
}
#phoneSessionsLeave {
  grid-column: 2;
  grid-row: 2;
}
.sessions-bottom [data-phone-back] {
  grid-column: 2;
  grid-row: 3;
}

/* === Spieler App (Smartphone) ==================================== */
.players-title {
  display: none;
}
#phonePlayerDisplayName {
  grid-column: 1 / -1;
}
#phonePlayerOutfitSelect {
  grid-column: 1 / -1;
}
.players-list {
  grid-column: 1 / -1;
  min-height: 0;
  border-radius: 0;
  border: none;
  padding: 0;
  background: transparent;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.players-empty {
  border-radius: 0;
  border: none;
  border-top: 4px solid #8f9093;
  padding: 14px 16px;
  background: #9d9da0;
  color: rgba(17, 24, 39, 0.85);
  font-weight: 600;
  font-size: 14px;
}
.players-btn {
  width: 100%;
  justify-content: space-between;
  gap: 10px;
}
.players-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.players-state {
  font-size: 12px;
  opacity: 0.9;
  white-space: nowrap;
}
.players-btn.active {
  outline: 3px solid rgba(0, 120, 255, 0.7);
  outline-offset: -3px;
}
.players-bottom {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: stretch;
  padding-top: 12px;
}
.players-pad {
  grid-column: 1;
  background: #9d9da0;
}
.players-bottom [data-phone-back] {
  grid-column: 2;
}

/* Direct smartphone page layouts without shell wrappers */
#pagerPanel {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
}
#pagerPanel.hidden { display: none; }

#phoneFunk,
#phoneChat,
#phoneRespawn,
#phonePoi,
#phoneSessions,
#phonePlayers {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

#phoneNotes,
#phoneImpressum,
#phoneAdminItems {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
}

#phoneFunk {
  grid-template-rows: auto 1fr auto;
}
#phoneChat {
  grid-template-rows: auto auto 1fr auto;
}
#phoneRespawn {
  grid-template-rows: auto auto 1fr auto;
}
#phonePoi {
  grid-template-rows: auto 1fr auto;
}
#phoneSessions {
  grid-template-rows: auto auto 1fr auto;
}
#phonePlayers {
  grid-template-rows: auto auto 1fr auto auto;
}

#phoneFunk .funk-title,
#phoneChat .chat-title,
#phoneRespawn .respawn-title,
#phonePoi .poi-title,
#phoneSessions .sessions-title,
#phonePlayers .players-title,
#phoneNotes .notes-title,
#phoneImpressum .notes-title,
#phoneAdminItems .notes-title {
  grid-column: 1 / -1;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: rgba(17, 24, 39, 0.85);
  line-height: 1;
}

#phoneFunk .funk-body,
#phoneChat .chat-body,
#phoneRespawn .respawn-body,
#phonePoi .poi-body,
#phoneSessions .sessions-body,
#phonePlayers .players-list,
#phoneNotes .notes-body,
#phoneImpressum .notes-body,
#phoneAdminItems .notes-body {
  grid-column: 1 / -1;
  min-height: 0;
  border-radius: 18px;
  border: 4px solid #6b6b6b;
  padding: 12px;
  background: #b1b2b6;
  overflow: hidden;
}

#phoneFunk .funk-bottom,
#phoneChat .chat-bottom,
#phoneRespawn .respawn-bottom,
#phonePoi .poi-bottom,
#phoneSessions .sessions-bottom,
#phonePlayers .players-bottom,
#phoneNotes .notes-bottom,
#phoneImpressum .notes-bottom,
#phoneAdminItems .notes-bottom {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  align-items: stretch;
}

#phoneFunk .funk-bottom,
#phoneChat .chat-bottom,
#phoneRespawn .respawn-bottom,
#phonePoi .poi-bottom,
#phoneSessions .sessions-bottom,
#phonePlayers .players-bottom,
#phoneNotes .notes-bottom,
#phoneImpressum .notes-bottom,
#phoneAdminItems .notes-bottom {
  grid-template-columns: 1fr 1fr;
}

#phoneFunk .funk-bottom,
#phoneChat .chat-bottom,
#phoneRespawn .respawn-bottom,
#phonePoi .poi-bottom,
#phoneSessions .sessions-bottom,
#phonePlayers .players-bottom {
  grid-template-rows: auto auto;
}

#phoneNotes .notes-bottom,
#phoneImpressum .notes-bottom,
#phoneAdminItems .notes-bottom {
  grid-template-rows: auto auto;
}

#phonePoi .poi-bottom {
  grid-template-columns: 1fr;
  grid-template-rows: auto auto auto;
}

#phoneFunk .funk-bottom {
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
}
#phoneFunk .funk-bottom .phone-select,
#phoneSessions .sessions-bottom .phone-select,
#phonePlayers .players-bottom .phone-select {
  grid-column: 1;
  grid-row: 1 / 3;
  height: 100%;
}

#phoneFunk .funk-bottom .phone-select {
  grid-row: 1;
  height: auto;
}

#phoneChat .chat-input,
#phoneNotes .notes-text,
#phoneImpressum .impressum-text {
  width: 100%;
  height: 100%;
  resize: none;
  padding: 12px;
  border-radius: 16px;
  border: 4px solid #4e4e4e;
  background: rgba(255,255,255,0.12);
  color: #111;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.25;
}

#phoneChat .chat-input {
  grid-column: 1;
  grid-row: 1 / 3;
}
#phoneChat #phoneChatSend,
#phoneFunk #phoneFunkGroupAdd,
#phoneRespawn #phoneRespawnConfirm,
#phonePoi #phonePoiSetNav,
#phonePoi #phonePoiCenter,
#phoneSessions #phoneSessionsJoin,
#phoneSessions #phoneSessionsLeave,
#phonePlayers .players-bottom [data-phone-back],
#phoneNotes #phoneNotesSave,
#phoneImpressum .notes-bottom [data-phone-back],
#phoneAdminItems .notes-bottom [data-phone-back] {
  width: 100%;
}

#phonePlayers .players-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#phoneSessions .sessions-info {
  height: 100%;
  overflow-y: auto;
  border-radius: 18px;
  border: 4px solid #6b6b6b;
  background: rgba(255,255,255,0.12);
  padding: 12px;
  color: rgba(17, 24, 39, 0.9);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.25;
  white-space: pre-wrap;
}

#phoneFunk .funk-cards,
#phoneChat .chat-messages,
#phoneRespawn .respawn-body,
#phoneSessions .sessions-body,
#phoneNotes .notes-body,
#phoneImpressum .notes-body,
#phoneAdminItems .notes-body {
  overflow: hidden;
}

#phoneFunk .funk-cards,
#phoneChat .chat-messages {
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
}

#phoneFunk .funk-bottom .phone-btn,
#phoneChat .chat-bottom .phone-btn,
#phoneRespawn .respawn-bottom .phone-btn,
#phonePoi .poi-bottom .phone-btn,
#phoneSessions .sessions-bottom .phone-btn,
#phonePlayers .players-bottom .phone-btn,
#phoneNotes .notes-bottom .phone-btn,
#phoneImpressum .notes-bottom .phone-btn,
#phoneAdminItems .notes-bottom .phone-btn {
  font-size: 18px;
  width: 100%;
}

/* === Sessions App (Tablet) ====================================== */
.session-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 56vh;
  overflow: auto;
  padding-right: 6px;
}
.session-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border-radius: 14px;
  border: 3px solid rgba(0,0,0,0.18);
  background: rgba(255,255,255,0.08);
  padding: 10px;
}
.session-row-title {
  font-weight: 700;
}
.session-row-meta {
  font-size: 12px;
  opacity: 0.9;
  margin-top: 3px;
}
.session-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.coords-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 10px;
}

.coords-row {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.12);
}

.coords-key {
  opacity: 0.85;
  font-weight: 600;
}

.coords-val {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  opacity: 0.95;
  word-break: break-word;
}

.spawnpoints-editor {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  flex: 1;
}

.spawnpoints-add {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.spawnpoints-add input {
  min-width: 140px;
}
.spawnpoints-add .field-small {
  min-width: 90px;
  width: 110px;
}

.spawnpoints-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 140px;
  overflow: auto;
  padding-right: 6px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.08);
  padding: 10px;
}

.spawnpoints-row {
  display: grid;
  grid-template-columns: 1fr 100px 100px 90px auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.12);
}
.spawnpoints-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.map-title {
  grid-column: 1 / -1;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: rgba(17, 24, 39, 0.85);
  line-height: 1;
}
.map-body {
  grid-column: 1 / -1;
  min-height: 0;
  border-radius: 24px;
  border: 5px solid #6b6b6b;
  padding: 8px;
  background: #b3b3b3;
  overflow: hidden;
}
.map-canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 18px;
  border: 4px solid #4e4e4e;
  background: rgba(0,0,0,0.08);
  touch-action: none;
}
.map-bottom {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 12px;
  align-items: stretch;
}
.map-pad {
  grid-column: 1;
  grid-row: 1 / 3;
  border-radius: 18px;
  border: 4px solid #6b6b6b;
  background: rgba(0,0,0,0.04);
}
.map-nav {
  grid-column: 1;
  grid-row: 1 / 3;
  border-radius: 18px;
  border: 4px solid #6b6b6b;
  background: rgba(0,0,0,0.04);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.map-nav-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: rgba(17, 24, 39, 0.9);
}
.radio-shell {
  width: 260px;
  background: #1f2937;
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
  border: 2px solid #111827;
  position: relative;
  cursor: move;
}
.radio-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.radio-grip {
  width: 74px;
  height: 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.25);
  cursor: grab;
  touch-action: none;
}
.radio-screen {
  background: #3d8c3d;
  color: #0f172a;
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  border: 2px solid #0f172a;
}
.radio-title { font-size: 18px; font-weight: 700; }
.radio-name { font-size: 14px; font-weight: 600; }
.radio-group { font-size: 12px; font-weight: 600; opacity: 0.9; }
.radio-speaker-line { font-size: 12px; font-weight: 600; opacity: 0.9; min-height: 14px; }
.radio-screen-right { font-size: 26px; font-weight: 800; }
.radio-speaker-line { font-size: 12px; font-weight: 600; opacity: 0.9; }
.radio-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.radio-keypad button {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.6);
  background: #374151;
  color: #e5e7eb;
  font-size: 18px;
  font-weight: 700;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  -webkit-user-drag: none;
}
.radio-info {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.radio-info.hidden { display: none; }
.radio-users {
  font-size: 0.78rem;
  color: #9ca3af;
}
.radio-speaker {
  flex: 1;
  text-align: right;
  font-size: 0.85rem;
  color: #fde68a;
  min-height: 18px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.radio-keypad button.small { font-size: 14px; }
.radio-keypad button.warn {
  border-color: rgba(248,113,113,0.8);
  color: #fca5a5;
}
.radio-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border: none;
  background: #e13232;
  color: #fff;
  border-radius: 50%;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}
.radio-back {
  margin-top: 10px;
  background: rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 8px;
}
.radio-back select {
  width: 100%;
  color: #0f172a;
  background: #3d8c3d;
  border: 1px solid rgba(0,0,0,0.2);
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  appearance: none;
}
.radio-back button {
  width: 100%;
  margin-top: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.6);
  background: #374151;
  color: #e5e7eb;
  font-weight: 700;
}
.radio-back .row {
  display: flex;
  align-items: center;
}
.radio-back .row select {
  flex: 1;
}
.radio-back .row button {
  flex: 1;
}
.scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.scroll::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
}
.scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.25);
  border-radius: 10px;
}
.scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.35);
}

/* === Desktop Grid Layout ======================================== */
body:not(.companion) {
  overflow: hidden;
  background:
    radial-gradient(1200px 760px at 50% 8%, rgba(62, 88, 180, 0.32), rgba(62, 88, 180, 0) 60%),
    linear-gradient(180deg, #bfc1c7 0%, #b4b6bc 100%);
}
body:not(.companion) #desktopLayout {
  position: fixed;
  inset: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 350px);
  gap: 18px;
  min-width: 0;
  min-height: 0;
  z-index: 1;
}
body:not(.companion) #desktopLeft {
  position: relative;
  min-width: 0;
  min-height: 0;
  border: 5px solid #2c456d;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(192, 194, 200, 0.98), rgba(169, 171, 178, 0.98));
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.15),
    0 10px 32px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}
body:not(.companion) #desktopRight {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(220px, 30%) minmax(0, 1fr);
  gap: 18px;
}
body:not(.companion) #game {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.08), transparent 28%),
    linear-gradient(180deg, #4a5568 0%, #111827 100%);
}
body:not(.companion) #ui,
body:not(.companion) #hudTopRight,
body:not(.companion) #vehiclePanel,
body:not(.companion) #editPanel,
body:not(.companion) #coordDisplay,
body:not(.companion) #modeDisplay {
  position: absolute;
  z-index: 5;
}
body:not(.companion) #ui {
  top: 18px;
  left: 18px;
  padding: 10px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(41, 57, 119, 0.92), rgba(23, 33, 80, 0.96));
  border: 4px solid rgba(38, 55, 107, 0.96);
  box-shadow: 0 12px 30px rgba(0,0,0,0.28);
}
body:not(.companion) #hudTopRight {
  top: 18px;
  right: 18px;
  width: 176px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}
body:not(.companion) .hud-clock,
body:not(.companion) .hud-vehicle {
  width: 100%;
  border-radius: 18px;
}
body:not(.companion) .hud-clock {
  height: 74px;
}
body:not(.companion) #vehiclePanel {
  top: 118px;
  right: 18px;
  width: 176px;
  border-radius: 22px;
}
body:not(.companion) #coordDisplay {
  left: 18px;
  bottom: 18px;
}
body:not(.companion) #modeDisplay {
  left: 18px;
  bottom: 58px;
}
body:not(.companion) #editPanel {
  left: 18px;
  bottom: 18px;
  width: min(440px, calc(100% - 36px));
  max-width: 440px;
}
body:not(.companion) #mapPreview {
  position: relative;
  inset: auto;
  width: 100%;
  height: 100%;
  border-radius: 28px;
  border: 6px solid #223658;
  overflow: hidden;
}
body:not(.companion) #miniMapCanvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
}
body:not(.companion) #phoneModal {
  position: relative !important;
  inset: auto !important;
  left: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: var(--phone-topbar-h) 1fr;
  gap: 8px;
  padding: 8px;
  --phone-w: 100%;
  --phone-h: 100%;
  transform: none !important;
  transform-origin: center center;
  justify-self: stretch;
  align-self: stretch;
}
body:not(.companion) #phoneModal.hidden {
  display: none !important;
}
body:not(.companion) #phoneModal.phone-shell {
  border-radius: 26px;
  background: #2c3f64;
}
body:not(.companion) #phoneModal .phone-screen {
  grid-column: 1;
  grid-row: 2;
}
body:not(.companion) #phoneModal .phone-topbar {
  grid-column: 1;
  grid-row: 1;
}
body:not(.companion) #phoneModal .phone-close {
  display: none;
}
body:not(.companion) #phoneModal #phoneLogin {
  padding: 12px;
}
body:not(.companion) #touchControls,
body:not(.companion) #touchItemRotate {
  display: none !important;
}
@media (max-width: 1100px) {
  body:not(.companion) #desktopLayout {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: 14px;
    inset: 12px;
  }
  body:not(.companion) #hudTopRight,
  body:not(.companion) #vehiclePanel {
    width: 200px;
    right: 14px;
  }
  body:not(.companion) #vehiclePanel {
    top: 114px;
  }
}
@media (max-width: 840px) {
  body:not(.companion) #desktopLayout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(55vh, 1fr) 52vh;
  }
  body:not(.companion) #desktopRight {
    grid-template-rows: minmax(170px, 30%) minmax(0, 1fr);
  }
  body:not(.companion) #ui {
    top: 12px;
    left: 12px;
  }
  body:not(.companion) #hudTopRight {
    top: 12px;
    right: 12px;
  }
  body:not(.companion) #vehiclePanel {
    top: 110px;
    right: 12px;
  }
  body:not(.companion) #editPanel {
    left: 12px;
    bottom: 12px;
    width: calc(100% - 24px);
  }
}
