:root {
  --bg: #f4f6f9;
  --surface: rgba(255, 255, 255, .86);
  --surface-2: rgba(248, 250, 252, .8);
  --ink: #1b2430;
  --muted: #5d6b7c;
  --line: #dde3ea;
  --accent: #1f4e79;
  --accent-ink: #ffffff;
  --accent-soft: #e6eef7;
  --good: #1d7a46;
  --good-soft: #e5f4ec;
  --warn: #9a5b00;
  --warn-soft: #fff3dc;
  --bad: #b3261e;
  --bad-soft: #fde8e7;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent); }
h1 { font-size: 1.55rem; margin: 1.2rem 0 .8rem; }
h2 { font-size: 1.1rem; margin: 0 0 .7rem; }
h3 { font-size: 1rem; margin: 1.2rem 0 .5rem; }
code { background: var(--accent-soft); padding: 0 .3em; border-radius: 4px; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 640px; margin-left: auto; margin-right: auto; }

/* Club logo watermark behind every page */
body::before {
  /* Fixed height (the tallest phone viewport), so the logo doesn't jump when the
     mobile address bar slides in and out while scrolling. */
  content: ""; position: fixed; top: 0; left: 0; width: 100%; height: 100vh; height: 100lvh; z-index: -1; pointer-events: none;
  background: url("watermark.png") no-repeat center 60% / min(78vw, 640px) auto;
  opacity: .13;
  transform: translateZ(0); will-change: transform;
}

/* Top bar */
.topbar { background: var(--accent); color: var(--accent-ink); position: relative; z-index: 30; }
.topbar-inner { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; min-height: 56px; }
.brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 1.1rem; letter-spacing: .2px; display: flex; align-items: center; gap: .5rem; }
.brand img { display: block; height: 48px; width: auto; margin: 4px 0; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); }
.hero-logo { display: block; margin: 0 auto .5rem; width: 214px; max-width: 60%; height: auto; }
.login h1 { text-align: center; }
.statement-logo { height: 57px; width: auto; }
.statement-title { flex: 1; }
.mainnav { display: flex; gap: .2rem; flex: 1; overflow-x: auto; scrollbar-width: none; }
.mainnav a, .usermenu > a {
  color: rgba(255, 255, 255, .88); text-decoration: none; padding: .45rem .7rem; border-radius: 8px; white-space: nowrap;
}
.mainnav a { display: inline-flex; align-items: center; gap: .4rem; }
.mainnav a:hover, .usermenu > a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.mainnav a.active, .usermenu > a.active { background: rgba(255, 255, 255, .2); color: #fff; font-weight: 600; }
.mainnav .nav-ico { display: none; position: relative; }
.mainnav .nav-label-tab { display: none; }
.usermenu { display: flex; gap: .2rem; align-items: center; font-size: .9rem; margin-left: auto; }
.usermenu .icon-link { padding: .4rem .5rem; }
.usermenu .ico { width: 20px; height: 20px; }

/* Menu behind your name */
.menu-dd { position: relative; }
.menu-btn {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: .3rem; color: #fff; padding: .4rem .55rem .4rem .7rem;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .35); white-space: nowrap; user-select: none;
}
.menu-btn::-webkit-details-marker { display: none; }
.menu-btn:hover, .menu-dd[open] .menu-btn { background: rgba(255, 255, 255, .14); }
.menu-btn.on-admin { background: rgba(255, 255, 255, .2); font-weight: 600; }
.menu-btn .ico { width: 16px; height: 16px; transition: transform .15s; }
.menu-dd[open] .menu-btn .ico { transform: rotate(180deg); }
.menu-btn .who-short { display: none; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px); width: 270px; max-height: calc(100vh - 80px); overflow-y: auto;
  background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: .4rem;
  box-shadow: 0 12px 32px rgba(16, 24, 40, .22); z-index: 40;
}
.menu-panel a {
  display: flex; align-items: center; gap: .6rem; padding: .55rem .6rem; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: .95rem;
}
.menu-panel a .ico { width: 19px; height: 19px; color: var(--accent); flex: none; }
.menu-panel a:hover { background: var(--accent-soft); }
.menu-panel a.active { background: var(--accent-soft); font-weight: 600; }
.menu-who { padding: .45rem .6rem .6rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; }
.menu-who strong, .menu-who span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-who span { font-size: .8rem; color: var(--muted); }
.menu-head { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .7rem .6rem .25rem; border-top: 1px solid var(--line); margin-top: .3rem; }
.menu-panel .menu-logout { border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: .3rem; padding-top: .65rem; }
.menu-panel .phone-only { display: none; }

@media (max-width: 1140px) and (min-width: 761px) {
  .topbar-inner { padding-top: .4rem; padding-bottom: .4rem; gap: .3rem; }
  .mainnav { order: 3; flex-basis: 100%; }
}

/* Notices at the top of the page (booking changes, waitlist) */
.notices { margin: .8rem 0; display: flex; flex-direction: column; gap: .4rem; }
.notice {
  display: flex; align-items: center; gap: .6rem; padding: .5rem .55rem .5rem .8rem; border-radius: 10px; border: 1px solid; margin: 0;
  font-size: .9rem; line-height: 1.35;
}
.notice-warn { background: var(--warn-soft); border-color: #f2d39b; color: #4d2e00; }
.notice-good { background: var(--good-soft); border-color: #9fd4b5; color: #12512e; flex-wrap: wrap; }
.notice-text { flex: 1; min-width: 0; }
.notice-when { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.notice-actions { display: flex; gap: .35rem; flex: none; }
.notice-good .notice-actions { margin-left: auto; }
.notices-foot { display: flex; align-items: flex-start; gap: .6rem; }
.more-notices { flex: 1; min-width: 0; }
.more-notices > summary { cursor: pointer; font-size: .85rem; color: var(--accent); font-weight: 600; padding: .1rem .2rem; }
.more-notices[open] > summary { margin-bottom: .4rem; }
.more-notices .notice + .notice { margin-top: .4rem; }
.notices-clear { margin: 0; flex: none; }
.linkish { background: none; border: 0; padding: .1rem .2rem; font: inherit; font-size: .82rem; color: var(--accent); text-decoration: underline; cursor: pointer; }

/* Cards and layout */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.1rem 1.2rem; margin-bottom: 1rem;
}
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-bottom: 1rem; }
.grid > .card { margin-bottom: 0; }
.grid-wide { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; }
@media (max-width: 900px) { .grid-wide { grid-template-columns: minmax(0, 1fr); } }

.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.pagehead h1 { margin-bottom: .6rem; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-bottom: .8rem; }
.qnav { display: flex; align-items: center; gap: .5rem; }
.inline { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .6rem 0; }

.stat .big { font-size: 2rem; font-weight: 700; margin: .2rem 0; line-height: 1.1; }
.stat .unit { font-size: .95rem; font-weight: 500; color: var(--muted); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.todo { list-style: none; padding: 0; margin: 0; }
.todo li { padding: .3rem 0; border-bottom: 1px solid var(--line); }
.todo li:last-child { border-bottom: 0; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* Buttons */
.btn {
  display: inline-block; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  padding: .55rem 1rem; border-radius: 8px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  line-height: 1.2;
}
.btn:hover { filter: brightness(1.08); }
.btn-secondary { background: var(--accent-soft); color: var(--accent); }
.btn-ghost { background: #fff; color: var(--accent); border-color: #c9d4e0; }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { background: #fff; color: var(--bad); border-color: #f0b8b4; }
.btn-big { font-size: 1.05rem; padding: .85rem 1.3rem; }
.btn-wide { width: 100%; padding: .8rem; font-size: 1.05rem; }
.danger-zone { margin: 1rem 0 2rem; }

/* Forms */
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .75rem; }
input, select, textarea {
  display: block; width: 100%; margin-top: .3rem; font: inherit; font-weight: 400; color: var(--ink);
  border: 1px solid #c5cfda; border-radius: 8px; padding: .55rem .65rem; background: #fff;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible {
  outline: 3px solid rgba(31, 78, 121, .35); outline-offset: 1px; border-color: var(--accent);
}
.inline select { width: auto; margin: 0; }
label.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
label.check input { width: auto; margin: 0; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: .82rem; }
p.hint { margin: -.3rem 0 .8rem; }
.row2, .row3 { display: grid; gap: 0 .8rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.row3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
input[type=date], input[type=time] { min-width: 0; -webkit-appearance: none; appearance: none; min-height: 2.6em; }
@media (max-width: 480px) { .row3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.big-inputs input, .big-inputs select { font-size: 1.1rem; padding: .7rem .75rem; }
.form-grid.sub { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .5rem; }
.login { margin-top: 3rem; }

/* Tables */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; background: var(--surface); font-variant-numeric: tabular-nums; }
.table th, .table td { padding: .5rem .55rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.table .num { text-align: right; }
.table tfoot td { font-weight: 600; background: var(--surface-2); border-bottom: 0; }
.table.compact th, .table.compact td { padding: .38rem .5rem; }
.table .sel { width: 1%; }
.table .sel input { width: auto; margin: 0; }
.table .empty { text-align: center; color: var(--muted); padding: 1.5rem; }
.table tr.row-warn td { background: #fffaf0; }
.table tr.row-correction td { background: var(--accent-soft); }
.table tr.inactive td { color: var(--muted); }
.table.flights { min-width: 980px; }
.table.flights td.flags { min-width: 220px; }
.remark { max-width: 320px; }
.table .notes { min-width: 200px; }
@media (max-width: 600px) { .hide-sm { display: none; } }
.card > .table-scroll, .card > .table { margin: 0 -.2rem; }

/* Tags and flags */
.flag, .ok-tag {
  display: inline-block; font-size: .78rem; padding: .1rem .45rem; border-radius: 999px; margin: 0 .25rem .2rem 0; line-height: 1.4;
}
.flag-warn { background: var(--warn-soft); color: var(--warn); border: 1px solid #f2d39b; font-weight: 600; }
.flag-done { background: #eef1f4; color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, .25); }
.flag-info { background: #eef1f4; color: var(--muted); }
.ok-tag { background: var(--good-soft); color: var(--good); font-weight: 600; }

/* Messages */
.flash { padding: .7rem .9rem; border-radius: 8px; margin: .8rem 0; border: 1px solid; }
.flash-ok { background: var(--good-soft); border-color: #b9e0c9; color: #12512e; }
.flash-error { background: var(--bad-soft); border-color: #f3c0bc; color: #7d1a14; }
.flash-warn { background: var(--warn-soft); border-color: #f2d39b; color: #6b3f00; }
.flash-info { background: var(--accent-soft); border-color: #c9d9ea; color: #17395a; }

.checklist { list-style: none; padding: 0; }
.checklist .pass { color: var(--good); }
.checklist .fail { color: var(--bad); font-weight: 600; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* Statement */
.statement-head { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.statement-head h2 { margin: .1rem 0; }
.big-name { font-size: 1.3rem; font-weight: 700; }
.totals { display: flex; justify-content: flex-end; margin: 1rem 0; }
.totals dl { display: grid; grid-template-columns: auto auto; gap: .25rem 1.5rem; margin: 0; min-width: 260px; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.totals .grand { font-weight: 700; color: var(--ink); border-top: 1px solid var(--line); padding-top: .3rem; }

.footer { color: var(--muted); font-size: .8rem; padding: 2rem 16px; }

@media print {
  body { background: #fff; font-size: 11pt; }
  body::before { display: none; }
  .topbar, .footer, .no-print, .toolbar, .pagehead .actions { display: none !important; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .table th { background: none; }
  .table-scroll { overflow: visible; }
  a { color: inherit; text-decoration: none; }
}

/* ---------- Booking calendar ---------- */
:root {
  --own: #1f4e79;
  --own-soft: #dbe8f6;
  --other: #5d6b7c;
  --other-soft: #eceff3;
  --maint: #9a5b00;
  --maint-soft: #fff1d6;
}
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg a { padding: .45rem .9rem; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .9rem; }
.seg a.on { background: var(--accent); color: #fff; }

.weekgrid { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.wg-head, .wg-body { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); }
.wg-head { border-bottom: 1px solid var(--line); background: #f8fafc; }
.wg-dayhead { padding: .5rem .4rem; font-size: .82rem; color: var(--muted); text-align: center; border-left: 1px solid var(--line); }
.wg-dayhead strong { display: block; color: var(--ink); font-size: .95rem; }
.wg-dayhead.today strong { color: var(--accent); }
.wg-times div { font-size: .72rem; color: var(--muted); text-align: right; padding: 0 .4rem; transform: translateY(-.55em); }
.wg-times div:first-child { transform: none; }
.wg-col {
  position: relative; border-left: 1px solid var(--line); cursor: copy;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 43px, var(--line) 43px, var(--line) 44px);
}
.wg-col.past { background-color: #f6f7f9; cursor: default; }
.wg-col.today { background-color: #f7fbff; }
.wg-now { position: absolute; left: 0; right: 0; border-top: 2px solid var(--bad); z-index: 2; pointer-events: none; }
.bk {
  position: absolute; left: 3px; right: 3px; z-index: 1; overflow: hidden; border-radius: 6px; padding: .2rem .35rem;
  font-size: .76rem; line-height: 1.25; text-decoration: none; border-left: 4px solid; cursor: pointer;
}
.bk strong, .bk span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-own { background: var(--own-soft); color: var(--own); border-color: var(--own); }
.bk-other { background: var(--other-soft); color: #2d3742; border-color: var(--other); }
.bk-maint { background: repeating-linear-gradient(45deg, var(--maint-soft), var(--maint-soft) 6px, #ffe6b3 6px, #ffe6b3 12px); color: #6b3f00; border-color: var(--maint); }
.bk:hover { filter: brightness(.97); box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
.bk-purpose { opacity: .85; }

.agenda { display: none; }
.ag-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .8rem; margin-bottom: .5rem; }
.ag-day.today { border-color: var(--accent); }
.ag-date { font-weight: 700; margin-bottom: .3rem; display: flex; justify-content: space-between; align-items: baseline; }
.ag-item { display: block; text-decoration: none; border-left: 4px solid; border-radius: 6px; padding: .4rem .55rem; margin-top: .35rem; }
.ag-time { display: inline-block; min-width: 6.5em; font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .weekgrid { display: none; }
  .agenda { display: block; }
}

.monthgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.mg-head { padding: .4rem; text-align: center; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #f8fafc; border-bottom: 1px solid var(--line); }
.mg-cell { min-height: 104px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: .25rem .3rem; overflow: hidden; }
.mg-cell:nth-child(7n) { border-right: 0; }
.mg-cell.other { background: #fafbfc; }
.mg-cell.other .mg-date { color: #a0aab5; }
.mg-cell.past { background-color: #f7f8fa; }
.mg-cell.today .mg-date { background: var(--accent); color: #fff; }
.mg-date { display: inline-block; min-width: 1.7em; text-align: center; border-radius: 999px; font-weight: 700; font-size: .85rem; text-decoration: none; color: var(--ink); margin-bottom: .15rem; }
.chip {
  display: block; font-size: .74rem; line-height: 1.3; padding: .08rem .35rem; margin-bottom: .15rem; border-radius: 4px; border-left: 3px solid;
  text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip.more { border: 0; color: var(--muted); }
.legend .chip { display: inline-block; margin-right: .3rem; }
@media (max-width: 600px) {
  .mg-cell { min-height: 64px; padding: .15rem; }
  .chip { font-size: .66rem; padding: .05rem .2rem; }
}

.banner { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; }
.banner-actions { display: flex; gap: .4rem; }
.flash-good { background: var(--good-soft); border-color: #9fd4b5; color: #12512e; }
.conflicts ul { margin: 0; padding-left: 1.2rem; }
.copyrow { display: flex; gap: .5rem; align-items: center; margin-top: .3rem; }
.copyrow input { margin: 0; font-size: .85rem; }
.queue { margin: 0; padding-left: 1.3rem; }
.upcoming li { padding: .3rem 0; border-bottom: 1px solid var(--line); list-style: none; }
.upcoming { padding: 0; margin: 0 0 .6rem; }

/* Booking length buttons */
.field { margin-bottom: .75rem; }
.field-label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .35rem; }
.durations { display: flex; flex-wrap: wrap; gap: .4rem; }
.dur {
  font: inherit; font-size: .95rem; font-weight: 600; padding: .5rem .8rem; border-radius: 999px; cursor: pointer;
  border: 1px solid #c5cfda; background: #fff; color: var(--accent);
}
.dur:hover { background: var(--accent-soft); }
.dur.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Chat ---------- */
.icon-link { display: inline-flex; align-items: center; }
.nav-badge, .badge {
  display: inline-block; min-width: 1.35em; padding: 0 .35em; margin-left: .35em; border-radius: 999px;
  background: #d93025; color: #fff; font-size: .72rem; font-weight: 700; line-height: 1.35em; text-align: center; vertical-align: 1px;
}
[hidden] { display: none !important; }
.btn-small { padding: .35rem .7rem; font-size: .88rem; }
.chat { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 1rem; margin-top: 1rem; height: calc(100vh - 140px); min-height: 460px; }
.chat-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; overflow-y: auto; }
.chat-list-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.chat-list-head h1 { margin: 0; font-size: 1.3rem; }
.convs { display: flex; flex-direction: column; gap: .15rem; margin-bottom: .6rem; }
.conv { display: block; padding: .5rem .6rem; border-radius: 8px; text-decoration: none; color: var(--ink); }
.conv:hover { background: var(--accent-soft); }
.conv.active { background: var(--accent); color: #fff; }
.conv.active .conv-last, .conv.active .muted { color: rgba(255, 255, 255, .8); }
.conv-top { display: flex; justify-content: space-between; align-items: center; gap: .4rem; }
.conv-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv.unread .conv-name { font-weight: 800; }
.conv-last { display: block; font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-main { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-height: 0; }
.chat-head { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
.chat-head h2 { margin: 0; font-size: 1.1rem; }
.chat-title { flex: 1; min-width: 0; }
.chat-back { display: none; font-size: 1.3rem; text-decoration: none; padding: 0 .3rem; }
.chat-msgs { flex: 1; overflow-y: auto; padding: .9rem; display: flex; flex-direction: column; gap: .45rem; }
.chat-empty { margin: auto; }
.chat-earlier { align-self: center; font-size: .85rem; margin: .3rem 0; }
.msg { max-width: min(78%, 560px); align-self: flex-start; background: #eef1f4; border-radius: 14px 14px 14px 4px; padding: .45rem .7rem; }
.msg.mine { align-self: flex-end; background: var(--accent); color: #fff; border-radius: 14px 14px 4px 14px; }
.msg.mine a { color: #fff; }
.msg.deleted { opacity: .65; }
.msg-sender { font-size: .75rem; font-weight: 700; color: var(--accent); margin-bottom: .1rem; }
.msg-body { white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
.msg-meta { font-size: .7rem; opacity: .7; margin-top: .15rem; text-align: right; }
.msg-del { background: none; border: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; padding: 0; opacity: .8; }
.chat-compose { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-compose textarea { margin: 0; resize: none; max-height: 9em; min-height: 2.6em; }
.people { list-style: none; padding: 0; margin: 0; }
.people li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.people li:last-child { border-bottom: 0; }
.people form { margin: 0; }
fieldset.checks { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .8rem; margin: 0 0 .8rem; }
fieldset.checks label.check { margin: .3rem 0; }
.table .center, .prefs .center { text-align: center; }
.prefs input[type=checkbox] { width: 1.2rem; height: 1.2rem; margin: 0 auto; display: inline-block; }

@media (max-width: 760px) {
  .chat { grid-template-columns: 1fr; height: calc(100vh - 150px); margin-top: .5rem; }
  .chat.show-list .chat-main { display: none; }
  .chat.show-conv .chat-list { display: none; }
  .chat-back { display: inline-block; }
  .msg { max-width: 88%; }
}

/* ---------- Fuel invoices ---------- */
.file-drop {
  display: flex; align-items: center; justify-content: center; position: relative; min-height: 5.5rem; margin: .4rem 0 .8rem;
  border: 2px dashed #b7c4d3; border-radius: var(--radius); background: var(--surface-2); color: var(--accent); cursor: pointer; text-align: center; padding: .8rem;
}
.file-drop:hover, .file-drop:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; width: 100%; height: 100%; }
.file-drop span { font-weight: 600; word-break: break-all; }
.inv-status { margin: .2rem 0 .6rem; }
.inv-read pre { white-space: pre-wrap; font-size: .78rem; max-height: 18rem; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .6rem; }
.inv-head { display: grid; gap: 0 .8rem; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, .5fr); }
@media (max-width: 700px) { .inv-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.inv-lines { min-width: 1000px; }
.inv-lines td { vertical-align: middle; }
.inv-lines input, .inv-lines select { margin: 0; padding: .35rem .45rem; font-size: .9rem; }
.inv-lines input.num { text-align: right; width: 6.5rem; }
.inv-lines select { width: 8.6rem; }
.inv-lines input[type=datetime-local] { width: 14.2rem; min-width: 0; }
.inv-lines td.ln { color: var(--muted); width: 1%; }
.inv-lines input[name="description[]"] { min-width: 11rem; }
.inv-lines input.loc { width: 8rem; }
input.bad-input { border-color: var(--bad); background: var(--bad-soft); }
.inv-totals { display: flex; gap: .8rem; justify-content: flex-end; flex-wrap: wrap; margin-top: .4rem; }
.inv-totals label { width: 9rem; }
.inv-totals input { text-align: right; }
.inv-checks { margin: .2rem 0 .9rem; }
.inv-checks > div { margin: .15rem 0; }
.inv-checks .price-line { margin-top: .5rem; padding: .45rem .6rem; background: var(--accent-soft); border-radius: 8px; color: var(--ink); }
.table tr.row-unmatched td { background: #fff7f6; }
.recon { min-width: 820px; }
.recon td { white-space: nowrap; }
.recon form.inline { display: inline-flex; gap: .4rem; align-items: center; margin-left: .3rem; }
.recon form.inline select { max-width: 16rem; }
.recon td form { margin: 0; }
.inv-tag { display: inline-block; font-size: .74rem; padding: .05rem .4rem; border-radius: 999px; background: var(--accent-soft); text-decoration: none; margin-top: .15rem; }
.stat .actions { gap: .4rem; flex-wrap: wrap; }
.stat .actions form { margin: 0; }
@media (max-width: 600px) { .inv-totals label { flex: 1 1 0; width: auto; min-width: 0; } }

/* ---------- Pilots ---------- */
.table.pilots { min-width: 640px; }
.lic-tag { display: inline-block; font-size: .74rem; font-weight: 700; padding: .05rem .4rem; border-radius: 6px; background: var(--accent); color: #fff; margin-right: .3rem; }
.endorse { display: flex; flex-wrap: wrap; gap: .2rem; margin-top: .25rem; }
.endorse span { font-size: .72rem; padding: .02rem .4rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
fieldset.sub-fields { border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .8rem .2rem; margin: .2rem 0 .9rem; min-width: 0; }
fieldset.sub-fields legend { font-weight: 700; font-size: .85rem; padding: 0 .3rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.checks2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .1rem .8rem; margin-bottom: .6rem; }
.checks2 label.check { margin: .2rem 0; font-size: .9rem; }
.pw-row { display: flex; gap: .4rem; align-items: center; }
.pw-row input { flex: 1; min-width: 0; }
.pw-row .btn { margin-top: .3rem; white-space: nowrap; }
.admin-override { border-color: #f2d39b; background: #fffaf0; }
.admin-override h2 { color: var(--warn); }
.override-note { margin-bottom: 1rem; }
.card.requested { border-color: #c9d9ea; background: var(--accent-soft); }
.card.requested .actions form { margin: 0; }
#booking-form { scroll-margin-top: 1rem; }

/* ---------- Maintenance & lists ---------- */
.flag-bad { background: var(--bad-soft); color: var(--bad); border: 1px solid #f3c0bc; font-weight: 700; }
.table.maint { min-width: 560px; }
.table.maint tr.st-overdue td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.table.maint tr.st-soon td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.task-row { display: flex; gap: .4rem; align-items: center; margin-bottom: .4rem; }
.task-row input { margin: 0; flex: 1; min-width: 0; }
#task-rows:empty { display: none; }
.hint-link { font-weight: 400; font-size: .82rem; margin-left: .4rem; }
.done-list { list-style: none; padding: 0; margin: .3rem 0 .8rem; }
.done-list li { padding: .25rem 0; }
.done-list label.check { margin: 0; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: .4rem 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }
.lists-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); align-items: start; }
.list-items { list-style: none; padding: 0; margin: 0 0 .8rem; }
.list-items li { display: flex; gap: .3rem; align-items: center; padding: .25rem 0; border-bottom: 1px solid var(--line); }
.list-items li.inactive .li-name input { color: var(--muted); text-decoration: line-through; }
.li-name { display: flex; flex: 1; min-width: 0; gap: .3rem; align-items: center; margin: 0; }
.li-name input { margin: 0; padding: .3rem .45rem; min-width: 0; }
.li-tools { display: flex; gap: .15rem; margin: 0; }
.li-tools .btn { padding: .25rem .45rem; }
.li-tools .btn[disabled] { opacity: .35; cursor: default; }
.li-add { display: flex; gap: .4rem; align-items: center; }
.li-add input { margin: 0; flex: 1; min-width: 0; }
.maint-due li { display: flex; justify-content: space-between; gap: .5rem; padding: .2rem 0; }
.free-parts { border-top: 1px solid #c9d9ea; margin-top: .6rem; padding-top: .5rem; }
.free-parts form { display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; margin: .4rem 0; }

/* Waitlist on the calendar: quiet hatched strips beside the booking they're waiting behind */
.wl-strip {
  position: absolute; z-index: 2; width: 6px; border-radius: 3px;
  background: repeating-linear-gradient(45deg, rgba(154, 91, 0, .55) 0 3px, rgba(154, 91, 0, .15) 3px 6px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .8);
}
.wl-strip.mine { background: repeating-linear-gradient(45deg, rgba(31, 78, 121, .7) 0 3px, rgba(31, 78, 121, .2) 3px 6px); }
.wl-strip:hover { width: 9px; }
.bk { padding-right: .7rem; }
.ag-wait { display: block; text-decoration: none; color: var(--warn); font-size: .85rem; margin-top: .25rem; padding: .15rem .55rem; border-left: 3px dashed #d9a441; }
.ag-wait.mine { color: var(--accent); border-left-color: var(--accent); }
.chip.wl-chip { background: repeating-linear-gradient(45deg, #fff3dc 0 4px, #fff 4px 8px); color: var(--warn); border: 1px dashed #d9a441; }
.ratings { font-size: .76rem; color: var(--muted); margin-top: .15rem; max-width: 15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table.flights.pilot-view { min-width: 620px; }
.lic-input { display: flex; align-items: stretch; margin-top: .3rem; }
.lic-input input { margin-top: 0; min-width: 0; }
.lic-prefix { display: flex; align-items: center; padding: 0 .55rem; background: var(--accent-soft); color: var(--accent); font-weight: 700; border: 1px solid #c5cfda; border-right: 0; border-radius: 8px 0 0 8px; }
.lic-prefix + input { border-radius: 0 8px 8px 0; }
.lic-prefix[hidden] + input { border-radius: 8px; }
.lic-no { font-variant-numeric: tabular-nums; letter-spacing: .02em; }

/* Batch import */
.inv-card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.inv-card-head label.check { margin: 0; font-size: 1.05rem; }
.inv-card .card-status { margin: 0 0 .8rem; }
.inv-card.saved { opacity: .75; }
.inv-card .raw pre { white-space: pre-wrap; font-size: .78rem; max-height: 14rem; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .6rem; }
.save-bar { position: sticky; bottom: .5rem; z-index: 5; box-shadow: 0 4px 16px rgba(16, 24, 40, .15); }
.save-bar .actions { margin-bottom: 0; }

/* Server settings and Graph certificate (Notifications, admins) */
.table.kv th { text-align: left; width: 7.5rem; color: var(--muted); font-weight: 600; vertical-align: top; }
.table.kv td { word-break: break-all; }
code.thumb { font-size: .85em; letter-spacing: .02em; }
#email-card h3 { margin: 1.25rem 0 .5rem; font-size: 1rem; }
#email-card .replace-cert { margin-top: .75rem; }
#email-card .ids-head { border-top: 1px solid var(--line); padding-top: 1rem; }
#server-settings code, #email-card code { word-break: break-all; }

/* ---------- Phone lists (used instead of wide tables on small screens) ---------- */
.m-list {
  display: none; list-style: none; margin: 0 0 1rem; padding: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.m-list > li { border-bottom: 1px solid var(--line); padding: .6rem .8rem; }
.m-list > li:last-child { border-bottom: 0; }
.m-list .m-link { display: block; color: inherit; text-decoration: none; margin: -.6rem -.8rem; padding: .6rem .8rem; position: relative; }
.m-list .m-link:active { background: var(--accent-soft); }
.m-row { display: flex; align-items: baseline; gap: .55rem; min-width: 0; }
.m-date { flex: none; width: 3.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.m-main { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-right { margin-left: auto; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; flex: none; }
.m-big { font-weight: 700; }
.m-big small { font-weight: 500; color: var(--muted); font-size: .8em; }
.m-sub { font-size: .84rem; color: var(--muted); padding-left: 4.05rem; margin-top: .1rem; }
.m-sub > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-sub.m-flush, .m-summary .m-sub { padding-left: 0; }
.m-wrap { white-space: normal; }
.m-tags { padding-left: 4.05rem; margin-top: .25rem; }
.m-tags .flag, .m-tags .ok-tag, .m-sub .flag, .m-sub .ok-tag { font-size: .72rem; margin-bottom: 0; }
.m-edit { position: absolute; right: .8rem; bottom: .55rem; font-size: .78rem; color: var(--accent); font-weight: 600; }
.m-fuel .m-link { padding-bottom: 1.5rem; }
.m-list li.row-warn { background: #fffaf0; }
.m-list li.row-correction { background: var(--accent-soft); }
.m-list .m-total { display: flex; justify-content: space-between; gap: .6rem; background: var(--surface-2); font-size: .92rem; }
.m-list .m-empty { text-align: center; color: var(--muted); padding: 1.4rem .8rem; }
.statement .m-flat { box-shadow: none; margin: 0 -.2rem; }
.m-only { display: none; }

/* ---------- Phones ---------- */
@media screen and (max-width: 640px) {
  .m-list { display: block; }
  .m-hide { display: none !important; }
  .m-only { display: inline; }
}

@media screen and (max-width: 760px) {
  body.signed-in { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .wrap { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }

  /* Top bar: one slim row */
  .topbar-inner { flex-wrap: nowrap; min-height: 54px; gap: .4rem; }
  .brand { font-size: 1.02rem; gap: .45rem; min-width: 0; }
  .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .brand img { height: 40px; margin: 3px 0; }
  .usermenu { flex: none; }
  .menu-btn .who-full { display: none; }
  .menu-btn .who-short { display: inline; max-width: 7.5rem; overflow: hidden; text-overflow: ellipsis; }
  .menu-panel {
    position: fixed; top: 58px; right: max(8px, env(safe-area-inset-right)); width: min(300px, calc(100vw - 16px));
    max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px);
  }
  .menu-panel a { padding: .65rem .6rem; }
  .menu-panel .phone-only { display: flex; }

  /* Main pages move to a tab bar at the bottom of the screen */
  .mainnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; flex: none; gap: 0; overflow: visible;
    background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); box-shadow: 0 -2px 14px rgba(16, 24, 40, .08);
    padding: 4px max(4px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
    -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  }
  .mainnav a {
    flex: 1 1 0; min-width: 0; flex-direction: column; gap: 1px; padding: 4px 2px 3px; color: #627285;
    font-size: .7rem; font-weight: 600; border-radius: 10px; -webkit-tap-highlight-color: transparent;
  }
  .mainnav a:hover { background: none; color: var(--accent); }
  .mainnav a.active { background: none; color: var(--accent); font-weight: 700; }
  .mainnav .nav-ico { display: flex; align-items: center; justify-content: center; width: 54px; height: 30px; border-radius: 999px; transition: background .15s; }
  .mainnav a.active .nav-ico { background: var(--accent-soft); }
  .mainnav .nav-label-full:not(:last-child) { display: none; }
  .mainnav .nav-label-tab { display: block; }
  .mainnav a.no-tab { display: none; }
  /* Slides down out of the way while you scroll down; back when you scroll up (app.js) */
  .mainnav { transition: transform .25s ease, box-shadow .25s ease; }
  body.nav-hidden .mainnav { transform: translateY(calc(100% + 4px)); box-shadow: none; }
  .mainnav .nav-badge { position: absolute; top: -1px; right: 6px; margin: 0; font-size: .64rem; box-shadow: 0 0 0 2px #fff; }

  /* Comfortable sizes for thumbs; 16px inputs so iPhones don't zoom in */
  input, select, textarea { font-size: 16px; }
  h1 { font-size: 1.35rem; margin: 1rem 0 .7rem; }
  .card { padding: 1rem .95rem; }
  .btn-small { padding: .45rem .75rem; }
  .pagehead { gap: .4rem 1rem; }
  .pagehead h1 { margin-bottom: .3rem; }
  .toolbar { gap: .5rem; }
  .footer { padding: 1.2rem 12px .6rem; text-align: center; }

  .notice { font-size: .86rem; }

  /* Statement heading stacks */
  .statement-head { flex-wrap: wrap; gap: .3rem .8rem; }
  .statement-head .statement-title { flex: 1 1 60%; }
  .statement-head > .right { flex-basis: 100%; text-align: left; }
  .statement-logo { height: 46px; }
  .statement-head h2 { font-size: 1rem; }
  .totals dl { min-width: 0; width: 100%; }

  /* Month view: coloured bars; tap a day to see it */
  .mg-cell { position: relative; min-height: 58px; }
  .mg-date::after { content: ""; position: absolute; inset: 0; }
  .mg-cell .chip { font-size: 0; height: 5px; padding: 0; border: 0; border-radius: 3px; margin: 0 0 2px; }
  .mg-cell .chip.bk-own { background: var(--own); }
  .mg-cell .chip.bk-other { background: var(--other); }
  .mg-cell .chip.bk-maint { background: var(--maint); }
  .mg-cell .chip.wl-chip { background: repeating-linear-gradient(90deg, #d9a441 0 4px, transparent 4px 7px); }
  .mg-cell .chip.more { display: none; }

  /* Chat fills the screen between the top bar and the tab bar (below any notices) */
  body.page-chat main.wrap {
    display: flex; flex-direction: column; padding-bottom: .5rem;
    height: calc(100vh - 54px - 66px - env(safe-area-inset-bottom)); height: calc(100dvh - 54px - 66px - env(safe-area-inset-bottom));
  }
  body.page-chat .chat { flex: 1 1 auto; height: auto; min-height: 0; }
  body.page-chat .notices { flex: none; }
  body.page-chat .footer { display: none; }

  body.typing .mainnav { display: none; }
  body.typing.signed-in { padding-bottom: 0; }
  body.page-chat.typing main.wrap { height: calc(100vh - 54px); height: calc(100dvh - 54px); }
  .save-bar { bottom: calc(72px + env(safe-area-inset-bottom)); }
  body.typing .save-bar { bottom: .5rem; }
}

/* Logins: invites and reset links */
.login-status { margin: .1rem 0 .4rem; }
.login-status .flag { margin-right: .4rem; }
.login-fields .actions { margin: .3rem 0 .8rem; }
.login-link { border: 1px solid #c9d9ea; background: var(--accent-soft); border-radius: 8px; padding: .6rem .7rem; margin: .4rem 0 .9rem; }
.login-link.needs-sending { border-color: #f2d39b; background: var(--warn-soft); }
.login-link p { margin: 0 0 .35rem; }
.login-link .copyrow input { font-size: .85rem; }
.login-link .hint { margin: .35rem 0 0; }
.username { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; color: var(--ink); }

/* ---------- v1.9: routes, aerodromes, aircraft, procedures ---------- */
.locked-field { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem .75rem; border: 1px dashed #c5cfda; border-radius: 8px; background: var(--surface-2); color: var(--ink); font-size: 1.05rem; }
.locked-field svg { color: var(--muted); flex: none; }
.route-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .3rem; }
.rt-pt { position: relative; display: inline-flex; align-items: center; }
.rt-pt .ap-wrap { width: 6.6rem; }
.big-inputs .rt-pt input, .rt-pt input { margin: 0; text-align: center; font-weight: 700; letter-spacing: .03em; padding: .55rem .35rem; font-size: 1rem; }
.rt-stop .ap-wrap { width: 6.2rem; }
.big-inputs .rt-stop input, .rt-stop input { padding-right: 1.3rem; }
.rt-x { position: absolute; right: .15rem; top: 50%; transform: translateY(-50%); z-index: 2; border: 0; background: none; color: var(--muted); font-size: 1.15rem; line-height: 1; cursor: pointer; padding: .25rem; }
.rt-x:hover { color: var(--bad); }
.rt-arrow { color: var(--muted); font-weight: 700; }
.rt-add { border: 1px dashed #b7c4d3; background: none; color: var(--accent); border-radius: 999px; padding: .45rem .75rem; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; margin-left: .15rem; }
.rt-add:hover { background: var(--accent-soft); }
.rt-summary { margin: .4rem 0 0; font-size: .85rem; color: var(--muted); line-height: 1.45; }
.rt-summary:empty { display: none; }
.rt-dist { color: var(--accent); font-weight: 600; }
.rt-bad { color: var(--warn); }
input.ap-unknown-input { border-color: #e0b25a; background: #fffaf0; }
input.ap-ok { border-color: #b9cde0; }
.route-row .ap-list { min-width: 17rem; text-align: left; }
@media (max-width: 380px) { .rt-pt .ap-wrap { width: 5.8rem; } .rt-stop .ap-wrap { width: 5.6rem; } }

.ap-wrap { position: relative; }
.ap-list {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin: 2px 0 0; padding: .25rem; list-style: none; max-height: 18rem; overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(16, 24, 40, .18); font-weight: 400; font-size: .92rem;
}
.ap-list li { padding: .45rem .55rem; border-radius: 6px; cursor: pointer; line-height: 1.3; }
.ap-list li:hover, .ap-list li.on { background: var(--accent-soft); }
.ap-list li.ap-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); cursor: default; padding: .3rem .55rem .15rem; }
.ap-list li.ap-head:hover { background: none; }
.ap-info { font-size: .8rem; font-weight: 400; color: var(--muted); margin-top: .2rem; min-height: 1em; }
.ap-info:empty { display: none; }
.ap-unknown { color: var(--warn); }
.ap-tag { display: inline-block; font-size: .68rem; font-weight: 700; padding: 0 .35rem; border-radius: 999px; background: var(--warn-soft); color: var(--warn); border: 1px solid #f2d39b; vertical-align: 1px; }

.aero-map { height: 340px; border-radius: 8px; border: 1px solid var(--line); background: #eef1f4; }
.aero-picker { height: 300px; border-radius: 8px; border: 1px solid var(--line); background: #eef1f4; margin: .3rem 0 .8rem; }
.map-credit { margin: .4rem 0 0; }
.aero-list li { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; }
.map-dialog { width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 24px); border: 0; border-radius: 14px; padding: 1rem; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.map-dialog::backdrop { background: rgba(16, 24, 40, .45); }
.map-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .6rem; font-size: 1.05rem; }
.route-map { height: min(60vh, 480px); border-radius: 8px; border: 1px solid var(--line); }
.route-label { font-weight: 700; font-size: .75rem; padding: 1px 5px; }
.leaflet-container { font: inherit; }

.log-card { border-color: #c9d9ea; }
.log-card h2 { margin-bottom: .4rem; }
.log-card ul.plain li { font-size: .92rem; }
.to-log-row { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }

.ac-picker { margin-bottom: .8rem; }
.ac-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.ac-reg { font-size: 1.6rem; font-weight: 800; letter-spacing: .02em; }
.ac-ttaf { display: flex; flex-direction: column; align-items: flex-end; gap: .1rem; }
.ac-ttaf strong { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.subtabs { display: flex; gap: .2rem; border-bottom: 2px solid var(--line); margin: 0 0 1rem; overflow-x: auto; }
.subtabs a { padding: .55rem .9rem; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.subtabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.subtabs .count { display: inline-block; min-width: 1.4em; text-align: center; font-size: .75rem; background: var(--accent-soft); border-radius: 999px; padding: 0 .3em; margin-left: .2rem; }
.ac-info { position: relative; }
.ac-edit { position: absolute; top: .8rem; right: .9rem; margin: 0; }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: .4rem 2rem; }
.spec-grid .facts { align-content: start; padding: .4rem 0; border-top: 1px solid var(--line); }
.spec-grid .facts:first-child, .spec-grid .facts:nth-child(2) { border-top: 0; }
.doc-list { list-style: none; padding: 0; margin: 0 0 .8rem; }
.doc-list li { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.doc-list li:last-child { border-bottom: 0; }
.doc-list form { margin: 0; }
.doc-link { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); min-width: 0; }
.doc-link strong { color: var(--accent); }
.doc-ext { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; border-radius: 8px; background: var(--bad-soft); color: var(--bad); font-weight: 800; font-size: .72rem; }
.doc-upload { border-top: 1px solid var(--line); padding-top: .6rem; margin-top: .6rem; }

.proc-toc { display: flex; flex-wrap: wrap; gap: .3rem .5rem; padding: .7rem .9rem; }
.proc-toc a { padding: .3rem .7rem; border-radius: 999px; background: var(--accent-soft); text-decoration: none; font-weight: 600; font-size: .9rem; }
.proc { scroll-margin-top: 1rem; }
.proc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.proc-head h2 { font-size: 1.3rem; }
.proc-tools { display: flex; gap: .3rem; align-items: center; }
.proc-tools form { display: flex; gap: .2rem; margin: 0; }
.proc-tools .btn[disabled] { opacity: .35; }
.proc-updated { margin: .6rem 0 0; }
.proc-body { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; line-height: 1.45; }
.prose { line-height: 1.55; }
.prose h3 { font-size: 1.05rem; margin: 1rem 0 .3rem; color: var(--accent); }
.prose h4 { font-size: .95rem; margin: .8rem 0 .25rem; }
.prose p { margin: .3rem 0 .6rem; }
.prose ul, .prose ol { margin: .3rem 0 .7rem; padding-left: 1.4rem; }
.prose li { margin: .15rem 0; }
@media screen and (max-width: 640px) {
  .ac-reg { font-size: 1.35rem; }
  .ac-edit { position: static; text-align: right; margin-bottom: .3rem; }
  .aero-map { height: 260px; }
  .map-dialog { padding: .8rem; }
}

/* Points of interest */
.poi-list { list-style: none; margin: 0; padding: 0; }
.poi-list li { padding: .7rem 0; border-bottom: 1px solid var(--line); scroll-margin-top: 1rem; }
.poi-list li:last-child { border-bottom: 0; }
.poi-list li.on { background: var(--accent-soft); margin: 0 -.6rem; padding-left: .6rem; padding-right: .6rem; border-radius: 8px; }
.poi-top { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; }
.poi-name { font-size: 1.02rem; font-weight: 700; text-decoration: none; padding: 0; }
.poi-list .prose { margin: .2rem 0; }
.poi-list .prose p { margin: .2rem 0; }
.poi-coords { display: flex; flex-wrap: wrap; gap: .1rem .5rem; align-items: baseline; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 600; }

/* Fly-over points (points of interest) in a booked route */
.rt-poi { gap: .2rem; max-width: 12rem; background: var(--good-soft); border: 1px solid #9fd4b5; color: #12512e; border-radius: 999px; padding: .45rem 1.5rem .45rem .7rem; font-size: .9rem; font-weight: 600; }
.rt-poi-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-poi .rt-x { right: .3rem; color: #3d7a57; }
.rt-poi-txt { color: var(--good); font-weight: 600; }
.rt-add-poi { border-color: #9fd4b5; color: var(--good); }
.rt-add-poi:hover { background: var(--good-soft); }
.route-label-poi { color: #12512e; }
.fo-dialog .fo-map { height: min(42vh, 340px); }
.fo-filter { margin: .7rem 0 0; }
.fo-list { list-style: none; margin: .5rem 0 .3rem; padding: 0; max-height: 34vh; overflow-y: auto; }
.fo-list li { display: flex; align-items: center; gap: .6rem; border-bottom: 1px solid var(--line); }
.fo-list li:last-child { border-bottom: 0; }
.fo-pick { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: .55rem .2rem; font: inherit; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; gap: .1rem; }
.fo-pick:hover:not(:disabled) .fo-name { text-decoration: underline; }
.fo-pick:disabled { cursor: default; opacity: .6; }
.fo-name { font-weight: 700; color: var(--good); }
.fo-note { font-size: .82rem; color: var(--muted); }
.fo-extra { font-size: .82rem; color: var(--muted); white-space: nowrap; }
.poi-book { white-space: nowrap; }
