:root {
      --bg: #09141c; 
      --surface: rgba(13, 25, 36, .88); 
      --surface-2: rgba(19, 34, 48, .92); 
      --surface-3: rgba(27, 45, 62, .92);
      --text: #eef7fb; 
      --muted: #94a3b8; 
      --border: rgba(180, 215, 230, .18); 
      --primary: #02c39a; 
      --primary-dark: #009677;
      --accent: #ff8a3d; 
      --warn: #ffd166; 
      --shadow: 0 20px 50px rgba(0,0,0,.45); 
      --radius: 18px;
    }
    * { box-sizing: border-box; }
    html, body { margin: 0; height: 100%; height: 100dvh; font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; background: var(--bg); color: var(--text); overflow: hidden; }
    body { min-height: 100vh; min-height: 100dvh; }
    button, select, input { font: inherit; }
    .app-shell { position: relative; width: 100vw; height: 100%; height: 100dvh; overflow: hidden; background: #08131a; }
    #map { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
    .glass { background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: var(--shadow); }

    .bottombar { position: absolute; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); left: 16px; right: 16px; z-index: 500; display: flex; justify-content: space-between; align-items: center; gap: 12px; pointer-events: none; background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: var(--shadow); border-radius: 22px; padding: 10px 12px; }
    .bottombar > * { pointer-events: auto; }
    .fold-handle { display: none; }
    .toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
    .toolbar button { border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--text); background: rgba(13, 25, 36, .85); backdrop-filter: blur(10px); }
    .toolbar button.primary { background: var(--primary); border-color: transparent; color: white; }

    /* SELETTORE STILE MAPPA NELLA TOOLBAR */
    .map-style-select {
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 8px 12px;
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
      color: var(--text);
      background: rgba(13, 25, 36, .85);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      outline: none;
      appearance: none;
      -webkit-appearance: none;
      transition: transform 0.15s ease, background 0.15s ease;
    }

    .map-style-select option {
      background: #0d1924;
      color: #ffffff;
      font-weight: 600;
      padding: 8px;
    }

    .panel-title { margin: 0; font-size: 16px; font-weight: 800; }
    .line-summary { padding: 0; border-radius: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: transparent; border: 0; box-shadow: none; }
    .badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.08); color: var(--text); font-size: 12px; font-weight: 700; }

    /* Brand Badge & Pillole Cliccabili (Senza Sticky Hover su Mobile) */
    .badge.brand-badge { background: var(--primary); color: #07131a; font-weight: 800; letter-spacing: .02em; cursor: pointer; transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease; }
    .badge.clickable-badge { cursor: pointer; transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease; }

    /* Pulsante di Chiusura con Area di Tocco Espansa */
    .panel-close-btn { position: relative; flex: none; width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--border); background: rgba(255,255,255,.06); color: var(--text); font-size: 17px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 20; touch-action: manipulation; }
    .panel-close-btn::after { content: ''; position: absolute; top: -8px; bottom: -8px; left: -8px; right: -8px; border-radius: 999px; }
    .panel-close-btn:active { background: rgba(255,255,255,.25); transform: scale(0.92); }

    /* Right Train Panel (Desktop: 400px originale) */
    .train-panel {
      position: absolute;
      top: 16px;
      right: 16px;
      bottom: calc(92px + env(safe-area-inset-bottom, 0px));
      width: 400px;
      max-width: calc(100vw - 32px);
      z-index: 600;
      border-radius: 22px;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      opacity: 0;
      transform: translateX(12px);
      pointer-events: none;
      transition: opacity .18s ease, transform .18s ease, height .25s ease, right .22s ease;
    }
    .train-panel.open { opacity: 1; transform: translateX(0); pointer-events: auto; }
    .train-panel-head { position: relative; padding: 14px 16px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, rgba(17,35,52,.96) 0%, rgba(13,25,36,.92) 100%); display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-shrink: 0; }
    .train-panel-head-text { min-width: 0; }
    .train-panel-body {
      padding: 16px 18px 20px;
      overflow-y: auto;
      overflow-x: hidden;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior-y: contain;
      display: flex;
      flex-direction: column;
      gap: 14px;
      flex: 1 1 0px;
      height: 0;
      min-height: 0;
      will-change: scroll-position;
      transform: translateZ(0);
      -webkit-transform: translateZ(0);
    }
    .fold-handle.sheet-handle { display: none; }

    @media (min-width: 1200px) {
      .train-panel.secondary {
        right: 428px;
        z-index: 590;
      }
    }

    /* Left Station Panel */
    .station-panel { position: absolute; top: 16px; left: 16px; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); width: 500px; max-width: calc(100vw - 32px); z-index: 650; border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; opacity: 0; transform: translateX(-12px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
    .station-panel.open { opacity: 1; transform: translateX(0); pointer-events: auto; }
    .station-panel-body { width: 100%; flex: 1; background: #000; overflow: hidden; position: relative; }
    .station-iframe-wrap { width: 100%; height: 100%; overflow: hidden; position: relative; }
    .station-iframe { width: 240%; height: 240%; transform: scale(0.416); transform-origin: 0 0; border: 0; }

    /* Bottom-left Telegram feed panel */
    .telegram-panel { position: absolute; left: 16px; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); width: 380px; max-width: calc(100vw - 32px); height: 58vh; z-index: 620; border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .18s ease, transform .18s ease, left .22s ease; }
    .telegram-panel.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
    .telegram-panel-head { flex-shrink: 0; }
    .telegram-panel-head .live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,.9); display: inline-block; margin-right: 6px; }
    .telegram-panel-body { 
      width: 100%; 
      flex: 1 1 0px; 
      height: 0; 
      overflow-y: auto; 
      overflow-x: hidden; 
      min-height: 0; 
      -webkit-overflow-scrolling: touch; 
      overscroll-behavior-y: contain; 
      will-change: scroll-position;
      transform: translateZ(0);
      -webkit-transform: translateZ(0);
    }
    .tg-item { display: block; padding: 12px 16px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--border); }
    .tg-item:last-child { border-bottom: 0; }
    .tg-title { font-size: 13.5px; font-weight: 800; color: #ffffff; margin-bottom: 5px; line-height: 1.35; }
    .tg-item .tg-text { font-size: 13px; line-height: 1.45; color: var(--text); margin-bottom: 6px; white-space: pre-wrap; }
    .tg-item .tg-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--muted); }
    .tg-empty, .tg-error { padding: 18px 16px; color: var(--muted); font-size: 13px; text-align: center; }
    .tg-error { color: #fca5a5; }

    /* Pannelli Lista Treni e Stazioni */
    .stations-list-panel { position: absolute; left: 16px; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); width: 380px; max-width: calc(100vw - 32px); height: 60vh; z-index: 630; border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .18s ease, transform .18s ease, left .22s ease; }
    .stations-list-panel.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
    .station-search-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; text-decoration: none; color: inherit; }
    .station-search-name { font-size: 13.5px; font-weight: 700; color: #fff; }
    .station-search-sub { font-size: 11px; color: var(--muted); }

    /* Megafinestra: Info sul Progetto */
    .info-panel {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -45%) scale(0.96);
      width: 620px;
      max-width: calc(100vw - 32px);
      height: 70vh;
      max-height: calc(100vh - 120px);
      z-index: 700;
      border-radius: 22px;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.22s ease, transform 0.22s ease;
    }
    .info-panel.open {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
      pointer-events: auto;
    }
    .info-panel-body {
      width: 100%;
      flex: 1 1 0px;
      height: 0;
      overflow-y: auto;
      min-height: 0;
      padding: 20px 24px;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior-y: contain;
    }
    .info-content { color: var(--text); font-size: 14px; line-height: 1.6; }
    .info-header-badge { font-size: 18px; font-weight: 800; color: #fff; margin-bottom: 8px; }
    .info-description { color: var(--muted); margin-top: 0; margin-bottom: 16px; font-size: 14px; }
    .info-divider { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
    .info-section { margin-bottom: 20px; }
    .info-section h4 { margin: 0 0 10px 0; font-size: 15px; font-weight: 800; color: #fff; }
    .info-section ul { margin: 0; padding-left: 20px; color: var(--text); }
    .info-section li { margin-bottom: 8px; }
    .info-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
    .info-tag { background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border); padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--muted); }

    .service-head { font-weight: 800; font-size: 15px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
    .service-sub { color: var(--muted); font-size: 13px; font-weight: 600; margin-top: 4px; line-height: 1.4; }
    .trip-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; margin: 0; }
    .trip-tag.full { background: rgba(72, 201, 120, .18); color: #9ce7b3; }
    .trip-tag.diretto { background: rgba(0, 180, 216, .22); color: #7fecff; }
    .trip-tag.direttissimo { background: rgba(184, 127, 255, .22); color: #d7bcff; }
    .trip-tag.partial { background: rgba(234, 179, 8, .22); color: #fef08a; }
    .trip-tag.campania-express { background: rgba(37, 99, 235, 0.28); color: #93c5fd; }

    .signal-strip { display: grid; gap: 8px; }

    .signal-badges-row-1,
    .signal-badges-row-2 {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 6px;
    }

    .signal-badge {
      padding: 5px 11px;
      border-radius: 999px;
      background: rgba(255,255,255,.08);
      color: var(--text);
      font-size: 11px;
      font-weight: 700;
      white-space: nowrap;
    }

    .signal-badge.live {
      background: rgba(44, 183, 129, .18);
      color: #a9f0ce;
      border: 1px solid rgba(44, 183, 129, .35);
    }

    .signal-badge.next {
      background: rgba(120, 70, 15, .35);
      color: #fde68a;
      border: 1px solid rgba(217, 119, 6, .5);
    }

    .signal-badge.done {
      background: rgba(255, 255, 255, .08);
      color: #d6e2ea;
      border: 1px solid rgba(255, 255, 255, .12);
    }

    .signal-badge.on-time-badge { background: rgba(34, 197, 94, 0.18); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.35); }
    .signal-badge.delay-mid-badge { background: rgba(234, 179, 8, 0.18); color: #fef08a; border: 1px solid rgba(234, 179, 8, 0.5); }
    .signal-badge.delay-high-badge { background: rgba(239, 68, 68, 0.22); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.5); }
    .signal-badge.suppressed-badge { background: rgba(185, 28, 28, 0.4); color: #fca5a5; border: 1.5px solid #eab308; font-weight: 800; }

    .signal-progress { height: 8px; border-radius: 999px; background: rgba(255,255,255,.1); overflow: hidden; }
    .signal-progress > span { display: block; height: 100%; background: var(--primary); transition: width 0.3s ease; }
    .signal-progress > span.dir-to-start,
    .signal-progress > span.dir-to-end { background: var(--primary); }

    .detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .tech-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; background: rgba(255,255,255,.04); color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; cursor: pointer; }
    .tech-toggle .chev { width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s ease; }
    .tech-toggle.open .chev { transform: rotate(-135deg); }
    .tech-details { display: none; grid-template-columns: 1fr; gap: 8px; margin-top: 8px; }
    .tech-details.open { display: grid; }
    .detail-item { border: 1px solid var(--border); background: rgba(255,255,255,.05); border-radius: 12px; padding: 8px 10px; }
    .detail-item .k { display:block; font-size:10px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); margin-bottom:2px; }
    .detail-item .v { font-size:13px; font-weight:700; color:var(--text); }

    .stops-panel { border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,.04); overflow: hidden; display: flex; flex-direction: column; flex-shrink: 0; }
    .stops-peek-hint { display: none; }
    .stops-list { overflow: visible; height: auto; }
    .stop-row { display:grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
    .stop-row:active { background: rgba(255,255,255,.12); }
    .stop-row:last-child { border-bottom: 0; }
    .stop-row.done { background: rgba(255,255,255,.02); }
    .stop-row.current { background: rgba(2, 195, 154, .14); }
    .stop-row.upcoming { background: transparent; }
    .stop-row.next-stop { background: rgba(27, 46, 36, .34); }

    .stop-index { width: 28px; height: 28px; border-radius: 999px; background: rgba(255,255,255,.1); color: #d9fbff; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:800; }
    .stop-row.done .stop-index { background: rgba(214,226,234,.12); color: #a2b3be; }
    .stop-row.current .stop-index { background: var(--primary); color: #07131a; }

    /* EFFETTI HOVER SOLO SU DESKTOP (No Sticky Hover su Mobile) */
    @media (hover: hover) and (pointer: fine) {
      .badge.brand-badge:hover { background: #10e0aa; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(2, 195, 154, 0.45); }
      .badge.clickable-badge:hover { background: rgba(255,255,255,0.18); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15); }
      .station-search-row:hover { background: rgba(255,255,255,.05); }
      .stop-row:hover .stop-index { background: var(--primary) !important; color: #07131a !important; transform: scale(1.18); box-shadow: 0 0 12px rgba(2, 195, 154, 0.7); }
      .tg-item:hover { background: rgba(255,255,255,.04); }
      .panel-close-btn:hover { background: rgba(255,255,255,.14); }
      .tech-toggle:hover { background: rgba(255,255,255,.08); color: var(--text); }
      .toolbar button:hover { transform: translateY(-1px); background: rgba(255,255,255,.12); }
      .map-style-select:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-1px); }
    }

    .stop-name { font-size: 13px; font-weight: 700; text-decoration: none; }
    .stop-row.done .stop-name, .stop-row.done .stop-time, .stop-row.done .stop-meta { color: #8fa1ae; }
    .stop-row.current .stop-meta { color: #d6f4f5; }
    .stop-row.upcoming .stop-meta { color: #b8c8d2; }
    .stop-badge { display:inline-flex; align-items:center; margin-left:6px; padding:2px 6px; border-radius:999px; font-size:10px; font-weight:800; letter-spacing:.03em; text-transform:uppercase; text-decoration: none; }
    .stop-badge.departed { background: rgba(214,226,234,.12); color: #aebfca; }
    .stop-badge.current { background: rgba(2, 195, 154, .22); color: #b8fcff; }
    .stop-badge.next { background: rgba(255,209,102,.18); color: #ffe19e; }
    .stop-time, .stop-meta { font-size: 11px; color: var(--muted); }
    .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

    /* ETICHETTA STAZIONI HOVER (DESKTOP) */
    .station-tooltip {
      background: rgba(13, 25, 36, 0.95) !important;
      border: 1px solid rgba(180, 215, 230, 0.25) !important;
      color: #eef7fb !important;
      font-size: 11.5px !important;
      font-weight: 700 !important;
      padding: 4px 10px !important;
      border-radius: 8px !important;
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6) !important;
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      pointer-events: none !important;
    }
    .leaflet-tooltip-top.station-tooltip::before,
    .station-tooltip::before {
      border-top-color: rgba(13, 25, 36, 0.95) !important;
    }

/* STAZIONI MAPPA (PALLINO COLORATO CON ALONE BIANCO) */
.station-marker-wrap {
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  transition: opacity 0.25s ease;
}

.station-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  /* Il centro prende il colore della linea, con fallback su verde */
  background: var(--dot-color, #02c39a);
  /* Bordo netto bianco attorno al colore */
  border: 2px solid #ffffff;
  /* Alone sfumato bianco brillante attorno al pallino */
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.9), 0 0 10px var(--dot-color, rgba(255, 255, 255, 0.4));
  transition: width 0.25s ease, height 0.25s ease, border-width 0.25s ease, box-shadow 0.25s ease, transform 0.18s ease;
}

/* ZOOM VICINO (Zoom tra 13 e 15) */
#map.zoom-high .station-dot {
  width: 13px;
  height: 13px;
  border-width: 2.5px;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.95), 0 0 12px var(--dot-color, rgba(255, 255, 255, 0.5));
}

/* ZOOM MOLTO VICINO (Zoom >= 15) */
#map.zoom-super .station-dot {
  width: 15px;
  height: 15px;
  border-width: 3px;
  box-shadow: 0 0 10px #ffffff, 0 0 14px var(--dot-color, rgba(255, 255, 255, 0.6));
}

/* EFFETTO HOVER DESKTOP */
@media (hover: hover) and (pointer: fine) {
  .station-marker-wrap:hover .station-dot {
    transform: scale(1.5) !important;
    box-shadow: 0 0 12px #ffffff, 0 0 16px var(--dot-color, #ffffff) !important;
  }
}

    /* Nasconde/Opacizza le stazioni da lontano per alleggerire la vista */
    #map.zoom-low .station-marker-wrap {
      opacity: 0.2;
      pointer-events: none;
    }

    /* MARCATORE TRENI SULLA MAPPA */
    .veh-marker { display: flex; flex-direction: column; align-items: center; gap: 1px; pointer-events: auto; cursor: pointer; }
    .veh-marker .veh-arrow-wrap { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }
    .veh-marker .veh-arrow { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 13px solid #10b981; filter: drop-shadow(0 0 3px rgba(16, 185, 129, 0.8)) drop-shadow(0 2px 3px rgba(0,0,0,.7)); transform-origin: 50% 65%; }
    .veh-marker .veh-label { font-size: 10px; font-weight: 800; line-height: 1.5; padding: 1px 6px; border-radius: 6px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.6); }

    .veh-marker.dir-a .veh-arrow { border-bottom-color: #10b981; }
    .veh-marker.dir-a .veh-label {
      background: #064e3b;
      color: #fff;
      outline: 1.5px solid #34d399;
      outline-offset: -1px;
      box-shadow: 0 0 10px rgba(52, 211, 153, 0.4);
    }

    .veh-marker.dir-b .veh-arrow { border-bottom-color: #10b981; }
    .veh-marker.dir-b .veh-label {
      background: #064e3b;
      color: #fff;
      outline: 1.5px solid #34d399;
      outline-offset: -1px;
      box-shadow: 0 0 10px rgba(52, 211, 153, 0.4);
    }

    .veh-marker.delay-mid .veh-arrow { border-bottom-color: #eab308 !important; filter: drop-shadow(0 0 5px rgba(234, 179, 8, 0.95)) !important; }
    .veh-marker.delay-mid .veh-label { outline: 2px solid #eab308 !important; box-shadow: 0 0 10px rgba(234, 179, 8, 0.5) !important; }

    .veh-marker.delay-high .veh-arrow { border-bottom-color: #ef4444 !important; filter: drop-shadow(0 0 5px rgba(239, 68, 68, 0.95)) !important; }
    .veh-marker.delay-high .veh-label { outline: 2px solid #ef4444 !important; box-shadow: 0 0 10px rgba(239, 68, 68, 0.5) !important; }

    .veh-marker.suppressed .veh-arrow { border-bottom-color: #dc2626 !important; filter: drop-shadow(0 0 6px rgba(220, 38, 38, 0.95)) !important; }
    .veh-marker.suppressed .veh-label { background: #b91c1c !important; color: #fff !important; outline: 2px solid #eab308 !important; box-shadow: 0 0 10px rgba(234, 179, 8, 0.6) !important; }

    .veh-marker .veh-label.selected { outline: 2px solid var(--warn) !important; outline-offset: 2px !important; }

    .leaflet-control-zoom { top: 16px !important; left: 16px !important; margin-top: 0 !important; }

    .veh-marker.campania-express .veh-arrow { border-bottom-color: #2563eb !important; filter: drop-shadow(0 0 5px rgba(37, 99, 235, 0.9)) !important; }
    .veh-marker.campania-express .veh-label { background: #1d4ed8 !important; color: #ffffff !important; }

    /* LAYOUT MOBILE CON ORDINE: [ MEZZI ATTIVI ] [ FERMATE ] [ TELEGRAM ] */
    @media (max-width: 980px) {
      .map-style-select {
        display: none !important;
      }

      .app-shell { overflow: hidden; }
      #map { position: fixed; }

      .signal-badges-row-2 {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
      }
      .signal-badges-row-2 .signal-badge {
        white-space: normal;
        line-height: 1.35;
      }

      .train-panel,
      .station-panel,
      .telegram-panel,
      .info-panel,
      .stations-list-panel {
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: none !important;
      }

      .info-panel {
        top: 12px !important;
        bottom: calc(var(--bottombar-h, 118px) + 26px + env(safe-area-inset-bottom, 0px)) !important;
        height: auto !important;
        max-height: none !important;
        transform: translateY(12px) scale(1) !important;
      }
      .info-panel.open {
        transform: translateY(0) scale(1) !important;
      }

      .train-panel {
        top: auto;
        bottom: calc(var(--bottombar-h, 118px) + 26px + env(safe-area-inset-bottom, 0px));
        height: 44vh;
        max-height: none;
      }
      .train-panel.expanded { top: 12px !important; bottom: calc(var(--bottombar-h, 118px) + 26px + env(safe-area-inset-bottom, 0px)) !important; height: auto !important; }
      .train-panel.expanded .train-panel-body {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
      }
      .train-panel-head { padding-top: 20px; cursor: pointer; }
      .train-panel:not(.expanded) .train-panel-body { overflow: hidden; }
      .train-panel:not(.expanded) .stops-panel { display: none; }
      .train-panel:not(.expanded) .stops-peek-hint { display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted); font-size: 12px; padding: 12px 8px 4px; cursor: pointer; }

      .station-panel { top: 12px; bottom: calc(var(--bottombar-h, 118px) + 26px + env(safe-area-inset-bottom, 0px)); }
      .telegram-panel, .stations-list-panel { bottom: calc(var(--bottombar-h, 118px) + 26px + env(safe-area-inset-bottom, 0px)); height: 62vh; }

      .fold-handle { display: flex; justify-content: center; align-items: center; position: absolute; top: 4px; left: 0; right: 0; height: 18px; cursor: grab; touch-action: none; z-index: 2; }
      .fold-handle .bar { width: 36px; height: 4px; border-radius: 99px; background: var(--border); }
      .fold-handle.sheet-handle { display: flex; }

      /* Barra inferiore Mobile a 3 colonne ordinate: [ MEZZI ATTIVI ] [ FERMATE ] [ TELEGRAM ] */
      .bottombar { display: grid; grid-template-columns: 1fr 1fr 1fr; grid-template-rows: auto auto; gap: 8px; align-items: center; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); left: 10px; right: 10px; }
      .line-summary, .toolbar { display: contents; }
      .bottombar .brand-badge { grid-column: 1 / -1; grid-row: 1; justify-self: center; }
      .bottombar #shapeInfo, .bottombar #stopInfo, .bottombar #telegramBtn { grid-row: 2; height: 36px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border-radius: 12px; padding: 0 10px; font-size: 12px; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
      .bottombar #shapeInfo { grid-column: 1; border: 1px solid var(--border); background: rgba(13, 25, 36, .85); color: var(--text); }
      .bottombar #stopInfo { grid-column: 2; border: 1px solid var(--border); background: rgba(13, 25, 36, .85); color: var(--text); }
      .bottombar #telegramBtn { grid-column: 3; }
      .bottombar #githubBtn, .bottombar #clockBadge { display: none; }
      .leaflet-control-zoom { top: 12px !important; left: 12px !important; }
    }

