/* TAILTRACK: black top (title, menu, next boxes, arrivals, departures), light grey below. Apple style. */
:root {
  --red: #ff3b30; --green: #34c759; --orange: #e8430a; --amber: #ff9500; --blue: #0a84ff;
  --bg: #f2f2f7; --card: #ffffff; --ink: #000000; --muted: #8e8e93;
  --night: #000000; --nightcard: #1c1c1e; --nightline: #2c2c2e;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; width: 100%; max-width: 100%; overflow-x: hidden; }
body {
  background: var(--bg); color: var(--ink);
  font: 15px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Arial, sans-serif;
  touch-action: pan-y; overscroll-behavior-x: none; -webkit-text-size-adjust: 100%;
}
a { color: inherit; }

/* ---------- top (night) ---------- */
#top { background: var(--night); color: #fff; padding: calc(env(safe-area-inset-top) + 10px) 12px 12px;
       border-radius: 0 0 22px 22px; }
.title { font-weight: 900; font-size: 22px; letter-spacing: 1px; margin: 2px 2px 8px; }
#menu { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
#menu button { border: 0; border-radius: 999px; padding: 7px 14px; font-weight: 800; font-size: 13.5px;
               background: #e5e5ea; color: #000; }
#menu button.on { background: var(--red); color: #fff; }
.loading { color: var(--muted); padding: 20px 4px; }

/* next arrival / next departure (half size) */
.nx { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 2px 0 10px; }
.nm { background: var(--nightcard); border: 2px solid var(--red); border-radius: 12px; padding: 6px 8px; min-width: 0;
      animation: ncpulse 1.2s ease-in-out infinite; }
.nm .l { font-size: 9px; font-weight: 800; color: var(--red); letter-spacing: .4px; animation: blinkred 1s ease-in-out infinite; }
.nm .r1 { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.nm .rg { font-size: 13px; font-weight: 800; color: #fff; }
.nm a.w { background: var(--green); color: #fff; font-size: 9.5px; font-weight: 800; border-radius: 999px;
          padding: 1px 8px; text-decoration: none; }
.nm .r2 { font-size: 11px; color: #fff; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes ncpulse { 0%,100% { box-shadow: 0 0 0 rgba(255,59,48,0); } 50% { box-shadow: 0 0 12px rgba(255,59,48,.6); } }
@keyframes blinkred { 0%,100% { opacity: 1; } 50% { opacity: .15; } }

/* arrivals / departures boxes */
.box { border: 2px solid #48484a; border-radius: 18px; overflow: hidden; background: var(--nightcard); margin-top: 8px; }
.box .bh { padding: 9px 12px; font-weight: 800; font-size: 16px; color: var(--red); background: #000;
           border-bottom: 1px solid #3a3a3c; }
table.xl { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 11.5px; color: #fff; }
table.xl th { background: var(--nightline); color: #ff453a; text-align: left; padding: 6px 3px; font-size: 10.5px; font-weight: 800; }
table.xl td { padding: 6px 3px 2px; border-bottom: 1px solid var(--nightline); vertical-align: middle;
              overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.xl td.reg a { font-weight: 800; color: #fff; text-decoration: none; }
table.xl tr.main td { border-bottom: none; }
table.xl .c-ac { width: 20%; } table.xl .c-fl { width: 15%; } table.xl .c-pl { width: 11%; }
table.xl .c-dt { width: 13%; } table.xl .c-t { width: 11%; } table.xl .c-st { width: 19%; }
td.stc { white-space: normal !important; line-height: 1.25; }
.st { font-weight: 800; display: block; }
.s-good { color: #30d158; } .s-info { color: var(--blue); } .s-warn { color: #ff9f0a; } .s-bad { color: #ff453a; }
.blink { color: #ff453a; font-weight: 800; animation: blinkred 1s ease-in-out infinite; }
.empty { padding: 14px 12px; color: var(--muted); font-size: 13px; }
.note { color: var(--muted); font-size: 11px; margin: 6px 4px 0; }

/* moving aircraft line under each arrival */
tr.trkrow td { padding: 0 8px 8px !important; border-bottom: 1px solid var(--nightline); }
.trk { display: flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 800; }
.trk .ta { color: var(--muted); } .trk .te { color: #ff453a; }
.trk .ln { position: relative; flex: 1; height: 22px; }
.trk .ln:before { content: ""; position: absolute; left: 0; right: 0; top: 15px; height: 3px; background: #5c2410; border-radius: 3px; }
.trk .dn { position: absolute; left: 0; top: 15px; height: 3px; background: #ff5a1f; border-radius: 3px; }
.trk .pl { position: absolute; top: 0; transform: translateX(-50%); text-align: center; white-space: nowrap; }
.trk .pl b { display: block; font-size: 9px; color: #ff7a45; line-height: 9px; }
.trk .pl span { font-size: 15px; line-height: 14px; display: inline-block; transform: rotate(45deg); }

/* fleet page */
.fleet .row { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--nightline); font-size: 13px; }
.fleet .row b { color: #fff; } .fleet .row span { color: #d1d1d6; text-align: right; }

/* ---------- light part ---------- */
#light { padding: 6px 12px 0; }
h2.sec { color: #f2602b; font-size: 18px; margin: 18px 2px 8px; }
.gx { background: var(--card); border-radius: 12px; padding: 9px 12px; margin-bottom: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.gx .t { display: flex; align-items: center; gap: 8px; }
.gx .rg { font-size: 15px; font-weight: 800; width: 72px; flex: none; }
.gx .sm { font-size: 13px; color: #3c3c43; font-weight: 600; flex: 1; white-space: nowrap; }
.gx .big { font-size: 14.5px; font-weight: 800; white-space: nowrap; }
.gx.now .big { color: var(--red); } .gx.wait .big { color: var(--muted); }
.gx .bar { height: 7px; border-radius: 4px; background: #e5e5ea; margin-top: 6px; overflow: hidden; }
.gx .bar i { display: block; height: 100%; border-radius: 4px; background: var(--orange); }
.lnote { color: var(--muted); font-size: 11.5px; margin: 4px 2px; }

.dayrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 12px 0 4px; }
.dayrow span { font-size: 13px; font-weight: 700; }
.btn { border: 0; border-radius: 999px; padding: 8px 16px; font-weight: 800; font-size: 14px; background: #e5e5ea; color: #000; }
.btn.red { background: var(--red); color: #fff; }
.btn.green { background: var(--green); color: #fff; }

/* tonight's grounded (night sky) */
.gl { position: relative; overflow: hidden; border-radius: 22px; padding: 14px 16px; color: #fff; margin-top: 12px;
      background: linear-gradient(160deg, #0b1036, #1b1446 60%, #2a1650); }
.gl .gltitle { color: #ffd60a; font-weight: 800; font-size: 17px; margin-bottom: 6px; position: relative; }
.gl .moon { position: absolute; right: 14px; top: 10px; font-size: 22px; }
.gl .gr { position: relative; display: flex; justify-content: space-between; gap: 8px; padding: 8px 0;
          border-top: 1px solid rgba(255,255,255,.15); font-size: 13px; }
.gl .gr b { color: #fff; } .gl .gr span { color: #c7c7ff; text-align: right; }
.star { position: absolute; border-radius: 50%; background: #fff; animation: twinkle 2s ease-in-out infinite; }
@keyframes twinkle { 0%,100% { opacity: .15; } 50% { opacity: 1; } }

.okbox, .chg { background: var(--card); border-radius: 14px; padding: 12px 14px; font-size: 14px; margin-bottom: 6px; }
.chg { border-left: 4px solid var(--red); }
.chg .when { color: var(--muted); font-size: 12px; }

/* developed by Brij */
.credit { text-align: center; margin: 26px 0 6px; }
.credit-line { width: 60px; height: 3px; border-radius: 3px; margin: 0 auto 12px;
               background: linear-gradient(90deg, #ff3b30, #ff9500); }
.credit-text { font-size: 22px; font-weight: 900; letter-spacing: .3px; color: #1c1c1e; }
.credit-text span { background: linear-gradient(90deg, #ff3b30, #ff9500); -webkit-background-clip: text;
                    background-clip: text; color: transparent; font-size: 26px; }
.credit-sub { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin-top: 4px; }

/* settings */
details.set { background: var(--card); border-radius: 14px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
details.set summary { padding: 13px 14px; font-weight: 700; font-size: 15px; list-style: none; cursor: pointer; }
details.set summary::-webkit-details-marker { display: none; }
details.set summary:after { content: "›"; float: right; color: var(--muted); font-size: 18px; line-height: 15px; }
details.set[open] summary:after { content: "⌄"; }
.setbody { padding: 0 14px 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--orange); color: #fff; font-weight: 800;
        font-size: 13px; border-radius: 999px; padding: 5px 6px 5px 11px; }
.chip button { border: 0; background: rgba(255,255,255,.25); color: #fff; border-radius: 50%; width: 20px; height: 20px;
               font-weight: 900; font-size: 12px; line-height: 20px; padding: 0; }
.addrow { display: flex; gap: 6px; }
.addrow input, .sheet input { flex: 1; min-width: 0; font-size: 16px; padding: 9px 12px; border-radius: 12px; border: 1px solid #d1d1d6; }
.sug { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.sug button { text-align: left; border: 0; background: #f2f2f7; border-radius: 10px; padding: 8px 10px; font-size: 13.5px; }
.hint { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.help ol { padding-left: 20px; margin: 0; font-size: 14px; } .help li { margin-bottom: 4px; }
.rec { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.recdot { width: 12px; height: 12px; border-radius: 50%; background: var(--red); animation: blinkred 1s infinite; }
.radio { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.radio button.on { background: #000; color: #fff; }
audio { width: 100%; margin: 6px 0; }

#status { text-align: center; color: var(--muted); font-size: 12.5px; margin: 18px 0 8px; }
#status .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 4px 0 10px; }
.dot.ok { background: var(--green); } .dot.fail { background: var(--red); } .dot.idle { background: #c7c7cc; }
.online { display: block; margin: 8px auto; border: 0; background: #fff; border-radius: 999px; padding: 9px 18px;
          font-weight: 800; font-size: 15px; box-shadow: 0 1px 4px rgba(0,0,0,.12); color: #000; }

/* voice chip: sits in the top bar, never covers anything */
.titlerow { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#chip { padding: 5px 10px; border-radius: 999px; font: 700 11.5px -apple-system, system-ui, Arial, sans-serif;
        white-space: nowrap; flex: none; }
#chip.on { background: #16a34a; color: #fff; } #chip.off { background: #fed7aa; color: #1c1917; }

/* bottom sheet (password, online list) */
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100; display: flex; align-items: flex-end; }
.sheet.hidden { display: none; }
.sheetbox { background: #fff; width: 100%; border-radius: 20px 20px 0 0; padding: 18px 16px calc(env(safe-area-inset-bottom) + 18px);
            max-height: 80vh; overflow-y: auto; }
.sheetbox h3 { margin: 0 0 10px; }
.sheetbox .rowb { display: flex; gap: 8px; margin-top: 12px; }
.err { color: var(--red); font-weight: 700; font-size: 13px; margin-top: 8px; }
