/* RadarPociagow.pl – strona główna z mapą */
:root{--navy:#0b2545;--navy2:#13315c;--ink:#1b2a3d;--muted:#566479;--bg:#f4f6f9;--line:#dde3ea;--amber:#f2a900;--amberd:#8a5d00;--green:#16805e;--red:#c93a3a;--sh:0 6px 20px rgba(11,37,69,.12)}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;color:var(--ink);background:var(--bg);-webkit-font-smoothing:antialiased}
button,input,select{font:inherit;color:inherit}
a{color:var(--navy2)}
[hidden]{display:none !important}
.vh{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
body.pg-map{display:flex;flex-direction:column;height:100vh;height:100dvh;overflow:hidden}

/* nagłówek */
.hdr{flex:none;height:64px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:28px;padding:0 24px;position:relative;z-index:20}
.logo{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--navy);font-weight:800;font-size:19px;white-space:nowrap}
.logo-mk{width:34px;height:34px;border-radius:9px;background:var(--navy);display:grid;place-items:center}
.logo .tld{color:var(--muted);font-weight:600}
.nav{display:flex;gap:4px}
.nav a{padding:10px 14px;border-radius:8px;text-decoration:none;font-weight:600;font-size:15px;color:var(--muted)}
.nav a.on{color:var(--navy);background:#fff1cc;box-shadow:inset 0 -3px 0 var(--amber)}
.nav a:hover{color:var(--navy)}
.hdr-search{margin-left:auto;width:340px;max-width:40vw}
.search{position:relative}
.search-box{display:flex;align-items:center;gap:10px;background:var(--bg);border:1px solid var(--line);border-radius:10px;padding:0 14px;height:44px}
.search-box input{border:0;background:transparent;outline:none;font-size:15px;width:100%;min-width:0}
.search-res{position:absolute;left:0;right:0;top:calc(100% + 6px);background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 16px 40px rgba(11,37,69,.18);z-index:50;max-height:60vh;overflow:auto;padding:6px}
.sr-h{font-size:11px;font-weight:800;letter-spacing:.06em;color:var(--muted);padding:8px 10px 4px}
.sr{display:flex;align-items:center;gap:10px;width:100%;text-align:left;border:0;background:none;padding:9px 10px;border-radius:9px;cursor:pointer;color:var(--ink)}
.sr:hover,.sr:focus{background:#f2f6fb;outline:none}
.sr b{font-size:14px}.sr small{display:block;font-size:12px;color:var(--muted)}
.sr .grow{flex:1;min-width:0}.sr .grow small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sr-empty{padding:12px 10px;color:var(--muted);font-size:14px}

/* układ */
.app{flex:1;min-height:0;display:flex}
.side{flex:0 0 380px;width:380px;height:100%;background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column;gap:12px;padding:0 20px 14px;overflow:hidden;z-index:5}
.side-top{margin:0 -20px;padding:16px 20px;background:var(--navy);display:flex;flex-direction:column;gap:12px}
.side-title{display:flex;justify-content:space-between;align-items:baseline;gap:10px}
.side-title h1{margin:0;font-size:20px;line-height:1.2;color:#fff;letter-spacing:-.02em}
.side-title h1 span{color:var(--amber)}
.side-time{font-size:12px;color:#9fb3cc;white-space:nowrap}
.search-big{display:flex;gap:6px;background:#fff;border-radius:12px;padding:5px}
.search-big label{flex:1;min-width:0;display:flex;align-items:center;gap:8px;padding-left:9px}
.search-big input{border:0;outline:none;font-size:15px;font-weight:600;width:100%;min-width:0;background:transparent}
.btn-amber{flex:none;border:0;padding:0 16px;min-height:42px;border-radius:9px;background:var(--amber);color:var(--navy);font-weight:800;font-size:14px;cursor:pointer}
.filters{display:flex;gap:8px;align-items:center}
.sel{flex:1;min-width:0;position:relative}
.sel select{appearance:none;-webkit-appearance:none;width:100%;font-size:13px;font-weight:600;min-height:40px;padding:0 34px 0 12px;border:1px solid var(--line);border-radius:10px;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23566479' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;cursor:pointer}
.chk{flex:none;display:flex;align-items:center;gap:8px;font-size:13px;font-weight:600;min-height:40px;padding:0 10px 0 12px;border:1px solid var(--line);border-radius:10px;cursor:pointer;white-space:nowrap}
.chk input{width:18px;height:18px;accent-color:var(--navy);margin:0}
.tabs{display:flex;gap:4px;padding:4px;border-radius:12px;background:#e6ebf1}
.tabs button{flex:1;min-height:38px;padding:0 6px;border:0;border-radius:9px;background:transparent;color:var(--muted);font-weight:700;font-size:13px;cursor:pointer;white-space:nowrap}
.tabs button[aria-selected=true]{background:#fff;color:var(--navy);box-shadow:0 1px 4px rgba(11,37,69,.14)}
.badge{margin-left:5px;padding:1px 7px;border-radius:999px;color:#fff;font-size:11px;font-weight:800}
.badge.red{background:var(--red)}.badge.amber{background:var(--amberd)}
.list{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;margin:-4px -8px 0;padding:0 8px}
.list-h{display:flex;justify-content:space-between;align-items:center;padding:2px 0 4px;font-size:12px;color:var(--muted)}
.row{display:grid;grid-template-columns:52px minmax(0,1fr);gap:12px;align-items:center;padding:8px;margin:0 -8px;border-radius:12px;width:calc(100% + 16px);text-align:left;border:0;background:none;cursor:pointer;color:var(--ink)}
.row:hover,.row:focus-visible{background:#f2f6fb;outline:none}
.row .dl{height:46px;border-radius:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1}
.row .dl b{font-size:18px}.row .dl span{font-size:10px;font-weight:700;margin-top:2px}
.dl.bad{background:#fde4e4;color:var(--red)}.dl.mid{background:#fff1cc;color:var(--amberd)}.dl.ok{background:#e3f4ec;color:var(--green)}
.row .mid-c{min-width:0;display:flex;flex-direction:column;gap:4px}
.row .t1{display:flex;justify-content:space-between;gap:8px;align-items:baseline}
.row .t1 b{font-size:14px}.row .t1 span{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.row .rt{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.row .pb{display:flex;align-items:center;gap:8px}
.row .pb i{flex:1;height:4px;border-radius:2px;background:var(--line);position:relative;overflow:hidden}
.row .pb i u{position:absolute;left:0;top:0;bottom:0;background:var(--navy)}
.row .pb span{font-size:11px;font-weight:600;white-space:nowrap;max-width:50%;overflow:hidden;text-overflow:ellipsis}
.drow{display:flex;gap:12px;align-items:flex-start;padding:10px 8px;margin:0 -8px;border-radius:12px;border:0;background:none;width:calc(100% + 16px);text-align:left;cursor:pointer;color:var(--ink)}
.drow:hover{background:#f2f6fb}
.drow .ic{flex:none;width:34px;height:34px;border-radius:9px;display:grid;place-items:center}
.drow .tx{flex:1;min-width:0;font-size:13px;line-height:1.45}
.drow .tx b{display:block;font-size:14px;margin-bottom:2px}
.drow .tx small{color:var(--muted);font-size:12px}
.prow{padding:8px 0;border-top:1px solid var(--line)}
.prow .t{display:flex;justify-content:space-between;font-size:13px;margin-bottom:5px}
.prow .bar{height:8px;border-radius:4px;background:var(--bg);overflow:hidden}
.prow .bar i{display:block;height:100%;border-radius:4px}
.empty{padding:22px 6px;color:var(--muted);font-size:14px;text-align:center}
.ad{flex:none;border:1px dashed #b8c4d2;border-radius:8px;background:repeating-linear-gradient(135deg,#f7f9fb 0 10px,#f0f3f7 10px 20px);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;color:var(--muted);font-size:12px}
.ad b{font-size:11px;letter-spacing:.08em}
.ad-side{width:300px;height:250px;max-width:100%;margin:0 auto}

/* mapa */
.mapwrap{flex:1;min-width:0;position:relative;background:#e3e9ef}
#map{position:absolute;inset:0}
.maplibregl-ctrl-attrib{font-size:11px}
.mright{position:absolute;top:18px;right:18px;display:flex;flex-direction:column;gap:10px;align-items:flex-end;z-index:7}
.mright-row{display:flex;gap:10px;align-items:flex-start}
.regions{display:flex;gap:4px;padding:5px;background:rgba(255,255,255,.96);border:1px solid var(--line);border-radius:999px;box-shadow:var(--sh)}
.regions button{min-height:34px;padding:0 13px;border:0;border-radius:999px;background:transparent;font-weight:700;font-size:13px;cursor:pointer;color:var(--ink)}
.regions button[aria-pressed=true]{background:var(--navy);color:#fff}
.layers{width:220px;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 12px 30px rgba(11,37,69,.18);padding:8px}
.layers-h{display:flex;align-items:center;gap:8px;padding:4px 6px 6px;font-size:11px;font-weight:800;color:var(--muted);letter-spacing:.06em}
.lay{display:flex;align-items:center;gap:10px;min-height:36px;padding:0 10px;border-radius:9px;font-size:13px;font-weight:700;cursor:pointer;color:var(--muted)}
.lay span{flex:1}
.lay input{position:absolute;opacity:0;width:1px;height:1px}
.lay i{width:30px;height:18px;border-radius:9px;background:#cdd5df;position:relative;transition:background .15s}
.lay i::after{content:"";position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:left .15s}
.lay:has(input:checked){background:#eaf0f7;color:var(--navy)}
.lay input:checked+i{background:var(--navy)}
.lay input:checked+i::after{left:14px}
.lay input:focus-visible+i{outline:2px solid var(--amber);outline-offset:2px}
.ctrls{display:flex;flex-direction:column;border-radius:12px;overflow:hidden;border:1px solid var(--line);box-shadow:var(--sh);background:#fff}
.ctrls button{width:44px;height:44px;border:0;border-bottom:1px solid var(--line);background:#fff;color:var(--navy);font-size:22px;font-weight:600;cursor:pointer;display:grid;place-items:center}
.ctrls button:last-child{border-bottom:0}
.ctrls button.on{background:#fff1cc}
.mright-row .layers{position:relative}
/* stopka */
.fbar{flex:none;height:44px;background:var(--navy);display:flex;align-items:stretch;font-size:12px;color:#7f97b5}
.fbar-l{flex:none;display:flex;align-items:center;gap:16px;padding:0 20px}
.fbar-l a{color:#c9d6e6;text-decoration:none;font-weight:600}
.fbar-sp{flex:1}
.fbar-r{flex:none;display:flex;align-items:center;padding:0 20px}
.tabbar{display:none}
.toast{position:fixed;left:50%;bottom:90px;transform:translateX(-50%);background:var(--navy);color:#fff;padding:12px 18px;border-radius:12px;font-size:14px;font-weight:600;z-index:100;box-shadow:0 10px 30px rgba(0,0,0,.25);max-width:calc(100% - 32px)}

/* telefon: układ aplikacji */
@media (max-width: 900px){
  .pg-map .hdr{position:absolute;left:12px;right:12px;top:calc(env(safe-area-inset-top) + 10px);height:auto;background:none;border:0;padding:0;gap:8px}
  .pg-map .hdr .nav,.pg-map .hdr .logo span:not(.logo-mk){display:none}
  .pg-map .hdr .logo-mk{width:46px;height:46px;border-radius:12px;box-shadow:0 4px 14px rgba(11,37,69,.18)}
  .pg-map .hdr-search{flex:1;width:auto;max-width:none;margin:0}
  .pg-map .hdr-search .search-box{background:#fff;height:46px;border-radius:12px;box-shadow:0 4px 14px rgba(11,37,69,.12);border:0}
  .app{position:relative}
  .side{position:absolute;left:0;right:0;bottom:0;top:auto;width:auto;height:72%;z-index:30;border-right:0;border-radius:20px 20px 0 0;box-shadow:0 -10px 30px rgba(11,37,69,.18);transform:translateY(105%);transition:transform .25s ease}
  .side.open{transform:none}
  .side-top{border-radius:20px 20px 0 0}
  .side .ad-side{display:none}
  .mright{top:auto;bottom:16px;right:12px}
  .regions{display:none}
  .ctrls button#full{display:none}
  .live{top:calc(env(safe-area-inset-top) + 66px);bottom:auto;left:12px;right:12px;transform:none;width:auto;padding:8px 12px}
  .live-top{font-size:13px}
  .live-leg{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
  .tcard{top:auto;bottom:0;left:0;right:0;width:auto;max-width:none;max-height:78%;border-radius:20px 20px 0 0;z-index:25}
  .fbar{display:none}
  .tabbar{display:flex;flex:none;height:calc(64px + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);background:#fff;border-top:1px solid var(--line);z-index:40}
  .tabbar>*{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border:0;background:none;font-size:11px;font-weight:600;color:var(--muted);text-decoration:none;cursor:pointer}
  .tabbar .on{color:var(--navy);font-weight:800}
  .tabbar .on svg{stroke:var(--navy)}
  .tabbar .on{box-shadow:inset 0 3px 0 var(--amber)}
}

/* widżet „sytuacja teraz” */
.live{position:absolute;left:50%;transform:translateX(-50%);bottom:22px;z-index:3;background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:var(--sh);padding:10px 14px 8px;display:flex;flex-direction:column;gap:7px;width:min(560px,calc(100% - 36px))}
.live-top{display:flex;align-items:center;gap:10px;font-size:14px;color:var(--muted);white-space:nowrap}
.live-top b{color:var(--navy);font-size:17px;font-weight:800;font-variant-numeric:tabular-nums}
.live-top b.r{color:var(--red)}
.live-dot{width:8px;height:8px;border-radius:50%;background:#1f9d6a;box-shadow:0 0 0 3px #dff3ea;flex:none}
.live-sep{width:1px;height:16px;background:var(--line)}
.live-bar{display:flex;height:8px;border-radius:4px;overflow:hidden;background:var(--bg)}
.live-bar i{display:block;height:100%;transition:width .4s}
.live-bar i.ok,.mk.ok{background:#1f9d6a}.live-bar i.mid,.mk.mid{background:#f2a900}.live-bar i.bad,.mk.bad{background:#e04848}
.live-leg{display:flex;flex-wrap:wrap;gap:4px 6px;align-items:center}
.live-leg button,.live-leg .lnk{display:inline-flex;align-items:center;gap:6px;border:1px solid transparent;background:none;border-radius:999px;padding:4px 9px;font-size:12.5px;font-weight:600;color:var(--muted);cursor:pointer;white-space:nowrap}
.live-leg span.lnk{cursor:default}
.live-leg b{color:var(--ink)}
.live-leg button:hover{background:var(--bg)}
.live-leg button[aria-pressed=true]{background:#eaf0f7;border-color:#c9d6e6;color:var(--navy)}
.live.filtered .live-leg button[aria-pressed=false][data-dc]{opacity:.5}
.mk{width:10px;height:10px;border-radius:50%;display:inline-block}

/* karta pociągu */
.tcard{position:absolute;top:18px;left:18px;width:384px;max-width:calc(100% - 36px);max-height:calc(100% - 36px);overflow:auto;background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:0 14px 40px rgba(11,37,69,.2);z-index:6;font-size:14px}
.tc-head{display:flex;justify-content:space-between;gap:12px;padding:16px 16px 12px}
.tc-car{font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.tc-lab{font-size:26px;font-weight:800;color:var(--navy);letter-spacing:-.03em;line-height:1.1;margin-top:2px}
.tc-lab span{font-size:17px;font-weight:700;letter-spacing:-.01em}
.tc-rt{font-size:15px;font-weight:600;margin-top:4px;line-height:1.35}
.tc-rt span{color:var(--muted)}
.tc-side{display:flex;gap:6px;align-items:flex-start}
.tc-dl{min-width:62px;border-radius:12px;padding:8px 8px 6px;text-align:center;line-height:1}
.tc-dl b{display:block;font-size:22px;font-weight:800}.tc-dl span{font-size:11px;font-weight:700}
.tc-dl.ok{background:#e3f4ec;color:var(--green)}.tc-dl.mid{background:#fff1cc;color:var(--amberd)}.tc-dl.bad{background:#fde4e4;color:var(--red)}
.tc-x{width:36px;height:36px;border:0;border-radius:10px;background:var(--bg);color:var(--muted);font-size:20px;cursor:pointer}
.tc-strip{margin:0 16px;padding:12px 14px;border-radius:14px;background:#eef3f9;display:flex;justify-content:space-between;align-items:center;gap:12px}
.tc-strip.mid{background:#fff6dc}.tc-strip.bad{background:#fdecec}.tc-strip.ok{background:#e9f6ef}
.tc-strip small{display:block;font-size:11px;font-weight:700;color:var(--muted);letter-spacing:.05em}
.tc-strip b{font-size:16px;color:var(--navy)}
.tc-strip span>small:last-child:not(:first-child){font-weight:600;letter-spacing:0;margin-top:2px;font-size:12.5px}
.tc-strip .r{text-align:right;flex:none}
.tc-strip .big{font-size:24px;font-weight:800;display:block;line-height:1.1;font-variant-numeric:tabular-nums}
.tc-strip.mid .big{color:var(--amberd)}.tc-strip.bad .big{color:var(--red)}
.tc-strip s{font-size:13px;color:var(--muted)}
.tc-prog{padding:14px 16px 4px}
.tc-bar{height:8px;border-radius:4px;background:#e6ebf1;overflow:hidden}
.tc-bar i{display:block;height:100%;background:var(--navy);border-radius:4px}
.tc-pl{display:flex;justify-content:space-between;gap:10px;margin-top:6px;font-size:12.5px;font-weight:600}
.tc-pl span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:50%}
.tc-cnt{font-size:12px;color:var(--muted);margin-top:2px}
.tc-reason{display:flex;gap:8px;align-items:flex-start;margin:10px 16px 0;padding:10px 12px;border-radius:12px;background:#fffaf0;color:var(--amberd);font-size:13px;font-weight:600}
.tc-reason svg{flex:none;margin-top:1px}
.tc-ad{width:350px;height:150px;max-width:calc(100% - 32px);margin:14px auto 4px;border:1px dashed #b8c4d2;border-radius:10px;background:repeating-linear-gradient(135deg,#f7f9fb 0 10px,#f0f3f7 10px 20px);display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--muted);font-size:12px}
.tc-ad b{font-size:11px;letter-spacing:.08em}
.tc-list{padding:8px 16px 0}
.tc-lh{font-size:12px;font-weight:800;color:var(--muted);letter-spacing:.05em;text-transform:uppercase;padding:6px 0}
.tc-row{display:grid;grid-template-columns:58px minmax(0,1fr) auto;gap:10px;align-items:center;padding:9px 0;border-top:1px solid var(--line)}
.tc-row .tt b{display:block;font-size:15px;font-weight:800;font-variant-numeric:tabular-nums}
.tc-row .tt b.lt{color:var(--amberd)}
.tc-row .tt s{font-size:11.5px;color:var(--muted)}
.tc-row .tn{font-size:14.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tc-row .tp{font-size:12px;font-weight:700;color:var(--navy2);background:#eaf0f7;border-radius:7px;padding:3px 7px;white-space:nowrap}
.tc-row .tp:empty{display:none}
.tc-row.past{opacity:.55}
.tc-more{width:100%;border:0;border-top:1px solid var(--line);background:none;color:var(--navy2);font-weight:700;font-size:13px;padding:11px 0;cursor:pointer}
.tc-act{display:flex;gap:8px;padding:12px 16px 16px;border-top:1px solid var(--line);position:sticky;bottom:0;background:#fff}
.tc-act a.pri{flex:1;display:flex;align-items:center;justify-content:center;background:var(--navy);color:#fff;text-decoration:none;border-radius:11px;font-weight:700;font-size:14px;min-height:44px}
.tc-act button{min-height:44px;min-width:44px;border-radius:11px;border:1px solid var(--line);background:#fff;color:var(--navy);font-weight:700;font-size:14px;padding:0 14px;cursor:pointer;display:grid;place-items:center}
.tc-act button.on{background:#fff1cc;border-color:#f5d98a}
@media (max-width: 900px){
  .tcard{top:auto;bottom:0;left:0;right:0;width:auto;max-width:none;max-height:78%;border-radius:20px 20px 0 0;z-index:25}
  .live{top:calc(env(safe-area-inset-top) + 66px);bottom:auto;left:12px;right:12px;transform:none;width:auto;padding:8px 12px;gap:5px}
  .live-top{font-size:13px;gap:8px}
  .live-top b{font-size:15px}
  .live-leg{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
  .mright{z-index:4}
  .layers{position:absolute !important;right:54px;bottom:0}
}
