/* ══════════════════════════════════════════════════════
   DISRUPTIONS — UI alignée avec l'app
══════════════════════════════════════════════════════ */

.btn-disruptions {
  display: block;
  width: 100%;
  padding: 10px 0;
  margin: 8px 0;
  background: var(--bg-subtle);
  color: var(--ink);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .16s var(--ease);
}

.btn-disruptions:hover {
  background: var(--bg-hover);
  border-color: var(--border-dark);
}

/* ── Perturbations : liste & détail (corps clair sous le header sombre) ── */
.dsr {
  --dsr-c: #475569;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* fond de catégorie = sa couleur diluée dans la carte */
.dsr, .dsr-card, .dsr-hero {
  --dsr-bg: color-mix(in srgb, var(--dsr-c) 13%, var(--bg-card));
}

.dsr-card-works     { --dsr-c: #c2410c; }
.dsr-card-deviation { --dsr-c: #7c3aed; }
.dsr-card-moved     { --dsr-c: #2563eb; }
.dsr-card-removed   { --dsr-c: #dc2626; }
.dsr-card-event     { --dsr-c: #db2777; }
.dsr-card-strike    { --dsr-c: #b91c1c; }
.dsr-card-info      { --dsr-c: #475569; }

/* résumé en tête de liste */
.dsr-summary {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.4;
  padding: 2px 2px 0;
}

.dsr-summary b {
  color: var(--ink);
  font-weight: 800;
}

.dsr-summary-new {
  color: var(--primary-ink);
  font-weight: 700;
}

.dsr-summary > span:last-child {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--ink-3);
}

.dsr .disruptions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Carte d'une perturbation ── */
.dsr .dsr-card,
.dsr .dsr-hero {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 15px 0;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
  position: relative;
  overflow: hidden;
}

.dsr .dsr-hero {
  padding-bottom: 15px;
}

/* liseré de couleur de la catégorie */
.dsr .dsr-card::before,
.dsr .dsr-hero::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--dsr-c);
}

.dsr .dsr-card {
  cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), border-color .15s;
}

.dsr .dsr-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-dark);
  box-shadow: 0 6px 18px rgba(16, 24, 40, .08);
}

.dsr .dsr-card:active {
  transform: translateY(0);
}

.dsr-tags {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.dsr-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: var(--dsr-bg);
  color: var(--dsr-c);
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

.dsr-cat svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.dsr-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-3);
  white-space: nowrap;
}

.dsr-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.dsr-status-live { color: var(--red); }
.dsr-status-live i { animation: dsrPulse 1.8s ease-out infinite; }
.dsr-status-soon { color: var(--blue); }
.dsr-status-past { color: var(--ink-4); }

.dsr-status-new {
  color: #171204;
  background: var(--primary);
  padding: 3px 9px;
  border-radius: 999px;
}

.dsr-status-new i { display: none; }

@keyframes dsrPulse {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .45); }
  100% { box-shadow: 0 0 0 7px rgba(220, 38, 38, 0); }
}

.dsr .dsr-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
}

.dsr-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.dsr-meta span {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink-2);
}

.dsr-meta svg {
  width: 14px;
  height: 14px;
  flex: none;
  margin-top: 1px;
  color: var(--ink-3);
}

.dsr .dsr-desc {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dsr .dsr-desc-full {
  display: block;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.dsr-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px -15px 0;
  padding: 10px 15px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 700;
}

.dsr-foot-stops {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
}

.dsr-foot-stops svg {
  width: 14px;
  height: 14px;
  color: var(--dsr-c);
}

.dsr-foot-none { color: var(--ink-3); }

.dsr-foot-go {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--ink);
  font-weight: 800;
}

.dsr-foot-go svg {
  width: 15px;
  height: 15px;
}

/* ── Détail : section arrêts ── */
.dsr-sec {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 2px -2px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.dsr-sec span {
  font-family: var(--mono);
  letter-spacing: 0;
  background: var(--border);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
}

.dsr .stops-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dsr .stop-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 13px;
}

.dsr .stop-card.is-off {
  background: var(--bg-subtle);
}

.dsr .stop-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.dsr .stop-alert-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--red-soft);
  color: var(--red);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.dsr .stop-alert-icon svg {
  width: 16px;
  height: 16px;
}

.dsr .stop-name-wrap {
  min-width: 0;
  flex: 1;
  padding-top: 1px;
}

.dsr .stop-name {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
}

.dsr .stop-directions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 5px 0 0;
}

.dsr .dir-chip {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-hover);
  border: none;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
}

.dsr .replacement-badge {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 10px 0 0;
  padding: 9px 11px;
  border: none;
  border-radius: 11px;
  background: var(--green-soft);
}

.dsr .replacement-ico {
  display: inline-flex;
  color: var(--green);
  margin-top: 1px;
}

.dsr .replacement-ico svg {
  width: 15px;
  height: 15px;
}

.dsr .replacement-body {
  min-width: 0;
}

.dsr .replacement-label {
  display: block;
  margin-bottom: 1px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--green);
}

.dsr .replacement-text {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.dsr .replacement-comment {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--ink-2);
}

.dsr .btn-locate-stop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  margin-top: 10px;
  padding: 9px 12px;
  border: none;
  border-radius: 11px;
  background: var(--bg-hover);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s, transform .12s;
}

.dsr .btn-locate-stop svg {
  width: 15px;
  height: 15px;
}

.dsr .btn-locate-stop:hover {
  background: var(--border);
  transform: translateY(-1px);
}

.dsr .stop-match-ko {
  margin: 10px 0 0;
  padding: 0;
  border: none;
  background: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}

/* ── États vides ── */
.dsr-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.dsr-empty-ico {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dsr-empty-ico svg {
  width: 26px;
  height: 26px;
}

.dsr-empty p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.5;
}

.dsr-empty p b {
  display: block;
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .dsr-status-live i { animation: none; }
  .dsr .dsr-card, .dsr .btn-locate-stop { transition: none; }
}

.maplibregl-popup.disruption-locate-popup {
  z-index: 12 !important;
}

.maplibregl-popup.disruption-locate-popup .maplibregl-popup-content {
  border: 1.5px solid #ef4444;
  background: var(--bg-card);
  border-radius: 10px !important;
  box-shadow: 0 10px 24px rgba(185, 28, 28, 0.24);
  padding: 8px 10px !important;
}

.maplibregl-popup.disruption-locate-popup .dlp-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--red-ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: .01em;
}

.maplibregl-popup.disruption-locate-popup .dlp-name::before {
  content: '!';
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  flex: 0 0 18px;
}

.error-panel {
  padding: 14px;
  background: var(--red-soft);
  border: 1.5px solid var(--red-soft);
  border-radius: var(--r-s);
  color: var(--red-ink);
  text-align: center;
  font-size: 12px;
}

.error-panel p {
  margin: 0;
}

/* consigne commune / note "hors trajet" au-dessus des arrêts */
.dsr-shared-rep .replacement-badge { margin: 0; }
.dsr .dsr-shared-rep .replacement-badge { background: var(--green-soft); }

.dsr-off-note {
  margin: -4px 2px 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-3);
}

.dsr .stop-card.is-off {
  padding: 10px 12px;
}

/* bouton "Tout voir sur la carte" dans l'en-tête de section */
.dsr-sec-map {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: none;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg-card);
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}

.dsr-sec-map svg { width: 13px; height: 13px; }
.dsr-sec-map:hover { background: var(--ink-2); }

/* marqueur de l'arrêt sélectionné */
.disruption-stop-icon { cursor: pointer; }

.disruption-stop-icon.is-active {
  width: 30px;
  height: 30px;
  z-index: 6;
  border-color: #ef4444;
  animation: none;
  box-shadow: 0 0 0 5px rgba(239, 68, 68, .25), 0 3px 10px rgba(0, 0, 0, .2);
}

/* ── Mobile : panneau masqué + barre de navigation entre les arrêts ── */
#panel.dsr-hidden {
  transform: translateY(100%) !important;
  pointer-events: none;
}

body.dsr-map-mode #fabs { display: none; }

.dsr-mapbar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: var(--bg-card);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  font-family: var(--font);
  transform: translateY(calc(100% + 30px));
  opacity: 0;
  pointer-events: none;
  transition: transform .3s var(--ease-spring), opacity .2s;
}

.dsr-mapbar.vis {
  transform: none;
  opacity: 1;
  pointer-events: auto;
}

.dsr-mb-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 42px;
  padding: 0 13px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: #171204;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.dsr-mb-back svg { width: 16px; height: 16px; }

.dsr-mb-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0 2px;
}

.dsr-mb-info b {
  font-size: 13.5px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dsr-mb-info span {
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dsr-mb-nav {
  width: 42px;
  height: 42px;
  flex: none;
  border: none;
  border-radius: 12px;
  background: var(--bg-hover);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.dsr-mb-nav[hidden] { display: none; }
.dsr-mb-nav svg { width: 18px; height: 18px; }

@media (prefers-reduced-motion: reduce) {
  .dsr-mapbar { transition: none; }
}
