:root{
  --bg: #f7f1ff;
  --panel: rgba(255,255,255,0.65);
  --panel-strong: rgba(255,255,255,0.82);
  --text: #2a1836;
  --muted: rgba(42,24,54,0.62);
  --primary: #b87cff;
  --primary-2: #8f5cff;
  --danger: #ff4d6d;

  --period: rgba(255, 95, 143, 0.36);
  --spotting: rgba(255, 159, 95, 0.28);
  --pred: rgba(184, 124, 255, 0.18);

  --shadow: 0 10px 30px rgba(30, 10, 60, 0.12);
  --radius: 22px;
  --radius-sm: 16px;
  --ring: 0 0 0 3px rgba(184,124,255,0.25);

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(1200px 700px at 30% 0%, rgba(184,124,255,0.30), transparent 60%),
              radial-gradient(900px 650px at 80% 30%, rgba(255,95,143,0.18), transparent 55%),
              var(--bg);
  overflow-x:hidden;
}

.app{
  max-width: 980px;
  margin: 0 auto;
  padding: 22px 18px 28px;
}

.panel{
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(130, 92, 170, 0.18);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

/* Topbar */
.topbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.brand-title{
  font-weight: 900;
  font-size: 28px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.brand-dot{ color: var(--primary); }
.brand-sub{
  margin-top: 4px;
  font-size: 14px;
  color: var(--muted);
}

.top-actions{ display:flex; gap: 10px; }

/* Buttons */
.btn{
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  user-select:none;
  transition: transform .06s ease, box-shadow .18s ease, background .18s ease, opacity .18s ease;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
}
.btn:active{ transform: translateY(1px); }
.btn:focus-visible{ outline:none; box-shadow: var(--ring); }
.btn.primary{
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
}
.btn.ghost{
  background: rgba(255,255,255,0.55);
  color: var(--text);
  border: 1px solid rgba(130, 92, 170, 0.18);
}
.btn.danger{
  background: rgba(255,77,109,0.15);
  color: #7f0d22;
  border: 1px solid rgba(255,77,109,0.22);
}
.btn.icon{
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 12px;
  background: rgba(255,255,255,0.50);
  border: 1px solid rgba(130, 92, 170, 0.18);
}
.btn.nav{
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 14px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(130, 92, 170, 0.18);
  font-size: 22px;
}

/* Content */
.content{
  display:grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 14px;
}

/* Calendar header */
.calendar-header{
  display:grid;
  grid-template-columns: 44px 1fr 44px;
  align-items:center;
  gap: 10px;
  margin-bottom: 10px;
}
.month-title{ text-align:center; }
.month-label{
  font-weight: 900;
  font-size: 18px;
  text-transform: capitalize;
}
.month-hint{
  margin-top: 4px;
  font-size: 12.5px;
  color: rgba(42,24,54,0.72);
  min-height: 18px;
}

.weekday-row{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin: 10px 0 8px;
  color: rgba(42,24,54,0.55);
  font-weight: 800;
  font-size: 12px;
  text-align:center;
}

.calendar-grid{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

/* Day cells */
.day{
  border: 0;
  background: rgba(255,255,255,0.60);
  border: 1px solid rgba(130, 92, 170, 0.18);
  border-radius: var(--radius-sm);
  min-height: 86px;
  padding: 10px;
  cursor:pointer;
  text-align:left;
  position:relative;
  overflow:hidden;
}
.day:focus-visible{ outline:none; box-shadow: var(--ring); }
.day.is-empty{
  background: transparent;
  border: 0;
  box-shadow: none;
}
.day.today{
  box-shadow: 0 0 0 3px rgba(184,124,255,0.25);
}
.day.period::before,
.day.spotting::before,
.day.predicted::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:0;
}
.day.period::before{ background: var(--period); }
.day.spotting::before{ background: var(--spotting); }
.day.predicted::before{ background: var(--pred); }

.day-top, .day-bottom{ position:relative; z-index:1; }

.day-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 6px;
}

.day-num{
  font-weight: 900;
  font-size: 14px;
  color: rgba(42,24,54,0.85);
}

.badges{
  display:flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content:flex-end;
  max-width: 70%;
}
.badge{
  font-size: 13px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(130, 92, 170, 0.16);
  user-select:none;
}

.day-bottom{
  margin-top: 10px;
  display:flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pill{
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.70);
  border: 1px solid rgba(130, 92, 170, 0.16);
  color: rgba(42,24,54,0.78);
  font-weight: 800;
}

/* Legend */
.legend{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  align-items:center;
  justify-content:flex-start;
}
.legend-item{
  display:flex;
  align-items:center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  color: rgba(42,24,54,0.70);
}
.dot{
  width: 12px;
  height: 12px;
  border-radius: 4px;
  display:inline-block;
  border: 1px solid rgba(130, 92, 170, 0.22);
}
.dot.period{ background: var(--period); }
.dot.spotting{ background: var(--spotting); }
.dot.predicted{ background: var(--pred); }

/* Summary */
.summary .h2{
  margin: 4px 0 12px;
  font-size: 18px;
  font-weight: 900;
}
.summary-grid{
  display:grid;
  gap: 10px;
}
.stat{
  background: rgba(255,255,255,0.60);
  border: 1px solid rgba(130, 92, 170, 0.16);
  border-radius: 18px;
  padding: 12px 12px;
}
.stat-label{
  font-size: 12px;
  color: rgba(42,24,54,0.60);
  font-weight: 900;
}
.stat-value{
  font-size: 16px;
  font-weight: 900;
  margin-top: 6px;
}
.stat-sub{
  font-size: 12px;
  color: rgba(42,24,54,0.62);
  margin-top: 6px;
}
.fineprint{
  margin-top: 12px;
  font-size: 12px;
  color: rgba(42,24,54,0.62);
}

/* Footer */
.footer{
  margin-top: 14px;
  text-align:center;
  font-size: 12.5px;
  color: rgba(42,24,54,0.64);
}

/* Toast */
.toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(42,24,54,0.90);
  color: white;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
  opacity: 0;
  pointer-events:none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 4096;
}
.toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

/* Modals */
.modal[hidden]{ display:none !important; }
.modal{
  position: fixed;
  inset:0;
  z-index: 1200;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;
}
.modal-backdrop{
  position:absolute;
  inset:0;
  background: rgba(15, 7, 28, 0.45);
  backdrop-filter: blur(4px);
}
.modal-card{
  position:relative;
  z-index:1;
  width: min(720px, 92vw);
  background: var(--panel-strong);
  border: 1px solid rgba(130, 92, 170, 0.20);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow:hidden;
}
.modal-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
  padding: 14px 14px;
  border-bottom: 1px solid rgba(130, 92, 170, 0.14);
}
.modal-title{
  font-weight: 900;
  font-size: 16px;
}
.modal-subtitle{
  font-size: 12px;
  color: rgba(42,24,54,0.62);
  margin-top: 2px;
}
.modal-body{
  padding: 14px 14px 10px;
  display:flex;
  flex-direction:column;
  gap: 12px;
}
.modal-footer{
  padding: 12px 14px;
  border-top: 1px solid rgba(130, 92, 170, 0.14);
  display:flex;
  align-items:center;
  gap: 10px;
}
.spacer{ flex: 1; }

/* Form fields */
.field{ display:flex; flex-direction:column; gap: 8px; }
.field .label{
  font-size: 12px;
  color: rgba(42,24,54,0.60);
  font-weight: 900;
}
.field-row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.input, .textarea{
  border: 1px solid rgba(130, 92, 170, 0.18);
  background: rgba(255,255,255,0.66);
  border-radius: 14px;
  padding: 10px 12px;
  font-family: var(--font);
  font-weight: 800;
  color: rgba(42,24,54,0.85);
}
.textarea{ resize: vertical; }

/* Chips */
.emoji-scale{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip-row{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip{
  border: 1px solid rgba(130, 92, 170, 0.18);
  background: rgba(255,255,255,0.70);
  border-radius: 16px;
  padding: 10px 10px;
  font-weight: 900;
  cursor:pointer;
  min-width: 86px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 6px;
}
.chip small{
  font-size: 11px;
  color: rgba(42,24,54,0.62);
  font-weight: 900;
}
.chip.active{
  border-color: rgba(184,124,255,0.55);
  box-shadow: var(--ring);
}

/* Toggle */
.toggle{
  display:flex;
  align-items:center;
  gap: 10px;
  font-weight: 900;
  color: rgba(42,24,54,0.75);
  user-select:none;
}
.toggle input{ transform: scale(1.1); }

.sep{
  border: 0;
  border-top: 1px solid rgba(130, 92, 170, 0.16);
  margin: 8px 0;
}

.actions-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.file-btn{ position:relative; overflow:hidden; }
.file-btn input{ position:absolute; inset:0; opacity:0; cursor:pointer; }

/* Responsive */
@media (max-width: 860px){
  .content{ grid-template-columns: 1fr; }
}

@media (max-width: 560px){
  .app{ padding: 16px 14px 24px; }
  .panel{ padding: 14px; }

  .brand-title{ font-size: 24px; }
  .brand-sub{ font-size: 13px; }

  .calendar-grid{ gap: 6px; }
  .weekday-row{ gap: 6px; font-size: 11px; }

  .day{
    min-height: 72px;
    padding: 8px;
    border-radius: 16px;
    text-align: center;
  }

  .badges{
    max-width: calc(100% - 8px);
    justify-content: center;
  }

  .field-row{ grid-template-columns: 1fr; }

  .actions-grid{ grid-template-columns: 1fr; }
}

/* =========================================================
   Mobile Makeover: Bigger tap targets, better spacing, no overlap
========================================================= */
@media (max-width: 560px){

  /* Top action buttons a bit tighter */
  .top-actions .btn{
    padding: 9px 12px;
  }
  .btn.nav{
    width: 38px;
    height: 38px;
  }

  /* Calendar header spacing */
  .calendar-header{
    grid-template-columns: 40px 1fr 40px;
    gap: 8px;
  }

  /* Calendar day: compact square, number at top, badges at bottom */
  .day{
    min-height: 64px;
    padding: 8px 8px 6px;
  }

  .day-top{
    padding-top: 2px;
  }

  .day-num{
    font-size: 13px;
    font-weight: 900;
    opacity: 0.92;
  }

  .badges{
    gap: 4px;
  }
  .badge{
    font-size: 12px;
    padding: 2px 6px;
  }

  /* Hide bottom pills (too cramped) */
  .day-bottom{
    display:none;
  }

  /* Modal: full width feeling */
  .modal-card{
    width: min(720px, 96vw);
    border-radius: 22px;
  }

  /* Chips: reduce min-width so 5 fit in one row if needed */
  .emoji-scale{
    gap: 8px;
  }
  .emoji-scale .chip{
    min-width: 0;
    flex: 1 1 0;
    padding: 8px 6px;
  }
  .emoji-scale .chip small{
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Horizontal scroll for long chip rows */
  .chip-row{
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }
  .chip-row .chip{
    flex: 0 0 auto;
  }

  /* Footer text slightly smaller */
  .footer{
    font-size: 12px;
    line-height: 1.4;
  }
}

/* =========================================================
   Mobile polish v2: prevent day icons from overlapping day number
========================================================= */
@media (max-width: 560px){
  /* Make day a compact square and reserve top area for the number */
  .day{
    aspect-ratio: 1 / 1;
    min-height: unset;
    padding: 8px;
  }

  /* Put the day number top-center */
  .day-top{
    justify-content: center;
    align-items: flex-start;
    padding-top: 2px;
  }
  .day-num{
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    font-weight: 900;
    z-index: 2;
  }

  /* Badges bottom-center with overflow hidden */
  .badges{
    position: absolute;
    left: 50%;
    bottom: 7px;
    transform: translateX(-50%);
    z-index: 2;
    max-width: calc(100% - 16px);
    justify-content: center;
    flex-wrap: nowrap;
    overflow: hidden;
    pointer-events: none;
  }

  /* Remove day-bottom completely */
  .day-bottom{ display:none !important; }
}


/* =========================================================
   A2HS (Add to Home Screen) – kleine Anleitung, offline
========================================================= */
.a2hs-card .modal-body{
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.a2hs-block{
  background: rgba(255,255,255,0.70);
  border: 1px solid rgba(130, 92, 170, 0.18);
  border-radius: 18px;
  padding: 12px 12px;
}

.a2hs-platform{
  font-weight: 900;
  font-size: 14px;
  margin-bottom: 8px;
}

.a2hs-steps{
  margin: 0;
  padding-left: 18px;
  color: rgba(42,24,54,0.78);
}

.a2hs-steps li{
  margin: 8px 0;
  line-height: 1.35;
}

/* =========================================================
   Mobile Overrides (final)
   - Kalender: Datum oben, Icons unten, Overflow sauber (➕)
   - Skalen im Modal: 5 Buttons immer in 1 Zeile (Grid)
========================================================= */
@media (max-width: 560px){
  /* Kalender: absolut positionieren -> keine Überlappung */
  .day{
    position: relative !important;
    aspect-ratio: 1 / 1;
  }

  .day-top{
    padding: 0 !important;
  }

  .day-num{
    position: absolute !important;
    top: 8px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 2;
    line-height: 1;
  }

  .badges{
    position: absolute !important;
    left: 50% !important;
    bottom: 7px !important;
    transform: translateX(-50%) !important;
    z-index: 2;

    display: flex !important;
    justify-content: center !important;
    flex-wrap: nowrap !important;       /* kein Umbruch */
    gap: 4px !important;

    max-width: calc(100% - 16px) !important;
    overflow: hidden !important;        /* JS zeigt ggf. ➕ */
    pointer-events: none !important;
  }

  .day-bottom{ display: none !important; }

  /* Skalen: 5 Optionen in einer Reihe */
  .emoji-scale{
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px !important;
  }

  .emoji-scale .chip{
    min-width: 0 !important;
    padding: 8px 4px !important;
  }

  .emoji-scale .chip small{
    font-size: 10px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* =========================================================
   FIX: Modal muss auf iOS/Safari scrollen können
   - Card bekommt max-height (Viewport)
   - Body wird scrollbarer Bereich
   - iOS Smooth Scrolling
========================================================= */

.modal{
  /* erlaubt Scroll, wenn Karte größer als Viewport wäre */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  /* Safe-Area (Notch/Homebar) */
  padding-top: max(18px, env(safe-area-inset-top));
  padding-bottom: max(18px, env(safe-area-inset-bottom));
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
}

/* Auf Mobile lieber oben beginnen statt perfekt zentrieren */
@media (max-width: 560px){
  .modal{ align-items: flex-start; }
}

.modal-card{
  /* Fallback zuerst, dann dvh (wenn unterstützt) */
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);

  display: flex;
  flex-direction: column;

  /* wichtig: Header/Footer bleiben sichtbar, Body scrollt */
  overflow: hidden;

  /* wichtig für Flex-Scrolling (iOS!) */
  min-height: 0;
}

.modal-body{
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  /* wichtig für Flex-Scrolling (iOS!) */
  min-height: 0;
}

/* optional: Footer bleibt „sicher“ über der Homebar */
.modal-footer{
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

/* =========================================================
   Mobile Calendar Badges v3
   Ziel:
   - Zahl bleibt IMMER an gleicher Stelle
   - Badges beeinflussen das Layout nicht (absolute Position)
   - Badges als kleines Pill unten (clean)
========================================================= */

@media (max-width: 560px){
  .day{
    position: relative !important;
    aspect-ratio: 1 / 1;
    padding: 0 !important;
    text-align: center;
  }

  .day-top{
    /* nimmt keinen Platz mehr weg -> verhindert „Zahl wandert“ */
    position: absolute !important;
    inset: 0 !important;
    padding: 0 !important;
  }

  /* Zahl immer oben, egal ob Eintrag vorhanden oder nicht */
  .day-num{
    position: absolute !important;
    top: 10px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 2;
    font-size: 13px;
    line-height: 1;
  }

  /* Badges unten als dezentes Pill */
  .badges{
    position: absolute !important;
    left: 50% !important;
    bottom: 8px !important;
    transform: translateX(-50%) !important;
    z-index: 2;

    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 4px;

    flex-wrap: nowrap !important;
    overflow: hidden !important;
    max-width: calc(100% - 16px) !important;

    padding: 2px 8px !important;
    border-radius: 999px !important;
    background: rgba(255,255,255,0.72) !important;
    border: 1px solid rgba(130, 92, 170, 0.16) !important;
    box-shadow: 0 8px 18px rgba(30, 10, 60, 0.10) !important;

    pointer-events: none !important; /* Klick soll immer auf den Tag gehen */
  }

  /* Wenn keine Badges → komplett unsichtbar */
  .badges[hidden]{
    display: none !important;
  }

  /* Einzelne Badge-Bubbles entfernen (wir nutzen das Pill als Container) */
  .badge{
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    font-size: 12px !important;
    line-height: 1 !important;
  }

  /* Mobile: keine Text-Pills unterhalb */
  .day-bottom{
    display: none !important;
  }
}

/* =========================================================
   Mobile Calendar: iOS-like Notification Bubble (Badge)
   - Zahl bleibt IMMER zentriert
   - Badge ist oben rechts (wie iPhone Benachrichtigungen)
========================================================= */

@media (max-width: 560px){

  /* Der Tages-Button ist ein Kreis */
  .day{
    position: relative !important;
    aspect-ratio: 1 / 1;
    border-radius: 999px !important;
    padding: 0 !important;
    text-align: center !important;
    overflow: hidden; /* Background bleibt sauber im Kreis */
  }

  /* day-top nimmt keinen Platz mehr weg (verhindert “springen”) */
  .day-top{
    position: absolute !important;
    inset: 0 !important;
    padding: 0 !important;
  }

  /* Zahl IMMER exakt in der Mitte */
  .day-num{
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 2 !important;
    font-size: 14px !important;
    line-height: 1 !important;
  }

  /* Bubble oben rechts – iOS-Style */
  .badges{
    position: absolute !important;
    top: 6px !important;
    right: 6px !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    z-index: 3 !important;

    /* Bubble Look */
    min-width: 18px !important;
    height: 18px !important;
    padding: 0 6px !important;
    border-radius: 999px !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;

    background: linear-gradient(135deg, var(--primary), var(--primary-2)) !important;
    color: #fff !important;
    font-weight: 900 !important;
    font-size: 11px !important;

    box-shadow: 0 10px 20px rgba(30, 10, 60, 0.18) !important;

    pointer-events: none !important; /* Klick bleibt auf dem Tag */
  }

  /* Wenn keine Badge vorhanden → unsichtbar */
  .badges[hidden]{
    display: none !important;
  }

  /* Die innere Badge soll kein “Chip” mehr sein – nur Text/Emoji */
  .badge{
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    color: inherit !important;
    font-size: inherit !important;
    line-height: 1 !important;
  }

  /* Mobile: keine Text-Pills unten */
  .day-bottom{
    display: none !important;
  }
}

/* =========================================================
   Mobile Calendar Badge – iOS-style Ecke (überlappend)
   FIX:
   - Tage NICHT mehr kreisrund
   - Zahl bleibt zentriert
   - Badge sitzt oben rechts und überlappt die Ecke
========================================================= */

@media (max-width: 560px){

  /* Tag-Form wieder wie vorher: abgerundetes Quadrat/Rechteck */
  .day{
    border-radius: var(--radius-sm) !important; /* z.B. 16px */
    aspect-ratio: 1 / 1;                        /* bleibt kompakt */
    padding: 0 !important;
    overflow: visible !important;               /* wichtig: Badge darf raus ragen */
    text-align: center !important;
    position: relative !important;
  }

  /* Hintergrund-Markierungen (Periode/Spotting/Prognose) sauber abrunden */
  .day.period::before,
  .day.spotting::before,
  .day.predicted::before{
    border-radius: inherit !important;
  }

  /* day-top nimmt keinen Platz weg */
  .day-top{
    position: absolute !important;
    inset: 0 !important;
    padding: 0 !important;
  }

  /* Zahl bleibt immer perfekt in der Mitte */
  .day-num{
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 2 !important;
    font-size: 14px !important;
    line-height: 1 !important;
  }

  /* iOS-Notification-Bubble oben rechts (überlappend) */
  .badges{
    position: absolute !important;
    top: -6px !important;     /* überlappt die Ecke */
    right: -6px !important;   /* überlappt die Ecke */
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    z-index: 5 !important;

    min-width: 20px !important;
    height: 20px !important;
    padding: 0 6px !important;
    border-radius: 999px !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    background: linear-gradient(135deg, var(--primary), var(--primary-2)) !important;
    color: #fff !important;
    font-weight: 900 !important;
    font-size: 11px !important;
    line-height: 1 !important;

    /* kleiner „Rand“ wie iOS, damit es sich abhebt */
    border: 2px solid rgba(255,255,255,0.95) !important;
    box-shadow: 0 10px 22px rgba(30, 10, 60, 0.18) !important;

    pointer-events: none !important;
  }

  .badges[hidden]{
    display: none !important;
  }

  /* Innen-element neutral halten */
  .badge{
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    color: inherit !important;
    font-size: inherit !important;
    line-height: 1 !important;
  }

  /* Mobile: keine Text-Pills unten */
  .day-bottom{
    display: none !important;
  }
}

.day.predicted{
  outline: 2px dashed rgba(184,124,255,0.55);
  outline-offset: -2px;
}
.day.predicted::after{
 border-radius: var(--radius-sm) !important;
  content:"";
  position:absolute;
  inset:0;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(184,124,255,0.10),
      rgba(184,124,255,0.10) 10px,
      rgba(255,255,255,0.0) 10px,
      rgba(255,255,255,0.0) 20px
    );
  pointer-events:none;
}