#stickyBonusBar {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: #e9353d;
  height: 50px;
  display: flex;
  align-items: center;
  padding-left: 16px;
  color: white;
  font-size: 18px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.euro-amount {
  font-size: 28px;
  font-weight: 900;
  color: white;
  display: inline-flex;
  align-items: flex-start;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.euro-suffix {
  font-size: 10px;
  font-weight: normal;
  vertical-align: super;
  margin-left: 2px;
}
.top-form { margin-top: 24px; }

footer {
  font-size: 10px;
  text-align: center;
  color: #666;
  margin: 40px 0;
  background: transparent;
  padding: 8px;
}
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  letter-spacing: 0.3px;
  background: linear-gradient(180deg, #eceff4 0%, #e6e9ef 100%);
}

h1 {
  font-size: 26px;
  margin: 24px 16px;
  color: #e9353d;
  text-align: center;
}

form {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.05);
  padding: 24px;
  margin: 0 16px 24px;
}

button,
input[type="file"] {
  display: block;
  width: 100%;
  font-size: 16px;
  padding: 14px;
  border-radius: 12px;
  border: none;
  margin-bottom: 16px;
}

button {
  background: rgba(233,53,61,0.8);
  backdrop-filter: blur(10px);
  color: #fff;
  font-weight: 600;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(233,53,61,0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}
button:hover:not(:disabled) {
  background: rgba(233,53,61,1);
  transform: translateY(-1px);
}
button:disabled { background-color: #ccc; cursor: not-allowed; }

.card {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 16px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
  padding: 10px 20px;
  margin: 0 16px 24px;
}
.card h3 {
  margin-top: 0;
  color: #e9353d;
  font-size: 20px;
}

ul { list-style: none; padding: 0; margin: 0; }
ul li {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  font-size: 15px;
}

.highlight { font-weight: bold; color: #e9353d; }

#loadingOverlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  backdrop-filter: blur(10px);
  background-color: rgba(255,255,255,0.6);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}
#loadingTime {
  margin-top: 20px;
  font-size: 18px;
  font-weight: 500;
  color: #e9353d;
}

.spinner {
  width: 60px; height: 60px;
  border: 6px solid transparent;
  border-top-color: #e9353d;
  border-radius: 50%;
  animation: rotateSpinner 1s linear infinite;
}
.spinner.small {
  width: 30px; height: 30px;
  border-width: 4px;
  border-top-color: #aaa;
  animation-direction: reverse;
}
@keyframes rotateSpinner {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.analysis-grid {
  font-size: 14px;
  line-height: 1.3;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 16px;
  row-gap: 8px;
  align-items: start;
}
.analysis-grid .label {
  font-size: 13px;
  color: rgba(17, 17, 17, 0.65);
  font-weight: 600;
}
.analysis-grid .label.highlight {
  color: #e9353d;
}
.analysis-grid .label.muted {
  color: rgba(17, 17, 17, 0.55);
}
.analysis-grid .value {
  font-weight: 600;
}
.analysis-grid .full {
  grid-column: 1 / -1;
}

.muted {
  color: rgba(17, 17, 17, 0.55);
}

#scanControls button {
  padding: 12px 16px;
  text-align: center;
}

@media (max-width: 600px) {
  form, .card { margin: 0 8px 16px; padding: 16px; }
  h1 { font-size: 22px; margin: 16px 8px; }
  .card h3 { font-size: 18px; }
  ul li { font-size: 14px; }
  button, input[type="file"] { font-size: 15px; padding: 12px; }
  footer { font-size: 9px; margin: 24px 8px; }
}

@keyframes scanDown { 0% { top: 0; } 100% { top: 100%; } }

/* Weiße Icons in der Sticky-Leiste erzwingen */
#stickyBonusBar div[style*="font-size: 20px;"] {
  filter: brightness(0) invert(1);
}

.bon-wert {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  width: 80px;
}

@keyframes pulse {
  0% { background-color: #e9353d; }
  50% { background-color: #ff5b5b; }
  100% { background-color: #e9353d; }
}
.pulse-bonus {
  background-color: #e9353d !important;
  animation: pulse 1s ease-in-out 3;
  color: white;
  font-weight: bold;
}

/* === Utilities === */
.flex{display:flex;}
.flex-col{flex-direction:column;}
.items-center{align-items:center;}
.justify-center{justify-content:center;}
.justify-between{justify-content:space-between;}
.gap-16{gap:16px;}
.mr-16{margin-right:16px;}
.text-center{text-align:center;}
.text-white{color:#fff;}
.fs-10{font-size:10px;}
.fs-11{font-size:11px;}
.fs-12{font-size:12px;}
.fs-14{font-size:14px;}
.fs-18{font-size:18px;}
.fw-300{font-weight:300;}
.fw-600{font-weight:600;}
.pos-rel{position:relative;}
.pos-abs{position:absolute;}
.top-18{top:18px;}
.left-62{left:62px;}
.w-20{width:20px;}
.h-20{height:20px;}
.h-24{height:24px;}
.h-50{height:50px;}
.aspect-square{aspect-ratio:1/1;}
.opacity-40{opacity:.4;}
.cursor-pointer{cursor:pointer;}
.hidden{display:none;}
.mt-10{margin-top:10px;}
.mb-10{margin-bottom:10px;}
.mt-12{margin-top:12px;}
.mt-16{margin-top:16px;}
.mb-16{margin-bottom:16px;}
.p-16{padding:16px;}
.p-10{padding:10px;}
.round-16{border-radius:16px;}
.border-gray{border:1px solid #ddd;}
.bg-white{background:#fff;}
.bg-black-60{background-color:rgba(0,0,0,0.6);}

/* === Components === */
.sticky-icons{display:flex;align-items:center;gap:16px;margin-right:16px;}
.icon-stack{ text-align:center;color:#fff;font-size:14px;display:flex;flex-direction:column;align-items:center;}
.icon-emoji{font-size:20px;}
.icon-dots{display:flex;justify-content:center;align-items:flex-end;gap:2px;}
.icon-bar{width:3px;background:#fff;}
.icon-bar.s{height:8px;}
.icon-bar.m{height:14px;}
.icon-bar.l{height:10px;}

.partner-slider{overflow-x:auto;scroll-snap-type:x mandatory;display:flex;width:100%;-webkit-overflow-scrolling:touch;}
.partner-page{flex:0 0 100%;scroll-snap-align:start;}
.partner-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;padding:16px;}
.partner-kachel{
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius:16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  display:flex;
  align-items:center;
  justify-content:center;
  aspect-ratio:1/1;
  position:relative;
  overflow:hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.partner-kachel {
  background: #fff !important;
}

.partner-kachel::before {
  background: #fff !important;
}

.partner-kachel .logo {
  background: #fff !important;
}
.partner-kachel:hover{
  transform: scale(1.03);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.partner-kachel .logo{max-width:70%;max-height:70%;object-fit:contain;position:absolute;top:0;bottom:20%;left:0;right:0;margin:auto;}
.partner-kachel .bonusbar{
  position:absolute;
  bottom:0;
  width:100%;
  height:20%;
  font-size:10px;
  color: #111;
  text-align:center;
  line-height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  border-bottom-left-radius:16px;
  border-bottom-right-radius:16px;
  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(6px);
  border-top: 1px solid rgba(255,255,255,0.3);
}

.partner-kachel .bonusbar.pulse-bonus {
  color: #fff;
}

.dot{
  display:inline-block;
  width:10px;
  height:10px;
  margin:0 5px;
  border-radius:50%;
  background: rgba(255,255,255,0.3);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255,255,255,0.6);
}
.dot.active{
  background: rgba(255,255,255,0.9);
}

.statistik-wrap,.bons-wrap{padding:16px;}
.statistik-controls{display:flex;justify-content:center;gap:8px;margin-bottom:16px;}
.statistik-field{display:flex;flex-direction:column;align-items:center;}
.statistik-field label{font-size:12px;color:#444;margin-bottom:4px;}
.statistik-field input{padding:10px;font-size:16px;border-radius:8px;border:1px solid #ccc;}

.bons-header{display:flex;justify-content:space-between;align-items:center;margin:0 16px 32px;}
.bons-total{display:flex;flex-direction:column;align-items:flex-end;text-align:right;width:80px;}
.bons-total .sum{font-size:14px;}
.bons-total .bonus{font-size:11px;color:#0a0;}

.status{font-size:11px;}
.status.genehmigt{color:green;}
.status.abgelehnt{color:red;}
.status.pruefung{color:orange;}

/* === More utilities for inline-style removal === */
.flex-1{flex:1;}
.gap-8{gap:8px;}
.gap-12{gap:12px;}
.mt-8{margin-top:8px;}
.mt-24{margin-top:24px;}
.mx-auto{margin-left:auto;margin-right:auto;}
.ml-8{margin-left:8px;}
.text-brand{color:#e9353d;}
.text-muted{color:#777;}
.text-green{color:#0a0;}
.text-red{color:red;}
.m-0{margin:0;}
.w-60{width:60px;}
.maxw-120{max-width:120px;}
.fs-13{font-size:13px;}
.fw-500{font-weight:500;}
.mt-20{margin-top:20px;}
.my-20{margin-top:20px;margin-bottom:20px;}

/* Bons list components */
.list-header{display:flex;justify-content:space-between;font-size:14px;border-bottom:1px solid #eee;padding-bottom:6px;font-weight:600;}
.list-row{display:flex;justify-content:space-between;align-items:center;font-size:13px;padding:4px 0;}
.center-bold-lg{text-align:center;font-weight:bold;font-size:18px;}
.logo-cell{
  width:90px;
  height:24px; /* Container-Höhe für alle Logos in der Liste */
  display:flex;
  justify-content:center;
  align-items:center;
  overflow:hidden; /* verhindert Ausreißer */
}
.logo-cell img{
  max-height:100%;
  max-width:100%;
  width:auto;
  height:100%;
  object-fit:contain;
}

/* Empty state */
.empty-state{text-align:center;padding:40px;font-size:18px;}

/* === Overlays (default hidden, replacing former inline styles) === */
#loadingOverlay,
#infoOverlay,
#bonusOverlay,
#incompleteOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  backdrop-filter: blur(10px);
  background-color: rgba(255,255,255,0.8);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  text-align: center;
  color: #e9353d;
  font-weight: bold;
}

#loadingOverlay {
  background-color: rgba(255,255,255,0.6);
  z-index: 1000;
  flex-direction: column;
}

#bonusOverlay {
  z-index: 3000;
}

#incompleteOverlay {
  z-index: 3100;
}

/* Spinner wrapper utility for overlays */
.spinner-wrap {
  position: relative;
  width: 60px;
  height: 60px;
}

/* Force-hide file inputs on mobile */
input[type="file"].hidden {
  display: none !important;
}

#scanWrapper input[type="file"] {
  display: none !important;
}

/* Optional visually-hidden class for programmatic clicks */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

h1, h2, h3 {
  font-weight: 500;
}
h1, h2, h3 {
  font-weight: 500;
}

/* Inaktive Partner-Kacheln: Glas-Overlay + Blur + Schloss-Icon */
.partner-kachel.inaktiv {
  pointer-events: none;
  position: relative;
}

.partner-kachel.inaktiv .logo {
  filter: blur(1.5px) saturate(0.8);
}

.partner-kachel.inaktiv::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.35);
  backdrop-filter: blur(4px);
  border-radius: 16px;
}

.partner-kachel.inaktiv::after {
  content: "🔒";
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 20px;
  line-height: 1;
  opacity: 0.7;
}

.partner-kachel.inaktiv .bonusbar {
  background: rgba(255,255,255,0.25);
  color: #666;
}

/* Einheitliche Logo-Größe (Erkennungskarte & Bonliste) */
:root{--logo-height-card:30px;--logo-height-list:22px;}

/* Karte/Erkennung */
.card h3 .logo{
  height:var(--logo-height-card);
  width:auto;
  max-width:100%;
  object-fit:contain;
  display:block;
}

/* Bonliste */
.list-row .logo{
  height:var(--logo-height-list);
  width:auto;
  max-width:100%;
  object-fit:contain;
  display:block;
}

/* === Defensive overrides against inline styles from index === */
/* Bonliste: erzwinge einheitliche Bildhöhe auch wenn <img> width/height-Attributes oder inline-styles gesetzt sind */
.list-row img.logo,
.logo-cell img{
  height: var(--logo-height-list) !important;
  width: auto !important;
  max-height: 100% !important;
  max-width: 100% !important;
  object-fit: contain !important;
  display: block;
}

/* Karte/Erkennung: ebenfalls gegen Inline-Styles absichern */
.card h3 img.logo{
  height: var(--logo-height-card) !important;
  width: auto !important;
  max-height: 100% !important;
  max-width: 100% !important;
  object-fit: contain !important;
  display: block;
}

/* === Responsive FAB Layout: gleichmäßig verteilt über die gesamte Breite === */
:root{
  --fab-m: 30px;           /* Mindestabstand links/rechts (veraltet, nicht mehr benutzt unten) */
  --fab-small: 57px;       /* 5% kleiner: zuvor 60px */
  --fab-big: 95px;         /* 5% kleiner: zuvor 100px */
}

:root{ --footer-h: 60px; }

:root{
  --safeL: env(safe-area-inset-left);
  --safeR: env(safe-area-inset-right);
  --outer: 30px; /* gewünschter Außenabstand links/rechts */
}
@supports(padding: constant(safe-area-inset-left)){
  :root{
    --safeL: constant(safe-area-inset-left);
    --safeR: constant(safe-area-inset-right);
  }
}

:root{
  /* Kanten (Außenkanten) */
  --startEdge: calc(max(var(--safeL), 0px) + var(--outer));
  --endEdge: calc(100vw - max(var(--safeR), 0px) - var(--outer));
  /* Zentren der Außenbuttons (kleine Kreise) */
  --startC: calc(var(--startEdge) + (var(--fab-small) / 2));
  --endC: calc(var(--endEdge) - (var(--fab-small) / 2));
  /* Spanne zwischen den Außen-Zentren */
  --spanC: calc(var(--endC) - var(--startC));
}

/* Alle FABs absolute mit top setzen */
#logoutFab, #statsFab, #scanFab, #profileFab, #homeFab{
  position:absolute;
  top:-30px;
}
#scanFab{ top:-50px; width:var(--fab-big); height:var(--fab-big); }
#logoutFab, #statsFab, #profileFab, #homeFab{ width:var(--fab-small); height:var(--fab-small); }

#logoutFab{ left: var(--startEdge) !important; }
#statsFab { left: calc(var(--startC) + (var(--spanC) * 0.22) - (var(--fab-small) / 2)) !important; }
#scanFab  { left: calc(50vw - (var(--fab-big) / 2)) !important; }
#profileFab{ left: calc(var(--startC) + (var(--spanC) * 0.78) - (var(--fab-small) / 2)) !important; }
#homeFab  { left: calc(var(--endC) - (var(--fab-small) / 2)) !important; right:auto !important; }

@media (max-width: 360px){
  :root{ --fab-small: 53px; --fab-big: 91px; }
}

/* ===== Footer-Leiste und Buttons (ausgelagert) ===== */
footer.footer-bar{
  /* überschreibt den generischen footer-Style weiter oben */
  margin: 0;
  padding: 0;
  background: transparent;
}

.footer-bar{
  position: fixed;
  bottom: 0; left: 0;
  width: 100%;
  height: 60px;
  background: linear-gradient(180deg, #ffffff 0%, #f3f3f3 40%, #6e6e6e 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
  z-index: 1000; /* ggf. erhöhen, falls andere Elemente drüberliegen */
}

/* SCAN mittig ausrichten über linken Rand (ohne translate) */
.scan-button{
  position: absolute;
  top: -50px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #e9353d;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: transform .15s ease;
  left: calc(50% - (var(--fab-big) / 2));
  z-index: 4003;
}
.scan-button:hover{ transform: scale(1.05); }

/* kleine runde Buttons: Home/Logout */
.footer-button{
  position: absolute;
  top: -30px;                 /* halb über der Leiste */
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #e9353d;
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.22);
  cursor: pointer;
  user-select: none;
  z-index: 4002;
}
.footer-button.left{ left: auto; }
.footer-button.right{ right: auto; }

/* Bogen-/Hinweistext im Logout-Kreis (vereinfachte Variante) */
.danger-zone-text{
  position: absolute;
  top: 5px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
}

/* === Ergänzung: IDs aus index.php, falls verwendet === */
#stickyFooterBar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1000;
  background: linear-gradient(180deg, #ffffff 0%, #f3f3f3 40%, #6e6e6e 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  height: 60px; /* fallback, falls --footer-h nicht gesetzt ist */
  box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
}
#stickyFooterBar .footer-inner { display: grid; row-gap: 2px; text-align: center; font-size: 11px; line-height: 1.2; }
#stickyFooterBar .footer-line.strong { font-weight: 600; }



/* === iOS Safe-Area fixes for sticky footer & FABs === */
:root { --footer-base: 60px; }

.footer-bar{
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 4000; /* über allem */
  height: calc(var(--footer-base) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
}

/* Fallback für ältere Safari-Versionen */
@supports(padding: constant(safe-area-inset-bottom)){
  .footer-bar{
    height: calc(var(--footer-base) + constant(safe-area-inset-bottom));
    padding-bottom: constant(safe-area-inset-bottom);
  }
}

/* Sicherheitsnetz: Body bekommt stets genug Platz nach unten */
body{
  padding-bottom: calc(var(--footer-h, 48px) + env(safe-area-inset-bottom));
}
@supports(padding: constant(safe-area-inset-bottom)){
  body{
    padding-bottom: calc(var(--footer-h, 48px) + constant(safe-area-inset-bottom));
  }
}
/* === Favorites mode: disable horizontal pagination and stack pages vertically === */
#partnerSlider.fav-mode{
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
}
#partnerSlider.fav-mode .partner-page{
  flex: 0 0 auto; /* allow natural height */
}

/* Kleinere Screens: etwas mehr Abstand zwischen den mittleren Buttons */
@media (max-width: 400px){
  #statsFab{ transform: translateX(-3px); }
  #profileFab{ transform: translateX(3px); }
}

/* Entferne verbleibende CWX/Crossworx-Branding-Fläche am Seitenende */
#footerLogo, .footer-logo, .cw-brand, .cw-logo, .brand-footer,
footer .footer-logo, footer .cw-logo, footer .cw-brand {
  display: none !important;
}

/* ===== Modal-Overlay für vergrößerte Partner-Card ===== */
#cardOverlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#cardOverlay.active { display: flex; }
#cardOverlay .modal-card {
  width: min(520px, 92vw);
  border-radius: 16px;
  background: rgba(255,255,255,0.85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 12px 36px rgba(0,0,0,0.25);
  overflow: hidden;
}
#cardOverlay .modal-head{
  display:flex; align-items:center; justify-content:space-between;
  padding: 12px 14px; border-bottom: 1px solid rgba(0,0,0,0.06);
}
#cardOverlay .modal-head .title{ font-weight:600; font-size:16px; }
#cardOverlay .modal-close{
  border:none; background:transparent; font-size:22px; line-height:1; cursor:pointer; padding:6px; color:#333;
}
#cardOverlay .modal-body{ padding: 14px; }
#cardOverlay .modal-row{ display:flex; justify-content:space-between; align-items:center; padding:6px 0; font-size:14px; }
#cardOverlay .label{ color:#555; }
#cardOverlay .value{ font-weight:600; }
#cardOverlay .modal-logo{
  height: 34px; width:auto; object-fit:contain; display:block;
}

/* --- Mailbox & News Center --- */
#newsBell {
  position: fixed;
  bottom: calc(var(--safe-bottom, 0px) + 22px);
  left: 18px;
  z-index: 2500;
  width: 64px;
  height: 64px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.45);
  background:
    radial-gradient(circle at 30% 30%, rgba(233,53,61,0.92), rgba(199,34,40,0.85)),
    linear-gradient(135deg, rgba(233,53,61,0.98), rgba(199,34,40,0.82));
  backdrop-filter: blur(18px) saturate(220%);
  -webkit-backdrop-filter: blur(18px) saturate(220%);
  box-shadow: 0 16px 36px rgba(233,53,61,0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
#newsBell::after {
  content: "Mailbox";
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #e9353d;
}
#newsBell::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: inherit;
  background: rgba(255,255,255,0.15);
  box-shadow: inset 0 1px 8px rgba(255,255,255,0.5);
}
#newsBell:active { transform: translateY(1px); }
#newsBell:hover {
  box-shadow: 0 20px 44px rgba(233,53,61,0.48);
}
#newsBell svg {
  width: 30px;
  height: 30px;
  position: relative;
  z-index: 1;
}
#newsBell .news-badge {
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff;
  color: #e9353d;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  z-index: 2;
}

@keyframes newsBellVibrate {
  0%, 100% { transform: rotate(0deg); }
  12% { transform: rotate(8deg); }
  25% { transform: rotate(-6deg); }
  37% { transform: rotate(5deg); }
  50% { transform: rotate(-4deg); }
  62% { transform: rotate(3deg); }
  75% { transform: rotate(-2deg); }
  87% { transform: rotate(1deg); }
}
#newsBell.has-news {
  animation: newsBellVibrate 1.1s ease-in-out infinite;
}

.news-screen {
  position: relative;
  width: min(980px, 96vw);
  margin: clamp(22px, 6vw, 38px) auto;
  padding: clamp(20px, 4vw, 36px);
  background: linear-gradient(180deg, rgba(255,255,255,0.94) 0%, rgba(244,246,252,0.88) 100%);
  border-radius: 32px;
  border: 1px solid rgba(255,255,255,0.7);
  box-shadow: 0 32px 60px rgba(17,27,51,0.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 2.6vw, 28px);
}
body.news-mode {
  overflow: hidden;
}
body.news-mode {
  --news-offset-top: calc(var(--safe-top, 0px) + var(--topbar-h, 56px));
  --news-offset-bottom: var(--safe-bottom, 0px);
}
body.news-mode .news-screen {
  position: fixed;
  top: var(--news-offset-top);
  left: 0;
  right: 0;
  bottom: var(--news-offset-bottom);
  margin: 0;
  width: 100vw;
  max-width: none;
  height: calc(100vh - var(--news-offset-top) - var(--news-offset-bottom));
  min-height: calc(100vh - var(--news-offset-top) - var(--news-offset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: clamp(20px, 4vw, 36px);
  padding-bottom: clamp(22px, 5vw, 38px);
  z-index: 3500;
  border-radius: 0;
  border-left: none;
  border-right: none;
}
body.news-mode #filterBar,
body.news-mode #partnerSlider,
body.news-mode .legal-note {
  display: none !important;
}
body.news-mode #newsBell {
  display: none;
}
.news-screen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 24px;
  background: rgba(255,255,255,0.82);
  border-radius: 24px;
  box-shadow: 0 18px 36px rgba(17,27,51,0.12);
}
.news-screen-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.news-screen-title {
  margin: 0;
  font-size: clamp(20px, 2vw + 12px, 28px);
  font-weight: 700;
  color: #e9353d;
  letter-spacing: 0.03em;
}
.news-screen-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(28, 38, 61, 0.55);
}
.news-screen-unread {
  color: #c10c19;
  font-weight: 600;
}
.news-screen-close {
  border: none;
  background: rgba(233,53,61,0.12);
  color: #c10c19;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.news-screen-close:active { transform: translateY(1px); }
.news-screen-close:focus-visible {
  outline: 2px solid rgba(233,53,61,0.45);
  outline-offset: 4px;
}

.news-section {
  background: rgba(255,255,255,0.9);
  border-radius: 30px;
  padding: clamp(18px, 3vw, 30px);
  box-shadow: 0 24px 48px rgba(17,27,51,0.14);
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2.2vw, 26px);
}
.news-section-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.news-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.news-filter-pill {
  border: 1px solid rgba(233,53,61,0.18);
  background: rgba(255,255,255,0.7);
  color: #c10c19;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.news-filter-pill.is-active {
  background: linear-gradient(135deg, #ff4b33, #f12222);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(255,85,66,0.24);
}
.news-filter-pill:focus-visible {
  outline: 2px solid rgba(233,53,61,0.45);
  outline-offset: 3px;
}
.news-empty-filter {
  margin: 0;
  padding: 0;
  font-size: 12px;
  color: rgba(26,35,58,0.56);
  font-style: italic;
}
.news-section-subtitle {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: rgba(26, 35, 58, 0.56);
}

.news-grid {
  display: flex;
  gap: clamp(16px, 3vw, 28px);
  padding: 4px 6px 20px;
  margin: 0 -6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.news-grid::after {
  content: '';
  flex: 0 0 6px;
}
.news-grid::-webkit-scrollbar {
  height: 8px;
}
.news-grid::-webkit-scrollbar-track {
  background: rgba(17,27,51,0.08);
  border-radius: 999px;
}
.news-grid::-webkit-scrollbar-thumb {
  background: rgba(233,53,61,0.45);
  border-radius: 999px;
}

.news-card {
  position: relative;
  flex: 0 0 clamp(260px, 32vw, 340px);
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,0.85);
  background: linear-gradient(180deg, #ffffff 0%, rgba(252,253,255,0.95) 100%);
  box-shadow: 0 22px 44px rgba(21,33,60,0.18);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  scroll-snap-align: start;
}
.news-card.is-unread {
  border-color: rgba(233,53,61,0.55);
  box-shadow: 0 24px 48px rgba(233,53,61,0.18);
}
.news-card.is-active {
  border-color: rgba(233,53,61,0.6);
  box-shadow: 0 22px 42px rgba(233,53,61,0.24);
}
.news-card.is-personal::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 20px;
  border: 1px dashed rgba(233,53,61,0.28);
  pointer-events: none;
}
.news-card:hover {
  transform: translate3d(6px, -6px, 0);
  box-shadow: 0 26px 52px rgba(21,33,60,0.24);
}
.news-card-trigger {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  padding: clamp(16px, 2.5vw, 22px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(12px, 2vw, 18px);
  cursor: pointer;
  text-align: left;
}
.news-card-trigger:focus-visible {
  outline: 2px solid rgba(233,53,61,0.6);
  outline-offset: 4px;
}
.news-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.news-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.news-card-headline {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.news-card-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.1em;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(233,53,61,0.16);
  color: #b01420;
  box-shadow: none;
}
.news-card-tag.is-breaking {
  background: linear-gradient(135deg, #ff4b33, #f12222);
  color: #fff;
  box-shadow: 0 12px 24px rgba(255,85,66,0.24);
}
.news-card-tag.is-update {
  background: linear-gradient(135deg, rgba(98,135,255,0.35), rgba(160,177,255,0.65));
  color: #24306d;
  box-shadow: none;
}
.news-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #101728;
  line-height: 1.35;
}
.news-card-flags {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.news-card-badge {
  padding: 3px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(233,53,61,0.18), rgba(233,53,61,0.32));
  color: #b01420;
  font-size: 10px;
  letter-spacing: 0.05em;
  font-weight: 600;
  text-transform: uppercase;
}
.news-card-state {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.05em;
  font-weight: 600;
  text-transform: uppercase;
  background: rgba(18,28,48,0.08);
  color: #1f2a44;
}
.news-card-state.is-unread {
  background: linear-gradient(135deg, rgba(255,92,92,0.32), rgba(233,53,61,0.4));
  color: #b9101d;
}
.news-card-state.is-read {
  background: linear-gradient(135deg, rgba(64,199,131,0.18), rgba(18,168,88,0.24));
  color: #0c6b38;
}
.news-card-preview {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(20,26,40,0.7);
}
.news-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 10px;
  color: rgba(20,26,40,0.52);
}
.news-card-meta span {
  position: relative;
  padding-left: 10px;
}
.news-card-meta span::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(233,53,61,0.7);
  transform: translateY(-50%);
}
.news-card-meta span:nth-child(2)::before { background: rgba(255,170,0,0.8); }
.news-card-meta span:nth-child(3)::before { background: rgba(12,107,56,0.7); }

.news-scroll-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(28, 38, 61, 0.45);
}
.news-scroll-hint::before {
  content: '';
  display: inline-block;
  width: 68px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(233,53,61,0.65), rgba(233,53,61,0.3));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35);
}
.news-scroll-hint span {
  font-weight: 600;
}

.news-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 3600;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15,25,40,0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  padding: 18px;
}
.news-detail-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.news-detail-card {
  width: min(520px, 92vw);
  max-height: min(78vh, 640px);
  background:
    radial-gradient(circle at 25% 15%, rgba(255,255,255,0.97), rgba(255,255,255,0.82)),
    linear-gradient(150deg, rgba(255,255,255,0.9), rgba(238,241,246,0.75));
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 28px 56px rgba(0,0,0,0.24);
  padding: clamp(20px, 3vw, 28px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}
.news-detail-card.animate {
  animation: newsDetailFlip 0.45s ease forwards;
  transform-origin: left center;
}
@keyframes newsDetailFlip {
  0% { transform: perspective(1200px) rotateY(-85deg); opacity: 0; }
  55% { transform: perspective(1200px) rotateY(-18deg); opacity: 1; }
  100% { transform: perspective(1200px) rotateY(0deg); opacity: 1; }
}
.news-detail-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(233,53,61,0.16);
  color: #c72228;
  font-size: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.news-detail-close:active { transform: scale(0.95); }
.news-detail-close:focus-visible {
  outline: 2px solid rgba(233,53,61,0.45);
  outline-offset: 3px;
}
.news-detail-image {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 18px 32px rgba(0,0,0,0.18);
}
.news-detail-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  max-height: 240px;
}
.news-detail-title {
  margin: 0;
  font-size: clamp(20px, 1.6vw + 14px, 28px);
  font-weight: 700;
  color: #11131a;
}
.news-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 11px;
  color: rgba(0,0,0,0.55);
}
.news-detail-body {
  flex: 1 1 auto;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.58;
  color: rgba(0,0,0,0.88);
  padding-right: 4px;
}
.news-detail-toggle {
  justify-content: flex-start;
  padding-top: 4px;
}

.news-read-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(0,0,0,0.7);
  user-select: none;
  cursor: pointer;
}
.news-read-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #e9353d;
  cursor: pointer;
}
.news-read-toggle input[type="checkbox"][disabled] {
  cursor: not-allowed;
  opacity: 0.7;
}

.news-empty {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(0,0,0,0.75);
  text-align: left;
}

@media (max-width: 900px) {
  .news-screen {
    width: min(740px, 95vw);
  }
  .news-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 640px) {
  #newsBell {
    bottom: calc(var(--safe-bottom, 0px) + 18px);
    left: 14px;
    width: 60px;
    height: 60px;
  }
  .news-screen {
    margin: clamp(16px, 6vw, 26px) auto;
    padding: clamp(16px, 5vw, 24px);
  }
  .news-card-header {
    flex-direction: column;
  }
  .news-card-flags {
    margin-top: 6px;
  }
}

@media (max-width: 480px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
  .news-card-thumb {
    max-height: 160px;
  }
  .news-detail-card {
    width: 92vw;
    max-height: 80vh;
  }
}
body.news-mode .footer-bar,
body.news-mode #stickyFooterBar {
  display: none !important;
}
