/* Jasp Tracking Enterprise 5.0 — fast command interface for desktop, tablet and phone. */
:root{
  --e5-surface:#07111c;
  --e5-surface-2:#0b1927;
  --e5-surface-3:#102235;
  --e5-border:#29435a;
  --e5-border-strong:#3b627f;
  --e5-primary:#19c2d8;
  --e5-primary-strong:#0394bd;
  --e5-text:#f4f8fb;
  --e5-muted:#9bb0bf;
  --e5-radius:10px;
}

html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{background:#050b12;color:var(--e5-text)}
button,input,select{min-height:40px}
button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #50dff0;outline-offset:2px}

/* Compact command bar: information first, ornament second. */
.topbar{height:68px;padding:0 16px;gap:11px;background:#071421;border-bottom-color:#29465d;box-shadow:0 4px 16px #0007}
.topbar:after{background:linear-gradient(90deg,#0394bd,transparent 42%);opacity:.8}
.brandmark{width:42px;height:42px;border-radius:9px;background:#0b82ab;box-shadow:inset 0 0 0 1px #67e8f966,0 5px 14px #0006}
.brandmark:before{display:none}
.brand strong{font-size:15px;letter-spacing:.015em}.brand>span{margin-top:5px;color:#91a8b8;letter-spacing:1.7px}
.brand strong:after{content:" 5";color:#fff;font-family:var(--mono);font-size:.66em;margin-left:5px;padding:2px 4px;border-radius:4px;background:#087fa5;vertical-align:2px}
.stationbadge{height:38px;margin-left:8px;padding:0 12px}.source-switch{height:40px;border-radius:9px;background:#091827;backdrop-filter:none}
.source-switch button{border-radius:6px}.clock strong{font-size:14px}.connection{height:38px;border-radius:8px;background:#091a29}
.source-switch button.network-degraded{box-shadow:inset 0 0 0 1px #e5a72f;color:#ffd779}.source-switch button.network-offline{box-shadow:inset 0 0 0 1px #d64f62;color:#ff9ba8}
.iconbtn{width:40px;height:40px;border-radius:8px;background:#102438}

/* Dense overview preserves map space, particularly on a Pi-driven wall display. */
.kpis{height:96px;padding:10px 12px;gap:8px;background:#07101a}
.kpis article{border-radius:10px;padding:10px 11px;background:#0a1826;border-color:#213b51;box-shadow:none}
.kpis article:before{display:none}.kpi-icon{width:36px;height:36px;flex-basis:36px;border-radius:8px}.kpis strong{font-size:24px}
.workspace{height:calc(100vh - 164px);grid-template-columns:minmax(0,1fr) 438px}
.sidebar{background:#081522;border-left-color:#29445a;box-shadow:-8px 0 22px #0004}
.sidehead{height:54px}.tabs{height:45px}.filters{padding:9px}.searchbox{height:42px}.filters select{height:38px}
.aircraftrow{min-height:58px;padding:8px;border-radius:8px}.aircraftrow:hover{transform:none}.aircraftrow.selected{background:#0c3042;border-color:#2682a0}
.sidefooter{height:34px;background:#07131f}

/* Map visuals inspired by professional ADS-B displays: flat silhouettes and crisp outlines. */
.mapwrap:after{box-shadow:inset 0 0 42px rgba(0,8,16,.2)}
.leaflet-tile-pane{filter:brightness(.66) saturate(.72) contrast(1.12) hue-rotate(165deg)}
.mapheadline,.legend{border-radius:8px;background:#06131feb;backdrop-filter:none;border-color:#41647d;box-shadow:0 5px 18px #0008}
.maptools button{border-radius:8px;background:#0a1d2d;box-shadow:0 4px 14px #0008}
.aircraft-marker{filter:none}
.aircraft-marker .aircraft-svg{filter:drop-shadow(0 1px 0 #fff8) drop-shadow(0 2px 2px #000)!important;transition:transform .12s ease,filter .12s ease}
.aircraft-silhouette .aircraft-body{fill:var(--plane-color);stroke:#02070b;stroke-width:2.25;paint-order:stroke fill}
.aircraft-engine,.aircraft-basket{fill:#172633;stroke:#eaf7ff;stroke-width:1.1}
.aircraft-detail,.aircraft-spine{stroke:#f5fbff;stroke-width:1.05;opacity:.88}
.aircraft-cockpit{fill:#07131d;stroke:#fff;stroke-width:.7}
.nav-light.port{fill:#ff4055}.nav-light.starboard{fill:#42f59b}.nav-light.tail{fill:#fff}
.aircraft-marker .aircraft-detail,.aircraft-marker .aircraft-spine,.aircraft-marker .aircraft-cockpit,.aircraft-marker .nav-light{display:none}
.aircraft-marker .aircraft-engine{fill:var(--plane-color);stroke:#02070b;stroke-width:1.7}
.aircraft-marker:hover .aircraft-svg,.aircraft-marker.selected .aircraft-svg{transform:scale(1.1);filter:drop-shadow(0 0 2px #fff) drop-shadow(0 0 7px var(--plane-color))!important}
.aircraft-marker .aircraft-halo{inset:-5px;border:2px solid #fff;border-radius:50%;background:none;box-shadow:0 0 0 3px #07111caa,0 0 13px var(--plane-color)}
.aircraft-marker.selected .aircraft-halo{opacity:.95}
.marker-label{left:calc(100% + 5px);padding:3px 6px;border-radius:4px;background:#06111cf2;border-color:#5c7f98;color:#fff;font-size:8px;font-weight:800;box-shadow:0 2px 7px #000b}
.aircraft-marker.selected .marker-label{display:block;border-color:#fff;background:#0a3345}
.mini-plane{border-radius:7px;background:#0c1d2c}.mini-plane .aircraft-body{stroke-width:2.6}.mini-plane .aircraft-detail{display:none}
.network-aircraft{opacity:.88}.local-aircraft{filter:none}.network-aircraft .aircraft-halo{border-style:dashed}

/* Panels use a flat high-contrast information hierarchy. */
.detailpanel,.range-panel,.command-center,.playback-panel,.compare-panel{background:#071521f8;border-color:#365b74;backdrop-filter:none;box-shadow:0 20px 60px #000c}
.detailpanel{top:80px;width:440px;max-height:calc(100vh - 94px);border-radius:12px}.detailpanel:before,.range-panel:before{border-radius:12px 12px 0 0}
.detailplane{border-radius:10px;background:#0a789d;box-shadow:none}.detailitem{border-radius:7px;background:#0a1927;border-color:#203c52}
.detailitem span{color:#91a8b9}.detailitem strong{font-size:12px}.detailactions button{min-height:44px;border-radius:7px;background:#123650}
.command-center{border-radius:12px}.command-head{background:#091a28}.command-tabs{background:#07131f}.command-tabs button{min-height:48px}
.command-tabs button.active{background:#0d2c3e;color:#fff}.command-body{background:#07131f}
.command-kpis article,.chart-card,.top-types-card,.records-card,.e4-card{border-radius:8px;background:#0a1926;box-shadow:none}
.airport-row{border-radius:8px}.airport-follow{min-height:38px;border-radius:6px}.flight-phase{border-radius:5px}
.airport-row .codeshare-line{margin-top:4px;color:#c4d1da;font-family:var(--mono);font-size:7px;letter-spacing:.15px}
.light .airport-row .codeshare-line{color:#dce7ed}
.airport-row.arrivals{background:#06271f}.airport-row.departures{background:#2b1907}.airport-row.cruise{background:#17132d}
.mission-card,.mission-detail,.mission-hero{border-radius:10px!important;box-shadow:none!important}
.flight-tooltip{border-radius:7px!important;backdrop-filter:none!important}
.flight-dock{width:min(1100px,calc(100vw - 28px));grid-template-columns:50px minmax(170px,1fr) auto 160px auto auto auto!important}
#dockRecenter{border-color:#2388a6;background:#0d3a50;white-space:nowrap}

/* Light mode remains genuinely readable, including strong airport state colours. */
.light{--e5-text:#112c3e;--e5-muted:#536e80;background:#e8eef2}
.light .topbar{background:#fff;border-bottom-color:#b6c9d5;box-shadow:0 4px 14px #18394b24}
.light .brand strong:after{color:#fff}.light .kpis{background:#e8eef2}.light .kpis article{background:#fff;border-color:#c2d1db}
.light .sidebar{background:#f8fbfc;border-color:#b9ccd7}.light .command-center,.light .detailpanel,.light .range-panel{background:#f8fbfcf8;border-color:#8eabba}
.light .command-head,.light .command-tabs,.light .command-body{background:#f8fbfc}.light .command-tabs button.active{background:#dceef4;color:#0a526b}
.light .detailitem,.light .command-kpis article,.light .chart-card,.light .top-types-card,.light .records-card,.light .e4-card{background:#fff;border-color:#c0d1db}
.light .marker-label{background:#fffffff5;border-color:#68899d;color:#102d40}.light .aircraft-marker.selected .marker-label{background:#fff;border-color:#0b7395}

/* Tablet: retain a useful map and make the traffic board a compact lower deck. */
@media (max-width:1100px){
  .workspace{grid-template-columns:minmax(0,1fr) 370px}.stationbadge{display:none}.brand>span{letter-spacing:1.2px}
  .kpis{height:88px}.workspace{height:calc(100vh - 156px)}.kpis small{display:none}
}

@media (max-width:820px){
  body{overflow:auto;background:#07111b;padding-bottom:env(safe-area-inset-bottom)}
  .topbar{position:sticky;top:0;height:58px;padding:env(safe-area-inset-top) 8px 0;min-height:calc(58px + env(safe-area-inset-top));gap:7px}
  .brandmark{width:38px;height:38px;flex:0 0 38px}.brand strong{font-size:12px}.brand>span{font-size:6px;letter-spacing:1px}.brand strong:after{font-size:.62em}
  .source-switch{margin-left:auto;height:40px}.iconbtn{width:40px;height:40px}.clock,.stationbadge,#fullscreenBtn,.connection span{display:none}.connection{width:18px;min-width:18px;height:40px;padding:0;border:0;background:transparent}.connection i{margin:auto}
  .kpis{height:72px;display:flex;overflow-x:auto;padding:7px;gap:6px;scroll-snap-type:x proximity;scrollbar-width:none}.kpis::-webkit-scrollbar{display:none}
  .kpis article{min-width:138px;min-height:58px;flex:1 0 138px;padding:7px 9px;scroll-snap-align:start}.kpi-icon{width:30px;height:30px;flex-basis:30px;font-size:16px}.kpis strong{font-size:19px}.kpis span{font-size:6px}.kpis em{top:5px;right:6px;font-size:6px}.kpis small{display:none}
  .workspace{height:auto;display:block}.mapwrap{height:57svh;min-height:360px}.sidebar{height:47svh;min-height:390px;border-top:1px solid #29445a}
  .sidehead{height:50px}.tabs button,.filters select,.searchbox input{font-size:12px}.listhead,.aircraftrow{grid-template-columns:minmax(0,1fr) 76px 64px}.aircraftrow{min-height:62px}.aircraft-id strong{font-size:12px}.aircraft-id small{font-size:10px}
  .mapheadline{top:8px;left:8px;height:38px}.mapheadline>span{display:none}.maptools{left:8px;bottom:44px;gap:5px}.maptools button{width:44px;height:44px}.legend{right:8px;bottom:8px;max-width:calc(100% - 16px)}
  .aircraft-marker.selected .marker-label{display:block!important}
  .detailpanel{inset:auto 6px calc(6px + env(safe-area-inset-bottom));width:auto;max-height:82svh;border-radius:14px 14px 8px 8px;padding:14px;transform:translateY(calc(100% + 30px))}.detailpanel.open{transform:translateY(0)}
  .detailhead{grid-template-columns:48px minmax(0,1fr) 44px}.detailplane{width:48px;height:48px}.closebtn,#closeCommandCenter,#closeRangePanel,#closeMissionDetail{min-width:44px;min-height:44px}
  .detailgrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.detailitem{padding:9px}.detailactions{display:grid;grid-template-columns:1fr 1fr;bottom:-14px;padding-bottom:calc(14px + env(safe-area-inset-bottom))}
  .command-center{inset:calc(4px + env(safe-area-inset-top)) 4px calc(4px + env(safe-area-inset-bottom));width:auto;height:auto;border-radius:12px;transform:translateY(calc(100% + 20px))}.command-center.open{transform:translateY(0)}
  .command-head{padding:13px}.command-head h2{font-size:20px}.command-tabs{position:sticky;top:0;z-index:4;display:flex;overflow-x:auto;scroll-snap-type:x proximity;scrollbar-width:none}.command-tabs::-webkit-scrollbar{display:none}.command-tabs button{min-width:116px;font-size:9px;scroll-snap-align:start}
  .command-body{padding:10px}.airport-selects{display:grid;grid-template-columns:1fr 1fr;width:100%}.airport-selects select{width:100%;min-height:44px}.airport-kpis{grid-template-columns:1fr 1fr}
  .airport-row{grid-template-columns:minmax(0,1fr) 74px 72px!important;min-height:76px;padding:10px!important;gap:7px!important}.airport-row strong{font-size:12px}.airport-row small{font-size:9px}.airport-follow{min-height:40px;font-size:10px}
  .mission-hero form{grid-template-columns:1fr!important}.mission-hero input,.mission-hero button{min-height:46px}.mission-toolbar{align-items:stretch;gap:8px}.mission-toolbar button{min-height:44px}
  .flight-dock{bottom:calc(6px + env(safe-area-inset-bottom));border-radius:10px;background:#071521fb;backdrop-filter:none}
  .flight-dock{grid-template-columns:38px minmax(0,1fr) auto!important}.flight-dock label{grid-column:1/4}.flight-dock #dockRecenter{grid-column:1/2}.flight-dock #dockInfo{grid-column:2/3}.flight-dock #dockStop{grid-column:3/4}
}

@media (max-width:520px){
  .brand{max-width:132px}.brand>span{white-space:nowrap}.source-switch button{padding:0 7px}.source-switch button>span:first-child{display:none}
  .mapwrap{height:54svh;min-height:330px}.sidebar{height:50svh}.legend{gap:7px;padding:6px 8px;font-size:7px}.legend strong{display:none}
  .filters{gap:6px}.selectrow{grid-template-columns:1fr 1fr}.listhead,.aircraftrow{grid-template-columns:minmax(0,1fr) 70px 56px}
  .detailgrid{grid-template-columns:1fr 1fr}.detailitem strong{font-size:11px}.smart-flight{margin:9px 0}.smart-grid{grid-template-columns:1fr 1fr}
  .command-head p{display:none}.command-tabs button{min-width:108px}.command-body{padding:8px}.command-kpis{gap:6px}
  .airport-selects{grid-template-columns:1fr}.airport-row{grid-template-columns:minmax(0,1fr) 66px 66px!important}.airport-row .mini-plane,.schedule-plane{width:32px;height:32px;flex-basis:32px}
  .mission-list{grid-template-columns:1fr!important}.mission-card{padding:12px!important}
}

/* Reduce effects on low-power devices and honour accessibility settings. */
@media (prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}
@supports (content-visibility:auto){.aircraftrow,.airport-row,.mission-card{content-visibility:auto;contain-intrinsic-size:auto 64px}}
