/*
 * MagicKcal · Magic AutoKcal Dashboard v1
 * Chat 92 / Runde 7 · App 1.2.195.272
 *
 * Ausschliesslich die Magic-AutoKcal-Kachel und ihren Info-Dialog gestalten.
 * Runde 7: Standard-Donuts 1:1 aus Tagesliste/Tagesjournal, zwei kcal-Subkacheln
 * mit deaktivierten Haken/X ohne Vorschlag, laufende Datenbasis nach der Lernphase.
 * Keine Aenderung am globalen Styleguide; vorhandene CC-/BS-/KA-Tokens werden genutzt.
 */

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .magicAutoKcalHead {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: .5rem !important;
  padding-right: 3.35rem !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .magicAutoKcalHead h2 {
  margin: 0 !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalInfoButton {
  flex: 0 0 40px !important;
  margin: 0 !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalInfoIcon {
  display: block !important;
  width: 18px !important;
  height: 18px !important;
  background: var(--cc-w) !important;
  -webkit-mask: url('/assets/pictograms/ui/info.svg') center / contain no-repeat !important;
  mask: url('/assets/pictograms/ui/info.svg') center / contain no-repeat !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .magicAutoKcalStatusRow {
  min-height: 0 !important;
  margin: 0 !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .magicAutoKcalStatusActions {
  position: absolute !important;
  top: 1rem !important;
  right: 1rem !important;
  z-index: 2 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: .4rem !important;
  padding: 0 !important;
  margin: 0 !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard.mkAutoKcalDateLocked .magicAutoKcalStatusActions .tipSwitch {
  display: none !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .magicAutoKcalStatusActions .mkUnavailableLock.magicAutoKcalDateLock {
  position: static !important;
  inset: auto !important;
  margin: 0 !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalDashboard {
  display: grid !important;
  gap: .72rem !important;
  margin-top: .7rem !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalDashboard.is-locked {
  opacity: .62 !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalDashboardStatus {
  position: relative !important;
  margin: 0 !important;
  padding-left: 14px !important;
  color: var(--cc-ci) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  letter-spacing: .015em !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalDashboardStatus::before {
  content: "" !important;
  position: absolute !important;
  left: 0 !important;
  top: 50% !important;
  width: 7px !important;
  height: 7px !important;
  border-radius: 50% !important;
  background: var(--cc-ci) !important;
  transform: translateY(-50%) !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalDonutRow {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  align-items: start !important;
  gap: .5rem !important;
  width: 100% !important;
}

/* Donut-Geometrie/Track/Segmentenden kommen unveraendert aus dem bestehenden
   Tageslisten-/Tagesjournal-Donut. AutoKcal setzt nur die CI-Farbe und Inhalte. */
html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalDonutMeter {
  --meter-color: var(--cc-ci) !important;
  --meter-text: var(--cc-g) !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalDonutMeter .donutRing {
  --meter-color: var(--cc-ci) !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalDonutMeter .donutCenter > span {
  display: block !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalDashboardText {
  margin: 0 !important;
  padding-top: .65rem !important;
  border-top: 1px solid var(--cc-r) !important;
  color: var(--cc-g) !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalKcalBlock {
  --mk-ak-kcal-tone: var(--cc-w);
  min-width: 0 !important;
  min-height: 128px !important;
  padding: .82rem .62rem .72rem !important;
  display: grid !important;
  align-content: center !important;
  justify-items: center !important;
  text-align: center !important;
  border: 1px solid color-mix(in srgb, var(--mk-ak-kcal-tone) 24%, transparent) !important;
  border-radius: 16px !important;
  background: color-mix(in srgb, var(--mk-ak-kcal-tone) 9%, #ffffff05) !important;
  box-shadow: inset 0 1px #ffffff09 !important;
  overflow: hidden !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalKcalBlock--single {
  width: min(100%, 320px) !important;
  justify-self: start !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalKcalBlock--current {
  --mk-ak-kcal-tone: var(--cc-k);
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalKcalBlock--proposal {
  --mk-ak-kcal-tone: var(--cc-z);
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalKcalLine {
  display: flex !important;
  align-items: baseline !important;
  justify-content: center !important;
  gap: .28rem !important;
  min-width: 0 !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalKcalNumber {
  color: var(--mk-ak-kcal-tone) !important;
  line-height: .92 !important;
  letter-spacing: -.045em !important;
  text-shadow: 0 0 18px color-mix(in srgb, var(--mk-ak-kcal-tone) 16%, transparent) !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalKcalUnit {
  color: var(--cc-w) !important;
  font-size: 16px !important;
  font-weight: 700 !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalKcalLabel {
  display: block !important;
  margin-top: .35rem !important;
  color: var(--cc-w) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.18 !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalProposalRow {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 38px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: .55rem !important;
  min-width: 0 !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalProposalArrow {
  display: grid !important;
  place-items: center !important;
  width: 38px !important;
  height: 38px !important;
  border: 1px solid color-mix(in srgb, var(--cc-g) 35%, transparent) !important;
  border-radius: 50% !important;
  background: var(--cc-d) !important;
  color: var(--cc-g) !important;
  font-size: 24px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalProposalActions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: .4rem !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard :is(.mkAutoKcalProposalReject, .mkAutoKcalProposalAccept) {
  flex: 0 0 40px !important;
  margin: 0 !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalProposalIcon {
  display: block !important;
  width: 20px !important;
  height: 20px !important;
  object-fit: contain !important;
}

/* Bestehende Zielwahl bleibt funktional unveraendert und wird nur optisch vom Dashboard getrennt. */
html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalControls {
  margin-top: .85rem !important;
  padding-top: .75rem !important;
  border-top: 1px solid var(--cc-r) !important;
}

/* Info-Dialog: ausschliesslich vorhandene KA-DN / TXT / BS-Bausteine. */
html.mkStyleguideV014 body.mkStyleguideV014 .mkAutoKcalInfoBackdrop {
  z-index: 430 !important;
  padding: 20px !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .mkAutoKcalInfoPanel {
  width: min(620px, 100%) !important;
  max-height: min(88vh, 820px) !important;
  overflow: auto !important;
  padding: 1rem !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .mkAutoKcalInfoHead {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 1rem !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .mkAutoKcalInfoHead h2 {
  margin: 0 !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .mkAutoKcalInfoClose {
  flex: 0 0 40px !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .mkAutoKcalInfoCheck {
  display: block !important;
  width: 20px !important;
  height: 20px !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .mkAutoKcalInfoCopy {
  display: grid !important;
  gap: .72rem !important;
  margin-top: .85rem !important;
}

html.mkStyleguideV014 body.mkStyleguideV014 .mkAutoKcalInfoCopy p {
  margin: 0 !important;
}

@media (max-width: 600px), (orientation: landscape) and (max-height: 500px) {
  html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalProposalRow {
    grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr) !important;
    gap: .4rem !important;
  }

  html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalProposalArrow {
    width: 34px !important;
    height: 34px !important;
    font-size: 21px !important;
  }

  html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalKcalBlock {
    min-height: 116px !important;
    padding: .72rem .45rem .65rem !important;
  }

  html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalKcalUnit {
    font-size: 14px !important;
  }

  html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalKcalLabel {
    font-size: 11px !important;
  }

  html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalProposalActions {
    grid-column: 1 / -1 !important;
    justify-self: end !important;
  }

  /* iPhone: keine rechte vertikale Pillenspalte; 2+1-Auswahl nutzt die Kachelbreite. */
  html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalGoalPills {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    justify-items: stretch !important;
    width: 100% !important;
    gap: .45rem !important;
  }

  html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalGoalPill {
    width: 100% !important;
    min-width: 0 !important;
    justify-content: center !important;
    white-space: nowrap !important;
  }

  html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalGoalPill:nth-child(3) {
    grid-column: 1 / -1 !important;
    width: min(100%, 190px) !important;
    justify-self: center !important;
  }

  html.mkStyleguideV014 body.mkStyleguideV014 .mkAutoKcalInfoBackdrop {
    padding: 10px !important;
    align-items: start !important;
  }

  html.mkStyleguideV014 body.mkStyleguideV014 .mkAutoKcalInfoPanel {
    max-height: calc(100vh - 20px) !important;
  }
}

html.mkStyleguideV014 body.mkStyleguideV014 .magicAutoKcalCard .mkAutoKcalControls:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}
