/* LUX* colours, taken from luxresorts.com:
   charcoal #303030 · black · white · sand #EDE6E1 · cream #F7F3F0 · grey #707372 · accent orange #CB6015 */
:root {
  --accent: #cb6015;         /* LUX* orange, used sparingly: active tab, unread dots, highlights */
  --charcoal: #303030;
  --sand: #ede6e1;
  --sand-line: #d9d0c8;

  --bg: #f7f3f0;             /* cream */
  --surface: #ffffff;
  --surface-2: #ede6e1;      /* sand */
  --text: #303030;
  --muted: #707372;
  --line: #e2dad3;
  --brand: #303030;          /* charcoal buttons */
  --brand-strong: #000000;
  --brand-soft: #ede6e1;
  --on-brand: #ffffff;       /* text on brand-coloured buttons */
  --topbar: #000000;
  --topbar-2: #1f1f1f;
  --ok: #2e7d57;
  --warn: #a8650f;
  --danger: #b3261e;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(48, 48, 48, .05), 0 6px 18px rgba(48, 48, 48, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {:root:not([data-theme="light"]) {
    --bg: #121212;
    --surface: #1c1c1b;
    --surface-2: #272523;
    --text: #f2eeea;
    --muted: #a8a49f;
    --line: #3a3733;
    --brand: #ede6e1;          /* sand buttons with dark text */
    --brand-strong: #ffffff;
    --brand-soft: #2f2b27;
    --on-brand: #121212;
    --accent: #e0772f;
    --topbar: #000000;
    --topbar-2: #161616;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #121212;
    --surface: #1c1c1b;
    --surface-2: #272523;
    --text: #f2eeea;
    --muted: #a8a49f;
    --line: #3a3733;
    --brand: #ede6e1;          /* sand buttons with dark text */
    --brand-strong: #ffffff;
    --brand-soft: #2f2b27;
    --on-brand: #121212;
    --accent: #e0772f;
    --topbar: #000000;
    --topbar-2: #161616;
    --shadow: none;
    color-scheme: dark;
  }

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
h1, h2, h3 { line-height: 1.2; margin: 0; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1.05rem; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
a { color: var(--brand); }

/* ---- Header & tabs ---- */
.topbar {
  position: sticky; top: 0; z-index: 1001;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 8px;
  background: var(--topbar); color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; min-width: 0; }
.brand span { white-space: nowrap; }
.brand img { height: 26px; width: auto; display: block; }
.brand span { padding-left: 10px; border-left: 1px solid rgba(255,255,255,.35); line-height: 1.2; }
.brand svg { width: 28px; height: 28px; color: var(--accent); }
.who.active { box-shadow: 0 2px 0 var(--accent); }
.who { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: #fff; text-decoration: none; min-width: 0; }
#whoName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 28vw; }

/* Menu: a button top left that opens the list of sections */
.brand { margin-right: auto; }
.menubtn {
  display: flex; align-items: center; gap: 8px; flex: none;
  background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.2);
  border-radius: 10px; padding: 7px 12px 7px 9px; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer;
}
.menubtn:hover { background: rgba(255,255,255,.16); }
.menubtn svg { width: 20px; height: 20px; }
.menubtn[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); }
.menubtn .badge { box-shadow: 0 0 0 2px var(--topbar); }
.navscrim { position: fixed; inset: 0; z-index: 1002; background: rgba(0,0,0,.35); }
.nav {
  position: fixed; z-index: 1003; left: 12px; top: calc(56px + env(safe-area-inset-top, 0px));
  width: min(280px, calc(100vw - 24px)); padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
}
.nav[hidden] { display: none; }
.nav a {
  display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-weight: 600;
  padding: 12px 14px; border-radius: 10px; position: relative;
}
.nav a[hidden] { display: none; }
.nav a:hover { background: var(--surface-2, rgba(127,127,127,.1)); }
.nav a.active { background: var(--accent); color: #fff; }
.nav .ni { width: 22px; text-align: center; font-size: 1.05rem; }
.badge {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  font-size: 0; vertical-align: top; margin-left: 2px; box-shadow: 0 0 0 2px var(--topbar-2);
}

main { max-width: 900px; margin: 0 auto; padding: 20px 16px 60px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px;
}

/* ---- Auth ---- */
.auth { display: grid; gap: 20px; }
.hero h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); margin-bottom: 8px; }
.hero h1::after { content: ""; display: block; width: 56px; height: 4px; background: var(--accent); border-radius: 2px; margin-top: 12px; }
.hero p { color: var(--muted); max-width: 60ch; margin: 0; }
.authcard { max-width: 440px; width: 100%; }
.authcard h2 { margin-bottom: 6px; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 10px; margin-bottom: 16px; }
.tab { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 8px; font-weight: 600; color: var(--muted); }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.code { font-size: 1.4rem; letter-spacing: .4em; text-align: center; }

/* ---- Forms ---- */
.stack { display: grid; gap: 12px; }
.stack.tight { gap: 4px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.grid .wide { grid-column: 1 / -1; }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }
label { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }
label small, .hint { font-weight: 400; color: var(--muted); font-size: .82rem; margin: 0; }
.opt { font-weight: 400; color: var(--muted); }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); min-height: 42px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
button, .button {
  cursor: pointer; border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 10px; padding: 9px 14px; font-weight: 600; min-height: 42px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
button:hover, .button:hover { border-color: var(--sand-line); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary, .button.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
button.primary:hover { background: var(--brand-strong); }
button.link { background: none; border: 0; padding: 4px 0; min-height: 0; color: var(--brand); font-weight: 600; }
button.left { justify-self: start; }
button.small, .button.small { padding: 6px 10px; min-height: 34px; font-size: .85rem; }
button.warn { color: var(--warn); }
button.danger, .link.danger { color: var(--danger); }
button.armed { background: var(--danger); border-color: var(--danger); color: #fff; }
.wide-btn { width: 100%; }
.filebtn { font-size: .85rem; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row input { flex: 1; min-width: 140px; }
.row.spread { justify-content: space-between; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0; }
legend { font-weight: 600; font-size: .9rem; padding: 0 4px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.checks label { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.checks input { width: auto; min-height: 0; accent-color: var(--brand); }
.switch { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-weight: 500; }
.switch input { width: 18px; height: 18px; min-height: 0; margin-top: 2px; accent-color: var(--brand); flex: none; }
.switch span { display: grid; gap: 2px; }
.error { color: var(--danger); font-size: .88rem; margin: 6px 0 0; }
.error:empty { display: none; }
.ok { color: var(--ok); font-weight: 600; font-size: .9rem; }

.testmode {
  background: #fff6e0; color: #6b4a00; border: 1px solid #f1d58e; border-radius: 10px;
  padding: 10px 14px; font-size: .88rem; margin-bottom: 16px;
}
@media (prefers-color-scheme: dark) {:root:not([data-theme="light"]) .testmode { background: #2b2410; color: #f3d98e; border-color: #5a4a1c; } }
:root[data-theme="dark"] .testmode { background: #2b2410; color: #f3d98e; border-color: #5a4a1c; }

details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details.card > summary h2::after { content: " ▾"; color: var(--muted); font-size: .8em; }
details.card:not([open]) > summary h2::after { content: " ▸"; }

.addplace { background: var(--surface-2); border-radius: 10px; padding: 12px; display: grid; gap: 8px; }
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.results li button { width: 100%; justify-content: flex-start; text-align: left; font-weight: 500; background: var(--surface); }
.map { height: 260px; border-radius: 10px; border: 1px solid var(--line); z-index: 0; }

.listhead { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 24px 2px 10px; }
.listhead.tight { margin: 0 0 12px; }
.listhead .muted { font-size: .82rem; }
.listhead + .hint { margin: -4px 2px 12px; }
.watchlist { display: grid; gap: 14px; }
.empty { text-align: center; color: var(--muted); padding: 28px 16px; margin: 0; }
.filters { display: flex; gap: 6px; }
.chip { min-height: 32px; padding: 4px 12px; border-radius: 999px; font-size: .85rem; }
.chip.active { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

/* ---- Avatars ---- */
.avatar {
  --s: 36px; width: var(--s); height: var(--s); border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
  color: #fff; font-weight: 700; font-size: calc(var(--s) * .38); background: var(--charcoal);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { --s: 26px; }
.avatar.lg { --s: 64px; }
.avatar.xl { --s: 88px; }
.avatarrow { display: flex; align-items: center; gap: 16px; }

/* ---- Watch cards ---- */
.watch { margin: 0; display: grid; gap: 14px; border-top: 3px solid var(--brand); }
.watch.archived { border-top-color: var(--sand-line); }
.whead { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.wmeta { font-size: .85rem; margin-top: 2px; }
.wowner { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); margin-top: 6px; }
.wowner:empty { display: none; }
.sharetag { background: var(--brand-soft); color: var(--brand-strong); border-radius: 999px; padding: 2px 8px; font-weight: 600; }
.pill {
  flex: none; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted);
}
.pill.assigned { background: #e7eef8; color: #2d5b8f; }
.pill.departed, .pill.approaching, .pill.transit { background: var(--brand-soft); color: var(--brand-strong); }
.pill.landed { background: #dff3e6; color: var(--ok); }
.pill.delayed { background: #fdf0d9; color: var(--warn); }
.pill.cancelled { background: #fbe3e0; color: var(--danger); }
@media (prefers-color-scheme: dark) {:root:not([data-theme="light"]) .pill.assigned { background: #1b2a3d; color: #8fb8e8; }:root:not([data-theme="light"]) .pill.landed { background: #12301f; color: #74d69c; }:root:not([data-theme="light"]) .pill.delayed { background: #3a2c0f; color: #f0c46b; }:root:not([data-theme="light"]) .pill.cancelled { background: #3a1612; color: #f19185; }
}
:root[data-theme="dark"] .pill.assigned { background: #1b2a3d; color: #8fb8e8; }:root[data-theme="dark"] .pill.landed { background: #12301f; color: #74d69c; }:root[data-theme="dark"] .pill.delayed { background: #3a2c0f; color: #f0c46b; }:root[data-theme="dark"] .pill.cancelled { background: #3a1612; color: #f19185; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; margin: 0; padding: 0; }
.steps li { position: relative; text-align: center; font-size: .78rem; color: var(--muted); padding-top: 22px; }
.steps li::before {
  content: ""; position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  width: 12px; height: 12px; border-radius: 50%; background: var(--line); z-index: 1;
}
.steps li::after { content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.steps li:first-child::after { display: none; }
.steps li.done { color: var(--text); font-weight: 600; }
.steps li.done::before, .steps li.done::after { background: var(--brand); }
.steps li.current::before { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 25%, transparent); }
.archived .steps li.done::before, .archived .steps li.done::after { background: var(--charcoal); }

.tailbox { display: grid; gap: 6px; }
.tailchip { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.05rem; }
.tailchip button { font-size: .82rem; }
.tailchip .ty { font-weight: 500; font-size: .85rem; }
.tailcheck {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: 10px; padding: 10px 12px;
  background: var(--surface-2);
}
.tailcheck.good { border-left-color: var(--ok); }
.tailcheck.badcheck { border-left-color: var(--danger); }
.tailcheck.good .tctitle { color: var(--ok); }
.tailcheck.badcheck .tctitle { color: var(--danger); }
.tcphoto { width: 96px; height: 64px; object-fit: cover; border-radius: 6px; flex: none; }
.tcbody { flex: 1; min-width: 200px; display: grid; gap: 2px; font-size: .88rem; }
.tcbody .tctitle { font-size: .95rem; }
.tclive { color: var(--muted); }
.tclive:empty { display: none; }
.live { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.live:empty { display: none; }
.stat { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; }
.stat b { display: block; font-size: 1.15rem; }
.stat span { font-size: .78rem; color: var(--muted); }
.live .note { grid-column: 1 / -1; font-size: .84rem; color: var(--muted); margin: 0; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.small-label { font-size: .8rem; margin-left: 6px; }
.notebox { background: var(--surface-2); padding: 8px; border-radius: 10px; }
.more summary { color: var(--brand); font-weight: 600; font-size: .9rem; }
.more[open] { display: grid; gap: 12px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .86rem; }
.timeline li { display: flex; gap: 10px; }
.timeline time { color: var(--muted); flex: none; width: 92px; }
.footer-actions { display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 12px; }

/* ---- WhatsApp message log ---- */
.outbox { margin-top: 24px; }
.msg { border-top: 1px solid var(--line); padding: 10px 0; display: grid; gap: 4px; }
.msg:first-child { border-top: 0; }
.msg pre {
  margin: 0; white-space: pre-wrap; font: inherit; background: #dcf8c6; color: #102a12;
  padding: 8px 12px; border-radius: 10px 10px 10px 2px; max-width: 480px;
}
@media (prefers-color-scheme: dark) {:root:not([data-theme="light"]) .msg pre { background: #1d4a2b; color: #e5f7e8; } }
:root[data-theme="dark"] .msg pre { background: #1d4a2b; color: #e5f7e8; }
.msg .meta { font-size: .76rem; color: var(--muted); }
.msg .meta .failed { color: var(--danger); }

.plane-icon { color: var(--accent); font-size: 22px; line-height: 1; text-shadow: 0 0 3px #fff; }

/* ---- Notifications / install ---- */
.notifycard { display: flex; gap: 14px; align-items: flex-start; border-left: 4px solid var(--brand); }
.notifyicon { font-size: 1.8rem; line-height: 1; }
.notifycard .stack { flex: 1; gap: 8px; }
.installsteps { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: .9rem; }
.shareicon { display: inline-block; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; font-size: .8rem; }
.devices { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .9rem; }
.devicesrow { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; }
.sources { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
#adminLiveBox .tablewrap { margin-bottom: 10px; }

/* ---- Chat ---- */
.chatcard { display: flex; flex-direction: column; height: calc(100dvh - 190px); min-height: 380px; padding: 0; overflow: hidden; margin: 0; }
.chathead { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.chathead .muted { font-size: .82rem; }
.chatlist { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.chatempty { margin: auto; }
.chatmsg { display: flex; gap: 8px; align-items: flex-end; max-width: 80%; }
.chatmsg.mine { align-self: flex-end; flex-direction: row-reverse; }
.bubble { background: var(--surface); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 8px 12px; min-width: 0; }
.mine .bubble { background: var(--brand); border-color: var(--brand); color: var(--on-brand); border-radius: 14px 14px 4px 14px; }
.bubble .who { font-size: .78rem; font-weight: 700; }
.bubble .who .muted { font-weight: 400; }
.mine .bubble .who, .mine .bubble .who .muted { color: inherit; opacity: .85; }
.bubble .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble .msgdel { font-size: .75rem; padding: 0; min-height: 0; margin-top: 2px; opacity: .8; }
.mine .msgdel { color: inherit; }
.admintag { background: var(--charcoal); color: #fff; font-size: .65rem; text-transform: uppercase; border-radius: 4px; padding: 1px 5px; margin-left: 6px; vertical-align: 1px; }
.chatform { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.chatform textarea { resize: none; min-height: 42px; max-height: 140px; }
.chatcard .error { padding: 0 12px 10px; }

/* ---- Profile ---- */
.profilecard h2 { font-size: 1.3rem; }

/* ---- Admin ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stats .stat { margin: 0; padding: 12px 14px; background: var(--surface); }
.stats .stat b { font-size: 1.5rem; color: var(--brand); }
.search { max-width: 280px; }
.tablewrap { overflow-x: auto; }
table.users { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 640px; }
.users th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.users td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.users tr.disabled td { opacity: .55; }
.usercell { display: flex; align-items: center; gap: 10px; }
.usercell .muted { font-size: .8rem; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-right: 4px; background: var(--surface-2); }
.tag.admin { background: var(--charcoal); color: #fff; }
.tag.ok { background: #dff3e6; color: var(--ok); }
.tag.warn { background: #fdf0d9; color: var(--warn); }
.tag.off { background: #fbe3e0; color: var(--danger); }

.dialog {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; width: min(480px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.dialog::backdrop { background: rgba(0, 0, 0, .45); }

@media (max-width: 560px) {
  .brand { font-size: .95rem; }
  .brand img { height: 22px; }
  .nav { top: calc(52px + env(safe-area-inset-top, 0px)); }
  .menubtn #menuLabel { display: none; }
  .menubtn { padding: 7px 9px; }
  .chatmsg { max-width: 92%; }
  .chatcard { height: calc(100dvh - 170px); }
}

/* ---- Header: theme button ---- */
.topright { display: flex; align-items: center; gap: 10px; min-width: 0; }
.iconbtn {
  min-height: 36px; width: 36px; padding: 0; border-radius: 50%; font-size: 1.05rem; line-height: 1;
  background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .25); color: #fff;
}
.iconbtn:hover { background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .45); }

/* ---- Sub-tabs (Seaplane Tracker: Watching now / History) ---- */
.subtabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 10px; margin-bottom: 16px; width: fit-content; max-width: 100%; }
.subtabs a { padding: 7px 14px; border-radius: 8px; font-weight: 600; color: var(--muted); text-decoration: none; font-size: .92rem; }
.subtabs a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---- Guests ---- */
.guestbar { display: grid; gap: 10px; }
.guestbar input[type="search"] { flex: 1; }
.datepick input[type="date"] { width: auto; min-width: 150px; }
.filebtn.busy { opacity: .6; pointer-events: none; }
.filebtn.busy::after { content: " · reading…"; }
.transferlist { display: grid; gap: 14px; }
.transfer { margin: 0; padding: 0; overflow: hidden; border-left: 4px solid var(--brand); }
.transfer.departure { border-left-color: var(--charcoal); }
.transfer.arrival { border-left-color: var(--accent); }
.thead { display: grid; gap: 4px; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.ttitle { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.tseq { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.ttime { font-size: 1.25rem; }
.tmode { font-weight: 600; }
.tailtag { font-weight: 700; background: var(--brand-soft); color: var(--brand-strong); border-radius: 999px; padding: 1px 9px; font-size: .85rem; }
.tailtag.tba { background: var(--surface); color: var(--muted); border: 1px dashed var(--line); }
.tmeta { font-size: .82rem; }
.tactions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.livepill { font-size: .8rem; font-weight: 600; text-decoration: none; padding: 5px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.livepill.departed, .livepill.approaching { border-color: var(--brand); color: var(--brand-strong); }
.livepill.landed { border-color: var(--ok); color: var(--ok); }
.livepill.delayed { border-color: var(--warn); color: var(--warn); }
.bookings { display: grid; }
.booking { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); align-items: start; }
.booking:first-child { border-top: 0; }
.booking.done { background: color-mix(in srgb, var(--ok) 7%, transparent); }
.booking.done .names, .booking.done .bchips { opacity: .7; }
.booking.st-no_show, .booking.st-cancelled { background: color-mix(in srgb, var(--danger) 6%, transparent); }
.villa { font-size: 1.35rem; font-weight: 800; line-height: 1.1; display: grid; }
.villa small { font-size: .72rem; font-weight: 600; color: var(--muted); }
.bmain { display: grid; gap: 5px; min-width: 0; }
.names { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.names span { color: var(--muted); font-size: .9rem; }
.bchips { display: flex; flex-wrap: wrap; gap: 4px; }
.bchip { font-size: .78rem; background: var(--surface-2); border-radius: 6px; padding: 2px 7px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.bchip i { font-style: normal; color: var(--muted); }
.bchip.care { background: var(--brand-soft); color: var(--brand-strong); font-weight: 700; }
.remarks { font-size: .85rem; white-space: pre-line; border-left: 3px solid var(--sand-line); padding-left: 8px; color: var(--text); }
.fonotes { font-size: .85rem; white-space: pre-line; background: #fff6e0; color: #6b4a00; border-radius: 6px; padding: 4px 8px; }
.bactions { display: grid; gap: 6px; justify-items: end; }
.statusbtn { white-space: nowrap; }
.statusbtn.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.addrow { margin-top: 18px; }
.uploadpreview { border-left: 4px solid var(--brand); }
.uploadpreview .previewdate { font-weight: 600; }
.uploadpreview .previewdate input { width: auto; }
.previewtable td { font-size: .82rem; vertical-align: top; }
.warnings { color: var(--warn); margin: 0; padding-left: 18px; }
.warnings:empty { display: none; }
.dialog.wide { width: min(720px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
.grid.g3 { grid-template-columns: repeat(3, 1fr); margin-top: 0; }
@media (max-width: 640px) {
  .grid.g3 { grid-template-columns: 1fr 1fr; }
  .booking { grid-template-columns: 52px 1fr; }
  .bactions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
  .villa { font-size: 1.15rem; }
}

@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fonotes { background: #2b2410; color: #f3d98e; } }
:root[data-theme="dark"] .fonotes { background: #2b2410; color: #f3d98e; }

/* ---- Rights (Admin → Manage user) ---- */
.rights { display: grid; gap: 8px; }
.rightslist { display: grid; gap: 6px; }
.rightslist label { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; }
.rightslist input { width: auto; min-height: 0; margin-top: 3px; accent-color: var(--brand); }
.rightspreset select { width: 100%; }
.checks.column { display: grid; gap: 6px; }

/* ---- Guests: status shown to users who can't change it ---- */
.statustag { font-size: .8rem; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.statustag.on { background: var(--ok); color: #fff; }
.chatreadonly { padding: 0 12px 12px; margin: 0; }

/* ---- Guests: no show ---- */
.noshowbtn { color: var(--danger); }
.noshowbtn.on { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: var(--danger); }
.noshowname { text-decoration: line-through; text-decoration-color: var(--danger); text-decoration-thickness: 2px; }
.noshowbox { font-size: .85rem; border-left: 3px solid var(--danger); background: color-mix(in srgb, var(--danger) 7%, transparent); padding: 6px 10px; border-radius: 0 6px 6px 0; display: grid; gap: 2px; }
.noshowbox b { color: var(--danger); }
.noshownote { white-space: pre-line; }

/* ---- Admin: data storage ---- */
.storagecard { border-left: 4px solid var(--ok); }
.storagecard.danger { border-left-color: var(--danger); }
.storagecard.danger b { color: var(--danger); }
.storagecard #storageStatus { margin-top: 6px; line-height: 1.6; overflow-wrap: anywhere; }

/* ---- Live map ---- */
.liveplane { color: var(--accent); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .4)); }
.liveplane div { width: 30px; height: 30px; transition: transform .6s ease; }
.mapinfo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .85rem; padding: 6px 2px 0; }
.mapinfo:empty { display: none; }
.livedot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.livedot.on { background: #22a35a; box-shadow: 0 0 0 0 rgba(34, 163, 90, .6); animation: livepulse 1.6s infinite; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(34, 163, 90, .55); } 70% { box-shadow: 0 0 0 8px rgba(34, 163, 90, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 163, 90, 0); } }

/* ---- Notifications tab ---- */
.notiflist { display: grid; gap: 10px; margin-top: 12px; }
.notifday { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 12px 2px 0; }
.notif { margin: 0; padding: 12px 16px; display: grid; gap: 4px; border-left: 4px solid var(--ok); }
.notif.warn { border-left-color: var(--sand-line); }
.notif.bad { border-left-color: var(--danger); }
.notifhead { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.notiftitle { font-size: .98rem; }
.notifbody { white-space: pre-line; font-size: .9rem; }
.notifwho summary { font-size: .82rem; color: var(--muted); cursor: pointer; }
.notifwho ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: .85rem; }
.notifwho li { display: flex; align-items: center; gap: 8px; }
.notifwho li.st-failed { color: var(--danger); }
.notifwho li.st-no-device { color: var(--muted); }
#notifMore { margin-top: 12px; }

/* ---- Chat: emoji picker ---- */
.emojibtn { min-height: 42px; width: 42px; padding: 0; font-size: 1.25rem; flex: none; background: var(--surface-2); }
.emojibtn.on { border-color: var(--brand); }
.emojipanel { border-top: 1px solid var(--line); background: var(--surface); display: grid; grid-template-rows: auto 1fr; max-height: 240px; }
.emojitabs { display: flex; gap: 2px; padding: 6px 10px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.emojitab { min-height: 34px; padding: 2px 10px; border: 0; border-bottom: 2px solid transparent; border-radius: 6px 6px 0 0; background: none; font-size: 1.15rem; }
.emojitab.active { border-bottom-color: var(--accent); background: var(--surface-2); }
.emojigrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 2px; padding: 8px 10px; overflow-y: auto; }
.emoji { min-height: 40px; padding: 0; border: 0; background: none; font-size: 1.45rem; line-height: 1; border-radius: 8px; }
.emoji:hover, .emoji:focus-visible { background: var(--surface-2); }
.bubble .text { font-size: 1rem; }

/* ---- Guests: list actions ---- */
.listactions { gap: 6px; }
#reuploadBtn.busy, #uploadBtn.busy { opacity: .6; pointer-events: none; }
#reuploadBtn.busy::after { content: " · reading…"; }
#removeListBtn.armed { background: var(--danger); border-color: var(--danger); color: #fff; }

@media (max-width: 400px) { .brand span { display: none; } }

/* ---- Luggage weight ---- */
.lugflight { margin-bottom: 18px; }
.lughead { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; margin: 4px 2px 10px; }
.lughead h2 { margin: 0; font-size: 1.05rem; }
.lugtotals { display: flex; flex-wrap: wrap; gap: 6px; }
.lugtotals span { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: .85rem; }
.lugvilla { padding: 14px; }
.lugvilla.weighed { border-left: 4px solid #2e9e5b; }
.lugvhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.lugvhead b { font-size: 1.05rem; }
.lugvhead .muted { font-size: .85rem; }
.lugguest { border-top: 1px solid var(--line); padding: 10px 0 4px; }
.lugguest:first-of-type { border-top: 0; }
.lugguest.noshow { opacity: .55; }
.lugname { font-weight: 600; margin-bottom: 6px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.lugrow { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.lugrow > .lab { width: 92px; font-size: .85rem; color: var(--muted); }
.lugrow input { width: 64px; padding: 7px 6px; text-align: center; }
.lugrow .sum { margin-left: auto; font-size: .9rem; white-space: nowrap; }
.lugrow button.add { width: 34px; height: 34px; padding: 0; border-radius: 50%; font-size: 1.1rem; line-height: 1; }
.lugsaved { font-size: .8rem; color: var(--muted); }
.lugsaved.ok { color: #2e9e5b; }
.lugsaved.err { color: var(--danger, #c0392b); }
@media (max-width: 560px) { .lugrow > .lab { width: 100%; } .lugrow input { width: 58px; } }

/* ---- Transit stops ---- */
.stopsbox { display: grid; gap: 8px; }
.stopseditor { display: grid; gap: 8px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; }
.stopseditor .row select { flex: 1; min-width: 0; }
.stoplist { margin: 0; padding-left: 22px; display: grid; gap: 4px; }
.stoplist li span { margin-right: 6px; }
.stoplist[hidden] { display: none; }
.wroute { font-size: .85rem; margin-top: 2px; }
.wstops { display: grid; gap: 8px; margin: 10px 0 14px; }
.small-title { font-size: .9rem; }

/* Luggage: flights page */
.lugflights { display: grid; gap: 12px; }
.lugfcard { display: grid; gap: 10px; text-decoration: none; color: var(--text); margin-bottom: 0; }
.lugfcard:hover { border-color: var(--accent); }
.lugfcard.weighed { border-left: 4px solid #2e9e5b; }
.lugftop { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 1.05rem; }
.lugftop .chev { font-size: 1.6rem; line-height: 1; color: var(--muted); }
.lugfstats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lugfstats div { display: grid; }
.lugfstats b { font-size: 1.35rem; }
.lugfstats span { font-size: .82rem; color: var(--muted); }
.lugfsub { font-size: .82rem; }
.progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress span { display: block; height: 100%; background: #2e9e5b; border-radius: 99px; }
/* Luggage: one flight */
.backlink { display: inline-block; margin: 0 0 10px; font-weight: 600; text-decoration: none; padding: 6px 0; }
.lugfhead { display: grid; gap: 8px; }
.lugfhead .lughead { margin: 0; }
.lugtotals .grand { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
.lugcargo { display: grid; gap: 10px; }
.cargolist { display: grid; gap: 8px; }
.cargoline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cargoline .cwhat { flex: 1 1 200px; min-width: 0; }
.cargoline .cw { display: inline-flex; align-items: center; gap: 6px; }
.cargoline .cweight { width: 80px; text-align: center; padding: 7px 6px; }
.cargoline .lugsaved { flex-basis: 100%; }
.cargoline .lugsaved:empty { display: none; }
.cargoadd { padding-top: 10px; border-top: 1px dashed var(--line); }

/* Guests: finished flights, linked flights */
.transfer.complete { opacity: .72; }
.transfer.complete .thead { background: transparent; }
.donehead { margin: 18px 2px 8px; font-size: .9rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.linkchip { justify-self: start; font-size: .8rem; text-decoration: none; border: 1px dashed var(--line); border-radius: 999px; padding: 2px 10px; color: var(--text); }
.linkchip:hover { border-color: var(--accent); }
button.primary.armed, .tactions button.armed { background: var(--danger); border-color: var(--danger); color: #fff; }
