/* swagapilots.com — design system
   Light "chart paper" theme: paper background, ink navy, bold blue primary,
   sectional magenta accent. */

:root {
  --paper: #f6f4ee;
  --panel: #ffffff;
  --ink: #1c2740;
  --ink-soft: #55617e;
  --line: #e3ded2;
  --blue: #304CB2;
  --blue-deep: #22335c;
  --magenta: #b23a70;
  --yellow: #f5a800;
  --teal: #0e7c7b;
  --green: #2e7d32;
  --orange: #e07020;
  --purple: #7b4bb7;
  --sw-gold: #E9AC5E;   /* retro Southwest desert gold */
  --sw-red: #FF0000;
  --sw-orange: #FC7436;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(28, 39, 64, .08), 0 10px 32px rgba(28, 39, 64, .07);
  --font: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Barlow Semi Condensed', 'Barlow', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* The app toggles visibility via the hidden attribute; without this, any rule
   that sets display (e.g. .modal-back{display:flex}) overrides it and every
   modal renders open on page load. */
[hidden] { display: none !important; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; }
code { background: #eee9db; padding: .1em .35em; border-radius: 5px; font-size: .9em; }

/* ── buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  font: 600 15px/1 var(--font); color: var(--ink);
  background: #fff; border: 1.5px solid var(--line);
  padding: 10px 18px; border-radius: 10px; cursor: pointer;
  transition: transform .08s, box-shadow .15s, background .15s;
  text-decoration: none !important; white-space: nowrap;
}
.btn:hover { box-shadow: 0 3px 10px rgba(28,39,64,.12); transform: translateY(-1px); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: #2a43a0; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: rgba(28,39,64,.06); box-shadow: none; }
.btn-lg { padding: 14px 26px; font-size: 17px; border-radius: 12px; }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn-warn { color: #a33; }
.btn-block { width: 100%; }

/* ── top navigation (marketing pages) ────────────────────────── */
.topnav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(246, 244, 238, .92); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none !important; }
/* Name in ink with the retro livery as accents: orange GA + the classic
   gold/red/orange stripe underneath. */
.brand-text { font: 700 20px var(--font-display); color: var(--blue-deep); letter-spacing: .02em; }
.brand-text em { font-style: normal; color: var(--sw-orange); }
.brand-text::after {
  content: ''; display: block; height: 3.5px; border-radius: 2px; margin-top: 1px;
  background: linear-gradient(90deg,
    var(--sw-gold) 0 34%, var(--sw-red) 34% 67%, var(--sw-orange) 67% 100%);
}
.topnav-links { display: flex; align-items: center; gap: clamp(8px, 2vw, 22px); }
.topnav-links a { font-weight: 600; color: var(--ink); }

.page-main { min-height: 62vh; }
.flash-stack { max-width: 560px; margin: 18px auto 0; padding: 0 16px; }
.flash {
  background: #fdf3e3; border: 1px solid #efd9a7; color: #7a5b12;
  border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; font-weight: 500;
}

/* ── hero ────────────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; }
.hero-chart {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(180deg, rgba(246,244,238,.88) 0%, rgba(246,244,238,.62) 45%, rgba(246,244,238,.97) 100%),
    url('https://tiles.arcgis.com/tiles/ssFJjBXIUyZDrSYZ/arcgis/rest/services/VFR_Sectional/MapServer/tile/8/93/52'),
    url('https://tiles.arcgis.com/tiles/ssFJjBXIUyZDrSYZ/arcgis/rest/services/VFR_Sectional/MapServer/tile/8/93/53');
  background-size: cover, 512px, 512px;
  background-position: center, 0 0, 512px 0;
}
.hero-inner {
  position: relative; max-width: 860px; margin: 0 auto;
  padding: clamp(56px, 11vw, 130px) 20px clamp(48px, 8vw, 96px);
  text-align: center;
}
.hero-kicker {
  font: 700 14px var(--font-display); letter-spacing: .18em; text-transform: uppercase;
  color: var(--sw-orange); margin: 0 0 14px;
}
.hero h1 { font-size: clamp(40px, 7vw, 68px); margin: 0 0 18px; color: var(--blue-deep); font-weight: 700; }
.hero h1 .accent { color: var(--blue); }
.hero-sub { font-size: clamp(17px, 2.4vw, 21px); color: var(--ink-soft); max-width: 640px; margin: 0 auto 30px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-fine { color: var(--ink-soft); font-size: 14px; margin-top: 18px; }

/* ── features ────────────────────────────────────────────────── */
.features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px; max-width: 1100px; margin: 0 auto; padding: 10px 20px 70px;
}
.feature {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.feature-dot { width: 34px; height: 6px; border-radius: 3px; margin-bottom: 14px; }
.feature h3 { margin: 0 0 8px; font-size: 20px; }
.feature p { margin: 0; color: var(--ink-soft); font-size: 15px; }

/* ── auth cards ──────────────────────────────────────────────── */
.auth-card {
  max-width: 440px; margin: clamp(30px, 7vw, 80px) auto; background: var(--panel);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 40px);
}
.auth-card h1 { margin: 0 0 6px; font-size: 30px; color: var(--blue-deep); }
.auth-sub { color: var(--ink-soft); margin: 0 0 22px; font-size: 15px; }
.auth-card label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 14px; }
.auth-card input {
  display: block; width: 100%; margin-top: 5px; padding: 11px 12px;
  border: 1.5px solid var(--line); border-radius: 10px; font: 500 16px var(--font);
  background: #fdfcf9; color: var(--ink);
}
.auth-card input:focus { outline: none; border-color: var(--blue); background: #fff; }
.auth-card .btn { margin-top: 6px; }
.auth-alt { text-align: center; margin-top: 18px; font-size: 14px; color: var(--ink-soft); }
.opt { font-weight: 400; color: var(--ink-soft); font-size: 12.5px; }

/* ── resources ───────────────────────────────────────────────── */
.res-wrap { max-width: 1000px; margin: 0 auto; padding: clamp(28px, 5vw, 56px) 20px 70px; }
.res-wrap h1 { color: var(--blue-deep); font-size: clamp(30px, 5vw, 42px); margin-bottom: 4px; }
.res-sub { color: var(--ink-soft); margin: 0 0 28px; }
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.res-card {
  display: block; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none !important;
  transition: transform .1s, box-shadow .2s;
}
.res-card:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(28,39,64,.14); }
.res-card h3 { margin: 0 0 6px; color: var(--blue-deep); font-size: 19px; }
.res-card p { margin: 0 0 12px; color: var(--ink-soft); font-size: 14.5px; }
.res-link { font-weight: 700; color: var(--magenta); font-size: 14px; }
.sponsor-card {
  margin-top: 34px; padding: 18px 22px; border-radius: var(--radius);
  background: #fff8ea; border: 1px solid #efd9a7; font-size: 15px;
}
.sponsor-card span { color: var(--ink-soft); margin-right: 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; }

/* ── admin ───────────────────────────────────────────────────── */
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 30px 20px 80px; }
.admin-wrap h2 { margin: 36px 0 10px; color: var(--blue-deep); }
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 14px 0 6px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 22px; text-align: center; box-shadow: var(--shadow);
}
.stat b { display: block; font-size: 26px; color: var(--blue); font-family: var(--font-display); }
.stat span { font-size: 13px; color: var(--ink-soft); }
.admin-table {
  width: 100%; border-collapse: collapse; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 14px;
}
.admin-table th { text-align: left; background: #eee9db; padding: 8px 10px; font-family: var(--font-display); }
.admin-table td { padding: 7px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.admin-table tr.inactive td { opacity: .45; }
.admin-table .actions form { display: flex; gap: 6px; }
.admin-table td.wrap { max-width: 380px; overflow-wrap: anywhere; }

/* ── footer ──────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); background: #efece2; }
.footer-inner {
  max-width: 1100px; margin: 0 auto; padding: 28px 20px;
  display: flex; gap: 30px; justify-content: space-between; flex-wrap: wrap; font-size: 14px;
}
.footer-fine { color: var(--ink-soft); font-size: 12.5px; max-width: 480px; }
.sponsor { margin-top: 8px; font-weight: 600; }

/* ════════════════════════════════════════════════════════════════
   MAP APP
   ════════════════════════════════════════════════════════════════ */
body.mapapp { overflow: hidden; height: 100dvh; display: flex; flex-direction: column; }

.appbar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--line);
  z-index: 1200; position: relative; flex-wrap: wrap;
}
.brand-compact img { display: block; }
.routebar { display: flex; gap: 6px; flex: 1 1 340px; min-width: 240px; }
.routebar input {
  flex: 1; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  font: 600 15px var(--font); letter-spacing: .04em; text-transform: uppercase;
  background: #fdfcf9; color: var(--ink); min-width: 0;
}
.routebar input::placeholder { text-transform: none; letter-spacing: 0; font-weight: 400; }
.routebar input:focus { outline: none; border-color: var(--blue); }

.searchwrap { position: relative; flex: 0 1 220px; min-width: 150px; }
.searchwrap input {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  font: 500 14px var(--font); background: #fdfcf9; color: var(--ink);
}
.searchwrap input:focus { outline: none; border-color: var(--blue); }
.search-results {
  position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); overflow: hidden; z-index: 1300;
}
.search-results button {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: 8px 12px; font: 500 14px var(--font); cursor: pointer; color: var(--ink);
}
.search-results button:hover { background: #f0ede2; }
.search-results b { color: var(--blue); }

.usermenu { position: relative; }
.user-drop {
  position: absolute; right: 0; top: 110%; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  min-width: 200px; padding: 6px; z-index: 1400;
}
.user-drop a { display: block; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--ink); }
.user-drop a:hover { background: #f0ede2; text-decoration: none; }
.user-name { padding: 8px 12px 4px; font: 700 13px var(--font-display); color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; }

#map { flex: 1; z-index: 1; background: #dfe8ec; }
.leaflet-container { font-family: var(--font); }

/* airport hover tooltip */
.apt-tip {
  background: var(--ink); color: #fff; border: 0; border-radius: 8px;
  padding: 5px 10px; font: 600 13px var(--font); box-shadow: 0 3px 12px rgba(0,0,0,.3);
}
.apt-tip::before { display: none; }
.apt-tip .tip-sub { display: block; font-weight: 400; font-size: 12px; opacity: .85; }

/* pin divIcons */
.pin-ico { filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }

/* ── layers panel ────────────────────────────────────────────── */
.layers-panel {
  position: absolute; top: 64px; left: 12px; z-index: 1100;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); width: 232px; overflow: hidden;
}
.layers-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: none; border: 0; padding: 10px 14px; cursor: pointer;
  font: 700 14px var(--font-display); color: var(--blue-deep); letter-spacing: .04em;
}
.layers-body { padding: 2px 14px 12px; }
.layers-panel.collapsed .layers-body { display: none; }
.layers-panel.collapsed { width: auto; }
.layers-section { border-top: 1px solid var(--line); padding: 9px 0; }
.lhead { font: 700 11.5px var(--font-display); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); margin-bottom: 5px; }
.lrow { display: flex; align-items: center; gap: 7px; font: 500 14px var(--font); padding: 3px 0; cursor: pointer; }
.lrow input { accent-color: var(--blue); width: 15px; height: 15px; }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
#sectionalOpacity { width: 100%; accent-color: var(--blue); margin-top: 4px; }
.layers-note { font-size: 12px; color: var(--magenta); padding-top: 8px; font-weight: 600; }

/* ── detail panel ────────────────────────────────────────────── */
.detail-panel {
  position: absolute; top: 64px; right: 12px; bottom: 12px; width: 390px; max-width: calc(100vw - 24px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); z-index: 1100; overflow-y: auto; padding: 18px 18px 24px;
}
.panel-close {
  position: absolute; top: 10px; right: 10px; background: #f0ede2; border: 0;
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 14px; color: var(--ink);
  z-index: 3;
}
.dp-ident { font: 700 13px var(--font-display); letter-spacing: .12em; color: var(--magenta); text-transform: uppercase; }
.dp-name { font: 700 24px/1.15 var(--font-display); color: var(--blue-deep); margin: 2px 0 2px; padding-right: 26px; }
.dp-sub { color: var(--ink-soft); font-size: 14px; margin-bottom: 10px; }
.dp-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.badge {
  font: 600 12px var(--font); padding: 3px 9px; border-radius: 999px;
  background: #eee9db; color: var(--ink);
}
.badge.warn { background: #fbe3e3; color: #8c2b2b; }
.badge.blue { background: #e2e8fb; color: var(--blue); }
.badge.green { background: #e0efe1; color: var(--green); }
.dp-section { border-top: 1px solid var(--line); padding: 12px 0; }
.dp-section h4 { margin: 0 0 8px; font: 700 12.5px var(--font-display); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); }
.rwy-table { width: 100%; font-size: 14px; border-collapse: collapse; }
.rwy-table td { padding: 4px 6px 4px 0; border-top: 1px dashed var(--line); }
.rwy-table tr:first-child td { border-top: 0; }
.freq-list { margin: 0; padding: 0; list-style: none; font-size: 14px; }
.freq-list li { display: flex; justify-content: space-between; padding: 3px 0; }
.freq-list b { font-variant-numeric: tabular-nums; }
.dp-links { display: flex; flex-wrap: wrap; gap: 8px; }
.dp-note { white-space: pre-wrap; font-size: 14.5px; }
.dp-pin { border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; font-size: 14px; }
.dp-pin h5 { margin: 0 0 3px; font-size: 15px; }
.dp-meta { color: var(--ink-soft); font-size: 12.5px; margin-top: 10px; }
.strip-fact { display: flex; justify-content: space-between; font-size: 14px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.strip-fact b { text-align: right; }
.diff-pill { font-weight: 800; padding: 2px 10px; border-radius: 999px; color: #fff; }

/* ── route drawer ────────────────────────────────────────────── */
.route-drawer {
  position: absolute; left: 12px; right: 12px; bottom: 12px; max-height: 42vh;
  margin: 0 auto; max-width: 760px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  z-index: 1150; display: flex; flex-direction: column;
}
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.drawer-head strong { font-family: var(--font-display); color: var(--blue-deep); }
#routeTotals { color: var(--ink-soft); font-size: 14px; font-weight: 600; }
.tas { margin-left: auto; font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.tas input { width: 58px; padding: 4px 6px; border: 1.5px solid var(--line); border-radius: 8px; font: 600 14px var(--font); }
.drawer-scroll { overflow-y: auto; }
.route-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.route-table th { position: sticky; top: 0; background: #eee9db; text-align: left; padding: 6px 12px; font-family: var(--font-display); font-size: 12.5px; letter-spacing: .06em; }
.route-table td { padding: 6px 12px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.route-table td:first-child, .route-table td:nth-child(2) { font-weight: 600; }

/* ── FABs ────────────────────────────────────────────────────── */
.fabs { position: absolute; right: 14px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; z-index: 1100; }
.fab {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--panel); color: var(--blue-deep); font-size: 20px; cursor: pointer;
  box-shadow: var(--shadow);
}
.fab-accent { background: var(--magenta); border-color: var(--magenta); color: #fff; font-size: 26px; line-height: 1; }

/* ── modals ──────────────────────────────────────────────────── */
.modal-back {
  position: fixed; inset: 0; background: rgba(28, 39, 64, .45); z-index: 2000;
  display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 4vh 12px;
}
.modal {
  background: var(--panel); border-radius: 16px; box-shadow: var(--shadow);
  max-width: 640px; width: 100%; padding: 22px; position: relative; margin-bottom: 6vh;
}
.modal-sm { max-width: 480px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.modal-head h2 { margin: 0; font-size: 24px; color: var(--blue-deep); }
.modal-hint { font-size: 14px; color: var(--ink-soft); margin: 4px 0 16px; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.grid-form label { font: 600 13px var(--font); display: flex; flex-direction: column; gap: 4px; }
.grid-form .span2 { grid-column: span 2; }
.grid-form input, .grid-form select, .grid-form textarea {
  padding: 9px 10px; border: 1.5px solid var(--line); border-radius: 9px;
  font: 500 15px var(--font); background: #fdfcf9; color: var(--ink); width: 100%;
}
.grid-form input:focus, .grid-form select:focus, .grid-form textarea:focus { outline: none; border-color: var(--blue); background: #fff; }
.grid-form .check { flex-direction: row; align-items: center; font-size: 14px; }
.grid-form .check input { width: auto; accent-color: var(--blue); }
.wordcount { font: 500 12px var(--font); color: var(--ink-soft); text-align: right; }
.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.form-hint { font-size: 12.5px; color: var(--ink-soft); }
.form-errors { background: #fbe3e3; color: #8c2b2b; border-radius: 9px; padding: 9px 12px; font-size: 14px; font-weight: 500; }

/* events search */
.events-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.events-bar input {
  flex: 1 1 240px; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 9px;
  font: 600 15px var(--font); text-transform: uppercase; background: #fdfcf9; min-width: 0;
}
.events-bar input::placeholder { text-transform: none; font-weight: 400; }
.events-bar select { padding: 9px 8px; border: 1.5px solid var(--line); border-radius: 9px; font: 500 14px var(--font); background: #fdfcf9; }
.events-results { max-height: 52vh; overflow-y: auto; }
.ev-count { font-weight: 700; color: var(--blue-deep); margin: 4px 0 10px; }
.ev-empty { color: var(--ink-soft); }
.ev-row {
  display: flex; gap: 12px; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px; cursor: pointer; background: #fdfcf9;
}
.ev-row:hover { border-color: var(--blue); }
.ev-date {
  flex: 0 0 auto; font: 700 13px var(--font-display); color: var(--magenta);
  min-width: 82px; font-variant-numeric: tabular-nums;
}
.ev-main { min-width: 0; }
.ev-main b { font-size: 15px; }
.ev-sub { font-size: 13px; color: var(--ink-soft); overflow-wrap: anywhere; }

/* find a pilot */
.drop-sep { height: 1px; background: var(--line); margin: 6px 8px; }
.pilot-results { max-height: 56vh; overflow-y: auto; }
.pilot-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; background: #fdfcf9; }
.pilot-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.pilot-head b { font: 700 17px var(--font-display); color: var(--blue-deep); }
.pilot-emp { font: 600 12px var(--font); color: #fff; background: var(--blue); border-radius: 999px; padding: 2px 9px; }
.pilot-joined { font-size: 12px; color: var(--ink-soft); }
.pilot-none { font-size: 13.5px; color: var(--ink-soft); font-style: italic; }
.pilot-chips { display: flex; flex-direction: column; gap: 6px; }
.pilot-chip {
  display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff;
}
.pilot-chip:hover { border-color: var(--blue); background: #f6f8ff; }
.pilot-chip em { font-style: normal; color: var(--ink-soft); font-size: 12px; margin-left: auto; white-space: nowrap; }

/* event alerts */
.alerts-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.alert-row {
  display: flex; align-items: center; gap: 12px; border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; background: #fdfcf9;
}
.alert-row.off { opacity: .5; }
.alert-main { flex: 1; min-width: 0; }
.alert-main b { font: 700 15px var(--font-display); color: var(--blue-deep); }
.alert-sub { font-size: 12.5px; color: var(--ink-soft); }
.alert-form { border-top: 1px solid var(--line); padding-top: 14px; }
.alert-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.alert-form label { font: 600 13px var(--font); display: flex; flex-direction: column; gap: 4px; }
.alert-form input[type=text], .alert-form input[type=email], .alert-email-row input {
  padding: 9px 10px; border: 1.5px solid var(--line); border-radius: 9px;
  font: 500 15px var(--font); background: #fdfcf9; width: 100%;
}
.alert-form input[name=airport] { text-transform: uppercase; }
.alert-email-row { margin-bottom: 12px; }
.alert-email-row label { font: 600 13px var(--font); display: flex; flex-direction: column; gap: 4px; }
#alertRadius { accent-color: var(--blue); }
#alertRadiusVal { font-weight: 400; color: var(--blue); }
.alert-toggles { display: flex; gap: 18px; margin: 12px 0; flex-wrap: wrap; }
.alert-toggles .check { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; }
.alert-toggles .check input { accent-color: var(--blue); }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: 0 0 auto; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #ccc4b0; border-radius: 999px; transition: .2s; }
.switch span::before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::before { transform: translateX(18px); }

.routes-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.routes-list button {
  text-align: left; background: #fdfcf9; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 10px 12px; cursor: pointer; font: 600 14px var(--font); color: var(--ink);
}
.routes-list button:hover { border-color: var(--blue); }
.routes-list .r-date { display: block; font-weight: 400; font-size: 12px; color: var(--ink-soft); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-weight: 600; z-index: 3000; box-shadow: 0 6px 24px rgba(0,0,0,.3); font-size: 14.5px;
  max-width: 90vw; text-align: center;
}

/* ── mobile ──────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .appbar { gap: 8px; padding: 6px 8px; }
  .searchwrap { order: 3; flex: 1 1 100%; }
  /* The bar wraps to two rows on phones, dropping ☰ to the left of row 2.
     Keep the button on the right, and anchor its menu to the appbar so the
     dropdown always hugs the right edge of the screen. */
  .usermenu { position: static; margin-left: auto; }
  .user-drop { right: 6px; top: calc(100% + 4px); }
  .layers-panel { top: auto; bottom: 76px; left: 10px; width: 208px; max-height: 46vh; overflow-y: auto; }
  .layers-panel:not(.collapsed) { z-index: 1500; }
  .detail-panel {
    top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-width: none;
    border-radius: 18px 18px 0 0; max-height: 62vh;
  }
  .route-drawer { left: 0; right: 0; bottom: 0; border-radius: 18px 18px 0 0; max-height: 48vh; }
  .grid-form { grid-template-columns: 1fr; }
  .grid-form .span2 { grid-column: span 1; }
  .fabs { bottom: 84px; }
  .footer-inner { flex-direction: column; gap: 12px; }
}

/* ── member photos ──────────────────────────────────────────── */
.photo-list { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-list .ph { position: relative; width: 72px; height: 72px; }
.photo-list .ph img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--line);
}
.photo-list .ph button {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px;
  border-radius: 50%; border: none; background: var(--ink); color: #fff;
  font-size: 11px; line-height: 1; cursor: pointer;
}
.dp-gallery { margin-top: 8px; }
.gal-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.gal-strip img {
  width: 86px; height: 64px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--line); cursor: pointer; flex: 0 0 auto;
}
.gal-edit { margin-top: 6px; }

.lightbox {
  position: fixed; inset: 0; z-index: 3000; background: rgba(10, 14, 24, .92);
  display: flex; align-items: center; justify-content: center;
}
.lightbox img {
  max-width: 92vw; max-height: 86vh; border-radius: 6px;
  box-shadow: 0 12px 60px rgba(0, 0, 0, .6);
}
.lb-btn {
  position: absolute; background: rgba(255, 255, 255, .12); color: #fff;
  border: none; border-radius: 50%; width: 44px; height: 44px; font-size: 22px;
  cursor: pointer; z-index: 1;
}
.lb-btn:hover { background: rgba(255, 255, 255, .25); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-full {
  position: absolute; bottom: 18px; right: 18px; color: #fff; font-weight: 700;
  background: rgba(255, 255, 255, .12); padding: 8px 14px; border-radius: 10px;
  text-decoration: none;
}
.lb-count {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  color: rgba(255, 255, 255, .85); font-size: 13px;
}
.photo-field { display: flex; flex-direction: column; gap: 6px; font: 600 13px var(--font); }
.photo-picker { display: flex; align-items: center; gap: 10px; }
.photo-count { font-size: 13px; }

/* ── classifieds ─────────────────────────────────────────────── */
.ads-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.ads-bar select {
  padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 9px;
  font: 500 14px var(--font); background: #fdfcf9; color: var(--ink);
}
.ads-list { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; }
.ads-empty { color: var(--ink-soft); text-align: center; padding: 28px 0; }
.ad-card {
  display: flex; gap: 12px; align-items: center; padding: 10px;
  border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
  background: #fdfcf9; transition: box-shadow .15s, transform .08s;
}
.ad-card:hover { box-shadow: 0 3px 12px rgba(28,39,64,.12); transform: translateY(-1px); }
.ad-thumb {
  width: 84px; height: 64px; object-fit: cover; border-radius: 9px;
  border: 1px solid var(--line); flex: 0 0 auto;
}
.ad-thumb-none { display: flex; align-items: center; justify-content: center; font-size: 26px; background: #eee9db; }
.ad-main { flex: 1; min-width: 0; }
.ad-title { font-weight: 700; font-size: 15.5px; }
.ad-meta { color: var(--ink-soft); font-size: 13.5px; }
.ad-sub { color: var(--ink-soft); font-size: 12.5px; }
.ad-price { font: 700 16px var(--font-display); color: var(--green); white-space: nowrap; }
.ad-view-price { font: 700 24px var(--font-display); color: var(--green); margin: 6px 0; }
.ad-view-desc { margin: 12px 0 4px; font-size: 15px; }

/* ── along-your-route list ───────────────────────────────────── */
.route-nearby { padding: 10px 14px 14px; border-top: 1px solid var(--line); }
.route-nearby h4 {
  margin: 0 0 6px; font: 700 12.5px var(--font-display);
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft);
}
.rn-group { margin: 6px 0; font-size: 14px; line-height: 1.7; }
.rn-group .dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  margin-right: 6px; vertical-align: baseline;
}
.rn-cat { font-weight: 700; margin-right: 4px; }
.rn-item { cursor: pointer; white-space: nowrap; }
.rn-item:hover { text-decoration: underline; color: var(--blue); }
.rn-off { color: var(--ink-soft); font-size: 12.5px; }
.rn-sep { color: var(--line); margin: 0 6px; }
