/* ─────────────────────────────────────────────────────────────
   GTBR Target Binder — styles
   Palette + type derived from the 2025 printed binder PDF.
   Mobile-first; desktop breakpoints enhance from there.
   ───────────────────────────────────────────────────────────── */

:root {
  --red:            #c8102e;   /* balloon race red */
  --red-dark:       #8a0b20;
  --yellow:         #ffd100;   /* balloon yellow */
  --yellow-warn:    #ffc72c;   /* SWEPCO warning */
  --blue:           #1f3b8f;   /* BFA banner blue */
  --ink:            #111111;
  --ink-soft:       #333333;
  --muted:          #6b6b6b;
  --paper:          #faf8f3;   /* off-white, binder page feel */
  --line:           #d8d5cd;
  --card:           #ffffff;
  --ok:             #0a7a3a;
  --danger:         #b00020;
  --shadow-sm:      0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:      0 2px 6px rgba(0,0,0,0.08), 0 6px 16px rgba(0,0,0,0.06);

  --font-display: 'Oswald', 'Impact', 'Haettenschweiler', system-ui, sans-serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --font-title:   'Clarendon URW', 'Clarendon', 'Clarendon BT', 'Bookman Old Style', Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--font-body);
  -webkit-text-size-adjust: 100%;
}

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-dark); text-decoration: underline; }

code {
  background: #eee;
  padding: 2px 6px;
  border-radius: 4px;
  font: 13px var(--font-mono);
}

.mono { font-family: var(--font-mono); }

/* ─── Branded top strip ──────────────────────────────────── */
.brand-strip {
  background: #ffffff;
  border-bottom: 4px solid var(--red);
  padding: 14px 16px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.brand-logo img {
  display: block;
  height: 64px;
  width: auto;
}

@media (min-width: 720px) {
  .brand-strip { padding: 18px 28px; }
  .brand-logo img { height: 86px; }
}

/* ─── Nav strip ──────────────────────────────────────────── */
.nav-strip {
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  font-family: var(--font-display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.nav-strip .nav-spacer { flex: 1; }
.nav-strip .nav-inline { margin: 0; display: inline; }
.nav-link {
  color: #fff;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
}
.nav-link:hover { background: rgba(255,255,255,0.1); color: #fff; text-decoration: none; }
.link-btn {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

/* Dropdown menus inside the nav strip (uses <details>/<summary> for a11y). */
.nav-dropdown { position: relative; }
.nav-dropdown > summary {
  /* Match .nav-link styling exactly */
  color: #fff;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.nav-dropdown > summary::-webkit-details-marker { display: none; }
.nav-dropdown > summary::marker { content: ''; }
.nav-dropdown > summary:hover {
  background: rgba(255,255,255,0.1);
}
.nav-caret {
  font-size: 10px;
  transition: transform 0.15s ease;
}
.nav-dropdown[open] > summary .nav-caret { transform: rotate(180deg); }
.nav-dropdown[open] > summary { background: rgba(255,255,255,0.12); }

.nav-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--ink);
  border: 1px solid rgba(255,255,255,0.1);
  border-top: none;
  min-width: 200px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  z-index: 100;
}
.nav-menu-item {
  display: block;
  padding: 10px 16px;
  color: #fff;
  text-decoration: none;
  font: inherit;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.nav-menu-item:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
  text-decoration: none;
}
/* Right-align the trailing dropdown so it doesn't overflow the right edge */
.nav-dropdown:last-of-type .nav-menu { left: auto; right: 0; }
@media (max-width: 600px) {
  .nav-strip { padding: 0 4px; }
  .nav-link, .nav-dropdown > summary { padding: 12px 10px; font-size: 13px; }
  .nav-menu { min-width: 180px; }
}

/* ─── Layout ─────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 20px auto 40px;
  padding: 0 16px;
}
@media (min-width: 720px) {
  .container { margin: 28px auto 56px; padding: 0 28px; }
}

.page-title {
  font-family: var(--font-title);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 28px;
  margin: 0 0 14px;
  color: var(--ink);
}
.count { color: var(--muted); font-weight: 500; font-size: 20px; }

/* ─── Search ─────────────────────────────────────────────── */
.search {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  align-items: stretch;
  flex-wrap: wrap;
}
.search input[type="search"] {
  flex: 1 1 220px;
  min-height: 44px;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 6px;
  font: 16px var(--font-body); /* 16px prevents iOS zoom on focus */
  background: #fff;
}
.search input[type="search"]:focus {
  outline: none;
  border-color: var(--red);
}
.search .clear { align-self: center; color: var(--muted); font-size: 14px; }

/* ─── Target list: card layout ───────────────────────────── */
.target-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
@media (min-width: 720px) {
  .target-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
@media (min-width: 1000px) {
  .target-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.target-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  align-items: stretch;
}
.target-card.is-favorite {
  border-left-color: var(--yellow);
  background: #fffdf2;
}
.target-card-link {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: var(--ink);
  text-decoration: none;
}

/* ─── Favorite star toggle ───────────────────────────────── */
.fav-toggle {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  padding: 0;
  border: none;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fav-toggle:hover { background: #fffdf6; color: var(--yellow-warn); }
.fav-toggle:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }
.fav-star {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
  transition: fill 0.12s ease, stroke 0.12s ease, transform 0.12s ease;
}
.fav-toggle.is-on { color: var(--yellow); }
.fav-toggle.is-on .fav-star {
  fill: var(--yellow);
  stroke: #d8a900;
}
.fav-toggle:active .fav-star { transform: scale(0.85); }

/* Divider between favorites and the rest of the list. */
.fav-divider {
  flex-basis: 100%;
  grid-column: 1 / -1;
  list-style: none;
  height: 0;
  margin: 4px 0;
  border-top: 1px dashed var(--line);
}

/* Hint + cap notice above the list. */
.fav-hint {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}
.fav-notice {
  margin: 0 0 10px;
  padding: 8px 12px;
  background: #fff7d6;
  border: 1px solid var(--yellow-warn);
  border-radius: 6px;
  color: #6a4e00;
  font-size: 13px;
  font-weight: 600;
}

/* Row holding the hint and the Clear-favorites button. */
.fav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.fav-bar .fav-hint { margin: 0; flex: 1 1 auto; }
.fav-bar .fav-notice { margin: 0; }

.fav-clear-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.fav-clear-btn span { color: var(--yellow); }
.fav-clear-btn:hover {
  border-color: var(--red);
  color: var(--red);
  background: #fffdf6;
}
.fav-clear-btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.target-card-link:hover {
  background: #fffdf6;
  text-decoration: none;
  color: var(--ink);
}
.target-card-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--red);
  letter-spacing: 0.02em;
  min-width: 3.2em;
}
.target-card-body { min-width: 0; }
.target-card-desc {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.target-card-addr {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.target-card-meta {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}
.meta-pill {
  background: var(--yellow-warn);
  color: #3a2a00;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.meta-coords { color: var(--muted); }
.target-card-chev {
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  padding-right: 4px;
}

.empty { color: var(--muted); padding: 20px; text-align: center; }

/* ─── Admin bar (above target hero) ──────────────────────── */
.admin-bar {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 10px;
}
.admin-bar form { margin: 0; }

/* ─── Target detail page ─────────────────────────────────── */
.target-page {
  display: grid;
  gap: 16px;
}
@media (min-width: 960px) {
  .target-page { gap: 20px; }
}

/* Hero: target number */
.target-hero {
  background: rgb(200, 16, 46);
  border: 2px solid rgb(200, 16, 46);
  border-radius: 9999px;
  padding: 18px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.target-hero-label {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 13px;
  color: #fff;
  margin-bottom: 2px;
}
.target-hero-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 56px;
  line-height: 1;
  color: #fff;
  letter-spacing: 0.02em;
}
.target-hero-number .hash {
  font-size: 0.5em;
  vertical-align: super;
  font-weight: 600;
  margin-right: 0.05em;
  line-height: 1;
}
@media (min-width: 720px) {
  .target-hero-number { font-size: 72px; }
}

/* Info block: 1-col mobile, 2-col tablet+ */
.info-block {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 720px) {
  .info-block { grid-template-columns: 1fr 1fr; gap: 16px; }
}
.info-col {
  display: grid;
  gap: 14px;
  align-content: start;
}
.info-group {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.info-label {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: #000;
  font-size: 18px;
  margin: 0 0 10px;
  padding: 6px 14px;
  border-radius: 9999px;
  text-align: center;
  border-bottom: none;
}
.info-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
  flex-wrap: wrap;
}
.info-sublabel {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 300;
  min-width: 82px;
}
.info-value { font-size: 15px; color: var(--ink); }
.info-value.big { font-size: 18px; font-weight: 600; }
.info-value.hazards { white-space: pre-wrap; text-align: center; }
.info-value.landmarks { text-align: center; }
.info-value .sep { color: var(--muted); margin: 0 4px; }
/* All coordinate values use Oswald at 18px, centered, semibold */
.info-value.coord {
  font-family: 'Oswald', 'Impact', 'Haettenschweiler', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
}
/* Center any coordinate row (sublabel + value) horizontally */
.info-row:has(.info-value.coord) {
  justify-content: center;
}

/* Directions buttons — styled like map-app tiles */
.directions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-maps {
  flex: 1 1 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 8px 20px;
  border-radius: 9999px;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform 0.05s ease, box-shadow 0.15s ease;
}
.btn-maps:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-maps:active { transform: translateY(0); }
.btn-maps--google { background: #ffffff; border-color: #4285f4; }
.btn-maps--apple  { background: #ffffff; border-color: var(--ink); }
.btn-maps-logo {
  display: block;
  height: 28px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

/* SWEPCO pole block — yellow warning callout */
.pole-block { background: #fffbe8; border-color: var(--yellow-warn); text-align: center; }
.pole-block .info-row { justify-content: center; }
.pole-block .info-sublabel { min-width: 0; }
.pole-block .info-label.pole-label {
  color: #3a2a00;
  background: var(--yellow-warn);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.warn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  background: var(--yellow-warn);
  color: #3a2a00;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
}
.pole-callout {
  background: transparent;
  color: #3a2a00;
  padding: 8px 10px;
  border-radius: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-align: center;
  margin-bottom: 8px;
}

/* ─── Overview map (all targets) ─────────────────────────── */
.overview-header { margin-bottom: 12px; }
.overview-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.overview-map-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  box-shadow: var(--shadow-sm);
}
.overview-map {
  width: 100%;
  height: calc(100vh - 260px);
  min-height: 380px;
  border-radius: 6px;
  background: #ddd;
}
@media (min-width: 720px) {
  .overview-map { height: calc(100vh - 240px); min-height: 520px; }
}

/* Google Maps InfoWindow content — scoped via .map-tooltip */
.map-tooltip {
  font: 13px/1.45 var(--font-body);
  color: var(--ink);
  padding: 2px 2px 4px;
  min-width: 180px;
  max-width: 260px;
}
.map-tooltip-num {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--red);
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.map-fav-star {
  color: var(--yellow);
  -webkit-text-stroke: 0.6px #d8a900;
  font-size: 20px;
  vertical-align: -1px;
}
.map-tooltip-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.map-tooltip-actions .map-tooltip-link { margin-top: 0; }
.map-fav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  min-height: 36px;
  border: 1px solid var(--yellow-warn);
  border-radius: 6px;
  background: #fff7d6;
  color: #6a4e00;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
}
.map-fav-toggle.is-on {
  background: var(--yellow);
  border-color: #d8a900;
  color: #3a2a00;
}
.map-fav-toggle:hover { filter: brightness(0.97); }
.map-tooltip-utm {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.map-tooltip-desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.map-tooltip-link {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--red);
  color: #fff !important;
  border-radius: 6px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 13px;
  text-decoration: none;
  min-height: 36px;
  line-height: 1.4;
}
.map-tooltip-link:hover { background: var(--red-dark); text-decoration: none; }

/* ─── Map section (single target detail) ─────────────────── */
.map-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  box-shadow: var(--shadow-sm);
}
.map {
  width: 100%;
  height: 320px;
  border-radius: 6px;
  background: #ddd;
}
@media (min-width: 720px)  { .map { height: 480px; } }
@media (min-width: 1000px) { .map { height: 560px; } }

.map-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 8px 4px 0;
  font-size: 13px;
  color: var(--muted);
}
.map-hint { margin-left: auto; font-size: 12px; color: var(--muted); }
.swatch {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 50%;
  margin-right: 4px;
  border: 2px solid transparent;
  vertical-align: middle;
}
.swatch.s25  { border-color: #00e5ff; }
.swatch.s50  { border-color: var(--yellow); }
.swatch.s100 { border-color: var(--red); }

/* ─── Legacy reference image ─────────────────────────────── */
.legacy-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.legacy-section .info-label { margin-bottom: 10px; }
.legacy-image { margin: 0; }
.legacy-image img { width: 100%; height: auto; display: block; border-radius: 4px; }
.legacy-image figcaption { color: var(--muted); font-size: 12px; margin-top: 6px; }

/* ─── Buttons (generic) ──────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 2px solid var(--ink);
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
  font: 600 14px/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.btn:hover { background: var(--ink); color: #fff; text-decoration: none; }
.btn.primary {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.btn.primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn.danger {
  background: #fff;
  border-color: var(--danger);
  color: var(--danger);
}
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 13px; }

/* ─── Forms (admin + login) ──────────────────────────────── */
.login, .admin-form {
  background: var(--card);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.login-hint {
  max-width: 380px;
  margin: 6px 0 18px;
  color: var(--muted);
  font-size: 14px;
}
.login {
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.qr-info {
  margin-top: 28px;
  max-width: 480px;
  border-top: 1px solid var(--border, #ddd);
  padding-top: 18px;
}
.qr-url-template {
  display: block;
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--surface-alt, #f5f5f5);
  border: 1px solid var(--border, #ddd);
  border-radius: 6px;
  font-size: 13px;
  word-break: break-all;
  color: var(--text, #222);
  user-select: all;
}
.login label, .admin-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.login input, .admin-form input, .admin-form textarea {
  min-height: 44px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 6px;
  font: 16px var(--font-body);
  color: var(--ink);
  background: #fff;
  text-transform: none;
  letter-spacing: normal;
}
.login input:focus, .admin-form input:focus, .admin-form textarea:focus {
  outline: none; border-color: var(--red);
}
.admin-form .form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 720px) {
  .admin-form .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.admin-form label.full { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; }
.admin-form textarea { min-height: 100px; resize: vertical; font-family: var(--font-body); }
.form-actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.form-actions.secondary { margin-top: 12px; }
.admin-form .hint {
  margin: 14px 0 6px;
  padding: 10px 12px;
  background: #f5f3eb;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.45;
}
.compute-result { font-size: 13px; color: var(--muted); }

/* ─── Banners: error / warn ──────────────────────────────── */
.error {
  background: #ffe5e9;
  border: 1px solid #f5b3bd;
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
}
.warn {
  background: #fff7da;
  border: 1px solid #f0d778;
  color: #7a5d00;
  padding: 10px 14px;
  border-radius: 6px;
}

/* ─── Footer ─────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 24px 16px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
  background: #fff;
  margin-top: 32px;
}

/* ─── Print (bonus: clean binder-style print layout) ─────── */
@media print {
  body { background: #fff; }
  .nav-strip, .admin-bar, .map-legend .map-hint { display: none; }
  .map { height: 360px; }
  .target-page { gap: 10px; }
}

/* ─── Pilot gallery ─────────────────────────────────────── */

/* Category filter bar above the grid */
.category-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 18px;
}
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font: 600 13px var(--font-body);
  text-decoration: none;
  transition: all 0.15s ease;
}
.cat-chip:hover {
  border-color: var(--red);
  color: var(--red);
  text-decoration: none;
}
.cat-chip.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.cat-chip .cat-count {
  background: rgba(0,0,0,0.12);
  color: inherit;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.cat-chip.active .cat-count { background: rgba(255,255,255,0.25); }

/* The grid itself — mobile 2-up, tablet 3-up, small-desktop 4-up, desktop 5-up */
.pilot-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 560px)  { .pilot-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 860px)  { .pilot-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1100px) { .pilot-grid { grid-template-columns: repeat(5, 1fr); gap: 18px; } }

.pilot-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.pilot-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.pilot-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.pilot-card-link:hover { text-decoration: none; }

/* Image frame: square-ish, with the balloon number overlayed bold at the top */
.pilot-card-img {
  position: relative;
  aspect-ratio: 5 / 7;   /* balloon photos shown in portrait 5x7 */
  overflow: hidden;
  background: #f0eee7;
}
.pilot-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pilot-card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font: 500 13px var(--font-body);
  background: repeating-linear-gradient(
    45deg,
    #f0eee7 0 10px,
    #e9e6dc 10px 20px
  );
}

/* Big number overlay — high-contrast red with white outline so it reads
   against any balloon photo. */
.pilot-card-number {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--red);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  line-height: 1;
  padding: 6px 12px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  letter-spacing: 0.5px;
}
@media (min-width: 860px) {
  .pilot-card-number { font-size: 32px; padding: 7px 14px; }
}

.pilot-card-body {
  padding: 10px 12px 12px;
}
.pilot-card-name {
  font: 700 15px/1.25 var(--font-body);
  color: var(--ink);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pilot-card-balloon {
  font: 500 13px/1.3 var(--font-body);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Pilot detail page ─────────────────────────────────── */
.pilot-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 14px 0 32px;
}

.pilot-hero {
  background: var(--card);
  border: 2px solid var(--red);
  border-radius: 10px;
  padding: 18px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.pilot-hero-content { flex: 1; min-width: 0; }
.pilot-nav {
  flex-shrink: 0;
  display: inline-block;
  background: var(--yellow);
  color: var(--ink);
  font-family: 'Oswald', 'Impact', 'Haettenschweiler', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 8px 18px;
  border-radius: 9999px;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s ease, transform 0.05s ease;
}
.pilot-nav:hover {
  color: var(--ink);
  text-decoration: none;
  opacity: 0.88;
}
.pilot-nav:active { transform: translateY(1px); }
.pilot-nav-placeholder { flex-shrink: 0; width: 1px; }
@media (max-width: 600px) {
  .pilot-hero { padding: 14px 12px; gap: 8px; }
  .pilot-nav { font-size: 14px; padding: 6px 12px; letter-spacing: 0.02em; }
}
.pilot-hero-label {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 13px;
  color: var(--muted);
}
.pilot-hero-number {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--red);
  font-size: 56px;
  line-height: 1;
  margin: 4px 0 8px;
}
@media (min-width: 720px) {
  .pilot-hero-number { font-size: 72px; }
}
.pilot-hero-name {
  font: 700 22px/1.2 var(--font-body);
  color: var(--ink);
}
.pilot-hero-balloon {
  font: 500 16px/1.3 var(--font-body);
  color: var(--ink-soft);
  margin-top: 2px;
}
.pilot-hero-category {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 10px;
  background: var(--yellow);
  color: var(--ink);
  font: 700 12px var(--font-display);
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 999px;
}

/* Two large image frames side-by-side on desktop, stacked on mobile */
.pilot-images {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 720px) {
  .pilot-images { grid-template-columns: 1.6fr 1fr; }
}

/* Per-pilot grid: each column groups one image + its info block.
   Mobile = single column (Balloon image, Balloon info, Pilot image, Pilot info).
   Desktop = two columns side-by-side (Balloon left, Pilot right). */
.pilot-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 720px) {
  .pilot-grid { grid-template-columns: 1.6fr 1fr; gap: 16px; }
}
.pilot-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-content: start;
}
.pilot-image-frame {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.pilot-image-frame img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 560px;
  object-fit: cover;
}
.pilot-image-frame--portrait img { max-height: 560px; object-fit: cover; }
/* Balloon photo shown in a portrait 5x7 frame on the detail page. */
.pilot-image-frame--balloon img {
  aspect-ratio: 5 / 7;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: cover;
}
.pilot-image-frame--balloon .pilot-card-img-placeholder { aspect-ratio: 5 / 7; }
.pilot-image-frame figcaption {
  padding: 8px 12px;
  font: 600 12px var(--font-display);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: #fdfcf7;
}
.pilot-image-frame .pilot-card-img-placeholder {
  aspect-ratio: 4 / 3;
}

.pilot-back { margin-top: 12px; }

/* ─── Admin pilots table ────────────────────────────────── */
.admin-table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-table th,
.admin-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.admin-table th {
  background: #f5f2ea;
  font: 600 12px var(--font-display);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: #fbf9f2; }
.admin-table .small { font-size: 12px; }
.admin-table .ok      { color: var(--ok);     font-weight: 700; }
.admin-table .missing { color: var(--muted);  opacity: 0.45; }
.admin-table-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}
.admin-table-actions form { display: inline; }

.btn.tiny {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 5px;
}

/* Import result + flash notices */
.import-result {
  background: #f2faf4;
  border: 1px solid #bfe3c9;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.import-result h2 {
  margin: 0 0 8px;
  font: 600 18px var(--font-display);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ok);
}
.import-result ul { margin: 6px 0 12px; padding-left: 20px; }
.flash {
  background: #eef6ff;
  border: 1px solid #c6defc;
  color: #1f3b8f;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 14px;
}

/* Form sections shared by admin pages */
.form-section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 720px) {
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row--wide { grid-column: span 2; }
}
.form-row label { display: block; font-weight: 600; margin-bottom: 4px; }
.form-row input[type="text"],
.form-row input[type="search"],
.form-row input[type="file"] {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: 14px var(--font-body);
  background: #fff;
}
.form-row .form-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.form-row legend {
  font-weight: 600;
  margin-bottom: 6px;
}
.form-row .radio {
  display: flex;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fdfcf7;
  cursor: pointer;
}
.form-row .radio input { margin-top: 4px; }
.form-row .radio span strong { display: block; margin-bottom: 2px; }
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

/* ─── v2: brand name, event picker, super-admin ─────────────── */
.brand-strip { gap: 14px; }
.brand-name {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  color: #1f2937;
}

.event-list {
  list-style: none;
  margin: 18px 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.event-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}
.event-link {
  display: block;
  padding: 16px 18px;
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
  text-decoration: none;
}
.event-link:hover { background: #f9fafb; }
.admin-link { margin-top: 22px; font-size: 0.9rem; }
.admin-link a { color: #6b7280; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #eef0f2;
  vertical-align: middle;
}
.data-table th { font-weight: 600; color: #374151; }
.data-table code { font-size: 0.85em; color: #6b7280; }
.data-table .row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.data-table .row-actions form { margin: 0; }
.data-table .ok { color: #15803d; font-weight: 600; }
.data-table .missing { color: #9ca3af; text-decoration: line-through; }

.field-hint { font-size: 0.85rem; color: #6b7280; margin: 4px 0 12px; }
.pw-fieldset {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 14px 0;
}
.pw-fieldset legend { font-weight: 600; padding: 0 6px; }
.admin-form label.checkbox {
  display: flex; align-items: center; gap: 8px;
  font-weight: 400; margin: 8px 0;
}
.admin-form label.checkbox input { width: auto; margin: 0; }

@media (max-width: 640px) {
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr { border: 1px solid #e5e7eb; border-radius: 8px; margin-bottom: 12px; padding: 6px; }
  .data-table td { border: none; padding: 6px 10px; }
}

/* v2: representative-location input-mode toggle */
.radio-row { display: flex; flex-wrap: wrap; gap: 20px; margin: 6px 0 12px; }
.radio-row .checkbox { margin: 0; }

/* v2: event login page — logo hero + centered sign-in box */
.login-page {
  max-width: 460px;
  margin: 12px auto 0;
  text-align: center;
}
.login-hero { margin: 4px 0 22px; }
.login-hero-logo {
  display: block;
  width: 350px;
  max-width: 100%;   /* shrink to fit on narrow screens */
  height: auto;
  margin: 0 auto 12px;
}
.login-event-name {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 1.35rem;
  color: #1f2937;
  margin: 0;
}
.login-page .login-title { text-align: center; }
.login-page .login-hint { margin-left: auto; margin-right: auto; }
/* Center the sign-in card; keep its fields left-aligned for readability. */
.login-page .login {
  margin: 0 auto;
  text-align: left;
  width: 100%;
  max-width: 340px;
}
.login-page .error {
  max-width: 340px;
  margin: 0 auto 14px;
}
