/* Panel look, shared by the panel (index.html) and the phone sign-in page (login.html). */
/* One page for the Mac and the phone (redesign, Chris 2026-10-14). Apple look: system font, one blue accent,
   colour only for state (green = on/working, red = live/over/denied, orange = waiting, grey = off).
   Wide screens: tabs at the top. Phones: a tab bar at the bottom, like Apple's own apps. */
:root {
  --bg: #f2f2f7; --card: #ffffff; --fill: #e8e8ed; --fill2: #f2f2f7; --line: #dcdce1;
  --text: #1c1c1e; --text2: #6c6c70;
  --blue: #0064d6; --blue-soft: #e1ecfb;
  --green: #1d7f37; --green-btn: #1f8b3c; --green-soft: #e0f2e5;
  --red: #c8102e; --red-btn: #d32f2f; --red-soft: #fbe4e6;
  --orange: #b25400; --orange-soft: #fcebd8;
  --bar: rgba(242, 242, 247, .82); --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 1px 1px rgba(0, 0, 0, .04);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #000000; --card: #1c1c1e; --fill: #2c2c2e; --fill2: #232325; --line: #38383a;
  --text: #f2f2f7; --text2: #98989f;
  --blue: #4ea1ff; --blue-soft: #0f2c4f;
  --green: #4cd068; --green-btn: #23883f; --green-soft: #12351d;
  --red: #ff6961; --red-btn: #d0352c; --red-soft: #45191a;
  --orange: #ffb340; --orange-soft: #43300f;
  --bar: rgba(22, 22, 24, .8); --shadow: none;
  color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #000000; --card: #1c1c1e; --fill: #2c2c2e; --fill2: #232325; --line: #38383a;
  --text: #f2f2f7; --text2: #98989f;
  --blue: #4ea1ff; --blue-soft: #0f2c4f;
  --green: #4cd068; --green-btn: #23883f; --green-soft: #12351d;
  --red: #ff6961; --red-btn: #d0352c; --red-soft: #45191a;
  --orange: #ffb340; --orange-soft: #43300f;
  --bar: rgba(22, 22, 24, .8); --shadow: none;
  color-scheme: dark }

* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.4 var(--font); -webkit-font-smoothing: antialiased }
button, input, select { font: inherit; color: inherit }
.num, time, .t { font-variant-numeric: tabular-nums }
.wrap { max-width: 980px; margin: 0 auto; padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)) }

/* Frosted header: name, status pills, tabs (wide screens) */
.top { position: sticky; top: 0; z-index: 20; background: var(--bar); -webkit-backdrop-filter: saturate(1.8) blur(18px); backdrop-filter: saturate(1.8) blur(18px);
  border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top) }
.top .wrap { display: grid; gap: 8px; padding-block: 10px }
.title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px }
.title h1 { margin: 0; font-size: 22px; letter-spacing: -.02em }
.pills { display: flex; flex-wrap: wrap; gap: 6px }
.pill { display: inline-flex; align-items: baseline; gap: 5px; background: var(--card); border-radius: 999px; padding: 3px 10px; font-size: 13px; box-shadow: var(--shadow); white-space: nowrap; border: 0 }
.pill b { font-size: 11px; letter-spacing: .06em; font-weight: 700 }
button.pill { cursor: pointer }
.k-g { color: var(--green) } .k-r { color: var(--red) } .k-o { color: var(--orange) } .k-b { color: var(--blue) } .k-2 { color: var(--text2) }
.tabs { display: flex; gap: 4px }
.tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font-weight: 600; color: var(--text2); cursor: pointer }
.tabs button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow) }
.tabs button .count, .tabbar .count { font-weight: 500; color: var(--text2); margin-left: 4px }

/* Bottom tab bar (phones) */
.tabbar { display: none; position: fixed; inset: auto 0 0 0; z-index: 20; background: var(--bar); -webkit-backdrop-filter: saturate(1.8) blur(18px); backdrop-filter: saturate(1.8) blur(18px);
  border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); grid-template-columns: repeat(4, 1fr) }
.tabbar.five { grid-template-columns: repeat(5, 1fr) }
.tabbar button { border: 0; background: none; display: grid; justify-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--text2); padding: 4px 0; cursor: pointer }
.tabbar button.on { color: var(--blue) }
.tabbar svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round }

@media (prefers-reduced-motion: no-preference) {
  section.tab.slide-l { animation: swL .22s ease-out } section.tab.slide-r { animation: swR .22s ease-out }
  @keyframes swL { from { opacity: 0; transform: translateX(40px) } to { opacity: 1; transform: none } }
  @keyframes swR { from { opacity: 0; transform: translateX(-40px) } to { opacity: 1; transform: none } }
}
main { padding-block: 16px 40px }
section.tab { display: none; gap: 14px }
section.tab.show { display: grid }
.card { background: var(--card); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); min-width: 0 }
.card h2 { margin: 0; font-size: 17px }
.sub { font-size: 13px; color: var(--text2) }
.row-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: space-between }
.gap { display: flex; flex-wrap: wrap; gap: 6px; align-items: center }

/* Buttons: same control looks the same everywhere; on/off and choices are buttons */
.btn { border: 0; border-radius: 9px; padding: 7px 13px; min-height: 34px; font-weight: 600; font-size: 14px; background: var(--fill); color: var(--text); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px }
.btn:disabled { opacity: .45; cursor: default }
.btn { transition: transform .08s, filter .08s }
.btn:active:not(:disabled) { transform: scale(.96); filter: brightness(.88) } /* pressed look: every button gives feedback (Chris, 2026-10-21) */
.btn.connecting:disabled { opacity: 1; cursor: progress; animation: sgPulse 1.1s ease-in-out infinite }
@keyframes sgPulse { 50% { filter: brightness(.8) } }
.btn.green { background: var(--green-btn); color: #fff }
.btn.red { background: var(--red-btn); color: #fff }
.btn.redsoft { background: var(--red-soft); color: var(--red) }
.btn.blue { background: var(--blue); color: #fff }
.btn.ghost { background: transparent; color: var(--blue); padding-inline: 6px }
.btn.sm { min-height: 28px; padding: 4px 10px; font-size: 13px; border-radius: 8px }
.btn.x { min-height: 28px; width: 30px; padding: 0; color: var(--text2); font-size: 13px; background: var(--fill2) }
.btn:focus-visible, .tabs button:focus-visible, .tabbar button:focus-visible, .seg button:focus-visible, .f:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px }
.seg { display: inline-flex; background: var(--fill); border-radius: 9px; padding: 2px; gap: 2px }
.seg button { border: 0; background: transparent; border-radius: 7px; padding: 5px 12px; font-weight: 600; font-size: 13.5px; color: var(--text2); cursor: pointer; white-space: nowrap }
.seg button.on { background: var(--blue); color: #fff }
.seg button.on.live { background: var(--red-btn) }
#tab-settings .seg button.on, #tab-settings .seg button.on.live { background: var(--green-btn); color: #fff }
.f { border: 0; border-radius: 999px; padding: 4px 11px; font-size: 13px; font-weight: 600; background: var(--fill); color: var(--text); cursor: pointer; white-space: nowrap }
.f.on { background: var(--blue); color: #fff }
.f .c { opacity: .7; margin-left: 3px; font-weight: 500 }
.flabel { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text2); min-width: 46px }
.spin { width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block }
@media (prefers-reduced-motion: no-preference) { .spin { animation: spin .8s linear infinite } @keyframes spin { to { transform: rotate(360deg) } } }

/* Logs */
.logrow { display: grid; grid-template-columns: 5.4em minmax(0, 1fr); gap: 10px; padding: 7px 2px; border-top: 1px solid var(--line); font-size: 14px }
.logrow:first-child { border-top: 0 }
.logrow time { color: var(--text2); font-size: 13px }
.logrow .ok { color: var(--green); font-weight: 600 } .logrow .bad { color: var(--red); font-weight: 600 }
.nooncard { background: var(--card); box-shadow: var(--shadow); border-radius: 12px; padding: 10px 14px; display: grid; gap: 3px; font-size: 14px }
.nooncard b { font-size: 15px }

/* Settings */
.group h3 { margin: 6px 4px 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text2) }
.set { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--line) }
.set:first-child { border-top: 0 }
.set[hidden] { display: none }
.set > span:first-child { font-weight: 500 }
.set .ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; justify-content: flex-end }
.set input[type=number] { width: 64px } .set input[type=text] { width: 170px }
.onoff { min-width: 62px }
.hint { font-size: 12.5px; color: var(--text2); flex-basis: 100% }

#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40; max-width: min(92vw, 520px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 500; box-shadow: 0 6px 24px rgba(0, 0, 0, .25) }
#toast.err { background: var(--red-btn); color: #fff }

@media (max-width: 720px) {
  .top { position: static }
  .pills { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px }
  .top .tabs { display: none }
  .tabbar { display: grid }
  main { padding-bottom: calc(96px + env(safe-area-inset-bottom)) }
  #toast { bottom: calc(84px + env(safe-area-inset-bottom)) }
  .title h1 { font-size: 20px }
  .spec .head { grid-template-columns: 22px 22px minmax(0, 1fr); row-gap: 6px }
  .spec .btns { grid-column: 3; justify-content: center }
  .editor { padding-left: 0 }
}
/* Midnight look (Chris, 2026-10-23): navy cards, orange header band, mint = on/done. Same screens and colour rules as Classic
   (green = on/done, blue = info/today, red = can't/over); orange is only the header band and the active tab. Settings > Look switches back. */
:root[data-look="midnight"] {
  --bg: #070b22; --card: #121a45; --fill: #1b2660; --fill2: #1b2660; --line: #222d6a; --sep: #222d6a;
  --text: #ffffff; --text2: #a3b3ec;
  --blue: #5aa2ff; --blue-soft: #14306e;
  --green: #3de6a6; --green-btn: #3de6a6; --green-soft: #123b3a;
  --red: #ff8a8a; --red-btn: #ff8a8a; --red-soft: #4a1a2a;
  --orange: #ffb340; --orange-soft: #43300f;
  --bar: rgba(8, 12, 36, .96); --shadow: none;
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  color-scheme: dark }
/* Header band colour (Settings > Header): orange (default), green or blue, per device (Chris, 2026-11-14) */
:root[data-look="midnight"] { --bar-bg: #ff9f0a; --bar-ink: #1d1300; --bar-ink2: #4a2e00 }
:root[data-look="midnight"][data-bar="green"] { --bar-bg: #3de6a6; --bar-ink: #04251a; --bar-ink2: #0b4a35 }
:root[data-look="midnight"][data-bar="blue"] { --bar-bg: #5aa2ff; --bar-ink: #04152e; --bar-ink2: #0f3a73 }
[data-look="midnight"] .top { background: var(--bar-bg); border-bottom: 0; -webkit-backdrop-filter: none; backdrop-filter: none }
[data-look="midnight"] .title h1 { color: var(--bar-ink); font-size: 26px; font-weight: 800 }
[data-look="midnight"] .top .title .sub { color: var(--bar-ink2) }
[data-look="midnight"] .pill { background: #11163b; color: #fff; box-shadow: none }
[data-look="midnight"] .tabs button { color: var(--bar-ink2); font-weight: 700 }
[data-look="midnight"] .tabs button .count { color: inherit }
[data-look="midnight"] .tabs button.on { background: #11163b; color: var(--bar-bg); box-shadow: none }
[data-look="midnight"] .tabbar button.on { color: var(--bar-bg) }
[data-look="midnight"] .tabbar button { font-weight: 700 }
[data-look="midnight"] .card { border-radius: 20px }
[data-look="midnight"] .btn { border-radius: 12px; font-weight: 700 }
[data-look="midnight"] .btn.sm { border-radius: 10px }
[data-look="midnight"] .seg { border-radius: 14px; padding: 3px }
[data-look="midnight"] .seg button { border-radius: 11px; font-weight: 700 }
[data-look="midnight"] .findrow .go { font-weight: 800; border-radius: 16px; min-height: 52px }
[data-look="midnight"] .dbtn { border-radius: 12px }
[data-look="midnight"] .ckc { border-radius: 14px }
/* Text on the bright fills is dark (like the mockups): blue/info first, then green, then red */
[data-look="midnight"] :is(.btn.blue, .seg button.on, .f.on, .days button.on, .ckday, .ckdate .today-btn) { color: #04152e }
[data-look="midnight"] :is(.btn.green, #tab-settings .seg button.on, .setup li.done .ck, .ckday.other, .ckdate .today-btn.other) { color: #052b1d }
[data-look="midnight"] :is(.btn.red, .seg button.on.live, #tab-settings .seg button.on.live, #toast.err) { color: #330606 }
[data-look="midnight"] #themeRow { display: none } /* Midnight is always dark */

/* PriceGraber additions */
.frow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center } /* buttons centered, never left (Chris, 2026-10-31) */
.fgroup .flabel { text-align: center }
h2.sect { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text2); text-align: center; margin: 10px 0 0 }
.deal { display: grid; gap: 6px }
.deal { box-shadow: inset 0 0 0 2px var(--blue) } /* every route card: blue; great deals green (Chris, 2026-11-02) */
.deal.great { box-shadow: inset 0 0 0 2px var(--green) }
.deal .btns { display: flex; justify-content: center }
.fgroup { display: grid; gap: 6px }
.hint { font-size: 12.5px; color: var(--text2) }
.empty { text-align: center; padding: 22px 10px; display: grid; gap: 4px; color: var(--text2) }
.empty b { color: var(--text); font-size: 16px }
.note { border-radius: 10px; padding: 8px 12px; font-size: 14px; background: var(--orange-soft); color: var(--text) }
.note.bad { background: var(--red-soft) }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--fill); border-radius: 999px; padding: 3px 4px 3px 10px; font-size: 13px; font-weight: 600 }
.chip button { border: 0; background: transparent; color: var(--text2); cursor: pointer; font-size: 14px; padding: 0 6px }
.chip.plain { padding: 1px 9px; font-size: 12px }
.chip.blue { background: var(--blue-soft); color: var(--blue) } .chip.green { background: var(--green-soft); color: var(--green) }
.chip.red { background: var(--red-soft); color: var(--red) } .chip.orange { background: var(--orange-soft); color: var(--orange) }
/* Flights */
.trip { display: grid; gap: 6px }
.trip .route { font-weight: 700; font-size: 17px }
.total { font-weight: 700; font-size: 17px; border-radius: 8px; padding: 2px 9px }
.total.low { color: var(--green); background: var(--green-soft) } .total.high { color: var(--red); background: var(--red-soft) }
.btn.book { background: var(--green-btn); color: #fff; text-decoration: none }
.dir { margin-top: 6px } .dir h3 { margin: 0 0 2px; font-size: 13px; color: var(--text2) }
.fl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 7px 0; border-top: 1px solid var(--line) }
.fl .price { text-align: right; font-weight: 600 }
.fl .none { color: var(--text2); font-weight: 400 }
/* Preferred Flights */
.spec { border-top: 1px solid var(--line) } .spec:first-child { border-top: 0 }
.spec .head { display: grid; grid-template-columns: 26px 24px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 10px 2px }
.grip { cursor: grab; color: var(--text2); font-size: 18px; text-align: center; touch-action: none; user-select: none; -webkit-user-select: none; padding: 6px 0 }
.spec .n { font-size: 12.5px; font-weight: 700; color: var(--blue) }
.spec .main { cursor: pointer; min-width: 0 } .spec .main b { display: block }
.spec .btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center }
.spec.dragging { opacity: .5 }
.editor { display: grid; gap: 12px; padding: 4px 2px 14px 34px }
.field { display: grid; gap: 4px }
.field > label, .flabel { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text2) }
.field input[type=text], .field input[type=date], .field input[type=number] { border: 1px solid var(--line); background: var(--fill2); color: var(--text); border-radius: 9px; padding: 7px 10px; min-height: 34px; max-width: 260px }
.field input[type=number] { width: 90px }
.codes { display: flex; flex-wrap: wrap; gap: 6px; align-items: center }
.codes input { width: 150px }
/* Logs / Settings */
.logrow { display: grid; grid-template-columns: 6.2em minmax(0, 1fr); gap: 10px; padding: 7px 2px; border-top: 1px solid var(--line); font-size: 14px }
.logrow:first-child { border-top: 0 }
.logrow time { color: var(--text2); font-size: 13px }
.logrow .ok { color: var(--green); font-weight: 600 } .logrow .bad { color: var(--red); font-weight: 600 }
.logq { width: 100%; border: 1px solid var(--line); background: var(--fill2); color: var(--text); border-radius: 9px; padding: 7px 10px; min-height: 34px }
.set input[type=number] { width: 80px } .set input[type=text] { width: 190px }
.set input { border: 1px solid var(--line); background: var(--fill2); color: var(--text); border-radius: 9px; padding: 6px 10px; min-height: 34px }
.seg.wrap { flex-wrap: wrap }
.bo .dates { display: flex; flex-wrap: wrap; align-items: center; gap: 6px }
.set.bo input[type=text] { width: 170px }
.bo input[type=date], #passFrom, #passUntil { width: 136px; padding-inline: 8px }
@media (max-width: 720px) { .set.bo input[type=text] { flex: 1 1 100% } }
.bo.past { opacity: .55 }
/* Best deals: one card per route, days open under it (2026-11-01) */
.total.plain { color: var(--text); background: transparent; padding-inline: 0 }
.total .sub { font-weight: 400 }
.dhead { display: grid; gap: 6px; cursor: pointer }
.ddays { display: grid }
.dday { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line) }
.dprice { display: flex; align-items: center; gap: 10px; font-weight: 700 }
.dprice .good { color: var(--green) }
.strips { display: grid; gap: 10px; padding: 8px 0 12px }
.frow.strip { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 4px; scrollbar-width: thin } /* long airport list: one sideways-scrolling row */
.frow.strip > * { flex: none }
.dday.via { grid-template-columns: minmax(0, 1fr) }
.dday.via .dprice { flex-wrap: wrap; justify-content: center }

/* Stays tab (2026-11-02): one row per place: photo, details, price + link */
.stay { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line) }
.stay img, .stay .noimg { width: 64px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--line); display: grid; place-items: center; font-size: 22px }
.stay .sinfo { min-width: 0; display: grid; gap: 1px }
.stay .sinfo b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.sprice { display: grid; justify-items: end; gap: 3px; font-weight: 700 }
.sprice .good { color: var(--green) }
.sprice > * { white-space: nowrap }
@media (max-width: 520px) { .stay { grid-template-columns: 52px minmax(0, 1fr) } .stay img, .stay .noimg { width: 52px; height: 40px } .sprice { grid-column: 2; justify-items: start; grid-auto-flow: column; align-items: center } }
