:root {
  /* Brand: purple */
  --cf-primary: #CDA9E5;
  --cf-accent: #CDA9E5;
  --cf-cta: #A760DE;
  --cf-ink: #0b0f14;
  --cf-surface: rgba(255,255,255,0.86);
  --cf-border: rgba(15, 23, 42, 0.10);
  --cf-shadow: 0 18px 50px rgba(2, 6, 23, 0.10);
  --cf-radius: 16px;

  /* Bootstrap theme alignment */
  --bs-primary: var(--cf-primary);
  --bs-primary-rgb: 205, 169, 229;
  --bs-success: var(--cf-accent);
  --bs-success-rgb: 205, 169, 229;
  --bs-link-color: #CDA9E5;
  --bs-link-hover-color: #CDA9E5;
}

body {
  color: var(--cf-ink);
  background:
    radial-gradient(1200px 600px at 10% 0%, rgba(205,169,229,0.10), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(205,169,229,0.06), transparent 60%),
    radial-gradient(700px 420px at 60% 95%, rgba(2,6,23,0.05), transparent 60%),
    #f7fbf8;
}

/* Typography scale (clean + consistent) */
h1, h2, h3, h4, .h1, .h2, .h3, .h4 {
  letter-spacing: -0.01em;
}
.display-6 {
  font-size: clamp(1.85rem, 2.2vw + 1.1rem, 2.55rem);
  line-height: 1.12;
}
.h4 { font-size: 1.25rem; line-height: 1.2; }
.h5 { font-size: 1.1rem; line-height: 1.25; }

/* Subtle interactivity (not distracting) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Better focus visibility (keyboard) */
:where(a, button, input, select, textarea, .btn):focus-visible {
  outline: 0;
  box-shadow: 0 0 0 0.22rem rgba(205, 169, 229, 0.28);
}

/* Buttons: gentle hover/press feedback */
.btn {
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease, background-color .12s ease, border-color .12s ease;
  will-change: transform;
}
.btn:hover { filter: brightness(0.98); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { transform: none; filter: none; }

.btn-primary, .btn-success, .btn-cta {
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.10);
}
.btn-primary:hover, .btn-success:hover, .btn-cta:hover {
  box-shadow: 0 14px 30px rgba(2, 6, 23, 0.12);
}
.btn-outline-primary:hover, .btn-outline-secondary:hover, .btn-outline-danger:hover {
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.08);
}

/* Global button style: match primary CTA ("Найти предложение") */
.btn:not(.btn-link):not(.btn-close) {
  background: var(--cf-cta);
  border-color: var(--cf-cta);
  color: #fff;
  font-weight: 700;
}
.btn:not(.btn-link):not(.btn-close):hover,
.btn:not(.btn-link):not(.btn-close):focus {
  background: var(--cf-cta);
  border-color: var(--cf-cta);
  color: #fff;
  filter: brightness(0.92);
}
.btn:not(.btn-link):not(.btn-close):active {
  background: var(--cf-cta);
  border-color: var(--cf-cta);
  color: #fff;
  filter: brightness(0.88);
}
.btn:disabled, .btn.disabled {
  opacity: 0.6;
}

/* Links */
a {
  transition: color .12s ease, filter .12s ease;
}

/* Responsive media defaults */
img { max-width: 100%; height: auto; }

/* Comfortable reading width and typography for articles */
.cf-prose {
  font-size: 1.05rem;
  line-height: 1.7;
}
.cf-prose hr { margin: 1.25rem 0; }
.cf-prose p { margin: 0 0 0.9rem; }
.cf-prose ul, .cf-prose ol { margin: 0.6rem 0 1rem 1.25rem; }
.cf-prose li { margin: 0.25rem 0; }

@media (max-width: 575.98px) {
  .cf-prose { font-size: 1rem; }
}

.navbar.bg-white {
  background-color: rgba(255,255,255,0.82) !important;
}

.navbar .nav-link.active {
  font-weight: 700;
}

.navbar {
  backdrop-filter: saturate(1.2) blur(10px);
}

/* Mobile nav drawer */
.cf-mobile-nav .list-group-item {
  border: 0;
  border-radius: 12px;
  margin-bottom: 6px;
  padding: 12px 12px;
  font-weight: 600;
}
.cf-mobile-nav .list-group-item.active {
  background: rgba(205,169,229,0.14);
  color: var(--cf-ink);
}

/* Better touch targets on small screens */
@media (max-width: 575.98px) {
  .btn, .form-control, .form-select {
    min-height: 44px;
  }
  .btn.btn-sm {
    min-height: 38px;
  }
}

.cf-logo {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  image-rendering: auto;
}

.card {
  border: 1px solid var(--cf-border) !important;
  border-radius: var(--cf-radius);
}

.shadow-sm {
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.08) !important;
}

.cf-hero {
  position: relative;
  background:
    linear-gradient(180deg, rgba(205,169,229,0.35) 0%, rgba(205,169,229,0.10) 55%, rgba(247,251,248,0.0) 100%),
    radial-gradient(900px 420px at 20% 0%, rgba(205,169,229,0.18), transparent 60%),
    radial-gradient(820px 380px at 90% 25%, rgba(205,169,229,0.14), transparent 60%);
}

.cf-hero-title {
  color: rgba(11, 15, 20, 0.92);
}
.cf-hero-lead {
  color: rgba(11, 15, 20, 0.68);
}
.cf-hero .cf-pill {
  border-color: rgba(205,169,229,0.35);
  background: rgba(255,255,255,0.72);
}
.cf-hero .cf-pill i {
  color: rgba(205,169,229,0.95);
}

.cf-calc-card {
  border: 4px solid rgba(205,169,229,0.55) !important;
  border-radius: 22px !important;
  box-shadow: 0 18px 44px rgba(2, 6, 23, 0.10) !important;
  background: #fff;
}
.cf-calc-body {
  min-height: 600px;
}
@media (min-width: 992px) {
  .cf-calc-body { min-height: 660px; }
}
@media (max-width: 575.98px) {
  .cf-calc-body { min-height: 0; }
}
.cf-calc-card .form-control,
.cf-calc-card .form-select {
  border-width: 2px;
  border-color: rgba(205,169,229,0.45);
}
.cf-calc-card .form-control:focus,
.cf-calc-card .form-select:focus {
  border-color: rgba(205,169,229,0.75);
}

/* Slightly larger spacing between key fields in hero calculator */
.cf-calc-field--term {
  margin-top: 10px; /* adds extra space between amount and term (in addition to vstack gap) */
}

/* Term field: combine value + slider into a single “cell” */
.cf-term-box {
  border: 2px solid rgba(205,169,229,0.45);
  border-radius: 12px;
  background: #fff;
  padding: 14px 16px 12px;
}
.cf-term-value {
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  font-size: 1.25rem;
  font-weight: 800;
  color: rgba(11, 15, 20, 0.92);
  background: transparent !important;
  margin-bottom: 10px;
}
.cf-term-scale span {
  color: rgba(11, 15, 20, 0.55);
  font-weight: 600;
}

/* Range slider (hero calculator) */
.cf-range {
  accent-color: var(--cf-cta);
}
.cf-range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(167,96,222,0.28);
}
.cf-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--cf-cta);
  border: 2px solid #fff;
  box-shadow: 0 8px 18px rgba(2,6,23,0.16);
  margin-top: -6px;
}
.cf-range::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(167,96,222,0.28);
}
.cf-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--cf-cta);
  border: 2px solid #fff;
  box-shadow: 0 8px 18px rgba(2,6,23,0.16);
}

.cf-pill {
  border: 1px solid var(--cf-border);
  background: var(--cf-surface);
  backdrop-filter: blur(8px);
}

.cf-rate {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--cf-primary);
}
@media (max-width: 575.98px) {
  .cf-rate { font-size: 1.35rem; }
}

.btn-cta {
  background: var(--cf-cta);
  border-color: var(--cf-cta);
  color: #fff;
  font-weight: 700;
}
.btn-cta:hover,
.btn-cta:focus {
  background: var(--cf-cta);
  border-color: var(--cf-cta);
  color: #fff;
  filter: brightness(0.92);
}
.btn-cta:active {
  background: var(--cf-cta);
  border-color: var(--cf-cta);
  color: #fff;
  filter: brightness(0.88);
}

/* Home hero: make CTA slightly narrower (but keep mobile full width) */
.cf-cta-btn {
  width: 88%;
  margin-left: auto;
  margin-right: auto;
  display: block;
}
@media (max-width: 575.98px) {
  .cf-cta-btn { width: 100%; margin-left: 0; margin-right: 0; }
}

.btn-success { background: var(--cf-accent); border-color: var(--cf-accent); }

.card-hover { transition: transform .12s ease, box-shadow .12s ease; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--cf-shadow); }

.cf-offer-cell { position: relative; }
.cf-offer-cell:hover { outline: 2px solid rgba(205,169,229,0.16); }

/* Chips / presets */
.cf-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--cf-border);
  background: rgba(255,255,255,0.75);
  color: rgba(11, 15, 20, 0.85);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, filter .12s ease;
}
.cf-chip:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(2,6,23,0.08); border-color: rgba(205,169,229,0.35); }
.cf-chip:active { transform: translateY(0); }
.cf-chip.is-active {
  border-color: rgba(205,169,229,0.55);
  background: rgba(205,169,229,0.14);
  color: rgba(11, 15, 20, 0.92);
  box-shadow: 0 10px 24px rgba(2,6,23,0.08);
}

/* Small tooltip icon button */
.cf-tip {
  color: rgba(11, 15, 20, 0.55);
  text-decoration: none;
  line-height: 1;
}
.cf-tip:hover { color: rgba(205, 169, 229, 0.95); }

/* Gentle highlight after filters update */
@keyframes cfFlash {
  0% { box-shadow: 0 0 0 0 rgba(205,169,229,0.0); background-color: rgba(205,169,229,0.00); }
  35% { box-shadow: 0 0 0 4px rgba(205,169,229,0.18); background-color: rgba(205,169,229,0.06); }
  100% { box-shadow: 0 0 0 0 rgba(205,169,229,0.0); background-color: rgba(205,169,229,0.00); }
}
.cf-flash {
  border-radius: 16px;
  animation: cfFlash 900ms ease-out 1;
}

/* Mini stepper for "smart selection" */
.cf-steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cf-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--cf-border);
  background: rgba(255,255,255,0.72);
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(11, 15, 20, 0.82);
}
.cf-step b {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(205,169,229,0.18);
  color: rgba(11, 15, 20, 0.82);
  font-size: 0.8rem;
}

/* Trust blocks */
.cf-trust {
  border: 1px solid var(--cf-border);
  background: rgba(255,255,255,0.70);
  border-radius: 16px;
  padding: 14px 14px;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.06);
  backdrop-filter: blur(8px);
}
.cf-trust .fw-bold i {
  color: var(--cf-accent);
}

/* Compare insights */
.cf-insight {
  border: 1px solid var(--cf-border);
  background: rgba(255,255,255,0.72);
  border-radius: 16px;
  padding: 14px 14px;
}
.cf-insight-top {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cf-insight-kicker {
  font-size: 0.78rem;
  font-weight: 800;
  color: rgba(11, 15, 20, 0.70);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cf-insight-title {
  font-size: 1rem;
  font-weight: 800;
  color: rgba(11, 15, 20, 0.92);
}

.cf-bank-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--cf-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cf-bank-logo--lg {
  /* 2x smaller (was 88x88) */
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.08);
  padding: 0; /* logo goes into the big square (no inner small tile effect) */
}
.cf-bank-logo img {
  max-width: 40px;
  max-height: 40px;
}
.cf-bank-logo--lg img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
}

/* Offers list: make bank logos appear “full size” inside the tile */
.cf-bank-logo--offer {
  width: 92px;
  height: 92px;
  border-radius: 0;
  padding: 0;
  /* Offer list request: show logo without a frame */
  border: 0;
  background: transparent;
  box-shadow: none;
}
.cf-bank-logo--offer img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  /* Some partner logos come with large transparent margins; gently “zoom” so it reads bigger. */
  transform: scale(1.38);
  transform-origin: center center;
}

/* Partner banks: unify logo tiles (helps “real” logos look consistent) */
.cf-bank-logo--lg {
  background: #fff;
}

.cf-bank-fallback {
  font-weight: 800;
  color: var(--cf-primary);
}
.cf-bank-logo--lg .cf-bank-fallback {
  font-size: 1.15rem;
  line-height: 1;
}

.cf-partners {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* center rows (including the last row) */
  gap: 10px;
}

/* Home page partner lists: plain logos (no tiles), aligned in a neat grid */
.cf-partners--plain {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px 18px;
  align-items: center;
  justify-items: center;
}
.cf-partners--plain .cf-partner {
  /* Make logos readable and consistent (some logos are very light on the page background) */
  position: relative;
  border: 1px solid var(--cf-border);
  background: rgba(255,255,255,0.86);
  backdrop-filter: saturate(1.1) blur(6px);
  border-radius: 14px;
  padding: 16px 14px 12px; /* extra top space for accent bar */
  width: 100%;
  aspect-ratio: auto;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.06);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.cf-partners--plain .cf-partner::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 7px;
  background: var(--bank-accent, var(--cf-cta));
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  opacity: 0.95;
}
.cf-partners--plain .cf-partner:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(2, 6, 23, 0.08);
  border-color: rgba(167,96,222,0.35);
}
@supports (color: color-mix(in srgb, #000 50%, #fff)) {
  .cf-partners--plain .cf-partner:hover {
    border-color: color-mix(in srgb, var(--cf-cta) 38%, transparent);
    box-shadow:
      0 16px 40px rgba(2, 6, 23, 0.08),
      0 0 0 3px color-mix(in srgb, var(--cf-cta) 18%, transparent);
  }
}
.cf-partners--plain .cf-partner-logo {
  /* Larger, readable logos */
  height: 42px;
  width: auto;
  max-width: 100%;
  max-height: 42px;
  object-fit: contain;
  display: block;
  opacity: 1;
  transition: opacity .12s ease, filter .12s ease;
}
.cf-partners--plain .cf-partner:hover .cf-partner-logo {
  opacity: 1;
  filter: brightness(0.98);
}
.cf-partners--plain .cf-partner-fallback {
  height: 42px;
  width: 100%;
  max-width: 92px;
  background: transparent;
  font-size: 1.2rem;
}

.cf-partners--plain .cf-partner-name--plain {
  margin-top: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(11, 15, 20, 0.86);
}

/* Keep links clickable but without “square” focus ring in plain logo lists */
.cf-partners--plain .cf-partner:focus-visible {
  outline: none;
  box-shadow: none;
}
.cf-partners--plain .cf-partner:focus-visible .cf-partner-logo {
  opacity: 1;
  filter: brightness(0.98);
}

@media (max-width: 575.98px) {
  .cf-partners--plain {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px 12px;
  }
  .cf-partners--plain .cf-partner-logo {
    height: 34px;
    max-height: 34px;
  }
  .cf-partners--plain .cf-partner-fallback {
    height: 34px;
  }
}
.cf-partner {
  border: 1px solid var(--cf-border);
  background: var(--cf-surface);
  backdrop-filter: blur(8px);
  border-radius: var(--cf-radius);
  /* 2x smaller tiles for partner bank/MFO logos */
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  aspect-ratio: 1 / 1;
  overflow: hidden; /* no inner square, logo is clipped by the tile */
}

/* Offer card “premium” layout helpers */
.cf-metric {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.cf-metric-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(205,169,229,0.12);
  border: 1px solid rgba(205,169,229,0.22);
  color: rgba(11, 15, 20, 0.92);
  font-weight: 800;
}
.cf-metric-sep {
  opacity: 0.55;
  font-weight: 800;
}
.cf-cashback {
  font-size: 0.95rem;
  font-weight: 800;
  color: rgba(11, 15, 20, 0.78);
  white-space: nowrap;
}
.cf-metric-badge .cf-rate {
  font-size: 1.25rem;
  line-height: 1;
  margin: 0;
}
.cf-metric-hint {
  font-size: 0.78rem;
  color: rgba(11, 15, 20, 0.62);
}
.cf-offer-desc {
  margin-top: 8px;
  color: rgba(11, 15, 20, 0.68);
  font-size: 0.92rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  /* Keep card layout consistent even when description is missing */
  min-height: 2.6em; /* ~2 lines */
  /* Ensure long words/URLs never overflow the card */
  overflow-wrap: anywhere;
  word-break: break-word;
}
.cf-offer-desc--placeholder {
  color: rgba(11, 15, 20, 0.52);
}


/* Offer detail: long text blocks (description/requirements) must stay within the card */
.cf-offer-longtext {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.cf-kv {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.cf-kv-item {
  border: 1px solid var(--cf-border);
  background: rgba(255,255,255,0.70);
  border-radius: 12px;
  padding: 8px 10px;
  line-height: 1.2;
}
.cf-kv-item .k { font-size: 0.78rem; color: rgba(11, 15, 20, 0.58); }
.cf-kv-item .v { font-weight: 800; color: rgba(11, 15, 20, 0.90); }

/* Offers list: make Sum/Term/Query values more prominent (as requested) */
.cf-kv--offer .cf-kv-item .k {
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(11, 15, 20, 0.55);
}
.cf-kv--offer .cf-kv-item .v {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: rgba(11, 15, 20, 0.92);
}
@media (max-width: 575.98px) {
  .cf-kv--offer .cf-kv-item .v { font-size: 1.05rem; }
}

/* Offers list request: remove "frames" around Sum/Term/Query items (text only). */
.cf-kv--offer .cf-kv-item {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}
.cf-kv-item--query {
  border: 0;
  background: transparent;
  box-shadow: none;
}

/* Offer card: add purple border like the left filter card (lighter weight) */
.cf-offer-card {
  border: 2px solid rgba(205,169,229,0.55) !important;
  position: relative;
}
.cf-offer-card:hover {
  border-color: rgba(167,96,222,0.55) !important;
}

/* Offer list: move bank logo to the top-left corner and make it larger */
.cf-offer-card .cf-bank-logo--offer {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 128px;  /* ~2x compared to the old 64px tile */
  height: 128px;
  z-index: 2;
}
.cf-offer-card .cf-bank-logo--offer img {
  transform: none;
  transform-origin: center center;
  object-fit: contain;
}
.cf-offer-card .card-body {
  /* Make room for the absolute-positioned logo */
  padding-left: 160px;
  /* Make room for pinned top-right metric and bottom-right compare */
  padding-right: 190px;
}
@media (max-width: 575.98px) {
  .cf-offer-card .cf-bank-logo--offer {
    width: 96px;
    height: 96px;
    top: 14px;
    left: 14px;
  }
  .cf-offer-card .card-body {
    padding-left: 128px;
    padding-right: 160px;
  }
}

/* Offer cards: pin elements to keep a consistent layout across all offers */
.cf-offer-corner {
  position: absolute;
  z-index: 3;
}
.cf-offer-corner--tr {
  top: 16px;
  right: 16px;
}
@media (max-width: 575.98px) {
  .cf-offer-corner--tr {
    top: 12px;
    right: 12px;
  }
}

/* Compare checkbox cell: purple outline, similar to other “pill/cell” UI */
.cf-compare-pill {
  border: 2px solid rgba(205,169,229,0.55);
  background: rgba(255,255,255,0.80);
  border-radius: 12px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.cf-compare-pill--br {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 3;
}
@media (max-width: 575.98px) {
  .cf-compare-pill--br {
    right: 12px;
    bottom: 12px;
  }
}
.cf-compare-pill .form-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.cf-compare-pill .form-check-input {
  margin-top: 0;
  accent-color: var(--cf-cta);
  border-color: rgba(205,169,229,0.7);
}
.cf-compare-pill .form-check-input:checked {
  background-color: var(--cf-cta);
  border-color: var(--cf-cta);
}

/* Purple outline button that stays outline despite global .btn styling */
.btn.cf-btn-outline {
  background: transparent !important;
  color: var(--cf-cta) !important;
  border: 2px solid rgba(205,169,229,0.65) !important;
  box-shadow: none !important;
  border-radius: 12px;
}
.btn.cf-btn-outline:hover,
.btn.cf-btn-outline:focus {
  background: rgba(205,169,229,0.12) !important;
  border-color: rgba(167,96,222,0.65) !important;
  color: rgba(11, 15, 20, 0.92) !important;
}
.btn.cf-btn-outline:disabled,
.btn.cf-btn-outline.disabled {
  opacity: 0.55;
  background: transparent !important;
  color: rgba(11, 15, 20, 0.55) !important;
  border-color: rgba(205,169,229,0.35) !important;
}
.cf-partner-link {
  text-decoration: none;
  color: inherit;
}

.cf-partner-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain; /* scale logo up to tile without distortion */
}

.cf-partner-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 2.2rem;
  color: var(--cf-primary);
  background: #fff;
}
.cf-partner:hover {
  transform: translateY(-2px);
  box-shadow: var(--cf-shadow);
  border-color: rgba(167,96,222,0.45);
}

/* Partner bank hover accent (match CTA color) */
@supports (color: color-mix(in srgb, #000 50%, #fff)) {
  .cf-partner:hover {
    border-color: color-mix(in srgb, var(--cf-cta) 55%, transparent);
    box-shadow:
      0 16px 40px rgba(2, 6, 23, 0.10),
      0 0 0 3px color-mix(in srgb, var(--cf-cta) 22%, transparent);
  }
}
.cf-partner-name {
  width: 100%;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.15;
  font-weight: 600;
  color: rgba(11, 18, 32, 0.9);
  word-break: break-word;
}

.cf-partner-desc,
.cf-partner-history {
  width: 100%;
  text-align: center;
  color: rgba(11, 18, 32, 0.70);
  font-size: 0.82rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cf-partner-desc { -webkit-line-clamp: 2; }
.cf-partner-history { -webkit-line-clamp: 3; }

.cf-bank-more {
  width: 100%;
  margin-top: 2px;
}
.cf-bank-more > summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
  text-align: center;
  color: rgba(11, 18, 32, 0.75);
  font-size: 0.82rem;
  font-weight: 600;
}
.cf-bank-more > summary::-webkit-details-marker { display: none; }
.cf-bank-full {
  margin-top: 8px;
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.45;
  color: rgba(11, 18, 32, 0.85);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--cf-border);
  border-radius: 12px;
  padding: 10px 12px;
}

/* Fixed count per row (centered) */
@media (min-width: 992px) {
  .cf-partner {
    /* was 7 per row -> make ~2x smaller by showing 14 per row */
    flex: 0 0 calc((100% - 10px * 13) / 14);
    max-width: calc((100% - 10px * 13) / 14);
  }
}
@media (min-width: 576px) and (max-width: 991.98px) {
  .cf-partner {
    /* was 5 per row -> make ~2x smaller by showing 10 per row */
    flex: 0 0 calc((100% - 10px * 9) / 10);
    max-width: calc((100% - 10px * 9) / 10);
  }
}
@media (max-width: 575.98px) {
  .cf-partners {
    /* Mobile: no horizontal scroll; align logos in a neat grid */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 10px;
    overflow-x: visible;
    padding-bottom: 0;
    scroll-snap-type: none;
    justify-items: center;
  }
  .cf-partner {
    min-width: 0;
    width: 100%;
    max-width: 96px; /* keeps tiles from stretching too wide */
    scroll-snap-align: unset;
  }
}

/* Sticky filters on desktop to keep UX simple */
@media (min-width: 992px) {
  .cf-sticky {
    position: sticky;
    top: 88px;
  }
}

/* Mobile/tablet: collapsible filters, but always visible on desktop */
@media (min-width: 992px) {
  .cf-collapse-lg.collapse {
    display: block !important;
    height: auto !important;
    visibility: visible !important;
  }
}

@media (min-width: 768px) {
  .cf-collapse-md.collapse {
    display: block !important;
    height: auto !important;
    visibility: visible !important;
  }
}

/* Sticky action bar for mobile (safe-area aware) */
.cf-mobile-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,0.86);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--cf-border);
}
.cf-mobile-bar .btn { width: 100%; }
.cf-has-mobile-bar {
  padding-bottom: calc(78px + env(safe-area-inset-bottom));
}
