/**
 * Airloop Shortcode Themes
 * ------------------------
 * 4 visual presets + dark mode + custom color overrides.
 * Scoped to .airloop-records-wrapper so themes never leak.
 */

/* ================================
   Base custom properties (light)
   ================================ */
.airloop-records-wrapper {
  --al-bg: #ffffff;
  /* Text, headings, accent and font inherit Divi / theme defaults when those
     tokens exist, falling back to the Airloop palette otherwise. Any of these
     can be overridden per-shortcode (accent/bg/text/heading_color/font/...). */
  --al-text: var(--et-color-body-text, #4b5563);
  --al-text-heading: var(--et-color-heading, #111827);
  --al-text-muted: #6b7280;
  --al-font: var(--et-font-body, inherit);
  --al-accent: var(--et-color-primary, #F95E00);
  --al-accent-hover:  #d24f00;
  --al-accent-bg:     #fff2e9;
  --al-accent-text:   #b4470c;
  --al-amber:         #f9c22d;
  --al-border: #e5e7eb;
  --al-surface: #f9fafb;
  --al-surface-hover: #f3f4f6;
  --al-radius: 14px;
  --al-radius-sm: 10px;
  --al-shadow: 0 1px 2px rgba(16,24,40,0.04), 0 1px 3px rgba(16,24,40,0.06);
  --al-shadow-hover: 0 20px 40px -16px rgba(16,24,40,0.20), 0 8px 16px -10px rgba(16,24,40,0.12);
  --al-gap: 22px;
  --al-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--al-font, inherit);
}

/* ================================
   Dark mode overrides
   ================================ */
.airloop-records-wrapper[data-mode="dark"] {
  --al-bg: #18181b;
  --al-text: #a1a1aa;
  --al-text-heading: #fafafa;
  --al-text-muted: #71717a;
  --al-accent: #ff7a2f;
  --al-accent-hover: #ff9052;
  --al-accent-bg: #3a1c0b;
  --al-accent-text: #ffb27d;
  --al-border: #27272a;
  --al-surface: #1c1c1f;
  --al-surface-hover: #27272a;
  --al-shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --al-shadow-hover: 0 24px 48px -16px rgba(0,0,0,0.55), 0 10px 20px -10px rgba(0,0,0,0.4);
}

@media (prefers-color-scheme: dark) {
  .airloop-records-wrapper[data-mode="auto"] {
    --al-bg: #18181b;
    --al-text: #a1a1aa;
    --al-text-heading: #fafafa;
    --al-text-muted: #71717a;
    --al-accent: #ff7a2f;
    --al-accent-hover: #ff9052;
    --al-accent-bg: #3a1c0b;
    --al-accent-text: #ffb27d;
    --al-border: #27272a;
    --al-surface: #1c1c1f;
    --al-surface-hover: #27272a;
    --al-shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
    --al-shadow-hover: 0 24px 48px -16px rgba(0,0,0,0.55), 0 10px 20px -10px rgba(0,0,0,0.4);
  }
}

/* ================================
   Clickable card/list/row
   ================================ */
.al-clickable {
  cursor: pointer;
  transition: box-shadow var(--al-transition), transform var(--al-transition);
}
.al-clickable:hover {
  box-shadow: var(--al-shadow-hover);
  transform: translateY(-2px);
}
.al-clickable:focus-visible {
  outline: 2px solid var(--al-accent);
  outline-offset: 2px;
}

/* ================================
   Theme: Clean (default)
   ================================ */
.airloop-records-wrapper.airloop-theme-clean {
  --al-radius: 10px;
}
.airloop-theme-clean .al-card {
  box-shadow: var(--al-shadow);
  border-color: transparent;
}
.airloop-theme-clean .al-card:hover {
  border-color: transparent;
}

/* ================================
   Theme: Bordered
   ================================ */
.airloop-records-wrapper.airloop-theme-bordered {
  --al-border: #d1d5db;
  --al-radius: 0px;
  --al-radius-sm: 0px;
  --al-shadow: none;
  --al-shadow-hover: none;
}
.airloop-theme-bordered .al-card {
  border-width: 2px;
}
.airloop-theme-bordered .al-card:hover {
  border-color: var(--al-accent);
}
.airloop-theme-bordered .al-list-item {
  border-bottom-width: 2px;
}
.airloop-theme-bordered .al-table thead tr {
  border-bottom-width: 3px;
}

/* ================================
   Theme: Shadow
   ================================ */
.airloop-records-wrapper.airloop-theme-shadow {
  --al-border: transparent;
  --al-radius: 14px;
  --al-shadow: 0 8px 30px rgba(0,0,0,0.13), 0 2px 8px rgba(0,0,0,0.07);
  --al-shadow-hover: 0 24px 48px rgba(0,0,0,0.16), 0 8px 20px rgba(0,0,0,0.09);
}
.airloop-theme-shadow .al-card {
  box-shadow: var(--al-shadow);
}

/* ================================
   Theme: Editorial
   ------------------------------
   Editorial = the shared .al-alternating zigzag layout (below) plus a
   borderless, full-bleed "magazine" skin. Flex mechanics live in the
   Alternating section so the two stay in sync.
   ================================ */
.airloop-records-wrapper.airloop-theme-editorial {
  --al-radius: 0px;
  --al-shadow: none;
  --al-shadow-hover: none;
}
.airloop-theme-editorial .al-grid.al-alternating {
  gap: 0;
}
.airloop-theme-editorial .al-card {
  align-items: stretch;
  border-left: none;
  border-right: none;
  border-top: none;
  border-bottom: 1px solid var(--al-border);
  border-radius: 0;
  padding: 28px 0;
  background: transparent;
  box-shadow: none;
}
.airloop-theme-editorial .al-card:hover {
  transform: none;
  box-shadow: none;
}
.airloop-theme-editorial .al-card .al-card-media img {
  border-radius: var(--al-radius);
}

/* ================================
   Theme: Glass
   ================================ */
.airloop-records-wrapper.airloop-theme-glass {
  --al-shadow: 0 8px 32px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  --al-shadow-hover: 0 20px 48px rgba(0,0,0,0.12), 0 6px 16px rgba(0,0,0,0.06);
  --al-border: rgba(255,255,255,0.35);
  --al-surface: rgba(255,255,255,0.18);
  --al-radius: 16px;
  --al-radius-sm: 10px;
  background: linear-gradient(135deg, #dbeafe 0%, #ede9fe 50%, #fce7f3 100%);
  border-radius: 20px;
  padding: 12px;
}
.airloop-theme-glass .al-card {
  background: rgba(255,255,255,0.6);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(255,255,255,0.55);
  box-shadow: var(--al-shadow), inset 0 1px 0 rgba(255,255,255,0.7);
}
.airloop-theme-glass .al-card:hover {
  background: rgba(255,255,255,0.78);
  border-color: rgba(255,255,255,0.7);
}
.airloop-records-wrapper.airloop-theme-glass[data-mode="dark"] .al-card,
.airloop-records-wrapper.airloop-theme-glass[data-mode="auto"] .al-card {
  background: rgba(30,30,40,0.55);
  border-color: rgba(255,255,255,0.1);
}
.airloop-records-wrapper.airloop-theme-glass[data-mode="dark"],
.airloop-records-wrapper.airloop-theme-glass[data-mode="auto"] {
  background: linear-gradient(135deg, #1e1b4b 0%, #1f2937 50%, #18181b 100%);
}
@media (prefers-color-scheme: dark) {
  .airloop-records-wrapper.airloop-theme-glass[data-mode="auto"] {
    background: linear-gradient(135deg, #1e1b4b 0%, #1f2937 50%, #18181b 100%);
  }
  .airloop-records-wrapper.airloop-theme-glass[data-mode="auto"] .al-card {
    background: rgba(30,30,40,0.55);
    border-color: rgba(255,255,255,0.1);
  }
}
.airloop-records-wrapper.airloop-theme-soft[data-mode="dark"] .al-card,
.airloop-records-wrapper.airloop-theme-soft[data-mode="auto"] .al-card {
  background: #1c1a2e;
  border-color: #2e2a4a;
}
.airloop-records-wrapper.airloop-theme-soft[data-mode="dark"] .al-card:hover,
.airloop-records-wrapper.airloop-theme-soft[data-mode="auto"] .al-card:hover {
  background: #221f38;
  border-color: #3b3463;
}
@media (prefers-color-scheme: dark) {
  .airloop-records-wrapper.airloop-theme-soft[data-mode="auto"] .al-card {
    background: #1c1a2e;
    border-color: #2e2a4a;
  }
}

/* ================================
   Theme: Bold
   ================================ */
.airloop-records-wrapper.airloop-theme-bold {
  --al-radius: 0px;
  --al-radius-sm: 0px;
  --al-shadow: 4px 4px 0 var(--al-text-heading, #111827);
  --al-shadow-hover: 6px 6px 0 var(--al-text-heading, #111827);
}
.airloop-theme-bold .al-card {
  border: 2px solid var(--al-text-heading, #111827);
  box-shadow: var(--al-shadow);
}
.airloop-theme-bold .al-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--al-shadow-hover);
  border-color: var(--al-text-heading, #111827);
}
.airloop-theme-bold .al-card::before { display: none; }
.airloop-theme-bold .al-table-wrap {
  border: 2px solid var(--al-text-heading, #111827);
  border-radius: 0;
}
.airloop-theme-bold .al-list {
  border-top: 2px solid var(--al-text-heading, #111827);
}
.airloop-theme-bold .al-list-item {
  border-bottom: 2px solid var(--al-text-heading, #111827);
}

/* ================================
   Theme: Soft
   ================================ */
.airloop-records-wrapper.airloop-theme-soft {
  --al-radius: 20px;
  --al-radius-sm: 12px;
  --al-border: transparent;
  --al-shadow: 0 2px 20px rgba(0,0,0,0.05), 0 1px 4px rgba(0,0,0,0.03);
  --al-shadow-hover: 0 8px 32px rgba(0,0,0,0.09), 0 3px 8px rgba(0,0,0,0.05);
  --al-surface: #f5f3ff;
  --al-accent-bg: #ede9fe;
  --al-accent-text: #5b21b6;
}
.airloop-theme-soft .al-card {
  border: 1px solid #ede9fe;
  background: #faf8ff;
  box-shadow: var(--al-shadow);
}
.airloop-theme-soft .al-card:hover {
  border-color: #ddd6fe;
  background: #f5f3ff;
  transform: translateY(-4px) scale(1.01);
}
.airloop-theme-soft .al-card::before { display: none; }
.airloop-theme-soft .al-table-wrap {
  border-radius: var(--al-radius);
  border-color: var(--al-surface);
}

/* ================================
   Theme: Editorial Rich
   ------------------------------
   A richer, more premium card composition. Taller media, a clear
   title→meta→tags→footer rhythm, and a brand-gradient hairline accent.
   Uses only card slots the renderer already emits — no markup changes.
   Ported from docs/Display Builder options cleanup 2/frontend/al-enhanced.css
   (.al-x-editorial), folding in the brand tokens from the base block above.
   ================================ */
.airloop-theme-editorial-rich .al-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-color: var(--al-border);
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.airloop-theme-editorial-rich .al-card-media {
  margin: 0;
  border-radius: 0;
  aspect-ratio: 4 / 3;
}
.airloop-theme-editorial-rich .al-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 8px;
  padding: 16px 18px 18px;
}
.airloop-theme-editorial-rich .al-name {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}
.airloop-theme-editorial-rich .al-overview {
  margin: 0;
  font-size: 13.5px;
  color: var(--al-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.airloop-theme-editorial-rich .al-card-loc { margin: 2px 0 0; font-size: 13px; }
.airloop-theme-editorial-rich .al-tags { margin: 4px 0 0; }
.airloop-theme-editorial-rich .al-card-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--al-border);
}
.airloop-theme-editorial-rich .al-card-foot-meta {
  font-weight: 700;
  color: var(--al-text-heading);
  font-family: var(--al-heading-font, inherit);
}
/* Hairline accent along the top of the media — subtle brand cue at rest. */
.airloop-theme-editorial-rich .al-card-media::after {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--al-accent), var(--al-amber));
  z-index: 2;
}
.airloop-theme-editorial-rich .al-card:hover { box-shadow: 0 18px 40px -20px rgba(16,24,40,.28); }
.airloop-theme-editorial-rich .al-card::before { display: none; }
.airloop-theme-editorial-rich .al-overlay-dot { background: #1f9d55; }
.airloop-theme-editorial-rich .al-spot-avatar { background: var(--al-accent); }
.airloop-theme-editorial-rich .al-spotlight-title { font-size: 30px; }

/* ================================
   Density
   ================================ */
.airloop-records-wrapper[data-density="compact"] {
  --al-gap: 12px;
  --al-card-padding: 14px;
}
.airloop-records-wrapper[data-density="spacious"] {
  --al-gap: 36px;
  --al-card-padding: 30px;
}
.airloop-records-wrapper[data-density="compact"] .al-card,
.airloop-records-wrapper[data-density="spacious"] .al-card {
  padding: var(--al-card-padding);
}
.airloop-records-wrapper[data-density="compact"] .al-list-item {
  padding: 8px 10px;
}
.airloop-records-wrapper[data-density="spacious"] .al-list-item {
  padding: 22px 14px;
}

/* ================================
   Layout: Card Grid
   ================================ */
.airloop-records-wrapper .al-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--al-gap);
  margin: 20px 0;
}
.airloop-records-wrapper .al-grid.al-columns-1 { grid-template-columns: 1fr; }
.airloop-records-wrapper .al-grid.al-columns-2 { grid-template-columns: repeat(2, 1fr); }
.airloop-records-wrapper .al-grid.al-columns-3 { grid-template-columns: repeat(3, 1fr); }
.airloop-records-wrapper .al-grid.al-columns-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .airloop-records-wrapper .al-grid,
  .airloop-records-wrapper .al-grid.al-columns-3,
  .airloop-records-wrapper .al-grid.al-columns-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 540px) {
  .airloop-records-wrapper .al-grid,
  .airloop-records-wrapper .al-grid.al-columns-2,
  .airloop-records-wrapper .al-grid.al-columns-3,
  .airloop-records-wrapper .al-grid.al-columns-4 {
    grid-template-columns: 1fr;
  }
}

.al-card {
  background: var(--al-bg);
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius);
  padding: 20px;
  cursor: default;
  transition:
    transform var(--al-transition),
    box-shadow var(--al-transition),
    border-color var(--al-transition);
  will-change: transform;
  position: relative;
  overflow: hidden;
}
.al-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--al-shadow-hover);
  border-color: var(--al-accent);
}

/* Subtle top accent stripe on hover */
.al-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--al-accent);
  opacity: 0;
  transition: opacity var(--al-transition);
}
.al-card:hover::before {
  opacity: 1;
}
.airloop-theme-bordered .al-card::before,
.airloop-theme-editorial .al-card::before {
  display: none;
}

/* ================================
   Card media
   ================================ */
.al-card-media {
  overflow: hidden;
  border-radius: var(--al-radius-sm);
  margin-bottom: 14px;
  background: var(--al-surface);
  position: relative;
  line-height: 0;
}
.al-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.al-card:hover .al-card-media img {
  transform: scale(1.04);
}

/* Aspect ratios */
.al-aspect-16-9 .al-card-media { aspect-ratio: 16/9; }
.al-aspect-4-3 .al-card-media  { aspect-ratio: 4/3; }
.al-aspect-1-1 .al-card-media  { aspect-ratio: 1/1; }

/* ================================
   Layout: Alternating (zigzag)
   ------------------------------
   Theme-independent magazine layout: full-width rows where the image and
   text sit side by side and the image position flips every other row.
   Works with any theme (card chrome is preserved); the editorial theme
   layers its borderless skin on top. Enabled when the shortcode uses
   alternate="yes" or theme="editorial".
   ================================ */
.al-grid.al-alternating {
  display: flex;
  flex-direction: column;
  gap: var(--al-gap);
}
.al-alternating .al-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 28px;
}
.al-alternating .al-card.al-alt {
  flex-direction: row-reverse;
}
.al-alternating .al-card .al-card-media {
  flex: 0 0 42%;
  max-width: 360px;
  margin: 0;
}
.al-alternating .al-card .al-card-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
/* Default media aspect ratio so images never collapse on short body text.
   Low specificity (:where) so the al-aspect-* attribute always overrides. */
:where(.al-alternating) .al-card-media {
  aspect-ratio: 4 / 3;
}

@media (max-width: 768px) {
  .al-alternating .al-card,
  .al-alternating .al-card.al-alt {
    flex-direction: column;
    align-items: stretch;
  }
  .al-alternating .al-card .al-card-media {
    max-width: 100%;
    width: 100%;
  }
}

/* ================================
   Typography & Elements
   ================================ */
.al-name {
  margin: 0 0 10px;
  font-size: var(--al-heading-size, 17px);
  font-weight: 700;
  color: var(--al-text-heading);
  line-height: 1.3;
  letter-spacing: -0.015em;
  transition: color var(--al-transition);
}
/* Title picks up the accent when the whole card is a link */
.al-detail-link:hover .al-name,
.al-clickable:hover .al-name {
  color: var(--al-accent);
}
.al-detail-link {
  text-decoration: none;
}
.al-overview {
  font-size: var(--al-body-size, 13.5px);
  line-height: 1.65;
  color: var(--al-text);
  margin: 0 0 12px;
}
.al-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--al-accent-bg);
  color: var(--al-accent-text);
  padding: 4px 11px;
  border-radius: 999px;
  margin-bottom: 10px;
  margin-right: 5px;
  letter-spacing: 0.01em;
  box-shadow: inset 0 0 0 1px rgba(16,24,40,0.04);
}
.al-badge.al-status {
  background: #dcfce7;
  color: #166534;
  box-shadow: inset 0 0 0 1px rgba(22,101,52,0.10);
}
/* Live-status dot — premium "available now" cue */
.al-badge.al-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
  flex: 0 0 auto;
}
.al-rating {
  font-size: 13px;
  color: var(--al-text);
  margin-bottom: 8px;
}
.al-link {
  font-size: 13px;
  color: var(--al-accent);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--al-transition);
}
.al-link:hover {
  color: var(--al-accent-hover);
  text-decoration: underline;
}
.al-field {
  font-size: var(--al-body-size, 13.5px);
  color: var(--al-text);
  margin-bottom: 8px;
  line-height: 1.55;
}
/* Premium spec-sheet labels: muted, lighter weight so the value leads.
   Applies to plain fields, date fields and the inline badge label. */
.al-field > strong {
  font-weight: 600;
  color: var(--al-text-muted);
  letter-spacing: 0.005em;
}
.al-img {
  max-width: 100%;
  height: auto;
  border-radius: var(--al-radius-sm);
  margin-bottom: 12px;
  display: block;
}
.al-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.al-attachments a {
  font-size: 13px;
  color: var(--al-accent);
  text-decoration: none;
  font-weight: 500;
}
.al-attachments a:hover {
  color: var(--al-accent-hover);
  text-decoration: underline;
}

/* ================================
   Action button
   ================================ */
.al-link-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: #ffffff !important;
  background: var(--al-accent);
  padding: 7px 14px;
  border-radius: 20px;
  text-decoration: none !important;
  letter-spacing: 0.01em;
  transition: background var(--al-transition), transform var(--al-transition);
  cursor: pointer;
}
.al-link-button:hover {
  background: var(--al-accent-hover);
  transform: translateY(-1px);
  text-decoration: none !important;
}

/* ================================
   Layout: List
   ================================ */
.al-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
  border-top: 1px solid var(--al-border);
}
.al-list-item {
  border-bottom: 1px solid var(--al-border);
  padding: 14px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  border-radius: 0;
  transition: background-color var(--al-transition);
  cursor: default;
}
.al-list-item:hover {
  background-color: var(--al-surface);
}
.al-list-name {
  font-size: var(--al-heading-size, 14.5px);
  font-weight: 700;
  color: var(--al-text-heading);
  min-width: 140px;
  letter-spacing: -0.01em;
}
.al-list-field {
  font-size: var(--al-body-size, 13px);
  color: var(--al-text);
}
.al-list-img-wrap {
  overflow: hidden;
  border-radius: var(--al-radius-sm);
  display: block;
  flex-shrink: 0;
  background: var(--al-surface);
  line-height: 0;
}
.al-list-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.al-list-img {
  max-width: 80px;
  height: auto;
  border-radius: var(--al-radius-sm);
}
.al-aspect-16-9 .al-list-img-wrap { aspect-ratio: 16/9; width: 80px; }
.al-aspect-4-3  .al-list-img-wrap { aspect-ratio: 4/3;  width: 80px; }
.al-aspect-1-1  .al-list-img-wrap { aspect-ratio: 1/1;  width: 56px; }

/* ================================
   Layout: Table
   ================================ */
.al-table-wrap {
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius);
  -webkit-overflow-scrolling: touch;
}
.al-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--al-body-size, 13px);
}
.al-table thead tr {
  background: var(--al-surface);
  border-bottom: 2px solid var(--al-border);
  text-align: left;
}
.al-table th {
  padding: 11px 14px;
  font-weight: 700;
  color: var(--al-text-heading);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.al-table td {
  padding: 11px 14px;
  color: var(--al-text);
  border-bottom: 1px solid var(--al-border);
  vertical-align: middle;
}
.al-table tbody tr:last-child td {
  border-bottom: none;
}
.al-table td img {
  max-width: 80px;
  height: auto;
  border-radius: var(--al-radius-sm);
}
.al-table tbody tr {
  transition: background-color var(--al-transition);
}
.al-table tbody tr:hover {
  background-color: var(--al-accent-bg);
}
.al-table tbody tr:nth-child(even) {
  background-color: var(--al-surface);
}
.al-table tbody tr:nth-child(even):hover {
  background-color: var(--al-accent-bg);
}

/* ================================
   Layout: Minimal
   ================================ */
.al-minimal {
  list-style: none;
  padding: 0;
  margin: 20px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.al-minimal li {
  background: var(--al-surface);
  border: 1px solid var(--al-border);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: var(--al-body-size, 13px);
  color: var(--al-text);
  transition: background-color var(--al-transition), border-color var(--al-transition), color var(--al-transition);
  cursor: default;
}
.al-minimal li:hover {
  background: var(--al-accent-bg);
  border-color: var(--al-accent);
  color: var(--al-accent-text);
}

/* ================================
   Filter form (inside wrapper)
   ================================ */
.airloop-records-wrapper .airloop-filters {
  margin-bottom: 20px;
}

.airloop-filter-upgrade-notice {
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px dashed var(--al-border, #d1d5db);
  border-radius: var(--al-radius-sm, 8px);
  background: var(--al-bg-soft, #f9fafb);
  color: var(--al-text, #4b5563);
  font-family: var(--al-font, inherit);
  font-size: var(--al-body-size, 13px);
  line-height: 1.5;
}
.airloop-filter-upgrade-notice strong {
  color: var(--al-text-heading, #111827);
}
.airloop-filter-upgrade-notice a {
  color: var(--al-accent, #F95E00);
  font-weight: 700;
  text-decoration: none;
}
.airloop-filter-upgrade-notice a:hover {
  text-decoration: underline;
}

/* ================================
   Star Rating
   ================================ */
.al-rating-stars-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--al-text);
}
.al-rating-stars {
  display: inline-flex;
  align-items: center;
  color: var(--al-amber);
}
.al-star {
  margin-right: 1px;
  flex-shrink: 0;
}
.al-star-empty {
  color: var(--al-border);
}
.al-rating-number-hint {
  font-size: 11.5px;
  color: var(--al-text-muted);
  font-weight: 500;
}

/* ================================
   Rating Pill
   ================================ */
.al-rating-pill-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--al-text);
}
.al-rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  color: #ffffff;
  letter-spacing: 0.02em;
}
.al-rating-high   { background-color: #10B981; }
.al-rating-medium { background-color: #F59E0B; }
.al-rating-low    { background-color: #EF4444; }

/* ================================
   Animations
   ================================ */
@keyframes al-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.al-animate-in {
  animation: al-fade-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .al-animate-in {
    animation: none;
  }
  .al-card,
  .al-card-media img,
  .al-list-item,
  .al-minimal li,
  .al-table tbody tr,
  .al-link-button {
    transition: none !important;
  }
  .al-card:hover {
    transform: none;
  }
  .al-card:hover .al-card-media img {
    transform: none;
  }
  .al-link-button:hover {
    transform: none;
  }
}

/* ================================
   Single Record Detail
   ================================ */
.airloop-single-wrapper {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 24px;
  font-family: var(--al-font, inherit);
}

.airloop-single-record {
  background: var(--al-bg, #ffffff);
  border: 1px solid var(--al-border, #e5e7eb);
  border-radius: var(--al-radius, 10px);
  padding: var(--al-detail-pad, 32px);
  box-shadow: var(--al-shadow, 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04));
}

/* Density (detail page) */
.airloop-records-wrapper[data-density="compact"] {
  --al-detail-pad: 18px;
}
.airloop-records-wrapper[data-density="spacious"] {
  --al-detail-pad: 48px;
}
.airloop-records-wrapper[data-density="compact"] .al-detail-overview {
  margin-bottom: 16px;
}
.airloop-records-wrapper[data-density="compact"] .al-detail-title {
  margin-bottom: 6px;
}
.airloop-records-wrapper[data-density="spacious"] .al-detail-overview {
  margin-bottom: 36px;
}

.al-detail-name {
  font-size: 2rem;
  font-weight: 800;
  color: var(--al-text-heading, #111827);
  margin: 0 0 16px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.al-detail-overview {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--al-text, #4b5563);
  margin: 0 0 28px;
}

.al-detail-body {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

/* Modern single-column layout: children stack vertically (title, meta,
   content, bottom media, actions) — flex row is only for the legacy
   media-col/content-col pair. */
.al-detail-body.al-detail-body-full {
  display: block;
}

.al-detail-body-full .al-detail-content-col {
  flex: 1 1 100%;
  max-width: 100%;
}

.al-detail-media-col {
  flex: 0 0 38%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.al-detail-media-col .al-detail-media {
  margin: 0;
}

.al-detail-media-col .al-img {
  width: 100%;
  height: auto;
  border-radius: var(--al-radius-sm, 6px);
  display: block;
}

.al-detail-content-col {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.al-detail-field {
  font-size: var(--al-body-size, 14px);
  color: var(--al-text, #4b5563);
  line-height: 1.6;
}

.al-detail-field-attachments {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.al-detail-label {
  display: block;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--al-text-muted, #9ca3af);
  margin-bottom: 2px;
}

.al-detail-value {
  color: var(--al-text, #4b5563);
}

.al-detail-media {
  margin-bottom: 16px;
}

.al-detail-media .al-img {
  width: 100%;
  height: auto;
  border-radius: var(--al-radius-sm, 6px);
  display: block;
}

/* Responsive: stack columns on narrow screens */
@media (max-width: 768px) {
  .airloop-single-wrapper {
    margin: 20px auto;
    padding: 0 16px;
  }

  .airloop-single-record {
    --al-detail-pad: 20px;
  }

  .al-detail-name {
    font-size: 1.5rem;
  }

  .al-detail-body {
    flex-direction: column;
    gap: 24px;
  }

  .al-detail-media-col {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

/* ================================
   Detail page: themed record card
   When render_record_detail() wraps in airloop-records-wrapper, theme
   custom properties and overrides cascade to .airloop-single-record.
   ================================ */

/* --- Themed card overrides (parallel to .al-card rules above) --- */
.airloop-theme-clean .airloop-single-record {
  box-shadow: var(--al-shadow);
  border-color: transparent;
}
.airloop-theme-shadow .airloop-single-record {
  box-shadow: var(--al-shadow);
  border-color: transparent;
}
.airloop-theme-bordered .airloop-single-record {
  border-width: 2px;
  border-radius: 0;
  box-shadow: none;
}
.airloop-theme-glass .airloop-single-record {
  background: rgba(255,255,255,0.55);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(255,255,255,0.4);
  box-shadow: var(--al-shadow), inset 0 1px 0 rgba(255,255,255,0.6);
}
.airloop-theme-bold .airloop-single-record {
  border: 2px solid var(--al-text-heading, #111827);
  border-radius: 0;
  box-shadow: var(--al-shadow);
}
.airloop-theme-editorial .airloop-single-record {
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  background: transparent;
}
.airloop-theme-soft .airloop-single-record {
  border: none;
  box-shadow: var(--al-shadow);
}

/* --- Detail hero image (full-width banner) --- */
.al-detail-hero {
  margin: calc(-1 * var(--al-detail-pad, 32px)) calc(-1 * var(--al-detail-pad, 32px)) 24px;
  overflow: hidden;
}
.al-detail-hero img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  display: block;
}
.airloop-single-record + .al-detail-hero,
.al-detail-bottom-media {
  margin: 24px calc(-1 * var(--al-detail-pad, 32px)) calc(-1 * var(--al-detail-pad, 32px));
}
.al-detail-bottom-media img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  display: block;
}

/* --- Detail title (used in styled layout) --- */
.al-detail-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--al-text-heading, #111827);
  margin: 0 0 10px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* --- Badge row --- */
.al-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  align-items: center;
}
/* Header pills carry no bottom margin (the row owns the spacing) and use a
   neutral surface tone so they stay legible whatever the accent colour is. */
.al-detail-meta .al-badge {
  margin: 0;
}
.al-badge-spec {
  background: var(--al-surface);
  color: var(--al-text-heading);
  box-shadow: inset 0 0 0 1px var(--al-border);
}

/* --- Spec sheet: premium key/value grid ---
   Internal dividers are drawn with each cell's top/left box-shadow rather than
   a gap + background fill, so a partial last row leaves blank space (not empty
   grey boxes) for any number of fields. */
.al-detail-specs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  margin: 4px 0 8px;
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius-sm, 10px);
  overflow: hidden;
}
.al-detail-specs .al-detail-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  padding: 15px 18px;
  background: var(--al-bg, #ffffff);
  box-shadow: -1px -1px 0 0 var(--al-border, #e5e7eb);
}
.al-detail-specs .al-detail-label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--al-text-muted, #9ca3af);
}
.al-detail-specs .al-detail-value {
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--al-text-heading, #111827);
}
/* Vertical rhythm for any non-grid field stacked directly in the body
   (e.g. long description fields rendered outside the spec grid). */
.al-detail-body-full > .al-detail-field {
  margin-bottom: 16px;
}

/* --- Side-by-side image + content --- */
.al-detail-side-wrap {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  margin-bottom: 20px;
}
.al-detail-side-media {
  flex: 0 0 240px;
  max-width: 240px;
}
.al-detail-side-media img {
  width: 100%;
  border-radius: var(--al-radius-sm, 6px);
  display: block;
}
.al-detail-side-content {
  flex: 1 1 auto;
}

/* --- Gallery --- */
.al-detail-gallery {
  margin-bottom: 20px;
}
.al-detail-gallery img {
  width: 100%;
  border-radius: var(--al-radius-sm, 6px);
  display: block;
}

/* --- Body variants (full vs sidebar-cols) --- */
.al-detail-body-cols {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 32px;
  align-items: start;
}
.al-detail-main {
  min-width: 0;
}
.al-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.al-detail-sidebar img {
  width: 100%;
  border-radius: var(--al-radius-sm, 6px);
  display: block;
}
.al-detail-sidebar .al-detail-field {
  font-size: 0.875rem;
}

/* --- Specs table --- */
.al-specs {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 16px;
}
.al-specs th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--al-text-muted, #9ca3af);
  font-weight: 700;
  padding: 9px 10px;
  width: 38%;
  border-bottom: 1px solid var(--al-border, #e5e7eb);
  vertical-align: top;
}
.al-specs td {
  padding: 9px 10px;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--al-border, #e5e7eb);
  color: var(--al-text, #4b5563);
}

/* --- Action bar (bottom right) --- */
.al-detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--al-border, #e5e7eb);
}
/* Keep the "Back" link visually secondary — pushed left, primary CTA right. */
.al-detail-actions .al-btn-ghost:first-child {
  margin-right: auto;
}
.al-btn-primary,
.al-btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: var(--al-radius-sm, 6px);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--al-transition), color var(--al-transition), border-color var(--al-transition);
}
.al-btn-primary {
  background: var(--al-accent, #F95E00);
  color: #fff;
  border: 1.5px solid transparent;
}
.al-btn-primary:hover {
  opacity: 0.88;
}
.al-btn-ghost {
  background: transparent;
  color: var(--al-accent, #F95E00);
  border: 1.5px solid var(--al-accent, #F95E00);
}
.al-btn-ghost:hover {
  background: var(--al-accent-bg, #eef2ff);
}

/* --- Responsive: narrow screens --- */
@media (max-width: 768px) {
  .al-detail-side-wrap {
    flex-direction: column;
  }
  .al-detail-side-media {
    flex: 1 1 100%;
    max-width: 100%;
  }
  .al-detail-body-cols {
    grid-template-columns: 1fr;
  }
}

/* ================================
   Empty State / No Results
   ================================ */
.airloop-no-results {
  text-align: center;
  padding: 56px 24px;
  background: var(--al-surface);
  border: 1px dashed var(--al-border);
  border-radius: var(--al-radius);
  margin: 20px 0;
  width: 100%;
  box-sizing: border-box;
}
.airloop-no-results-icon {
  width: 48px;
  height: 48px;
  background: var(--al-accent-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--al-accent);
}
.airloop-no-results-icon svg {
  width: 24px;
  height: 24px;
}
.airloop-no-results h3 {
  margin: 0 0 6px;
  font-size: 17px;
  color: var(--al-text-heading);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.airloop-no-results p {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--al-text);
  line-height: 1.6;
}
.al-reset-filters-btn {
  background: var(--al-accent);
  color: #ffffff;
  border: none;
  border-radius: 20px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--al-transition), transform var(--al-transition);
  letter-spacing: 0.01em;
}
.al-reset-filters-btn:hover {
  background: var(--al-accent-hover);
  transform: translateY(-1px);
}
.al-reset-filters-btn:focus-visible {
  outline: 2px solid var(--al-accent);
  outline-offset: 2px;
}

/* ================================
   Image positions (card)
   ------------------------------
   Markup order follows the visual position (media first for top/left,
   body first for bottom/right), so plain flex is enough — no reverse
   directions, which would otherwise scramble body content order.
   ================================ */
/* Default media aspect so card grids align; :where() keeps specificity
   low so al-aspect-*, pos-* and shape-circle overrides always win. */
:where(.al-card .al-card-media) { aspect-ratio: 16 / 9; }
.al-card-media:empty { display: none; }

.al-card.pos-left,
.al-card.pos-right { display: flex; align-items: stretch; gap: 16px; }
.al-card.pos-left .al-card-media,
.al-card.pos-right .al-card-media { flex: 0 0 42%; aspect-ratio: auto; min-height: 120px; margin-bottom: 0; }
.al-card.pos-left .al-card-body,
.al-card.pos-right .al-card-body { flex: 1 1 auto; min-width: 0; }
.al-card.pos-bottom { display: flex; flex-direction: column; }
.al-card.pos-bottom .al-card-body { flex: 1 1 auto; }
.al-card.pos-bottom .al-card-media { margin: 14px 0 0; }

@media (max-width: 540px) {
  .al-card.pos-left,
  .al-card.pos-right { flex-direction: column; }
  .al-card.pos-left .al-card-media,
  .al-card.pos-right .al-card-media { flex: 0 0 auto; }
}

/* ================================
   Image shapes
   ================================ */
.al-list-img-wrap.shape-circle,
.al-list-img-wrap.shape-circle img {
  border-radius: 50%; overflow: hidden; aspect-ratio: 1;
}
.al-card-media.shape-circle {
  width: 84px; height: 84px; aspect-ratio: 1;
  border-radius: 50%; overflow: hidden;
  margin: 0 auto 14px; flex: 0 0 auto;
}
.al-card-media.shape-circle img,
.al-list-img-wrap.shape-circle img {
	object-fit: cover; width: 100%; height: 100%;
}
.al-card.pos-left .al-card-media.shape-circle,
.al-card.pos-right .al-card-media.shape-circle {
  flex: 0 0 84px; min-height: 84px; align-self: center; margin: 0;
}
.al-card.pos-bottom .al-card-media.shape-circle { margin: 14px auto 0; }
.al-card-media.shape-rounded,
.al-list-img-wrap.shape-rounded { border-radius: 8px; overflow: hidden; }

/* ================================
   Hover effects (card only)
   ================================ */
.al-card.hover-lift { transition: transform 0.25s ease, box-shadow 0.25s ease; }
.al-card.hover-lift:hover { transform: translateY(-8px); box-shadow: 0 12px 32px rgba(0,0,0,0.15); }
.al-card.hover-zoom { overflow: hidden; }
.al-card.hover-zoom .al-card-media img,
.al-card.hover-zoom .al-card-media .al-img,
.al-card.hover-zoom .al-img { transition: transform 0.35s ease; }
.al-card.hover-zoom:hover .al-card-media img,
.al-card.hover-zoom:hover .al-card-media .al-img,
.al-card.hover-zoom:hover .al-img { transform: scale(1.09); }

/* ================================
   CTA button
   ================================ */
.al-cta {
  display: inline-block; margin-top: 12px;
  padding: 10px 20px;
  background: var(--al-accent, #F95E00); color: #fff;
  border: none; border-radius: 6px;
  font-size: 0.9em; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: opacity 0.2s ease;
}
.al-cta:hover { opacity: 0.85; }
.al-card .al-cta,
.al-list-item .al-cta { margin: 8px 0 0; }

/* ================================
   Rich card slots (phase 1a–1d)
   ================================ */

/* Image overlay badges + conditional dimming (1a) */
.al-overlay-status,
.al-overlay-type {
  position: absolute;
  top: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  line-height: 1.2;
}
.al-overlay-status {
  left: 10px;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.al-overlay-status--inactive {
  color: var(--al-text-muted);
}
.al-overlay-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1f9d55;
}
.al-overlay-type {
  right: 10px;
  background: rgba(17,24,39,0.62);
  color: #ffffff;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.al-card--inactive { opacity: 0.78; }
.al-card--inactive img { filter: grayscale(1); transition: filter .2s ease; }
.al-card--inactive:hover img { filter: grayscale(0); }

/* Aggregate stats bar (1e) */
.al-stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 38px;
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--al-border);
}
.al-stat { display: flex; flex-direction: column; gap: 2px; }
.al-stat-n {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--al-text-heading);
}
.al-stat-l {
  font-size: 13px;
  color: var(--al-text-muted);
}

/* ================================
   Rich card slots (phase 1b–1d)
   ================================ */

/* Two-tone badge rows */
.al-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}
.al-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.01em;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--al-surface);
  color: var(--al-text);
  box-shadow: inset 0 0 0 1px rgba(16,24,40,0.04);
}
.al-tag--sage {
  background: #e7f6ec;
  color: #1f7a43;
}
/* Internally "accent"; surfaced in the builder as "Red" (warm orange reads as red). */
.al-tag--accent {
  background: #fdeee2;
  color: #b4530f;
}
/* Badge field rendered with its label (when "Show field labels" is on) —
   keep the label inline on the same row as the pills. */
.al-tags-field {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}
.al-tags-field > strong {
  margin: 0;
}
.al-tags-field .al-tags {
  margin: 0;
}

/* Location row */
.al-card-loc {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--al-text-muted);
  margin: 0 0 10px;
}
.al-card-loc .al-loc-pin { flex: 0 0 auto; }

/* Two-slot footer */
.al-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
}
.al-card-foot-meta {
  font-size: 13px;
  color: var(--al-text-muted);
}
.al-card-foot .al-cta { margin: 0; }

/* Inactive (non-interactive) CTA — keeps the button's shape/size, just greyed out */
.al-cta--inactive {
  background: #d1d5db;
  color: #6b7280;
  cursor: default;
  pointer-events: none;
}
.al-cta--inactive:hover { opacity: 1; }

/* Chip filter */
.al-chip-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
}
.al-chip {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  padding: 8px 14px;
  border: 1px solid var(--al-border);
  border-radius: 20px;
  /* --al-choice-bg/--al-choice-text are set inline per chip when the value
     matches an Airtable choice colour (select-colour-sync); theme colours
     remain the fallback when absent or the toggle is off. */
  background: var(--al-choice-bg, var(--al-bg));
  color: var(--al-choice-text, var(--al-text));
  cursor: pointer;
  transition: all var(--al-transition);
}
.al-chip:hover {
  border-color: var(--al-accent);
  color: var(--al-accent);
}
.al-chip.is-active {
  background: var(--al-accent);
  border-color: var(--al-accent);
  color: #fff;
}

/* Spotlight / featured record (1f) */
.al-spotlight {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  margin-bottom: 28px;
}
.al-spotlight-media {
  position: relative;
  border-radius: var(--al-radius);
  overflow: hidden;
  line-height: 0;
  background: var(--al-surface);
}
.al-spotlight-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.al-spotlight-tag {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  line-height: 1.3;
}
.al-spot-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--al-accent);
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
}
.al-spotlight-tag strong { color: #111827; font-size: 14px; }
.al-spotlight-tag span { color: #6b7280; font-size: 12px; }
.al-spotlight-title {
  margin: 0 0 8px;
  font-size: 30px;
  font-weight: 700;
  color: var(--al-text-heading);
}
.al-spotlight-meta {
  margin: 0 0 18px;
  font-size: 15px;
  color: var(--al-text-muted);
}
@media (max-width: 640px) {
  .al-spotlight { grid-template-columns: 1fr; gap: 18px; }
}

/* ================================
   Carousel pagination
   ================================ */
.airloop-filtered-set.al-carousel .al-grid {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: 16px;
  padding-bottom: 8px;
}
.airloop-filtered-set.al-carousel .al-grid .al-card {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: min(280px, 85vw);
}
.airloop-filtered-set.al-carousel .al-card-media,
.airloop-filtered-set.al-carousel .al-card-body { width: 100%; }

/* ================================
   Summary row (KPI stat cards)
   ================================ */
.airloop-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.al-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 120px;
  padding: 12px 16px;
  background: var(--al-surface, #f9fafb);
  border: 1px solid var(--al-border, #e5e7eb);
  border-radius: var(--al-radius, 10px);
}
.al-stat-value {
  font-size: 1.5em;
  font-weight: 700;
  line-height: 1.1;
  color: var(--al-text-heading, #111827);
  font-variant-numeric: tabular-nums;
}
.al-stat-label {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 6px;
  font-size: 0.78em;
  color: var(--al-text-muted, #6b7280);
}
.al-stat-op {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--al-accent, #f75d00);
}
.al-stat-field {
  color: var(--al-text, #4b5563);
}

/* ================================
   Result count ("Showing X of Y")
   ================================ */
.airloop-result-count {
  margin-bottom: 14px;
  font-size: 0.85em;
  font-weight: 600;
  color: var(--al-text, #6b7280);
  font-variant-numeric: tabular-nums;
}

/* ================================
   Grouped view (group_by)
   ================================ */
.airloop-grouped {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* "Collapse all / Expand all" control — subtle accent pill, left-aligned. */
.al-group-toggle-all {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 2px;
  padding: 6px 12px;
  font: inherit;
  font-size: 0.82em;
  font-weight: 600;
  line-height: 1;
  color: var(--al-accent-text, var(--al-accent, #f75d00));
  background: var(--al-accent-bg, #eef2ff);
  border: 1px solid transparent;
  border-radius: var(--al-radius-sm, 6px);
  cursor: pointer;
  transition: filter var(--al-transition, 0.2s ease), background var(--al-transition, 0.2s ease);
}
.al-group-toggle-all:hover {
  filter: brightness(0.97);
}
.al-group-toggle-all:focus-visible {
  outline: 2px solid var(--al-accent, #f75d00);
  outline-offset: 2px;
}

/* Each group is a self-contained card. */
.al-group {
  background: var(--al-bg, #fff);
  border: 1px solid var(--al-border, #e5e7eb);
  border-radius: var(--al-radius, 10px);
  box-shadow: var(--al-shadow, 0 1px 3px rgba(0, 0, 0, 0.06));
  overflow: hidden;
}

.al-group-header {
  display: flex;
  align-items: center;
  background: var(--al-surface, #f9fafb);
  border-bottom: 1px solid var(--al-border, #e5e7eb);
  transition: border-color var(--al-transition, 0.2s ease);
}

/* The whole header bar is the toggle hit-area. */
.al-group-toggle {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 12px 16px;
  font: inherit;
  text-align: left;
  color: var(--al-text-heading, #111827);
  background: none;
  border: 0;
  cursor: pointer;
  transition: background var(--al-transition, 0.2s ease);
}
.al-group-toggle:hover {
  background: var(--al-surface-hover, #f3f4f6);
}
.al-group-toggle:focus-visible {
  outline: 2px solid var(--al-accent, #f75d00);
  outline-offset: -2px;
}

/* Disclosure chevron — points down when expanded, right when collapsed. */
.al-group-toggle-icon {
  flex: none;
  width: 7px;
  height: 7px;
  margin-right: 2px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: 0.55;
  transform: rotate(45deg);
  transition: transform var(--al-transition, 0.2s ease);
}
.al-group-toggle[aria-expanded="false"] .al-group-toggle-icon {
  transform: rotate(-45deg);
}

.al-group-label {
  font-weight: 600;
  color: var(--al-text-heading, #111827);
}

/* Count pill — clearly separated from the label (fixes "Unassigned2 items"). */
.al-group-count {
  flex: none;
  margin-left: 10px;
  padding: 2px 9px;
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1.6;
  color: var(--al-text-muted, #9ca3af);
  background: var(--al-bg, #fff);
  border: 1px solid var(--al-border, #e5e7eb);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

/* Per-group aggregate badge, pushed to the far right of the header. */
.al-group-summary-badge {
  margin: 0 16px 0 auto;
  padding-left: 16px;
  font-size: 0.8em;
  font-weight: 500;
  color: var(--al-text-muted, #9ca3af);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.al-group-body {
  padding: 16px;
}

/* Collapsed state — JS sets data-collapsed + aria-expanded="false". */
.al-group[data-collapsed="true"] .al-group-header {
  border-bottom-color: transparent;
}
.al-group[data-collapsed="true"] .al-group-body {
  display: none;
}

/* Per-group aggregate items inside the header badge. */
.al-group-summary-item {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}
.al-group-summary-item + .al-group-summary-item {
  margin-left: 14px;
}
.al-group-summary-op {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--al-accent, #f75d00);
}
.al-group-summary-item strong {
  color: var(--al-text-heading, #111827);
  font-weight: 700;
}

/* ================================
   Table summary footer (tfoot)
   ================================ */
.al-table tfoot {
  border-top: 2px solid var(--al-border, #e5e7eb);
}
.al-table tfoot td {
  padding: 11px 14px;
  background: var(--al-surface, #f9fafb);
  color: var(--al-text-heading, #111827);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.al-table tfoot .al-summary-op {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.82em;
  color: var(--al-accent, #f75d00);
  margin-right: 4px;
}

/* ================================
   Export toolbar (export="yes")
   ================================ */
.airloop-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}
.al-export {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  font-size: 0.85em;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  color: var(--al-text-heading, #111827);
  background: var(--al-surface, #f9fafb);
  border: 1px solid var(--al-border, #e5e7eb);
  border-radius: var(--al-radius-sm, 6px);
  cursor: pointer;
  transition: background var(--al-transition, 0.2s ease), border-color var(--al-transition, 0.2s ease);
}
.al-export:hover {
  background: var(--al-surface-hover, #f3f4f6);
  border-color: var(--al-accent, #f75d00);
  color: var(--al-text-heading, #111827);
}
.al-export:focus-visible {
  outline: 2px solid var(--al-accent, #f75d00);
  outline-offset: 2px;
}
/* Down-tray download glyph, drawn in CSS (no emoji / no image request). */
.al-export-icon {
  flex: none;
  position: relative;
  width: 13px;
  height: 13px;
}
.al-export-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  height: 8px;
  background: currentColor;
  transform: translateX(-50%);
}
.al-export-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 3px;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateX(-50%) rotate(45deg);
}
.al-export-tray {
  display: none;
}

/* ================================
   Reduced motion
   ================================ */
@media (prefers-reduced-motion: reduce) {
  .airloop-records-wrapper *,
  .airloop-grouped * {
    transition-duration: 0.01ms !important;
  }
}

/* ---------------------------------------------------------------------------
   Record Spotlight — full-width single-record hero card.
   Reuses the shared theme tokens (--al-*) so the Records styling controls
   (theme, mode, colours, radius) apply to the hero exactly as to the grid.
   --------------------------------------------------------------------------- */
.airloop-records-wrapper .al-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  width: 100%;
  background: var(--al-card-bg, var(--al-bg, #fff));
  color: var(--al-text, #1f2937);
  border: 1px solid var(--al-border, #e5e7eb);
  border-radius: var(--al-radius, 14px);
  overflow: hidden;
}
.airloop-records-wrapper .al-hero.al-clickable { cursor: pointer; }
.airloop-records-wrapper .al-hero-media {
  flex: 1 1 44%;
  min-width: 260px;
  margin: 0;
}
.airloop-records-wrapper .al-hero-media .al-img {
  width: 100%;
  height: 100%;
  min-height: 240px;
  object-fit: cover;
  display: block;
}
.airloop-records-wrapper .al-hero-body {
  flex: 1 1 56%;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(20px, 4vw, 40px);
}
.airloop-records-wrapper .al-hero-title {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.15;
  color: var(--al-text-heading, var(--al-text, #111827));
}
.airloop-records-wrapper .al-hero-body .al-overview { margin: 0; }
.airloop-records-wrapper .al-hero-cta { align-self: flex-start; margin-top: 8px; }

@media (max-width: 700px) {
  .airloop-records-wrapper .al-hero { flex-direction: column; }
  .airloop-records-wrapper .al-hero-media .al-img { min-height: 200px; }
}
