:root{
  --navy:#0B2545; --orange:#E8590C; --orange-ink:#B4460A; --paper:#F5F1E8; --white:#FFFFFF;
  --muted:#475569; --chip:#F3F6F9; --line:#E2E8F0; --teal:#2A9D8F; --slate:#4C6A8A; --green:#146C43; --green-bg:#E3F6EC;
  --shadow:0 8px 24px rgba(11,37,69,.14);
  --f-display:Sora,system-ui,sans-serif; --f-body:Figtree,system-ui,-apple-system,"Segoe UI",sans-serif;
}
*{box-sizing:border-box}
html,body{height:100%;margin:0}
body{background:#DCEBF2;color:var(--navy);font-family:var(--f-body);font-size:15px;line-height:1.4;overflow:hidden}
button,select,input{font:inherit;color:inherit}
button{cursor:pointer}
a{color:var(--navy)}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
#map{position:fixed;inset:0;z-index:0;background:#DCEBF2}
.leaflet-container{font-family:var(--f-body)}
.tiles{filter:saturate(.55) brightness(1.04) contrast(.92)}
.leaflet-control-attribution{display:none}

/* top bar */
.top{position:fixed;left:12px;right:12px;top:calc(12px + env(safe-area-inset-top,0px));z-index:500;display:flex;align-items:center;gap:8px;pointer-events:none}
.top>*{pointer-events:auto}
.brand{display:flex;align-items:center;gap:8px;background:var(--white);border-radius:999px;padding:6px 14px 6px 6px;box-shadow:var(--shadow);text-decoration:none;color:var(--navy)}
.brand-mark{width:32px;height:32px;border-radius:50%;background:var(--navy);display:grid;place-items:center}
.brand-mark svg{width:18px;height:18px}
.brand-name{font-family:var(--f-display);font-weight:800;font-size:17px;letter-spacing:-.3px}
.live{white-space:nowrap;display:flex;align-items:center;gap:7px;background:var(--navy);color:#fff;border-radius:999px;padding:8px 12px;font-size:13px;font-weight:600;box-shadow:var(--shadow)}
.live i{width:8px;height:8px;border-radius:50%;background:#5EE0A0;box-shadow:0 0 0 0 rgba(94,224,160,.6);animation:pulse 2s infinite}
.live.err i{background:#F4B860;animation:none}
@keyframes pulse{70%{box-shadow:0 0 0 8px rgba(94,224,160,0)}100%{box-shadow:0 0 0 0 rgba(94,224,160,0)}}
.grow{flex:1}
.sbar{flex:1;min-width:0;max-width:440px;height:44px;display:flex;align-items:center;gap:9px;border:2px solid var(--orange);border-radius:999px;background:var(--white);padding:0 16px 0 13px;box-shadow:var(--shadow);font-weight:700;font-size:15px;color:var(--navy);text-align:left}
.sbar svg{flex:none;width:20px;height:20px;color:var(--orange)}
.sbar span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--muted)}
.sbar:hover{box-shadow:0 0 0 4px rgba(232,89,12,.15),var(--shadow)}
.top .live{margin-left:auto}
.brand,.live,.lang{flex:none}
.lang{height:44px;border:0;border-radius:999px;background:var(--white);padding:0 10px;box-shadow:var(--shadow);font-weight:700}
.round{width:44px;height:44px;border-radius:50%;border:0;background:var(--white);box-shadow:var(--shadow);display:grid;place-items:center;color:var(--navy)}
.round svg{width:20px;height:20px}
.loc{position:fixed;right:12px;z-index:500;bottom:calc(46vh + 14px)}
.hint{position:fixed;left:50%;top:calc(70px + env(safe-area-inset-top,0px));transform:translateX(-50%);z-index:500;background:var(--navy);color:#fff;border-radius:12px;padding:8px 14px;font-weight:600;font-size:14px;box-shadow:var(--shadow);max-width:calc(100vw - 24px);text-align:center}

/* sheet: bottom on phones, left panel on wide screens */
.sheet{position:fixed;left:0;right:0;bottom:0;z-index:600;background:var(--white);border-radius:24px 24px 0 0;box-shadow:0 -10px 30px rgba(11,37,69,.14);padding:6px 18px calc(10px + env(safe-area-inset-bottom,0px));max-height:46vh;overflow-y:auto;overscroll-behavior:contain;transition:max-height .25s ease}
.sheet.open{max-height:64vh}
.grip{display:block;width:100%;height:20px;border:0;background:none;padding:0;position:relative}
.grip::after{content:"";position:absolute;left:50%;top:8px;width:44px;height:5px;margin-left:-22px;border-radius:3px;background:#D5DDE5}
.tog{display:flex;align-items:center;gap:10px;margin-top:14px;font-weight:600;font-size:14.5px;min-height:44px}
.tog input{width:22px;height:22px;accent-color:var(--orange)}
.credit{margin:12px 0 0;font-size:11.5px;color:var(--muted)}
.credit a{color:var(--muted)}
.eyebrow{font-size:12.5px;font-weight:700;color:var(--orange-ink);text-transform:uppercase;letter-spacing:1px;margin:2px 0 8px}
.title{font-family:var(--f-display);font-weight:800;font-size:26px;line-height:1.08;letter-spacing:-.5px;margin:0}
.sub{color:var(--muted);font-size:15px;margin:4px 0 0}
.stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:14px}
.stat{background:var(--chip);border-radius:14px;padding:9px 11px;min-width:0}
.stat small{display:block;font-size:12px;color:var(--muted)}
.stat b{display:block;font-family:var(--f-display);font-weight:700;font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.stat b.wx{white-space:normal;font-size:15px;line-height:1.2}
.stat em{font-style:normal;font-size:11.5px;color:var(--muted)}
.row{display:flex;gap:10px;margin-top:14px}
.btn{flex:1;border:0;border-radius:14px;padding:14px;font-weight:700;font-size:16px;text-align:center;text-decoration:none;min-height:48px}
.btn.primary{background:var(--orange);color:#fff}
.btn.dark{background:var(--navy);color:#fff}
.btn.soft{background:var(--chip);color:var(--navy)}
.head{display:flex;align-items:flex-start;gap:12px}
.head .grow{min-width:0}
.badge{flex:none;width:52px;height:52px;border-radius:16px;background:#FFF1E8;display:grid;place-items:center}
.badge svg{width:28px;height:28px}
.empty{color:var(--muted);margin:6px 0 0}

/* detail */
.photo{position:relative;margin:4px -18px 0;height:160px;background:#C9D9E3;display:grid;place-items:center;overflow:hidden}
.photo img{width:100%;height:100%;object-fit:cover;display:block}
.photo .ph{color:#33506E;font-weight:600;font-size:14px}
.photo .by{position:absolute;left:10px;bottom:8px;background:rgba(11,37,69,.78);color:#fff;font-size:12px;border-radius:8px;padding:3px 8px;text-decoration:none}
.photo .back{position:absolute;left:10px;top:10px}
.route{background:var(--chip);border-radius:18px;padding:14px;margin-top:14px}
.route .ends{display:flex;justify-content:space-between;align-items:flex-end;gap:10px}
.route .code{font-family:var(--f-display);font-weight:800;font-size:24px}
.route .city{font-size:13px;color:var(--muted)}
.bar{position:relative;height:8px;border-radius:4px;background:#D5DDE5;margin:12px 0 10px}
.bar>i{position:absolute;left:0;top:0;bottom:0;border-radius:4px;background:var(--orange)}
.bar>b{position:absolute;top:-9px;width:26px;height:26px;margin-left:-13px;border-radius:50%;background:#fff;box-shadow:0 3px 8px rgba(11,37,69,.2);display:grid;place-items:center}
.bar>b svg{width:15px;height:15px}
.route p{margin:0;font-weight:600;font-size:14px}
.estnote{margin:12px 0 0;background:#FFF4E5;color:#7A3E06;border-radius:12px;padding:9px 12px;font-size:13.5px;line-height:1.35}

/* search */
.sform{display:flex;gap:8px;margin-top:10px}
.sform input{flex:1;min-width:0;font-size:17px;font-weight:700;background:#fff;border:2px solid var(--navy);border-radius:14px;padding:11px 14px}
.sform button{border:0;background:var(--navy);color:#fff;border-radius:14px;padding:0 16px;font-weight:700}
.msg{margin:12px 0 0;color:var(--muted)}
.tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;background:var(--chip);border-radius:14px;padding:4px;margin-top:4px}
.tab{border:0;background:none;border-radius:10px;padding:10px 4px;font-weight:700;font-size:14px;color:var(--muted);min-height:44px}
.tab.on{background:#fff;color:var(--navy);box-shadow:0 2px 6px rgba(11,37,69,.1)}
.sform.col{flex-direction:column}
.sform.col button{min-height:48px}
.sug-wrap{position:relative;display:flex;flex-direction:column;min-width:0}
.sug-wrap.grow{flex:1}
.sbar{flex:1;min-width:0;max-width:440px;height:44px;display:flex;align-items:center;gap:9px;border:2px solid var(--orange);border-radius:999px;background:var(--white);padding:0 16px 0 13px;box-shadow:var(--shadow);font-weight:700;font-size:15px;color:var(--navy);text-align:left}
.sbar svg{flex:none;width:20px;height:20px;color:var(--orange)}
.sbar span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--muted)}
.sbar:hover{box-shadow:0 0 0 4px rgba(232,89,12,.15),var(--shadow)}
.top .live{margin-left:auto}
.brand,.live,.lang{flex:none}
.sug-wrap input{font-size:17px;font-weight:700;background:#fff;border:2px solid var(--navy);border-radius:14px;padding:11px 14px;min-width:0}
.sug{display:flex;flex-direction:column;gap:4px;margin-top:4px}
.sug:empty{display:none}
.sg{border:1px solid var(--line);background:#fff;border-radius:12px;padding:10px 12px;text-align:left;min-height:44px}
.sg:hover,.sg:focus{border-color:var(--orange)}
.sg b{font-weight:700}
.sg span{display:block;font-size:13px;color:var(--muted)}
.gh{font-family:var(--f-display);font-size:16px;margin:18px 0 0;display:flex;align-items:center;gap:8px}
.gh span{background:var(--chip);border-radius:999px;padding:2px 9px;font-size:13px}
.list.on{display:flex;margin-top:10px}

/* list of nearby aircraft (wide screens) */
.list{display:none;margin-top:16px;flex-direction:column;gap:8px}
.item{display:block;width:100%;text-align:left;background:#fff;border:1px solid var(--line);border-radius:16px;padding:11px 13px}
.item:hover{border-color:var(--slate)}
.item b{font-family:var(--f-display);font-size:16px}
.item span{display:block;font-size:13.5px;color:var(--muted)}

.legend{display:none}
#legMil[hidden]{display:none!important}
.toast{position:fixed;left:50%;bottom:calc(46vh + 20px);transform:translateX(-50%);z-index:900;background:var(--navy);color:#fff;border-radius:12px;padding:10px 16px;font-weight:600}

/* map markers */
.ac{width:28px;height:28px;display:grid;place-items:center;transition:transform .9s linear}
.ac svg{width:100%;height:100%;filter:drop-shadow(0 1px 1px rgba(0,0,0,.25))}
.ac.sm{width:20px;height:20px}
.ac.tr{width:25px;height:25px}
.ac.sel{width:38px;height:38px}
.me{width:22px;height:22px;border-radius:50%;background:var(--orange);border:3px solid #fff;box-shadow:0 0 0 10px rgba(232,89,12,.16)}

@media (max-width:430px){.live span{display:none}.live{padding:12px}.brand-name{font-size:16px}.top{gap:6px}.sbar{padding:0 10px;gap:6px;font-size:14px}}
@media (max-width:360px){.brand-name{display:none}.brand{padding:6px}}
@media (min-width:900px){
  .photo{height:200px}
  .sheet,.sheet.open{left:12px;right:auto;top:76px;bottom:12px;width:380px;max-height:none;border-radius:22px;padding:14px 18px 12px}
  .grip{display:none}
  .photo{margin:-14px -18px 0;border-radius:22px 22px 0 0}
  .list{display:flex}
  .loc{bottom:20px}
  .toast{bottom:24px}
  .legend{display:flex;flex-direction:column;gap:7px;position:fixed;right:12px;bottom:76px;z-index:500;background:#fff;border-radius:14px;padding:11px 13px;box-shadow:var(--shadow);font-size:13px}
  .legend div{display:flex;align-items:center;gap:8px}
  .legend i{width:12px;height:12px;border-radius:50%}
}
@media (prefers-reduced-motion:reduce){.ac{transition:none}.live i{animation:none}}

/* departures / arrivals board */
.tabs.two{grid-template-columns:1fr 1fr;margin-top:14px}
.bnote{margin:10px 0 4px;font-size:12px;color:var(--muted)}
.board{display:flex;flex-direction:column}
.brow{display:grid;grid-template-columns:54px minmax(0,1fr) auto;gap:10px;align-items:center;width:100%;text-align:left;background:none;border:0;border-bottom:1px solid var(--line);padding:10px 2px;min-height:52px}
.brow:hover{background:var(--chip)}
.bt{display:flex;flex-direction:column;line-height:1.15}
.bt b{font-family:var(--f-display);font-size:16px}
.bt s{font-size:12px;color:var(--muted)}
.bt b.new{color:var(--orange-ink)}
.bm{min-width:0}
.bm b{display:block;font-weight:700;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bm span{display:block;font-size:12.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bs{display:flex;flex-direction:column;align-items:flex-end;gap:4px}
.st{font-style:normal;font-size:12px;font-weight:700;border-radius:999px;padding:3px 8px;background:var(--chip);color:var(--navy);white-space:nowrap}
.st.bad{background:#FDE8E8;color:#A61B1B}
.st.ok{background:var(--green-bg);color:var(--green)}
.st.air{background:#E6EEF8;color:#163E6E}
.st.go{background:#FFF1E8;color:var(--orange-ink)}
.st.live{background:var(--navy);color:#fff}
.finfo{margin-top:14px;background:var(--chip);border-radius:16px;padding:14px}
.finfo .fh{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.finfo .fh b{font-family:var(--f-display);font-size:20px}
.finfo .fh span{color:var(--muted);font-size:14px}
.finfo .fr{font-weight:700;margin:6px 0 8px}
.finfo p{margin:6px 0 0;font-size:14px}
.finfo p s{color:var(--muted);margin-right:4px}
.finfo p b.new{color:var(--orange-ink)}
.finfo p span{color:var(--muted)}
.official{margin-top:12px;padding-top:11px;border-top:1px solid #D5DDE5}
.official div{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.official small{font-size:13px;color:var(--muted);font-weight:600}
.official b{font-family:var(--f-display);font-size:20px}
.official b.new{color:var(--orange-ink)}
.official s{color:var(--muted);font-size:14px}
.official p{margin:4px 0 0;font-weight:500;font-size:13px;color:var(--muted)}
.finfo p.nogate{font-size:13px;color:var(--orange-ink);margin-top:2px}
.prog{display:flex;justify-content:space-between;gap:10px;font-weight:600;font-size:13.5px}
.prog span:last-child{text-align:right}
.official p s{font-size:13px}
