/* Aeropict Tailstack — © Aeropict Aviation LLC */
:root {
  --bg: #f4f4f6;
  --panel: #ffffff;
  --panel-2: #f8f8fa;
  --ink: #111114;
  --ink-2: #3a3a42;
  --muted: #5b5b66;
  --line: #e4e4e9;
  --line-2: #cfcfd6;
  --accent: #1f1f24;
  --accent-ink: #ffffff;
  --accent-soft: #ececf0;
  --ok: #15803d; --ok-soft: #dcfce7;
  --warn: #b45309; --warn-soft: #fef3c7;
  --bad: #b91c1c; --bad-soft: #fee2e2;
  --info: #0369a1; --info-soft: #e0f2fe;
  --brand-red: #cc0000;
  --red: #cc0000; --red-ink: #ffffff;
  --side: #0e0e10;
  --side-ink: #c9c9d1;
  --side-active: #26262c;
  --shadow: 0 1px 2px rgba(17,17,20,.06), 0 4px 16px rgba(17,17,20,.06);
  --shadow-lg: 0 10px 40px rgba(17,17,20,.22);
  --radius: 10px;
  --night: rgba(17,17,20,.07);
  --twilight: rgba(17,17,20,.035);
  --grid: #efeff2;
  --grid-hour: #e1e1e6;
  --now: #ef4444;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d10; --panel: #17171b; --panel-2: #121215; --ink: #ececf0; --ink-2: #d0d0d7; --muted: #9d9da8;
    --line: #27272e; --line-2: #36363e; --accent: #ececf0; --accent-ink: #0e0e10; --accent-soft: #2a2a31; --red: #ff6363; --red-ink: #0e0e10;
    --ok: #4ade80; --ok-ink: #04210f; --ok-soft: #12351f; --warn: #fbbf24; --warn-soft: #3a2c0b; --bad: #f87171; --bad-soft: #3b1414;
    --info: #7dd3fc; --info-soft: #0c2e44; --side: #08080a; --side-active: #222228;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 10px 40px rgba(0,0,0,.6);
    --night: rgba(0,0,0,.28); --twilight: rgba(0,0,0,.14); --grid: #1b1b20; --grid-hour: #27272e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0d10; --panel: #17171b; --panel-2: #121215; --ink: #ececf0; --ink-2: #d0d0d7; --muted: #9d9da8;
    --line: #27272e; --line-2: #36363e; --accent: #ececf0; --accent-ink: #0e0e10; --accent-soft: #2a2a31; --red: #ff6363; --red-ink: #0e0e10;
    --ok: #4ade80; --ok-ink: #04210f; --ok-soft: #12351f; --warn: #fbbf24; --warn-soft: #3a2c0b; --bad: #f87171; --bad-soft: #3b1414;
    --info: #7dd3fc; --info-soft: #0c2e44; --side: #08080a; --side-active: #222228;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 10px 40px rgba(0,0,0,.6);
    --night: rgba(0,0,0,.28); --twilight: rgba(0,0,0,.14); --grid: #1b1b20; --grid-hour: #27272e;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
a:not([class]) { text-decoration-line: underline; text-underline-offset: .18em; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, var(--red) 75%, transparent); }
a:not([class]):hover { text-decoration-color: var(--red); text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
code { background: var(--panel-2); border: 1px solid var(--line); padding: 0 .3em; border-radius: 4px; font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; z-index: 1000; }
.skip:focus { left: 8px; top: 8px; }
.ico { flex: none; vertical-align: middle; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------- app shell */
body.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex: none; background: var(--side); color: var(--side-ink);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 14px; color: #fff; text-decoration: none; }
.brand strong { display: block; font-size: .98rem; line-height: 1.2; }
.brand small { color: #8f8f9a; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 6px 10px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px;
  color: var(--side-ink); text-decoration: none; margin-bottom: 2px; font-weight: 500;
}
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 #e5383b; }
.sidebar nav a.active .ico, .sidebar nav a.active svg { color: #ff6b6b; }
.sidebar nav a span { flex: 1; }
.badge { font-style: normal; background: #e9e9ee; color: #0e0e10; font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.badge.red { background: #cc0000; color: #fff; }
.side-foot { display: flex; align-items: center; gap: 6px; padding: 12px 10px; border-top: 1px solid rgba(255,255,255,.08); }
.side-foot .me { flex: 1; display: flex; align-items: center; gap: 10px; color: var(--side-ink); text-decoration: none; min-width: 0; padding: 4px; border-radius: 8px; }
.side-foot .me:hover, .side-foot .me.active { background: rgba(255,255,255,.06); }
.side-foot .me strong { display: block; color: #fff; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .me small { color: #7f93b2; font-size: .75rem; }
.side-foot .me > span:last-child { min-width: 0; }
.side-foot .icon-btn { color: var(--side-ink); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #3a3a42; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none; }

.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--panel);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; min-height: 58px;
}
.page-title { font-size: 1.2rem; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 8px; align-items: center; }
@media (min-width: 901px) { html.nav-collapsed .sidebar { display: none; } }
main { padding: 22px 24px 40px; max-width: 1200px; width: 100%; }
main.wide { max-width: none; }
.app-foot { padding: 14px 24px; color: var(--muted); font-size: .78rem; margin-top: auto; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 39; }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; visibility: hidden; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); visibility: visible; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 14px; }
  main { padding: 16px 16px 32px; }
}

/* ---------------- buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel);
  color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.danger.solid { background: var(--bad); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: var(--ok-ink, #fff); }
.btn.small { padding: 5px 10px; font-size: .84rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--panel-2); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-row.end { justify-content: flex-end; }
.spacer { flex: 1; }

.form label, label.field { display: block; font-weight: 600; font-size: .86rem; color: var(--ink-2); margin-bottom: 12px; }
.form label > input, .form label > select, .form label > textarea,
label.field > input, label.field > select, label.field > textarea { margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=time],
input[type=datetime-local], input[type=search], input[type=url], input:not([type]), select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel);
  color: var(--ink); font: inherit; font-weight: 400;
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); border-color: var(--accent); }
input[type=color] { width: 44px; height: 34px; padding: 2px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); cursor: pointer; }
label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
label.check input { margin-top: 3px; width: auto; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 700px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr; } }
@media (min-width: 701px) and (max-width: 1000px) { .grid4 { grid-template-columns: repeat(2, 1fr); } }
.hint { font-weight: 400; color: var(--muted); font-size: .8rem; display: block; margin-top: 3px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px 4px; margin: 0 0 16px; }
legend { font-weight: 700; padding: 0 6px; }

/* ---------------- cards, flashes, pills */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; flex: 1; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .cols { grid-template-columns: minmax(0, 1fr); } }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid transparent; }
.flash.success { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.flash.error { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.flash.info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.flash.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.flash ul { margin: 4px 0 0; padding-left: 18px; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: .76rem; font-weight: 700; background: var(--panel-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.pill.st-scheduled { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill.st-dispatched, .pill.st-active, .pill.st-resolved, .pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.st-completed { background: var(--panel-2); color: var(--muted); }
.pill.st-cancelled, .pill.st-rejected, .pill.st-suspended, .pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.st-noshow, .pill.st-pending, .pill.st-deferred, .pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.st-open { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; border: 1px solid rgba(0,0,0,.15); }
.stat { display: flex; flex-direction: column; }
.stat b { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .82rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stats .card { margin: 0; padding: 14px 16px; }
.owes { color: var(--bad); } .credit { color: var(--ok); }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; align-content: start; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 500; }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }

/* ---------------- tables */
.table-wrap { overflow-x: auto; margin: 0 -4px; position: relative; }   /* keeps .sr-only text inside the scroller */
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl th { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; background: var(--panel-2); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--panel-2); }
.tbl td.actions { text-align: right; white-space: nowrap; }
.tbl tfoot td { font-weight: 700; border-top: 2px solid var(--line-2); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a, .tabs button { padding: 8px 14px; border: 0; background: none; color: var(--muted); text-decoration: none; font: inherit; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tabs a.active, .tabs button.active, .tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--red); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search] { max-width: 280px; }

/* ---------------- checks (dispatch) */
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { display: grid; grid-template-columns: 26px 150px 1fr; gap: 8px; align-items: start; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.checks li:last-child { border-bottom: 0; }
.checks .mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .8rem; color: #fff; }
.checks .pass .mark { background: var(--ok); }
.checks .warn .mark { background: #d97706; }
.checks .fail .mark { background: var(--bad); }
.checks .info .mark { background: var(--muted); }
.checks .lbl { font-weight: 600; }
.checks .hard { font-size: .74rem; font-weight: 700; color: var(--bad); display: block; }
@media (max-width: 600px) { .checks li { grid-template-columns: 26px 1fr; } .checks li .det { grid-column: 2; } }
ul.checklist { list-style: none; padding: 0; }
ul.checklist li { padding: 6px 0; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
ul.checklist .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex: none; }
ul.checklist .fail .dot { background: var(--bad); }
ul.checklist small { flex-basis: 100%; color: var(--bad); padding-left: 18px; }

/* ---------------- public pages */
body.public { min-height: 100vh; display: flex; flex-direction: column; }
.pub-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; background: var(--side); }
.pub-top .brand { padding: 0; }
.pub-top nav { display: flex; gap: 14px; align-items: center; }
.pub-top nav a:not(.btn) { color: #c9c9d1; text-decoration: none; font-weight: 600; }
.pub-main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 32px 20px; }
.pub-main.narrow { max-width: 820px; }
.pub-foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 18px; }
.auth-card { max-width: 420px; margin: 24px auto; }
.auth-card.wide { max-width: 640px; }
.hero {
  border-radius: 16px; padding: 56px 40px; color: #fff; margin-bottom: 32px;
  background: radial-gradient(1200px 400px at 90% -10%, rgba(96,165,250,.45), transparent 60%),
              linear-gradient(135deg, #0e0e10 0%, #1d1d22 60%, #34343c 130%);
}
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: .3em; }
.hero .lead { font-size: 1.1rem; max-width: 620px; color: #e4e4ea; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; color: #ff8a8a; font-weight: 700; margin: 0 0 8px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.hero .btn:not(.primary) { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.hero .btn.primary { background: #fff; color: #0e0e10; border-color: #fff; }
.fleet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.fleet-card { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.fleet-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; background: var(--panel-2); }
.fleet-card figcaption { padding: 10px 12px; }
.install-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.install-head h1 { margin: 0; }
ol.steps li { margin-bottom: 6px; }

/* ---------------- modal / popover / toast */
.modal-back { position: fixed; inset: 0; background: rgba(2,6,23,.5); z-index: 100; display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal {
  background: var(--panel); color: var(--ink); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px;
  max-height: calc(100vh - 32px); overflow-y: auto; border: 1px solid var(--line);
}
.modal.lg { max-width: 720px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px 0; }
.modal-head h2 { flex: 1; margin: 0; }
.modal-body { padding: 14px 20px; }
.modal-foot { padding: 12px 20px 18px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--line); }
.popover {
  position: fixed; z-index: 90; width: 320px; max-width: calc(100vw - 20px); background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 14px 16px;
}
.popover .pop-type { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 4px; }
.popover .pop-type .swatch { width: 12px; height: 12px; }
.popover h3 { margin: 0 0 6px; font-size: 1.02rem; }
.popover dl.kv { font-size: .88rem; margin-bottom: 10px; }
.popover .notes { font-size: .86rem; background: var(--panel-2); border-radius: 8px; padding: 6px 9px; white-space: pre-wrap; margin-bottom: 10px; }
.toast-wrap { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: #111114; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 500; }
.toast.error { background: #b91c1c; }
.toast.warn { background: #92400e; }
.toast.ok { background: #166534; }
.ac-modal .ac-photo { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; background: var(--panel-2); display: block; margin-bottom: 12px; }
.ac-modal .ac-grounded { background: var(--bad-soft); color: var(--bad); font-weight: 700; padding: 8px 12px; border-radius: 8px; margin-bottom: 10px; }
.ac-modal .ac-grounded.ac-hold { background: var(--warn-soft); color: var(--warn); }
.ac-modal ul { padding-left: 18px; margin: 4px 0 10px; }
.ac-modal .state-overdue { color: var(--bad); font-weight: 700; }
.ac-modal .state-soon { color: var(--warn); font-weight: 700; }

/* ---------------- schedule */
body.schedule main { padding: 0; max-width: none; display: flex; flex-direction: column; }   /* 1.13: the page scrolls, not the schedule */
body.schedule .app-foot { display: none; }
.sch-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.sch-bar .date-label { font-weight: 700; font-size: 1.02rem; min-width: 170px; }
.sch-bar input[type=date] { width: auto; padding: 6px 8px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--panel); color: var(--ink-2); padding: 6px 11px; font: inherit; font-weight: 600; cursor: pointer; border-right: 1px solid var(--line-2); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.sch-bar select { width: auto; padding: 6px 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 6px 16px; font-size: .78rem; color: var(--muted); background: var(--panel); border-bottom: 1px solid var(--line); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.sch-host { position: relative; }
.sch-loading { position: absolute; top: 10px; right: 16px; font-size: .8rem; color: var(--muted); z-index: 20; }

/* horizontal timeline */
.tl { display: flex; flex-direction: column; --label-w: 150px; }
.tl-scroll { overflow-x: auto; overflow-y: hidden; position: relative; }   /* full height; only sideways scrolling */
.tl-head { display: flex; position: sticky; top: 0; z-index: 12; background: var(--panel); border-bottom: 1px solid var(--line-2); }
.tl-corner { position: sticky; left: 0; z-index: 13; width: var(--label-w); flex: none; background: var(--panel); border-right: 1px solid var(--line-2); padding: 4px 10px; font-size: .72rem; color: var(--muted); display: flex; align-items: flex-end; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.tl-times { position: relative; height: 44px; flex: none; }
.tl-day { position: absolute; top: 0; height: 20px; font-size: .75rem; font-weight: 700; padding: 2px 6px; border-left: 2px solid var(--line-2); color: var(--ink-2); white-space: nowrap; overflow: hidden; }
.tl-day.today { color: var(--red); }
.tl-hour { position: absolute; bottom: 0; height: 22px; font-size: .72rem; color: var(--muted); padding-left: 4px; border-left: 1px solid var(--grid-hour); white-space: nowrap; }
.tl-section { display: flex; flex-direction: column; min-height: 0; }
.tl-section-title { position: sticky; left: 0; z-index: 11; display: flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--panel-2); border-bottom: 1px solid var(--line); width: 100%; }
.tl-row, .tl-head { width: max-content; min-width: 100%; }
.tl-row { display: flex; border-bottom: 1px solid var(--line); min-height: 46px; }
.tl-label {
  position: sticky; left: 0; z-index: 10; width: var(--label-w); flex: none; background: var(--panel); border-right: 1px solid var(--line-2);
  padding: 5px 10px; display: flex; flex-direction: column; justify-content: center; line-height: 1.2; overflow: hidden;
}
.tl-label button.tail { all: unset; cursor: pointer; font-weight: 800; color: var(--accent); font-size: .95rem; letter-spacing: .02em; display: inline-flex; align-items: center; gap: 5px; }
.tl-label button.tail:hover { text-decoration: underline; }
.tl-label button.tail:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.tl-label small { color: var(--muted); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-label .gnd { display: inline-block; font-size: .64rem; font-weight: 800; background: #b91c1c; color: #fff; border-radius: 4px; padding: 0 4px; letter-spacing: .04em; }
.tl-label .instr-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.tl-label strong { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-lane { position: relative; flex: none; cursor: cell; touch-action: pan-x pan-y; }
.tl-lane.ro { cursor: default; }
.lane-bg { position: absolute; inset: 0; pointer-events: none; }
.lane-bg i { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--grid); }
.lane-bg i.h { border-left-color: var(--grid-hour); }
.lane-bg i.d { border-left: 2px solid var(--line-2); }
.lane-bg b { position: absolute; top: 0; bottom: 0; background: var(--night); }
.lane-bg b.tw { background: var(--twilight); }
.now-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--now); z-index: 5; pointer-events: none; }
.tl-split { height: 8px; flex: none; background: var(--panel-2); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); cursor: row-resize; display: grid; place-items: center; touch-action: none; }
.tl-split::after { content: ""; width: 40px; height: 3px; border-radius: 3px; background: var(--line-2); }
.tl-split:hover::after, .tl-split:focus-visible::after { background: var(--accent); }

.blk {
  position: absolute; top: 4px; bottom: 4px; border-radius: 6px; padding: 3px 7px; font-size: .76rem; line-height: 1.2;
  overflow: hidden; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.2); z-index: 3; user-select: none; -webkit-user-select: none;
  border: 1px solid rgba(0,0,0,.12); display: flex; flex-direction: column; justify-content: center; min-width: 6px;
}
.blk b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk:hover { filter: brightness(1.06); z-index: 4; }
.blk:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; z-index: 6; }
.blk.st-cancelled { opacity: .55; background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(255,255,255,.35) 6px 12px) !important; text-decoration: line-through; }
.blk.st-noshow { background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(0,0,0,.12) 6px 12px); }
.blk.maint { background-image: repeating-linear-gradient(135deg, transparent 0 8px, rgba(255,255,255,.18) 8px 16px); }
.blk.dragging { opacity: .85; z-index: 50; box-shadow: var(--shadow-lg); }
.blk.bad-drop { outline: 3px solid var(--bad); }
.blk .grip { position: absolute; top: 0; bottom: 0; right: 0; width: 8px; cursor: ew-resize; }
.blk.mine { box-shadow: 0 0 0 2px rgba(255,255,255,.9) inset, 0 1px 2px rgba(0,0,0,.25); }
.sel-box { position: absolute; top: 3px; bottom: 3px; background: color-mix(in srgb, var(--accent) 22%, transparent); border: 2px dashed var(--accent); border-radius: 6px; z-index: 2; pointer-events: none; font-size: .72rem; font-weight: 700; color: var(--accent); padding: 2px 5px; white-space: nowrap; }

/* vertical day view */
.vt { overflow-x: auto; overflow-y: hidden; position: relative; }
.vt-grid { display: grid; position: relative; min-width: 100%; }
.vt-head { position: sticky; top: 0; z-index: 12; background: var(--panel); border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 6px 4px; text-align: center; line-height: 1.2; border-left: 1px solid var(--line); min-height: 50px; }
.vt-head small { color: var(--muted); font-size: .72rem; }
.vt-corner { position: sticky; top: 0; left: 0; z-index: 14; background: var(--panel); border-bottom: 1px solid var(--line-2); }
.vt-times { position: sticky; left: 0; z-index: 11; background: var(--panel); border-right: 1px solid var(--line-2); }
.vt-times div { position: absolute; left: 0; right: 0; font-size: .72rem; color: var(--muted); padding: 0 6px; transform: translateY(-.6em); text-align: right; }
.vt-col { position: relative; border-left: 1px solid var(--line); cursor: cell; }
.vt-col .lane-bg i { left: 0; right: 0; top: auto; bottom: auto; border-left: 0; border-top: 1px solid var(--grid); height: 0; }
.vt-col .lane-bg i.h { border-top-color: var(--grid-hour); }
.vt-col .lane-bg b { left: 0; right: 0; top: auto; bottom: auto; }
.vt-col .now-line { left: 0; right: 0; top: auto; bottom: auto; width: auto; height: 2px; }
.vt-col .blk { top: auto; bottom: auto; left: 3px; right: 3px; justify-content: flex-start; padding-top: 4px; }
.vt-col .blk .grip { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 8px; cursor: ns-resize; }
.vt-col .sel-box { top: auto; bottom: auto; left: 3px; right: 3px; }

/* month view */
.mv { padding: 12px 16px 20px; }
.mv-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--line); border-top: 1px solid var(--line); background: var(--panel); border-radius: 8px; overflow: hidden; }
.mv-dow { padding: 6px 8px; font-size: .72rem; font-weight: 800; text-transform: uppercase; color: var(--muted); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel-2); }
.mv-day { min-height: 118px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px 5px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mv-day.other { background: var(--panel-2); }
.mv-day.other .mv-num { color: var(--muted); }
.mv-num { all: unset; cursor: pointer; font-weight: 700; font-size: .82rem; padding: 1px 6px; border-radius: 99px; align-self: flex-start; }
.mv-num:hover { background: var(--accent-soft); }
.mv-day.today .mv-num { background: var(--red); color: var(--red-ink); }
.mv-chip { all: unset; cursor: pointer; display: block; font-size: .72rem; padding: 1px 5px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-more { font-size: .72rem; color: var(--muted); padding-left: 5px; }
@media (max-width: 700px) { .mv-day { min-height: 70px; } .mv-chip { font-size: .64rem; } }

/* list view */
.lv { padding: 12px 16px 20px; }
.lv h3 { margin: 16px 0 6px; font-size: .9rem; color: var(--ink-2); padding: 6px 0; }
.lv-item { display: grid; grid-template-columns: 6px 110px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 8px 0; margin-bottom: 6px; cursor: pointer; overflow: hidden; }
.lv-item:hover { border-color: var(--line-2); }
.lv-item .bar { align-self: stretch; }
.lv-item .when { font-weight: 700; font-variant-numeric: tabular-nums; }
.lv-item .what { min-width: 0; }
.lv-item .what b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-item .what small { color: var(--muted); }
@media (max-width: 600px) { .lv-item { grid-template-columns: 6px minmax(0,1fr) auto; } .lv-item .when { grid-column: 2; } .lv-item .what { grid-column: 2; } .lv-item .pill { grid-row: 1; grid-column: 3; } }

/* flight line */
.fl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.fl-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.fl-card .fl-top { display: flex; gap: 12px; padding: 12px; align-items: center; border-bottom: 1px solid var(--line); }
.fl-card img { width: 86px; height: 56px; object-fit: cover; border-radius: 6px; background: var(--panel-2); }
.fl-card .fl-status { font-weight: 800; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
.fl-card .fl-body { padding: 10px 12px; flex: 1; font-size: .9rem; }
.fl-card.out { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); }
.fl-card.overdue { border-color: var(--bad); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bad) 30%, transparent); }
.fl-card.grounded { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); }
.fl-card.hold { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); } .fl-status.hold { color: var(--warn); }
.fl-status.out { color: var(--ok); } .fl-status.overdue, .fl-status.grounded { color: var(--bad); } .fl-status.avail { color: var(--muted); }

/* aircraft pages */
.ac-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; }
.ac-hero img { width: 100%; border-radius: 10px; aspect-ratio: 16/10; object-fit: cover; background: var(--panel-2); }
@media (max-width: 800px) { .ac-hero { grid-template-columns: minmax(0, 1fr); } }
.ac-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.ac-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--panel-2); display: block; }
.ac-card .body { padding: 12px 14px; flex: 1; }
.ac-card h3 { margin: 0; font-size: 1.1rem; }
.ac-card:hover { border-color: var(--line-2); }
.state-overdue { color: var(--bad); font-weight: 700; }
.state-soon, .state-unknown { color: var(--warn); font-weight: 700; }
.state-ok { color: var(--ok); }

/* types editor */
.type-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.preview-blk { display: inline-flex; flex-direction: column; border-radius: 6px; padding: 3px 9px; font-size: .76rem; min-width: 120px; line-height: 1.25; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.color-pair { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* receipt / print */
.receipt { max-width: 720px; }
@media print {
  .sidebar, .topbar, .app-foot, .no-print, .flash { display: none !important; }
  body.app { display: block; background: #fff; }
  main { padding: 0; }
  .card { box-shadow: none; border: 0; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.preview-blk span { font-weight: 400; }
.vt-col .blk b, .vt-col .blk span { white-space: normal; }
@media (max-width: 700px) {
  .sch-bar { padding: 8px 10px; gap: 6px; }
  .sch-bar .date-label { display: none; }
  .sch-bar #schZoomIn, .sch-bar #schZoomOut { display: none; }
  .sch-bar .spacer { display: none; }
  .seg button { padding: 5px 9px; }
  .sch-bar select { max-width: 150px; }
  .legend { display: none; }
}
.pill.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.tbl.verify th[scope=row] { background: none; text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--ink); white-space: nowrap; }
.tbl.verify tr.v-fail { background: color-mix(in srgb, var(--bad-soft) 55%, transparent); }
.tbl.verify tr.v-warn { background: color-mix(in srgb, var(--warn-soft) 45%, transparent); }
.tbl.verify .hard { font-size: .74rem; font-weight: 700; color: var(--bad); white-space: nowrap; }
.tv-launch { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.tv-tile { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: var(--radius); background: #0e0e10; color: #e4e4ea; text-decoration: none; border: 1px solid #2c2c33; }
.tv-tile:hover { border-color: #9d9da8; }
.tv-tile strong { font-size: 1.05rem; display: flex; align-items: center; gap: 8px; color: #fff; }
.tv-tile span { color: #a8b8d0; font-size: .88rem; }
.tv-tile em { font-style: normal; color: #c9c9d1; font-weight: 600; font-size: .85rem; margin-top: 4px; }
kbd { border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: .85em; background: var(--panel-2); }
a.card.ac-card { color: inherit; text-decoration: none; padding: 0; }
a.card.ac-card .stat b { font-size: 1.8rem; }
.mx-sq { border-top: 1px solid var(--line); padding: 12px 0; }
.mx-sq:first-child { border-top: 0; }
.mx-sq-meta { margin-bottom: 6px; }
.mx-sq textarea { width: 100%; }
.mx-sq-row { display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); gap: 0 12px; margin-top: 8px; }
.mx-sq-row label { margin-bottom: 0; }
@media (max-width: 600px) { .mx-sq-row { grid-template-columns: 1fr; } }

/* ---------------- announcement banner (v1.3) */
.site-banner { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; margin-bottom: 14px; border-radius: 8px; border: 1px solid transparent; font-weight: 600; line-height: 1.4; }
.site-banner .ico { flex: none; margin-top: 1px; }
.site-banner-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.site-banner-x { margin: -4px -6px -4px 0; }
.site-banner-x .icon-btn { color: inherit; }
.site-banner.info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 35%, transparent); }
.site-banner.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.site-banner.danger { background: #b91c1c; color: #fff; border-color: #991b1b; }
body.schedule .site-banner { margin: 0; border-radius: 0; border-width: 0 0 1px; flex: none; }
.banner-preview { margin: 10px 0 0; }

/* ---------------- reorder dialog (v1.3) */
.reorder h3 { margin: 14px 0 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ro-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.ro-list li { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 4px; background: var(--panel); border-top: 1px solid var(--line); }
.ro-list li:first-child { border-top: 0; }
.ro-list li.dragging { background: var(--accent-soft); position: relative; z-index: 2; box-shadow: var(--shadow); }
.ro-grip { cursor: grab; touch-action: none; user-select: none; color: var(--muted); font-size: 1.15rem; padding: 4px 8px; line-height: 1; }
.ro-list li.dragging .ro-grip { cursor: grabbing; }
.ro-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ro-list .icon-btn { width: 30px; height: 30px; }

/* ---------------- owner / checkout lists (v1.3) */
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--line); }
.plain-list li:first-child { border-top: 0; }
.plain-list li form.inline { margin-left: auto; }
form.inline { display: inline; margin: 0; }

/* ---------------- groups (v1.4) */
.gchip { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 600; padding: 1px 8px 1px 6px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); white-space: nowrap; }
.gchip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.group-picks { border: 0; padding: 0; margin: 0 0 6px; display: grid; gap: 2px; }
.group-picks .check { align-items: center; flex-wrap: wrap; }
.perm-table { border-collapse: collapse; width: 100%; font-size: .88rem; }
.perm-table th, .perm-table td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: center; vertical-align: middle; }
.perm-table th:first-child, .perm-table td:first-child { text-align: left; min-width: 260px; }
.perm-table thead th { position: sticky; top: 0; background: var(--panel); z-index: 2; font-size: .78rem; vertical-align: bottom; }
.perm-table tbody th[colspan] { background: var(--panel-2); text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; color: var(--muted); text-align: left; }
.perm-table td small { display: block; color: var(--muted); font-weight: 400; }
.perm-table input[type=checkbox] { width: 18px; height: 18px; }
.perm-table .locked { color: var(--ok); font-weight: 800; }

/* ---------------- website editor (v1.4) */
.blk-ed { padding: 0; overflow: hidden; }
.blk-ed > summary { cursor: pointer; padding: 14px 18px; display: flex; gap: 10px; align-items: center; font-weight: 700; list-style: none; }
.blk-ed > summary::-webkit-details-marker { display: none; }
.blk-ed > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
.blk-ed[open] > summary::before { transform: rotate(90deg); }
.blk-ed .blk-kind { background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 2px 8px; font-size: .8rem; }
.blk-ed .blk-sum { color: var(--muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.blk-ed.is-hidden > summary { opacity: .65; }
.blk-ed > .blk-tools, .blk-ed > form, .blk-ed > .blk-add-after { padding: 0 18px; }
.blk-ed > form.form { padding-bottom: 14px; }
.blk-tools form { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.blk-add-after { border-top: 1px dashed var(--line); padding-top: 10px !important; padding-bottom: 12px !important; background: var(--panel-2); }
.add-block { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.add-block select { max-width: 100%; }
fieldset.items { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0 0 14px; }
fieldset.items > legend { font-weight: 700; padding: 0 6px; }
.item-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 10px; background: var(--panel-2); }
.item-tools { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
@media (max-width: 640px) { .item-row { grid-template-columns: minmax(0, 1fr); } .item-tools { flex-direction: row; } }
fieldset.linkf { border: 0; padding: 0; margin: 0 0 6px; }
fieldset.linkf > legend { font-weight: 600; font-size: .9rem; padding: 0; margin-bottom: 4px; }
.imgf { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; align-items: start; margin-bottom: 10px; }
.imgf-prev { width: 120px; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); }
.imgf-prev[hidden] { display: block; visibility: hidden; }
.media-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.media-item { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel-2); }
.media-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.media-item form { padding: 8px; }
.inbox-item { border-top: 1px solid var(--line); padding: 12px 0; }
.inbox-item.done { opacity: .75; }

/* ------------------------------------------------------------ live demo (1.5; pinned yellow bar 1.13) */
/* The bar spans the whole window above the menu and stays at the top while the page scrolls. Its height (it wraps on
   phones) is measured by app.js into --demo-h, so the sticky menu and page header sit just below it. */
body.app.has-demo { flex-wrap: wrap; align-content: flex-start; --demo-h: 50px; }
.demo-bar { flex: 0 0 100%; position: sticky; top: 0; z-index: 60; box-sizing: border-box; display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px 14px; padding: 8px 16px; background: #facc15; color: #1f1300; font-size: .9rem; border-bottom: 1px solid #c9a20f; }
.demo-bar b { color: #1f1300; }
.demo-tag { background: #1f1300; color: #facc15; font-weight: 800; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.demo-bar > span:nth-child(2) { flex: 1; min-width: 220px; }
.demo-switch { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.demo-switch select { width: auto; min-height: 32px; padding: 4px 8px; background: #fff; color: #1f1300; border-radius: 8px; border: 1px solid rgb(31 19 0 / .35); }
.demo-bar .btn { background: rgb(31 19 0 / .08); color: #1f1300; border-color: rgb(31 19 0 / .4); }
.demo-bar .btn:hover { background: rgb(31 19 0 / .16); }
.demo-bar .btn:focus-visible, .demo-bar select:focus-visible { outline: 2px solid #1f1300; outline-offset: 2px; }
body.has-demo .sidebar { top: var(--demo-h); height: calc(100vh - var(--demo-h)); }
body.has-demo .topbar { top: var(--demo-h); }
.demo-bar { align-self: flex-start; }
/* On phones the menu slides in over the page (position: fixed), so the page has to start its own row under the bar. */
@media (max-width: 900px) {
  body.has-demo .sidebar { top: var(--demo-h); height: calc(100vh - var(--demo-h)); }
  body.app.has-demo .main-wrap { flex: 0 0 100%; }
}
/* Small screens: the pinned bar keeps every button but drops the long sentence and the "Switch role" label. */
@media (max-width: 600px) {
  .demo-bar { padding: 6px 10px; gap: 6px 10px; font-size: .85rem; }
  .demo-bar .demo-more { display: none; }
  .demo-bar > span:nth-child(2) { min-width: 0; }
  .demo-switch label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .demo-bar .btn.small { padding: 4px 8px; }
}
.demo-roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.demo-roles form { margin: 0; }
@media (max-width: 520px) { .demo-roles { grid-template-columns: minmax(0, 1fr); } }

/* ---- 1.6: locations + long-term out-of-service strip */
.loc-pick { font-weight: 700; }
.tl-label .gnd.oos, .tl-oos-bar .gnd.oos { background: #57534e; }
.tl-label .gnd.hold { background: #b45309; }
.tl-oos-bar { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 8px; flex: none; width: 100%; padding: 7px 14px; font-size: .82rem;
  background: var(--panel-2); border-top: 2px solid var(--line-2); cursor: pointer; color: var(--ink-2); }
.tl-oos-bar:hover { background: var(--panel); }
.tl-oos-bar:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tl-oos-bar .gnd { display: inline-block; font-size: .64rem; font-weight: 800; color: #fff; border-radius: 4px; padding: 1px 5px; letter-spacing: .04em; }
.tl-scroll[data-kind="o"] .tl-row { background: repeating-linear-gradient(135deg, transparent 0 10px, var(--panel-2) 10px 20px); }
.tl-oos-chev { width: 1em; text-align: center; color: var(--muted); }

/* ---- 1.6: visual website editor */
body.site-editor main.wide { padding: 0; }
.ve { display: flex; flex-direction: column; height: calc(100vh - 61px); min-height: 520px; }
.ve-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.ve-bar select { width: auto; max-width: 260px; padding: 6px 8px; }
.ve-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 460px; }
.ve-stage { min-height: 0; background: var(--panel-2); display: flex; justify-content: center; overflow: auto; padding: 14px;
  background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 18px 18px; }
.ve-stage iframe { width: 100%; height: 100%; min-height: 480px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; box-shadow: 0 8px 30px rgba(15,23,42,.12); transition: width .2s; }
.ve-stage[data-device="tablet"] iframe { width: 820px; flex: none; }
.ve-stage[data-device="phone"] iframe { width: 390px; flex: none; }
.ve-panel { min-height: 0; overflow: auto; border-left: 1px solid var(--line); background: var(--bg); padding: 14px; }
.ve-panel .card { margin-bottom: 10px; }
.ve-settings > summary { cursor: pointer; padding: 2px 0; }
.ve-settings[open] > summary { margin-bottom: 10px; }
.ve-outline-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0 4px; }
.ve-outline-head h2 { margin: 0; font-size: 1.05rem; }
.ve-hint { margin: 0 0 10px; }
.ve-outline { list-style: none; margin: 0; padding: 0; }
.ve-outline > li.dragging { opacity: .6; }
.ve-outline .blk-ed > summary { padding: 11px 12px; font-size: .92rem; }
.ve-outline .blk-ed > summary::before { display: none; }
.ve-grip { cursor: grab; color: var(--muted); padding: 2px 4px; touch-action: none; user-select: none; }
.ve-kind-ico { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); flex: none; }
.ve-outline .blk-ed .blk-kind { background: none; padding: 0; color: var(--ink); font-size: .9rem; }
.ve-outline .blk-ed.is-selected { outline: 2px solid var(--accent); outline-offset: -2px; }
.ve-outline .blk-ed > .blk-tools, .ve-outline .blk-ed > form, .ve-outline .blk-ed > .blk-add-after { padding: 0 14px; }
.ve-outline .blk-ed > form.blk-form { padding-bottom: 14px; }
.ve-outline .blk-tools form { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ve.js .blk-add-after, .ve.js #addblock { display: none; }
.blk-save { position: sticky; bottom: -14px; background: var(--panel); padding: 10px 0 4px; border-top: 1px solid var(--line); margin-top: 10px; z-index: 2; }
.blk-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.blk-pick { all: unset; box-sizing: border-box; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 12px; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; background: var(--panel); }
.blk-pick .ve-kind-ico { grid-row: span 2; width: 34px; height: 34px; }
.blk-pick strong { font-size: .92rem; }
.blk-pick span:last-child { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.blk-pick:hover, .blk-pick:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
@media (max-width: 1100px) {
  .ve { height: auto; }
  .ve-main { grid-template-columns: 1fr; }
  .ve-stage { height: 62vh; }
  .ve-panel { border-left: 0; border-top: 1px solid var(--line); }
}

/* ---- 1.6: member standing, hiring, reports, locations */
.standing-now { border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--line); }
.standing-now p { margin: 6px 0; white-space: pre-line; }
.standing-now.bad { background: var(--bad-soft); border-color: transparent; }
.standing-now.warn { background: var(--warn-soft); border-color: transparent; }
.standing h3 { font-size: .95rem; margin: 14px 0 6px; }
.inline-dialog { border: 1px solid var(--line-2); border-radius: 10px; padding: 12px; margin: 10px 0; background: var(--panel-2); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line-2); }
.timeline li { position: relative; padding: 4px 0 10px 10px; }
.timeline li::before { content: ""; position: absolute; left: -21px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); border: 2px solid var(--panel); }
.timeline li.suspended::before { background: var(--bad); }
.timeline details summary { cursor: pointer; color: var(--muted); }
.btn.ok.solid { background: var(--ok); color: #fff; }
.join-toggle.closed { border-color: var(--warn); background: var(--warn-soft); }
.oos-card { border-color: #a8a29e; }
.loc-switch { display: inline-flex; }
.loc-switch select { width: auto; padding: 5px 8px; }
.loc-ed { border-top: 1px solid var(--line); padding: 8px 0; }
.loc-ed > summary { cursor: pointer; font-weight: 600; }
.pre-line { white-space: pre-line; }
tr.unread td { font-weight: 600; }
.seg-radios { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 2px 10px; margin-bottom: 10px; }
.rep-cat { font-size: 1.05rem; margin: 22px 0 8px; }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.rep-card { margin: 0; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.rep-card strong { color: var(--accent); }
.rep-card span { color: var(--muted); font-size: .86rem; }
.rep-card:hover, .rep-card:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.rep-desc { margin-top: -6px; }
.rep-filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.rep-filter-row label { margin: 0; min-width: 150px; flex: 1 1 150px; max-width: 240px; }
.rep-filter-row .btn { flex: none; }
.rep-presets { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.rep-table td.long { min-width: 240px; white-space: normal; }
.rep-table tfoot th { border-top: 2px solid var(--line-2); }
.print-only { display: none; }
@media print {
  .print-only { display: block; }
  .rep-table { break-inside: auto; }
  .stats .card, .rep-table { box-shadow: none; }
}
body.site-editor main > .flash, body.site-editor main > .site-banner, body.site-editor main > .demo-bar { margin: 10px 16px; }
body.site-editor .app-foot { display: none; }
.rep-filter-row input, .rep-filter-row select { height: 40px; }

/* ---- 1.7: settings → updates */
details.restore > summary { list-style: none; display: inline-flex; }
details.restore > summary::-webkit-details-marker { display: none; }
.update-review { border-color: var(--line-2); }
.form input[type="file"] { display: block; margin-top: 6px; }

/* 1.8 online payments */
.online-pay { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 10px; }
.online-pay h3 { font-size: 14px; margin: 0 0 6px; }
.pay-col { max-width: 680px; }

/* Settings → Updates: server security check (long ini names must wrap on phones) */
.server-checks li { overflow-wrap: anywhere; }

/* Sidebar: the Admin drop-down (1.10) */
.nav-group { margin: 6px 0 2px; }
.nav-group > summary {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; cursor: pointer; list-style: none;
  color: var(--side-ink); font-weight: 500; margin-bottom: 2px;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary span { flex: 1; }
.nav-group > summary:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-group > summary:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.nav-group > summary.has-active { color: #fff; }
.nav-group > summary .ico:last-child { transition: transform .15s ease; }
.nav-group[open] > summary .ico:last-child { transform: rotate(180deg); }
.nav-group[open] .nav-group-badge { display: none; }
.nav-sub { margin-left: 14px; padding-left: 8px; border-left: 1px solid rgba(255,255,255,.1); }
.nav-sub a { padding: 7px 10px; }   /* same size as the main items (it inherits the sidebar’s 14px) */
/* Admin → Packages */
.pkg-sub { margin-top: 14px; padding: 12px 0 0 16px; border-top: 1px solid var(--line); border-left: 3px solid var(--line-2); }
.pkg-sub h3 { margin: 0; font-size: 1rem; }
/* Admin → Instructors */
.ins-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.ins-photo { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; background: var(--panel-2); }
.ins-initials { display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700; color: var(--muted); }
.ins-name { display: inline-flex; align-items: center; gap: 10px; }
.ins-name img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.ins-ro { display: flex; flex-direction: column; gap: 4px; }
.ins-ro > span:first-child { font-weight: 600; font-size: .9rem; }
.ins-hours td { vertical-align: middle; }
.ins-hours input[type=time] { width: auto; }
/* Schedule: instructor not available (outside weekly hours / time off), 1.10 */
.lane-bg b.off { background: repeating-linear-gradient(135deg, var(--unavail, rgba(100,100,115,.16)) 0 6px, transparent 6px 12px); }
.lane-bg b.off.timeoff { --unavail: rgba(100,100,115,.26); }
.swatch.unavail { background: repeating-linear-gradient(135deg, rgba(100,100,115,.45) 0 3px, transparent 3px 6px); border: 1px solid var(--line-2); }
#profile .group-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; }
#profile .group-picks legend { padding: 0; margin-bottom: 4px; }
#profile .group-picks + .group-picks, #profile .ins-ro + .group-picks { margin-top: 8px; }

/* 1.12 · the school's own logo (sidebar, receipts, TV). A light tile keeps dark logos visible on the dark sidebar. */
img.org-logo { width: auto; max-width: 120px; object-fit: contain; }
.brand img.org-logo { background: #fff; border-radius: 6px; padding: 2px; }

/* 1.12 · school setup wizard (setup.php) */
.setup-card { max-width: 980px; margin: 0 auto; }
.setup-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.setup-head h1 { margin: 0; }
.setup-logo { height: 48px; width: auto; max-width: 160px; object-fit: contain; }
.setup-steps { list-style: none; margin: 12px 0 20px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; counter-reset: none; }
.setup-steps li { font-size: .85rem; color: var(--muted); }
.setup-steps li a, .setup-steps li > span:first-child { color: inherit; }
.setup-steps li a { text-decoration: none; }
.setup-steps li a:hover { text-decoration: underline; }
.setup-steps .num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); font-size: .75rem; margin-right: 2px; }
.setup-steps li.done .num { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.setup-steps li.on { color: var(--ink); font-weight: 600; }
.setup-steps li.on .num { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.setup-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 14px; margin: 14px 0; }
.setup-cols .card { margin: 0; }
.setup-preview { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; background: var(--panel); }
.setup-list { columns: 2 220px; padding-left: 18px; margin: 6px 0 14px; }
.setup-pkg { align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.setup-pkg-desc { display: block; margin-top: 2px; }
.setup-logo-now { display: flex; align-items: center; gap: 12px; }
.setup-logo-now img { height: 48px; width: auto; max-width: 160px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px; }

/* 1.12 · the first-run tour (assets/js/tour.js) */
.tour-hl { position: relative; z-index: 1001; outline: 3px solid var(--info); outline-offset: 3px; border-radius: 6px; }
.tour-pop { position: fixed; z-index: 1002; width: min(340px, calc(100vw - 32px)); background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 14px 16px; }
.tour-pop h2 { font-size: 1rem; margin: 0 0 6px; }
.tour-pop p { margin: 0 0 12px; font-size: .92rem; }
.tour-pop .tour-foot { display: flex; align-items: center; gap: 8px; }
.tour-pop .tour-foot .spacer { flex: 1; }
.tour-pop .tour-count { color: var(--muted); font-size: .8rem; }
.tour-shade { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, .35); }
