.al-clean-audience-route {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.55fr);
  gap: 20px;
  padding: 24px;
  min-height: calc(100vh - 88px);
  background: var(--al-page-bg, #f8fafc);
  color: var(--al-text, #0f172a);
}

.al-clean-audience-map-card,
.al-clean-card {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.al-clean-audience-map-card {
  overflow: hidden;
  min-height: 760px;
  display: flex;
  flex-direction: column;
}

.al-clean-audience-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
}

.al-clean-eyebrow {
  margin: 0 0 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.al-clean-audience-toolbar h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.al-clean-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.al-clean-controls input,
.al-clean-controls select,
.al-clean-controls button {
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.42);
  background: #fff;
  color: #0f172a;
  padding: 0 12px;
  font-weight: 700;
}

.al-clean-controls input {
  min-width: 280px;
}

.al-clean-controls button {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
  cursor: pointer;
}

#al-audiences-map {
  min-height: 660px;
  flex: 1;
}

.al-clean-note {
  margin: 0;
  padding: 12px 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.al-clean-audience-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 116px);
  overflow: auto;
  padding-right: 2px;
}

.al-clean-card {
  padding: 18px;
}

.al-clean-card h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.al-clean-card h3 {
  margin: 16px 0 8px;
  font-size: 14px;
}

.al-clean-card p,
.al-clean-card li,
.al-clean-card small {
  color: #64748b;
  line-height: 1.5;
}

.al-clean-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.al-clean-row {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #f8fafc;
  border-radius: 16px;
  padding: 10px;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  color: #0f172a;
  cursor: pointer;
}

.al-clean-row:hover {
  border-color: rgba(37, 99, 235, 0.45);
  background: #eff6ff;
}

.al-clean-row strong,
.al-clean-row small {
  display: block;
}

.al-clean-row small {
  margin-top: 2px;
  font-size: 12px;
}

.al-clean-row em {
  font-style: normal;
  font-weight: 900;
  color: #64748b;
}

.al-clean-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent);
}

.al-clean-mix-row {
  margin-top: 12px;
}

.al-clean-mix-row div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  font-size: 13px;
}

.al-clean-mix-row b {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.al-clean-mix-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
}

.al-clean-profile-grid {
  display: grid;
  gap: 10px;
}

.al-clean-profile-grid div {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  padding: 12px;
  background: #f8fafc;
}

.al-clean-profile-grid strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.al-clean-profile-grid p {
  margin: 0;
}

.al-clean-muted {
  color: #64748b;
}

@media (max-width: 1100px) {
  .al-clean-audience-route {
    grid-template-columns: 1fr;
  }

  .al-clean-audience-sidebar {
    max-height: none;
  }

  .al-clean-audience-toolbar {
    flex-direction: column;
  }

  .al-clean-controls {
    justify-content: flex-start;
  }

  .al-clean-controls input {
    min-width: min(100%, 280px);
  }
}

html[data-theme="dark"] .al-clean-audience-route,
body.dark .al-clean-audience-route {
  background: #020617;
  color: #f8fafc;
}

html[data-theme="dark"] .al-clean-audience-map-card,
html[data-theme="dark"] .al-clean-card,
body.dark .al-clean-audience-map-card,
body.dark .al-clean-card {
  background: rgba(15, 23, 42, 0.94);
  border-color: rgba(71, 85, 105, 0.72);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .al-clean-controls input,
html[data-theme="dark"] .al-clean-controls select,
body.dark .al-clean-controls input,
body.dark .al-clean-controls select {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

html[data-theme="dark"] .al-clean-row,
html[data-theme="dark"] .al-clean-profile-grid div,
body.dark .al-clean-row,
body.dark .al-clean-profile-grid div {
  background: #111827;
  color: #f8fafc;
  border-color: #334155;
}

html[data-theme="dark"] .al-clean-row:hover,
body.dark .al-clean-row:hover {
  background: #172554;
}

html[data-theme="dark"] .al-clean-card p,
html[data-theme="dark"] .al-clean-card li,
html[data-theme="dark"] .al-clean-card small,
html[data-theme="dark"] .al-clean-eyebrow,
html[data-theme="dark"] .al-clean-note,
body.dark .al-clean-card p,
body.dark .al-clean-card li,
body.dark .al-clean-card small,
body.dark .al-clean-eyebrow,
body.dark .al-clean-note {
  color: #94a3b8;
}

/* Keep the native app header/nav visible on #/audiences */
html.al-clean-audience-active,
body.al-clean-audience-active {
  overflow: hidden;
}

#al-integrated-audience-explorer.al-clean-audience-route {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--al-clean-route-top, 88px);
  bottom: 0;
  z-index: 20;
  overflow: auto;
  min-height: 0;
  height: auto;
  padding: 24px;
}

#al-integrated-audience-explorer .al-clean-audience-map-card {
  min-height: calc(100vh - var(--al-clean-route-top, 88px) - 48px);
}

#al-integrated-audience-explorer #al-audiences-map {
  min-height: calc(100vh - var(--al-clean-route-top, 88px) - 180px);
}

#al-integrated-audience-explorer .al-clean-audience-sidebar {
  max-height: calc(100vh - var(--al-clean-route-top, 88px) - 48px);
}

