/* Pagina «2» delle città (/zurigo2 …): mappa con le linee nei loro colori + pannello (linee, fermate, corsa del tram). Script: js/city-pro.js */
html, body { margin: 0; height: 100%; background: var(--rp-ink); color: var(--rp-paper); font-family: var(--rp-sans); overflow: hidden; overscroll-behavior: none; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
#map { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#msg { position: fixed; left: 392px; right: 20px; top: 46%; text-align: center; font: 14px var(--rp-sans); color: var(--rp-dim); pointer-events: none; }

#panel { position: fixed; left: 0; top: 0; bottom: 0; width: 372px; display: flex; flex-direction: column; background: var(--rp-ink); border-right: 1px solid var(--rp-rule); }
#grip { display: none; }
.ph { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 0; }
.ph .home { color: var(--rp-paper); text-decoration: none; font: 500 17px var(--rp-display); letter-spacing: -.02em; }
.ph .home b { color: var(--rp-amber); font-weight: 500; }
.ph .pr { display: flex; align-items: center; gap: 8px; }
a.don { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 32px; box-sizing: border-box; background: var(--rp-ink); border: 1px solid var(--rp-edge, #5a564c); border-radius: 4px; color: var(--rp-amber); text-decoration: none; }   /* come .ico.donate di css/site.css */
a.don svg { display: block; transition: fill .15s; }
a.don:hover { border-color: var(--rp-paper); }
a.don:hover svg path { fill: currentColor; fill-opacity: .25; }
a.don { position: relative; }
@media (hover: hover) {   /* spiegazione al passaggio del mouse, come .donate[data-tip] di css/site.css */
  a.don[data-tip]::after { content: attr(data-tip); position: absolute; right: 0; top: calc(100% + 8px); width: 230px; padding: 8px 10px; background: var(--rp-ink); color: var(--rp-paper); border: 1px solid var(--rp-edge, #5a564c); border-radius: 4px; font: 400 12px/1.4 var(--rp-sans); text-align: left; white-space: pre-line; opacity: 0; pointer-events: none; transform: translateY(-3px); transition: opacity .15s, transform .15s; z-index: 60; }
  a.don[data-tip]:hover::after, a.don[data-tip]:focus-visible::after { opacity: 1; transform: none; }
}
#top { display: none; }
#citySel, #citySel2 { background: var(--rp-ink2); border: 1px solid var(--rp-rule); border-radius: 5px; padding: 5px 8px; font-size: 13px; color: var(--rp-dim); }

#head { padding: 18px 20px 16px; border-bottom: 1px solid var(--rp-rule); }
.h1 { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.h1 h1 { margin: 0; font: 500 38px/1 var(--rp-display); letter-spacing: -.035em; }
.h1 #clk { font: 500 26px/1 var(--rp-mono); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
#sum { margin: 10px 0 12px; font-size: 15px; color: var(--rp-dim); }
#sum b { color: var(--rp-paper); font-weight: 500; }
#bar { display: flex; height: 6px; gap: 2px; }
#bar i { display: block; min-width: 0; border-radius: 1px; transition: flex-grow .6s; }
#lg { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: 8px; margin-top: 9px; font-size: 12px; color: var(--rp-dim); }
#lg b { display: block; font: 500 17px/1.2 var(--rp-mono); font-variant-numeric: tabular-nums; }
.k0 { color: var(--rp-paper); } .k1 { color: var(--rp-amber); } .k2 { color: var(--rp-brick); } .k3 { color: #7d786c; }
.ke, .k0.ke { color: #8fc7ae; } #lgE { margin-top: 6px; font-size: 12px; }   /* in anticipo di almeno 1 minuto (27.11.2026) */
#bar .k0 { background: var(--rp-paper); } #bar .k1 { background: var(--rp-amber); } #bar .k2 { background: var(--rp-brick); } #bar .k3 { background: #7d786c; }
#note { margin-top: 10px; font-size: 12px; color: var(--rp-amber); }
#note:empty { display: none; }
#chips, #more { display: none; }

#scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--rp-rule) transparent; }
#view { padding: 14px 12px 8px; }
.cseo { padding: 0 20px calc(18px + env(safe-area-inset-bottom)); font-size: 11px; line-height: 1.55; color: #7d786c; }
.cseo h2 { font: 500 12px var(--rp-sans); color: #b8b2a4; margin: 0 0 4px; }
.cseo p { margin: 0 0 6px; }
.cseo h2:empty, .cseo p:empty { display: none; }
a.rail { display: block; margin: 18px 20px 0; padding-top: 14px; border-top: 1px solid #2a2824; color: var(--rp-paper); font-size: 13px; text-decoration: none; }
a.rail:hover { color: var(--rp-amber); }
#foot { padding: 14px 20px calc(18px + env(safe-area-inset-bottom)); font-size: 11px; line-height: 1.55; color: #7d786c; }

.bdg { flex: none; display: inline-block; min-width: 28px; height: 24px; padding: 0 5px; box-sizing: border-box; border-radius: 4px; background: var(--c); color: var(--t); font: 600 13px/24px var(--rp-mono); text-align: center; }
.bdg.dk { box-shadow: inset 0 0 0 1px rgba(239, 233, 220, .4); }
.bdg.big { min-width: 44px; height: 38px; font-size: 20px; line-height: 38px; border-radius: 6px; }

#q { width: 100%; box-sizing: border-box; margin: 0 0 10px; padding: 10px 12px; background: var(--rp-ink2); border: 1px solid var(--rp-rule); border-radius: 6px; font-size: 15px; }
#q::placeholder { color: #7d786c; }
.vh { position: sticky; top: -14px; z-index: 2; margin: -14px -12px 6px; padding: 14px 12px 0; background: var(--rp-ink); border-bottom: 1px solid var(--rp-rule); }
.row { box-sizing: border-box; display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 8px; border-radius: 6px; }
.row:hover, .row:focus-visible { background: var(--rp-ink2); }
.row .nm { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dots { flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px; max-width: 96px; }
.lhint { margin: 10px 16px 4px; font-size: 12px; line-height: 1.4; color: var(--rp-dim); }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.empty { padding: 10px 8px; font-size: 14px; color: var(--rp-dim); }

.back { margin: 0 0 12px 4px; padding: 6px 10px 6px 6px; border-radius: 5px; font-size: 13px; color: var(--rp-dim); }
.back:hover { color: var(--rp-paper); background: var(--rp-ink2); }
.lt { display: flex; align-items: center; gap: 14px; padding: 0 8px 14px; }
.lt > div { flex: 1; min-width: 0; }
.lt b { display: block; font: 500 20px/1.2 var(--rp-display); letter-spacing: -.02em; }
.lt span.sub { display: block; margin-top: 3px; font-size: 13px; color: var(--rp-dim); }
.lt .dl { display: block; margin-top: 5px; font: 600 14px var(--rp-mono); }

/* linea come collana di fermate: i tram scorrono nelle due corsie a sinistra (giù = verso l'ultimo capolinea, su = ritorno) */
.perl { position: relative; margin: 4px 0 0 8px; padding-left: 82px; }
.perl .rail { position: absolute; left: 66px; top: 15px; bottom: 15px; width: 4px; border-radius: 2px; background: var(--c); }
.perl ol, .run, .deps { list-style: none; margin: 0; padding: 0; }
.perl li { height: 30px; display: flex; align-items: center; position: relative; }
.perl li::before { content: ""; position: absolute; left: -20px; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--rp-ink); border: 2px solid var(--rp-paper); }
.st { max-width: 100%; padding: 4px 6px; border-radius: 4px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st:hover { background: var(--rp-ink2); }
.v { position: absolute; top: 0; width: 22px; height: 16px; border-radius: 5px; background: var(--c); box-shadow: 0 0 0 2px var(--rp-ink), 0 0 0 4px currentColor; transition: transform 1s linear; }
.v.dn { left: 4px; } .v.up { left: 36px; }
.v::after { content: ""; position: absolute; left: 6px; border: 5px solid transparent; }
.v.dn::after { bottom: -13px; border-top-color: currentColor; }
.v.up::after { top: -13px; border-bottom-color: currentColor; }

.run { margin-left: 8px; }
.run li { display: flex; align-items: center; gap: 8px; min-height: 30px; padding-left: 26px; position: relative; }
.run li::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 4px; background: var(--c); }
.run li:first-child::before { top: 15px; border-radius: 2px 2px 0 0; } .run li:last-child::before { bottom: 15px; border-radius: 0 0 2px 2px; }
.run li::after { content: ""; position: absolute; left: 5px; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--rp-ink); border: 2px solid var(--rp-paper); }
.run li.pa { opacity: .42; }
.run li.nx::after { left: 2px; top: 7px; width: 12px; height: 12px; background: var(--rp-paper); }
.run .st { flex: 1; min-width: 0; }
.run .tm, .run .ex { flex: none; font: 13px var(--rp-mono); font-variant-numeric: tabular-nums; color: var(--rp-dim); }
.run .tm.old { text-decoration: line-through; opacity: .6; }
.run .ex { font-weight: 600; }

.dep { box-sizing: border-box; display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 8px; border-radius: 6px; }
button.dep:hover { background: var(--rp-ink2); }
.dep .nm { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dep .in { flex: none; min-width: 58px; text-align: right; font: 500 15px var(--rp-mono); font-variant-numeric: tabular-nums; }
.dep .dl { flex: none; min-width: 30px; text-align: right; font: 600 13px var(--rp-mono); }

.ctl { position: fixed; right: 16px; bottom: calc(16px + var(--pb, 0px)); display: flex; flex-direction: column; gap: 8px; }
.ctl button, .ctl a { display: block; width: 42px; height: 42px; box-sizing: border-box; border-radius: 6px; border: 1px solid var(--rp-rule); background: var(--rp-ink2); color: var(--rp-paper); font: 20px/40px var(--rp-mono); text-align: center; text-decoration: none; }
.ctl a { font-size: 13px; color: var(--rp-amber); }

@media (max-width: 820px) {
  #msg { left: 20px; top: 30%; }
  #panel { top: auto; right: 0; width: auto; max-height: 78dvh; border-right: 0; border-top: 1px solid var(--rp-rule); border-radius: 14px 14px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  #grip { display: block; width: 100%; height: 30px; touch-action: none; }
  #head { touch-action: pan-x; }
  #more { display: flex; justify-content: space-between; align-items: center; box-sizing: border-box; width: 100%; margin-top: 10px; padding: 11px 12px; background: var(--rp-ink2); border: 1px solid var(--rp-rule); border-radius: 6px; font-size: 15px; color: var(--rp-paper); }
  #more::after { content: ""; width: 8px; height: 8px; margin: 4px 4px 0 0; border: solid var(--rp-amber); border-width: 2px 0 0 2px; transform: rotate(45deg); }
  #grip::before { content: ""; display: block; width: 40px; height: 4px; margin: 0 auto; border-radius: 2px; background: #5a564c; }
  .ph { display: none; }
  #top { display: flex; align-items: center; gap: 8px; position: fixed; top: 0; left: 0; right: 0; z-index: 5; padding: calc(8px + env(safe-area-inset-top)) 12px 8px 16px; background: rgba(15,14,12,.9); border-bottom: 1px solid var(--rp-rule); }
  #top .home { margin-right: auto; color: var(--rp-paper); text-decoration: none; font: 500 18px var(--rp-display); letter-spacing: -.02em; }
  #top .home b { color: var(--rp-amber); font-weight: 500; }
  #citySel2 { padding: 6px 8px; font-size: 14px; color: var(--rp-paper); }
  #head { padding: 0 16px 12px; border-bottom: 0; }
  .h1 h1 { font-size: 28px; } .h1 #clk { font-size: 20px; }
  #sum { margin: 6px 0 9px; font-size: 14px; }
  #lg { gap: 6px; margin-top: 7px; font-size: 11px; }   /* legenda anche sul telefono (24.11: senza, barra e puntini non si capivano) */
  #lg b { font-size: 14px; }
  #chips { display: flex; gap: 6px; margin: 12px -16px 0; padding: 0 16px 2px; overflow-x: auto; scrollbar-width: none; }
  #chips::-webkit-scrollbar { display: none; }
  #chips .bdg { height: 30px; min-width: 36px; line-height: 30px; font-size: 14px; }
  #chips .bdg.off { opacity: .32; }
  #scroll { display: none; border-top: 1px solid var(--rp-rule); }
  #panel.open #scroll { display: block; flex: none; height: 40dvh; }
  #panel.open ~ .ctl { display: none; }
  #panel.open #chips, #panel.open #more { display: none; }
  .vh { top: -12px; margin: -12px -8px 6px; padding: 12px 8px 0; }
  #view { padding: 12px 8px 6px; }
  .row, .dep { padding: 10px 8px; }
}
@media (prefers-reduced-motion: reduce) { .v, #bar i { transition: none; } }
