/* Drift Analysis mobile / PWA CSS (v6.1).
 *
 * Loaded by every admin page via <link rel="stylesheet" href="/mobile.css">
 * BEFORE the page's inline styles so page-specific rules can override
 * where needed.
 *
 * What this fixes:
 *   1. iOS PWA fullscreen — content extending under the Dynamic Island
 *      or home indicator. viewport-fit=cover was already set in the
 *      HTML meta, but no page had the matching env(safe-area-inset-*)
 *      padding to keep UI visible. Symptom: header invisible under
 *      Dynamic Island, statusbar under the home indicator.
 *   2. Topbar overflow on narrow screens — brand + 6 tab links + 4
 *      icon buttons + version chip is ~730px wide, doesn't fit a 390px
 *      iPhone. Wrap onto multiple rows instead of overflowing.
 *   3. Horizontal scroll containment — belt-and-braces overflow-x:
 *      hidden on html and body so no rogue element can push a scroll
 *      offset that visually clips content on the left.
 *
 * Tested targets: iPhone 15 Pro (portrait + landscape), iPad Safari,
 * Chrome Android, desktop.
 */

/* Belt-and-braces: never allow horizontal scroll on the root elements.
   Any child that tries to be wider than viewport gets clipped rather
   than pushing the layout offset. */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* v9.11 — QR generation, scanner, and action-picker modals. Same
   base modal pattern as the recovery / alerts modals: fixed overlay,
   centred card, blurred backdrop. Three distinct modals share the
   same visual language: qr-modal (per-drifter QR), qr-scan-modal
   (camera), qr-picker-modal (post-scan action picker). */
.qr-modal, .qr-scan-modal, .qr-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 4100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.qr-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}
.qr-card, .qr-scan-card, .qr-picker-card {
  position: relative;
  background: var(--surface, #fdfbf6);
  color: var(--ink, #0f172a);
  border: 1px solid var(--border, #dfd8c8);
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
}
.qr-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--border, #dfd8c8);
}
.qr-title {
  font-family: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  font-size: 22px; font-weight: 600;
}
.qr-close-btn {
  appearance: none; border: none; background: transparent;
  color: var(--ink-3, #94a3b8);
  font-size: 22px; line-height: 1;
  cursor: pointer; padding: 4px 8px; border-radius: 4px;
}
.qr-close-btn:hover { background: rgba(0, 0, 0, 0.05); color: var(--ink, #0f172a); }

/* Per-drifter QR modal body */
.qr-body { padding: 16px 18px; text-align: center; }
.qr-image { display: inline-block; padding: 8px; background: #fff; border: 1px solid var(--border, #dfd8c8); border-radius: 6px; }
.qr-image svg { display: block; width: 240px; height: 240px; }
.qr-payload {
  font-family: ui-monospace, "SF Mono", "Menlo", monospace;
  font-size: 12px;
  color: var(--ink-3, #94a3b8);
  margin-top: 10px;
  word-break: break-all;
}
.qr-info { font-size: 12px; color: var(--ink-2, #4a5b75); margin-top: 4px; }
.qr-actions {
  display: flex; gap: 8px; padding: 12px 18px 14px; border-top: 1px solid var(--border, #dfd8c8);
  flex-wrap: wrap;
}
.qr-btn {
  appearance: none;
  background: var(--surface-2, #f5efe1);
  border: 1px solid var(--border, #dfd8c8);
  color: var(--ink-2, #4a5b75);
  border-radius: 6px; padding: 7px 12px;
  font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.qr-btn:hover:not(:disabled) { background: #fff; border-color: var(--border-strong, #b8ac91); }
.qr-btn-primary {
  background: #0f766e; border-color: #0f766e; color: #fff;
  margin-left: auto;
}
.qr-btn-primary:hover:not(:disabled) { background: #115e59; }

/* Scanner modal body */
.qr-scan-card { max-width: 460px; }
.qr-scan-body { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.qr-video {
  width: 100%; height: 320px; object-fit: cover;
  background: #000;
  border-radius: 8px;
  border: 1px solid var(--border, #dfd8c8);
}
.qr-scan-hint { font-size: 12px; color: var(--ink-3, #94a3b8); text-align: center; }
.qr-scan-manual {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  border-top: 1px dashed var(--border, #dfd8c8);
  padding-top: 10px; margin-top: 4px;
}
.qr-scan-manual label { font-size: 11.5px; color: var(--ink-3, #94a3b8); font-weight: 600; }
.qr-scan-input {
  flex: 1 1 140px; min-width: 100px;
  padding: 6px 10px;
  border: 1px solid var(--border, #dfd8c8);
  border-radius: 5px;
  font-family: ui-monospace, "SF Mono", "Menlo", monospace;
  font-size: 12.5px;
  background: #fff;
  color: var(--ink, #0f172a);
}

/* Action picker after scan */
.qr-picker-card { max-width: 420px; }
.qr-picker-body { padding: 10px 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.qr-picker-row {
  display: block;
  text-align: left;
  width: 100%;
  appearance: none;
  background: var(--surface-2, #f5efe1);
  border: 1px solid var(--border, #dfd8c8);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.06s ease;
}
.qr-picker-row:hover { background: #fff; border-color: var(--border-strong, #b8ac91); }
.qr-picker-row:active { transform: scale(0.99); }
.qr-picker-row-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink, #0f172a);
  margin-bottom: 2px;
}
.qr-picker-row-sub {
  font-size: 11.5px;
  color: var(--ink-3, #94a3b8);
}
.qr-picker-recover { background: rgba(15, 118, 110, 0.08); border-color: #99f6e4; }
.qr-picker-recover .qr-picker-row-title { color: #0f766e; }

/* v9.8 — Alerts topbar badge + modal. Badge sits to the LEFT of the
   version chip; only visible when there are unresolved alerts. Click
   opens a modal listing each alert with a Resolve button. */
.alerts-badge {
  appearance: none;
  display: none;             /* hidden until stats poll finds > 0 */
  align-items: center;
  gap: 5px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 999px;
  padding: 3px 9px 3px 6px;
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.alerts-badge:hover { background: #fee2e2; border-color: #fca5a5; }
.alerts-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #dc2626;
  box-shadow: 0 0 0 2px #fef2f2;
  animation: alerts-pulse 2s ease-in-out infinite;
}
@keyframes alerts-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}
.alerts-count {
  font-family: ui-monospace, "SF Mono", "Menlo", monospace;
  font-size: 11px;
}

.alerts-modal {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.alerts-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}
.alerts-card {
  position: relative;
  background: var(--surface, #fdfbf6);
  color: var(--ink, #0f172a);
  border: 1px solid var(--border, #dfd8c8);
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
}
.alerts-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--border, #dfd8c8);
}
.alerts-title {
  font-family: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  font-size: 22px; font-weight: 600;
}
.alerts-close-btn {
  appearance: none; border: none; background: transparent;
  color: var(--ink-3, #94a3b8);
  font-size: 22px; line-height: 1;
  cursor: pointer; padding: 4px 8px; border-radius: 4px;
}
.alerts-close-btn:hover { background: rgba(0, 0, 0, 0.05); color: var(--ink, #0f172a); }
.alerts-body {
  padding: 8px 12px 14px;
  overflow: auto;
  flex: 1 1 auto;
}
.alerts-empty {
  padding: 24px 12px;
  color: var(--ink-3, #94a3b8);
  text-align: center;
  font-size: 13px;
}
.alert-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 8px;
  border-top: 1px solid var(--border, #dfd8c8);
}
.alert-row:first-child { border-top: none; }
.alert-kind {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.alert-body { min-width: 0; }
.alert-drifter {
  font-family: ui-monospace, "SF Mono", "Menlo", monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink, #0f172a);
}
.alert-msg {
  font-size: 12px;
  color: var(--ink-2, #4a5b75);
  margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.alert-when {
  font-size: 10.5px;
  color: var(--ink-3, #94a3b8);
  margin-top: 2px;
}
.alert-resolve {
  appearance: none;
  border: 1px solid var(--border, #dfd8c8);
  background: var(--surface-2, #f5efe1);
  color: var(--ink-2, #4a5b75);
  border-radius: 5px;
  padding: 5px 10px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.alert-resolve:hover:not(:disabled) { background: #fff; border-color: var(--border-strong, #b8ac91); }
.alert-resolve:disabled { opacity: 0.6; cursor: not-allowed; }

/* v9.7 — Recovery modal. Fixed-position overlay opened from the Map
   page drifter popup when the ops team needs to plan a recovery. Not a
   Leaflet popup because those get clipped by the map viewport and are
   awkward on mobile. Centred card with a semi-opaque backdrop; body
   scrolls if the content is taller than the viewport. */
.recovery-modal {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.recovery-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}
.recovery-card {
  position: relative;
  background: var(--surface, #fdfbf6);
  color: var(--ink, #0f172a);
  border: 1px solid var(--border, #dfd8c8);
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
}
.recovery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--border, #dfd8c8);
}
.recovery-title {
  font-family: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink, #0f172a);
}
.recovery-close-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-3, #94a3b8);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.recovery-close-btn:hover { background: rgba(0, 0, 0, 0.05); color: var(--ink, #0f172a); }
.recovery-body {
  padding: 12px 18px;
  overflow: auto;
  flex: 1 1 auto;
}
.recovery-drifter-head { margin-bottom: 8px; }
.recovery-drifter-id {
  font-family: ui-monospace, "SF Mono", "Menlo", monospace;
  font-size: 15px;
  font-weight: 600;
}
.recovery-drifter-sub {
  font-size: 11.5px;
  color: var(--ink-3, #94a3b8);
  margin-top: 2px;
}
.recovery-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px dashed var(--border, #dfd8c8);
  font-size: 12.5px;
  align-items: baseline;
}
.recovery-row:first-of-type { border-top: none; }
.recovery-label { color: var(--ink-3, #94a3b8); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.02em; }
.recovery-value { color: var(--ink, #0f172a); line-height: 1.4; }
.recovery-value.mono { font-family: ui-monospace, "SF Mono", "Menlo", monospace; font-size: 12px; }
.recovery-dms { font-size: 10.5px; color: var(--ink-3, #94a3b8); }
.recovery-sep { color: var(--ink-4, #cbd5e1); margin: 0 4px; }
/* v9.16 — Harvest workflow reminder inside the recovery modal. */
.recovery-harvest {
  margin: 12px 18px 6px;
  padding: 10px 12px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
}
.recovery-harvest-title {
  font-size: 11px;
  font-weight: 600;
  color: #065f46;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.recovery-harvest-steps {
  margin: 0;
  padding-left: 18px;
  color: #065f46;
  font-size: 12.5px;
  line-height: 1.5;
}
.recovery-harvest-steps li { margin-bottom: 3px; }
.recovery-mono {
  font-family: ui-monospace, "SF Mono", "Menlo", monospace;
  font-size: 11.5px;
  background: rgba(6, 95, 70, 0.08);
  padding: 1px 5px;
  border-radius: 3px;
}
.recovery-harvest-link {
  color: #047857;
  font-weight: 600;
  text-decoration: underline;
}
.recovery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px 14px;
  border-top: 1px solid var(--border, #dfd8c8);
}
.recovery-actions .btn-secondary,
.recovery-actions .btn-primary {
  appearance: none;
  border-radius: 6px;
  padding: 7px 12px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.recovery-actions .btn-secondary {
  background: var(--surface-2, #f5efe1);
  border: 1px solid var(--border, #dfd8c8);
  color: var(--ink-2, #4a5b75);
}
.recovery-actions .btn-secondary:hover { background: #fff; border-color: var(--border-strong, #b8ac91); }
.recovery-actions .btn-primary {
  background: #0f766e;
  border: 1px solid #0f766e;
  color: #fff;
  margin-left: auto;
}
.recovery-actions .btn-primary:hover:not(:disabled) { background: #115e59; }
.recovery-actions .btn-primary:disabled { background: #94a3b8; border-color: #94a3b8; cursor: not-allowed; }

/* v9.7 — Small "Recover" chip inside the Map page drifter popup that
   opens the modal above. Sits under the existing stats row. */
.drifter-popup-recover {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 6px 8px;
  border: 1px solid #0f766e;
  background: #0f766e;
  color: #fff;
  border-radius: 5px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.drifter-popup-recover:hover { background: #115e59; border-color: #115e59; }

/* v9.6 — Weather layer toggle control. Sits as a Leaflet control in
   the top-right of the map. Uses leaflet-bar base styling for the
   drop-shadow / border, then overrides button styling to match the
   Drift Analysis palette. Two toggle buttons (Wind, Current) plus a
   unit-cycle pill (kt / km/h / mph) that only appears when at least
   one layer is on. Buttons stack vertically. */
.weather-ctl {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border, #dfd8c8);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
}
.weather-btn {
  appearance: none;
  border: none;
  border-top: 1px solid var(--border, #dfd8c8);
  background: transparent;
  color: var(--ink-2, #4a5b75);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  min-width: 84px;
  text-align: left;
  transition: background 0.12s ease;
}
.weather-btn:first-child { border-top: none; }
.weather-btn:hover { background: rgba(0, 0, 0, 0.04); }
.weather-btn[aria-pressed="true"] { background: rgba(37, 99, 235, 0.08); color: #1e40af; }
.weather-btn.current[aria-pressed="true"] { background: rgba(13, 148, 136, 0.10); color: #0f766e; }
.weather-btn.unit {
  justify-content: center;
  font-family: ui-monospace, "SF Mono", "Menlo", monospace;
  font-size: 10.5px;
  background: rgba(0, 0, 0, 0.03);
  color: var(--ink-3, #94a3b8);
  padding: 4px 10px;
  min-width: 0;
}
.weather-btn.unit:hover { background: rgba(0, 0, 0, 0.06); color: var(--ink-2, #4a5b75); }

/* Individual arrow markers — no background, no border. The SVG carries
   its own shape and the numeric label. */
.leaflet-div-icon.weather-arrow,
.weather-arrow {
  background: transparent !important;
  border: none !important;
}

/* v8.7 — Shared base styles for the topbar tab strip. Prior to v8.7
   each page defined these itself, with small drifts (colours, margins,
   quote-escaping in inline styles). Now every page just mounts the
   tab list via topbar.js and inherits these rules.

   Pages may still override colours if their theme demands it, but
   the layout, sizing and interaction states are single-sourced here.
   The .topbar-tabs container holds the row; individual .topbar-tab
   elements are the anchor tags rendered by topbar.js.

   v9.0 — The tab strip now sits on its OWN row at every width, below
   the brand and version chip. Prior to v9.0 the tabs, version chip
   and icon buttons all clustered on the right of a single-row
   header, which looked squashed. The three rules that make this
   work: (1) the topbar container flex-wraps, (2) the tab strip is
   forced to flex-basis 100 percent so it always begins a new line,
   (3) a small top padding + hairline on the tabs row gives visual
   separation from the brand row. The container width claim also
   naturally centres the strip on very wide screens because the
   individual tabs pack from the start-edge and there is empty
   space to the right; if this ever needs to be evenly-distributed
   or centred, add justify-content on .topbar-tabs. */
.header,
.topbar,
.admin-topbar {
  flex-wrap: wrap;
}
.topbar-tabs {
  display: flex;
  gap: 4px;
  row-gap: 4px;
  align-items: center;
  flex-wrap: wrap;
  flex: 1 1 100%;
  max-width: 100%;
  padding-top: 8px;
  border-top: 1px solid var(--border, #dfd8c8);
}
.topbar-tab {
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2, #4a5b75);
  padding: 5px 10px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.14s ease, color 0.14s ease;
  white-space: nowrap;
}
.topbar-tab:hover {
  background: var(--surface-2, #eef2f7);
  text-decoration: none;
}
.topbar-tab.active {
  background: var(--ink, #0a2540);
  color: #fff;
}
.topbar-tab.active:hover {
  background: var(--ink, #0a2540);
}

/* Constrain the .app grid to viewport width. If any grid child tries
   to overflow (say a too-wide topbar before mobile styles applied),
   the grid track stays at viewport width and the offending child
   gets clipped/wrapped instead of pushing the layout. */
.app {
  max-width: 100vw;
  overflow-x: hidden;
}

/* Safe area handling — kicks in on devices that report insets (iPhone
   notch / Dynamic Island, iPad rounded corners, Android edge-to-edge).
   Uses max() so we never lose the existing padding, only extend it
   further when the device needs more room.

   Not wrapped in @supports because iOS Safari has quirks resolving
   env() inside @supports queries — the direct rule works everywhere
   env() is supported, and falls back to the max() fallback (14px)
   where env() returns 0 or is unsupported.

   Uses !important because pages have inline <style> blocks loaded
   AFTER this stylesheet that set their own padding on .header. */
.header,
.topbar {
  padding-top: max(14px, env(safe-area-inset-top)) !important;
  padding-left: max(14px, env(safe-area-inset-left)) !important;
  padding-right: max(14px, env(safe-area-inset-right)) !important;
}
body {
  padding-bottom: env(safe-area-inset-bottom);
}
/* Playback bar on the map page — respect insets so it doesn't sit
   under the home indicator. */
.playback {
  margin-bottom: env(safe-area-inset-bottom);
}

/* Mobile header wrapping. On narrow screens, allow the header to
   wrap onto multiple rows rather than overflow horizontally. This
   is what actually stops the layout from being pushed off-screen. */
@media (max-width: 820px) {
  .header,
  .topbar {
    flex-wrap: wrap;
    row-gap: 6px;
    /* Combine top-inset with a small extra gap so the FIRST row of
       content clears the Dynamic Island / notch comfortably rather
       than sitting flush against it. */
    padding-top: calc(max(14px, env(safe-area-inset-top)) + 4px) !important;
    padding-left: max(10px, env(safe-area-inset-left)) !important;
    padding-right: max(10px, env(safe-area-inset-right)) !important;
    padding-bottom: 10px !important;
  }
  /* v8.8 — Let the tab strip wrap onto multiple rows on narrow
     screens. Base rules in v9.0 already give the strip its own row
     via flex: 1 1 100%; here we only compress the individual tabs
     so eight of them still fit on a portrait iPhone without a
     second wrap. */
  /* Tabs stay on one row but can compress. */
  .topbar-tab {
    font-size: 11px !important;
    padding: 4px 7px !important;
  }
  /* Version chip smaller and never grows. */
  .version-chip {
    font-size: 10px;
    padding: 2px 7px;
    flex-shrink: 0;
  }
  /* Icon buttons shrink so they don't push wider than the row. */
  .icon-btn {
    width: 28px !important;
    height: 28px !important;
    flex-shrink: 0;
  }
  /* Brand mark keeps its size but doesn't get squeezed weirdly. */
  .brand {
    flex-shrink: 0;
  }
  /* The flexible spacer between brand and nav has no reason to exist
     on mobile — remove it so items pack tightly. */
  .spacer {
    flex: 0 0 auto !important;
    width: 0 !important;
  }
}

/* Very small screens (SE, older phones): compress further. */
@media (max-width: 400px) {
  .topbar-tab {
    font-size: 10.5px !important;
    padding: 3px 6px !important;
    margin-right: 2px !important;
  }
  .brand-mark {
    font-size: 15px !important;
  }
}
