/* ===== Design System (broker-portal24 inspired) ===== */
:root {
  --color-bg: #f7f7f7;
  --color-surface: #ffffff;
  --color-primary: #1e3a8a;
  --color-primary-light: #243b53;
  --color-accent: #1a63c5;
  --color-accent-hover: #0d4b98;
  --color-highlight: #0284c7;
  --color-text: #333333;
  --color-text-muted: #666666;
  --color-border: #d4d4d4;
  --color-border-dark: #b8b8b8;
  --color-border-light: #e5e5e5;
  --color-cell-border: #dcdcdc;
  --color-success: #16a34a;
  --color-warning: #ea580c;
  --color-danger: #dc2626;
  --color-tag-bar: #dcfce7;
  --color-tag-zins: #e0f2fe;
  --color-tag-order: #fef3c7;
  --color-tag-gutschein: #f3e8ff;
  --color-tag-none: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 2px 6px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.12);
  --radius: 3px;
  --radius-lg: 4px;
  --font-sans: Arial, Helvetica, sans-serif;
  --max-width: 1180px;
  --transition: 0.15s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 14px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.45;
  min-height: 100vh;
}

/* ===== Header ===== */
.site-header {
  background: #ffffff;
  color: #000000;
  padding: 1.5rem 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  box-shadow: none;
}

.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-wordmark {
  color: #111c38;
  font-family: system-ui, sans-serif;
  font-size: clamp(1.15rem, 5.2vw, 2.5rem);
  font-style: italic;
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: -0.045em;
  white-space: nowrap;
}

.site-wordmark-arrow,
.site-wordmark-premium,
.site-wordmark-domain {
  color: #0d587d;
}

.site-wordmark-arrow {
  display: inline-block;
  overflow: visible;
  margin: 0 -0.04em 0 0.12em;
  vertical-align: 0.01em;
}

.site-wordmark-umlaut {
  position: relative;
  display: inline-block;
  line-height: 1.178em;
  margin-left: -0.005em;
}

.site-wordmark-umlaut-body {
  clip-path: inset(0.394em -1em -1em -1em);
}

.site-wordmark-umlaut-dots {
  position: absolute;
  top: 0;
  left: 0;
  user-select: none;
  clip-path: inset(-1em -1em 0.784em -1em);
  transform: translateX(0.018em);
}

.site-wordmark-domain {
  margin-left: -0.27em;
  font-style: normal;
  font-size: 0.66em;
  letter-spacing: -0.02em;
}

/* Comparison toolbar buttons */
.bookmarks-btn, .filter-menu > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-sans);
  color: #000000;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  box-shadow: var(--shadow-sm);
}

.bookmarks-btn:hover, .filter-menu > summary:hover {
  border-color: #888888;
  background: #fbfbfb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.bookmarks-btn .bookmark-btn-heart {
  color: #f59e0b;
  font-size: 1.05rem;
  line-height: 1;
}

/* ===== Meta Bar ===== */
.meta-bar {
  max-width: var(--max-width);
  margin: 1.25rem auto 1rem;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.meta-bar .last-updated {
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.meta-bar .last-updated time {
  font-weight: 600;
  color: var(--color-text);
}

/* ===== Info Banner ===== */
.info-banner {
  max-width: var(--max-width);
  margin: 0 auto 0.75rem;
  padding: 0 1rem;
}

.info-banner-inner {
  background: transparent;
  border: none;
  padding: 0.25rem 0;
  font-size: 0.85rem;
  color: #000000;
  line-height: 1.5;
}

.info-banner-inner strong {
  color: #000000;
}

/* ===== Staleness Warning ===== */
.staleness-warning {
  max-width: var(--max-width);
  margin: 0 auto 1rem;
  padding: 0 1rem;
}

.staleness-warning-inner {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-left: 4px solid var(--color-warning);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: #92400e;
  line-height: 1.5;
  font-weight: 500;
}

/* ===== Comparison Table Container ===== */
.comparison-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

/* Table Header (broker-portal24 style) */
.table-header-row {
  display: grid;
  grid-template-columns: 240px 1.5fr 80px 75px 125px 155px;
  gap: 0;
  align-items: stretch;
  background: #f0f0f0;
  border: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 0;
  font-size: 0.70rem;
  font-weight: 700;
  color: #333333;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.th-cell {
  display: flex;
  align-items: center;
  padding: 0.65rem 0.65rem;
  border-right: 1px solid var(--color-cell-border);
  background: transparent;
  line-height: 1.2;
}

.th-cell:last-child {
  border-right: none;
}

.th-mindest,
.th-haltefrist {
  padding-left: 0.4rem;
  padding-right: 0.4rem;
  justify-content: center;
  text-align: center;
  hyphens: auto;
}

.th-cell.sortable {
  cursor: pointer;
  user-select: none;
  transition: color var(--transition);
}

.th-cell.sortable:hover {
  color: var(--color-accent);
}

.sort-icon {
  margin-left: 0.25rem;
  font-size: 0.65rem;
  color: #888888;
}

.active-sort {
  color: var(--color-accent) !important;
}

.active-sort .sort-icon {
  color: var(--color-accent) !important;
}

/* Card List as Table Rows */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Broker Card (Table Row on Desktop) */
.broker-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0;
  box-shadow: none;
  transition: background-color var(--transition), opacity var(--transition), filter var(--transition);
  position: relative;
}

.broker-card:last-child {
  border-radius: 0 0 var(--radius) var(--radius);
  border-bottom: 1px solid var(--color-border);
}

.broker-card:hover {
  background-color: #fafbfc;
  z-index: 1;
}

/* User request: entferne links greune/ graue border.
   Mache die inaktiven angebote noch mehr ausgebleicht. */
.broker-card.status-keine_aktion,
.broker-card.status-nicht_erreichbar {
  opacity: 0.46;
  filter: grayscale(75%);
  background-color: #fbfbfb;
}

.broker-card.status-keine_aktion:hover,
.broker-card.status-nicht_erreichbar:hover {
  opacity: 0.75;
  filter: grayscale(20%);
}

.broker-card.status-abgelaufen {
  opacity: 0.78;
  filter: grayscale(100%);
  background-color: #f5f5f5;
}

.broker-card.status-unsicher {
  opacity: 0.88;
}

/* Card Grid Row */
.card-grid {
  display: grid;
  grid-template-columns: 240px 1.5fr 80px 75px 125px 155px;
  gap: 0;
  align-items: stretch;
  padding: 0;
}

.card-col {
  padding: 1rem 0.85rem;
  border-right: 1px solid var(--color-cell-border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: transparent;
}

.card-col:last-child {
  border-right: none;
}

.mobile-col-label {
  display: none;
}

/* Col 1: Anbieter */
.col-anbieter {
  justify-content: flex-start;
  gap: 0.35rem;
}

.card-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-bookmark-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: #9ca3af;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  user-select: none;
}

.card-bookmark-btn:hover { color: #be123c; }
.card-bookmark-btn.is-bookmarked,
.card-bookmark-btn.is-bookmarked:hover { color: #e11d48; }

.broker-logo {
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  background: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-primary);
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: none;
}

.broker-logo img,
.broker-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.logo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #f1f5f9;
}

.broker-info h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #000000;
  line-height: 1.2;
}

.broker-info .produkt {
  font-size: 0.76rem;
  color: var(--color-text-muted);
  font-weight: 400;
  display: block;
  margin-top: 0.1rem;
}

.card-header-badges {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

.type-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.type-badge.type-depotwechsel {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.type-badge.type-neueroeffnung {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.type-badge.type-beides {
  background: #fdf4ff;
  color: #a21caf;
  border: 1px solid #f5d0fe;
}

.type-badge.type-nur_konditionen {
  display: none !important;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.mydealz-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 12px;
  background: #fff1ec;
  color: #e65100;
  border: 1px solid #ffccbc;
  text-decoration: none;
  white-space: nowrap;
}

.source-badge {
  display: inline-block;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(120, 120, 120, 0.15);
  background: color-mix(in srgb, var(--badge-color) 15%, transparent);
  color: var(--badge-color);
  border: 1px solid rgba(120, 120, 120, 0.3);
  border: 1px solid color-mix(in srgb, var(--badge-color) 30%, transparent);
  margin: 0;
  font-weight: 500;
}

.status-badge {
  display: none;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-badge.aktiv {
  background: var(--color-tag-bar);
  color: var(--color-success);
  border: 1px solid #bbf7d0;
}

.status-badge.keine_aktion {
  background: var(--color-tag-none);
  color: var(--color-text-muted);
  border: 1px solid #e2e8f0;
}

.status-badge.unsicher {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.status-badge.nicht_erreichbar {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.status-badge.abgelaufen {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}

/* Validity countdown badge */
.col-validity {
  margin-top: 0.15rem;
}

.validity-badge {
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
}

.validity-badge.val-green {
  display: none;
}

.validity-badge.val-orange {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #ffedd5;
  font-weight: 700;
}

.validity-badge.val-red {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fee2e2;
  font-weight: 700;
}

.validity-badge.val-gray {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* Card Dates */
.card-dates {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}

.date-item {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.date-discovered {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

/* Col 2: Prämie & Vorteile (The Highlight Column) */
.col-praemie {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.praemie-highlight {
  font-size: 1.28rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #000000;
}

.praemie-highlight.is-active {
  color: #000000;
}

.praemie-highlight.is-muted {
  font-size: 1rem;
  color: var(--color-text-muted);
  font-weight: 600;
}

.praemie-expired-label {
  display: block;
  margin-bottom: .15rem;
  font-size: .72rem;
  font-weight: 600;
  color: var(--color-text);
}

.star-icon {
  color: #f59e0b;
  display: inline-block;
  width: .9em;
  height: .9em;
  fill: currentColor;
  vertical-align: -.08em;
}

.praemie-text {
  font-size: 0.82rem;
  color: #334155;
  line-height: 1.35;
}

.praemie-perks {
  display: none;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.25rem;
}

.perk-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.74rem;
  color: #000000;
  background: transparent;
  border: 1px solid #cccccc;
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  font-weight: 500;
}

.perk-check {
  color: #000000;
  font-weight: 700;
}

.details-toggle-btn {
  background: none;
  border: none;
  padding: 0;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #000000;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-sans);
  transition: color var(--transition);
}

.details-toggle-btn:hover {
  color: #333333;
  text-decoration: underline;
}

.toggle-arrow {
  font-size: 0.7rem;
  transition: transform var(--transition);
}

/* Col 3 & 4: Mindestübertrag & Haltefrist */
.col-mindest,
.col-haltefrist {
  padding-left: 0.4rem;
  padding-right: 0.4rem;
  text-align: center;
  align-items: center;
}

.col-mindest .cell-value,
.col-haltefrist .cell-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
  word-break: break-word;
}

/* Col 5: Depotkosten */
.col-depot .cell-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.35;
}

.fee-preview[hidden],
.fee-full[hidden] {
  display: none !important;
}

a.fee-toggle-btn {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: 400;
  text-decoration: underline;
  cursor: pointer;
}

.fee-toggle-btn:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 3px;
}

.check-icon {
  color: var(--color-success);
  font-weight: 800;
  margin-right: 0.15rem;
}

/* Col 6: CTA Button & Source Link */
.col-cta {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: stretch;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: linear-gradient(180deg, #ffffff 0%, #f7f7f7 42%, #eaeaea 50%, #dedede 100%);
  color: #000000;
  text-decoration: none;
  padding: 0.55rem 0.85rem;
  border: 1px solid #b2b2b2;
  border-radius: 3px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-sans);
  text-shadow: 0 1px 0 #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: all var(--transition);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.35;
  min-width: 0;
  cursor: pointer;
}

.cta-button:hover {
  background: linear-gradient(180deg, #ffffff 0%, #fafafa 42%, #f0f0f0 50%, #e6e6e6 100%);
  border-color: #888888;
  color: #000000;
  box-shadow: inset 0 1px 0 #ffffff, 0 1px 3px rgba(0, 0, 0, 0.16);
  transform: none;
}

.cta-button:active {
  background: linear-gradient(180deg, #d8d8d8 0%, #e5e5e5 100%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.cta-button svg {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.broker-card.status-keine_aktion .cta-button,
.broker-card.status-nicht_erreichbar .cta-button,
.broker-card.status-abgelaufen .cta-button {
  background: linear-gradient(180deg, #f5f5f5 0%, #e8e8e8 100%);
  color: #777777;
  border-color: #cccccc;
  text-shadow: 0 1px 0 #ffffff;
  box-shadow: none;
  cursor: default;
}

.broker-card.status-keine_aktion .cta-button:hover,
.broker-card.status-nicht_erreichbar .cta-button:hover,
.broker-card.status-abgelaufen .cta-button:hover {
  background: linear-gradient(180deg, #eeeeee 0%, #dfdfdf 100%);
  color: #555555;
  border-color: #aaaaaa;
}

.source-link {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  transition: color var(--transition);
  text-align: center;
}

.source-link svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.source-link:hover {
  color: var(--color-accent);
}

.source-url-display {
  display: block;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  word-break: break-all;
  margin-top: 0.2rem;
  text-align: center;
}

/* ===== Expandable Details Accordion ===== */
.card-expandable-details {
  display: none;
  background: #f8fafc;
  border-top: 1px dashed var(--color-border);
  padding: 1.25rem 1.5rem;
  animation: fadeIn 0.2s ease;
  color: #000000;
}

.card-expandable-details * {
  color: #000000;
}

.bedingungen-fliesstext {
  white-space: pre-line;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #000000;
  padding: 0.25rem 0;
}

.bedingungen-leer {
  color: #000000;
  font-style: italic;
  font-size: 0.85rem;
  padding: 0.25rem 0;
}

.card-expandable-details.is-open {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.details-content {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.structured-details {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: #000000;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
}

.detail-row {
  line-height: 1.45;
  color: #000000;
}

.detail-row strong {
  color: #000000;
  margin-right: 0.35rem;
}

.konditionen-block {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.konditionen-title {
  display: block;
  padding: 0.6rem 1rem;
  background: #f1f5f9;
  font-size: 0.78rem;
  font-weight: 700;
  color: #000000;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--color-border);
}

.konditionen-list {
  list-style: none;
}

.kondition-item {
  display: flex;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  gap: 0.5rem;
  font-size: 0.82rem;
  line-height: 1.45;
}

.kondition-item:last-child {
  border-bottom: none;
}

.kondition-item:nth-child(odd) {
  background: #fafbfc;
}

.kondition-label {
  font-weight: 600;
  color: #000000;
  min-width: 150px;
  flex-shrink: 0;
}

.kondition-wert {
  color: #000000;
}

/* ===== Homepage Intro ===== */
.site-intro {
  max-width: var(--max-width);
  margin: 1rem auto;
  padding: 0 1rem;
}

.site-intro h2 {
  margin-bottom: 0.25rem;
  font-size: 1.15rem;
}

.site-intro h3 {
  margin: 0.65rem 0 0.25rem;
  color: #000000;
  font-size: 1rem;
}

.site-intro ul {
  padding-left: 1.25rem;
}

.site-intro li + li {
  margin-top: 0.35rem;
}

/* ===== Disclaimer ===== */
.disclaimer {
  max-width: var(--max-width);
  margin: 0 auto 2rem;
  padding: 0 1rem;
}

.disclaimer-inner {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem 0;
  font-size: 0.875rem;
  color: #555;
  line-height: 1.55;
}

.disclaimer-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1.5px solid #315c93;
  border-radius: 50%;
  color: #315c93;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

/* ===== Footer ===== */
.site-footer {
  background: #0a2540;
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.78rem;
}

.footer-logo {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 0 0.75rem;
  border-radius: 10px;
}

.site-footer a {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ===== Loading & Empty State ===== */
.loading-state,
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-muted);
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

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

/* ===== Responsive (Mobile & Tablet) ===== */

@media (max-width: 960px) {
  .table-header-row {
    display: none;
  }

  .card-list {
    gap: 1rem;
  }

  .broker-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
  }

  .broker-card:last-child {
    border-radius: var(--radius-lg);
  }

  .card-grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
  }

  .card-col {
    padding: 0;
    border-right: none;
  }

  .mobile-col-label {
    display: inline-block;
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--color-text-muted);
    letter-spacing: 0.03em;
  }

  .col-mindest,
  .col-haltefrist,
  .col-depot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    border-bottom: 1px dashed var(--color-border-light);
  }

  .col-cta {
    margin-top: 0.5rem;
  }

  .card-header-badges {
    justify-content: flex-start;
  }
}

@media (max-width: 540px) {
  .site-header {
    padding: 1.5rem 0.75rem;
  }

  .comparison-container {
    padding: 0 0.5rem 2rem;
  }

  .meta-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 0.5rem;
  }
}

/* All conditions remain keyboard reachable without clipping. */
.card-expandable-details[hidden] { display: none; }
.card-col, .details-content, .offer-overview, .detail-row { min-width: 0; overflow-wrap: anywhere; }
.offer-overview p { margin: 0 0 .5rem; }
.overview-bullets { padding-left: 1.3rem; margin: .5rem 0; }
.overview-bullets .kondition-item { display: list-item; padding: .25rem 0; border: 0; }
.verification-limitation, .last-supported { font-size: .82rem; }
.further-conditions summary { cursor: pointer; font-weight: 600; padding: .5rem 0; }
.further-conditions .detail-row { margin: .5rem 0; }
.evidence-links { padding-left: 1.2rem; overflow-wrap: anywhere; }
.details-toggle-btn:focus-visible, .further-conditions summary:focus-visible { outline: 3px solid #2563eb; outline-offset: 3px; }

.historical-value {
  display: block;
  color: #777;
  font-size: 0.75rem;
  font-weight: normal;
  margin-top: 0.2rem;
}

.historical-notice {
  color: #666;
  font-size: 0.85rem;
}
/* Literal witnesses keep every qualifier accessible beyond the compact summary. */
.fact-evidence {
  margin: 10px 0;
  padding: 8px 12px;
  border-left: 3px solid #cbd5e1;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.fact-evidence cite { display: block; margin-top: 4px; font-size: 12px; }

/* Filter menu and removable pills reuse the card badge colors. */
.offer-filters {
  position: relative;
  margin-bottom: .75rem;
}
.filter-toolbar, .active-filter-pills { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.filter-menu > summary {
  min-height: 34px;
  list-style: none;
}
.filter-menu > summary::-webkit-details-marker { display: none; }
.filter-menu > summary::before {
  content: "";
  width: 1.15rem;
  height: 1.15rem;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M4 6h4m4 0h8M4 12h9m4 0h3M4 18h2m4 0h10M8 4v4m9 2v4M6 16v4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.filter-menu > summary::after {
  content: "";
  width: .42rem;
  height: .42rem;
  margin: -.2rem .1rem 0;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.offer-filters:has(.active-filter-pill) .filter-menu > summary {
  border-color: var(--color-border-dark);
}
.filter-menu[open] > summary {
  border-color: var(--color-border-dark);
  background: #f0f0f0;
}
.filter-menu[open] > summary::after { margin-top: .2rem; transform: rotate(225deg); }
.filter-options {
  position: absolute;
  left: 0;
  z-index: 20;
  width: min(34rem, 100%);
  margin-top: .35rem;
  padding: .85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
}
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.filter-row + .filter-row { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--color-border-light); }
.filter-row strong {
  flex-basis: 100%;
  font-size: .7rem;
  color: var(--color-text);
  letter-spacing: .02em;
  text-transform: uppercase;
}
.filter-all { border: 1px solid var(--color-border); background: white; color: var(--color-text); cursor: pointer; }
.filter-all[aria-pressed="true"] { background: #f0f0f0; }
.filter-status { font-size: .8rem; color: var(--color-text-muted); }
.filter-status:empty, .active-filter-pills:empty { display: none; }
button.type-badge, button.source-badge { font-family: inherit; cursor: pointer; }
button.type-badge { border: 1px solid currentColor; }
button.type-badge.is-active, button.source-badge.is-active { outline: 2px solid var(--color-text-muted); outline-offset: 2px; }
.type-badge.type-referral { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.filter-options button, .active-filter-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: .25rem .65rem;
  border-radius: 999px;
  font: 600 .82rem/1.2 var(--font-sans);
}
.filter-options button:not([aria-pressed="true"]):hover { border-color: currentColor; }
.filter-options button[aria-pressed="true"] {
  border-color: currentColor;
  box-shadow: inset 0 0 0 1px currentColor;
  outline: none;
}
button[data-filter-group]:focus-visible, .filter-options button[aria-pressed="true"]:focus-visible,
.active-filter-pill button:focus-visible, .filter-menu > summary:focus-visible { outline: 2px solid #1e40af; outline-offset: 3px; }
.active-filter-pill { gap: .15rem; padding: 0 .2rem 0 .7rem; }
.active-filter-pill button { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; font-size: 1.1rem; line-height: 1; }
.active-filter-pill button:hover { background: #00000010; }
a.source-url-display { text-decoration: underline; text-underline-offset: 2px; }
a.source-url-display:hover { color: var(--color-accent); }
span.source-link:hover { color: var(--color-text-muted); }
@media (max-width: 600px) {
  .active-filter-pill { min-height: 38px; padding-right: 0; }
  .active-filter-pill button { width: 36px; height: 36px; }
  .filter-options button { min-height: 40px; }
}

/* Hearts and a more compact mobile card. */
.bookmarks-btn .bookmark-btn-heart, .card-bookmark-btn.is-bookmarked { color: #e11d48; }
@media (max-width: 960px) {
  .card-grid { padding: .85rem 1rem; gap: .65rem; }
  .col-anbieter { position: relative; padding-right: 2.25rem; gap: .25rem; }
  .card-header-left { gap: .65rem; padding-right: .85rem; }
  .broker-info { flex: 1 1 0; min-width: 0; }
  .card-header-left .praemie-highlight { max-width: 45%; min-width: 0; text-align: right; }
  .card-bookmark-btn { position: absolute; top: -.25rem; right: -.25rem; width: 36px; height: 36px; font-size: 1.5rem; }
  .col-mindest.is-empty, .col-haltefrist.is-empty, .col-depot.is-empty { display: none; }
  .col-mindest, .col-haltefrist, .col-depot { flex-direction: row; gap: .75rem; padding: .25rem 0; }
  .col-mindest .cell-value, .col-haltefrist .cell-value, .col-depot .cell-value { text-align: right; }
  .col-praemie > .details-toggle-btn:first-child { margin-top: 0; }
  .col-praemie .card-expandable-details { margin-top: .65rem; padding: .75rem; border: 1px solid var(--color-border-light); border-radius: 6px; }
  .col-praemie .evidence-links { margin: 0; padding-left: 1rem; }
  .col-cta { margin-top: .15rem; }
}

/* Rounded hearts share one geometry in both states. */
.heart-svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.bookmark-icon, .bookmark-btn-heart { display: inline-flex; align-items: center; justify-content: center; }
.card-bookmark-btn.is-bookmarked .heart-svg, .bookmarks-btn.has-bookmarks .heart-svg { fill: currentColor; }
.bookmarks-btn .bookmark-btn-heart { color: #9ca3af; }
.bookmarks-btn.has-bookmarks .bookmark-btn-heart { color: #e11d48; }
.bookmarks-slot { margin-left: auto; width: 126px; min-height: 36px; display: flex; align-items: center; justify-content: flex-end; flex-shrink: 0; }
.bookmarks-btn, .filter-menu > summary { white-space: nowrap; font-size: .8rem; padding: .35rem .6rem; }
.filter-status { order: 2; }
.bookmarks-slot { order: 3; }
.card-bookmark-btn { position: relative; overflow: visible; }
.floating-hearts { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 1000; }
.floating-heart { position: absolute; display: block; color: #e11d48; pointer-events: none; }
.floating-heart .heart-svg { width: 15px; height: 15px; fill: currentColor; stroke-width: 1; }
@media (max-width: 960px) {
  .card-bookmark-btn { position: absolute; }
}
@media (max-width: 600px) {
  .filter-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .filter-menu { grid-column: 1; grid-row: 1; justify-self: start; }
  .bookmarks-slot { grid-column: 2; grid-row: 1; }
  .active-filter-pills { grid-column: 1 / -1; grid-row: 2; }
  .filter-status { grid-column: 1 / -1; grid-row: 3; }
}
@media (prefers-reduced-motion: reduce) { .floating-hearts { display: none; } }

/* Keep the saved-offers control reachable on every screen size. */
.bookmarks-btn.has-bookmarks.is-floating { position: fixed; top: max(.5rem, env(safe-area-inset-top)); right: max(.5rem, env(safe-area-inset-right)); z-index: 50; background: white; box-shadow: 0 2px 12px #0f172a26; }
.bookmarks-btn.is-active, .bookmarks-btn.has-bookmarks.is-floating.is-active { background: #fff1f2; border-color: #fda4af; color: #9f1239; }
.bookmarks-btn.is-active:hover, .bookmarks-btn.has-bookmarks.is-floating.is-active:hover { background: #ffe4e6; border-color: #fb7185; }

.bookmarks-btn:disabled, .bookmarks-btn:disabled:hover { cursor: default; opacity: .55; background: white; border-color: var(--color-border); box-shadow: var(--shadow-sm); }

/* Provider fallbacks without a reward stay visually secondary in every status. */
.broker-card.is-no-reward { opacity: .46; filter: grayscale(75%); background-color: #fbfbfb; }
.broker-card.is-no-reward:hover { opacity: .75; filter: grayscale(20%); }
.broker-card.is-no-reward .cta-button { background: linear-gradient(180deg, #fafafa 0%, #ececec 100%); color: #666; border-color: #ccc; box-shadow: none; }

.popularity-btn { font: inherit; font-size: .8rem; padding: .35rem .6rem; border: 1px solid var(--color-border); border-radius: 6px; background: white; cursor: pointer; white-space: nowrap; }
.popularity-btn[aria-pressed="true"] { background: #eaf3ff; border-color: #6797c8; }
.ranking-controls { display: flex; flex-wrap: wrap; gap: .5rem; }
.popularity-btn:disabled { opacity: .55; cursor: default; }
@media (max-width: 600px) {
  .ranking-controls { grid-column: 1 / -1; grid-row: 2; }
  .active-filter-pills { grid-row: 3; }
  .filter-status { grid-row: 4; }
}
