:root {
  --bg:        #0E1E36;
  --bg-2:      #142849;
  --surface:   #1B335A;
  --elev:      #22406F;
  --text:      #ECF1FA;
  --text-dim:  #98A8C3;
  --accent:    #F2B705;
  --accent-2:  #FFCE3D;
  --danger:    #E4473C;
  /* Deep red for LIGHT TEXT ON RED (5.77:1); --danger itself only reaches
     3.5-4.0:1 behind text, which fails AA and washes out in sunlight. */
  --danger-deep: #B3261E;
  /* Red for TEXT ON THE DARK BACKGROUND (7.66:1). */
  --danger-text: #FF8A80;
  --success:   #3BC47A;
  --radius:    14px;
  --radius-sm: 8px;
  --safe-top:    env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; }

.app-shell { display: flex; flex-direction: column; height: 100dvh; }

.top-bar {
  display: flex; align-items: center; gap: 8px;
  padding: calc(var(--safe-top) + 10px) 12px 10px;
  background: var(--bg-2);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky; top: 0; z-index: 1000;
}
.top-bar .title { flex: 1; margin: 0; font-size: 17px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-bar .beta-badge {
  display: inline-block; flex-shrink: 0;
  padding: 2px 7px; font-size: 10px; font-weight: 700; letter-spacing: 0.2px;
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #fff; border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.04); color: var(--text);
  font-size: 18px; cursor: pointer;
}
.icon-btn:hover { background: rgba(255,255,255,0.08); }
.icon-btn[hidden] { display: none !important; }

.view { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 16px; -webkit-overflow-scrolling: touch; }
.view h2 { margin: 0 0 12px; font-size: 20px; }

.tab-bar {
  display: flex; padding-bottom: var(--safe-bottom);
  background: var(--bg-2);
  border-top: 1px solid rgba(255,255,255,0.06);
}
.tab {
  flex: 1; padding: 8px 4px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--text-dim); font-size: 11px;
}
.tab.active { color: var(--accent); }
.tab[hidden] { display: none !important; }
.tab-icon {
  font-size: 20px; line-height: 1; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
}
.tab-icon.camera-icon svg { display: block; height: 19px; width: auto; }
.tab-icon-wrap { position: relative; display: inline-block; }
.tab-count {
  position: absolute; top: -4px; right: -10px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--danger-deep); color: #fff;
  border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; line-height: 1;
}
.tab-count[hidden],
.tab-count.is-hidden { display: none !important; }

/* Cards */
.card {
  background: var(--surface); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset;
}
.card.unread { border-left: 3px solid var(--accent); }
.card.urgent { border-left: 3px solid var(--danger); }
.card.pinned { box-shadow: 0 0 0 1px rgba(242,183,5,0.28), 0 1px 0 rgba(255,255,255,0.04) inset; }
.pin-btn {
  flex-shrink: 0;
  height: 26px; border-radius: 999px; border: 0;
  background: rgba(255,255,255,0.06); color: var(--text-dim);
  font-size: 13px; line-height: 1; cursor: pointer;
  padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0.6; transition: opacity 0.15s ease, background 0.15s ease;
}
.pin-btn:hover { opacity: 1; background: rgba(255,255,255,0.1); }
.pin-btn.active {
  opacity: 1; background: rgba(242,183,5,0.22); color: var(--accent);
  font-weight: 700; letter-spacing: 0.02em;
}
.edit-btn {
  flex-shrink: 0;
  height: 24px; border-radius: 999px; border: 0;
  background: rgba(255,255,255,0.06); color: var(--text-dim);
  font-size: 12px; line-height: 1; cursor: pointer;
  padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0.75; transition: opacity 0.15s ease, background 0.15s ease;
}
.edit-btn:hover { opacity: 1; background: rgba(255,255,255,0.1); color: var(--text); }

/* Location card: address line + row of three map-app buttons. The buttons
 * render as proper pill-buttons with icon above label so the touch target
 * is large and the group looks like a set of equal actions. */
.loc-box {
  margin-top: 10px; padding: 10px 12px;
  background: var(--elev); border-radius: 8px;
}
.loc-label {
  color: var(--text); font-size: 13px; margin-bottom: 8px;
  overflow-wrap: anywhere; line-height: 1.35;
}
.loc-btn-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
}
.loc-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 10px 2px;
  width: auto; height: auto; min-width: 0;
  font-size: 12px; font-weight: 600;
  text-decoration: none;
  border-radius: 10px;
  text-align: center; line-height: 1.2;
}
.loc-btn-icon {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
}
.loc-btn-icon svg { display: block; width: 22px; height: 22px; }
.loc-btn-label {
  font-size: 12px; font-weight: 600; line-height: 1.15;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

/* Compact variant — single-row layout used inside emergency-reply bubbles:
 *   [📍 address, truncates ...] [🗺][🧭][🚗]
 * Address flexes to fill, clips with ellipsis if too long. Icons hug right.
 * max-width:100% + min-width:0 at every level so the row never overflows
 * its parent bubble regardless of address length. */
.loc-box-compact {
  margin-top: 6px; padding: 5px 8px; border-radius: 6px;
  display: flex; align-items: center; gap: 8px;
  width: 100%; max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.loc-box-compact .loc-label {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0;
  font-size: 11.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.loc-btn-row-compact {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  flex-wrap: nowrap;
}
/* The .btn baseline gives anchors width:100% + big padding; we need to
 * override that explicitly for the icon-only compact pills. !important
 * keeps the mini pill sized regardless of rule ordering. */
.loc-btn-compact {
  flex: 0 0 28px !important;
  width: 28px !important;
  height: 28px !important;
  padding: 0 !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0 !important;
}
.loc-btn-compact .loc-btn-icon { width: 18px; height: 18px; }
.loc-btn-compact .loc-btn-icon svg { width: 18px; height: 18px; }

/* Emergency comm — treated like a 911: red background, white text. Wins over
   .card.unread / .card.urgent (added last via class list, same specificity). */
.card.emergency { background: #dc2626 !important; color: #fff !important; border-left: 4px solid #7f1d1d !important; }
.card.emergency h3, .card.emergency p, .card.emergency strong, .card.emergency a { color: #fff !important; }
.card.emergency .meta { color: rgba(255,255,255,0.85) !important; }
.card.emergency .badge { background: rgba(255,255,255,0.22) !important; color: #fff !important; }
/* Inside an emergency card the default --elev (dark blue) clashes with the
 * red background — override loc-box + map buttons to a deeper red so the
 * address block reads as part of the emergency, not transparent to the page. */
.card.emergency .loc-box,
.card.emergency .loc-box-compact { background: rgba(0,0,0,0.22) !important; }
.card.emergency .loc-btn.secondary { background: rgba(255,255,255,0.95) !important; color: #1a1a1a !important; }

/* Menu item used for the "Send Emergency Message" action. */
.menu-item.emergency { color: #fff; background: #dc2626; font-weight: 700; }
.menu-item.emergency:hover { background: #b91c1c; }
.card-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.card-h h3 { margin: 0; font-size: 16px; flex: 1 1 0; min-width: 0; }
/* Push the kind badge to the right so Edit/title stays hugged together. */
.card-h .badge { margin-left: auto; }
/* Safety net so long unbroken strings (URLs, option labels, etc.) never push
 * the viewport out to horizontal scroll. */
.card, .card p, .card h3, .list-row, .list-row .name, .modal { overflow-wrap: anywhere; word-break: break-word; }
.meta  { color: var(--text-dim); font-size: 12px; }
.badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--elev); color: var(--text); }
.badge.urgent   { background: var(--danger-deep); color: #fff; }
.badge.question { background: var(--accent); color: #1a1a1a; }
.badge.answer   { background: var(--success); color: #0a2416; }
.badge.dm       { background: var(--elev); }
.badge.stand-down {
  background: rgba(255,255,255,0.12); color: var(--text-dim);
  text-transform: none; letter-spacing: 0.01em;
}
/* Tappable urgent/stand-down toggle — styled as a clickable pill without
 * the default button chrome, so it still looks like a badge. Explicit
 * appearance reset + pointer-events ensures the click target is live on
 * every platform (iOS Safari in particular can eat taps without this). */
button.badge-toggle {
  appearance: none; -webkit-appearance: none;
  border: 0; cursor: pointer; font-family: inherit;
  padding: 2px 8px; line-height: 1.35;
  pointer-events: auto;
  font-size: 11px; /* match .badge font */
}
button.badge-toggle:hover  { filter: brightness(1.1); }
button.badge-toggle:active { transform: scale(0.97); }

/* Swipe-to-archive */
.swipe-row { position: relative; overflow: hidden; border-radius: var(--radius); margin-bottom: 12px; }
.swipe-row .swipe-action {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 96px; display: flex; align-items: center; justify-content: center;
  background: var(--danger-deep); color: #fff; font-weight: 600; font-size: 14px;
  pointer-events: none; user-select: none;
}
.swipe-row .swipe-action.unarchive { background: var(--success); color: #0a2416; }
.swipe-row .swipe-card { position: relative; touch-action: pan-y; background: var(--surface); transition: transform 0.22s ease; }
.swipe-row.dragging .swipe-card { transition: none; }
.swipe-row .card { margin-bottom: 0; }

/* "Unread only" comms filter — toggled by the pill above the feed.
   Hides any swipe-row whose card no longer carries the .unread class.
   Tap-to-read removes .unread on the card, so freshly-read cards drop
   out of view in real time without a re-render. */
.comms-feed.unread-only .swipe-row:not(:has(.card.unread)) { display: none; }

/* Forms */
.form { max-width: 420px; margin: 0 auto; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
/* Big text inputs only — checkboxes / radios / file pickers keep their
 * native dimensions so member-pickers and poll voting render cleanly. */
.form-row input:not([type=checkbox]):not([type=radio]):not([type=file]),
.form-row textarea,
.form-row select {
  width: 100%; padding: 12px 14px;
  background: var(--bg-2); border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-sm);
  color: var(--text); font-size: 16px;
}
.form-row input[type=checkbox], .form-row input[type=radio] {
  accent-color: var(--accent); width: 18px; height: 18px;
}
.form-row textarea { min-height: 100px; resize: vertical; }
.btn {
  width: 100%; padding: 13px 16px; border: none; border-radius: var(--radius-sm);
  background: var(--accent); color: #1a1a1a; font-size: 16px; font-weight: 600; cursor: pointer;
}
.btn.secondary { background: var(--elev); color: var(--text); }
.btn.danger    { background: var(--danger); color: #fff; }
.btn:disabled  { opacity: 0.5; cursor: not-allowed; }

.error { color: var(--danger-text); font-size: 14px; margin-top: 10px; }
.hint  { color: var(--text-dim); font-size: 13px; margin-top: 8px; }

.hero { text-align: center; padding: 30px 16px 16px; }
.hero img { width: 96px; height: 96px; border-radius: 24px; }
.hero h1  { font-size: 22px; margin: 12px 0 4px; }
.hero p   { color: var(--text-dim); margin: 0 0 20px; }

.event-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--surface); padding: 14px; border-radius: var(--radius); margin-bottom: 10px;
  color: var(--text);
}
.event-row .caret { color: var(--text-dim); }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 10;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  width: 100%; max-width: 520px; background: var(--bg-2); border-radius: 20px 20px 0 0;
  padding: 18px 18px calc(18px + var(--safe-bottom)); max-height: 85vh; overflow-y: auto;
}
/* Tall variant for editors that want the full phone height (e.g. Emergency
 * info edit). The child form is expected to use flex column layout so its
 * textarea grows to fill the remaining space. */
.modal.tall {
  max-height: 100dvh; height: 100dvh; border-radius: 0;
  display: flex; flex-direction: column;
  padding-top: calc(18px + var(--safe-top));
}
.modal.tall > form, .modal.tall > .tall-body {
  display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 10px;
}
.modal.tall textarea.fill {
  flex: 1; min-height: 0; resize: none;
}
.modal h3 { margin: 0 0 14px; font-size: 18px; }

/* Standardized action bar at the top of admin/editor modals.
 * Single line at the top of every admin modal — Save/Close on form-style
 * editors, Create/Archive/Close on the manager list modals. Right-aligned
 * by default; managers override with .modal-topbar.spread for left+right. */
.modal-topbar {
  display: flex; gap: 6px; justify-content: flex-end;
  margin: 0 0 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
  /* Sticky so Close stays in view on long-scrolling modals (groups with
   * 50+ members, attendee pickers, etc). The modal itself is the scroll
   * container so top:0 anchors to its visible top. */
  position: sticky;
  top: -18px; /* counters the modal's 18px top padding so it docks flush */
  background: var(--bg-2);
  z-index: 2;
  padding: 8px 0;
}
.modal-topbar.spread { justify-content: space-between; }
.modal-topbar .btn { width: auto; padding: 6px 12px; font-size: 13px; }

/* Manage-panel action button row: compact buttons on one line, with
   horizontal scroll as a graceful fallback on narrow screens. */
.action-row {
  display: flex; gap: 6px; flex-wrap: nowrap;
  overflow-x: auto; scrollbar-width: none;
  margin-top: 4px;
}
.action-row::-webkit-scrollbar { display: none; }
.action-row .btn {
  width: auto; padding: 6px 10px; font-size: 13px;
  white-space: nowrap; flex-shrink: 0;
}

/* Threaded DM chat view inside the modal */
.thread-wrap { display: flex; flex-direction: column; gap: 12px; max-height: 70vh; }
.thread-list {
  display: flex; flex-direction: column; gap: 8px;
  overflow-y: auto; padding: 4px 2px;
  min-height: 200px; max-height: 55vh;
}
.thread-msg {
  max-width: 82%; padding: 8px 12px; border-radius: 14px;
  font-size: 14.5px; line-height: 1.35; word-break: break-word;
}
.thread-msg.theirs { align-self: flex-start; background: var(--elev); border-bottom-left-radius: 4px; }
.thread-msg.mine   { align-self: flex-end;   background: var(--accent); color: #1a1a1a; border-bottom-right-radius: 4px; }
.thread-author { font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 2px; }
.thread-owner-tag { font-weight: 400; opacity: 0.85; }
.thread-msg.mine .thread-author { color: rgba(26,26,26,0.72); }
.thread-body { white-space: pre-wrap; }
/* Card body for comms (announcements, DMs, groups): preserve newlines from
   the composer (Ctrl+Enter, real \n) and let inline links break onto a new
   line on narrow screens. linkifyBody() emits <a class="inline-link"> for
   any URL it finds — kept underlined so it reads as tappable on mobile. */
.comm-body { white-space: pre-wrap; }
.inline-link { text-decoration: underline; }
.card.emergency .inline-link { color: #fff !important; }
.thread-when { font-size: 12px; opacity: 0.85; margin-top: 3px; }
.thread-msg.fresh { box-shadow: inset 3px 0 0 var(--accent); }
.thread-msg.mine .thread-when { color: rgba(26,26,26,0.72); opacity: 1; }
.thread-reply { display: flex; flex-direction: column; gap: 8px; }
.thread-reply textarea { font-size: 16px; } /* 16px keeps iOS Safari from auto-zooming */

/* Inline thread on a card (not a modal). List scrolls if long but no min-height. */
.inline-thread { display: block; }
.inline-thread-body {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; flex-direction: column; gap: 10px;
}
.inline-thread-body[hidden] { display: none; }
.thread-list.inline {
  max-height: 50vh; min-height: 0;
  padding: 2px 2px 4px;
}
.thread-reply.inline textarea {
  min-height: 60px;
}

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(80px + var(--safe-bottom));
  background: var(--elev); color: var(--text);
  padding: 11px 18px; border-radius: 999px; font-size: 15px; line-height: 1.35;
  opacity: 0; transition: opacity 0.2s ease;
  pointer-events: none; z-index: 20; max-width: 92%;
}
.toast.show { opacity: 1; }
.toast.err  { background: var(--danger-deep); }
.toast.ok   { background: var(--success); color: #0a2416; }

.empty   { text-align: center; padding: 40px 16px; color: var(--text-dim); }
.loading { text-align: center; padding: 24px; color: var(--text-dim); }

/* Photos grid */
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.media-grid .tile {
  position: relative; aspect-ratio: 1; overflow: hidden;
  background: var(--elev); border-radius: 4px; display: block;
}
.media-grid img { width: 100%; height: 100%; object-fit: cover; }

/* Floating upload button */
.fab {
  position: fixed; right: 16px; bottom: calc(64px + var(--safe-bottom) + 16px);
  width: 56px; height: 56px; border-radius: 50%; border: none;
  background: var(--accent); color: #1a1a1a; font-size: 28px; font-weight: 300;
  cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,0.35); z-index: 4;
}

.menu-item {
  display: block; width: 100%; padding: 12px 14px; border: none; background: none;
  color: var(--text); text-align: left; font-size: 15px; border-radius: 8px;
}
.menu-item:hover  { background: var(--elev); }
.menu-item.danger { color: var(--danger); }

/* People list */
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; background: var(--surface); border-radius: var(--radius-sm); margin-bottom: 8px;
  color: inherit; cursor: pointer;
}
a.list-row:hover { background: var(--elev); }
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--elev); color: var(--text);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
  flex-shrink: 0; overflow: hidden;
}
img.avatar { object-fit: cover; }
.list-row .name { flex: 1; font-size: 14px; }
.list-row .sub  { font-size: 12px; color: var(--text-dim); }

/* ---------- Credits (rolling crawl) ---------- */
.credits-wrap {
  display: flex; flex-direction: column; gap: 10px;
  flex: 1; min-height: 0;
}
.credits-viewport {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  background: linear-gradient(180deg, #000 0%, #0b1020 100%);
  border-radius: 12px;
  color: #e6e8ef;
  cursor: pointer;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 15%, #000 85%, transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0, #000 15%, #000 85%, transparent 100%);
}
.credits-roll {
  position: absolute; left: 0; right: 0; top: 100%;
  padding: 0 22px;
  text-align: center;
  animation: credits-crawl var(--credits-duration, 40s) linear forwards;
  will-change: transform;
}
/* Translate distance is set at runtime so the roll clears the TOP of the
 * viewport (bottom edge reaches y=0) rather than stopping when the element
 * itself has travelled its own height. Fallback keyframe is just in case JS
 * hasn't measured yet. */
@keyframes credits-crawl {
  0%   { transform: translateY(0); }
  100% { transform: translateY(var(--credits-distance, -100vh)); }
}
.credits-title {
  font-size: 28px; font-weight: 800; letter-spacing: 4px;
  margin: 0 0 10px; color: #ffd580;
  text-shadow: 0 0 10px rgba(255, 213, 128, 0.35);
}
.credits-subtitle {
  font-size: 14px; font-style: italic; color: #b6bdd0;
  margin: 0 0 26px;
}
.credits-entry { margin: 0 0 22px; }
.credits-name  {
  font-size: 17px; font-weight: 700; color: #ffd580;
  margin-bottom: 4px;
}
.credits-blurb {
  font-size: 13px; line-height: 1.5; color: #d6d9e4;
  margin: 0 auto; max-width: 420px;
}
.credits-outro {
  font-size: 13px; font-style: italic; color: #b6bdd0;
  margin: 28px auto 0; max-width: 420px; line-height: 1.5;
}
.credits-hint {
  margin: 0; text-align: center; font-size: 11px;
  color: var(--text-dim, #6b7280);
}

/* Closing logo — center of the credits viewport. Starts hidden at scale 0
 * and pops out when the crawl finishes (JS toggles `.show`). */
.credits-logo-wrap {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.credits-logo {
  width: 58%; max-width: 260px; height: auto;
  transform: scale(0); opacity: 0;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.5));
}
.credits-logo.show {
  animation: credits-logo-pop 1.4s cubic-bezier(0.22, 0.9, 0.32, 1.25) forwards;
}
@keyframes credits-logo-pop {
  0%   { transform: scale(0);    opacity: 0; }
  55%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1);    opacity: 1; }
}

/* Info-tab reference row — single-line compact link used by the Usher
 * system entry. Matches the list-row aesthetic but with an icon + caret
 * instead of avatar+name. */
.info-ref-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; margin-top: 8px; padding: 12px 14px;
  background: var(--bg-2); border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  color: var(--text); font-size: 14px; font-weight: 600;
  cursor: pointer; text-align: left;
}
.info-ref-row:hover { background: var(--elev); }
.info-ref-icon  { font-size: 18px; line-height: 1; }
.info-ref-label { flex: 1; }

/* ---------- Map tab (live positions) ---------- */

/* When the map is the active view we want it edge-to-edge — the default
 * .view padding steals horizontal space and breaks Leaflet's tile math when
 * the container width changes mid-render. */
.view.map-view {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.map-canvas {
  flex: 1;
  width: 100%;
  min-height: 300px;
  background: #0b1628;
  /* Contain Leaflet's internal pane z-indexes (200 for tiles up to 700 for
   * popups) in their own stacking context so they can't cover the app's
   * chrome: top-bar, tab-bar, menu modal, toasts. */
  isolation: isolate;
}
/* Wraps the canvas + overlay buttons. Map rotation handled by
   leaflet-rotate inside Leaflet's panes, so no CSS-transform tricks. */
.map-canvas-wrap {
  position: relative;
  flex: 1;
  display: flex;
  min-height: 0;
}
.map-canvas-wrap > .map-canvas {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
}
/* Floating control stack on the map's right edge. Pointer-events none on the
   container lets map drags pass through; the buttons themselves opt back in. */
.map-overlay-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 800;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.map-overlay-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(14, 30, 54, 0.92);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: background 0.15s, color 0.15s, transform 0.2s;
}
.map-overlay-btn:hover { background: rgba(14, 30, 54, 1); }
.map-overlay-btn:active { transform: scale(0.94); }
.map-overlay-btn.active {
  background: var(--accent, #1e8bff);
  color: #1a1a1a;
}
/* Direction-up rotation handled by leaflet-rotate plugin — no CSS
   rules required for either the canvas or the pin counter-rotation. */
.map-filter-bar {
  padding: 8px 12px;
  background: var(--bg-1, #0e1e36);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.map-filter-bar[hidden] { display: none; }
.map-filter-select {
  width: 100%;
  padding: 7px 10px;
  font-size: 13px;
  color: #fff;
  /* Desktop browsers render the open dropdown with the OS colour scheme, so a
   * translucent background works fine on the closed control against our dark
   * chrome but the popup inherits OS defaults. The opaque fallback + option
   * styles below force readable contrast in the popup too. */
  background-color: #1a2a4a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  cursor: pointer;
}
.map-filter-select option {
  color: #fff;
  background-color: #1a2a4a;
}
.map-filter-select:focus {
  outline: none;
  border-color: var(--accent);
}
.map-filter-select:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
/* Pins — Leaflet gives us a .map-pin-wrap on the outer div; our inner span
 * draws either a coloured dot or a circular buggy photo, plus an adjacent
 * label chip and (for lead pins) a small gold crown. */
.map-pin-wrap { background: transparent; border: 0; }
.map-pin {
  position: relative;
  display: inline-flex;
  align-items: center;
  pointer-events: auto;
}
.map-pin-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #e0476a;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  flex: 0 0 auto;
}
.map-pin.me    .map-pin-dot { background: #1e8bff; }
.map-pin.stale .map-pin-dot { background: #8892a6; }
.map-pin.lead  .map-pin-dot { background: #f5a623; }

/* Circular buggy photo — used when the server returns a buggy_url. Border
 * colour mirrors the dot palette so the role read is consistent. */
.map-pin-photo {
  width: 36px; height: 36px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-color: #1a2a4a;
  border: 2px solid #e0476a;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  flex: 0 0 auto;
}
.map-pin.me    .map-pin-photo { border-color: #1e8bff; }
.map-pin.stale .map-pin-photo { border-color: #8892a6; filter: grayscale(0.5); }
.map-pin.lead  .map-pin-photo {
  border-color: #f5a623;
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.35), 0 1px 6px rgba(0, 0, 0, 0.45);
}
.map-pin.lead.has-photo  { filter: none; }
.map-pin.lead:not(.has-photo) .map-pin-dot {
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.45), 0 1px 4px rgba(0, 0, 0, 0.35);
}

/* Tiny crown sitting on top-right of a lead pin. Absolute so the label chip
 * stays on the same horizontal line as the photo/dot. */
.map-pin-crown {
  position: absolute;
  top: -6px;
  left: 22px;
  font-size: 12px;
  line-height: 1;
  color: #f5a623;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}
.map-pin:not(.has-photo) .map-pin-crown { left: 10px; top: -10px; }

.map-pin-label {
  margin-left: 5px;
  background: rgba(14, 30, 54, 0.88);
  color: #fff;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.map-pin.stale .map-pin-label { opacity: 0.6; }
.map-pin.lead  .map-pin-label {
  background: #f5a623;
  color: #1a1f2a;
}

/* Leaflet popup on pin tap — match the app palette. */
.leaflet-popup-content { margin: 10px 12px; font-size: 13px; color: #10192e; }
.pin-popup-title { font-size: 14px; margin-bottom: 3px; }
.pin-popup-title strong { font-weight: 700; }
.pin-popup-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}
.pin-popup-tag.lead { background: #f5a623; color: #1a1f2a; }
.pin-popup-tag.me   { background: #1e8bff; color: #fff; }
.pin-popup-meta { color: #374151; font-size: 11px; margin-bottom: 4px; }
.pin-popup-dist { font-weight: 700; font-size: 13px; color: #0b5394; }

/* Six tabs need slightly tighter per-tab width than five. */
.tab-bar .tab { min-width: 0; }

/* Top-bar share-chip — visible across every tab when a location share is
 * active. Pulses gently so the user remembers it's still running. */
.top-bar .share-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: #c73651;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}
.top-bar .share-chip:hover { filter: brightness(1.1); }
.top-bar .share-chip.stale { background: #d97706; }
.top-bar .share-chip.stale .share-chip-dot { animation: share-pulse 0.6s ease-in-out infinite; }
.share-chip-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: share-pulse 1.4s ease-in-out infinite;
}
@keyframes share-pulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.7); }
}

/* My Info — bottom check-in status card. Loud amber when not yet checked
 * in; quiet green when done. */
.my-info-checkin {
  margin: 18px 0 4px;
  padding: 12px 14px;
  border-radius: 10px;
  border-left: 4px solid;
}
.my-info-checkin-head { font-weight: 700; font-size: 14.5px; }
.my-info-checkin.done {
  background: rgba(59,196,122,0.10);
  border-color: var(--success);
  color: var(--success);
}
.my-info-checkin.reminder {
  background: rgba(217,119,6,0.14);
  border-color: #d97706;
  color: #fbbf24;
}
.my-info-checkin.reminder p { color: var(--text); }

/* ---------- Registration desk ---------------------------------------- */
/* Full-screen view: hide the global title + tab bar so the desk header
 * can claim the full width and the volunteer can't accidentally tap
 * a tab while looking down at the next member in line. */
body.reg-desk-mode .top-bar { display: none !important; }
body.reg-desk-mode .tab-bar { display: none !important; }
body.reg-desk-mode .view    { padding: 0; }

/* Sticky header: back button left, counts right; search + filter chips
 * stack underneath. Designed for one-handed use — search lives in the
 * top third of the screen so the thumb naturally lands on the chips and
 * list rows below. */
.reg-desk-header {
  position: sticky; top: 0; z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "back title counts"
    "search search search"
    "chips  chips  chips";
  gap: 8px 8px;
  padding: calc(var(--safe-top) + 10px) 12px 10px;
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.reg-desk-back {
  grid-area: back;
  border: none; background: rgba(255,255,255,0.05);
  color: var(--text); font-size: 13px; font-weight: 600;
  padding: 6px 10px; border-radius: 8px; cursor: pointer;
}
.reg-desk-back:active { background: rgba(255,255,255,0.12); }
.reg-desk-title {
  grid-area: title;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; letter-spacing: 0.2px;
}
.reg-desk-counts {
  grid-area: counts;
  display: flex; flex-direction: column; align-items: flex-end;
  line-height: 1; padding: 2px 6px;
}
.reg-desk-count-num { font-size: 16px; font-weight: 700; color: var(--accent); }
.reg-desk-count-lbl { font-size: 9.5px; color: var(--text-dim); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; }

.reg-desk-search-wrap {
  grid-area: search;
  position: relative;
}
.reg-desk-search {
  width: 100%;
  padding: 10px 36px 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  /* 16px keeps iOS Safari from auto-zooming the page on focus. */
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
}
.reg-desk-search::placeholder { color: var(--text-dim); }
.reg-desk-search:focus { outline: none; border-color: var(--accent); background: rgba(255,255,255,0.08); }
.reg-desk-search:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.reg-desk-search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,0.1); color: var(--text);
  font-size: 16px; line-height: 1; cursor: pointer;
}
.reg-desk-search:placeholder-shown + .reg-desk-search-clear { display: none; }

.reg-desk-chips {
  grid-area: chips;
  display: flex; gap: 6px;
}
.reg-desk-chip {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text-dim);
  font-size: 12.5px; font-weight: 600;
  border-radius: 999px; cursor: pointer;
  white-space: nowrap;
  text-align: center;
}
.reg-desk-chip.active {
  background: var(--accent);
  color: #1a1a1a;
  border-color: var(--accent);
}
/* Log button — tighter than the filter chips, square-ish, never grows. */
.reg-desk-chip.reg-desk-log-btn {
  flex: 0 0 auto;
  padding: 6px 12px;
  font-size: 16px;
  line-height: 1;
}

/* Audit-log modal rows. Wide gap-list with the action color-coded. */
.reg-desk-log-list { display: flex; flex-direction: column; gap: 4px; }
.reg-desk-log-row {
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  border-left: 3px solid rgba(255,255,255,0.08);
}
.reg-desk-log-when {
  font-size: 11px; color: var(--text-dim);
  margin-bottom: 3px;
}
.reg-desk-log-body {
  display: flex; flex-wrap: wrap; gap: 4px 8px;
  align-items: baseline;
  font-size: 13.5px;
}
.reg-desk-log-action {
  font-weight: 700; font-size: 12.5px;
  padding: 1px 6px; border-radius: 4px;
}
.reg-desk-log-action.mark   { background: rgba(59,196,122,0.15);  color: var(--success); }
.reg-desk-log-action.unmark { background: rgba(228,71,60,0.15);   color: var(--danger);  }
.reg-desk-log-target { font-weight: 600; }
.reg-desk-log-by     { color: var(--text-dim); font-size: 12px; }

/* List */
.reg-desk-list {
  padding: 4px 0 calc(var(--safe-bottom) + 24px);
}
.reg-desk-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
}
.reg-desk-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  transition: background 0.12s ease;
}
.reg-desk-row:active { background: rgba(255,255,255,0.06); }
.reg-desk-row.is-done { opacity: 0.6; }
.reg-desk-row.is-done .reg-desk-row-name { text-decoration: line-through; text-decoration-color: rgba(255,255,255,0.25); }
.reg-desk-row-main { flex: 1; min-width: 0; }
.reg-desk-row-name {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.reg-desk-row-meta {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  margin-top: 3px;
}
.reg-desk-row-meta .pill {
  display: inline-flex; align-items: center;
  padding: 2px 7px;
  font-size: 11px; font-weight: 500;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--text-dim);
  white-space: nowrap;
}
.reg-desk-row-meta .pill.swag {
  background: rgba(242,183,5,0.15);
  color: var(--accent);
}
.reg-desk-status {
  flex: 0 0 auto;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.reg-desk-status.pending {
  font-size: 26px; color: var(--text-dim);
}
.reg-desk-status.done {
  font-size: 22px;
}

/* Detail sheet */
.reg-desk-sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
  z-index: 2000;
  display: flex; align-items: flex-end; justify-content: center;
  animation: reg-fade-in 0.16s ease-out;
}
.reg-desk-sheet {
  width: 100%;
  max-width: 540px;
  background: var(--bg-2);
  border-radius: 18px 18px 0 0;
  padding: 18px 18px calc(var(--safe-bottom) + 18px);
  box-shadow: 0 -10px 40px rgba(0,0,0,0.45);
  max-height: 88vh;
  overflow-y: auto;
  animation: reg-sheet-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes reg-fade-in   { from { opacity: 0; } to { opacity: 1; } }
@keyframes reg-sheet-in  { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.reg-desk-sheet-head { padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.06); margin-bottom: 12px; }
.reg-desk-sheet-name { font-size: 20px; font-weight: 700; }
.reg-desk-sheet-sub  { font-size: 12.5px; color: var(--text-dim); margin-top: 4px; }

.reg-desk-sheet-opts { margin-bottom: 14px; }
.reg-desk-opt-label  {
  font-size: 11px; font-weight: 700;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.6px;
  margin: 8px 0 4px;
}
.reg-desk-opt {
  padding: 8px 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  margin-bottom: 6px;
}
.reg-desk-opt.main {
  background: rgba(242,183,5,0.12);
  border: 1px solid rgba(242,183,5,0.3);
}
.reg-desk-opt-name { font-size: 14px; }
.reg-desk-opt-variant { color: var(--text-dim); font-size: 13px; }

.reg-desk-sheet-state {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  margin-bottom: 12px;
}
.reg-desk-state-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
}
.reg-desk-state-pill.done    { background: rgba(59,196,122,0.15); color: var(--success); }
.reg-desk-state-pill.pending { background: rgba(255,255,255,0.06); color: var(--text-dim); }

.reg-desk-sheet-action {
  width: 100%;
  padding: 16px 18px;
  border: none;
  border-radius: 12px;
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  margin-bottom: 10px;
  transition: filter 0.12s ease, transform 0.12s ease;
}
.reg-desk-sheet-action.mark   {
  background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(22,163,74,0.4);
}
.reg-desk-sheet-action.unmark {
  background: rgba(228,71,60,0.15);
  color: var(--danger);
  border: 1px solid rgba(228,71,60,0.4);
}
.reg-desk-sheet-action:active { transform: translateY(1px); filter: brightness(0.95); }
.reg-desk-sheet-action:disabled { opacity: 0.6; cursor: wait; }

.reg-desk-sheet-footer {
  display: flex; gap: 8px;
  margin-bottom: 6px;
}
.reg-desk-sheet-link {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.reg-desk-sheet-close {
  width: 100%;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  margin-top: 6px;
}

/* ---------- Weather card (Info tab) ---------- */
.weather-card {
  background: var(--bg-2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 14px 14px 12px;
  margin: 14px 0 0;
  box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset;
}
.weather-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.weather-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.weather-title-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.weather-title-text { min-width: 0; flex: 1; }
.weather-title-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-dim);
  line-height: 1.2;
}
.weather-title-loc {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.weather-toggle {
  display: inline-flex;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 2px;
  flex-shrink: 0;
}
.weather-seg {
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.3px;
}
.weather-seg.active {
  background: var(--accent);
  color: #1a1a1a;
}
.weather-now {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 0 4px;
}
.weather-now-icon { font-size: 44px; line-height: 1; flex-shrink: 0; }
.weather-now-main { flex: 1; min-width: 0; }
.weather-now-temp {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.weather-now-desc {
  font-size: 13px;
  color: var(--text);
  margin-top: 4px;
}
.weather-feels { color: var(--text-dim); font-size: 12px; }
.weather-now-wind {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}
.weather-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 10px 0 8px;
}
.weather-section-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  margin: 2px 0 6px;
  font-weight: 700;
}
.weather-day-list { display: grid; gap: 4px; }
.weather-day {
  display: grid;
  grid-template-columns: 1.4fr 0.4fr 1fr 1fr;
  align-items: center;
  font-size: 13px;
  padding: 5px 0;
  border-top: 1px solid rgba(255,255,255,0.03);
}
.weather-day-list > .weather-day:first-child { border-top: 0; }
.weather-day-name { font-weight: 600; }
.weather-day-icon {
  font-size: 18px;
  text-align: center;
  line-height: 1;
}
.weather-day-temp {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.weather-day-pop {
  font-size: 11px;
  color: var(--text-dim);
  text-align: right;
}
.weather-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin: 4px 0 0;
  line-height: 1.4;
}
.weather-loading {
  font-size: 12px;
  color: var(--text-dim);
  padding: 6px 0;
}

/* ---------- Login tabs (Phase 2) ---------- */
.login-tabs {
  display: flex;
  gap: 0;
  max-width: 360px;
  margin: 0 auto 16px;
  border-radius: 10px;
  background: var(--elev, #1a2a4a);
  padding: 4px;
}
.login-tab {
  flex: 1 1 0;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.login-tab.active {
  background: var(--bg-2, #0e1e36);
  color: var(--text, #ffffff);
}
.login-tab:not(.active):hover {
  color: var(--text, #ffffff);
}
.login-pane {
  max-width: 360px;
  margin: 0 auto;
}
.login-pane-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 0 12px;
}


/* R2.2: self-organized event pill. Sky-blue to match the existing convention
 * on manxclub.com/events.php where non-sanctioned events get the sky accent. */
.badge.self-org { background: #0ea5e9; color: #fff; }
.top-bar .badge.title-pill {
  margin-left: 6px;
  flex-shrink: 0;
  font-size: 10.5px;
  white-space: nowrap;
}


/* R4.3: small Manx-cat logo in the top-bar (left of title). Tap to
 * jump to the events list. Sized to roughly match the hamburger button
 * on the right so the title centers cleanly between them. */
.top-bar-logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  flex-shrink: 0;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.1s ease-out, opacity 0.1s ease-out;
}
.top-bar-logo:active { transform: scale(0.92); opacity: 0.7; }

/* ---------- Keyboard focus (added 2026-08-11) ----------
 * Nothing in the app showed a focus ring, so keyboard/switch-control users had
 * no idea where they were. :focus-visible only paints for keyboard-style
 * interaction, so touch and mouse taps stay visually unchanged. */
:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 2px;
}
