/*
 * MagicKcal Notification Center v1
 * Chat 81 / AppServer 1.2.195.225
 * Nur NC-spezifische Darstellung. Verwendet bestehende MagicKcal-Farben/Geometrien.
 */

:root {
  --mk-nc-bg: #101214;
  --mk-nc-mid: #171C22;
  --mk-nc-button: #2D3541;
  --mk-nc-white: #FFFFFF;
  --mk-nc-gray: var(--cc-g, #AEB8C4);
  --mk-nc-black: #000001;
  --mk-nc-alert: var(--cc-a, #FF3232);
  --mk-nc-ci: var(--cc-ci, #5CE08A);
}


/* Chat 79 / .193 – finaler Badge-Reset ohne Root-Klassen-Abhaengigkeit.
   Die Datei hat bewusst einen neuen Namen, damit Safari/PWA keinen alten NC-CSS-
   Eintrag wiederverwenden kann. Die verdoppelte Klasse hebt auch alte !important-
   Regeln wie .favoriteCard .btnBadge sicher auf. */
html body :is(
  .BG-01.BG-01,
  .btnBadge.btnBadge,
  .plannerTabBadge.plannerTabBadge,
  .mkNcHomeBadge.mkNcHomeBadge,
  .mkNcCardBadge.mkNcCardBadge,
  .mkNcPlannerDeskBadge.mkNcPlannerDeskBadge,
  .mkNcPlannerPhoneBadge.mkNcPlannerPhoneBadge,
  .mkNcValueBadge.mkNcValueBadge
) {
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  filter: none !important;
  -webkit-filter: none !important;
  text-shadow: none !important;
  background-image: none !important;
}

/* HOME: reine Anzeige, niemals klickbar. */
.homeNavItem .BS-CG-START { position: relative !important; }
.mkNcHomeBadge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 0;
  border-radius: 999px;
  text-align: center;
  color: var(--mk-nc-white);
  background: var(--mk-nc-alert);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  margin: 0 !important;
  transform: none !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  filter: none !important;
  -webkit-filter: none !important;
  text-shadow: none !important;
  background-image: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Fachkachel-Badges: Einstieg in das zentrale NC. */
.mkNcBadgeHost { position: relative !important; }
.mkNcCardBadge,
.mkNcPlannerDeskBadge,
.mkNcPlannerPhoneBadge {
  box-sizing: border-box;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--mk-nc-white);
  background: var(--mk-nc-alert);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  filter: none !important;
  -webkit-filter: none !important;
  text-shadow: none !important;
  background-image: none !important;
  cursor: pointer;
}
.mkNcCardBadge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 6;
}
.mkNcCardBadge:hover,
.mkNcCardBadge:focus-visible,
.mkNcCardBadge:active,
.mkNcPlannerDeskBadge:hover,
.mkNcPlannerDeskBadge:focus-visible,
.mkNcPlannerDeskBadge:active,
.mkNcPlannerPhoneBadge:hover,
.mkNcPlannerPhoneBadge:focus-visible,
.mkNcPlannerPhoneBadge:active {
  border: 0;
  outline: none;
}

/* Tagesliste: ein BG-01 auf allen Plattformen in der rechten oberen Ecke
   der Hauptkachel (.planBoxCard). Nicht mehr im iPhone-Tab und nicht mehr
   zwischen den Desk/iPad-Aktionsbuttons. */
.planBoxCard.mkNcBadgeHost > .mkNcPlannerCardBadge {
  top: 1rem;
  right: 1rem;
  z-index: 12;
}
/* Chat 79 / AppServer 1.2.195.207 – der alte iPhone-Tab-Badge ist fachlich entfallen.
   display:none verhindert auch das kurze Aufblitzen vor der NC-Hydrierung und gibt
   dem Text „Tagesliste“ wieder die volle zentrierte Tab-Breite. */
.plannerTabBadge { display: none !important; }
.plannerTabBadge.mkNcOriginalBadgeHidden { display: none !important; visibility: hidden !important; }

/* Desk/iPad: Die Hauptkachel enthält direkt darunter eine Subkachel.
   Der reservierte rechte Bereich verhindert eine Kollision des Eck-Badges
   mit dem letzten Aktionsbutton, ohne die Button-Reihenfolge zu verändern. */
@media (min-width: 601px) {
  .planBoxCard .planHead {
    padding-right: 32px !important;
  }
}

/* Withings-Wölkchen in „Meine Körperdaten“ direkt vor den Synctext verschieben. */
html.mkStyleguideV014 body.mkStyleguideV014 .targetWeightCombinedCard .mkWithingsSync { display: none !important; }
.bodyCompositionHint .mkNcInlineCloud {
  width: 18px;
  min-width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: -4px;
  margin-right: 6px;
  background: var(--cc-day, var(--mk-nc-ci));
  -webkit-mask: url('/assets/pictograms/ui/cloud.svg') center / contain no-repeat;
  mask: url('/assets/pictograms/ui/cloud.svg') center / contain no-repeat;
}

/* Der alte Zaehler hinter „Gespeicherte Phasen“ wird mit dem NC nicht mehr benoetigt. */
.savedPhaseCountBadge { display: none !important; }

/* Einstellungen: eigene Erinnerungs-Kachel. */
.mkNcSettingsCard {
  align-self: start;
}
.mkNcSettingsIntro {
  margin: .2rem 0 .65rem;
  color: var(--mk-nc-gray);
}
.mkNcSettingRow + .mkNcSettingRow {
  margin-top: .72rem;
}
.mkNcWeekdays {
  display: grid;
  grid-template-columns: repeat(7, 40px);
  justify-content: start;
  gap: 6px;
  margin: .34rem 0 .1rem;
}
.mkNcWeekday {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
}
.mkNcWeekdayHint {
  margin: .45rem 0 .1rem;
  color: var(--mk-nc-gray);
  font-size: 13px;
}
.mkNcWeekdays + .mkNcSettingRow,
.mkNcWeekdayHint + .mkNcSettingRow {
  margin-top: .72rem;
}
@media (max-width: 390px) {
  .mkNcWeekdays { gap: 4px; }
}

/* NC Overlay: gleiche visuelle Tiefenwirkung wie Login, Panel blättert von oben ein. */
html.mkNcOpen,
body.mkNcOpen {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}
.mkNcOverlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  padding: 16px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: #00000180;
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  opacity: 0;
  transition: opacity 160ms ease;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.mkNcOverlay.open { opacity: 1; }
.mkNcOverlay.closing { opacity: 0; }
.mkNcPanel {
  width: min(760px, 100%);
  max-height: calc(100vh - 32px);
  margin-top: 0;
  padding: 12px 0 18px;
  transform: translateY(-22px);
  transition: transform 190ms ease;
}
.mkNcOverlay.open .mkNcPanel { transform: translateY(0); }
.mkNcPanel:focus { outline: none; }
.mkNcHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 10px;
  padding: 0 2px;
}
.mkNcHead h2 {
  margin: 0;
  color: var(--mk-nc-white);
  font-size: 20px;
  font-weight: 700;
}
.mkNcMessageStack {
  display: grid;
  gap: 9px;
}
.mkNcMessageCard {
  --mk-nc-bar: var(--mk-nc-gray);
  position: relative;
  display: grid;
  gap: 7px;
  min-height: 82px;
  padding: 13px 48px 13px 18px;
  border: 1px solid color-mix(in srgb, var(--mk-nc-bar) 48%, transparent);
  border-radius: 20px;
  background: var(--mk-nc-bg);
  box-shadow: 0 12px 34px #0000015c;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-12px) scale(.992);
  animation: mkNcCardIn 240ms ease forwards;
  animation-delay: calc(var(--mk-nc-order, 0) * 48ms + 70ms);
}
.mkNcMessageCard::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--mk-nc-bar);
}
.mkNcMessageCard.day.today { --mk-nc-bar: var(--day-today, #5CE08A); }
.mkNcMessageCard.day.past { --mk-nc-bar: var(--day-past, #FFCC66); }
.mkNcMessageCard.day.future { --mk-nc-bar: var(--day-future, #7EA8FF); }
.mkNcMessageCard.system { --mk-nc-bar: var(--mk-nc-gray); }
.mkNcMessageCard.isActionable { cursor: pointer; }
.mkNcMessageCard.isActionable:hover,
.mkNcMessageCard.isActionable:focus-visible {
  border-color: var(--mk-nc-bar);
  outline: none;
}
.mkNcMessageCard.removing {
  pointer-events: none;
  margin: 0 !important;
  transform: none !important;
  animation: mkNcCardOut 170ms ease forwards;
}
.mkNcMessageContext {
  color: var(--mk-nc-bar);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
}
.mkNcMessageBody {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.mkNcMessageBody p {
  margin: 0;
  color: var(--mk-nc-white);
  font-size: 15px;
  line-height: 1.35;
}
.mkNcValueBadge {
  flex: 0 0 auto;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--mk-nc-alert);
  color: var(--mk-nc-white);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.mkNcMessageCard.system .mkNcValueBadge {
  color: var(--mk-nc-white);
}
.mkNcMessageRemove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}
.mkNcMessageRemove:focus-visible {
  outline: 1px solid var(--mk-nc-gray);
  outline-offset: 1px;
}

@keyframes mkNcCardIn {
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes mkNcCardOut {
  to { opacity: 0; transform: translateY(-8px) scale(.985); max-height: 0; min-height: 0; padding-top: 0; padding-bottom: 0; margin: 0; }
}

@media (max-width: 600px) {
  .mkNcOverlay { padding: 9px; }
  .mkNcPanel { width: 100%; max-height: calc(100vh - 18px); }
  .mkNcHead { padding: 0 2px; }
  .mkNcMessageCard { border-radius: 18px; padding-left: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .mkNcOverlay,
  .mkNcPanel,
  .mkNcMessageCard,
  .mkNcMessageCard.removing {
    transition: none !important;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* =========================================================
   Chat 79 / AppServer 1.2.195.207 – zentraler NC-Posteingang
   - externes NC-Piktogramm als globaler Einstieg
   - roter Punkt nur als grafischer Posteingangshinweis, niemals mit Ziffer
   - Info-Dialog in „Meine Erinnerungen“
   - Auge statt X zum Ausblenden einzelner Mitteilungen
   - robuster iOS-Hintergrund-Lock; nur der NC-Inhalt scrollt
   ========================================================= */

/* Globaler Posteingang: auf datierten Seiten direkt hinter HEUTE,
   auf tagesunabhängigen Arbeitsseiten ganz rechts. */
.mkNcNavButton {
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  flex: 0 0 40px;
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--mk-nc-gray);
  box-shadow: none;
  filter: none;
  transition: none;
  cursor: pointer;
}
.mkNcNavButton:hover,
.mkNcNavButton:active {
  border: 0;
  background: transparent;
}
.mkNcNavButton:focus-visible {
  outline: 3px solid var(--mk-nc-ci);
  outline-offset: 4px;
}
.mkNcNavIcon {
  display: block;
  width: 29px;
  height: 25px;
  object-fit: contain;
  pointer-events: none;
}
/* Tagesunabhängige Seiten: NC ist letzter Eintrag der .tabs-Navigation.
   Die höhere Spezifität hält die globale Tab-Geometrie vom rahmenlosen
   Posteingang fern. */
.workHeader.globalWorkHeader .tabs > button.mkNcNavButton {
  flex: 0 0 40px;
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  display: inline-flex;
  place-items: unset;
  align-items: center;
  justify-content: center;
  background: transparent;
  box-shadow: none;
  filter: none;
}
.workHeader.globalWorkHeader .tabs > button.mkNcNavButton:hover,
.workHeader.globalWorkHeader .tabs > button.mkNcNavButton:active {
  border: 0;
  background: transparent;
  box-shadow: none;
  filter: none;
}

@media (max-width: 760px) {
  .mkNcNavIcon { width: 27px; height: 23px; }
}

/* Einstellungen > Meine Erinnerungen */
.mkNcSettingsHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.mkNcSettingsHead > h2 { margin: 0; }
.mkNcInfoButton { flex: 0 0 auto; }
html.mkStyleguideV014 body.mkStyleguideV014 button.BS-I.mkNcInfoButton {
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  filter: none !important;
}
.mkNcInfoIcon {
  display: block;
  width: 18px;
  height: 18px;
  background: var(--mk-nc-white);
  -webkit-mask: url('/assets/pictograms/ui/info.svg') center / contain no-repeat;
  mask: url('/assets/pictograms/ui/info.svg') center / contain no-repeat;
}

/* Info-Dialog zum Notification-Center. */
html.mkNcInfoOpen,
body.mkNcInfoOpen {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}
.mkNcInfoOverlay {
  position: fixed;
  inset: 0;
  z-index: 2147483100;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #00000180;
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  opacity: 0;
  transition: opacity 160ms ease;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}
.mkNcInfoOverlay.open { opacity: 1; }
.mkNcInfoOverlay.closing { opacity: 0; }
.mkNcInfoPanel {
  width: min(620px, 100%);
  max-height: calc(100dvh - 32px);
  margin: 0;
  padding: 18px 18px 20px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.mkNcInfoHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.mkNcInfoHead h2 { margin: 0; }
.mkNcInfoTitleGroup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.mkNcInfoTitleIcon {
  display: block;
  flex: 0 0 auto;
  width: 29px;
  height: 25px;
  object-fit: contain;
}
.mkNcInfoPanel:focus { outline: none; }
.mkNcInfoCheckIcon {
  display: block;
  width: 18px;
  height: 18px;
  background: var(--mk-nc-ci);
  -webkit-mask: url('/assets/pictograms/ui/check.svg') center / contain no-repeat;
  mask: url('/assets/pictograms/ui/check.svg') center / contain no-repeat;
}
.mkNcInfoCopy { display: grid; gap: 10px; }
.mkNcInfoCopy p { margin: 0; }
@media (max-width: 600px) {
  .mkNcInfoOverlay { padding: 9px; }
  .mkNcInfoPanel {
    max-height: calc(100dvh - 18px);
    padding: 16px 15px 18px 19px;
  }
}

/* Das NC selbst bleibt fest im Viewport. Nur das Panel scrollt. */
.mkNcOverlay {
  overflow: hidden !important;
  overscroll-behavior: none !important;
  touch-action: none;
}
.mkNcPanel {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

/* Die Mitteilungsaktion nutzt ab .205 ausschließlich das externe eye-off.svg. */
.mkNcMessageRemove:disabled { opacity: 1; cursor: default; }

.mkNcEmptyState {
  min-height: 88px;
  border: 1px solid color-mix(in srgb, var(--mk-nc-gray) 35%, transparent);
  border-radius: 20px;
  display: grid;
  place-items: center;
  padding: 18px;
  background: var(--mk-nc-bg);
  color: var(--mk-nc-gray);
  text-align: center;
}


/* =========================================================
   Chat 79 / AppServer 1.2.195.207 – NC Feinschliff
   - globaler NC-Einstieg ohne Button-Hintergrund/-Kontur
   - Piktogramm CC-G, roter Posteingangspunkt bleibt CC-A
   - auf HOME bewusst kein globaler NC-Einstieg
   - Info-Dialog zentriert; Copy = TXT-SL1-G
   ========================================================= */


/* =========================================================
   Chat 79 / AppServer 1.2.195.207 – NC Nachkorrektur
   - tagesunabhängig: Posteingang als letzter Hauptnav-Eintrag rechts
   - BS-I-Hintergrund integrationsfest transparent
   - Info-Dialog: BS-AG-H ohne Start-Focus-Ring, Haken CC-CI
   ========================================================= */

/* =========================================================
   Chat 79 / AppServer 1.2.195.207 – BS-I Nachkorrektur
   Das Info-Piktogramm enthält selbst den Kreis. Die Button-Hitbox bleibt
   40×40 px, aber vollständig ohne zusätzliche Fläche oder Kontur.
   ========================================================= */
html.mkStyleguideV014 body.mkStyleguideV014 button.BS-I.mkNcInfoButton,
html.mkStyleguideV014 body.mkStyleguideV014 button.BS-I.mkNcInfoButton:not(:disabled):hover,
html.mkStyleguideV014 body.mkStyleguideV014 button.BS-I.mkNcInfoButton:not(:disabled):active {
  background: transparent !important;
  background-color: transparent !important;
  border: 0 !important;
  border-width: 0 !important;
  box-shadow: none !important;
  filter: none !important;
}

/* =========================================================
   Chat 79 / AppServer 1.2.195.207 – NC/UI Konsolidierung
   - iPad/Desktop: Hauptnavigation links, NC als fester Slot ganz rechts
   - iPhone: NC immer direkt hinter Einstellungen in der oberen Hauptnavigation
   - Tagesliste: Live-Bestand bleibt fachlicher Badge; Dismissal quittiert nur die Meldung
   - NC-Aktion: externes eye-off.svg, kein Zwischenzustand
   ========================================================= */

/* Desktop/iPad: dieselbe Kopfgeometrie auf allen Arbeitsseiten. */
@media (min-width: 601px) {
  .workHeader {
    justify-content: flex-start !important;
  }
  .workHeader.datedWorkHeader .compactWorkDateNav {
    margin-left: auto !important;
  }
  .workHeader.globalWorkHeader > .mkNcNavButton,
  .workHeader:not(.datedWorkHeader) > .mkNcNavButton {
    margin-left: auto !important;
  }
  .workHeader.datedWorkHeader > .mkNcNavButton {
    margin-left: .35rem !important;
  }
}

/* iPhone: NC ist Teil der oberen Hauptnavigation und wandert nie in die Datumszeile. */
@media (max-width: 600px) and (orientation: portrait) {
  .workHeader .tabs > button.mkNcNavButton {
    flex: 0 0 40px !important;
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    display: inline-flex !important;
    place-items: unset !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    box-shadow: none !important;
    filter: none !important;
  }
  .workHeader .tabs > button.mkNcNavButton:hover,
  .workHeader .tabs > button.mkNcNavButton:active {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    filter: none !important;
  }
}

/* Durchgestrichenes Auge: eigenständiges externes NC-Aktionspiktogramm. */
.mkNcEyeOffIcon {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
  pointer-events: none;
}
.mkNcMessageRemove:disabled {
  opacity: 1;
  cursor: default;
}

/* Chat 79 / AppServer 1.2.195.207 – iPhone Tagesliste:
   nach endgültigem Entfernen des alten Tab-Badges bleibt der Text mittig. */
@media (max-width: 600px), (orientation: landscape) and (max-height: 500px) {
  .plannerMobileTabsStandalone > button {
    justify-content: center !important;
    text-align: center !important;
    gap: 0 !important;
  }
}
