/* ============================================================
   AVCentral Aviation Jobs — Stylesheet (single-mode rebuild)
   Mobile-first (430px), dark theme. Premium aviation cockpit aesthetic.
   See DESIGN.md for token definitions and motion specs.
   ============================================================ */

/* ── Design Tokens ── */
:root {
  /* 3-layer depth system */
  --avi-bg: #060f1e;          /* Layer 0 — page */
  --avi-card: #0c1a30;        /* Layer 1 — cards */
  --avi-card-b: #0f1e38;      /* Layer 2 — inputs, info grid cells */
  --avi-card-hover: #142644;  /* Layer 3 — hover/raised */

  /* Gold (primary accent) */
  --avi-gold: #e8a020;
  --avi-gold-dim: #c4871a;
  --avi-gold-glow: rgba(232,160,32,.15);
  --avi-gold-border: rgba(232,160,32,.25);
  --avi-gold-strong: rgba(232,160,32,.30);

  /* Ice blue (secondary accent) */
  --avi-ice: #4fc3f7;
  --avi-ice-dim: #3a9bc7;
  --avi-ice-glow: rgba(79,195,247,.12);
  --avi-ice-border: rgba(79,195,247,.25);

  /* Text */
  --avi-text: #e8eef5;
  --avi-text-2: #94a7be;
  --avi-muted: #7d93ad; /* audit LA-10: was #5d7490 / #3a4f6a (3.6:1 / 2.3:1); both now AA for small text */
  --avi-dim: #7d93ad;

  /* Functional */
  --avi-skip-bg: #1e2d42;
  --avi-skip-border: #2a3d55;
  --avi-border: rgba(255,255,255,0.07);
  --avi-border-light: rgba(255,255,255,0.12);

  /* Sizing */
  --avi-radius: 14px;
  --avi-radius-sm: 9px;
  --avi-radius-lg: 24px;
  --avi-header-h: 56px;
  --avi-nav-h: 64px;

  /* Fonts */
  --avi-font: 'DM Sans', sans-serif;
  --avi-font-display: 'Bebas Neue', cursive;
}

/* ── GP layout overrides — force full-width inside .site-content flex ── */
.page-template-page-aviation-jobs #content.site-content { display: block !important; }
.page-template-page-aviation-jobs .site-content > * { display: none !important; }
.page-template-page-aviation-jobs .site-content > .avi-jobs-header { display: flex !important; }
.page-template-page-aviation-jobs .site-content > .avi-jobs-h1 { display: block !important; }
.page-template-page-aviation-jobs .site-content > #avi-jobs-app { display: block !important; }
.page-template-page-aviation-jobs .site-content > #avi-jobs-loading { display: block !important; }
.page-template-page-aviation-jobs #primary,
.page-template-page-aviation-jobs #secondary,
.page-template-page-aviation-jobs .sidebar { display: none !important; }


/* SVG sizing fallbacks for icons inside buttons (icons have no inline w/h) */
.avi-btn-apply svg { width: 16px; height: 16px; flex-shrink: 0; }
.avi-btn-icon svg { width: 18px; height: 18px; flex-shrink: 0; }
.avi-btn-follow svg { width: 14px; height: 14px; flex-shrink: 0; }
.avi-tag svg { width: 11px; height: 11px; flex-shrink: 0; }

/* GP button-padding override that crushed our small icon buttons (close on
   detail sheet + icon-only buttons). The Saved-tab .avi-card-remove button
   was removed when the Saved view unified with buildListCard. */
.avi-detail-close,
.avi-btn-icon { padding: 0 !important; }

/* ── App container ── */
#avi-jobs-app {
  font-family: var(--avi-font);
  color: var(--avi-text);
  background: var(--avi-bg);
  min-height: 100vh;
  width: 100%;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Atmospheric noise + gradient mesh — applied to app background */
#avi-jobs-app::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.025 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
  opacity: 1;
}
#avi-jobs-app::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(50% 50% at 90% 0%, rgba(79,195,247,0.05), transparent 60%),
    radial-gradient(55% 55% at 10% 100%, rgba(232,160,32,0.04), transparent 65%);
  filter: blur(50px);
}

.avi-app {
  display: flex;
  flex-direction: column;
  /* Viewport minus the PHP-rendered .avi-jobs-header that now sits above us. */
  height: calc(100vh - var(--avi-header-h));
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* Hide GP footer/header inside jobs app */
#avi-jobs-app ~ footer,
.page-template-page-aviation-jobs footer,
.page-template-page-aviation-jobs .site-footer { display: none; }

/* ============================================================
   JOBS HEADER  (PHP-rendered: brand lockup + search toggle + input)
   Mirrors the old .avi-header container so the search-wrap slides
   down correctly underneath it.
   ============================================================ */
.avi-jobs-header {
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--avi-header-h);
  padding: 0 16px;
  background: rgba(6, 15, 30, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--avi-border);
  flex-shrink: 0;
  animation: avi-slide-down 0.4s ease both;
}

/* ============================================================
   Page H1 — visible page identity heading sitting between the
   sticky brand header and the SPA mount. Styled subordinately so
   it does not compete with the AVCENTRAL JOBS lockup for prominence
   but gives the page proper semantic structure for SEO + a11y.
   ============================================================ */
.avi-jobs-h1 {
  font-family: 'Bebas Neue', 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #4fc3f7;
  margin: 0;
  padding: 10px 16px;
  line-height: 1.2;
  background: rgba(6, 15, 30, 0.97);
  border-bottom: 1px solid rgba(79, 195, 247, 0.12);
}

@media (max-width: 767.98px) {
  .avi-jobs-h1 {
    font-size: 12px;
    letter-spacing: 1.2px;
    padding: 8px 12px;
  }
}

/* ============================================================
   HEADER  (orphaned — JS no longer renders .avi-header. Kept for
   any consumers still referencing the class; safe to delete later.)
   ============================================================ */
.avi-header {
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--avi-header-h);
  padding: 0 16px;
  background: rgba(6, 15, 30, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--avi-border);
  flex-shrink: 0;
  animation: avi-slide-down 0.4s ease both;
}
@keyframes avi-slide-down {
  from { transform: translateY(-12px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

.avi-header-brand {
  display: flex; align-items: center;
  text-decoration: none;
  flex-shrink: 0; line-height: 1;
}
.avi-header-logo-wrap { text-align: center; }
.avi-header-logo-line1 {
  font-family: var(--avi-font-display);
  font-size: 22px;
  letter-spacing: 3px;
  color: var(--avi-text);
}
.avi-header-logo-line1 span { color: var(--avi-gold); }
.avi-header-logo-line2 {
  font-family: var(--avi-font-display);
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--avi-muted);
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.avi-flag {
  width: 12px; height: 8px;
  object-fit: cover;
  border-radius: 1px;
  opacity: 0.75;
  margin-top: -2px;
}

.avi-header-actions { display: flex; align-items: center; gap: 6px; }

/* Post Job — gold gradient primary CTA. Jobs-sub-site only. Employer-facing
   transactional CTA; promoted from ice-blue outline to filled gold to read
   as a strong primary action rather than a secondary button. Still scoped
   under .avi-jobs-header to beat body.fsf-dark-theme a { color: inherit }. */
.avi-jobs-header a.avi-btn-post {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #060f1e;
  background: linear-gradient(135deg, #e8a020, #c4871a);
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(232, 160, 32, 0.25);
  text-decoration: none;
  white-space: nowrap;
  transition: box-shadow 0.15s, transform 0.1s;
}
.avi-jobs-header a.avi-btn-post:hover,
.avi-jobs-header a.avi-btn-post:focus-visible {
  box-shadow: 0 4px 18px rgba(232, 160, 32, 0.4);
  color: #060f1e;
  text-decoration: none;
  outline: none;
}
.avi-jobs-header a.avi-btn-post:active { transform: scale(0.98); }
.avi-jobs-header .avi-btn-post-short { display: none; }
@media (max-width: 640px) {
  .avi-jobs-header .avi-btn-post-full  { display: none; }
  .avi-jobs-header .avi-btn-post-short { display: inline; }
  .avi-jobs-header a.avi-btn-post      { padding: 0 10px; font-size: 12px; }
}

/* Hide Post Job on mobile — employers don't post jobs on phones. */
@media (max-width: 1023px) {
  .avi-jobs-header a.avi-btn-post { display: none; }
}

/* Legacy header search icon is now superseded by the in-column search bar
   rendered above the map on desktop. Hide it everywhere to avoid a dead
   icon that also used to slide a separate input wrap. */
.avi-jobs-header #avi-search-btn { display: none; }

.avi-btn-icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(148,167,190,0.2);
  background: rgba(148,167,190,0.08);
  color: var(--avi-text-2);
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.avi-btn-icon:hover {
  background: rgba(148,167,190,0.15);
  border-color: rgba(148,167,190,0.3);
  color: var(--avi-text);
}
.avi-btn-icon.active {
  background: var(--avi-gold-glow);
  border-color: var(--avi-gold-border);
  color: var(--avi-gold);
}

/* ── Search bar (slides down below header) ── */
.avi-search-wrap {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  padding: 10px 16px;
  background: rgba(6, 15, 30, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--avi-border);
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.2s ease;
  z-index: 49;
}
.avi-search-wrap.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.avi-search-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--avi-border);
  border-radius: 10px;
  background: var(--avi-card-b);
  color: var(--avi-text);
  font-family: var(--avi-font);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.avi-search-input::placeholder { color: var(--avi-muted); }
.avi-search-input:focus { border-color: var(--avi-ice); }

/* ============================================================
   CONTENT AREA
   ============================================================ */
.avi-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.avi-jobs-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ============================================================
   MAP — collapsible
   ============================================================ */
.avi-map-wrap {
  position: relative;
  height: 26vh;
  min-height: 200px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--avi-border);
  overflow: hidden;
  transition: height 0.3s ease, min-height 0.3s ease;
  background: var(--avi-bg);
  animation: avi-fade-in 0.5s ease 0.1s both;
}
.avi-map-wrap.collapsed {
  height: 0;
  min-height: 0;
  border-bottom: none;
}
.avi-map-wrap.collapsed #avi-jobs-map,
.avi-map-wrap.collapsed .avi-map-toggle,
.avi-map-wrap.collapsed .avi-map-legend { visibility: hidden; }
@keyframes avi-fade-in { from { opacity: 0; } to { opacity: 1; } }

#avi-jobs-map {
  width: 100%; height: 100%;
  background: var(--avi-bg);
}

/* Map corner toggle — anchored bottom-right INSIDE the map */
.avi-map-toggle {
  position: absolute;
  bottom: 8px; right: 10px;
  z-index: 1001;  /* above leaflet zoom controls */
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  background: rgba(12,26,48,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--avi-border);
  border-radius: 8px;
  color: var(--avi-gold);
  font-family: var(--avi-font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.avi-map-toggle:hover {
  background: rgba(12,26,48,0.95);
  border-color: var(--avi-border-light);
}
.avi-map-toggle:active { transform: scale(0.97); }
.avi-map-toggle svg { width: 12px; height: 12px; flex-shrink: 0; }

/* Map legend */
.avi-map-legend {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 1000;
  background: rgba(12,26,48,0.92);
  backdrop-filter: blur(8px);
  border-radius: var(--avi-radius-sm);
  padding: 7px 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--avi-text-2);
  border: 1px solid var(--avi-border);
}
.avi-legend-item { display: flex; align-items: center; gap: 6px; }
.avi-legend-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 2px solid;
  flex-shrink: 0;
}
.avi-legend-dot.gold { background: rgba(232,160,32,0.7); border-color: var(--avi-gold); }
.avi-legend-dot.ice  { background: rgba(79,195,247,0.7); border-color: var(--avi-ice); }

/* ============================================================
   SHOW MAP BAR — single bar shown ONLY when map is collapsed.
   Combines toggle + job count. When map is visible, no bar at all.
   ============================================================ */
.avi-show-map-bar {
  display: none;  /* JS sets to 'flex' when collapsed */
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 12px 16px;
  font-family: var(--avi-font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--avi-gold);
  background: var(--avi-card);
  border: none;
  border-bottom: 1px solid var(--avi-border);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
  animation: avi-fade-up 0.25s ease both;
}
.avi-show-map-bar:hover { background: var(--avi-card-hover); }
.avi-show-map-bar svg { width: 12px; height: 12px; flex-shrink: 0; }
@keyframes avi-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   JOB LIST — single scrollable column of compact cards
   ============================================================ */
/* .avi-list-column wraps the scroll container. It must be a flex column
   at all viewports so that .avi-list-scroll inside can claim a bounded
   height via flex:1. Before this was only set inside @media (min-width:
   1024px), which meant mobile had a plain block div — flex:1 on
   .avi-list-scroll did nothing, scroll height grew to content, and the
   page scrolled instead of the list. min-height:0 defeats the flex-item
   default (auto) that would let content push the column tall. */
.avi-list-column {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.avi-list-scroll {
  flex: 1;
  min-height: 0;    /* allow shrink below content so overflow:auto activates */
  overflow-y: auto;
  padding: 12px 12px 88px;
  /* iOS scroll-chain fix — two ancestors (.avi-content, .avi-app) are
     overflow:hidden, which historically breaks touch-pan scroll-routing
     on Safari. These two declarations explicitly opt this element into
     the iOS hardware-scroll pipeline and keep the chain contained here
     instead of bubbling to the non-scrollable body. Desktop unaffected. */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ============================================================
   CLUSTER FILTER CHIP — shown above the first card when a user
   has clicked a map cluster and the list is filtered to that set
   ============================================================ */
.avi-cluster-filter-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;    /* label hugs left, Clear hugs right */
  gap: 12px;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: rgba(79, 195, 247, 0.10);
  border: 1px solid rgba(79, 195, 247, 0.25);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  animation: avi-chip-fade-in 180ms ease-out;
}
/* Left-side label — pin + count/city text. Informational, not clickable. */
.avi-cluster-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #4fc3f7;
  font-weight: 600;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.avi-cluster-filter-pin {
  display: inline-flex;
  width: 14px;
  height: 14px;
  color: #4fc3f7;
  flex-shrink: 0;
}
.avi-cluster-filter-pin svg { width: 14px; height: 14px; }

/* Right-side Clear button — muted by default so it reads as secondary,
   brightens on hover/focus to confirm it's actionable. */
.avi-cluster-filter-clear {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: #94a7be;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.avi-cluster-filter-clear:hover,
.avi-cluster-filter-clear:focus-visible {
  background: rgba(255, 255, 255, 0.05);
  color: #e8eef5;
  outline: none;
}

@keyframes avi-chip-fade-in {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Mobile: allow the label to wrap so long city names don't overflow */
@media (max-width: 480px) {
  .avi-cluster-filter-chip { max-width: 100%; }
  .avi-cluster-filter-label { white-space: normal; }
}

/* ============================================================
   SEARCH FILTER CHIP — gold accent, distinguishes from ice-blue
   cluster chip. Both can stack; each clears independently.
   ============================================================ */
.avi-search-filter-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: rgba(232, 160, 32, 0.08);
  border: 1px solid rgba(232, 160, 32, 0.25);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  animation: avi-chip-fade-in 180ms ease-out;
}
.avi-search-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #e8a020;
  font-weight: 600;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.avi-search-filter-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.avi-search-filter-clear {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: #94a7be;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.avi-search-filter-clear:hover,
.avi-search-filter-clear:focus-visible {
  background: rgba(255, 255, 255, 0.05);
  color: #e8eef5;
  outline: none;
}
@media (max-width: 480px) {
  .avi-search-filter-chip { max-width: 100%; }
  .avi-search-filter-label { white-space: normal; }
}

.avi-job-card {
  position: relative;
  background: var(--avi-card);
  border: 1px solid var(--avi-border);
  border-radius: var(--avi-radius);
  padding: 14px;
  margin-bottom: 8px;
  cursor: pointer;
  overflow: hidden;
  touch-action: pan-y;
  transition:
    transform 0.25s cubic-bezier(.25,.46,.45,.94),
    box-shadow 0.25s cubic-bezier(.25,.46,.45,.94),
    border-color 0.2s ease,
    background 0.2s ease;
  /* Reveal animation lives on .avi-card-wrap instead — keeping a running
     transform animation on .avi-job-card would override the inline
     translateX we write during swipe drags (per CSS cascade: animation
     origin beats inline style). */
}
.avi-job-card.dragging { transition: none; cursor: grabbing; }
@keyframes avi-card-reveal {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);     }
}

/* Hover (desktop) — lift, scale, shadow bloom, gradient wash */
@media (hover: hover) {
  .avi-job-card:hover {
    transform: translateY(-2px) scale(1.01);
    border-color: var(--avi-border-light);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    background: linear-gradient(135deg, rgba(79,195,247,0.04), transparent 50%), var(--avi-card);
  }
  .avi-job-card.featured:hover {
    background: linear-gradient(135deg, rgba(232,160,32,0.06), transparent 50%), var(--avi-card);
    box-shadow: 0 8px 32px rgba(232,160,32,0.12);
  }
  /* .avi-card-icon hover rules removed alongside the legacy Saved-card
     letter placeholder — the unified buildListCard doesn't use .avi-card-icon. */
}
.avi-job-card:active { transform: scale(0.98); }

/* Featured: gold left border + soft shadow */
.avi-job-card.featured {
  border-left: 3px solid var(--avi-gold);
  box-shadow: 0 0 0 1px rgba(232,160,32,.10), 0 4px 24px rgba(232,160,32,.06);
}

/* Highlighted from map pin click */
.avi-job-card.highlighted {
  border-color: var(--avi-gold);
  box-shadow: 0 0 0 1px var(--avi-gold), 0 0 24px var(--avi-gold-glow);
}

/* ============================================================
   SPRINT 3.7 CARD LAYOUT — 3-row scan pattern
   Row 1: title + relative time (top-right)
   Row 2: employer · location
   Row 3: profession-aware chips + salary (right-pinned)
   Logo slot only renders when employer_logo_url is set. No letter
   placeholders — absent logo just means text starts at the left edge.
   ============================================================ */
.avi-job-card {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.avi-card-logo-slot {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--avi-surface);
  align-self: flex-start;
}
.avi-card-logo-slot img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.avi-card-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.avi-card-row1 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  margin-bottom: 2px;
}
.avi-card-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--avi-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.avi-card-time {
  color: #94a7be;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
  /* No absolute positioning — lives inline in Row 2 now. */
}
/* May 10 polish (Phase 2 of final-cleanup): emphasize fresh postings.
   .fresh applies when relativeTime returns 'just now', '<24h ago', or
   '1d'. Subtle gold tint signals freshness without competing with the
   gold employer name or salary pill. Pilot-scanning use case: at-a-
   glance differentiation of new postings without needing to read the
   timestamp. */
.avi-card-time.fresh {
  color: var(--avi-gold);
  font-weight: 600;
}

.avi-card-row2 {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
  font-size: 12px;
  margin-bottom: 6px;
  min-width: 0;
}
.avi-card-employer {
  color: var(--avi-gold);
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55%;
}
.avi-card-sep {
  color: #5d7490;
  opacity: 0.7;
  flex-shrink: 0;
}
.avi-card-location {
  color: var(--avi-text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.avi-card-row3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}
.avi-card-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1;
}
.avi-card-salary {
  flex-shrink: 0;
  /* May 9 polish: bumped 11px → 12px to lift visibility on the card
     row 3. Width caps + ellipsis added so vague Phase 1 LLM-extracted
     prose ("Competitive compensation package") truncates gracefully
     instead of forcing the chip row to wrap or the row to overflow.
     Hover tooltip via JS title attribute carries the full text. */
  font-size: 12px;
  font-weight: 700;
  color: var(--avi-gold);
  white-space: nowrap;
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* May 10 polish (Phase 2 of final-cleanup): three-tier salary visual
   hierarchy. Numeric ($-containing) salaries are the most actionable
   data point on a card — pilots scan for "$X-$Y" and react. Prose
   verbatim ("Competitive package") is informative but lower-leverage.
   "Contact" fallback is muted to avoid dominating the row when no
   real data is present.
     .numeric — chip-style boxed presentation, slightly bolder weight
     .prose   — existing gold styling (default tier, no class needed
                but explicit for symmetry)
     .muted   — Contact fallback */
.avi-card-salary.numeric {
  background: rgba(232, 160, 32, 0.12);
  border: 1px solid rgba(232, 160, 32, 0.35);
  border-radius: 5px;
  padding: 1px 7px;
  font-weight: 800;
}
.avi-card-salary.prose {
  /* Same as base — explicit class for symmetry / future tweaks. */
  font-style: italic;
  font-weight: 600;
  opacity: 0.92;
}
.avi-card-salary.muted { color: var(--avi-muted); font-weight: 500; }

/* Sprint 3.7 CHIPS — variants by profession group */
.avi-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  font-family: var(--avi-font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
  white-space: nowrap;
  border: 1px solid transparent;
}
.avi-chip-hours {
  background: var(--avi-gold-glow);
  border-color: var(--avi-gold-border);
  color: var(--avi-gold);
}
.avi-chip-any,
.avi-chip-licence,
.avi-chip-aircraft,
.avi-chip-schedule {
  background: var(--avi-ice-glow);
  border-color: var(--avi-ice-border);
  color: var(--avi-ice);
}
.avi-chip-type-rating {
  background: rgba(232, 160, 32, 0.15);
  border-color: rgba(232, 160, 32, 0.30);
  color: var(--avi-gold);
  letter-spacing: 0.08em;
}
/* May 10 polish (Phase 2 of final-cleanup): scheduleType pill — surfaces
   the LLM-extracted employment-type enum (full-time / part-time /
   rotational / casual / contract / seasonal) on pilot/ame cards. Visually
   distinct from .avi-chip-schedule (regex-extracted rotation pattern like
   "14 on / 14 off") via a neutral grayed-out background — same role,
   complementary information. Audit 2026-05-08 found scheduleType
   populated on 71% of publish posts but only rendered in detail-grid
   (May 9 polish) — never on the card itself. */
.avi-chip-schedule-type {
  background: rgba(148, 167, 190, 0.10);
  border-color: rgba(148, 167, 190, 0.25);
  color: var(--avi-text-2);
}
.avi-chip-jobtype {
  background: rgba(255,255,255,0.04);
  border-color: var(--avi-border);
  color: var(--avi-text-2);
}
/* Step 3 (May 8 2026) — specialty pill (medevac / charter / scheduled /
   training / cargo / corporate). Distinct purple-leaning hue so it stands
   apart from gold (hours), ice (licence/aircraft/schedule), and the muted
   jobtype pill. Renders only when avi_specialty meta is populated by the
   structured-extraction layer; absent for the majority of legacy posts
   until cron updates them. */
.avi-chip-specialty {
  background: rgba(155, 130, 220, 0.12);
  border-color: rgba(155, 130, 220, 0.30);
  color: rgb(190, 168, 240);
}

/* ============================================================
   SAVED ICON (STAR) — professional bookmark/watchlist vocabulary
   (LinkedIn, Gmail, ForeFlight). Used in: the Saved tab (outline,
   inherits tab color) and the detail sheet save button.

   Colour is NOT set here — both render contexts inherit the parent
   element's `color` through the SVG's `currentColor` for stroke/fill.
   That way the detail sheet's existing contrast scheme (.avi-btn-save
   color: gold → .saved color: #060f1e on solid gold bg) continues to
   work. Visual state change comes from swapping outline ↔ filled
   SVG at the JS layer.
   ============================================================ */
.avi-icon-star {
  transition: color 0.15s, transform 0.2s cubic-bezier(.34,1.56,.64,1);
}

/* Spring animation on commit — triggered by the .pulsing class
   added to the save button when the user saves from the detail sheet. */
@keyframes avi-star-bounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  70%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}
.avi-btn-save.pulsing { animation: avi-star-bounce 0.4s cubic-bezier(.34,1.56,.64,1); }

/* .avi-card-meta and .avi-card-tags rules removed — they belonged to the
   legacy Saved-tab card. The unified buildListCard uses Row 2 (meta) and
   Row 3 (.avi-card-row3 with chips + salary) instead. */

/* Tag pills */
.avi-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
  /* Stagger pop-in */
  opacity: 0;
  animation: avi-tag-pop 0.25s cubic-bezier(.34,1.56,.64,1) both;
  animation-delay: var(--tag-delay, 0s);
}
@keyframes avi-tag-pop {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1);   }
}
.avi-tag-type {
  background: var(--avi-ice-glow);
  color: var(--avi-ice);
  border: 1px solid var(--avi-ice-border);
}
.avi-tag-licence {
  background: var(--avi-gold-glow);
  color: var(--avi-gold);
  border: 1px solid var(--avi-gold-border);
}
.avi-tag-piw {
  background: rgba(255,255,255,0.05);
  color: var(--avi-text-2);
  border: 1px solid var(--avi-border);
}
.avi-tag-featured {
  background: var(--avi-gold-glow);
  color: var(--avi-gold);
  border: 1px solid var(--avi-gold-border);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
/* Salary pushed right */
.avi-tag-salary {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--avi-text);
  background: transparent;
  padding: 2px 0;
}

/* NEW corner ribbon (top-right, gold gradient) */
.avi-card-new-ribbon {
  position: absolute;
  top: 0; right: 0;
  background: linear-gradient(135deg, var(--avi-gold), var(--avi-gold-dim));
  color: #1a1100;
  font-family: var(--avi-font);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
  padding: 3px 10px 3px 12px;
  border-radius: 0 var(--avi-radius) 0 8px;
  z-index: 2;
  animation: avi-new-pulse 2s ease-in-out infinite;
}
@keyframes avi-new-pulse {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 1; }
}

/* ============================================================
   SWIPE GESTURE — clamped, quiet, commit-reveal only
   Each card is wrapped in .avi-card-wrap with two absolutely-
   positioned action backgrounds behind it. Backgrounds are
   invisible until commit (release past threshold). On commit
   the wrap collapses and following cards slide up naturally.
   ============================================================ */
.avi-card-wrap {
  position: relative;
  overflow: visible;
  max-height: 260px;   /* roomy cap — tallest cards (featured + tags) stay inside */
  margin-bottom: 8px;  /* matches .avi-list-scroll gap between cards */
  transition:
    max-height 0.4s cubic-bezier(.25,.46,.45,.94),
    opacity    0.3s,
    margin     0.4s cubic-bezier(.25,.46,.45,.94);
  /* Default opacity is 1 so cards appear immediately on subsequent renders
     (save/archive/filter-change re-render path). The staggered reveal is
     scoped under .avi-cards-initial-mount and only fires on first mount of
     the Jobs / Saved cards container (gated by hasMountedJobsList /
     hasMountedSavedList in JS). */
  opacity: 1;
}
.avi-cards-initial-mount .avi-card-wrap {
  /* First-mount cascade — translateY+scale fade-in, staggered via per-card
     --reveal-delay (set inline by buildListCard, capped at 0.8s). Class is
     added by render{Jobs,Saved}View on first mount, removed after 1.4s
     (longest delay 0.8s + animation 0.45s + buffer). */
  opacity: 0;
  animation: avi-card-reveal 0.45s cubic-bezier(.25,.46,.45,.94) both;
  animation-delay: var(--reveal-delay, 0s);
}
.avi-card-wrap.collapsing {
  max-height: 0;
  opacity: 0;
  margin-bottom: -8px; /* cancels the card-gap so following cards slide up */
}

.avi-action-bg {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  border-radius: var(--avi-radius);
  display: flex;
  align-items: center;
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: 20px;
  letter-spacing: 0.18em;
  font-weight: 400;
  padding: 0 22px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 1;
}
.avi-action-bg.save {
  justify-content: flex-end;
  color: rgba(232, 160, 32, 0.75);
  background: linear-gradient(270deg, rgba(232,160,32,0.09) 0%, transparent 55%);
}
.avi-action-bg.archive {
  justify-content: flex-start;
  color: rgba(79, 195, 247, 0.7);
  background: linear-gradient(90deg, rgba(79,195,247,0.07) 0%, transparent 55%);
}
.avi-action-bg.show { opacity: 1; }

/* Card lives above the action backgrounds. During drag we disable the
   transform transition so translateX tracks the finger 1:1; on commit
   the .committing class fades the card out in place. Reset the card's
   bottom margin — the wrap owns the gap. */
.avi-card-wrap > .avi-job-card {
  position: relative;
  z-index: 2;
  margin-bottom: 0;
  transition:
    transform    0.3s cubic-bezier(.25,.46,.45,.94),
    border-color 0.15s,
    opacity      0.3s;
}
.avi-card-wrap > .avi-job-card.dragging { transition: none; }
.avi-card-wrap > .avi-job-card.committing { opacity: 0; }
.avi-card-wrap > .avi-job-card.saved-border    { border-color: rgba(232, 160, 32, 0.30); }
.avi-card-wrap > .avi-job-card.archived-border { border-color: rgba(79, 195, 247, 0.25); }

/* ============================================================
   BOTTOM SHEET (DETAIL VIEW)
   ============================================================ */
.avi-detail-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.avi-detail-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.avi-detail-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  min-height: 75vh;
  max-height: 90vh;
  background: var(--avi-bg);
  border: 1px solid var(--avi-border-light);
  border-bottom: none;
  border-radius: var(--avi-radius-lg) var(--avi-radius-lg) 0 0;
  z-index: 101;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(.25,.46,.45,.94);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.avi-detail-sheet.open { transform: translateY(0); }

.avi-detail-handle {
  width: 40px; height: 4px;
  background: var(--avi-dim);
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}

.avi-detail-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border: none;
  background: rgba(255,255,255,0.08);
  color: var(--avi-text-2);
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 5;
  transition: background 0.15s, color 0.15s;
}
.avi-detail-close:hover {
  background: rgba(255,255,255,0.15);
  color: var(--avi-text);
}
.avi-detail-close svg { width: 18px; height: 18px; }

.avi-detail-body {
  padding: 16px 20px 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;  /* allow flex child to actually shrink for overflow */
}

/* Sheet content stagger reveal */
.avi-detail-sheet.open .avi-detail-stagger > * {
  animation: avi-card-reveal 0.4s cubic-bezier(.25,.46,.45,.94) both;
}
.avi-detail-sheet.open .avi-detail-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.avi-detail-sheet.open .avi-detail-stagger > *:nth-child(2) { animation-delay: 0.09s; }
.avi-detail-sheet.open .avi-detail-stagger > *:nth-child(3) { animation-delay: 0.13s; }
.avi-detail-sheet.open .avi-detail-stagger > *:nth-child(4) { animation-delay: 0.17s; }
.avi-detail-sheet.open .avi-detail-stagger > *:nth-child(5) { animation-delay: 0.21s; }
.avi-detail-sheet.open .avi-detail-stagger > *:nth-child(6) { animation-delay: 0.25s; }
.avi-detail-sheet.open .avi-detail-stagger > *:nth-child(7) { animation-delay: 0.29s; }
.avi-detail-sheet.open .avi-detail-stagger > *:nth-child(8) { animation-delay: 0.33s; }

.avi-detail-header {
  display: flex;
  gap: 14px;
  margin-bottom: 16px;
  margin-top: 4px;
  padding-right: 40px; /* leave room for close button */
}

.avi-detail-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--avi-ice-glow);
  color: var(--avi-ice);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--avi-font);
  font-size: 22px;
  font-weight: 800;
  flex-shrink: 0;
  border: 1.5px solid var(--avi-ice-border);
  overflow: hidden;
}
.avi-detail-icon img { width: 100%; height: 100%; object-fit: cover; }
.avi-detail-sheet.featured .avi-detail-icon {
  background: var(--avi-gold-glow);
  color: var(--avi-gold);
  border-color: var(--avi-gold-border);
}

.avi-detail-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 4px;
  color: var(--avi-text);
}
.avi-detail-employer {
  font-size: 14px;
  color: var(--avi-gold);
  font-weight: 600;
}

.avi-detail-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.avi-info-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: var(--avi-card);
  border: 1px solid var(--avi-border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--avi-text-2);
  font-weight: 500;
}
.avi-info-chip svg { width: 12px; height: 12px; flex-shrink: 0; }

.avi-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

/* Sprint 3.7 — chip row lives ABOVE the info grid in the detail sheet,
   mirroring the list-card Row 3 reading order. Reuses .avi-chip-* styling. */
.avi-detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 14px;
}

/* "Based at X" muted line between chips and info grid, when avi_base is set. */
.avi-detail-based-at {
  font-size: 12px;
  font-weight: 500;
  color: var(--avi-text-2);
  margin: 4px 0 12px;
}

/* Employer name link (gold underline, subtle → stronger on hover).
   Used on the detail-sheet header and the source card. */
.avi-detail-employer-link {
  color: var(--avi-gold);
  text-decoration: underline;
  text-decoration-color: rgba(232, 160, 32, 0.30);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.15s ease;
}
.avi-detail-employer-link:hover,
.avi-detail-employer-link:focus-visible {
  text-decoration-color: rgba(232, 160, 32, 0.60);
  outline: none;
}

/* Benefits strip — card below the info grid when avi_benefits is set. */
.avi-detail-benefits {
  background: var(--avi-card-b);
  border: 1px solid var(--avi-border);
  border-radius: var(--avi-radius-sm);
  padding: 12px 14px;
  margin-bottom: 18px;
}
.avi-detail-benefits-label {
  font-size: 12px;
  color: var(--avi-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
  margin-bottom: 6px;
}
.avi-detail-benefits-body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--avi-text);
}
.avi-detail-benefits-body p { margin: 0 0 6px; }
.avi-detail-benefits-body p:last-child { margin-bottom: 0; }

/* Source card — "via [Employer] Careers · Posted 2d" at the end of the sheet. */
.avi-detail-source {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--avi-border);
  font-size: 12px;
  color: var(--avi-text-2);
  margin: 0 0 16px;
}
.avi-detail-source-text { color: var(--avi-text-2); }
.avi-detail-source-updated {
  color: var(--avi-muted);
  font-weight: 500;
}

/* Info grid 2×2 in detail */
.avi-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}
.avi-detail-grid-item {
  background: var(--avi-card-b);
  border: 1px solid var(--avi-border);
  border-radius: var(--avi-radius-sm);
  padding: 9px 12px;
}
.avi-detail-grid-label {
  font-size: 12px;
  color: var(--avi-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
  margin-bottom: 4px;
}
.avi-detail-grid-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--avi-text);
}

.avi-detail-desc {
  font-size: 13px;
  line-height: 1.7;
  color: var(--avi-text-2);
  margin-bottom: 18px;
}

/* Skeleton shown in .avi-detail-desc-region while the /?avi_job_detail=<id>
   fetch is in flight (~100-300 ms warm, ~500-800 ms cold). Three full lines
   + one short approximates the visual rhythm of a typical job description
   without committing to a final height — the region replaces itself once
   the real description renders. */
.avi-detail-desc-region {
  margin-bottom: 18px;
}
.avi-detail-desc-skeleton {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.avi-skel-line {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.10) 50%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 200% 100%;
  animation: avi-skel-shimmer 1.4s ease-in-out infinite;
}
.avi-skel-line.short { width: 62%; }
@keyframes avi-skel-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Error fallback when /?avi_job_detail=<id> fails (network, 404, 5xx).
   Shown in place of the description with a Try-again button that re-fires
   the fetch — see loadDetail() in avi-jobs.js openDetail. */
.avi-detail-desc-error {
  font-size: 13px;
  line-height: 1.6;
  color: var(--avi-text-2);
  padding: 14px 16px;
  background: rgba(232, 160, 32, 0.06);
  border: 1px solid rgba(232, 160, 32, 0.20);
  border-radius: 6px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.avi-detail-retry {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #e8a020;
  background: transparent;
  border: 1px solid rgba(232, 160, 32, 0.55);
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.avi-detail-retry:hover,
.avi-detail-retry:focus {
  background: rgba(232, 160, 32, 0.12);
  outline: none;
}

/* Deferred placeholder slots that get replaced (or removed) once detail
   data arrives. Zero box so they don't push surrounding layout. */
.avi-detail-deferred-slot,
.avi-detail-apply-slot:empty {
  display: none;
}

/* Legacy flattened-text descriptions (scrapers that still .get_text()
   internally, plus historical posts scraped before the nh3 pipeline).
   Newlines in the source become visible paragraph breaks. Never
   combined with .avi-has-html so no double-spacing on rich posts. */
.avi-detail-desc .avi-plain-text {
  white-space: pre-line;
}

/* Rich-HTML descriptions from the aggregator's nh3 pipeline (p, ul,
   ol, li, strong, em, br, h3-5, a — see scrapers/utils/sanitize.py).
   These already carry structural markup so white-space: pre-line would
   double-space them. Rules below just tidy the default rendering. */
.avi-detail-desc .avi-has-html p {
  margin: 0 0 1em 0;
}
.avi-detail-desc .avi-has-html ul,
.avi-detail-desc .avi-has-html ol {
  margin: 0 0 1em 1.3em;
  padding: 0;
}
.avi-detail-desc .avi-has-html li {
  margin-bottom: 0.35em;
}
.avi-detail-desc .avi-has-html strong {
  font-weight: 700;
  color: var(--avi-text);
}
.avi-detail-desc .avi-has-html a {
  color: var(--avi-gold);
  text-decoration: underline;
}
.avi-detail-desc .avi-has-html a:hover {
  color: #fff;
}
.avi-detail-desc .avi-has-html h3,
.avi-detail-desc .avi-has-html h4,
.avi-detail-desc .avi-has-html h5 {
  font-size: 14px;
  font-weight: 700;
  color: var(--avi-text);
  margin: 1em 0 0.4em 0;
}
/* No trailing whitespace under the last paragraph / list. */
.avi-detail-desc .avi-has-html > :last-child {
  margin-bottom: 0;
}

/* Follow employer (ice blue secondary) */
.avi-detail-follow-row { margin-bottom: 14px; }
.avi-btn-follow {
  width: 100%;
  height: 44px;
  border: 1.5px solid var(--avi-ice-border);
  background: transparent;
  color: var(--avi-ice);
  border-radius: 12px;
  font-family: var(--avi-font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  transition: background 0.15s, border-color 0.15s;
}
.avi-btn-follow:hover {
  background: var(--avi-ice-glow);
  border-color: rgba(79,195,247,0.4);
}
.avi-btn-follow.following {
  background: var(--avi-ice-glow);
  border-color: var(--avi-ice);
}

/* Detail action bar — pinned to sheet bottom, never scrolls away */
.avi-detail-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;  /* never collapse — Apply Now must always be visible */
  padding: 16px 20px;
  padding-bottom: calc(36px + env(safe-area-inset-bottom, 0px));
  background: var(--avi-bg);
  border-top: 1px solid var(--avi-border);
}
/* Back to Jobs — secondary/ghost button on the right of the actions row,
   with a right-pointing arrow (forward-motion read: "go to the jobs list").
   Closes the detail sheet (same behaviour as the X icon at top-right and
   the backdrop tap). Kept compact so the primary Apply Now CTA still has
   the dominant visual weight in the middle. */
.avi-btn-back {
  flex: 0 0 auto;
  margin-left: auto;  /* push to the right edge of the actions row, with
                         visible empty space between Apply Now and Back */
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--avi-border-2, rgba(184,196,220,0.18));
  background: transparent;
  color: var(--avi-text-2);
  border-radius: 10px;
  font-family: var(--avi-font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.avi-btn-back svg { width: 12px; height: 12px; flex-shrink: 0; }
.avi-btn-back:hover,
.avi-btn-back:focus {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--avi-text-3, rgba(184,196,220,0.35));
  color: var(--avi-text);
  outline: none;
}

/* Save Job — text button (replaces previous icon-only star). Default
   outlined gold; .saved state flips to filled gold like before. The
   .pulsing animation keyframe (avi-star-bounce) still triggers on toggle
   even though it's no longer an icon — the bounce reads as a satisfying
   button press, kept intentionally. */
.avi-btn-save {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--avi-gold-border);
  background: transparent;
  color: var(--avi-gold);
  border-radius: 10px;
  font-family: var(--avi-font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.avi-btn-save.saved {
  background: var(--avi-gold);
  color: #060f1e;
}
.avi-btn-save:hover { background: var(--avi-gold-glow); }
.avi-btn-save.saved:hover { background: var(--avi-gold); filter: brightness(1.1); }

/* Apply Now — outlined gold (matches .avi-btn-save's default state, just
   wider for the longer label). Previous solid-gold fill read as too
   bright/dominant beside the two ghost buttons; outlined gives the action
   row a balanced symmetric feel. Hover lifts to a subtle gold-tinted
   background so the primary CTA still has interaction affordance. */
.avi-btn-apply {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 20px;
  background: transparent;
  color: var(--avi-gold);
  border: 1.5px solid var(--avi-gold-border);
  border-radius: 10px;
  font-family: var(--avi-font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s, transform 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.avi-btn-apply:hover,
.avi-btn-apply:focus {
  background: var(--avi-gold-glow);
  outline: none;
}
.avi-btn-apply:active { transform: scale(0.98); }

/* ============================================================
   BOTTOM NAV (glass effect)
   ============================================================ */
.avi-bottom-nav {
  display: flex;
  align-items: center;        /* vertically center icon+label stacks inside 64px bar */
  justify-content: space-around;
  height: var(--avi-nav-h);
  background: rgba(12, 26, 48, 0.91);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border-top: 1px solid var(--avi-border);
  flex-shrink: 0;
  z-index: 50;
  padding: 8px 0;
  /* Base 8px inner pad + iOS home-bar safe area added below.
     env() is 0 on browsers without safe-area (desktop, Android). */
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  animation: avi-slide-up 0.4s ease 0.4s both;
}
@keyframes avi-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.avi-nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: transparent;
  color: var(--avi-dim);
  cursor: pointer;
  font-family: var(--avi-font);
  font-size: 12px;
  font-weight: 600;
  transition: color 0.15s;
  position: relative;
}
.avi-nav-tab:hover { color: var(--avi-text-2); }
.avi-nav-tab.active { color: var(--avi-gold); }

.avi-nav-icon {
  font-size: 20px;
  line-height: 1;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.avi-nav-icon svg { width: 22px; height: 22px; display: block; }

/* Saved tab count badge — wrapped tightly around the star SVG via
   .avi-nav-icon-wrap (inline-flex, position:relative) so the badge anchors
   to the star's bounding box rather than the whole icon slot. Keeps the
   star fully visible and the "Saved" label uncrowded. */
.avi-nav-tab-saved { position: relative; }
.avi-nav-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.avi-nav-tab-saved .avi-nav-tab-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #e8a020;
  color: #060f1e;
  font-size: 12px;
  font-weight: 800;
  line-height: 16px;
  border-radius: 8px;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 0 0 1.5px #0c1a30;
}
.avi-nav-tab-saved .avi-nav-tab-badge:empty { display: none; }

/* ============================================================
   SAVED VIEW
   ============================================================ */
.avi-saved-view {
  height: 100%;
  overflow-y: auto;
  padding: 20px 12px 88px;
}
.avi-saved-header {
  font-family: var(--avi-font-display);
  font-size: 24px;
  letter-spacing: 2px;
  margin-bottom: 14px;
  color: var(--avi-text);
  padding: 0 4px;
}

/* ============================================================
   SAVED TAB SUB-PILL TOGGLE  — [★ Saved (N)] [⌫ Archived (N)]
   ============================================================ */
.avi-saved-pillbar {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0 4px;
}
.avi-saved-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 9999px;
  border: 1px solid var(--avi-border-light);
  background: transparent;
  color: var(--avi-text-2);
  font: 600 13px/1 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.avi-saved-pill:hover { color: var(--avi-text); border-color: var(--avi-text-2); }
.avi-saved-pill.active {
  color: var(--avi-gold);
  border-color: var(--avi-gold-border);
  background: rgba(232, 160, 32, 0.10);
}
.avi-saved-pill-glyph { font-size: 14px; line-height: 1; }
.avi-saved-pill-count { opacity: 0.7; font-weight: 500; margin-left: 2px; }

/* Directional swipe hint — quiet reference line below the pill toggle.
   Always visible, never dismissible; treated as a figure caption, not a
   banner, so it doesn't compete with cards for attention. */
.avi-saved-hint {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #5d7490;
  text-align: center;
  margin: 0 14px 10px;
  letter-spacing: 0.02em;
}

/* ============================================================
   NEW PILL on unarchived-fresh Jobs-tab cards
   Visually distinct from .avi-card-new-ribbon (corner ribbon for
   recently-posted jobs). The pill lives inline in Row 1 next to the
   title — shares the top-right slot that used to hold the posted-time
   (time moved to Row 2) so the pill no longer collides with anything.
   ============================================================ */
.avi-card-new-pill {
  display: inline-block;
  background: rgba(232, 160, 32, 0.15);
  color: #e8a020;
  border: 1px solid rgba(232, 160, 32, 0.4);
  font: 700 9px/1 'DM Sans', sans-serif;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  flex-shrink: 0;
  align-self: center;
  pointer-events: none;
}

/* .avi-card-remove (the X button on legacy Saved cards) removed — the
   unified Saved sub-view uses swipe-left = archive instead. */

/* ============================================================
   PROFILE VIEW
   ============================================================ */
.avi-profile-scroll {
  height: 100%;
  overflow-y: auto;
  padding: 20px 16px 100px;
}

.avi-welcome-icon { font-size: 40px; text-align: center; margin-bottom: 6px; }
.avi-welcome-title {
  font-family: var(--avi-font-display);
  font-size: 22px;
  letter-spacing: 2px;
  text-align: center;
  color: var(--avi-text);
  margin-bottom: 4px;
}
.avi-welcome-sub {
  font-size: 13px;
  color: var(--avi-text-2);
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.5;
}
.avi-section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--avi-muted);
  margin-bottom: 8px;
}
.avi-section-label-hint {
  font-weight: 400;
  opacity: 0.7;
  margin-left: 6px;
  text-transform: none;
  letter-spacing: 0;
}

/* Profession grid */
.avi-prof-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.avi-prof-card {
  position: relative;
  padding: 20px;
  min-height: 88px;
  border-radius: 14px;
  border: 1px solid var(--avi-border);
  background: var(--avi-card);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, padding 0.12s;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.avi-prof-card:hover { border-color: var(--avi-border-light); }
.avi-prof-card.selected {
  border: 2px solid var(--avi-gold);
  padding: 19px;  /* compensate for +1px border so card height stays stable */
  background: var(--avi-gold-glow);
  box-shadow: 0 0 0 1px rgba(232,160,32,.1), 0 0 24px rgba(232,160,32,.10);
}
.avi-prof-card-check {
  position: absolute;
  top: 10px; right: 10px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--avi-gold);
  color: #060f1e;
  font-size: 12px;
  font-weight: 800;
  display: none;
  align-items: center; justify-content: center;
}
.avi-prof-card.selected .avi-prof-card-check { display: flex; }
.avi-prof-card-label { font-size: 16px; font-weight: 700; color: var(--avi-text); line-height: 1.2; }
.avi-prof-card-sub   { font-size: 12px; font-weight: 500; color: var(--avi-gold-dim); margin-top: 4px; line-height: 1.2; }

/* Compact grid (returning-user expanded edit) */
.avi-prof-grid.compact .avi-prof-card { padding: 14px; min-height: 70px; }
.avi-prof-grid.compact .avi-prof-card.selected { padding: 13px; }
.avi-prof-grid.compact .avi-prof-card-label { font-size: 14px; }
.avi-prof-grid.compact .avi-prof-card-sub   { font-size: 12px; }

.avi-multi-banner {
  background: var(--avi-ice-glow);
  border: 1px solid var(--avi-ice-border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--avi-ice);
  margin-bottom: 14px;
  text-align: center;
}

.avi-profile-cta {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 14px;
  font-family: var(--avi-font);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  transition: filter 0.15s, opacity 0.15s, transform 0.15s;
  margin-top: 8px;
}
.avi-profile-cta.active {
  background: linear-gradient(135deg, var(--avi-gold), var(--avi-gold-dim));
  color: #060f1e;
  box-shadow: 0 4px 20px rgba(232,160,32,0.35);
}
.avi-profile-cta.disabled {
  background: #1c2e48;
  color: #4a5f78;
  cursor: not-allowed;
}
.avi-profile-cta.active:hover { filter: brightness(1.08); }
.avi-profile-cta.active:active { transform: scale(0.98); }

.avi-profile-hint {
  font-size: 12px;
  color: var(--avi-muted);
  text-align: center;
  margin-top: 10px;
  opacity: 0.7;
}

/* Returning user header */
.avi-prof-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.avi-prof-change {
  font-size: 13px;
  font-weight: 700;
  color: var(--avi-gold);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--avi-font);
  padding: 0;
}
.avi-prof-change:hover { text-decoration: underline; }
.avi-prof-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.avi-prof-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: 11px;
  background: var(--avi-gold-glow);
  border: 1px solid var(--avi-gold-border);
  color: var(--avi-gold);
  font-size: 12px;
  font-weight: 600;
}
.avi-prof-expand { margin-bottom: 16px; }
.avi-prof-expand-help {
  font-size: 12px;
  color: var(--avi-muted);
  margin-top: 8px;
}

/* Filter pill section. May 8 polish: tightened from 20px → 12px to
   reduce mobile filter-panel scroll. With .avi-section-label margin-
   bottom also at 8px (was 10px), each filter section is ~10px shorter,
   for ~50-60px panel-height reduction across the typical 5-6 sections. */
.avi-filter-section { margin-bottom: 12px; }
.avi-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.avi-pill {
  padding: 7px 14px;
  border-radius: 9px;
  border: 1.5px solid var(--avi-border);
  background: transparent;
  color: var(--avi-muted);
  font-family: var(--avi-font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}
.avi-pill:hover { border-color: var(--avi-border-light); color: var(--avi-text-2); }
.avi-pill.active {
  background: var(--avi-ice-glow);
  border-color: var(--avi-ice-border);
  color: var(--avi-ice);
}
.avi-pill-gold.active {
  background: var(--avi-gold-glow);
  border-color: var(--avi-gold-border);
  color: var(--avi-gold);
}

.avi-follow-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--avi-border);
  color: var(--avi-text);
  font-size: 12px;
  font-weight: 500;
}
.avi-follow-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px dashed var(--avi-border-light);
  color: var(--avi-muted);
  font-size: 12px;
  background: transparent;
}

/* Notification card */
.avi-notif-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--avi-border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}
.avi-notif-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--avi-text);
  margin-bottom: 4px;
}
.avi-notif-sub {
  font-size: 12px;
  color: var(--avi-text-2);
  margin-bottom: 12px;
}
.avi-notif-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--avi-border);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  color: var(--avi-text);
  font-family: var(--avi-font);
  font-size: 13px;
  outline: none;
  margin-bottom: 12px;
}
.avi-notif-input:focus { border-color: var(--avi-ice); }
.avi-notif-input::placeholder { color: var(--avi-muted); }

.avi-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}
.avi-toggle-label { font-size: 13px; color: var(--avi-text); }
.avi-toggle {
  position: relative;
  width: 42px; height: 24px;
  background: #1c2e48;
  border-radius: 12px;
  cursor: pointer;
  border: none;
  padding: 0;
  transition: background 0.2s;
}
.avi-toggle.on { background: var(--avi-gold); }
.avi-toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.avi-toggle.on::after { transform: translateX(18px); }

/* Start Here bubble (Profile tab when incomplete) */
.avi-start-bubble {
  position: absolute;
  bottom: 100%;
  left: 50%;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--avi-gold), var(--avi-gold-dim));
  color: #060f1e;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 6px 14px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(232,160,32,0.35);
  animation: avi-bubble-bounce 2.5s ease-in-out infinite;
  transform-origin: center bottom;
}
.avi-start-bubble::after {
  content: '';
  position: absolute;
  bottom: -5px; left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--avi-gold-dim);
}
@keyframes avi-bubble-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-5px); }
}

/* ============================================================
   EMPTY STATES
   ============================================================ */
.avi-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--avi-text-2);
}
.avi-empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.4;
}
.avi-empty h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--avi-text);
  margin-bottom: 6px;
}
.avi-empty p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--avi-text-2);
  max-width: 280px;
  margin: 0 auto 16px;
}
.avi-empty-cta {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border: 1.5px solid var(--avi-ice-border);
  background: transparent;
  color: var(--avi-ice);
  border-radius: 10px;
  font-family: var(--avi-font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.avi-empty-cta:hover {
  background: var(--avi-ice-glow);
  border-color: var(--avi-ice);
}

/* ============================================================
   LEAFLET MAP STYLING
   ============================================================ */
#avi-jobs-map .leaflet-control-zoom a {
  background: var(--avi-card) !important;
  color: var(--avi-text-2) !important;
  border-color: var(--avi-border) !important;
}
#avi-jobs-map .leaflet-control-zoom a:hover { color: var(--avi-text) !important; }

/* Cluster icons. fsf-gp-overrides.css (1.0.2) forces pointer-events: none on
   .leaflet-marker-icon (and the .leaflet-interactive variant) to hide an old
   theme-era pin style. That override swallows every click on cluster bubbles,
   so the clusterclick handler never fires — user-visible as a "hand" cursor
   with no response. Individual circle markers are SVG paths and go through a
   different cascade, which is why they stayed clickable while clusters didn't.
   Here we re-enable pointer-events with enough specificity + !important to
   win the cascade. */
.avi-cluster-icon {
  background: transparent !important;
  pointer-events: auto !important;
  cursor: pointer;
}
.leaflet-marker-icon.avi-cluster-icon,
.leaflet-marker-icon.avi-cluster-icon.leaflet-interactive {
  pointer-events: auto !important;
  cursor: pointer;
}
.avi-cluster-inner {
  width: 36px; height: 36px;
  background: var(--avi-card);
  border: 2px solid var(--avi-ice);
  border-radius: 50%;
  color: #fff;
  font-family: var(--avi-font);
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large { background: transparent !important; }
.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div { background: transparent !important; }

/* Pin glow on selected */
.avi-map-pin { transition: filter 0.2s; }
.avi-map-pin-active {
  filter: drop-shadow(0 0 8px rgba(79,195,247,0.6));
}
.avi-map-pin-featured.avi-map-pin-active {
  filter: drop-shadow(0 0 8px rgba(232,160,32,0.6));
}

/* Pin staggered drop-in */
.avi-map-pin-enter {
  animation: avi-pin-drop 0.5s cubic-bezier(.34,1.56,.64,1) both;
  animation-delay: var(--pin-delay, 0s);
}
@keyframes avi-pin-drop {
  from { opacity: 0; transform: scale(0); }
  to   { opacity: 1; transform: scale(1); }
}

/* Dark popup */
.avi-popup-dark .leaflet-popup-content-wrapper {
  background: var(--avi-card) !important;
  border: 1px solid var(--avi-ice-border) !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6) !important;
  color: var(--avi-text) !important;
}
.avi-popup-dark .leaflet-popup-tip {
  background: var(--avi-card) !important;
  border: 1px solid var(--avi-ice-border) !important;
  border-top: none !important;
  border-left: none !important;
}
.avi-popup-dark .leaflet-popup-close-button { color: var(--avi-muted) !important; }
.avi-map-popup {
  font-family: var(--avi-font);
  font-size: 13px;
  min-width: 170px;
  display: flex; flex-direction: column; gap: 3px;
  padding: 2px 0;
}
.avi-map-popup strong {
  font-size: 13px; font-weight: 700;
  color: var(--avi-text);
}
.avi-popup-employer { color: var(--avi-gold); font-size: 12px; font-weight: 600; }
.avi-popup-loc { color: var(--avi-text-2); font-size: 12px; }
.avi-popup-salary { color: var(--avi-ice); font-size: 12px; font-weight: 600; margin-top: 2px; }

/* ============================================================
   TOAST
   ============================================================ */
.avi-toast {
  position: fixed;
  bottom: calc(var(--avi-nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--avi-card-b);
  border: 1px solid var(--avi-border-light);
  border-radius: 10px;
  padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
  font-size: 13px;
  color: var(--avi-text-2);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  white-space: nowrap;
}
.avi-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.avi-toast-undo {
  background: transparent;
  border: none;
  color: var(--avi-gold);
  font-family: var(--avi-font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}
.avi-toast-undo:hover { text-decoration: underline; }

/* ============================================================
   SCROLLBARS
   ============================================================ */
.avi-list-scroll::-webkit-scrollbar,
.avi-detail-body::-webkit-scrollbar,
.avi-saved-view::-webkit-scrollbar,
.avi-profile-scroll::-webkit-scrollbar { width: 4px; }
.avi-list-scroll::-webkit-scrollbar-thumb,
.avi-detail-body::-webkit-scrollbar-thumb,
.avi-saved-view::-webkit-scrollbar-thumb,
.avi-profile-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
}

/* ============================================================
   LOADING
   ============================================================ */
#avi-jobs-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  font-family: var(--avi-font);
}

/* ============================================================
   DESKTOP TWEAKS
   ============================================================ */
@media (min-width: 768px) {
  .avi-list-scroll { padding: 16px 20px 88px; }
  .avi-map-wrap { height: 320px; }
  .avi-detail-sheet { max-width: 560px; left: 50%; transform: translateY(100%) translateX(-50%); }
  .avi-detail-sheet.open { transform: translateY(0) translateX(-50%); }
}

/* ============================================================
   DESKTOP THREE-COLUMN LAYOUT  (≥ 1024px)  — Amendment A skeleton
   Sidebar (300px, placeholder for now) + map column (flex) + list
   column (420px). Mobile layout below 1024px is untouched.
   ============================================================ */
@media (min-width: 1024px) {
  /* .avi-jobs-view is a pass-through — the grid child handles layout. */
  .avi-jobs-view { flex-direction: column; display: flex; }

  .avi-desktop-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 300px 1fr 420px;
    gap: 0;
    min-height: 0;       /* critical — lets nested flex/overflow work */
    overflow: hidden;
  }

  /* Left column — filter sidebar. Amendment B will mount the live Profile
     view inside. For now it's a placeholder div + fixed width. */
  .avi-sidebar {
    background: #0c1a30;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    overflow-y: auto;
    padding: 20px 16px;
  }
  .avi-sidebar-placeholder {
    color: #5d7490;
    font-size: 13px;
    padding: 20px 0;
    text-align: center;
    font-style: italic;
  }

  /* Middle column — map is always visible. No Show/Hide toggle on desktop:
     the middle column IS the map (no list above to cover it). */
  .avi-map-column {
    position: relative;
    overflow: hidden;
    background: #060f1e;
  }
  .avi-map-wrap {
    height: 100% !important;
    width: 100%;
    min-height: 0;
    border-bottom: none;
    border-right: none;
  }
  /* Override the mobile .collapsed rule: on desktop the map never collapses.
     state.mapCollapsed may default to true from the mobile-first init, but
     here we keep the map fully rendered inside the grid column anyway. */
  .avi-map-wrap.collapsed {
    height: 100% !important;
    width: 100%;
  }
  .avi-map-wrap.collapsed #avi-jobs-map,
  .avi-map-wrap.collapsed .avi-map-toggle,
  .avi-map-wrap.collapsed .avi-map-legend { visibility: visible; }

  /* Right column — job cards list, scrolls independently. */
  .avi-list-column {
    background: #060f1e;
    border-left: 1px solid rgba(255, 255, 255, 0.07);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: unset;          /* override the base .avi-list-column flex: 1 */
    width: auto;
    min-height: 0;
  }
  .avi-list-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 20px;   /* no bottom pad reserved for nav — nav is hidden */
  }

  /* Hide mobile-only chrome on desktop: the bottom nav, the Show/Hide map
     toggle bar + in-map hide button, and the welcome banner. Amendment B
     will introduce desktop-equivalent affordances for the nav and banner. */
  .avi-bottom-nav,
  .avi-show-map-bar,
  .avi-map-toggle,
  .avi-welcome-banner { display: none !important; }

  /* Amendment B — live-filtering sidebar styles -------------------------- */

  /* Gold-accent callout that primes first-time visitors on where to start.
     Sits at the top of the sidebar when !onboardingState.profileSet; self-
     dismisses on the first profession tap (which flips profileSet via
     onFilterChangeLive). */
  .avi-sidebar-welcome {
    background: rgba(232, 160, 32, 0.08);
    border-left: 3px solid #e8a020;
    padding: 10px 12px;
    margin-bottom: 16px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    color: #e8a020;
    line-height: 1.4;
    border-radius: 0 6px 6px 0;
  }

  /* Sidebar profile body — stack filter sections with breathing room. */
  .avi-sidebar-profile {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .avi-sidebar-profile .avi-filter-section {
    margin-bottom: 0;               /* gap on parent handles spacing */
  }

  /* List-column top bar — three toggle pills (Jobs / Saved / Archived)
     that swap state.desktopListView. Sits above the card list and is
     flex-shrink:0 so the list below can scroll independently. */
  .avi-list-topbar {
    display: flex;
    gap: 6px;
    padding: 14px 14px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
  }
  .avi-listbar-tab {
    flex: 1;
    padding: 7px 10px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a7be;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
  }
  .avi-listbar-tab:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: #e8eef5;
  }
  .avi-listbar-tab.active {
    background: rgba(232, 160, 32, 0.12);
    border-color: rgba(232, 160, 32, 0.4);
    color: #e8a020;
  }
  .avi-listbar-tab .count {
    opacity: 0.7;
    margin-left: 4px;
    font-weight: 500;
  }

  /* The Saved sub-view's own pill toggle is redundant on desktop — the
     list-topbar above replaces it. Hide it when it appears inside the
     desktop list column. */
  .avi-list-column .avi-saved-pillbar { display: none; }

  /* Swipe hint strip is touch-oriented; muted on desktop. */
  .avi-saved-hint { display: none; }

  /* Saved sub-body inside the desktop list column inherits flex:1 behavior
     so its cards scroll independently instead of running past the viewport. */
  .avi-list-column .avi-saved-subbody {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 14px;
  }

  /* ------------------------------------------------------------------
     Desktop search bar — sits at the top of the map column, above the
     Leaflet map. The column becomes a flex-column so the map fills the
     remaining height below the fixed-height search bar.
     ------------------------------------------------------------------ */
  .avi-map-column {
    display: flex;
    flex-direction: column;
  }
  .avi-map-column .avi-map-wrap {
    flex: 1;
  }
  .avi-desktop-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #0c1a30;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
  }
  .avi-desktop-search-icon {
    width: 18px;
    height: 18px;
    color: #5d7490;
    flex-shrink: 0;
  }
  .avi-desktop-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #e8eef5;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 4px 0;
  }
  .avi-desktop-search-input::placeholder {
    color: #5d7490;
    font-weight: 400;
  }
  .avi-desktop-search-clear {
    background: transparent;
    border: none;
    color: #94a7be;
    font-size: 20px;
    font-weight: 400;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
  }
  .avi-desktop-search-clear:hover,
  .avi-desktop-search-clear:focus-visible {
    background: rgba(255, 255, 255, 0.05);
    color: #e8eef5;
    outline: none;
  }

  /* ------------------------------------------------------------------
     Wider detail view on desktop. The mobile bottom-sheet at 560px felt
     cramped against all the available horizontal space — widen to
     min(1050px, 92vw) so the info grid + description + action button
     have room to breathe. Still centered via the existing left:50% +
     translateX(-50%) pattern inherited from the 768px+ rule; the slide
     animation is unchanged. Text capped at 720px max-width inside the
     wider container so lines stay readable.
     ------------------------------------------------------------------ */
  .avi-detail-sheet {
    width: min(1050px, 92vw);
    max-width: 1050px;
    max-height: 90vh;
  }

  .avi-detail-body {
    padding: 32px 40px 24px;
  }

  /* Description is the thing that gets awkward at wide widths — long
     text lines are hard to read. Cap at 720px regardless of container. */
  .avi-detail-desc {
    max-width: 720px;
  }

  /* Roomier info-grid cells + more space between them */
  .avi-detail-grid {
    gap: 14px;
  }
  .avi-detail-grid-item {
    padding: 14px 18px;
  }
}

/* Ensure the grid becomes inert and sidebar is hidden below the breakpoint
   so mobile layout is completely unaffected if a resize drops below 1024px
   mid-session (grid was only ever attached by JS on desktop, but if a ghost
   element ever appears, CSS keeps the old mobile render). */
@media (max-width: 1023px) {
  .avi-desktop-grid { display: block; }
  .avi-sidebar      { display: none; }
}

/* ============================================================
   MOBILE-ONLY JOBS LAYOUT  (< 1024px)
   Nav relocates from bottom to top as a compact tab bar. Map
   starts collapsed (accessible via "Show map" bar). List claims
   most of the vertical space. Frees the bottom of the viewport
   so iOS Safari's persistent toolbar no longer covers any in-app
   chrome — architectural fix rather than Safari CSS hacks.
   Desktop layout (>=1024px block above) is unchanged.
   ============================================================ */
@media (max-width: 1023px) {
  /* --- Flex order reshuffle on .avi-app --- */
  /* .avi-app already has `display: flex; flex-direction: column`. Children:
     .avi-content, .avi-detail-backdrop, .avi-detail-sheet, .avi-bottom-nav.
     Detail backdrop + sheet are position:fixed (out of flow). Giving the
     nav a smaller `order` than the content visually relocates it above
     without changing the DOM order or the JS render sequence. */
  .avi-app > .avi-bottom-nav { order: 1; }
  .avi-app > .avi-content    { order: 2; }

  /* --- Tab-bar visual treatment at top --- */
  .avi-bottom-nav {
    height: 48px;
    padding: 0;
    padding-bottom: 0;                    /* reset the safe-area bottom pad — not needed at top */
    background: #0c1a30;                   /* solid — glass blur is a bottom-nav idiom */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-top: none;
    border-bottom: 1px solid var(--avi-border);
    align-items: stretch;                  /* tabs fill full height so active underline sits at nav bottom */
    animation: none;                       /* avi-slide-up is a bottom-nav entrance; looks wrong at top */
  }

  .avi-bottom-nav .avi-nav-tab {
    flex: 1;
    display: flex;
    flex-direction: row;                   /* icon + label on one row (tab bar idiom) */
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
    position: relative;                    /* anchor for active underline */
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--avi-muted);
    background: transparent;
    border: 0;
    padding: 0;
  }
  .avi-bottom-nav .avi-nav-tab .avi-nav-icon {
    width: 18px; height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .avi-bottom-nav .avi-nav-tab .avi-nav-icon svg { width: 16px; height: 16px; }
  .avi-bottom-nav .avi-nav-tab.active { color: var(--avi-gold); }
  .avi-bottom-nav .avi-nav-tab.active::after {
    content: '';
    position: absolute;
    left: 20%; right: 20%;
    bottom: 0;
    height: 2px;
    background: var(--avi-gold);
    border-radius: 2px 2px 0 0;
  }
  /* Saved badge uses the same 16x16 notification-corner size on desktop and
     mobile — anchored via .avi-nav-icon-wrap around the star SVG, not around
     the full icon slot. See .avi-nav-tab-saved .avi-nav-tab-badge. */

  /* --- Map collapsed by default on mobile --- */
  /* The `.collapsed` class is applied by JS on init when no user preference
     exists (see state.mapCollapsed). CSS here only ensures the map wrapper
     has a reasonable expanded height once the user reveals it. */
  .avi-map-wrap {
    height: 40vh;                          /* more generous than the desktop 320px when user does expand it */
    min-height: 220px;
  }

  /* --- List padding: no bottom nav = no reserved bottom space --- */
  .avi-list-scroll {
    /* Desktop rule sets 88px to clear the fixed bottom nav. On mobile
       the nav is at the top so the list can breathe into the bottom
       (iOS Safari's own toolbar sits below and is harmless now). */
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}

/* ============================================================
   FIRST-RUN ONBOARDING — welcome banner, narrow-down chip,
   first-card wiggle + swipe hint. All three self-dismiss based
   on user behavior (banner X tap / profile saved / first swipe
   commit) and never return across sessions.
   ============================================================ */
.avi-welcome-banner {
  background: var(--avi-card);
  border: 1px solid rgba(232, 160, 32, 0.30);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 10px 14px;
  position: relative;
  animation: avi-slide-down 0.4s ease;
}
.avi-welcome-banner .content { padding-right: 28px; /* leave room for dismiss X */ }
.avi-welcome-banner .top-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.avi-welcome-banner .banner-icon {
  font-size: 16px;
  line-height: 1;
  color: var(--avi-gold);
  flex-shrink: 0;
}
.avi-welcome-banner .headline {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--avi-text);
}
.avi-welcome-banner .subtext {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--avi-text-2);
  margin-bottom: 0;
}
.avi-welcome-banner .instruction {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #e8a020;
  letter-spacing: 0.02em;
  margin-top: 10px;
  margin-bottom: 0;
}
.avi-welcome-banner .dismiss {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  color: var(--avi-muted);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.avi-welcome-banner .dismiss:hover { color: var(--avi-text); background: rgba(255,255,255,0.04); }
.avi-welcome-banner .dismiss svg   { width: 14px; height: 14px; }
.avi-welcome-banner.hiding {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.25s, transform 0.25s;
}

/* Profile-tab pulsing ring — draws attention while onboarding is active.
   Stops automatically via .needs-attention toggle (onboardingState.onStateChange). */
.avi-nav-tab-profile {
  position: relative;
}
.avi-nav-tab-profile.needs-attention::before {
  content: '';
  position: absolute;
  inset: 2px;
  border: 2px solid #e8a020;
  border-radius: 8px;
  opacity: 0;
  animation: avi-pulse-attention 2.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}
@keyframes avi-pulse-attention {
  0%, 100% { opacity: 0;    transform: scale(1); }
  25%      { opacity: 0.7;  transform: scale(1); }
  60%      { opacity: 0.25; transform: scale(1.08); }
}

/* Narrow-down chip — sits at the top of the scrolling list, above the
   first card. Hidden when a cluster filter is active (JS gating). */
.avi-empty-profile-chip {
  display: block;
  width: 100%;
  background: rgba(79, 195, 247, 0.08);
  border: 1px solid rgba(79, 195, 247, 0.25);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0 0 10px;
  color: var(--avi-ice);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.avi-empty-profile-chip:hover,
.avi-empty-profile-chip:active {
  background: rgba(79, 195, 247, 0.14);
  border-color: rgba(79, 195, 247, 0.40);
}

/* Swipe hint — muted caption above the wiggling card. */
.avi-swipe-hint {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--avi-text-2);
  letter-spacing: 0.02em;
  text-align: center;
  margin: 0 0 8px;
  animation: avi-fade-in 0.3s ease;
}
.avi-swipe-hint.hiding {
  opacity: 0;
  transition: opacity 0.25s;
}

/* Card wiggle — 1.2s pulse with a 1.8s dwell baked into a 3s keyframe.
   1s start delay lets the card's reveal animation complete first. The
   swipe handler toggles .dragging on the card during active pointer
   drag; we kill the wiggle animation then so it doesn't fight the JS-
   controlled inline translateX. */
.avi-card-wiggle {
  animation: avi-wiggle 3s ease-in-out 1s infinite;
}
.avi-card-wiggle.dragging { animation: none; }

@keyframes avi-wiggle {
  0%   { transform: translateX(0); }
  5%   { transform: translateX(-4px); }
  10%  { transform: translateX(4px); }
  15%  { transform: translateX(-2px); }
  20%  { transform: translateX(2px); }
  25%  { transform: translateX(0); }
  100% { transform: translateX(0); }
}
@keyframes avi-slide-down {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes avi-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Reduced motion respect */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ================================================================
   SEO Landing Pages — shared layout for profession/province/employer/combo
   Phase 3 ships profession styling; other page types reuse these classes.
   ================================================================ */

.avi-landing {
	background: var(--avi-bg);
	color: var(--avi-text);
	font-family: var(--avi-font);
	min-height: 60vh;
	padding: 28px 16px 56px;
}

.avi-landing-wrap {
	max-width: 1120px;
	margin: 0 auto;
}

/* Breadcrumbs */
.avi-landing-breadcrumbs {
	font-size: 13px;
	color: var(--avi-muted);
	margin: 0 0 18px;
}
.avi-landing-breadcrumbs ol {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.avi-landing-breadcrumbs li {
	display: inline-flex;
	align-items: center;
}
.avi-landing-breadcrumbs li:not(:last-child)::after {
	content: "›";
	margin-left: 6px;
	color: var(--avi-dim);
}
.avi-landing-breadcrumbs a {
	color: var(--avi-ice);
	text-decoration: none;
}
.avi-landing-breadcrumbs a:hover { text-decoration: underline; }
.avi-landing-breadcrumbs [aria-current="page"] { color: var(--avi-text); }

/* Hero */
.avi-landing-hero {
	background: linear-gradient(180deg, var(--avi-card) 0%, var(--avi-bg) 100%);
	border: 1px solid var(--avi-border);
	border-radius: var(--avi-radius-lg);
	padding: 36px 32px;
	margin: 0 0 36px;
}
.avi-landing-h1 {
	font-family: var(--avi-font-display);
	font-size: clamp(32px, 5vw, 52px);
	line-height: 1.05;
	letter-spacing: 0.5px;
	color: var(--avi-text);
	margin: 0 0 18px;
	font-weight: 400;
}
.avi-landing-intro {
	font-size: 16px;
	line-height: 1.65;
	color: var(--avi-text);
	max-width: 760px;
	margin: 0 0 18px;
}
.avi-landing-stats {
	font-size: 13px;
	color: var(--avi-muted);
	border-top: 1px solid var(--avi-border);
	padding-top: 14px;
	margin-top: 8px;
}

/* Section headings (jobs + related) */
.avi-landing-jobs,
.avi-landing-related {
	margin: 0 0 40px;
}
.avi-landing-jobs h2,
.avi-landing-related h2 {
	font-family: var(--avi-font-display);
	font-size: 24px;
	letter-spacing: 0.5px;
	color: var(--avi-text);
	margin: 0 0 18px;
	font-weight: 400;
}
.avi-landing-related {
	border-top: 1px solid var(--avi-border);
	padding-top: 32px;
}

/* Job grid + card */
.avi-landing-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 14px;
}
.avi-landing-card {
	background: var(--avi-card);
	border: 1px solid var(--avi-border);
	border-radius: var(--avi-radius);
	transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.avi-landing-card:hover {
	background: var(--avi-card-hover);
	border-color: var(--avi-border-light);
	transform: translateY(-1px);
}
.avi-landing-card-link {
	display: block;
	padding: 18px;
	text-decoration: none;
	color: inherit;
}
.avi-landing-card-title {
	font-size: 15.5px;
	line-height: 1.3;
	margin: 0 0 8px;
	color: var(--avi-text);
	font-weight: 600;
}
.avi-landing-card-employer {
	font-size: 13px;
	color: var(--avi-gold);
	margin: 0 0 4px;
	font-weight: 500;
}
.avi-landing-card-location {
	font-size: 13px;
	color: var(--avi-muted);
	margin: 0 0 10px;
}
.avi-landing-card-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 10px;
}
.avi-landing-chip {
	display: inline-block;
	padding: 2px 9px;
	background: var(--avi-ice-glow);
	border: 1px solid var(--avi-ice-border);
	border-radius: var(--avi-radius-sm);
	font-size: 12px;
	color: var(--avi-ice);
	line-height: 1.7;
	white-space: nowrap;
}
.avi-landing-card-posted {
	font-size: 12px;
	color: var(--avi-dim);
	margin-top: 4px;
}

/* CTA under grid (shows when total > 20) */
.avi-landing-cta {
	display: inline-block;
	margin-top: 22px;
	padding: 10px 18px;
	background: var(--avi-gold-glow);
	border: 1px solid var(--avi-gold-border);
	border-radius: var(--avi-radius-sm);
	color: var(--avi-gold);
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	transition: background 0.15s ease;
}
.avi-landing-cta:hover { background: var(--avi-gold-strong); }

.avi-landing-empty {
	color: var(--avi-muted);
	font-size: 14px;
	padding: 16px 0;
}

/* Related searches block */
.avi-landing-related-nav {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 28px;
}
.avi-landing-related-group h3 {
	font-size: 12px;
	color: var(--avi-muted);
	text-transform: uppercase;
	letter-spacing: 1px;
	margin: 0 0 10px;
	font-weight: 600;
}
.avi-landing-related-group ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.avi-landing-related-group a {
	color: var(--avi-ice);
	text-decoration: none;
	font-size: 14px;
	line-height: 1.5;
}
.avi-landing-related-group a:hover {
	color: var(--avi-text);
	text-decoration: underline;
}

/* 2026-10-10 (owner): compact top (H1 + one line), intro below the list ("About …"), related searches as one row. */
.avi-landing-hero--compact {
	padding: 24px 28px;
	margin: 0 0 16px;
}
.avi-landing-hero--compact .avi-landing-h1 { margin: 0 0 8px; }
.avi-landing-line {
	font-size: 14px;
	color: var(--avi-muted);
	margin: 0;
}
.avi-landing-about {
	margin: 0 0 28px;
	max-width: 820px;
}
.avi-landing-about h2 {
	font-family: var(--avi-font-display);
	font-size: 20px;
	letter-spacing: 0.5px;
	color: var(--avi-text);
	margin: 0 0 10px;
	font-weight: 400;
}
.avi-landing-about p {
	font-size: 15px;
	line-height: 1.65;
	color: var(--avi-muted);
	margin: 0;
}
/* 2026-10-17: employer page operator overview ("About <Operator>") + link to the operator profile */
.avi-landing-about--operator .avi-landing-about__more { margin-top: 8px; }
body .avi-landing-about.avi-landing-about--operator .avi-landing-about__more a {
	color: var(--avi-ice, #4fc3f7);
	text-decoration: underline;
	text-underline-offset: 3px;
}
/* 2026-10-19 (owner INBOX #33.4): employer pages "Hiring at <Employer>" + sourced About (inc/avi-employer-hiring.php) */
.avi-landing-about .avi-emp-facts { margin: 0; display: grid; gap: 12px; }
.avi-landing-about .avi-emp-row { min-width: 0; }
.avi-landing-about .avi-emp-row dt { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--avi-muted); margin: 0 0 2px; }
.avi-landing-about .avi-emp-row dd { margin: 0; font-size: 15px; line-height: 1.55; color: var(--avi-text); overflow-wrap: anywhere; }
.avi-landing-about .avi-emp-note { display: block; font-size: 13px; color: var(--avi-muted); }
.avi-landing-about .avi-emp-src, .avi-landing-about p.avi-emp-src { display: block; margin-top: 2px; font-size: 12px; color: var(--avi-muted); }
body .avi-landing-about--hiring a, body .avi-landing-about--employer-src a { color: var(--avi-ice, #4fc3f7); text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 720px) {
	.avi-landing-about .avi-emp-row { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 16px; align-items: baseline; }
}
.avi-landing-related.avi-landing-related--row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 16px;
	margin: 0 0 24px;
	padding: 18px 0 0;
	border-top: 1px solid var(--avi-border);
	font-size: 14px;
}
.avi-landing-related__label {
	font-size: 12px;
	color: var(--avi-muted);
	text-transform: uppercase;
	letter-spacing: 1px;
	font-weight: 600;
}
.avi-landing-related--row a {
	color: var(--avi-ice);
	text-decoration: none;
	line-height: 1.6;
}
.avi-landing-related--row a:hover { color: var(--avi-text); text-decoration: underline; }

/* Mobile (430px baseline) */
@media (max-width: 600px) {
	.avi-landing-hero--compact { padding: 18px 16px; }
	.avi-landing {
		padding: 18px 12px 40px;
	}
	.avi-landing-hero {
		padding: 26px 20px;
		border-radius: var(--avi-radius);
	}
	.avi-landing-h1 {
		font-size: 30px;
	}
	.avi-landing-intro {
		font-size: 14.5px;
	}
	.avi-landing-grid {
		grid-template-columns: 1fr;
	}
	.avi-landing-related-nav {
		grid-template-columns: 1fr;
		gap: 20px;
	}
}

/* ── Landing-page brand header (mirrors .avi-jobs-header look) ── */
.avi-landing-header {
	position: relative;
	z-index: 50;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	height: var(--avi-header-h);
	padding: 0 16px;
	background: rgba(6, 15, 30, 0.97);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--avi-border);
}
.avi-landing-header .avc-brand-lockup {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	color: var(--avi-text);
	line-height: 1;
	font-family: var(--avi-font);
}
.avi-landing-header .avc-brand-logo {
	display: block;
	height: 28px;
	width: auto;
	/* 2026-06-11: the light-variant content swap that lived here was
	   written when this header was near-white (9b5ec7f). The landing
	   pages have since gone dark — the light variant's navy "AV"
	   disappeared against the navy header. No swap needed now: the img
	   src is already avcentral.svg (cream "AV"), correct on dark. */
}
.avi-landing-header .avc-brand-divider {
	display: inline-block;
	width: 1px;
	height: 22px;
	background: var(--avi-border-light);
}
.avi-landing-header .avc-brand-subsite {
	font-family: var(--avi-font-display);
	font-size: 18px;
	letter-spacing: 1px;
}

/* ── Landing-page footer (inline within <main>; avoids GP #content flex conflicts) ── */
.avi-landing-footer {
	margin-top: 56px;
	padding-top: 32px;
	border-top: 1px solid var(--avi-border);
	display: flex;
	flex-direction: column;
	gap: 14px;
	color: var(--avi-muted);
	font-size: 13px;
}
.avi-landing-footer .avc-brand-lockup {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	color: var(--avi-text);
	line-height: 1;
	font-family: var(--avi-font);
}
.avi-landing-footer .avc-brand-logo {
	display: block;
	height: 24px;
	width: auto;
}
.avi-landing-footer .avc-brand-divider {
	display: inline-block;
	width: 1px;
	height: 18px;
	background: var(--avi-border-light);
}
.avi-landing-footer .avc-brand-subsite {
	font-family: var(--avi-font-display);
	font-size: 14px;
	letter-spacing: 1px;
}
.avi-landing-footer-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 18px;
}
.avi-landing-footer-meta a {
	color: var(--avi-ice);
	text-decoration: none;
}
.avi-landing-footer-meta a:hover { text-decoration: underline; }

@media (max-width: 600px) {
	.avi-landing-footer { margin-top: 36px; padding-top: 24px; }
}

/* Defensive — hide the desktop-search bar at <1024px even if JS left a
   stale instance in the DOM from an earlier desktop render. Icon was
   rendering at ~881x881 on mobile because the sizing rule (width/height:18px)
   is scoped inside @media (min-width: 1024px) — when the bar survives a
   desktop-to-mobile viewport transition, the icon loses its sizing and
   the SVG (viewBox 0 0 20 with no intrinsic attrs) balloons. Belt +
   suspenders: the SVG now has intrinsic width/height attrs too (JS change
   in avi-jobs.js), so the icon can't balloon even if this display:none
   gets overridden. */
@media (max-width: 1023px) {
	.avi-desktop-search { display: none !important; }
	/* Same class of stale-desktop-component bug as .avi-desktop-search above.
	   .avi-list-topbar (the Jobs/Saved/Archived pill-bar grey box) is
	   JS-created only inside the isDesktop block and styled only inside
	   @media (min-width: 1024px). When a user loads at desktop width and
	   then resizes to mobile, the bar survives the viewport transition
	   and renders as an unstyled grey box above the job cards. Hide it
	   on mobile so only the top tab-bar (.avi-bottom-nav at order: 1)
	   remains visible. */
	.avi-list-topbar { display: none !important; }
}


/* ============================================================
 * V2 Phase 3: Email alerts UI
 * ============================================================ */

.avi-alerts-card {
    margin: 24px 12px 32px;
    padding: 0;
    background: rgba(8, 18, 36, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
}

.avi-alerts-inner {
    padding: 20px 18px;
    text-align: center;
}

.avi-alerts-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.avi-alerts-icon-on {
    color: #4ade80;
    font-size: 32px;
}

.avi-alerts-title {
    font-family: 'Bebas Neue', system-ui, sans-serif;
    font-size: 20px;
    letter-spacing: 0.04em;
    color: #f4f6fa;
    margin: 0 0 6px;
}

.avi-alerts-text {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: #94a7be;
    margin: 0 0 16px;
}

.avi-alerts-meta {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 12px;
    color: #6b7d94;
    margin: 6px 0 0;
}

.avi-alerts-meta strong {
    color: #c9d4e3;
    font-weight: 500;
}

.avi-alerts-consent {
    display: block;
    text-align: left;
    margin: 12px 0 16px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    cursor: pointer;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 12px;
    line-height: 1.5;
    color: #c9d4e3;
}

.avi-alerts-consent input[type="checkbox"] {
    margin-right: 8px;
    transform: translateY(2px);
}

.avi-alerts-cta {
    display: inline-block;
    padding: 12px 24px;
    background: #e8a020;
    color: #060f1e;
    border: none;
    border-radius: 999px;
    font-family: 'Bebas Neue', system-ui, sans-serif;
    font-size: 14px;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

.avi-alerts-cta:hover { background: #f5b83a; }
.avi-alerts-cta:disabled { background: #4a3a18; color: #8a7a5a; cursor: not-allowed; }

.avi-alerts-secondary {
    display: inline-block;
    padding: 10px 18px;
    background: transparent;
    color: #c9d4e3;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}

.avi-alerts-secondary:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: #f4f6fa;
}

.avi-alerts-danger:hover {
    border-color: rgba(248, 113, 113, 0.45);
    color: #f87171;
}

.avi-alerts-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 12px;
}

/* Modal */
.avi-alerts-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.avi-alerts-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 8, 22, 0.78);
    backdrop-filter: blur(4px);
}

.avi-alerts-modal-inner {
    position: relative;
    z-index: 1;
    max-width: 380px;
    width: 100%;
    padding: 28px 24px;
    background: #0c1a30;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    text-align: center;
}

.avi-alerts-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: #6b7d94;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}

.avi-alerts-modal-close:hover { color: #f4f6fa; }

.avi-alerts-modal-inner h3 {
    font-family: 'Bebas Neue', system-ui, sans-serif;
    font-size: 22px;
    letter-spacing: 0.04em;
    margin: 8px 0;
    color: #f4f6fa;
}

.avi-alerts-modal-inner p {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 13px;
    color: #94a7be;
    margin: 0 0 20px;
}

.avi-alerts-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Toast */
.avi-alerts-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 20px;
    background: #0c1a30;
    color: #f4f6fa;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 13px;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    max-width: 90%;
    text-align: center;
}

.avi-alerts-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.avi-alerts-toast-error {
    background: #2c1518;
    border-color: rgba(248, 113, 113, 0.4);
    color: #fbb;
}

@media (min-width: 480px) {
    .avi-alerts-modal-actions {
        flex-direction: row;
        justify-content: center;
    }
}

/* 2026-09-27 — employer logo chip (job detail + employer pages).
   Background per logo, as the company's kit shows it (Logo review): white tile,
   dark tile (--dark) or none (--none). Never recoloured or cropped (contain). Logos are trimmed to their ink, so height drives size. */
.avi-employer-logo {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 52px;
	max-width: 100%;
	padding: 8px 14px;
	margin: 0 0 12px;
	border-radius: 10px;
	background: #fff;
	box-sizing: border-box;
}
.avi-employer-logo--dark {
	background: #0b1a2e;
	border: 1px solid rgba(255, 255, 255, 0.18);
}
/* 2026-10-07 (owner): 'as-is' — the kit's own (reversed / dark-background) file straight on our navy, no tile. */
.avi-employer-logo--none {
	background: transparent;
	border: 0;
	padding: 0;
}
/* > img[src] outranks the theme-wide .fsf-dark-theme img { height:auto; max-width:100% } */
.avi-employer-logo > img[src] {
	display: block;
	height: 36px;
	width: auto;
	max-width: 200px;
	object-fit: contain;
}

/* 2026-10-18 — jobs audit R5 (fix 7): landing lists (province / employer / combo pages): no text under 12 px
   ("Added 3 days ago", the pills) and 44 px breadcrumb tap targets on phones (negative margin keeps the height). */
.avi-landing-chip,
.avi-landing-card-posted,
.avi-landing-card-posted time { font-size: 12px; }
@media (max-width: 1023px) {
	.avi-landing-breadcrumbs ol { margin: -12px 0 -6px; align-items: center; }
	.avi-landing-breadcrumbs a { display: inline-flex; align-items: center; min-height: 44px; }
}
