:root {
  --bg: #F4F7FB; --surface: #FFFFFF; --surface-2: #EEF2F8; --border: #CBD5E1; --border-strong: #94A3B8;
  --text: #0F172A; --muted: #475569; --blue: #087E47; --gold: #B45309; --amber: #D97706;
  --green: #087E47; --red: #DC2626; --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px); --tabbar-h: 64px;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: #64748B #E2E8F0; }
::selection { background: #D1FAE5; color: #064E3B; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(120% 60% at 50% 0%, #D1FAE5 0%, #F4F7FB 55%, #F8FAFC 100%);
  background-attachment: fixed;
  color: var(--text); line-height: 1.45; min-height: 100dvh;
  accent-color: var(--blue);
  -webkit-tap-highlight-color: transparent; padding-bottom: var(--safe-bottom);
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; }
.hidden { display: none !important; }
.text-emerald { color: var(--green); }
.text-muted { color: var(--muted); }
.rate-zero { color: #059669; }

/* Header */
.app-header {
  position: sticky; top: 0; z-index: 50; padding-top: var(--safe-top);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-container { 
  max-width: 760px; 
  margin: 0 auto; 
  padding: 8px 12px; 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  gap: 8px; 
  min-height: 48px;
}
.brand-identity { 
  display: flex; 
  align-items: center; 
  gap: 8px; 
  min-width: 0;
  flex: 1 1 auto;
}
.brand-logo-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.brand-text { 
  display: flex; 
  flex-direction: column; 
  min-width: 0;
  line-height: 1.15;
}
.brand-title { 
  font-weight: 800; 
  font-size: 16px; 
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}
.badge-247 { 
  background: var(--amber); 
  color: #111; 
  font-size: 10px; 
  font-weight: 800;
  padding: 1px 5px; 
  border-radius: 4px; 
  vertical-align: middle; 
  flex-shrink: 0;
}
.brand-sub { 
  font-size: 11px; 
  color: var(--muted); 
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.btn-pwa-header { 
  display: inline-flex; 
  align-items: center; 
  gap: 5px; 
  background: #087E47; 
  color: #FFFFFF;
  padding: 6px 10px; 
  border-radius: 8px; 
  font-size: 12px; 
  font-weight: 700; 
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.btn-pwa-header:active {
  transform: scale(0.96);
}

/* Ticker */
.market-ticker-bar { overflow: hidden; background: var(--surface); border-bottom: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.ticker-inner { display: flex; gap: 14px; white-space: nowrap; padding: 8px 0; width: max-content; animation: ticker 28s linear infinite; }
.ticker-separator { opacity: .5; }
.dot-online { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 4px; box-shadow: 0 0 6px var(--green); }
@keyframes ticker { from { transform: translateX(100vw); } to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .ticker-inner { animation: none; padding-left: 16px; } }

.main-content { max-width: 760px; margin: 0 auto; padding: 16px; display: grid; gap: 20px; }
.section-title { font-size: 19px; font-weight: 800; }

/* Calculator */
.calculator-hero-card { background: linear-gradient(160deg, #073D2C 0%, var(--surface) 55%); border: 1px solid var(--border); border-radius: 20px; padding: 18px; display: grid; gap: 18px; }
.promo-pill { display: inline-flex; gap: 6px; align-items: center; background: rgba(253,224,71,.14); border: 1px solid rgba(253,224,71,.5); color: var(--gold); border-radius: 999px; padding: 6px 12px; font-size: 13px; margin-bottom: 10px; }
.hero-heading { font-size: 23px; line-height: 1.2; font-weight: 800; margin-bottom: 6px; }
.hero-desc { color: #C7D2FE; font-size: 14px; }
.calc-group { display: grid; gap: 8px; }
.calc-label-row { display: flex; justify-content: space-between; align-items: baseline; }
.calc-label { color: var(--muted); font-size: 14px; }
.calc-value-display { font-size: 22px; font-weight: 800; }
.range-slider { width: 100%; height: 28px; accent-color: var(--gold); cursor: pointer; }
.slider-range-limits { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; }
.amount-chip, .days-chip { background: var(--surface-2); border: 1px solid var(--border); padding: 6px 10px; border-radius: 999px; font-size: 13px; }
.amount-chip.active, .days-chip.active { background: var(--gold); color: #111; border-color: var(--gold); font-weight: 700; }
.calc-result-panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: rgba(0,0,0,.25); border-radius: 14px; padding: 12px; }
.result-metric { display: flex; flex-direction: column; gap: 2px; }
.res-label { font-size: 11px; color: var(--muted); }
.res-val { font-size: 16px; font-weight: 800; }

/* Multi-apply */
.multi-apply-banner { background: var(--surface); border: 1px dashed var(--amber); border-radius: var(--radius); padding: 14px; display: grid; gap: 12px; }
.multi-apply-content { display: flex; gap: 10px; font-size: 13px; }
.multi-text { display: flex; flex-direction: column; gap: 2px; color: var(--muted); }
.multi-text strong { color: var(--text); }
.multi-icon { font-size: 22px; }
.btn-multi-apply { display: flex; justify-content: center; align-items: center; gap: 6px; background: var(--amber); color: #111; font-weight: 700; padding: 12px; border-radius: 12px; }

/* Filters */
.offers-filter-section { 
  display: grid; 
  gap: 12px; 
  margin-bottom: 18px; /* Generous bottom spacing before offer cards */
}
.filter-header-row { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
}
.offers-count { 
  font-size: 12px; 
  color: var(--muted); 
  background: var(--surface); 
  border: 1px solid var(--border);
  padding: 4px 10px; 
  border-radius: 999px; 
}
.filter-tabs-scrollable { 
  display: flex; 
  gap: 8px; 
  overflow-x: auto; 
  scrollbar-width: none; 
  padding: 2px 2px 8px 2px; /* Generous bottom padding */
  -webkit-overflow-scrolling: touch;
}
.filter-tabs-scrollable::-webkit-scrollbar { display: none; }
.filter-tab { 
  flex: 0 0 auto; 
  background: var(--surface); 
  border: 1px solid var(--border); 
  padding: 9px 15px; 
  border-radius: 999px; 
  font-size: 13px; 
  font-weight: 600;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.filter-tab:active {
  transform: scale(0.96);
}
.filter-tab.active { 
  background: #087E47; 
  border-color: #0A9B57; 
  color: #FFFFFF;
  font-weight: 800; 
  box-shadow: 0 4px 12px rgba(8, 126, 71, 0.4);
}

/* Offer cards */
.offers-list { display: grid; gap: 14px; }

.offer-card { 
  background: var(--surface); 
  border: 1px solid var(--border); 
  border-radius: var(--radius); 
  padding: 16px; 
  display: grid; 
  gap: 12px; 
}
.offer-card.top-card {
  padding-top: 26px; /* Space for the top ribbon */
}

.offer-card.top-card { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(253,224,71,.25), 0 10px 30px -12px rgba(253,224,71,.35); }

.offer-card-top { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  gap: 10px; 
  flex-wrap: wrap; 
}
.offer-brand { 
  display: flex; 
  gap: 12px; 
  align-items: center; 
  flex: 1 1 200px; 
  min-width: 0; 
}
.brand-meta {
  min-width: 0;
  overflow: hidden;
}
.brand-name {
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-avatar { 
  width: 52px; 
  height: 52px; 
  border-radius: 12px; 
  background: var(--brand-color); 
  display: grid; 
  place-items: center; 
  font-weight: 800; 
  font-size: 20px; 
  color: #fff; 
  flex-shrink: 0;
}
.brand-avatar-img {
  background: #1E293B !important;
  border: 1px solid #334155;
  padding: 4px;
}
.offer-brand-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.offer-tag { 
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px; 
  font-weight: 800; 
  letter-spacing: 0.3px;
  line-height: 1.25;
  padding: 5px 10px; 
  border-radius: 8px; 
  text-align: center; 
  white-space: normal; /* Allow soft wrap if long text */
  max-width: fit-content; 
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.offer-brand { display: flex; gap: 10px; align-items: center; }
.brand-avatar { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-color); display: grid; place-items: center; font-weight: 800; font-size: 20px; color: #fff; }
.brand-title-wrap { display: flex; align-items: center; gap: 4px; }
.brand-name { font-size: 17px; font-weight: 800; }
.verified-icon { color: #10B981; display: inline-flex; }
.brand-rating { font-size: 12px; color: var(--muted); display: flex; gap: 4px; align-items: center; }
.stars { color: var(--amber); letter-spacing: 1px; }
.rating-val { color: var(--text); font-weight: 700; }

.offer-tag.top { background: var(--gold); color: #111; }
.offer-tag.promo { background: rgba(236,72,153,.18); color: #F9A8D4; }
.offer-tag.success { background: rgba(16,185,129,.18); color: #6EE7B7; }
.offer-tag.fire { background: rgba(239,68,68,.18); color: #FCA5A5; }
.offer-tag.fast { background: rgba(8, 126, 71,.2); color: #93C5FD; }
.offer-metrics-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }

.offer-metrics-grid { 
  display: grid; 
  grid-template-columns: repeat(2, 1fr); 
  gap: 8px; 
}
.metric-item { 
  background: var(--surface-2); 
  border-radius: 12px; 
  padding: 10px 12px; 
  display: flex; 
  flex-direction: column; 
  min-width: 0;
}
.metric-value { 
  font-size: 16px; 
  font-weight: 800; 
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis; 
}

.metric-item.highlight { background: rgba(253,224,71,.1); border: 1px solid rgba(253,224,71,.4); }
.metric-label { font-size: 11px; color: var(--muted); }
.metric-value { font-size: 17px; font-weight: 800; }
.metric-sub { font-size: 10px; color: var(--muted); }

.trust-pills-row { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 6px; 
  align-items: center; 
}
.pill { 
  display: inline-flex; 
  align-items: center; 
  gap: 5px; 
  font-size: 11px; 
  font-weight: 600;
  padding: 5px 9px; 
  border-radius: 8px; 
  background: var(--surface-2); 
  border: 1px solid var(--border); 
  white-space: nowrap; 
}

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 4px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.pill-bankid { color: #93C5FD; }
.pill-diia { color: #fff; }
.diia-badge-sm { background: #000; color: #fff; border-radius: 4px; padding: 0 4px; font-weight: 800; }
.pill-success { color: #6EE7B7; }

.offer-calc-preview { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  flex-wrap: wrap;
  gap: 8px; 
  font-size: 12px; 
  color: var(--muted); 
  background: rgba(0,0,0,.25); 
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 10px 12px; 
  border-radius: 10px; 
}
.calc-preview-text {
  flex: 1 1 200px;
}

.offer-calc-preview strong { color: var(--text); }
.badge-saving { flex: 0 0 auto; color: var(--green); font-weight: 700; font-size: 11px; }
.btn-cta {
  position: relative; display: grid; justify-items: center; text-decoration: none; padding: 12px 40px;
  border-radius: 14px; background: linear-gradient(180deg, #22C55E, #059669); color: #fff;
  box-shadow: 0 8px 20px -8px rgba(16,185,129,.7); transition: transform .1s;
}
.btn-cta:active { transform: scale(.98); }
.btn-cta:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn-text { font-size: 17px; font-weight: 800; }
.btn-subtext { font-size: 11px; opacity: .9; }
.btn-arrow { position: absolute; right: 16px; top: 50%; translate: 0 -50%; }

/* Accordions */
.legal-accordion, .faq-item { background: var(--surface-2); border-radius: 12px; }
.legal-summary, .faq-summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; font-size: 12px; color: var(--muted); }
.faq-summary { font-size: 14px; color: var(--text); font-weight: 600; padding: 14px; }
.legal-summary::-webkit-details-marker, .faq-summary::-webkit-details-marker { display: none; }
details[open] .acc-chevron, details[open] .faq-chevron { rotate: 180deg; }
.legal-accordion-content, .faq-content { padding: 0 12px 12px; font-size: 12px; color: var(--muted); display: grid; gap: 4px; }
.faq-content { font-size: 14px; padding: 0 14px 14px; }
.faq-section { display: grid; gap: 8px; }

/* BankID / Steps */
.bankid-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; }
.bankid-logos { display: flex; gap: 6px; margin-bottom: 8px; }
.logo-diia-pill { background: #000; border: 1px solid #fff; padding: 3px 10px; border-radius: 8px; font-weight: 800; }
.logo-bankid-pill { background: var(--blue); padding: 3px 10px; border-radius: 8px; font-weight: 800; }
.bankid-box h3 { font-size: 16px; }
.bankid-desc { font-size: 13px; color: var(--muted); }
.bankid-benefits-list { list-style: none; display: grid; gap: 8px; font-size: 13px; }
.bankid-benefits-list li { display: flex; gap: 8px; }
.check-icon { color: var(--green); font-weight: 800; }
.how-it-works-section { display: grid; gap: 12px; }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.step-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.step-number { width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: #111; font-weight: 800; display: grid; place-items: center; margin-bottom: 8px; }
.step-card h4 { margin-bottom: 4px; }
.step-card p { font-size: 13px; color: var(--muted); }

/* Legal footer */
.app-legal-footer { border-top: 1px solid var(--border); background: #070D1F; margin-top: 24px; padding-bottom: 90px; }
.footer-container { max-width: 760px; margin: 0 auto; padding: 20px 16px; }
.legal-disclaimer-box { display: grid; gap: 12px; font-size: 12px; color: var(--muted); }
.legal-heading { display: flex; gap: 6px; align-items: center; color: var(--text); font-size: 14px; }
.legal-text { display: grid; gap: 10px; }
.legal-consequences-list { padding-left: 18px; display: grid; gap: 6px; }
.legal-rates-block, .calculation-example-box, .aggregator-status-notice { background: var(--surface); border-radius: 10px; padding: 10px; display: grid; gap: 6px; }
.legal-rates-block { border-left: 3px solid var(--amber); }
.aggregator-status-notice { border-left: 3px solid var(--red); }
.legal-text strong { color: var(--text); }
.footer-bottom-copy { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; }
.bank-logos-row { display: flex; gap: 6px; flex-wrap: wrap; }
.badge-mini { border: 1px solid var(--border); padding: 2px 6px; border-radius: 6px; font-size: 10px; }

/* Install banner */
.pwa-install-banner {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-bottom)); z-index: 60;
  max-width: 560px; margin: 0 auto; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 16px; padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,.5); translate: 0 160%; transition: translate .3s ease;
}
.pwa-install-banner.visible { translate: 0 0; }
.install-banner-content { display: flex; gap: 10px; align-items: center; }
.install-app-icon { border-radius: 12px; }
.install-banner-text { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.install-banner-text strong { color: var(--text); font-size: 14px; }
.install-banner-actions { display: flex; gap: 4px; align-items: center; }
.btn-install-primary { background: var(--blue); padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: 13px; }
.btn-install-dismiss { padding: 8px; color: var(--muted); }

/* iOS modal */
.ios-modal-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.6); display: none; align-items: flex-end; justify-content: center; }
.ios-modal-backdrop.open { display: flex; }
.ios-modal-card { width: 100%; max-width: 480px; background: var(--surface); border-radius: 20px 20px 0 0; padding: 18px 18px calc(18px + var(--safe-bottom)); display: grid; gap: 14px; }
.ios-modal-header { display: flex; justify-content: space-between; align-items: center; }
.ios-modal-body { display: grid; gap: 12px; }
.ios-step { display: flex; gap: 12px; align-items: center; }
.ios-step-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: #10B981; flex: 0 0 auto; }
.ios-step-desc { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.ios-step-desc strong { color: var(--text); }
.btn-ios-close { padding: 6px; color: var(--muted); }
.btn-ios-done { background: var(--blue); padding: 12px; border-radius: 12px; font-weight: 700; }

/* Debug drawer */
.debug-floating-btn { position: fixed; right: 12px; bottom: calc(90px + var(--safe-bottom)); z-index: 55; background: #000; border: 1px solid var(--amber); color: var(--amber); padding: 8px 10px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.tracking-debug-drawer { position: fixed; inset: auto 0 0 0; z-index: 80; max-height: 70dvh; overflow: auto; background: #050A18; border-top: 2px solid var(--amber); padding: 16px 16px calc(16px + var(--safe-bottom)); translate: 0 100%; transition: translate .3s; font-size: 12px; }
.tracking-debug-drawer.open { translate: 0 0; }
.debug-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.btn-debug-close { padding: 6px; }
.debug-note { color: var(--muted); margin-bottom: 10px; }
.debug-params-list { display: grid; gap: 4px; font-family: ui-monospace, Menlo, monospace; }
.debug-param-row { display: flex; gap: 8px; }
.debug-param-key { color: var(--amber); }
.debug-param-val { word-break: break-all; }
.debug-preview-section { margin-top: 12px; display: grid; gap: 6px; }
.debug-link-code { font-family: ui-monospace, Menlo, monospace; background: var(--surface); padding: 8px; border-radius: 8px; word-break: break-all; color: #6EE7B7; }

/* Toast */
.app-toast { position: fixed; left: 50%; top: calc(70px + var(--safe-top)); translate: -50% -20px; opacity: 0; z-index: 90; background: var(--surface-2); border: 1px solid var(--border); padding: 10px 16px; border-radius: 12px; font-size: 13px; pointer-events: none; transition: opacity .25s, translate .25s; max-width: 90vw; text-align: center; }
.app-toast.visible { opacity: 1; translate: -50% 0; }

@media (min-width: 640px) {
  .offer-metrics-grid { grid-template-columns: repeat(4, 1fr); }
  .multi-apply-banner { grid-template-columns: 1fr auto; align-items: center; }
}



/* ==================== MULTI-SCREEN APP ARCHITECTURE ==================== */
.app-screen {
  display: none;
  animation: fadeInScreen 0.22s ease-out;
}
.app-screen.active {
  display: block;
}
@keyframes fadeInScreen {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header Quick Calc Button */
.btn-header-calc {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--gold);
  font-weight: 800;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 9px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-header-calc:active {
  transform: scale(0.96);
  background: var(--border);
}

/* Offers Summary Card (Screen 1) */
.offers-summary-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 14px;
}
.summary-left {
  display: flex;
  flex-direction: column;
}
.summary-label {
  font-size: 11px;
  color: var(--muted);
}
.summary-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.btn-change-params {
  font-size: 12px;
  color: var(--gold);
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(253, 224, 71, 0.12);
  border: 1px solid rgba(253, 224, 71, 0.3);
}

/* Calc Direct Action Button */
.btn-calc-cta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: linear-gradient(180deg, #087E47, #073D2C);
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 800;
  padding: 14px;
  border-radius: 14px;
  margin-top: 10px;
  box-shadow: 0 8px 20px -6px rgba(8, 126, 71, 0.6);
  cursor: pointer;
  transition: transform 0.15s;
}
.btn-calc-cta:active {
  transform: scale(0.98);
}

/* Legal Page Full Card */
.legal-page-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px 16px;
  display: grid;
  gap: 16px;
}

/* ==================== APP BOTTOM TAB BAR ==================== */
body {
  padding-bottom: calc(72px + var(--safe-bottom)) !important;
}
.app-tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99;
  height: calc(64px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #070D1F;
  border-top: 1px solid #1E293B;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6);
}
.tab-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 6px 0;
  transition: all 0.15s ease;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.tab-button:active {
  transform: scale(0.92);
}
.tab-button.active {
  color: #FDE047;
}
.tab-button.active .tab-icon-wrap {
  color: #FDE047;
  transform: translateY(-2px);
}
.tab-button.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: #FDE047;
  box-shadow: 0 2px 8px rgba(253, 224, 71, 0.6);
}
.tab-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}
.tab-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.tab-calc-badge svg {
  stroke-width: 2.2;
}

/* Desktop container adaptation */
@media (min-width: 768px) {
  .app-tab-bar {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 520px;
    bottom: 16px;
    height: 64px;
    padding-bottom: 0;
    border-radius: 20px;
    border: 1px solid #24335F;
  }
}

/* Offer Brand Image Logo */
.brand-avatar-img {
  background: #FFFFFF !important;
  padding: 3px;
  overflow: hidden;
}
.offer-brand-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

/* ==================== HIGH CTR / CONVERSION UI/UX STYLING ==================== */
/* Ribbon for top card */
.offer-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s;
}
.offer-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.ribbon-popular {
  position: absolute;
  top: 0;
  right: 0;
  background: linear-gradient(90deg, #F59E0B, #EF4444);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 12px 3px 14px;
  border-radius: 0 0 0 12px;
  letter-spacing: 0.4px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
  z-index: 2;
}

/* Approval Progress Meter */
.approval-meter-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 10px;
  padding: 8px 10px;
}
.approval-meter-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}
.meter-title {
  color: #94A3B8;
  font-weight: 600;
}
.meter-percent {
  color: #10B981;
  font-weight: 800;
  font-size: 12px;
}
.approval-progress-track {
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}
.approval-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981, #34D399);
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* Pulsing animated CTA Shimmer Button */
.btn-cta-shimmer {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
  box-shadow: 0 8px 24px -4px rgba(16, 185, 129, 0.65) !important;
}
.btn-cta-shimmer::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 80%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  animation: btnShimmer 3s infinite ease-in-out;
}
@keyframes btnShimmer {
  0% { left: -120%; }
  35% { left: 140%; }
  100% { left: 140%; }
}

/* Social Proof FOMO Counter under CTA */
.recent-apps-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: #94A3B8;
  margin-top: 6px;
}
.pulse-green-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseDot 1.8s infinite;
}
@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Trust Badges enhancement */
.pill-diia {
  background: #000000 !important;
  color: #FFFFFF !important;
  border-color: #334155 !important;
  font-weight: 700;
}
.pill-bankid {
  background: rgba(8, 126, 71, 0.18) !important;
  color: #10B981 !important;
  border-color: rgba(8, 126, 71, 0.4) !important;
  font-weight: 700;
}

@media (max-width: 480px) {
  .offer-card-top {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
  }
  .offer-brand {
    flex: 1 1 auto;
    min-width: 0;
  }
  .offer-tag {
    font-size: 10px;
    padding: 4px 8px;
    max-width: 140px;
    word-break: normal;
  }
}

/* Dedicated Badge Row - eliminates any overlap with brand title or reviews */
.offer-card-top {
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  gap: 12px !important;
  width: 100% !important;
}
.offer-brand {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  width: 100% !important;
  min-width: 0 !important;
}
.brand-meta {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}
.brand-title-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}
.brand-rating {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  font-size: 12px !important;
  color: var(--muted) !important;
}
.votes-cnt {
  color: #94A3B8 !important;
  font-size: 11px !important;
}

.offer-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 6px 10px;
  margin-top: -2px;
}
.offer-badge-row .offer-tag {
  margin: 0 !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  letter-spacing: 0.3px !important;
  box-shadow: none !important;
}
.tag-meta-hint {
  font-size: 11px;
  color: #94A3B8;
  font-weight: 500;
}

/* ==================== STRICT 1-ROW COMPACT HEADER ==================== */
.offer-card-top-compact {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  margin-bottom: 2px !important;
}

.brand-left-group {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

.brand-left-group .brand-avatar {
  width: 44px !important;
  height: 44px !important;
  border-radius: 10px !important;
  flex-shrink: 0 !important;
}

.brand-left-group .brand-meta {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  min-width: 0 !important;
}

.brand-left-group .brand-name {
  font-size: 16px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
}

.brand-left-group .brand-rating {
  font-size: 11px !important;
  line-height: 1 !important;
  display: flex !important;
  align-items: center !important;
  gap: 3px !important;
}
.brand-left-group .brand-rating .stars {
  font-size: 12px !important;
  color: var(--amber) !important;
}
.brand-left-group .brand-rating .rating-val {
  font-weight: 800 !important;
  color: var(--text) !important;
}
.brand-left-group .brand-rating .votes-cnt {
  font-size: 10px !important;
  color: var(--muted) !important;
}

.brand-right-badge {
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
}

.compact-offer-tag {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: 0.2px !important;
  padding: 4px 8px !important;
  border-radius: 6px !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
  max-width: 150px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.compact-offer-tag.top { background: var(--gold) !important; color: #111 !important; }
.compact-offer-tag.promo { background: rgba(236,72,153,.2) !important; color: #F9A8D4 !important; border: 1px solid rgba(236,72,153,.4) !important; }
.compact-offer-tag.success { background: rgba(16,185,129,.2) !important; color: #6EE7B7 !important; border: 1px solid rgba(16,185,129,.4) !important; }
.compact-offer-tag.fire { background: rgba(239,68,68,.2) !important; color: #FCA5A5 !important; border: 1px solid rgba(239,68,68,.4) !important; }
.compact-offer-tag.fast { background: rgba(8, 126, 71,.25) !important; color: #93C5FD !important; border: 1px solid rgba(8, 126, 71,.5) !important; }

/* Further reduce size for tiny screens */
@media (max-width: 380px) {
  .compact-offer-tag {
    font-size: 9px !important;
    padding: 3px 6px !important;
    max-width: 125px !important;
  }
  .brand-left-group .brand-name {
    font-size: 15px !important;
  }
  .brand-left-group .brand-avatar {
    width: 38px !important;
    height: 38px !important;
  }
}

/* ==================== 1. LIVE SOCIAL PROOF TOASTS ==================== */
.social-proof-container {
  position: fixed;
  bottom: calc(76px + var(--safe-bottom));
  left: 12px;
  right: 12px;
  max-width: 380px;
  margin: 0 auto;
  z-index: 95;
  pointer-events: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.social-proof-container.visible {
  opacity: 1;
  transform: translateY(0);
}
.social-toast-card {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 0 12px rgba(16, 185, 129, 0.2);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.social-toast-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}
.social-toast-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  line-height: 1.3;
  flex: 1;
}
.social-toast-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.social-toast-title strong {
  color: #EEF2FF;
  font-weight: 700;
}
.social-toast-time {
  font-size: 10px;
  color: #94A3B8;
}
.social-toast-desc {
  color: #CBD5E1;
}
.social-toast-desc strong {
  color: #FDE047;
}
.social-toast-close {
  background: transparent;
  border: none;
  color: #64748B;
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
}

/* ==================== 3. PROMO TIMER STRIP ==================== */
.promo-countdown-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.15), rgba(245, 158, 11, 0.15));
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 12px;
}
.strip-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #CBD5E1;
  font-weight: 600;
}
.pulse-red-badge {
  background: #EF4444;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  animation: pulseBadge 2s infinite;
}
@keyframes pulseBadge {
  0% { transform: scale(0.96); }
  50% { transform: scale(1.04); }
  100% { transform: scale(0.96); }
}
.strip-right {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #94A3B8;
}
.timer-box {
  background: #0F172A;
  color: #FDE047;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(253, 224, 71, 0.3);
}

/* ==================== 6. PUSH OPT-IN PROMPT BANNER ==================== */
.push-optin-banner {
  position: fixed;
  top: calc(14px + var(--safe-top));
  left: 12px;
  right: 12px;
  max-width: 460px;
  margin: 0 auto;
  z-index: 98;
  background: rgba(19, 29, 59, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid #0A9B57;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform: translateY(-120%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.push-optin-banner.visible {
  transform: translateY(0);
}
.push-optin-content {
  display: flex;
  gap: 10px;
  align-items: center;
}
.push-optin-icon {
  font-size: 26px;
  flex-shrink: 0;
}
.push-optin-text {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: #94A3B8;
}
.push-optin-text strong {
  color: #EEF2FF;
  font-size: 14px;
}
.push-optin-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.btn-push-allow {
  background: #087E47;
  color: #FFFFFF;
  border: none;
  font-weight: 700;
  font-size: 12px;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
}
.btn-push-later {
  background: transparent;
  color: #94A3B8;
  border: 1px solid #334155;
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}

/* ==================== HERO PARAMETERS SELECTION CARD ==================== */
.offers-params-card-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(8, 126, 71, 0.16) 0%, rgba(30, 41, 59, 0.9) 100%);
  border: 1px solid rgba(8, 126, 71, 0.45);
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.5), 0 0 16px rgba(8, 126, 71, 0.15);
  padding: 12px 14px;
  border-radius: 16px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
}
.offers-params-card-hero:active {
  transform: scale(0.98);
  border-color: #10B981;
  background: linear-gradient(135deg, rgba(8, 126, 71, 0.25) 0%, rgba(30, 41, 59, 0.95) 100%);
}
.params-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #087E47, #073D2C);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(8, 126, 71, 0.4);
}
.params-content-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.params-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.params-badge-tag {
  font-size: 10px;
  font-weight: 800;
  color: #93C5FD;
  letter-spacing: 0.5px;
}
.params-action-hint {
  font-size: 11px;
  color: #FDE047;
  font-weight: 600;
}
.params-values-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
}
.params-amount-val {
  font-size: 19px;
  font-weight: 900;
  color: #FFFFFF;
  letter-spacing: -0.3px;
}
.params-days-val {
  font-size: 14px;
  font-weight: 700;
  color: #E2E8F0;
}
.params-rate-val {
  font-size: 12px;
  font-weight: 800;
  color: #FDE047;
  background: rgba(253, 224, 71, 0.12);
  border: 1px solid rgba(253, 224, 71, 0.3);
  padding: 1px 6px;
  border-radius: 5px;
}
.params-divider {
  color: #64748B;
  font-size: 12px;
}
.params-arrow-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94A3B8;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.offers-params-card-hero:hover .params-arrow-btn {
  transform: translateX(3px);
  color: #FFFFFF;
  background: #087E47;
}

/* ==================== SCREEN 2: COMPACT CALC + STICKY FIRST-VIEW CTA ==================== */
#screen-calculator {
  padding-bottom: 70px; /* Space for the sticky button above tab bar */
}
#screen-calculator .calculator-hero-card {
  padding: 14px 14px 18px;
  gap: 12px;
}
#screen-calculator .hero-heading {
  font-size: 20px;
  margin-bottom: 2px;
}
#screen-calculator .hero-desc {
  font-size: 13px;
  line-height: 1.35;
}
#screen-calculator .calc-group {
  gap: 6px;
}
#screen-calculator .calc-value-display {
  font-size: 20px;
}
#screen-calculator .chips-row {
  gap: 5px;
}
#screen-calculator .amount-chip, 
#screen-calculator .days-chip {
  padding: 5px 8px;
  font-size: 12px;
}
#screen-calculator .calc-result-panel {
  padding: 10px;
  gap: 6px;
}
#screen-calculator .res-val {
  font-size: 15px;
}

/* Sticky Action Button at the bottom of the viewport above the tab bar */
.calc-sticky-cta-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(64px + var(--safe-bottom));
  z-index: 90;
  padding: 8px 16px;
  background: linear-gradient(180deg, transparent, rgba(11, 19, 43, 0.95) 30%, #0B132B 100%);
  display: flex;
  justify-content: center;
}
.btn-calc-cta-sticky {
  max-width: 728px;
  margin: 0 !important;
  padding: 13px 20px !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  border-radius: 14px !important;
  background: linear-gradient(135deg, #10B981, #059669) !important;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.5) !important;
}




/* ==================== FULLY ADAPTIVE SIMPLE LOAN CARD WITH CUSTOM INPUTS ==================== */
.simple-loan-card {
  background: var(--surface);
  border: 2px solid #087E47;
  box-shadow: 0 10px 28px -6px rgba(0, 0, 0, 0.65), 0 0 16px rgba(8, 126, 71, 0.2);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.simple-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.simple-question {
  font-size: 14px;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.2px;
}
.simple-promo-tag {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.5);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
}

/* Custom Amount Input Box */
.custom-input-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.custom-field-label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.edit-badge {
  font-size: 12px;
  font-weight: 700;
  color: #10B981;
  background: rgba(8, 126, 71, 0.15);
  border: 1px dashed rgba(96, 165, 250, 0.5);
  padding: 3px 10px;
  border-radius: 999px;
  transition: all 0.2s ease;
}
.custom-field-label:hover .edit-badge,
.custom-input-box:focus-within ~ .custom-field-label .edit-badge {
  color: #FDE047;
  border-color: #FDE047;
  background: rgba(253, 224, 71, 0.15);
}
.custom-input-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #080D1F;
  border: 2px solid #0A9B57;
  border-radius: 14px;
  padding: 6px 14px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6), 0 0 14px rgba(8, 126, 71, 0.25);
  width: 100%;
  max-width: 290px;
  cursor: text;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.custom-input-box:hover {
  border-color: #10B981;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6), 0 0 18px rgba(96, 165, 250, 0.35);
}
.custom-input-box:focus-within {
  border-color: #FDE047;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6), 0 0 22px rgba(253, 224, 71, 0.45);
  transform: scale(1.02);
}
.custom-input-icon {
  font-size: 16px;
  margin-right: 6px;
  opacity: 0.8;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
.custom-num-input {
  background: transparent !important;
  border: none !important;
  color: #FFFFFF !important;
  font-size: 34px !important;
  font-weight: 900 !important;
  text-align: center !important;
  width: 100% !important;
  padding: 2px 0 !important;
  letter-spacing: -0.5px !important;
  outline: none !important;
  cursor: text !important;
  -moz-appearance: textfield;
}
.custom-num-input::-webkit-outer-spin-button,
.custom-num-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.custom-currency-unit {
  font-size: 26px;
  font-weight: 900;
  color: #FDE047;
  margin-left: 6px;
}
.custom-input-hint {
  font-size: 11px;
  color: #94A3B8;
  font-weight: 500;
  text-align: center;
}

/* Quick Tap Amount Preset Buttons */
.simple-buttons-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.simple-buttons-grid .fin-chip {
  background: #1A2650;
  border: 1px solid #24335F;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 2px;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.simple-buttons-grid .fin-chip:active {
  transform: scale(0.95);
}
.simple-buttons-grid .fin-chip.active {
  background: #087E47;
  border-color: #10B981;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(8, 126, 71, 0.5);
}

/* Row 2: Term in Days Responsive Block */
.simple-term-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px;
  border-radius: 12px;
}
.term-header-mobile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.simple-term-label {
  font-size: 13px;
  font-weight: 700;
  color: #CBD5E1;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.custom-days-box {
  display: inline-flex;
  align-items: center;
  background: #080D1F;
  border: 2px solid #0A9B57;
  border-radius: 10px;
  padding: 4px 10px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  cursor: text;
  transition: all 0.2s ease;
}
.custom-days-box:hover {
  border-color: #10B981;
}
.custom-days-box:focus-within {
  border-color: #FDE047;
  box-shadow: 0 0 14px rgba(253, 224, 71, 0.4);
  transform: scale(1.03);
}
.custom-days-icon {
  font-size: 13px;
  margin-right: 4px;
  opacity: 0.8;
}
.custom-days-input {
  background: transparent !important;
  border: none !important;
  color: #FFFFFF !important;
  font-size: 18px !important;
  font-weight: 900 !important;
  width: 44px !important;
  text-align: center !important;
  padding: 0 !important;
  outline: none !important;
  cursor: text !important;
  -moz-appearance: textfield;
}
.custom-days-input::-webkit-outer-spin-button,
.custom-days-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.custom-days-unit {
  font-size: 13px;
  color: #FDE047;
  font-weight: 800;
  margin-left: 2px;
}
.custom-days-hint {
  font-size: 11px;
  color: #94A3B8;
  font-weight: 500;
}

/* 4 Compact Days Chips */
.simple-days-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.term-chip {
  background: #1A2650;
  border: 1px solid #24335F;
  color: #CBD5E1;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 4px;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.term-chip:active {
  transform: scale(0.95);
}
.term-chip.active {
  background: #10B981;
  border-color: #34D399;
  color: #FFFFFF;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

/* Super Clear Return Calculation Summary */
.simple-calc-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  color: #CBD5E1;
}
.calc-summary-left {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.calc-summary-right {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  color: #94A3B8;
}
.simple-gold {
  color: #FDE047;
  font-weight: 800;
  font-size: 16px;
}
.simple-green {
  color: #34D399;
  font-weight: 800;
}
.summary-dot {
  color: #64748B;
}

/* Mobile & compact header adaptation */
@media (max-width: 480px) {
  .header-container {
    padding: 6px 10px;
    gap: 6px;
  }
  .brand-logo-icon svg {
    width: 22px;
    height: 22px;
  }
  .brand-title {
    font-size: 15px;
  }
  .brand-sub {
    font-size: 10px;
  }
  .badge-247 {
    font-size: 9px;
    padding: 1px 4px;
  }
  .btn-header-calc {
    padding: 5px 8px;
    font-size: 12px;
    gap: 4px;
  }
  .btn-header-calc svg {
    width: 14px;
    height: 14px;
  }
  .btn-pwa-header {
    padding: 5px 8px;
    font-size: 11px;
    gap: 4px;
  }
  .btn-pwa-header svg {
    width: 14px;
    height: 14px;
  }
}

/* Very narrow devices (iPhone SE, 320px - 360px) */
@media (max-width: 360px) {
  .brand-sub {
    display: none; /* Hide subtitle on micro screens to keep brand and buttons on 1 line */
  }
  .brand-title {
    font-size: 14px;
  }
  .btn-header-calc span {
    font-size: 11px;
  }
  .btn-pwa-header span {
    display: none; /* Keep icon only on micro screens to avoid crowding */
  }
  .btn-pwa-header {
    padding: 6px 8px;
  }
}

/* Small mobile responsiveness (iPhone SE, compact Androids) */
@media (max-width: 380px) {
  .simple-loan-card {
    padding: 12px 10px;
    gap: 10px;
  }
  .custom-num-input {
    font-size: 26px !important;
  }
  .custom-currency-unit {
    font-size: 22px;
  }
  .simple-buttons-grid .fin-chip {
    font-size: 11px;
    padding: 8px 1px;
  }
  .term-chip {
    font-size: 11px;
    padding: 7px 2px;
  }
  .simple-calc-summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}


/* ==================== FINTECH LIGHT THEME & INTERACTIVE FEATURES ==================== */
.app-header {
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid #E2E8F0;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}
.badge-247 {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #F59E0B;
}
.btn-header-calc {
  background: #ECFDF5;
  border: 1px solid #93C5FD;
  color: #073D2C;
}
.market-ticker-bar {
  background: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
  color: #334155;
  font-weight: 500;
}

/* Promo Countdown & VIP Match Trigger */
.promo-countdown-strip {
  background: linear-gradient(90deg, #FFFBEB 0%, #FEF2F2 100%);
  border: 1px solid #FCD34D;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.08);
  padding: 9px 12px;
  border-radius: 14px;
}
.strip-left {
  color: #1E293B;
}
.timer-box {
  background: #FFFFFF;
  color: #DC2626;
  border: 1px solid #FCA5A5;
  padding: 2px 7px;
  border-radius: 6px;
}
.btn-vip-match-trigger {
  background: linear-gradient(135deg, #087E47, #4F46E5);
  color: #FFFFFF;
  font-size: 11.5px;
  font-weight: 800;
  padding: 6px 11px;
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(8, 126, 71, 0.28);
  transition: transform 0.15s ease;
}
.btn-vip-match-trigger:active {
  transform: scale(0.95);
}

/* Light Loan Calculator Card on Screen 1 */
.simple-loan-card {
  background: #FFFFFF;
  border: 1.5px solid #BFDBFE;
  box-shadow: 0 12px 30px -8px rgba(8, 126, 71, 0.12), 0 2px 8px rgba(15, 23, 42, 0.04);
}
.simple-question {
  color: #0F172A;
  font-size: 15px;
}
.simple-promo-tag {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #6EE7B7;
}
.edit-badge {
  color: #073D2C;
  background: #ECFDF5;
  border: 1px dashed #10B981;
}
.custom-field-label:hover .edit-badge,
.custom-input-box:focus-within ~ .custom-field-label .edit-badge {
  color: #B45309;
  border-color: #F59E0B;
  background: #FEF3C7;
}
.custom-input-box {
  background: #F8FAFC;
  border: 2px solid #0A9B57;
  box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(8, 126, 71, 0.1);
}
.custom-input-box:focus-within {
  background: #FFFFFF;
  border-color: #087E47;
  box-shadow: 0 0 0 4px rgba(8, 126, 71, 0.15);
}
.custom-num-input {
  color: #0F172A !important;
}
.custom-currency-unit {
  color: #087E47;
}
.custom-input-hint,
.custom-days-hint {
  color: #475569;
}
.simple-buttons-grid .fin-chip {
  background: #F1F5F9;
  border: 1px solid #94A3B8;
  color: #1E293B;
}
.simple-buttons-grid .fin-chip.active {
  background: #087E47;
  border-color: #073D2C;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(8, 126, 71, 0.3);
}
.simple-term-row {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
}
.simple-term-label {
  color: #1E293B;
}
.custom-days-box {
  background: #FFFFFF;
  border: 1.5px solid #0A9B57;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}
.custom-days-input {
  color: #0F172A !important;
}
.custom-days-unit {
  color: #087E47;
}
.term-chip {
  background: #FFFFFF;
  border: 1px solid #94A3B8;
  color: #334155;
}
.term-chip.active {
  background: #059669;
  border-color: #047857;
  color: #FFFFFF;
}
.simple-calc-summary {
  background: linear-gradient(90deg, #ECFDF5 0%, #ECFDF5 100%);
  border: 1px solid #BFDBFE;
  color: #1E293B;
}
.calc-summary-right {
  color: #334155;
}
.simple-gold {
  color: #073D2C;
  font-size: 17px;
}
.simple-green {
  color: #047857;
}

/* Interactive Approval Radar Card */
.approval-radar-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: 0 6px 20px -6px rgba(15, 23, 42, 0.06);
  display: grid;
  gap: 10px;
}
.radar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.radar-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.radar-badge-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.radar-title {
  font-size: 14px;
  font-weight: 800;
  color: #0F172A;
}
.radar-subtitle {
  font-size: 11.5px;
  color: #475569;
}
.radar-score-pill {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  font-weight: 900;
  font-size: 15px;
  padding: 5px 11px;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
  flex-shrink: 0;
}
.radar-gauge-track {
  height: 8px;
  background: #E2E8F0;
  border-radius: 999px;
  overflow: hidden;
}
.radar-gauge-fill {
  height: 100%;
  background: linear-gradient(90deg, #0A9B57 0%, #10B981 100%);
  border-radius: 999px;
  transition: width 0.35s ease;
}
.radar-toggles-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
}
.radar-toggles-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.radar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #F8FAFC;
  border: 1px solid #94A3B8;
  color: #334155;
  transition: all 0.15s ease;
}
.radar-toggle.active {
  background: #ECFDF5;
  border-color: #087E47;
  color: #064E3B;
}
.toggle-check {
  font-weight: 900;
  color: #087E47;
}
.boost-tag {
  font-size: 10px;
  font-weight: 800;
  background: #D1FAE5;
  color: #073D2C;
  padding: 1px 5px;
  border-radius: 999px;
}

/* Multi-Apply Booster */
.multi-apply-banner {
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border: 1px solid #F59E0B;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.1);
  margin-bottom: 18px;
}
.multi-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}
.multi-progress-pill {
  font-size: 11px;
  font-weight: 800;
  background: #FFFFFF;
  color: #B45309;
  border: 1px solid #F59E0B;
  padding: 2px 8px;
  border-radius: 999px;
}
.btn-multi-apply {
  background: linear-gradient(135deg, #087E47, #073D2C);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(8, 126, 71, 0.3);
}

/* Offer Cards in Light Mode */
.offer-card {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  box-shadow: 0 6px 20px -6px rgba(15, 23, 42, 0.07), 0 1px 3px rgba(15, 23, 42, 0.04);
}
.offer-card:hover {
  box-shadow: 0 12px 28px -6px rgba(15, 23, 42, 0.12);
}
.offer-card.top-card {
  border: 2px solid #F59E0B;
  box-shadow: 0 10px 28px -8px rgba(245, 158, 11, 0.22);
}
.offer-card.offer-applied {
  border-color: #10B981;
  background: linear-gradient(180deg, #F0FDF4 0%, #FFFFFF 35%);
}
.brand-avatar-img {
  background: #F8FAFC !important;
  border: 1px solid #E2E8F0 !important;
}
.verified-icon {
  color: #087E47;
}
.compact-offer-tag.top { background: #FEF3C7 !important; color: #92400E !important; border: 1px solid #F59E0B !important; }
.compact-offer-tag.promo { background: #FCE7F3 !important; color: #9D174D !important; border: 1px solid #F472B6 !important; }
.compact-offer-tag.success { background: #DCFCE7 !important; color: #065F46 !important; border: 1px solid #34D399 !important; }
.compact-offer-tag.fire { background: #FEE2E2 !important; color: #991B1B !important; border: 1px solid #F87171 !important; }
.compact-offer-tag.fast { background: #D1FAE5 !important; color: #073D2C !important; border: 1px solid #10B981 !important; }

.approval-meter-wrap {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
}
.meter-title {
  color: #065F46;
}
.meter-percent {
  color: #047857;
}
.approval-progress-track {
  background: #D1FAE5;
}
.metric-item {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
}
.metric-item.highlight {
  background: #ECFDF5;
  border: 1px solid #6EE7B7;
}
.pill {
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  color: #334155;
}
.pill-bankid {
  background: #ECFDF5 !important;
  color: #073D2C !important;
  border-color: #93C5FD !important;
}
.pill-success {
  background: #ECFDF5;
  color: #047857;
  border-color: #A7F3D0;
}
.pill-applied-status {
  background: #DCFCE7;
  color: #065F46;
  border: 1px solid #34D399;
  font-weight: 800;
}
.offer-calc-preview {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  color: #475569;
}
.badge-saving {
  color: #047857;
  background: #DCFCE7;
  padding: 2px 8px;
  border-radius: 999px;
}
.recent-apps-counter {
  color: #475569;
}
.legal-accordion, .faq-item {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
}

/* Screen 2 Calculator Light Mode */
.calculator-hero-card {
  background: linear-gradient(160deg, #ECFDF5 0%, #FFFFFF 60%);
  border: 1px solid #BFDBFE;
  box-shadow: 0 10px 25px -8px rgba(8, 126, 71, 0.12);
}
.promo-pill {
  background: #FEF3C7;
  border: 1px solid #F59E0B;
  color: #92400E;
}
.hero-desc {
  color: #475569;
}
.range-slider {
  accent-color: var(--blue);
}
@supports not (accent-color: #087E47) {
  .range-slider {
    -webkit-appearance: none;
    appearance: none;
    background: #CBD5E1;
    height: 8px;
    border-radius: 4px;
  }
  .range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #087E47;
  }
}
.amount-chip, .days-chip {
  background: #F1F5F9;
  border: 1px solid #94A3B8;
  color: #1E293B;
}
.amount-chip.active, .days-chip.active {
  background: #087E47;
  border-color: #073D2C;
  color: #FFFFFF;
}
.calc-result-panel {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
}
.calc-sticky-cta-wrap {
  background: linear-gradient(180deg, transparent, rgba(244, 247, 251, 0.95) 30%, #F4F7FB 100%);
}
.logo-bankid-pill {
  color: #FFFFFF;
}
.step-number {
  background: #D1FAE5;
  color: #073D2C;
}

/* Bottom Tab Bar in Light Mode */
.app-tab-bar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid #CBD5E1;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
}
.tab-button {
  color: #64748B;
}
.tab-button.active {
  color: #087E47;
}
.tab-button.active .tab-icon-wrap {
  color: #087E47;
}
.tab-button.active::before {
  background: #087E47;
  box-shadow: 0 2px 8px rgba(8, 126, 71, 0.4);
}
@media (min-width: 768px) {
  .app-tab-bar {
    border: 1px solid #CBD5E1;
  }
}

/* Light Toasts & Banners */
.social-toast-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #6EE7B7;
  box-shadow: 0 12px 28px -6px rgba(15, 23, 42, 0.15);
}
.social-toast-title strong {
  color: #0F172A;
}
.social-toast-time {
  color: #64748B;
}
.social-toast-desc {
  color: #334155;
}
.social-toast-desc strong {
  color: #047857;
}
.push-optin-banner,
.pwa-install-banner,
.app-toast {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #93C5FD;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
  color: #0F172A;
}
.push-optin-text {
  color: #475569;
}
.push-optin-text strong {
  color: #0F172A;
}
.btn-push-later {
  color: #475569;
  border-color: #94A3B8;
}

/* Native VIP Matchmaker Dialog */
dialog:modal {
  overscroll-behavior: contain;
}
dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}
.vip-match-dialog[open] {
  margin: auto;
  width: min(92vw, 440px);
  border: 1px solid #BFDBFE;
  border-radius: 22px;
  padding: 20px;
  background: #FFFFFF;
  color: #0F172A;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
}
.vip-dialog-inner {
  display: grid;
  gap: 12px;
}
.vip-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.vip-badge-pill {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #F59E0B;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
}
.btn-vip-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: #334155;
  font-weight: 700;
}
.vip-dialog-title {
  font-size: 19px;
  font-weight: 800;
}
.vip-dialog-sub {
  font-size: 13px;
  color: #475569;
}
.vip-match-body {
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 16px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

@media (forced-colors: active) {
  .offer-card, .simple-loan-card, .approval-radar-card, .btn-cta {
    border: 1px solid CanvasText;
  }
}


/* ==================== MOBILE OVERFLOW & BADGE FIT FIXES ==================== */
.main-content,
.offer-card,
.simple-loan-card,
.approval-radar-card,
.multi-apply-banner,
.calculator-hero-card {
  min-width: 0;
  max-width: 100%;
}

.radar-title-group {
  min-width: 0;
  flex: 1 1 auto;
}
.radar-title,
.radar-subtitle {
  overflow-wrap: break-word;
}

.pill {
  max-width: 100%;
  white-space: normal;
  line-height: 1.25;
}

.calc-summary-left,
.calc-summary-right {
  flex-wrap: wrap;
}

.btn-multi-apply {
  width: 100%;
  text-align: center;
}
@media (min-width: 640px) {
  .btn-multi-apply {
    width: auto;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 12px;
    gap: 14px;
  }
  .btn-cta {
    padding: 12px 34px 12px 16px;
  }
  .btn-arrow {
    right: 12px;
  }
  .btn-text {
    font-size: 16px;
  }
  .compact-offer-tag {
    white-space: normal !important;
    text-align: center !important;
    line-height: 1.15 !important;
    max-width: 130px !important;
  }
  .promo-countdown-strip {
    justify-content: space-between;
  }
  .btn-vip-match-trigger {
    flex-shrink: 0;
  }
}

@media (max-width: 380px) {
  .radar-toggles-row {
    gap: 5px;
  }
  .radar-toggle {
    font-size: 11px;
    padding: 5px 8px;
  }
  .promo-countdown-strip {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .btn-vip-match-trigger {
    width: 100%;
    text-align: center;
    padding: 7px 12px;
  }
  .offer-metrics-grid {
    gap: 6px;
  }
  .metric-item {
    padding: 8px 10px;
  }
  .metric-value {
    font-size: 15px;
  }
}

.offer-metrics-grid.offer-metrics-compact {
  grid-template-columns: repeat(3, 1fr);
}

body {
  background: linear-gradient(180deg, #073D2C 0%, #087E47 100%) fixed;
}

#screen-offers .section-title {
  color: #FFFFFF;
}

