/**
 * Bottom-center POI detail card.
 * Compact + Desktop for Einsatz-POI; other kinds remain Desktop-gated in JS
 * (Hydrant / Gebäude / Live / Absprache — Compact keeps legacy overlays).
 */

.poi-detail {
  display: flex;
  flex-direction: column;
  position: absolute;
  left: 50%;
  /* Compact: clear mobile dock (~78px like former einsatz-poi-overlay). */
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 56;
  width: min(380px, calc(100vw - 20px));
  max-height: min(46vh, 420px);
  padding: 0;
  border-radius: var(--radius-chrome, 16px);
  background: var(--glass-bg, var(--chrome-bg));
  backdrop-filter: var(--chrome-blur);
  -webkit-backdrop-filter: var(--chrome-blur);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
  color: var(--text);
  pointer-events: auto;
  overflow: hidden;
}

.poi-detail.hidden {
  display: none !important;
}

/* Legacy Einsatz floating/bottom overlay — replaced by PoiDetail on all layouts. */
.einsatz-poi-overlay:not(.wasser-poi-overlay) {
  display: none !important;
}

.poi-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 4px 4px 10px;
  flex-shrink: 0;
}

.poi-detail-title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.3;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poi-detail-x {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fafafa;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: inherit;
  line-height: 1;
}

.poi-detail-x:hover {
  background: rgba(255, 255, 255, 0.14);
}

.poi-detail-x .material-symbols-outlined {
  font-size: 20px;
}

.poi-detail-body {
  padding: 2px 12px 10px;
  overflow: auto;
  font-size: 0.78rem;
  line-height: 1.4;
  min-height: 0;
}

.poi-detail-list {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
}

.poi-detail-list dt {
  margin: 0;
  color: var(--text-muted);
  font-weight: 500;
}

.poi-detail-list dd {
  margin: 0;
  min-width: 0;
  word-break: break-word;
}

.poi-detail-row {
  margin: 0 0 4px;
  color: var(--text-muted);
}

.poi-detail-row strong {
  color: var(--text);
  font-weight: 600;
}

/* Status chip sits between title (head) and detail rows (list). */
.poi-detail-chip-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}

.poi-detail-chip {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: rgba(255, 255, 255, 0.10);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
  user-select: none;
}

.poi-detail-chip[data-status="depot"] {
  background: rgba(76, 175, 80, 0.18);
  border-color: rgba(76, 175, 80, 0.35);
}

.poi-detail-chip[data-status="enroute"] {
  background: rgba(33, 150, 243, 0.18);
  border-color: rgba(33, 150, 243, 0.35);
}

.poi-detail-chip[data-status="waiting"] {
  background: rgba(255, 193, 7, 0.18);
  border-color: rgba(255, 193, 7, 0.4);
  color: #ffe082;
}

.poi-detail-chip[data-status="scene"] {
  background: rgba(244, 67, 54, 0.18);
  border-color: rgba(244, 67, 54, 0.4);
}

.poi-detail-oos {
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.poi-detail-oos.is-oos {
  background: #FFF3E0;
  border-color: #FF9800;
  color: #E65100;
}

.poi-detail-ort-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}

.poi-detail-ort-wrap label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.poi-detail-ort {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
}

.poi-detail-ort:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.32);
}

.poi-detail-ort:disabled {
  opacity: 0.55;
}

.poi-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.poi-detail-actions.hidden {
  display: none !important;
}

.poi-detail-actions .btn,
.poi-detail-actions .canvas-tb-btn {
  padding: 5px 10px;
  font-size: 0.74rem;
}

.poi-detail-actions .canvas-tb-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.poi-detail-actions .canvas-tb-btn.is-active {
  background: rgba(255, 255, 255, 0.16);
}

.poi-detail-confirm {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.poi-detail-confirm.is-open {
  display: flex;
}

.poi-detail-confirm-msg {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.35;
  font-weight: 500;
}

.poi-detail-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

@media (min-width: 1101px) {
  .poi-detail {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    width: min(380px, calc(100vw - 48px));
  }

  /* Hide legacy Gebäude side overlay on desktop — detail card replaces it. */
  .building-info-panel {
    display: none !important;
  }

  /* Desktop: Absprache function-toolbar replaced by detail card. */
  .canvas-toolbar-absprache {
    display: none !important;
  }
}
