/* Nexus — UI Components
 * Top App Bar · Hub · Subtopics · Story · AI Assist
 * Material language: frosted glass everywhere (Figma Glassmorphism)
 */

/* ════════════════════════════════════════════════════════
   UNIVERSAL FROSTED GLASS
   Every elevated surface gets blur + border + soft shadow.
   Color tokens alone are not enough — frost must be explicit.
   ════════════════════════════════════════════════════════ */

.nx-frost,
.subtopics-panel,
.story-card,
.sub-item,
.sub-index,
.hub-status,
.sources-block,
.service-debate,
.debate-card,
.hg-closing,
.tips-box,
.story-pending,
.ai-panel,
.story-hero-step,
.story-badge,
.story-badge-muted,
.story-tag,
.story-empty-icon,
.portal-refresh,
.category-meta .md-chip,
.subtopics-ai,
.dv-statpair-item,
.dv-hl-card,
.dv-block,
.info-card,
.hub-sources,
.segment-bar,
.portal-tabbar,
.story-rail,
.ai-pill,
.nx-top-app-bar,
.nx-pill-bar,
.hub-toast,
.journey,
.jcircle,
.bubble3d-label,
.portal-tile {
  -webkit-backdrop-filter: var(--nx-glass-blur);
  backdrop-filter: var(--nx-glass-blur);
}

/* Soft glass chips / secondary surfaces */
.nx-icon-btn:not(.nx-icon-btn-brand),
.story-tag,
.layer-chip,
.md-chip:not(.is-selected),
.ai-action,
.portal-refresh {
  background: var(--nx-glass-bg-soft);
  border: 1px solid var(--nx-glass-border-soft);
  box-shadow: none;
}

/* Raised glass panels */
.subtopics-panel,
.story-card,
.sources-block,
.service-debate,
.debate-card,
.hg-closing,
.tips-box,
.story-pending,
.ai-panel,
.info-card,
.hub-sources,
.dv-block,
.dv-hl-card,
.dv-statpair-item,
.hub-status,
.journey {
  background: var(--nx-glass-bg);
  border: 1px solid var(--nx-glass-border);
  box-shadow: var(--nx-glass-shadow);
}

/* ════════════════════════════════════════════════════════
   MATERIAL 3 FLOATING PILL APP BAR
   Frosted glass pill — shared on all viewports
   ════════════════════════════════════════════════════════ */

.nx-top-app-bar,
.nx-pill-bar {
  position: fixed !important;
  /* Single source of truth: --header-top + safe-area — identical on every page */
  top: calc(var(--header-top, 12px) + var(--safe-top, 0px)) !important;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: min(1360px, calc(100% - 24px));
  max-width: min(1360px, calc(100% - 24px));
  height: var(--header-h, 52px);
  min-height: var(--header-h, 52px);
  max-height: var(--header-h, 52px);
  box-sizing: border-box;
  background: var(--nx-glass-bg);
  -webkit-backdrop-filter: var(--nx-glass-blur);
  backdrop-filter: var(--nx-glass-blur);
  color: var(--md-sys-color-on-surface);
  border: 1px solid var(--nx-glass-border);
  border-radius: var(--md-sys-shape-corner-full);
  box-shadow: var(--nx-glass-shadow);
  overflow: hidden;
  transition:
    background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
    box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
    border-color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

.nx-top-app-bar.is-scrolled,
.nx-pill-bar.is-scrolled {
  background: var(--nx-glass-bg-strong);
  border-color: var(--nx-glass-border);
  box-shadow: var(--nx-glass-shadow-lg);
}

.nx-top-app-bar-inner {
  height: 100%;
  width: 100%;
  margin: 0 auto;
  padding: 0 6px 0 4px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.nx-top-leading {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-width: 48px;
}

.nx-top-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  padding: 0 4px 0 4px;
}

.nx-top-title-main {
  font-family: var(--md-sys-typescale-brand);
  font-size: 16px;
  line-height: 22px;
  font-weight: 500;
  letter-spacing: 0.1px;
  color: var(--md-sys-color-on-surface);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (min-width: 720px) {
  .nx-top-title-main {
    font-size: 18px;
    line-height: 24px;
  }
}

.nx-top-title-sub {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: var(--md-sys-color-on-surface-variant);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nx-top-trailing {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
}

/* ── Icon button (Apple HIG 44px touch target standard) ── */
.nx-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  text-decoration: none;
  overflow: hidden;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.16s cubic-bezier(0.2, 0.9, 0.4, 1.1), color 0.15s ease, background 0.15s ease;
}
.nx-icon-btn:active {
  transform: scale(0.94);
}
.nx-icon-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: currentColor;
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}
.nx-icon-btn:hover::after { opacity: var(--md-sys-state-hover-opacity); }
.nx-icon-btn:focus-visible {
  outline: 2px solid var(--md-sys-color-secondary);
  outline-offset: 0;
}
.nx-icon-btn:focus-visible::after { opacity: var(--md-sys-state-focus-opacity); }
.nx-icon-btn:active::after { opacity: var(--md-sys-state-pressed-opacity); }
.nx-icon-btn .material-symbols-rounded {
  position: relative;
  z-index: 1;
  font-size: 24px;
}

/* Brand mark on hub — clay tonal disc */
.nx-icon-btn-brand {
  color: var(--md-sys-color-on-primary-container);
}
.nx-icon-btn-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--nx-accent-soft), var(--nx-accent));
  box-shadow: var(--nx-elev-cta);
  border: 1px solid rgba(255, 255, 255, 0.4);
  z-index: 0;
}
.nx-icon-btn-brand .material-symbols-rounded {
  color: #fff !important;
}
.nx-icon-btn-brand .material-symbols-rounded {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ── Destinations as M3 filter chips inside pill ── */
.nx-top-destinations {
  display: none;
  align-items: center;
  gap: 4px;
  margin-right: 2px;
}
@media (min-width: 600px) {
  .nx-top-destinations { display: inline-flex; }
}

.nx-text-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 32px;
  padding: 0 12px;
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1px;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.nx-text-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0;
  border-radius: inherit;
  transition: opacity var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}
.nx-text-btn:hover::after { opacity: var(--md-sys-state-hover-opacity); }
.nx-text-btn:focus-visible {
  outline: 2px solid var(--md-sys-color-secondary);
  outline-offset: 1px;
}
/* Selected = secondary-container chip (M3 filter chip selected) */
.nx-text-btn.is-active {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}
.nx-text-btn.is-active::after { background: var(--md-sys-color-on-secondary-container); }
.nx-text-btn .material-symbols-rounded {
  position: relative;
  z-index: 1;
  font-size: 18px;
}
.nx-text-btn-label {
  position: relative;
  z-index: 1;
}

/* Legacy filled btn (if used elsewhere) — primary filled */
.nx-filled-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  min-width: 40px;
  padding: 0 20px 0 16px;
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1px;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}
.nx-filled-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--md-sys-color-on-primary);
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}
.nx-filled-btn:hover::after { opacity: var(--md-sys-state-hover-opacity); }
.nx-filled-btn:focus-visible {
  outline: 2px solid var(--md-sys-color-secondary);
  outline-offset: 2px;
}
.nx-filled-btn:focus-visible::after { opacity: var(--md-sys-state-focus-opacity); }
.nx-filled-btn:active::after { opacity: var(--md-sys-state-pressed-opacity); }
.nx-filled-btn .material-symbols-rounded {
  position: relative;
  z-index: 1;
  font-size: 18px;
}
.nx-filled-btn-label {
  position: relative;
  z-index: 1;
}

/* Progress ring as icon-button variant */
.nx-h-progress {
  position: relative;
}
.nx-h-progress svg {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 40px;
}
.nx-h-progress circle.track {
  fill: none;
  stroke: var(--md-sys-color-outline-variant);
  stroke-width: 3;
}
.nx-h-progress circle.fill {
  fill: none;
  stroke: var(--md-sys-color-primary);
  stroke-width: 3;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dashoffset var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-standard);
}
.nx-h-progress-num {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--md-sys-color-on-surface);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* Compact on small screens — same height tokens as desktop */
@media (max-width: 599px) {
  .nx-top-title-sub {
    display: none;
  }
  .nx-top-app-bar,
  .nx-pill-bar {
    width: calc(100% - 12px - var(--safe-left) - var(--safe-right));
    height: var(--header-h, 52px);
    min-height: var(--header-h, 52px);
    max-height: var(--header-h, 52px);
    border-radius: 999px;
    background: var(--nx-glass-bg-strong);
    padding: 0 8px;
  }
  .nx-top-title-main {
    font-size: 17px;
    font-weight: 600;
  }
  .nx-icon-btn:not(.nx-icon-btn-brand) {
    background: var(--nx-glass-bg-soft);
    border: 1px solid var(--nx-glass-border-soft);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    width: 44px;
    height: 44px;
  }
  .nx-top-destinations {
    display: none;
  }
}

/* Body offset: floating pill vars in theme.css */

/* Legacy floating pill hooks */
.nx-header { /* replaced by .nx-pill-bar */ }

/* ════════════════════════════════════════════════════════
   HUB PAGE — News-Portal / Mobile-App shell (redesign)
   Hero + horizontal rail + feed cards · M3 tonal · no MD2 shadows
   ════════════════════════════════════════════════════════ */

.hub-app {
  /* space for bottom tab bar */
  padding-bottom: calc(72px + var(--safe-bottom)) !important;
}

.hub-page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 8px 16px calc(24px + var(--safe-bottom));
  min-width: 0;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* ── Masthead ── */
.portal-masthead {
  padding: 8px 0 12px;
}
.portal-masthead-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.portal-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--md-sys-color-primary);
}
.portal-kicker .material-symbols-rounded { font-size: 16px; }

.portal-title {
  margin: 0 0 8px;
  font-family: var(--md-sys-typescale-brand);
  font-size: clamp(28px, 7vw, 40px);
  line-height: 1.12;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--md-sys-color-on-surface);
}

.portal-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 4px;
  font-size: 13px;
  color: var(--md-sys-color-on-surface-variant);
}
.portal-stat strong {
  color: var(--md-sys-color-on-surface);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.portal-stat-dot { opacity: 0.5; padding: 0 2px; }

.portal-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: none;
}
.portal-refresh.is-loading .material-symbols-rounded {
  animation: nx-spin 0.9s linear infinite;
}
.portal-refresh.is-success {
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
}
.portal-refresh.is-error {
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}
.portal-refresh .material-symbols-rounded { font-size: 20px; }
@media (max-width: 380px) {
  .portal-refresh-label { display: none; }
  .portal-refresh { padding: 0; width: 44px; }
}

.hub-linear-progress {
  position: relative;
  height: 4px;
  width: 100%;
  margin: 12px 0 0;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface-container-highest);
  overflow: hidden;
}
.hub-linear-progress[hidden] { display: none !important; }
.hub-linear-progress::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 40%;
  background: var(--md-sys-color-primary);
  border-radius: inherit;
  animation: hub-indeterminate 1.2s var(--md-sys-motion-easing-standard) infinite;
}
@keyframes hub-indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

.hub-status {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: var(--md-sys-shape-corner-md);
  font-size: 13px;
  line-height: 18px;
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}
.hub-status[hidden] { display: none !important; }
.hub-status.is-success {
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
}
.hub-status.is-warn {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}
.hub-status.is-error {
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}

/* ── Sticky filter chips ── */
.portal-chips {
  position: sticky;
  top: calc(var(--header-h) + var(--header-top) + var(--safe-top) + 8px);
  z-index: 40;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0 12px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  background: color-mix(in srgb, var(--md-sys-color-surface) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.portal-chips[hidden] { display: none !important; }
.portal-chips::-webkit-scrollbar { display: none; }
.portal-chip {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface-variant);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: none;
}
.portal-chip.is-active {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

/* ── Bento Startseite: Lead 16:9 + 9:16 Portrait-Cards ── */
.portal-feed {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}
.portal-feed.is-refreshing {
  opacity: 0.55;
  pointer-events: none;
}

/*
 * Lead immer volle Breite (16:9) → eigene Reihe.
 * Darunter nur 9:16-Cards in 2 Spalten → gleiche Höhe, keine Lücken.
 */
.portal-bento {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  align-items: stretch;
}

/* ── Tile shell ── */
.portal-tile {
  position: relative;
  display: grid;
  grid-template: 1fr / 1fr;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-radius: var(--md-sys-shape-corner-xl);
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  background: var(--nx-glass-bg);
  border: 1px solid var(--nx-glass-border);
  box-shadow: var(--nx-glass-shadow);
  box-sizing: border-box;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.portal-tile:active { opacity: 0.92; }
.portal-tile[hidden] { display: none !important; }

/* 9:16 Portrait — alle Cards unter dem Lead */
.portal-tile.size-portrait,
.portal-skel.size-portrait {
  grid-column: span 1;
  aspect-ratio: 9 / 16;
  width: 100%;
  height: auto;
}

/* Lead: volle Breite, 16:9 — sitzt allein in der ersten Reihe */
.portal-tile.size-lead,
.portal-skel.size-lead {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
}

/* Media = full bleed cover — sharp scaling */
.portal-tile-media {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 80% at 70% 30%, color-mix(in srgb, var(--md-sys-color-primary) 22%, transparent), transparent 65%),
    linear-gradient(145deg, var(--md-sys-color-primary-container), var(--md-sys-color-tertiary-container));
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  /* Avoid blurry upscales looking mushy */
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}
.portal-tile.is-trend .portal-tile-media {
  background:
    radial-gradient(ellipse 70% 80% at 70% 30%, color-mix(in srgb, var(--md-sys-color-tertiary) 22%, transparent), transparent 65%),
    linear-gradient(145deg, var(--md-sys-color-tertiary-container), var(--md-sys-color-secondary-container));
  background-size: cover;
  background-position: center center;
}
.portal-tile.has-image .portal-tile-media {
  background-color: var(--md-sys-color-surface-container-highest);
  /* When URL is set via inline style, keep cover + center */
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}

/* Text-Overlay unten auf dem Bild */
.portal-tile-body {
  grid-area: 1 / 1;
  z-index: 1;
  align-self: end;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  padding: 12px 12px 14px;
  box-sizing: border-box;
  background: linear-gradient(
    180deg,
    transparent 0%,
    color-mix(in srgb, var(--md-sys-color-scrim) 35%, transparent) 40%,
    color-mix(in srgb, var(--md-sys-color-scrim) 78%, transparent) 100%
  );
  color: #fff;
}

.portal-tile.size-lead .portal-tile-body {
  padding: 20px 18px 18px;
  gap: 8px;
}
.portal-tile.size-portrait .portal-tile-body {
  padding: 10px 10px 12px;
  gap: 5px;
}
.portal-tile-title {
  font-weight: 500;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
  color: #fff;
}
.portal-tile.size-lead .portal-tile-title {
  font-family: var(--md-sys-typescale-brand);
  font-size: clamp(22px, 6vw, 34px);
  line-height: 1.12;
  font-weight: 400;
  -webkit-line-clamp: 3;
}
.portal-tile.size-portrait .portal-tile-title {
  font-size: 13px;
  line-height: 17px;
  -webkit-line-clamp: 4;
}

.portal-tile-teaser {
  font-size: 13px;
  line-height: 18px;
  color: color-mix(in srgb, #fff 88%, transparent);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  -webkit-line-clamp: 2;
  word-break: break-word;
}
.portal-tile.size-portrait .portal-tile-teaser {
  display: none;
}

.portal-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--md-sys-shape-corner-full);
  background: color-mix(in srgb, var(--md-sys-color-secondary-container) 92%, #fff);
  color: var(--md-sys-color-on-secondary-container);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2px;
  text-transform: none;
  width: fit-content;
  overflow: hidden;
  box-sizing: border-box;
}
.portal-badge-hot {
  background: color-mix(in srgb, var(--md-sys-color-error-container) 92%, #fff);
  color: var(--md-sys-color-on-error-container);
}
.portal-tile.size-portrait .portal-badge {
  height: 18px;
  padding: 0 6px;
  font-size: 9px;
}
.portal-badge .material-symbols-rounded {
  font-size: 13px;
  flex-shrink: 0;
}
.portal-tile.size-portrait .portal-badge .material-symbols-rounded {
  font-size: 12px;
}
.portal-badge-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Skeleton */
.portal-skeleton.portal-bento {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.portal-skel {
  width: 100%;
  border-radius: var(--md-sys-shape-corner-xl);
  background: linear-gradient(
    90deg,
    var(--md-sys-color-surface-container) 0%,
    var(--md-sys-color-surface-container-high) 50%,
    var(--md-sys-color-surface-container) 100%
  );
  background-size: 200% 100%;
  animation: hub-shimmer 1.2s ease-in-out infinite;
  box-sizing: border-box;
}
@keyframes hub-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Tablet: 3 Spalten Portrait — Lead bleibt full-width 16:9 */
@media (min-width: 720px) {
  .portal-bento,
  .portal-skeleton.portal-bento {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
  .portal-tile.size-lead,
  .portal-skel.size-lead {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 9;
  }
  .portal-tile.size-portrait .portal-tile-title {
    font-size: 14px;
    line-height: 18px;
    -webkit-line-clamp: 4;
  }
  .portal-tile.size-lead .portal-tile-title {
    font-size: clamp(24px, 3vw, 36px);
  }
}

/* Desktop: 4 Spalten — Lead full-width 16:9, darunter 9:16 */
@media (min-width: 1000px) {
  .portal-bento,
  .portal-skeleton.portal-bento {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }
  .portal-tile.size-lead,
  .portal-skel.size-lead {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 9;
  }
}

/* ── Bottom tab bar (mobile app chrome) ── */
.portal-tabbar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 99999;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  min-height: 56px;
  padding: 6px 8px;
  border-radius: var(--md-sys-shape-corner-full);
  background: rgba(12, 14, 28, 0.88);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  backdrop-filter: blur(28px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.portal-tab {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  border-radius: var(--md-sys-shape-corner-lg);
  text-decoration: none;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.portal-tab .material-symbols-rounded {
  font-size: 24px;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.portal-tab.is-active {
  color: var(--md-sys-color-primary);
}
.portal-tab.is-active .material-symbols-rounded {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
@media (min-width: 900px) {
  .portal-tabbar { display: none; }
  .hub-app { padding-bottom: 0 !important; }
}

/* Sources + about (compact) */
.hub-sources {
  margin-top: 28px;
  padding: 14px 16px;
  border-radius: var(--md-sys-shape-corner-lg);
  background: var(--nx-glass-bg);
  -webkit-backdrop-filter: var(--nx-glass-blur);
  backdrop-filter: var(--nx-glass-blur);
  box-shadow: var(--nx-glass-shadow);
  border: 1px solid var(--nx-glass-border);
}
.hub-sources-title {
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--md-sys-color-on-surface-variant);
}
.hub-sources-title .material-symbols-rounded {
  font-size: 16px;
  color: var(--md-sys-color-primary);
}
.hub-sources-body {
  margin: 0;
  font-size: 12px;
  line-height: 18px;
  color: var(--md-sys-color-on-surface-variant);
  word-break: break-word;
}

.hub-about {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
}
.hub-about-head {
  max-width: 560px;
  margin-bottom: 16px;
}
.hub-about-head h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 400;
  color: var(--md-sys-color-on-surface);
}
.hub-about-head p {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--md-sys-color-on-surface-variant);
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 720px) {
  .info-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}
.info-card {
  position: relative;
  padding: 16px;
  border-radius: var(--md-sys-shape-corner-2xl);
  background: var(--nx-glass-bg);
  -webkit-backdrop-filter: var(--nx-glass-blur);
  backdrop-filter: var(--nx-glass-blur);
  border: 1px solid var(--nx-glass-border);
  box-shadow: var(--nx-glass-shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
.info-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--md-sys-shape-corner-full);
  display: grid;
  place-items: center;
  background: linear-gradient(160deg,
    color-mix(in srgb, var(--md-sys-color-primary-container) 70%, white),
    var(--md-sys-color-primary-container));
  color: var(--md-sys-color-on-primary-container);
  box-shadow: var(--nx-clay-raised-sm);
}
.info-card-icon .material-symbols-rounded { font-size: 22px; }
.info-card-icon.tonal-secondary {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}
.info-card-icon.tonal-tertiary {
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
}
.info-card h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
}
.info-card p {
  margin: 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--md-sys-color-on-surface-variant);
}
.layer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.layer-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--md-sys-shape-corner-full);
  border: 1px solid var(--nx-glass-border);
  background: var(--nx-glass-bg-soft);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 12px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
}
.layer-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--md-sys-color-primary);
}

@keyframes nx-spin { to { transform: rotate(360deg); } }

/* legacy aliases kept for other pages referencing hub-refresh */
.hub-refresh { /* see .portal-refresh */ }

/* ════════════════════════════════════════════════════════
   SUBTOPICS PAGE (index.html) — Material 3 list + preview
   ════════════════════════════════════════════════════════ */

.category-page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px 16px 80px;
}

/* ── Hero / orientation ── */
.category-hero {
  padding: 16px 0 24px;
}
.category-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 18px;
  letter-spacing: 0.4px;
  color: var(--md-sys-color-on-surface-variant);
}
.category-crumb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--md-sys-shape-corner-full);
  color: var(--md-sys-color-primary);
  font-weight: 500;
  background: var(--nx-glass-bg-soft);
  border: 1px solid var(--nx-glass-border-soft);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}
.category-crumb:hover {
  background: var(--nx-glass-bg);
  border-color: var(--nx-glass-border);
}
.category-crumb.is-current {
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 400;
  max-width: min(50vw, 280px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  background: var(--nx-glass-bg);
  border-color: var(--nx-glass-border);
}
.category-crumb i { font-size: 16px; }
.category-crumb-sep {
  font-size: 16px;
  color: var(--md-sys-color-outline);
  opacity: 0.8;
}

.category-hero-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.category-hero-text { min-width: 0; flex: 1; max-width: 720px; }
.category-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--md-sys-color-primary);
  margin-bottom: 8px;
}
.category-eyebrow i { font-size: 16px; }
.category-title {
  font-family: var(--md-sys-typescale-brand);
  font-size: clamp(28px, 4.2vw, 36px);
  line-height: 1.15;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 8px;
  font-variation-settings: 'opsz' 28;
}
.category-sub {
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.25px;
  color: var(--md-sys-color-on-surface-variant);
  max-width: 560px;
}
.category-meta {
  flex-shrink: 0;
}
.category-meta .md-chip {
  cursor: default;
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border: none;
}
.category-meta .md-chip i { font-size: 16px; }

/* ── Layout: list + preview ── */
.category-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .category-page, .hub-app, body.nx-hub, .story-entry-page {
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .category-grid {
    display: flex;
    flex-direction: column-reverse;
    gap: 24px;
  }
  .subtopics-panel {
    position: relative;
    max-height: none;
    border-radius: var(--md-sys-shape-corner-2xl);
    background: var(--nx-glass-bg-strong, rgba(16, 18, 40, 0.95));
    -webkit-backdrop-filter: blur(28px);
    backdrop-filter: blur(28px);
    border: 1px solid var(--nx-glass-border, rgba(255, 255, 255, 0.2));
    box-shadow: var(--nx-glass-shadow-lg);
    padding: 16px;
    width: 100%;
    box-sizing: border-box;
    z-index: 10;
  }
  .sub-list {
    display: flex;
    flex-direction: column;
    overflow: visible;
    max-height: none;
    gap: 12px;
    padding: 8px 0;
  }
  .sub-item {
    flex: 1 1 auto;
    width: 100%;
    box-sizing: border-box;
    scroll-snap-align: none;
    min-height: 80px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--md-sys-shape-corner-xl);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  }
  .sub-item.active {
    background: color-mix(in srgb, var(--md-sys-color-primary) 32%, rgba(20, 24, 55, 0.95));
    border-color: color-mix(in srgb, var(--md-sys-color-primary) 70%, white);
    box-shadow: 0 8px 24px rgba(33, 155, 239, 0.4);
  }
  .sub-desc {
    font-size: 13px;
    line-height: 1.45;
    color: var(--md-sys-color-on-surface-variant);
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
  }
  .story-card {
    min-height: auto;
    border-radius: var(--md-sys-shape-corner-2xl);
    background: var(--nx-glass-bg-strong, rgba(16, 18, 40, 0.92));
    -webkit-backdrop-filter: blur(28px);
    backdrop-filter: blur(28px);
    border: 1px solid var(--nx-glass-border, rgba(255, 255, 255, 0.25));
    width: 100%;
    box-sizing: border-box;
    z-index: 2;
    margin-top: 4px;
  }
  .story-empty {
    min-height: 280px;
    padding: 28px 20px;
    background: transparent;
  }
}

/* List panel — surface container, elevated */
.subtopics-panel {
  position: sticky;
  top: calc(var(--header-h) + var(--header-top) + 12px + var(--safe-top));
  padding: 16px;
  border-radius: var(--md-sys-shape-corner-2xl);
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(28px) saturate(1.7);
  backdrop-filter: blur(28px) saturate(1.7);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    var(--nx-glass-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  color: var(--md-sys-color-on-surface);
  max-height: calc(100dvh - var(--header-h) - var(--header-top) - 48px - var(--safe-top));
  display: flex;
  flex-direction: column;
}
.subtopics-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 0 4px 12px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.subtopics-head-text { min-width: 0; }
.subtopics-title {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  letter-spacing: 0.15px;
  color: var(--md-sys-color-on-surface);
}
.subtopics-hint {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.4px;
  color: var(--md-sys-color-on-surface-variant);
}
.subtopics-ai {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--md-sys-shape-corner-full);
  background: color-mix(in srgb, var(--md-sys-color-primary) 24%, var(--nx-glass-bg));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--nx-glass-border);
  color: var(--md-sys-color-on-surface);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.subtopics-ai i { font-size: 14px; }

.sub-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 2px;
  margin: 0 -2px;
}
.sub-list::-webkit-scrollbar { width: 6px; }
.sub-list::-webkit-scrollbar-thumb {
  background: var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-full);
}

/* Glass list items — frosted chips in the subtopics panel */
.sub-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 12px 12px 12px 10px;
  border: 1px solid var(--nx-glass-border-soft);
  border-radius: var(--md-sys-shape-corner-xl);
  background: var(--nx-glass-bg-soft);
  -webkit-backdrop-filter: blur(14px) saturate(1.35);
  backdrop-filter: blur(14px) saturate(1.35);
  color: var(--md-sys-color-on-surface);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  transition:
    background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
    border-color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
    box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
  -webkit-tap-highlight-color: transparent;
}
.sub-item:hover {
  background: var(--nx-glass-bg);
  border-color: var(--nx-glass-border);
}
.sub-item:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 1px;
}
.sub-item:active {
  background: var(--nx-glass-bg-strong);
}
.sub-item.active {
  background: color-mix(in srgb, var(--md-sys-color-primary) 26%, var(--nx-glass-bg-strong));
  border-color: color-mix(in srgb, var(--md-sys-color-primary) 55%, white);
  color: var(--md-sys-color-on-surface);
  box-shadow: 0 8px 24px rgba(33, 155, 239, 0.28);
}
.sub-item.active .sub-index {
  background: linear-gradient(160deg, var(--nx-accent-soft), var(--nx-accent));
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}
.sub-item.active .sub-desc {
  color: color-mix(in srgb, var(--md-sys-color-on-surface) 78%, transparent);
}
.sub-item.active .sub-chevron {
  color: var(--md-sys-color-primary);
  opacity: 1;
}

.sub-index {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--md-sys-shape-corner-full);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.4px;
  font-variant-numeric: tabular-nums;
  background: var(--nx-glass-bg-strong);
  border: 1px solid var(--nx-glass-border);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--md-sys-color-on-surface-variant);
}
.sub-text-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 1px;
}
.sub-text {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  letter-spacing: 0.1px;
  display: block;
  overflow: visible;
  word-break: break-word;
}
.sub-desc {
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: 0.2px;
  color: var(--md-sys-color-on-surface-variant);
  /* Full vorspann — never CSS-clamp mid-sentence */
  display: block;
  overflow: visible;
  word-break: break-word;
  white-space: normal;
}
.sub-chevron {
  flex-shrink: 0;
  font-size: 20px;
  margin-top: 6px;
  color: var(--md-sys-color-outline);
  opacity: 0.7;
}

/* ── Preview card — strong frosted glass (main subtopic panel) ── */
.story-card {
  position: relative;
  border-radius: var(--md-sys-shape-corner-3xl);
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(32px) saturate(1.75);
  backdrop-filter: blur(32px) saturate(1.75);
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow:
    var(--nx-glass-shadow-lg),
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
  color: var(--md-sys-color-on-surface);
  min-height: 420px;
  isolation: isolate;
  transition:
    opacity var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard),
    box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
    border-color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}
.story-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.18) 0%, transparent 42%),
    radial-gradient(ellipse 80% 50% at 80% 0%, rgba(33, 155, 239, 0.18), transparent 55%);
  pointer-events: none;
  z-index: 0;
}
.story-card > * {
  position: relative;
  z-index: 1;
}
.story-card.fading { opacity: 0.55; }
.story-card:hover {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow:
    var(--nx-glass-shadow-lg),
    0 0 0 1px rgba(33, 155, 239, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

/* Empty state — transparent so parent story-card frost shows */
.story-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 420px;
  padding: 40px 28px;
  background: transparent;
}
.story-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--md-sys-shape-corner-full);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  color: var(--md-sys-color-primary);
  box-shadow:
    var(--nx-glass-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.story-empty-icon i { font-size: 32px; }
.story-empty-title {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 28px;
  font-weight: 400;
  color: var(--md-sys-color-on-surface);
}
.story-empty-body {
  margin: 0;
  max-width: 320px;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.25px;
  color: var(--md-sys-color-on-surface-variant);
}

.story-preview { display: flex; flex-direction: column; min-height: 100%; }
.story-preview[hidden] { display: none !important; }
.story-empty[hidden] { display: none !important; }

.story-card-top {
  padding: 24px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: 1px solid var(--nx-glass-border, rgba(255, 255, 255, 0.12));
}

.story-hero {
  position: relative;
  aspect-ratio: 16/8;
  min-height: 160px;
  background:
    radial-gradient(ellipse 70% 90% at 75% 20%, color-mix(in srgb, var(--md-sys-color-primary) 22%, transparent), transparent 60%),
    rgba(255, 255, 255, 0.04);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}
.story-hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06) 0%,
    transparent 40%,
    rgba(5, 6, 15, 0.45) 100%
  );
  z-index: 1;
  pointer-events: none;
}
.story-hero-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  z-index: 0;
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-standard);
  /* Keep hero image soft so glass still reads */
  filter: saturate(1.05) brightness(0.85);
}
.story-hero-img.loaded { opacity: 0.85; }
.story-hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}
.story-hero-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--nx-glass-bg-strong);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--md-sys-color-on-surface);
  border: 1px solid var(--nx-glass-border);
  box-shadow: var(--nx-glass-shadow);
}
.story-hero-step i { font-size: 13px; }

.story-body {
  padding: 20px 24px 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
  background: transparent;
}
.story-badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.story-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--md-sys-shape-corner-full);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--md-sys-color-primary) 22%, var(--nx-glass-bg));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--nx-glass-border);
  color: var(--md-sys-color-on-surface);
}
.story-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--md-sys-color-primary);
}
.story-badge-muted {
  background: var(--nx-glass-bg-soft);
  color: var(--md-sys-color-on-surface-variant);
  border: 1px solid var(--nx-glass-border-soft);
}
.story-badge-muted .dot { display: none; }
.story-title {
  font-family: var(--md-sys-typescale-brand);
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 10px;
  font-variation-settings: 'opsz' 24;
}
.story-desc {
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.25px;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 16px;
  max-width: 560px;
}
.story-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.story-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--md-sys-shape-corner-full);
  border: 1px solid var(--nx-glass-border);
  background: var(--nx-glass-bg-soft);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: var(--md-sys-color-on-surface-variant);
}
.story-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding-top: 8px;
}
.story-actions .btn {
  min-height: 48px;
  padding: 0 28px;
}
.story-actions-hint {
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.4px;
  color: var(--md-sys-color-on-surface-variant);
}

/* ════════════════════════════════════════════════════════
   STORY PAGE (story.html) — round glass orbs + reading panels
   ════════════════════════════════════════════════════════ */

.explore-page {
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: transparent;
}

.bubble-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(88px + var(--safe-bottom));
}

.story-section {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ── Round segment hero bubble ── */
.story-bubble {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 16px 32px;
  overflow: hidden;
}

.story-orb {
  position: relative;
  width: min(96vw, 96vh, 980px);
  aspect-ratio: 1;
  max-height: 96vh;
  margin: 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.22), transparent 52%),
    linear-gradient(
      145deg,
      color-mix(in srgb, var(--bubble-accent, var(--md-sys-color-primary)) 28%, rgba(255, 255, 255, 0.12)),
      rgba(255, 255, 255, 0.08)
    );
  -webkit-backdrop-filter: blur(28px) saturate(1.7);
  backdrop-filter: blur(28px) saturate(1.7);
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -10px 28px rgba(0, 0, 0, 0.18),
    0 28px 80px rgba(0, 0, 0, 0.4),
    0 0 70px color-mix(in srgb, var(--bubble-accent, var(--md-sys-color-primary)) 22%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}
.story-section:nth-child(n) .story-orb {
  /* keep per-section accent via --bubble-accent only */
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.22), transparent 52%),
    linear-gradient(
      145deg,
      color-mix(in srgb, var(--bubble-accent, var(--md-sys-color-primary)) 28%, rgba(255, 255, 255, 0.12)),
      rgba(255, 255, 255, 0.08)
    );
}

.story-orb::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--bubble-accent, var(--md-sys-color-primary)) 38%, transparent) 0%, transparent 55%),
    radial-gradient(circle at 72% 78%, color-mix(in srgb, var(--bubble-accent, var(--md-sys-color-primary)) 22%, transparent) 0%, transparent 58%);
  z-index: 1;
  pointer-events: none;
}
.story-orb::after {
  content: '';
  position: absolute;
  top: 10%;
  left: 16%;
  width: 38%;
  height: 18%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.4), transparent 70%);
  filter: blur(1px);
  z-index: 2;
  pointer-events: none;
}

.story-orb-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  border-radius: inherit;
  z-index: 0;
  opacity: 0;
  filter: saturate(1.05) brightness(0.72);
  transition: opacity var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-standard);
}
.story-orb-img.img-loaded { opacity: 0.38; }

.story-orb-inner {
  position: relative;
  z-index: 3;
  padding: clamp(20px, 5%, 52px);
  max-width: 84%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 2vh, 22px);
  color: #fff;
  text-shadow: 0 2px 14px rgba(5, 6, 15, 0.45);
}
.story-section:nth-child(n) .story-orb-inner {
  color: #fff;
}

.story-orb-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: var(--md-sys-shape-corner-full);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: none;
  color: #fff;
}
.story-orb-title {
  font-family: var(--md-sys-typescale-brand);
  font-size: clamp(20px, 3.2vw, 36px);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: inherit;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}
.story-orb-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.82;
}
.story-orb-hint i {
  font-size: 16px;
  animation: nx-bounce 1.8s ease-in-out infinite;
}
@keyframes nx-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

/* ── Article body — full-width reading stage under each orb (not a tight nested card) ── */
.story-article {
  position: relative;
  min-height: 52vh;
  padding: 56px 28px calc(96px + var(--safe-bottom));
  background:
    linear-gradient(
      180deg,
      transparent 0%,
      color-mix(in srgb, var(--bubble-accent, var(--md-sys-color-primary)) 10%, transparent) 12%,
      transparent 26%
    ),
    rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(28px) saturate(1.55);
  backdrop-filter: blur(28px) saturate(1.55);
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 36px 36px 0 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 -12px 40px rgba(0, 0, 0, 0.18);
  color: var(--md-sys-color-on-surface);
}
.story-article-inner {
  max-width: min(920px, 100%);
  width: 100%;
  margin: 0 auto;
  padding: 8px 4px 12px;
  border-radius: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: none;
  box-shadow: none;
}
.story-article-head { margin-bottom: 28px; }
.story-article-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: var(--md-sys-shape-corner-full);
  background: color-mix(in srgb, var(--bubble-accent, var(--md-sys-color-primary)) 22%, transparent);
  color: var(--md-sys-color-on-surface);
  border: 1px solid color-mix(in srgb, var(--bubble-accent, var(--md-sys-color-primary)) 40%, white);
  margin-bottom: 12px;
}
.story-article-title {
  font-family: var(--md-sys-typescale-brand);
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.18;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--md-sys-color-on-surface);
}

.story-article-body {
  font-size: clamp(15px, 1.45vw, 18px);
  line-height: 1.75;
  letter-spacing: 0.15px;
  max-width: 68ch;
}
.story-meta-line {
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.4px;
  color: var(--md-sys-color-on-surface-variant);
  margin-top: 18px;
}
.story-article-body p {
  margin-bottom: 16px;
  color: var(--md-sys-color-on-surface-variant);
}
.story-article-body p.lead {
  font-size: clamp(16px, 1.55vw, 19px);
  line-height: 1.55;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
}
.story-article-body h2,
.story-article-body .hg-headline {
  font-family: var(--md-sys-typescale-brand);
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 600;
  margin: 28px 0 12px;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--md-sys-color-on-surface);
}
.story-article-body h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 20px 0 8px;
  color: var(--md-sys-color-on-surface);
}
.story-article-body ul {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.story-article-body li {
  position: relative;
  padding: 8px 0 8px 22px;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.55;
}
.story-article-body li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 15px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bubble-accent, var(--md-sys-color-primary));
}

/* Chapters — default (legacy mit Media) */
.chapter {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: start;
  padding: 16px 0;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  opacity: 1;
  transform: none;
  transition:
    opacity var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-standard),
    transform var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-standard);
}
@media (prefers-reduced-motion: no-preference) {
  .chapter:not(.in-view) {
    opacity: 0.92;
  }
}
.chapter:first-of-type { border-top: none; }
.chapter.in-view { opacity: 1; transform: translateY(0); }
.chapter-media {
  aspect-ratio: 4/3;
  border-radius: var(--md-sys-shape-corner-md);
  background-size: cover;
  background-position: center;
  background-color: var(--md-sys-color-surface-container-high);
  border: none;
  box-shadow: none;
}
/* Kontext: rein textuell, mehr Lesefläche */
.chapter.chapter-text-only {
  display: block;
  grid-template-columns: none;
  padding: 18px 0;
}
.chapter.chapter-text-only .chapter-title {
  font-size: 17px;
  line-height: 24px;
  margin-bottom: 8px;
}
.chapter.chapter-text-only p {
  font-size: 15px;
  line-height: 24px;
  color: var(--md-sys-color-on-surface);
  max-width: 62ch;
}
.story-orb.is-text-only .story-orb-img {
  display: none;
}
.story-orb.is-text-only {
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.2), transparent 52%),
    radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--bubble-accent, var(--md-sys-color-primary)) 34%, transparent), transparent 58%),
    rgba(255, 255, 255, 0.08);
}
.story-section.is-text-only .story-orb-img {
  opacity: 0;
  background-image: none !important;
}
.chapter-era {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--md-sys-color-primary);
  margin-bottom: 4px;
}
.chapter-title {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--md-sys-color-on-surface);
}
.chapter p {
  font-size: 14px;
  line-height: 20px;
  color: var(--md-sys-color-on-surface-variant);
  margin: 0;
}
@media (max-width: 640px) {
  .chapter { grid-template-columns: 1fr; }
  .chapter-media { aspect-ratio: 16/9; }
  .chapter.chapter-text-only p { font-size: 15px; line-height: 23px; }
}
.hg-closing {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: var(--md-sys-shape-corner-xl);
  background: var(--nx-glass-bg);
  -webkit-backdrop-filter: var(--nx-glass-blur);
  backdrop-filter: var(--nx-glass-blur);
  border: 1px solid var(--nx-glass-border);
  border-left: 3px solid var(--md-sys-color-primary);
  font-style: italic;
  color: var(--md-sys-color-on-surface);
  box-shadow: var(--nx-glass-shadow);
}
.story-pending {
  margin: 12px 0;
  padding: 14px 16px;
  border-radius: var(--md-sys-shape-corner-xl);
  background: var(--nx-glass-bg);
  -webkit-backdrop-filter: var(--nx-glass-blur);
  backdrop-filter: var(--nx-glass-blur);
  border: 1px solid var(--nx-glass-border);
  color: var(--md-sys-color-on-surface-variant);
  font-size: 14px;
  line-height: 20px;
  box-shadow: var(--nx-glass-shadow);
}

/* Tips */
.tips-box {
  margin: 18px 0;
  padding: 16px 18px;
  border-radius: var(--md-sys-shape-corner-xl);
  background: color-mix(in srgb, var(--md-sys-color-secondary) 18%, var(--nx-glass-bg));
  -webkit-backdrop-filter: var(--nx-glass-blur);
  backdrop-filter: var(--nx-glass-blur);
  color: var(--md-sys-color-on-surface);
  border: 1px solid var(--nx-glass-border);
  box-shadow: var(--nx-glass-shadow);
}
.tips-title {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 10px;
  opacity: 0.9;
}
.tips-box ul { margin: 0; padding: 0; list-style: none; }
.tips-box li {
  position: relative;
  padding: 6px 0 6px 28px;
  font-size: 14px;
  color: inherit;
}
.tips-box li::before {
  content: 'check';
  font-family: 'Material Symbols Rounded';
  position: absolute;
  left: 0;
  top: 4px;
  font-size: 18px;
  color: inherit;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Service + optional Debatte */
.service-debate {
  margin: 24px 0 8px;
  padding: 16px;
  border-radius: var(--md-sys-shape-corner-xl);
  background: var(--nx-glass-bg);
  -webkit-backdrop-filter: var(--nx-glass-blur);
  backdrop-filter: var(--nx-glass-blur);
  box-shadow: var(--nx-glass-shadow);
  border: 1px solid var(--nx-glass-border);
}
.service-debate-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1px;
  color: var(--md-sys-color-on-surface);
}
.service-debate-title .material-symbols-rounded {
  font-size: 20px;
  color: var(--md-sys-color-primary);
}
.service-debate-intro {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 20px;
  color: var(--md-sys-color-on-surface-variant);
}
.service-debate-points {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}
.service-debate-points li {
  position: relative;
  padding: 8px 0 8px 22px;
  font-size: 14px;
  line-height: 20px;
  color: var(--md-sys-color-on-surface-variant);
}
.service-debate-points li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 15px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--md-sys-color-primary);
}

/* Debate cards */
.debate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0 0;
}
.debate-card {
  padding: 16px;
  border-radius: var(--md-sys-shape-corner-xl);
  background: var(--nx-glass-bg);
  -webkit-backdrop-filter: var(--nx-glass-blur);
  backdrop-filter: var(--nx-glass-blur);
  border: 1px solid var(--nx-glass-border);
  box-shadow: var(--nx-glass-shadow);
}
.debate-card.pro {
  background: color-mix(in srgb, var(--md-sys-color-tertiary) 18%, var(--nx-glass-bg));
}
.debate-card.contra {
  background: color-mix(in srgb, var(--md-sys-color-error) 18%, var(--nx-glass-bg));
  color: var(--md-sys-color-on-surface);
}
.debate-card h3 {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.debate-card p { font-size: 14px; line-height: 1.5; margin: 0; }
@media (max-width: 640px) {
  .debate-grid { grid-template-columns: 1fr; }
}

/* Sources */
.sources-block {
  margin-top: 24px;
  padding: 16px;
  border-radius: var(--md-sys-shape-corner-xl);
  background: var(--nx-glass-bg);
  -webkit-backdrop-filter: var(--nx-glass-blur);
  backdrop-filter: var(--nx-glass-blur);
  box-shadow: var(--nx-glass-shadow);
  border: 1px solid var(--nx-glass-border);
}
.sources-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 8px;
}
.sources-list { display: flex; flex-direction: column; gap: 4px; }
.sources-list a {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--md-sys-color-primary);
  text-decoration: none;
  padding: 8px 0;
  border-radius: var(--md-sys-shape-corner-xs);
}
.sources-list a:hover {
  background: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent);
}
.sources-list a span {
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 400;
}

/* Loading / error — tonal */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  padding: 56px 28px;
  gap: 12px;
  color: var(--md-sys-color-on-surface-variant);
}
.loading-state.compact { padding: 32px 20px; gap: 10px; }
.loading-spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--md-sys-color-surface-container-highest);
  border-top-color: var(--md-sys-color-primary);
  box-shadow: none;
  animation: nx-spin 0.9s linear infinite;
}
.loading-spinner.sm { width: 28px; height: 28px; border-width: 2px; }
.loading-title {
  font-family: var(--md-sys-typescale-brand);
  font-size: 16px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
}
.loading-body { font-size: 14px; max-width: 320px; line-height: 20px; }
.loading-foot { font-size: 12px; letter-spacing: 0.4px; color: var(--md-sys-color-on-surface-variant); }

.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  padding: 48px 24px;
  gap: 10px;
}
.error-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
  display: grid;
  place-items: center;
  font-size: 24px;
  margin-bottom: 4px;
  box-shadow: none;
}
.error-title { font-size: 16px; font-weight: 500; color: var(--md-sys-color-on-surface); }
.error-body { font-size: 14px; color: var(--md-sys-color-on-surface-variant); max-width: 360px; }

.synapse-loader { width: 168px; height: 96px; }
.synapse-loader svg { width: 100%; height: 100%; }
.synapse-loader.compact { width: 132px; height: 76px; }
.syn-trace, .syn-bridge {
  fill: none;
  stroke: var(--md-sys-color-primary);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: syn-grow 2.8s ease-in-out infinite;
}
.syn-trace-1 { animation-delay: 0s; }
.syn-trace-2 { animation-delay: 0.18s; }
.syn-trace-3 { animation-delay: 0.36s; }
.syn-bridge { stroke: var(--md-sys-color-secondary); stroke-width: 2.5; animation-delay: 0.55s; }
@keyframes syn-grow {
  0% { stroke-dashoffset: 1; opacity: 0.35; }
  35% { stroke-dashoffset: 0; opacity: 1; }
  75%, 100% { stroke-dashoffset: 0; opacity: 0.45; }
}
.syn-source circle {
  fill: transparent;
  stroke: var(--md-sys-color-primary);
  stroke-width: 2;
  transform-origin: center;
  transform-box: fill-box;
  animation: syn-pulse 2.8s ease-in-out infinite;
}
.syn-source-2 circle { stroke: var(--md-sys-color-secondary); animation-delay: 0.15s; }
.syn-source-3 circle { stroke: var(--md-sys-color-tertiary); animation-delay: 0.3s; }
@keyframes syn-pulse {
  0%, 100% { transform: scale(0.92); opacity: 0.75; }
  20% { transform: scale(1.08); opacity: 1; }
  45% { transform: scale(1); opacity: 1; }
}
.syn-core {
  fill: var(--md-sys-color-primary-container);
  transform-origin: center;
  transform-box: fill-box;
  animation: syn-core 2.8s ease-in-out infinite;
}
@keyframes syn-core {
  0%, 58% { transform: scale(0.78); opacity: 0.5; }
  66% { transform: scale(1.14); opacity: 1; }
  78%, 100% { transform: scale(1); opacity: 1; }
}

/* ════════════════════════════════════════════════════════
   BOTTOM NAV — M3 Navigation bar (no floating shadow pill)
   ════════════════════════════════════════════════════════ */

.segment-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(8px + var(--safe-bottom));
  z-index: 950;
  padding: 8px 8px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--nx-glass-bg);
  -webkit-backdrop-filter: var(--nx-glass-blur);
  backdrop-filter: var(--nx-glass-blur);
  border: 1px solid var(--nx-glass-border);
  box-shadow: var(--nx-glass-shadow-lg);
  display: flex;
  align-items: stretch;
  gap: 0;
  justify-content: space-around;
}
.segment-bar.hidden { display: none; }

.seg-tab {
  position: relative;
  flex: 1 1 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 56px;
  min-width: 48px;
  padding: 6px 4px;
  border-radius: var(--md-sys-shape-corner-lg);
  border: none;
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.4px;
  cursor: pointer;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}
.seg-tab::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: inherit;
  background: var(--md-sys-color-on-surface);
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}
.seg-tab:hover::after { opacity: var(--md-sys-state-hover-opacity); }
.seg-tab:active::after { opacity: var(--md-sys-state-pressed-opacity); }
.seg-tab i,
.seg-tab .material-symbols-rounded,
.seg-tab span {
  position: relative;
  z-index: 1;
}
.seg-tab .material-symbols-rounded,
.seg-tab i { font-size: 24px; }
.seg-tab span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.seg-tab.active {
  color: var(--md-sys-color-on-secondary-container);
}
.seg-tab.active::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 28px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-secondary-container);
  z-index: 0;
}
.seg-tab.explored:not(.active) {
  color: var(--md-sys-color-on-surface);
}

@media (min-width: 720px) {
  .segment-bar {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(560px, calc(100% - 32px));
    bottom: calc(12px + var(--safe-bottom));
    border-radius: var(--md-sys-shape-corner-full);
    border: 1px solid var(--nx-glass-border);
    padding: 6px 8px;
  }
  .seg-tab {
    flex: 1 1 0;
    min-height: 48px;
    font-size: 12px;
  }
}

/* Mobile story / category — denser, keep round orbs */
@media (max-width: 640px) {
  .story-bubble {
    padding: 10px 10px 20px;
    min-height: 84vh;
  }
  .story-orb {
    width: min(98vw, 720px);
    aspect-ratio: 3 / 4;
    max-height: 88vh;
  }
  .story-orb-inner {
    padding: clamp(18px, 5vw, 32px);
    max-width: 86%;
  }
  .story-orb-title {
    font-size: clamp(18px, 5.4vw, 26px);
  }
  .story-article {
    min-height: 48vh;
    padding: 36px 18px calc(88px + var(--safe-bottom));
    border-radius: 28px 28px 0 0;
  }
  .story-article-inner {
    padding: 4px 2px 8px;
    max-width: 100%;
  }
  .story-article-body {
    max-width: none;
  }
  .segment-bar {
    left: 8px;
    right: 8px;
    bottom: calc(6px + var(--safe-bottom));
    background: var(--nx-glass-bg-strong);
  }
  .ai-fab {
    right: 12px;
    bottom: calc(78px + var(--safe-bottom));
  }
  .ai-panel {
    left: 10px;
    right: 10px;
    width: auto;
    bottom: calc(160px + var(--safe-bottom));
    border-radius: var(--md-sys-shape-corner-xl);
  }
  .sources-block,
  .service-debate,
  .tips-box,
  .hg-closing,
  .debate-card {
    border-radius: var(--md-sys-shape-corner-xl);
  }
  .category-hero {
    padding: 2px 0 14px;
  }
  .category-title {
    font-size: clamp(26px, 8vw, 34px);
  }
}

/* ════════════════════════════════════════════════════════
   STORY RAIL — tonal side nav (desktop)
   ════════════════════════════════════════════════════════ */

.story-rail {
  position: fixed;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  z-index: 920;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 8px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--nx-glass-bg);
  -webkit-backdrop-filter: var(--nx-glass-blur);
  backdrop-filter: var(--nx-glass-blur);
  border: 1px solid var(--nx-glass-border);
  box-shadow: var(--nx-glass-shadow);
  transition: opacity 0.25s var(--md-sys-motion-easing-standard), transform 0.25s var(--md-sys-motion-easing-standard);
}
.story-rail.is-hidden {
  opacity: 0;
  transform: translateY(-50%) translateX(12px);
  pointer-events: none;
}

.story-rail-item {
  position: relative;
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--md-sys-shape-corner-full);
}
.story-rail-orb {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--nx-glass-bg-strong);
  border: 1px solid var(--nx-glass-border);
  box-shadow: var(--nx-glass-shadow);
  overflow: hidden;
  transition:
    background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
    box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
  z-index: 1;
}
.story-rail-item:hover .story-rail-orb {
  background: var(--nx-glass-bg-strong);
  border-color: rgba(255, 255, 255, 0.35);
}
.story-rail-item.active .story-rail-orb {
  background: linear-gradient(160deg, var(--nx-accent-soft), var(--nx-accent));
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: var(--nx-elev-cta);
}
.story-rail-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--pct, 0%);
  background: var(--md-sys-color-primary);
  opacity: 0.35;
  transition: height 0.5s var(--md-sys-motion-easing-standard);
  pointer-events: none;
}
.story-rail-item.active .story-rail-fill {
  background: var(--md-sys-color-primary);
  opacity: 0.45;
  filter: none;
}
.story-rail-fill::before,
.story-rail-fill::after { display: none; }

.story-rail-icon {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 18px;
  text-shadow: none;
}
.story-rail-item.active .story-rail-icon {
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.story-rail-item.explored .story-rail-icon {
  color: var(--md-sys-color-on-surface);
  text-shadow: none;
}

.story-rail-label {
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%) translateX(4px);
  padding: 6px 12px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-inverse-surface);
  color: var(--md-sys-color-inverse-on-surface);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 2;
  box-shadow: none;
  border: none;
}
.story-rail-item:hover .story-rail-label,
.story-rail-item.active .story-rail-label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
  background: var(--md-sys-color-inverse-surface);
  border: none;
  box-shadow: none;
}

.story-rail-divider {
  width: 16px;
  height: 1px;
  margin: 2px auto;
  background: var(--md-sys-color-outline-variant);
  border-radius: 999px;
}

@media (max-width: 720px) {
  .story-rail { display: none; }
}

/* ════════════════════════════════════════════════════════
   AI ASSIST — M3 FAB + tonal panel (minimal glow)
   ════════════════════════════════════════════════════════ */

.ai-fab {
  position: fixed;
  right: 16px;
  bottom: calc(88px + var(--safe-bottom));
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}
.ai-fab > * { pointer-events: auto; }

.ai-orb {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 3;
  background: transparent;
  transition: transform 0.15s var(--md-sys-motion-easing-standard);
  flex-shrink: 0;
  box-shadow: none;
}
.ai-orb:hover { transform: scale(1.04); }
.ai-orb:focus-visible {
  outline: 2px solid var(--md-sys-color-secondary);
  outline-offset: 3px;
}

.ai-orb-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--nx-accent-soft), var(--nx-accent));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: var(--nx-elev-cta);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: none;
}
.ai-fab.open .ai-orb-face {
  background: linear-gradient(165deg, #9b8af5, var(--md-sys-color-secondary));
  color: #fff;
  box-shadow: 0 10px 28px rgba(124, 108, 240, 0.4);
}
.ai-fab.open .ai-orb-eye {
  background: var(--md-sys-color-on-primary);
  box-shadow: none;
}

.ai-orb-eye {
  width: 8px;
  height: 10px;
  background: var(--md-sys-color-on-primary-container);
  border-radius: 50%;
  box-shadow: none;
  transform-origin: center;
  animation: ai-blink 5.5s ease-in-out infinite;
}
.ai-fab.thinking .ai-orb-eye {
  animation: ai-blink 5.5s ease-in-out infinite;
}

@keyframes ai-pulse { 0%, 100% { opacity: 1; } }
@keyframes ai-float { 0%, 100% { transform: none; } }
@keyframes ai-float-active { 0%, 100% { transform: none; } }
@keyframes ai-blink {
  0%, 92%, 96%, 100% { transform: scaleY(1); }
  94% { transform: scaleY(0.08); }
}
@keyframes ai-glow { 0%, 100% { opacity: 1; } }
@keyframes ai-orbit-pop {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes ai-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-orbit {
  position: absolute;
  top: 28px;
  right: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 1;
}

.ai-orbit-btn {
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  margin-top: -22px;
  border-radius: 50%;
  border: none;
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  font-size: 18px;
  display: grid;
  place-items: center;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  box-shadow: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5);
  transition:
    left 0.28s var(--md-sys-motion-easing-emphasized-decelerate),
    top 0.28s var(--md-sys-motion-easing-emphasized-decelerate),
    opacity 0.18s ease,
    transform 0.28s var(--md-sys-motion-easing-emphasized-decelerate);
}
.ai-orbit-btn::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--md-sys-color-inverse-surface);
  color: var(--md-sys-color-inverse-on-surface);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--md-sys-shape-corner-xs);
  white-space: nowrap;
  border: none;
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.ai-orbit-btn:hover {
  background: var(--md-sys-color-secondary);
  color: var(--md-sys-color-on-secondary);
}
.ai-orbit-btn:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.ai-fab.open .ai-orbit-btn {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.ai-fab.open .ai-orbit-btn[data-mode="summary"] { left: -72px; top: -48px; transition-delay: 0.05s; }
.ai-fab.open .ai-orbit-btn[data-mode="child"]   { left: -24px; top: -88px; transition-delay: 0.03s; }
.ai-fab.open .ai-orbit-btn[data-mode="5ws"]     { left:  24px; top: -88px; transition-delay: 0.02s; }
.ai-fab.open .ai-orbit-btn[data-mode="infobox"] { left:  72px; top: -48px; transition-delay: 0s; }

.ai-pill {
  position: relative;
  align-self: flex-end;
  display: flex;
  align-items: center;
  gap: 6px;
  width: min(360px, calc(100vw - 40px - var(--safe-left) - var(--safe-right)));
  padding: 4px 4px 4px 14px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--nx-glass-bg);
  -webkit-backdrop-filter: var(--nx-glass-blur);
  backdrop-filter: var(--nx-glass-blur);
  border: 1px solid var(--nx-glass-border);
  box-shadow: var(--nx-glass-shadow);
  z-index: 2;
}
.ai-pill:focus-within {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 0;
  box-shadow: var(--nx-glass-shadow-lg);
}
.ai-pill-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--md-sys-color-on-surface);
  font: inherit;
  font-size: 14px;
  padding: 8px 0;
}
.ai-pill-input::placeholder { color: var(--md-sys-color-on-surface-variant); }
.ai-pill-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: linear-gradient(165deg, var(--nx-accent-soft), var(--nx-accent));
  color: #fff;
  font-size: 18px;
  display: grid;
  place-items: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
  box-shadow: var(--nx-elev-cta);
  transition: opacity 0.15s ease;
}
.ai-pill-send:hover { opacity: 0.92; }
.ai-pill-send:disabled { opacity: 0.38; cursor: default; }

.ai-panel {
  position: fixed;
  right: 16px;
  bottom: calc(200px + var(--safe-bottom));
  left: auto;
  width: min(380px, calc(100vw - 32px - var(--safe-left) - var(--safe-right)));
  max-height: min(50vh, 480px);
  z-index: 901;
  display: none;
  flex-direction: column;
  border-radius: var(--md-sys-shape-corner-2xl);
  background: var(--nx-glass-bg-strong);
  -webkit-backdrop-filter: var(--nx-glass-blur);
  backdrop-filter: var(--nx-glass-blur);
  border: 1px solid var(--nx-glass-border);
  box-shadow: var(--nx-glass-shadow-lg);
  color: var(--md-sys-color-on-surface);
  overflow: hidden;
  animation: ai-enter 0.25s var(--md-sys-motion-easing-emphasized-decelerate);
}
.ai-panel.visible { display: flex; }

.ai-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 8px 12px 16px;
  flex-shrink: 0;
  background: var(--nx-glass-bg-soft);
  border-bottom: 1px solid var(--nx-glass-border-soft);
}
.ai-panel-title { font-size: 14px; font-weight: 500; }
.ai-panel-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 20px;
  cursor: pointer;
  display: grid;
  place-items: center;
  -webkit-tap-highlight-color: transparent;
}
.ai-panel-close:hover {
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
}
.ai-panel-body { padding: 14px 16px; overflow-y: auto; flex: 1; }
.ai-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px 14px;
  flex-shrink: 0;
  background: var(--nx-glass-bg-soft);
  border-top: 1px solid var(--nx-glass-border-soft);
}

.ai-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--md-sys-shape-corner-full);
  border: none;
  background: transparent;
  color: var(--md-sys-color-primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ai-action:hover {
  background: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent);
}
.ai-action .material-symbols-rounded,
.ai-action i { font-size: 18px; }
.ai-action-active {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}
.ai-action-active:hover {
  background: var(--md-sys-color-secondary-container);
}

.ai-result p {
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 10px;
  color: var(--md-sys-color-on-surface);
}
.ai-result p:last-child { margin-bottom: 0; }
.ws-item {
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.ws-item:last-child { border-bottom: none; }
.ws-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--md-sys-color-primary);
}
.ws-text { font-size: 13px; line-height: 1.5; color: var(--md-sys-color-on-surface); }

.ai-infobox {
  display: flex;
  flex-direction: column;
  border: none;
  border-radius: var(--md-sys-shape-corner-md);
  overflow: hidden;
  background: var(--md-sys-color-surface-container-high);
  box-shadow: none;
}
.ai-infobox-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  align-items: baseline;
}
.ai-infobox-row:last-child { border-bottom: none; }
.ai-infobox-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--md-sys-color-on-surface-variant);
}
.ai-infobox-value {
  font-size: 13px;
  line-height: 1.5;
  color: var(--md-sys-color-on-surface);
  word-break: break-word;
}

.ai-error {
  color: var(--md-sys-color-error);
  font-size: 14px;
}

/* chat bubbles in panel */
.ai-chat-msg {
  padding: 10px 12px;
  border-radius: var(--md-sys-shape-corner-md);
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: none;
}
.ai-chat-msg.user {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  margin-left: 24px;
}
.ai-chat-msg.assistant {
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  margin-right: 12px;
}

/* ════════════════════════════════════════════════════════
   DATEN DASHBOARD — overview layout + viz tiles
   ════════════════════════════════════════════════════════ */
/* ── DATEN BODY ── */
.daten-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.daten-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 8px 0;
}
.daten-highlight-item {
  background: var(--nx-glass-bg-soft);
  border: 1px solid var(--nx-glass-border);
  border-radius: var(--md-sys-shape-corner-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.daten-highlight-val {
  font-size: 24px;
  font-weight: 700;
  color: var(--md-sys-color-primary-fixed);
  line-height: 1.1;
}
.daten-highlight-val span {
  font-size: 14px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  margin-left: 4px;
}
.daten-highlight-lbl {
  font-size: 13px;
  color: var(--md-sys-color-on-surface);
  line-height: 1.3;
}
.daten-highlight-trend {
  font-size: 12px;
  font-weight: 600;
  color: #4CAF50;
  margin-top: 4px;
}
.daten-dashboard {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.daten-dash-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.daten-dash-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.daten-dash-kicker .material-symbols-rounded {
  font-size: 16px;
}
.daten-intro {
  font-size: 15px;
  line-height: 22px;
  letter-spacing: 0.25px;
  color: var(--md-sys-color-on-surface-variant);
  margin: 0;
  max-width: 640px;
}
.daten-section-label {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--md-sys-color-on-surface-variant);
}
.daten-featured,
.daten-kpi,
.daten-viz {
  display: flex;
  flex-direction: column;
}
.daten-featured .dv-block--featured,
.daten-featured .dv-skin-callout,
.daten-featured .dv-skin-bigstat,
.daten-featured .dv-skin-comparison,
.daten-featured .dv-skin-versus {
  min-height: 180px;
  padding: 22px 20px;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--vc, var(--md-sys-color-primary)) 18%, var(--md-sys-color-surface-container-low)),
      var(--md-sys-color-surface-container-low) 55%);
}
.daten-featured .dv-callout-num,
.daten-featured .dv-bigstat-num,
.daten-featured .dv-comparison-value,
.daten-featured .dv-versus-val {
  font-size: clamp(44px, 8vw, 72px);
}
.daten-foot {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--md-sys-shape-corner-md);
  background: var(--md-sys-color-surface-container);
}
.daten-foot .material-symbols-rounded {
  font-size: 18px;
  color: var(--md-sys-color-on-surface-variant);
  flex-shrink: 0;
  margin-top: 1px;
}
.daten-source {
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.4px;
  color: var(--md-sys-color-on-surface-variant);
  margin: 0;
}

/* Mosaic grid: mixed tile sizes for visual variety */
.dv-dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.dv-dash-grid--mosaic {
  gap: 14px;
}
@media (min-width: 720px) {
  .dv-dash-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .dv-dash-grid--mosaic {
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
  }
  .dv-dash-grid--mosaic > .dv-cell {
    grid-column: span 3;
  }
  .dv-dash-grid--mosaic > .dv-cell--wide {
    grid-column: 1 / -1;
  }
  .dv-dash-grid--mosaic > .dv-cell--tall {
    grid-row: span 1;
  }
  .dv-dash-grid--mosaic > .dv-cell--versus,
  .dv-dash-grid--mosaic > .dv-cell--statpair,
  .dv-dash-grid--mosaic > .dv-cell--comparison {
    grid-column: span 3;
  }
  .dv-dash-grid--mosaic > .dv-cell--donut,
  .dv-dash-grid--mosaic > .dv-cell--scale,
  .dv-dash-grid--mosaic > .dv-cell--proportional {
    grid-column: span 2;
  }
  .dv-dash-grid--mosaic > .dv-cell--ranking,
  .dv-dash-grid--mosaic > .dv-cell--sparkline {
    grid-column: span 4;
  }
  .dv-cell--wide {
    grid-column: 1 / -1;
  }
}
.dv-cell {
  min-width: 0;
  display: flex;
}
.dv-cell .dv-block {
  width: 100%;
  height: 100%;
}
.dv-type-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  margin-bottom: 6px;
  border-radius: var(--md-sys-shape-corner-full);
  background: color-mix(in srgb, var(--vc, var(--md-sys-color-primary)) 16%, transparent);
  color: color-mix(in srgb, var(--vc, var(--md-sys-color-primary)) 85%, var(--md-sys-color-on-surface));
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

/* Per-type skins — each visual should feel distinct */
.dv-skin-callout,
.dv-skin-bigstat {
  background: color-mix(in srgb, var(--vc, var(--md-sys-color-primary)) 12%, var(--md-sys-color-surface-container-low));
}
.dv-skin-versus {
  background: var(--md-sys-color-surface-container-lowest);
  border: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 70%, transparent);
}
.dv-skin-timeline {
  background: transparent;
  padding-left: 8px;
  border-left: 3px solid var(--vc, var(--md-sys-color-primary));
  border-radius: 0 var(--md-sys-shape-corner-xl) var(--md-sys-shape-corner-xl) 0;
}
.dv-skin-timeline .dv-accent { display: none; }
.dv-skin-comparison {
  background:
    radial-gradient(circle at 12% 20%, color-mix(in srgb, var(--vc) 22%, transparent), transparent 42%),
    var(--md-sys-color-surface-container-low);
}
.dv-skin-proportional {
  background:
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 10px,
      color-mix(in srgb, var(--vc) 6%, transparent) 10px,
      color-mix(in srgb, var(--vc) 6%, transparent) 11px
    ),
    var(--md-sys-color-surface-container-low);
}
.dv-skin-table {
  background: var(--md-sys-color-surface-container-lowest);
  padding: 12px 10px 8px;
}
.dv-skin-ranking {
  background: var(--md-sys-color-surface-container);
}
.dv-skin-donut {
  background: var(--md-sys-color-surface-container-high);
}
.dv-skin-sparkline {
  background: linear-gradient(180deg, color-mix(in srgb, var(--vc) 10%, transparent), var(--md-sys-color-surface-container-low));
}
.dv-skin-statpair {
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
}
.dv-skin-statpair .dv-title,
.dv-skin-statpair .dv-statpair-val,
.dv-skin-statpair .dv-statpair-lbl {
  color: inherit;
}
.dv-skin-statpair .dv-statpair-item {
  background: color-mix(in srgb, var(--md-sys-color-on-tertiary-container) 8%, transparent);
}
.dv-skin-scale {
  background: var(--md-sys-color-surface-container-low);
}
.dv-skin-bar {
  background: var(--md-sys-color-surface-container);
}

/* legacy alias */
.daten-wrap { display: contents; }
.dv-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dv-block {
  --vc: var(--md-sys-color-primary);
  padding: 16px;
  border-radius: var(--md-sys-shape-corner-2xl);
  background: var(--nx-glass-bg);
  -webkit-backdrop-filter: var(--nx-glass-blur);
  backdrop-filter: var(--nx-glass-blur);
  border: 1px solid var(--nx-glass-border);
  box-shadow: var(--nx-glass-shadow);
  overflow: hidden;
  box-sizing: border-box;
}
.dv-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.dv-accent {
  width: 4px;
  min-height: 28px;
  border-radius: 999px;
  flex-shrink: 0;
  background: var(--vc, var(--md-sys-color-primary));
  margin-top: 2px;
}
.dv-title {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  letter-spacing: 0.15px;
  color: var(--md-sys-color-on-surface);
}
.dv-caption {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--md-sys-color-on-surface-variant);
}
.dv-meta {
  margin: 6px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.4px;
  color: var(--md-sys-color-on-surface-variant);
}
.dv-est {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
  font-weight: 500;
}

/* KPI strip — horizontal scroll on narrow, grid on wide */
.dv-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 480px) {
  .dv-highlights {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .dv-highlights::-webkit-scrollbar { display: none; }
  .dv-hl-card {
    flex: 0 0 min(72vw, 200px);
    scroll-snap-align: start;
  }
}
@media (min-width: 720px) {
  .dv-highlights {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (min-width: 900px) {
  .dv-highlights {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}
.dv-hl-card {
  --hl-color: var(--md-sys-color-primary);
  padding: 14px;
  border-radius: var(--md-sys-shape-corner-xl);
  background: var(--nx-glass-bg);
  -webkit-backdrop-filter: var(--nx-glass-blur);
  backdrop-filter: var(--nx-glass-blur);
  border: 1px solid var(--nx-glass-border);
  box-shadow: var(--nx-glass-shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 100px;
  border-top: 3px solid var(--hl-color);
}
.dv-hl-card:nth-child(odd) {
  border-radius: var(--md-sys-shape-corner-xl) var(--md-sys-shape-corner-sm) var(--md-sys-shape-corner-xl) var(--md-sys-shape-corner-sm);
}
.dv-hl-card:nth-child(even) {
  border-radius: var(--md-sys-shape-corner-sm) var(--md-sys-shape-corner-xl) var(--md-sys-shape-corner-sm) var(--md-sys-shape-corner-xl);
}
.dv-hl-value {
  font-family: var(--md-sys-typescale-brand);
  font-size: 28px;
  line-height: 1.1;
  font-weight: 400;
  color: var(--hl-color);
  font-variant-numeric: tabular-nums;
}
.dv-hl-unit {
  font-size: 14px;
  color: var(--md-sys-color-on-surface-variant);
  margin-left: 4px;
  font-weight: 400;
}
.dv-hl-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
}
.dv-hl-trend .material-symbols-rounded { font-size: 16px; }
.dv-hl-trend.up { color: #386a20; }
.dv-hl-trend.down { color: var(--md-sys-color-error); }
.dv-hl-label {
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  margin-top: auto;
}
.dv-hl-note {
  font-size: 11px;
  line-height: 14px;
  color: var(--md-sys-color-on-surface-variant);
}

/* Comparison (analogy icons) */
.dv-comparison {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dv-comparison-num {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.dv-comparison-value {
  font-family: var(--md-sys-typescale-brand);
  font-size: clamp(32px, 6vw, 48px);
  font-weight: 400;
  line-height: 1;
  color: var(--md-sys-color-on-surface);
  font-variant-numeric: tabular-nums;
}
.dv-comparison-unit {
  font-size: 16px;
  color: var(--md-sys-color-on-surface-variant);
}
.dv-comparison-analogy {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--md-sys-color-on-surface-variant);
}
.dv-comparison-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--vc, var(--md-sys-color-primary));
}
.dv-comp-icon {
  font-size: 28px !important;
  opacity: 0.9;
}

/* Proportional grid */
.dv-proportional {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dv-prop-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 10), minmax(0, 1fr));
  gap: 6px;
  max-width: 420px;
}
.dv-prop-cell {
  aspect-ratio: 1;
  border-radius: var(--md-sys-shape-corner-xs);
  background: var(--md-sys-color-surface-container-highest);
}
.dv-prop-cell.is-filled {
  background: var(--vc, var(--md-sys-color-primary));
}
.dv-prop-label {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
}
.dv-prop-empty {
  font-weight: 400;
  color: var(--md-sys-color-on-surface-variant);
}

/* Table */
.dv-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  padding: 0 4px;
}
.dv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.4;
}
.dv-table th,
.dv-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  vertical-align: top;
}
.dv-table th {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--md-sys-color-on-surface-variant);
  background: var(--md-sys-color-surface-container);
}
.dv-table td {
  color: var(--md-sys-color-on-surface);
}
.dv-table tr:last-child td { border-bottom: none; }
.dv-table tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--md-sys-color-surface-container) 55%, transparent);
}

/* Stat pair */
.dv-statpair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.dv-statpair-item {
  padding: 14px;
  border-radius: var(--md-sys-shape-corner-lg);
  background: var(--md-sys-color-surface-container);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dv-statpair-val {
  font-family: var(--md-sys-typescale-brand);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.1;
  color: var(--md-sys-color-on-surface);
  font-variant-numeric: tabular-nums;
}
.dv-statpair-val small {
  font-size: 13px;
  color: var(--md-sys-color-on-surface-variant);
  margin-left: 4px;
}
.dv-statpair-lbl {
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
}
.dv-statpair-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 10px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
}
.dv-statpair-delta.up { color: #386a20; }
.dv-statpair-delta.down { color: var(--md-sys-color-error); }
.dv-statpair-delta .material-symbols-rounded { font-size: 18px; }

.dv-bar-list { display: flex; flex-direction: column; gap: 12px; }
.dv-bar-item { display: flex; flex-direction: column; gap: 6px; }
.dv-bar-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--md-sys-color-on-surface-variant);}
.dv-bar-head strong { color: var(--md-sys-color-on-surface);font-variant-numeric: tabular-nums; font-weight: 600; }
.dv-bar-track {
  height: 8px;
  border-radius: 999px;
  background: var(--md-sys-color-surface-container-highest);
  overflow: hidden;
}
.dv-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--vc, var(--md-sys-color-primary));
  transition: width 0.8s var(--md-sys-motion-easing-standard);
  box-shadow: none;
}
.dv-bar-note { font-size: 11px; color: var(--md-sys-color-on-surface-variant);}

.dv-donut-layout { display: grid; grid-template-columns: minmax(140px, 200px) 1fr; gap: 18px; align-items: center; }
.dv-donut {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 10px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--vc, #fff) 18%, transparent) inset;
}
.dv-donut-hole {
  position: absolute; inset: 10px;
  background: var(--md-sys-color-surface-container-lowest);
  border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  padding: 8px;
}
.dv-donut-num {
  display: block;
  font-family: var(--md-sys-typescale-brand);
  font-size: 22px; font-weight: 500; color: var(--md-sys-color-on-surface);line-height: 1;
}
.dv-donut-lbl { display: block; font-size: 11px; color: var(--md-sys-color-on-surface-variant); margin-top: 4px; }
.dv-legend { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.dv-legend li { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.dv-legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.dv-legend-label { flex: 1; color: var(--md-sys-color-on-surface-variant);}
.dv-legend-value { color: var(--md-sys-color-on-surface);font-weight: 600; font-variant-numeric: tabular-nums; }

@media (max-width: 560px) {
  .dv-donut-layout { grid-template-columns: 1fr; }
  .dv-donut { max-width: 200px; margin: 0 auto; }
}

.dv-ranking { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.dv-rank-item { display: flex; align-items: center; gap: 12px; }
.dv-rank-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  color: var(--md-sys-color-on-surface-variant);background: var(--md-sys-color-surface-container-high);
  border: none;
  flex-shrink: 0;
}
.dv-rank-num.gold {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: none;
  border: none;
}
.dv-rank-body { flex: 1; min-width: 0; }
.dv-rank-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.dv-rank-head > span:first-child { color: var(--md-sys-color-on-surface);font-weight: 500; }
.dv-rank-value { color: var(--md-sys-color-on-surface);font-weight: 600; font-variant-numeric: tabular-nums; }
.dv-rank-value small { color: var(--md-sys-color-on-surface-variant);font-weight: 400; font-size: 11px; }

.dv-spark { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.dv-spark-current { display: flex; flex-direction: column; gap: 4px; }
.dv-spark-num { font-family: var(--md-sys-typescale-brand); font-size: 26px; font-weight: 500; color: var(--md-sys-color-on-surface);line-height: 1; }
.dv-spark-unit { font-size: 12px; color: var(--md-sys-color-on-surface-variant);}
.dv-spark-chart { width: 100%; height: 60px; display: block; }
@media (max-width: 480px) {
  .dv-spark { grid-template-columns: 1fr; }
}

.dv-bigstat { text-align: left; padding: 8px 0; }
.dv-bigstat-num {
  font-family: var(--md-sys-typescale-brand);
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1;
  font-weight: 500;
  color: var(--vc, var(--md-sys-color-on-surface));
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.dv-bigstat-unit { font-size: 16px; color: var(--md-sys-color-on-surface-variant);margin-left: 6px; }
.dv-bigstat-context { font-size: 13px; color: var(--md-sys-color-on-surface-variant);margin-top: 8px; max-width: 540px; }

.dv-timeline { list-style: none; display: flex; flex-direction: column; gap: 12px; position: relative; }
.dv-timeline::before {
  content: '';
  position: absolute;
  left: 6px; top: 4px; bottom: 4px;
  width: 1px;
  background: color-mix(in srgb, var(--vc, var(--md-sys-color-on-surface)) 16%, transparent);
  border-radius: 999px;
}
.dv-timeline-item { display: grid; grid-template-columns: 80px 1fr; gap: 12px; align-items: start; padding-left: 24px; position: relative; }
.dv-timeline-item::before {
  content: '';
  position: absolute;
  left: 0; top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--vc, var(--md-sys-color-primary));
  box-shadow: none;
  border: 2px solid var(--md-sys-color-surface-container-low);
}
.dv-timeline-date { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: color-mix(in srgb, var(--vc, var(--md-sys-color-on-surface)) 60%, var(--md-sys-color-on-surface)); padding-top: 2px; }
.dv-timeline-body strong { display: block; color: var(--md-sys-color-on-surface);font-weight: 500; font-size: 14px; margin-bottom: 3px; }
.dv-timeline-body p { font-size: 13px; color: var(--md-sys-color-on-surface-variant);line-height: 1.5; margin: 0; }

.dv-versus {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
}
.dv-versus-side {
  text-align: center;
  padding: 14px 12px;
  border-radius: var(--md-sys-shape-corner-lg);
  background: var(--md-sys-color-surface-container);
  border: none;
  box-shadow: none;
}
.dv-versus-side:first-child {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}
.dv-versus-side:last-child {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}
.dv-versus-side:first-child .dv-versus-lbl,
.dv-versus-side:first-child .dv-versus-unit,
.dv-versus-side:last-child .dv-versus-lbl,
.dv-versus-side:last-child .dv-versus-unit {
  color: inherit;
  opacity: 0.8;
}
.dv-versus-side:first-child .dv-versus-val,
.dv-versus-side:last-child .dv-versus-val {
  color: inherit;
}
.dv-versus-lbl { display: block; font-size: 11px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--md-sys-color-on-surface-variant);margin-bottom: 4px; }
.dv-versus-val { display: block; font-family: var(--md-sys-typescale-brand); font-size: 22px; font-weight: 500; color: var(--md-sys-color-on-surface);}
.dv-versus-unit { display: block; font-size: 11px; color: var(--md-sys-color-on-surface-variant);margin-top: 2px; }
.dv-versus-div { display: flex; align-items: center; justify-content: center; }
.dv-versus-div span {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--md-sys-color-on-surface-variant);padding: 4px 8px;
  border-radius: 999px;
  background: var(--md-sys-color-surface-container-high);
}

.dv-scale-num { font-family: var(--md-sys-typescale-brand); font-size: 30px; font-weight: 500; color: var(--md-sys-color-on-surface);}
.dv-scale-num span { font-size: 14px; color: var(--md-sys-color-on-surface-variant);margin-left: 4px; }
.dv-scale-lbl { font-size: 12px; color: var(--md-sys-color-on-surface-variant);margin: 4px 0 12px; }
.dv-scale-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--md-sys-color-surface-variant);
  overflow: visible;
}
.dv-scale-marker {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px; height: 16px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 3px solid var(--md-sys-color-surface-container-low);
  box-shadow: none;
  transition: left 0.8s var(--md-sys-motion-easing-standard);
}
.dv-scale-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--md-sys-color-on-surface-variant);margin-top: 8px; }

.dv-callout { text-align: left; }
.dv-callout-inner {
  padding: 8px 0 0;
}
.dv-callout-num {
  font-family: var(--md-sys-typescale-brand);
  font-size: clamp(36px, 6vw, 52px);
  font-weight: 400;
  color: var(--md-sys-color-on-surface);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.dv-callout-num span {
  font-size: 16px;
  color: var(--md-sys-color-on-surface-variant);
  margin-left: 6px;
  font-weight: 400;
}
.dv-callout-inner p {
  font-size: 14px;
  line-height: 20px;
  color: var(--md-sys-color-on-surface-variant);
  margin-top: 10px;
  max-width: 520px;
}

/* Prevent flash: hide story until first paint of body */
.story-article-body { opacity: 1; }
.story-article-body > * { animation: dv-in 0.5s var(--ease-glass) both; }
.story-article-body > *:nth-child(1) { animation-delay: 0.02s; }
.story-article-body > *:nth-child(2) { animation-delay: 0.06s; }
.story-article-body > *:nth-child(3) { animation-delay: 0.10s; }
.story-article-body > *:nth-child(4) { animation-delay: 0.14s; }
.story-article-body > *:nth-child(5) { animation-delay: 0.18s; }
.story-article-body > *:nth-child(6) { animation-delay: 0.22s; }
.story-article-body > *:nth-child(7) { animation-delay: 0.26s; }
@keyframes dv-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .story-article-body > * { animation: none !important; }
}

/* Better bubble grid responsive */
@media (max-width: 640px) {
  .bubble { width: 125px; height: 125px; }
  .bubble--fixed { width: 145px; height: 145px; }
  .bubble--dynamic { width: 110px; height: 110px; }
  .bubble-icon { width: 30px; height: 30px; font-size: 16px; }
  .bubble-title { font-size: 12px; }
  .bubble-grid { gap: 18px 20px; padding: 28px 16px; }
}
@media (max-width: 400px) {
  .bubble { width: 110px; height: 110px; }
  .bubble--fixed { width: 125px; height: 125px; }
  .bubble--dynamic { width: 95px; height: 95px; }
}

/* ════════════════════════════════════════════════════════
   3D BUBBLE LABELS (CSS2D)
   ════════════════════════════════════════════════════════ */

.bubble3d-label {
  --accent: #219bef;
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 16px 10px;
  min-width: 110px;
  max-width: 200px;
  border-radius: 22px;
  background: var(--nx-glass-bg);
  -webkit-backdrop-filter: var(--nx-glass-blur);
  backdrop-filter: var(--nx-glass-blur);
  border: 1px solid var(--nx-glass-border);
  box-shadow: var(--nx-glass-shadow);
  color: var(--md-sys-color-on-surface);
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform var(--md-sys-motion-duration-short) var(--ease-glass-spring),
    background var(--md-sys-motion-duration-short) var(--ease-glass),
    box-shadow var(--md-sys-motion-duration-short) var(--ease-glass),
    opacity var(--md-sys-motion-duration-medium) var(--ease-glass);
  pointer-events: auto;
}

/* Hidden by default — only shown on hover, like visionOS app names */
.bubble3d-label.is-hidden {
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  pointer-events: none;
}
.bubble3d-label::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 18%;
  right: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  border-radius: 999px;
  pointer-events: none;
}
.bubble3d-label.is-hovered {
  transform: translateY(-4px) scale(1.06);
  background: var(--nx-glass-bg-strong);
  box-shadow: var(--nx-glass-shadow-lg);
  border-color: color-mix(in srgb, var(--accent) 50%, white);
}
.bubble3d-label.is-active {
  animation: bubble-tap 0.4s var(--ease-glass-spring);
}
@keyframes bubble-tap {
  0% { transform: scale(1); }
  40% { transform: scale(0.94); }
  100% { transform: scale(1); }
}

.bubble3d-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1px;
  color: var(--md-sys-color-on-surface);
  text-shadow: none;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bubble3d-name > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.bubble3d-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(160deg,
    color-mix(in srgb, var(--accent) 55%, white),
    color-mix(in srgb, var(--accent) 70%, transparent));
  font-size: 13px;
  flex-shrink: 0;
  color: var(--md-sys-color-on-surface);
  box-shadow:
    0 4px 10px color-mix(in srgb, var(--accent) 35%, transparent),
    inset 1px 1px 3px rgba(255, 255, 255, 0.55);
}
.bubble3d-sub {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--md-sys-color-on-surface-variant);}
.bubble3d-label.is-dynamic .bubble3d-sub { color: var(--accent); }

.bubble3d-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: linear-gradient(160deg,
      color-mix(in srgb, var(--md-sys-color-on-surface) 30%, transparent),
      color-mix(in srgb, var(--accent) 30%, transparent));
  border: none;
  color: var(--md-sys-color-on-surface);font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 0.5px 0 rgba(0,0,0,0.1);
}

.bubble3d-trend {
  position: absolute;
  top: -6px;
  right: -6px;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(160deg,
      color-mix(in srgb, var(--md-sys-color-on-surface) 25%, transparent),
      color-mix(in srgb, var(--accent) 35%, transparent));
  color: var(--md-sys-color-on-surface);font-size: 13px;
  border: none;
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 45%, transparent);
  animation: nx-pulse-soft 2.4s ease-in-out infinite;
}

.bubble3d-label.is-dynamic .bubble3d-name {
  font-size: 12px;
  font-weight: 600;
}
.bubble3d-label.is-dynamic {
  min-width: 92px;
  padding: 6px 12px 8px;
}

/* Compact label for mobile */
.bubble3d-label.is-compact {
  min-width: 88px;
  padding: 5px 10px 7px;
}
.bubble3d-label.is-compact .bubble3d-name { font-size: 11px; }
.bubble3d-label.is-compact .bubble3d-sub { font-size: 8px; }
.bubble3d-label.is-compact .bubble3d-icon { width: 16px; height: 16px; font-size: 10px; }
/* ── Reel Modal ── */
.nx-reel-modal {
  position: fixed; inset: 0; z-index: 100000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.nx-reel-modal.show { opacity: 1; pointer-events: auto; }
.nx-reel-backdrop {
  position: absolute; inset: 0; background: rgba(0, 0, 0, 0.75);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.nx-reel-card {
  position: relative; z-index: 2;
  width: min(92vw, 380px); height: min(82vh, 660px);
  border-radius: 28px; overflow: hidden;
  background: #0a0c1a; border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 24px 60px rgba(0,0,0,0.8);
  display: flex; flex-direction: column; justify-content: flex-end;
}
.nx-reel-close {
  position: absolute; top: 16px; right: 16px; z-index: 10;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.3);
  color: #fff; display: grid; place-items: center; cursor: pointer;
}
.nx-reel-video, .nx-reel-poster {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.nx-reel-overlay-content {
  position: relative; z-index: 3; padding: 24px 20px;
  background: linear-gradient(180deg, transparent 0%, rgba(5,6,15,0.92) 100%);
  color: #fff; display: flex; flex-direction: column; gap: 8px;
}
.nx-reel-badge {
  align-self: flex-start; padding: 4px 12px; border-radius: 999px;
  background: rgba(33, 155, 239, 0.3); border: 1px solid rgba(33, 155, 239, 0.6);
  font-size: 11px; font-weight: 600; color: #fff;
}
.nx-reel-title { font-size: 20px; font-weight: 700; line-height: 1.2; margin: 0; }
.nx-reel-body { font-size: 13px; line-height: 1.4; opacity: 0.85; margin: 0; }
.nx-reel-loader {
  padding: 40px; text-align: center; color: #fff; font-size: 14px; font-weight: 500;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; height: 100%;
}
.spin { animation: nxSpin 1s linear infinite; }
@keyframes nxSpin { to { transform: rotate(360deg); } }
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(16px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── NEXUS ASSISTANT (GLOBAL) ── */
.nxa-orb-wrap {
  position: fixed !important; bottom: calc(90px + var(--safe-bottom, 0px)) !important; right: 20px !important; left: auto !important; z-index: 10000 !important;
  width: 68px; height: 68px;
  cursor: pointer;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  animation: nxaBounce 2.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite;
}
@keyframes nxaBounce {
  0%   { transform: translateY(0px);  }
  20%  { transform: translateY(-9px); }
  35%  { transform: translateY(-4px); }
  48%  { transform: translateY(-8px); }
  60%  { transform: translateY(-2px); }
  70%  { transform: translateY(-6px); }
  80%  { transform: translateY(0px);  }
  100% { transform: translateY(0px);  }
}
.nxa-canvas {
  position: absolute; inset: 0; border-radius: 50%;
  width: 100%; height: 100%;
}
.nxa-eyes {
  position: relative; z-index: 2;
  display: flex; gap: 12px; align-items: center;
  margin-top: -10px;
}
.nxa-eye {
  width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #b0e8ff, #00C8FF 60%, #0090cc);
  box-shadow: 0 0 8px 3px rgba(0,200,255,0.7);
  transform-origin: center center;
  transition: transform 0.06s ease;
}
.nxa-pulse {
  position: absolute; inset: -4px; border-radius: 50%; z-index: 0;
  border: 1.5px solid rgba(123,92,229,0.35);
  animation: nxaPulse 2.4s ease-in-out infinite;
}
@keyframes nxaPulse {
  0%,100% { transform: scale(1);   opacity: 0.5; }
  50%      { transform: scale(1.15); opacity: 0.15; }
}

/* ── DIALOG (Apple HIG Sheet Modal Standard) ── */
.nxa-dialog {
  position: fixed !important; bottom: calc(108px + var(--safe-bottom, 0px)) !important; right: 28px !important; left: auto !important; z-index: 9999 !important;
  width: min(340px, calc(100vw - 32px));
  background: rgba(12, 10, 36, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 24px;
  backdrop-filter: blur(28px) saturate(1.85);
  -webkit-backdrop-filter: blur(28px) saturate(1.85);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), inset 0 1.5px 0 rgba(255, 255, 255, 0.28);
  overflow: hidden;
  opacity: 0; pointer-events: none;
  transform: translateY(14px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.nxa-dialog::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
}
.nxa-dialog.open {
  opacity: 1; pointer-events: all;
  transform: translateY(0) scale(1);
}

.nxa-dialog-header {
  display: flex; align-items: center; gap: 8px;
  padding: 18px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.nxa-dialog-title {
  font-size: 10.5px; font-weight: 700; letter-spacing: 2px;
  color: rgba(255,255,255,0.85); text-transform: uppercase;
  flex: 1;
}
.nxa-ai-badge {
  font-size: 9px; font-weight: 600; letter-spacing: 1px;
  color: #00C8FF;
  border: 1px solid rgba(0,200,255,0.35);
  border-radius: 20px; padding: 2px 8px;
  display: flex; align-items: center; gap: 4px;
}
.nxa-close {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.5); font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  margin: -10px -10px -10px 0;
  transition: color 0.15s, background 0.15s, transform 0.15s;
  touch-action: manipulation;
}
.nxa-close:hover { color: #ffffff; background: rgba(255,255,255,0.1); }
.nxa-close:active { transform: scale(0.92); }

.nxa-dialog-body {
  padding: 20px 18px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}

/* mini orb inside dialog */
.nxa-mini-orb {
  width: 72px; height: 72px; border-radius: 50%;
  background:
    radial-gradient(circle at 38% 32%, rgba(120,80,220,0.55) 0%, transparent 55%),
    radial-gradient(circle at 62% 68%, rgba(0,150,255,0.35) 0%, transparent 60%),
    radial-gradient(circle at 50% 50%, #12103a 40%, #0a0830 100%);
  box-shadow:
    0 0 28px 8px rgba(80,50,200,0.45),
    0 0 14px 3px rgba(0,180,255,0.25),
    inset 0 0 20px rgba(120,80,220,0.2);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  position: relative;
  animation: nxaBounce 2.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite;
}
.nxa-mini-eye {
  width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #cef0ff, #00C8FF 60%, #0080bb);
  box-shadow: 0 0 7px 3px rgba(0,200,255,0.65);
  margin-top: -8px;
  transform-origin: center center;
  transition: transform 0.06s ease;
}

.nxa-greeting {
  font-size: 14px; font-weight: 600; color: white;
  align-self: flex-start;
}
.nxa-chat-history {
  display: flex; flex-direction: column; gap: 8px; width: 100%;
  max-height: 250px; overflow-y: auto; padding-right: 4px;
}
.nxa-chat-ai, .nxa-chat-user {
  padding: 10px 12px; border-radius: 12px; font-size: 13px; line-height: 1.5;
  max-width: 90%;
}
.nxa-chat-ai {
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85);
  align-self: flex-start; border-bottom-left-radius: 4px;
}
.nxa-chat-user {
  background: rgba(123,92,229,0.25); color: white;
  align-self: flex-end; border-bottom-right-radius: 4px;
}
.nxa-suggest-chips {
  display: flex; flex-direction: column; gap: 6px; width: 100%; margin-top: 8px;
}
.nxa-suggest-chip {
  background: rgba(0, 200, 255, 0.1); border: 1px solid rgba(0, 200, 255, 0.3);
  color: #b0e8ff; border-radius: 8px; padding: 6px 10px; font-size: 12px;
  cursor: pointer; text-align: left; line-height: 1.3; transition: all 0.2s;
}
.nxa-suggest-chip:hover {
  background: rgba(0, 200, 255, 0.2);
}
.nxa-typing {
  font-size: 12px; color: rgba(255,255,255,0.5); font-style: italic; align-self: flex-start;
}

.nxa-input-row {
  display: flex; gap: 8px; padding: 12px 16px 14px;
  border-top: 1px solid rgba(123,92,229,0.12);
}
.nxa-input {
  flex: 1; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(123,92,229,0.2); border-radius: 10px;
  padding: 9px 12px; font-size: 12.5px; color: white; outline: none;
  transition: border-color 0.2s;
}
.nxa-input::placeholder { color: rgba(255,255,255,0.28); }
.nxa-input:focus { border-color: rgba(123,92,229,0.55); }
.nxa-send {
  width: 34px; height: 34px; border-radius: 10px; border: none; cursor: pointer;
  background: linear-gradient(135deg, #7B5CE5, #00C8FF);
  color: white; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.nxa-send:hover { opacity: 0.85; }

/* ════════════════════════════════════════════════════════
   LIGHT MODE READABILITY & CONTRAST OVERRIDES
   Ensures WCAG AAA crystal-clear readability for all text elements.
   ════════════════════════════════════════════════════════ */
html[data-theme='light'] body {
  color: #0f172a;
}

html[data-theme='light'] h1,
html[data-theme='light'] h2,
html[data-theme='light'] h3,
html[data-theme='light'] h4,
html[data-theme='light'] .category-title,
html[data-theme='light'] .subtopics-title,
html[data-theme='light'] .story-title,
html[data-theme='light'] .story-empty-title,
html[data-theme='light'] .hero-title,
html[data-theme='light'] .section-title,
html[data-theme='light'] .briefing-title,
html[data-theme='light'] .sub-item-title,
html[data-theme='light'] .nx-top-title-main,
html[data-theme='light'] .chapter-title,
html[data-theme='light'] .segment-title,
html[data-theme='light'] .story-hero-title,
html[data-theme='light'] .dv-hl-val,
html[data-theme='light'] .dv-block-title {
  color: #0f172a !important;
}

html[data-theme='light'] p,
html[data-theme='light'] .category-sub,
html[data-theme='light'] .subtopics-hint,
html[data-theme='light'] .story-desc,
html[data-theme='light'] .story-empty-body,
html[data-theme='light'] .sub-item-desc,
html[data-theme='light'] .lead-text,
html[data-theme='light'] .chapter-text,
html[data-theme='light'] .service-tip,
html[data-theme='light'] .nx-top-title-sub,
html[data-theme='light'] .dv-hl-label,
html[data-theme='light'] .source-item-title {
  color: #334155 !important;
}

/* Category & Subtopics cards in Light Mode */
html[data-theme='light'] .subtopics-panel,
html[data-theme='light'] .story-card,
html[data-theme='light'] .sub-item,
html[data-theme='light'] .info-card,
html[data-theme='light'] .debate-card,
html[data-theme='light'] .sources-block,
html[data-theme='light'] .tips-box,
html[data-theme='light'] .dv-block,
html[data-theme='light'] .dv-hl-card,
html[data-theme='light'] .dv-statpair-item,
html[data-theme='light'] .story-empty {
  background: rgba(255, 255, 255, 0.88) !important;
  border-color: rgba(203, 213, 225, 0.9) !important;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06) !important;
}

html[data-theme='light'] .sub-item {
  background: rgba(255, 255, 255, 0.78) !important;
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
}

html[data-theme='light'] .sub-item.is-selected {
  background: rgba(2, 132, 199, 0.12) !important;
  border-color: #0284c7 !important;
  box-shadow: 0 2px 12px rgba(2, 132, 199, 0.15) !important;
}

html[data-theme='light'] .sub-item.is-selected .sub-item-title {
  color: #0284c7 !important;
}

html[data-theme='light'] .sub-index {
  background: rgba(2, 132, 199, 0.12) !important;
  color: #0284c7 !important;
  border-color: rgba(2, 132, 199, 0.25) !important;
}

/* Navigation pill app bar in Light Mode */
html[data-theme='light'] .nx-top-app-bar,
html[data-theme='light'] .nx-pill-bar {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(203, 213, 225, 0.9) !important;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08) !important;
  color: #0f172a !important;
}

html[data-theme='light'] .nx-icon-btn:not(.nx-icon-btn-brand) {
  background: rgba(241, 245, 249, 0.85) !important;
  border-color: rgba(203, 213, 225, 0.8) !important;
  color: #0f172a !important;
}

html[data-theme='light'] .nx-text-btn {
  color: #334155 !important;
}

html[data-theme='light'] .nx-text-btn.is-active {
  background: rgba(2, 132, 199, 0.12) !important;
  color: #0284c7 !important;
}

/* 3D Bubbles label pills in Light Mode */
html[data-theme='light'] .bubble3d-label {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(203, 213, 225, 0.9) !important;
  color: #0f172a !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08) !important;
}

/* Story tags & chips in Light Mode */
html[data-theme='light'] .story-tag,
html[data-theme='light'] .md-chip:not(.is-selected) {
  background: rgba(241, 245, 249, 0.95) !important;
  border-color: rgba(148, 163, 184, 0.55) !important;
  color: #1e293b !important;
}

/* ── Hub brand / journey / generic UI (was white-on-light) ── */
html[data-theme='light'] .hub-brand-title {
  color: #0f172a !important;
}
html[data-theme='light'] .hub-brand-kicker {
  color: #0284c7 !important;
}
html[data-theme='light'] .hub-brand-sub,
html[data-theme='light'] .hub-brand-hint {
  color: #334155 !important;
}
html[data-theme='light'] .jlabel,
html[data-theme='light'] .jsub,
html[data-theme='light'] .journey-hdr span,
html[data-theme='light'] .journey-hdr em,
html[data-theme='light'] .si {
  color: #334155 !important;
}
html[data-theme='light'] .jhere {
  color: #0284c7 !important;
}
html[data-theme='light'] .material-symbols-rounded {
  color: inherit;
}
html[data-theme='light'] .md-chip {
  color: #1e293b !important;
}
html[data-theme='light'] .md-chip.is-selected {
  background: rgba(2, 132, 199, 0.14) !important;
  color: #0369a1 !important;
  border-color: rgba(2, 132, 199, 0.35) !important;
}

/* Flip cards stay dark photo-cards → keep light text on dark faces only */
html[data-theme='light'] .nx-flip-card-front,
html[data-theme='light'] .nx-flip-card-back {
  /* intentionally dark surfaces */
  color: #fff;
}
html[data-theme='light'] .nx-flip-title,
html[data-theme='light'] .nx-flip-back-title,
html[data-theme='light'] .nx-flip-back-desc,
html[data-theme='light'] .nx-flip-desc,
html[data-theme='light'] .nx-flip-hint,
html[data-theme='light'] .nx-flip-feature-item,
html[data-theme='light'] .nx-flip-num-pill {
  color: #ffffff !important;
}
html[data-theme='light'] .nx-flip-back-desc {
  color: rgba(255, 255, 255, 0.9) !important;
}

/* Category hero text outside cards */
html[data-theme='light'] .category-eyebrow,
html[data-theme='light'] .category-meta,
html[data-theme='light'] .category-crumb,
html[data-theme='light'] .category-crumb a {
  color: #334155 !important;
}
html[data-theme='light'] .category-title {
  color: #0f172a !important;
}

/* Portal / toast / status */
html[data-theme='light'] .hub-toast {
  background: rgba(255, 255, 255, 0.95) !important;
  color: #0f172a !important;
  border-color: rgba(148, 163, 184, 0.45) !important;
}
html[data-theme='light'] .portal-tab,
html[data-theme='light'] .portal-tab span {
  color: #334155 !important;
}
html[data-theme='light'] .portal-tab.is-active,
html[data-theme='light'] .portal-tab.is-active span {
  color: #0284c7 !important;
}
html[data-theme='light'] .portal-tabbar {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(148, 163, 184, 0.4) !important;
}

/* Generic white-text utilities that break light mode */
html[data-theme='light'] .hub-btn:not(.hub-center .hub-btn) {
  color: #0f172a !important;
}
html[data-theme='light'] .hub-3d-tag {
  color: #1e293b !important;
}

/* Ensure on-surface tokens win over residual white */
html[data-theme='light'] .nx-top-app-bar .material-symbols-rounded,
html[data-theme='light'] .nx-pill-bar .material-symbols-rounded {
  color: #0f172a !important;
}
html[data-theme='light'] .nx-icon-btn-brand .material-symbols-rounded {
  color: #ffffff !important;
}

/* ════════════════════════════════════════════════════════
   BKLIT UI DATA DASHBOARD CHARTS (Area, Gauge, Radar)
   ════════════════════════════════════════════════════════ */
:root {
  --dv-grid-stroke: rgba(255, 255, 255, 0.16);
  --dv-arc-track: rgba(255, 255, 255, 0.2);
}

html[data-theme='light'] {
  --dv-grid-stroke: rgba(15, 23, 42, 0.16);
  --dv-arc-track: rgba(15, 23, 42, 0.18);
}

.dv-skin-area,
.dv-skin-gauge,
.dv-skin-radar {
  background: var(--nx-glass-bg, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--nx-glass-border, rgba(255, 255, 255, 0.12));
}

.dv-bklit-chart {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 18px 20px;
}

.bklit-area-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.bklit-chart-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.bklit-val-main {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.bklit-big-num {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--md-sys-color-on-surface, #fff);
  line-height: 1;
}

.bklit-unit {
  font-size: 15px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant, #94a3b8);
}

.bklit-svg-wrap {
  position: relative;
  width: 100%;
  height: 140px;
}

.bklit-svg-chart {
  width: 100%;
  height: 110px;
  overflow: visible;
}

.bklit-dot {
  transition: r 0.2s, stroke-width 0.2s;
  cursor: pointer;
}
.bklit-dot:hover {
  r: 6px;
  stroke-width: 3px;
}

.bklit-axis-x {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant, #94a3b8);
  margin-top: 4px;
  padding: 0 4px;
}

/* Gauge Meter */
.bklit-gauge-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.bklit-gauge-arc-wrap {
  position: relative;
  width: 140px;
  height: 75px;
}

.bklit-gauge-svg {
  width: 100%;
  height: 100%;
}

.bklit-needle {
  position: absolute;
  bottom: 10px;
  left: 50%;
  width: 3px;
  height: 44px;
  background: #f43f5e;
  transform-origin: bottom center;
  border-radius: 2px;
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.6);
}

.bklit-gauge-num {
  font-size: 26px;
  font-weight: 800;
  color: var(--md-sys-color-on-surface, #fff);
  margin-top: -6px;
}

.bklit-gauge-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bklit-gauge-badge.is-low { background: rgba(34, 197, 94, 0.18); color: #4ade80; }
.bklit-gauge-badge.is-med { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
.bklit-gauge-badge.is-high { background: rgba(239, 68, 68, 0.18); color: #f87171; }

.bklit-gauge-minmax {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 11px;
  color: var(--md-sys-color-on-surface-variant, #94a3b8);
}

/* Radar Chart */
.bklit-radar-layout {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 16px;
  margin-top: 10px;
}

.bklit-radar-svg {
  width: 150px;
  height: 150px;
  flex-shrink: 0;
}

.bklit-radar-legend {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.bklit-radar-legend li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bklit-radar-attr {
  color: var(--md-sys-color-on-surface-variant, #94a3b8);
}

/* ════════════════════════════════════════════════════════
   3D CARD FLIP LAYOUT (Kokonut UI x Nexus Design System)
   ════════════════════════════════════════════════════════ */

.nx-flip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 28px;
  width: 100%;
  margin-top: 16px;
  padding-bottom: 40px;
  box-sizing: border-box;
  overflow: visible;
}

/* Organic 3-card layout */
@media (min-width: 900px) {
  .nx-flip-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    align-items: stretch;
  }
  .nx-flip-card-wrap:nth-child(1),
  .nx-flip-card-wrap:nth-child(2),
  .nx-flip-card-wrap:nth-child(3) {
    transform: none;
  }
}

.nx-flip-card-wrap {
  position: relative;
  min-height: 520px;
  max-width: 330px;
  width: 100%;
  margin: 0 auto;
  perspective: 2000px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  box-sizing: border-box;
}

.nx-flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1);
  will-change: transform;
}

.nx-flip-card-wrap:hover .nx-flip-card-inner,
.nx-flip-card-wrap.is-flipped .nx-flip-card-inner {
  transform: rotateY(180deg);
}

.nx-flip-card-front,
.nx-flip-card-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* ── Front Face ── */
.nx-flip-card-front {
  transform: rotateY(0deg);
  background: linear-gradient(165deg, rgba(22, 18, 50, 0.84) 0%, rgba(10, 8, 26, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), inset 0 1.5px 0 rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 24px;
  justify-content: space-between;
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

.nx-flip-card-wrap:hover .nx-flip-card-front {
  border-color: rgba(123, 92, 229, 0.65);
  box-shadow: 0 20px 50px rgba(123, 92, 229, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

/* Pulsing ambient aura rings in front background */
.nx-flip-aura-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.65;
}

.nx-flip-aura-ring {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 140px;
  opacity: 0;
  box-shadow: 0 0 50px rgba(123, 92, 229, 0.6);
  animation: nxFlipScale 3.2s linear infinite;
}

.nx-flip-card-wrap:hover .nx-flip-aura-ring {
  animation: nxFlipScale 2s linear infinite;
  box-shadow: 0 0 55px rgba(0, 200, 255, 0.7);
}

@keyframes nxFlipScale {
  0% {
    transform: scale(2);
    opacity: 0;
    box-shadow: 0 0 50px rgba(123, 92, 229, 0.6);
  }
  50% {
    transform: translate(0, -6px) scale(1);
    opacity: 0.85;
    box-shadow: 0 0 25px rgba(0, 200, 255, 0.8);
  }
  100% {
    transform: translate(0, 6px) scale(0.1);
    opacity: 0;
    box-shadow: 0 0 0px rgba(123, 92, 229, 0);
  }
}

/* Full-Bleed Background Image — Bild.de-style preview (photo shows through clearly) */
.nx-flip-bg-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  border-radius: 24px;
}

.nx-flip-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Brighter preview: photo reads as real news cover, not a dark blob */
  opacity: 0.88;
  filter: contrast(1.06) saturate(1.18) brightness(1.08);
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease, filter 0.4s ease;
}

.nx-flip-card-wrap:hover .nx-flip-bg-img {
  transform: scale(1.1);
  opacity: 0.96;
  filter: contrast(1.08) saturate(1.22) brightness(1.12);
}

.nx-flip-bg-overlay {
  position: absolute;
  inset: 0;
  /* Lighter veil — keep title legible, let photo dominate mid/top */
  background: linear-gradient(
    180deg,
    rgba(6, 4, 18, 0.18) 0%,
    rgba(6, 4, 18, 0.28) 28%,
    rgba(6, 4, 18, 0.55) 58%,
    rgba(4, 2, 14, 0.88) 100%
  );
  transition: background 0.4s ease;
}

.nx-flip-card-wrap:hover .nx-flip-bg-overlay {
  background: linear-gradient(
    180deg,
    rgba(6, 4, 18, 0.12) 0%,
    rgba(6, 4, 18, 0.22) 28%,
    rgba(6, 4, 18, 0.48) 58%,
    rgba(4, 2, 14, 0.84) 100%
  );
}

.nx-flip-front-header,
.nx-flip-front-body,
.nx-flip-front-footer {
  position: relative;
  z-index: 2;
}

.nx-flip-front-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nx-flip-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.48;
  margin-top: 8px;
  display: block;
  overflow: visible;
  word-break: break-word;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.95);
}

.nx-flip-num-pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 4px 12px;
  border-radius: 20px;
  backdrop-filter: blur(8px);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85);
}

.nx-flip-icon-disc {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(123, 92, 229, 0.22);
  border: 1px solid rgba(140, 120, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7B5CE5;
  font-size: 16px;
  transition: transform 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.nx-flip-card-wrap:hover .nx-flip-icon-disc {
  transform: rotate(180deg) scale(1.1);
  color: #00C8FF;
  border-color: rgba(0, 200, 255, 0.6);
}

.nx-flip-front-body {
  position: relative;
  z-index: 2;
  margin-top: auto;
  margin-bottom: auto;
}

.nx-flip-title {
  font-family: var(--md-sys-typescale-brand, 'Inter', sans-serif);
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 800;
  line-height: 1.3;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.4px;
  display: block;
  overflow: visible;
  word-break: break-word;
  /* Stronger shadow so lighter photo previews stay readable (Bild.de style) */
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.95),
    0 2px 16px rgba(0, 0, 0, 0.9),
    0 0 28px rgba(0, 0, 0, 0.75);
  transition: transform 0.4s ease;
}

.nx-flip-card-wrap:hover .nx-flip-title {
  transform: translateY(-2px);
}

.nx-flip-front-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.nx-flip-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

.nx-flip-hint i {
  font-size: 14px;
  color: #7B5CE5;
  animation: nxFlipSpin 4s linear infinite;
}

@keyframes nxFlipSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ── Back Face ── */
.nx-flip-card-back {
  transform: rotateY(180deg);
  background: linear-gradient(165deg, rgba(28, 22, 60, 0.95) 0%, rgba(12, 9, 30, 0.98) 100%);
  border: 1px solid rgba(123, 92, 229, 0.5);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 35px rgba(123, 92, 229, 0.25);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  padding: 22px 24px;
  justify-content: space-between;
}

.nx-flip-back-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow: hidden;
}

.nx-flip-back-title {
  font-size: 16.5px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
  margin: 0;
  display: block;
  overflow: visible;
  word-break: break-word;
}

.nx-flip-back-desc {
  font-size: 13px;
  line-height: 1.48;
  color: rgba(255, 255, 255, 0.88);
  margin: 0;
  display: block;
  overflow: visible;
  word-break: break-word;
}

.nx-flip-features {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.nx-flip-feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.88);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nx-flip-card-wrap.is-flipped .nx-flip-feature-item,
.nx-flip-card-wrap:hover .nx-flip-feature-item {
  transform: translateX(0);
  opacity: 1;
}

.nx-flip-feature-item i {
  font-size: 12px;
  color: #00C8FF;
  flex-shrink: 0;
}

.nx-flip-back-footer {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.nx-flip-cta-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 12px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(123, 92, 229, 0.38) 0%, rgba(0, 200, 255, 0.28) 100%);
  border: 1px solid rgba(140, 120, 255, 0.55);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  touch-action: manipulation;
  box-shadow: 0 6px 24px rgba(123, 92, 229, 0.35);
  transition: transform 0.16s cubic-bezier(0.2, 0.9, 0.4, 1.1), background 0.25s ease, box-shadow 0.25s ease;
  box-sizing: border-box;
}

.nx-flip-cta-btn:hover {
  background: linear-gradient(135deg, rgba(123, 92, 229, 0.58) 0%, rgba(0, 200, 255, 0.48) 100%);
  box-shadow: 0 8px 32px rgba(123, 92, 229, 0.65), 0 0 24px rgba(0, 200, 255, 0.5);
  transform: translateY(-1px) scale(1.01);
}

.nx-flip-cta-btn:active {
  transform: scale(0.96);
}

.nx-flip-cta-btn i {
  font-size: 16px;
  color: #00C8FF;
  transition: transform 0.25s ease;
}

.nx-flip-cta-btn:hover i {
  transform: translateX(4px);
  color: #ffffff;
}

@media (max-width: 640px) {
  .nx-flip-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .nx-flip-card-wrap {
    height: 320px;
  }
}


/* ════════════════════════════════════════════════════════
   DATEN BRIEFING LAYOUT (story-driven dashboard)
   Uses theme tokens — readable in dark + light mode
   Inspired by bklit-ui stat-card chrome (vanilla port)
   ════════════════════════════════════════════════════════ */

.daten-dashboard,
.daten-briefing-wrapper {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
  max-width: 720px;
}

.daten-briefing-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.daten-briefing-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.daten-briefing-badge .pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--md-sys-color-primary);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--md-sys-color-primary) 50%, transparent);
  animation: daten-pulse 1.8s ease-out infinite;
}

@keyframes daten-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--md-sys-color-primary) 45%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.badge-kicker {
  color: inherit;
}

.daten-briefing-headline {
  margin: 0;
  font-family: var(--md-sys-typescale-brand, 'Poppins', system-ui, sans-serif);
  font-size: clamp(22px, 3.2vw, 30px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--md-sys-color-on-surface);
}

.daten-briefing-intro-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.daten-briefing-intro-box .material-symbols-rounded {
  font-size: 20px;
  color: var(--md-sys-color-primary);
  flex-shrink: 0;
  margin-top: 1px;
}

.daten-intro-text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--md-sys-color-on-surface-variant);
}

.daten-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.daten-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--md-sys-color-on-surface-variant);
}

.daten-hero-cell .dv-block {
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--vc, var(--md-sys-color-primary)) 16%, var(--md-sys-color-surface-container-low)),
      var(--md-sys-color-surface-container-low) 60%
    );
}

.daten-hero-cell .dv-callout-num,
.daten-hero-cell .dv-bigstat-num {
  font-size: clamp(40px, 7vw, 64px);
  color: var(--md-sys-color-on-surface);
}

.daten-briefing-footer {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.daten-briefing-footer .material-symbols-rounded {
  font-size: 18px;
  color: var(--md-sys-color-primary);
  flex-shrink: 0;
}

.daten-source-note {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--md-sys-color-on-surface-variant);
}

.daten-source-note strong {
  color: var(--md-sys-color-on-surface);
  font-weight: 600;
}

.daten-empty-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--md-sys-color-on-surface-variant);
  max-width: 520px;
}

/* Bklit-inspired stat card polish */
.dv-bklit-stat {
  border: 1px solid var(--md-sys-color-outline-variant);
}

.dv-type-badge {
  display: inline-block;
  margin-bottom: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--vc, var(--md-sys-color-primary)) 16%, transparent);
  color: var(--md-sys-color-on-surface);
}

/* Force readable text on all core dv surfaces (overrides residual white) */
.dv-hl-value,
.dv-title,
.dv-callout-num,
.dv-bigstat-num,
.dv-versus-val,
.dv-rank-head > span:first-child,
.dv-rank-value,
.dv-bar-head strong,
.dv-legend-value,
.dv-table th,
.dv-table td,
.dv-statpair-val,
.bklit-big-num {
  color: var(--md-sys-color-on-surface);
}

.dv-hl-label,
.dv-hl-unit,
.dv-hl-note,
.dv-caption,
.dv-meta,
.dv-bar-head,
.dv-bar-note,
.dv-callout-inner p,
.dv-bigstat-context,
.dv-bigstat-unit,
.dv-callout-num span,
.dv-versus-lbl,
.dv-versus-unit,
.dv-legend-label,
.dv-rank-value small,
.bklit-unit {
  color: var(--md-sys-color-on-surface-variant);
}

.dv-bar-track,
.dv-scale-track {
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent);
}

.dv-donut-hole {
  background: var(--md-sys-color-surface-container-low, var(--nx-glass-bg, #0d0b22));
}

.dv-versus-side {
  background: color-mix(in srgb, var(--vc, var(--md-sys-color-primary)) 10%, var(--md-sys-color-surface-container));
}

.dv-versus-div span {
  color: var(--md-sys-color-on-surface-variant);
  background: var(--md-sys-color-surface-container);
}

.dv-rank-num {
  color: var(--md-sys-color-on-surface-variant);
  background: var(--md-sys-color-surface-container);
}

.dv-rank-num.gold {
  color: var(--md-sys-color-on-primary, #fff);
  background: var(--vc, var(--md-sys-color-primary));
}

.dv-table th {
  color: var(--md-sys-color-on-surface-variant);
  border-bottom-color: var(--md-sys-color-outline-variant);
}

.dv-table td {
  color: var(--md-sys-color-on-surface);
  border-bottom-color: var(--md-sys-color-outline-variant);
}

.dv-table tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 4%, transparent);
}

/* Light mode: hard guarantees for Daten (story-entry + story page) */
html[data-theme='light'] .daten-briefing-headline,
html[data-theme='light'] .daten-intro-text,
html[data-theme='light'] .section-tag,
html[data-theme='light'] .daten-source-note,
html[data-theme='light'] .daten-empty-text,
html[data-theme='light'] .badge-kicker,
html[data-theme='light'] .dv-title,
html[data-theme='light'] .dv-hl-value,
html[data-theme='light'] .dv-callout-num,
html[data-theme='light'] .dv-bigstat-num,
html[data-theme='light'] .dv-versus-val,
html[data-theme='light'] .dv-bar-head strong,
html[data-theme='light'] .dv-rank-head > span:first-child,
html[data-theme='light'] .dv-rank-value,
html[data-theme='light'] .dv-table th,
html[data-theme='light'] .dv-table td,
html[data-theme='light'] .dv-legend-value,
html[data-theme='light'] .dv-statpair-val,
html[data-theme='light'] .bklit-big-num {
  color: #0f172a !important;
}

html[data-theme='light'] .dv-hl-label,
html[data-theme='light'] .dv-hl-unit,
html[data-theme='light'] .dv-hl-note,
html[data-theme='light'] .dv-caption,
html[data-theme='light'] .dv-meta,
html[data-theme='light'] .dv-bar-head,
html[data-theme='light'] .dv-bar-note,
html[data-theme='light'] .dv-callout-inner p,
html[data-theme='light'] .dv-callout-num span,
html[data-theme='light'] .dv-bigstat-unit,
html[data-theme='light'] .dv-bigstat-context,
html[data-theme='light'] .dv-versus-lbl,
html[data-theme='light'] .dv-versus-unit,
html[data-theme='light'] .dv-legend-label,
html[data-theme='light'] .dv-rank-value small,
html[data-theme='light'] .daten-source-note,
html[data-theme='light'] .bklit-unit,
html[data-theme='light'] .bklit-axis-x {
  color: #475569 !important;
}

html[data-theme='light'] .daten-briefing-intro-box,
html[data-theme='light'] .daten-briefing-footer,
html[data-theme='light'] .dv-block,
html[data-theme='light'] .dv-hl-card,
html[data-theme='light'] .dv-versus-side,
html[data-theme='light'] .dv-statpair-item {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(148, 163, 184, 0.45) !important;
  color: #0f172a !important;
}

html[data-theme='light'] .daten-hero-cell .dv-block {
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--vc, #0284c7) 14%, #ffffff),
      #ffffff 55%
    ) !important;
}

html[data-theme='light'] .dv-donut-hole {
  background: #f8fafc !important;
}

html[data-theme='light'] .dv-bar-track,
html[data-theme='light'] .dv-scale-track {
  background: rgba(15, 23, 42, 0.1) !important;
}

html[data-theme='light'] .dv-rank-num:not(.gold) {
  background: rgba(15, 23, 42, 0.08) !important;
  color: #334155 !important;
}

html[data-theme='light'] .dv-type-badge {
  background: rgba(2, 132, 199, 0.12) !important;
  color: #0369a1 !important;
}

html[data-theme='light'] .daten-briefing-badge {
  background: rgba(2, 132, 199, 0.12) !important;
  color: #0369a1 !important;
}

html[data-theme='light'] .section-tag {
  color: #64748b !important;
}

html[data-theme='light'] .dv-hl-trend.flat {
  color: #64748b !important;
  background: rgba(15, 23, 42, 0.06) !important;
}

html[data-theme='light'] .dv-versus-div span {
  color: #64748b !important;
  background: rgba(15, 23, 42, 0.06) !important;
}
