.shape-fasting {
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 14px;
  padding: 16px;
  max-width: 860px;
  background: #fff;
}

.shape-fasting__header {
  margin-bottom: 10px;
}

.shape-fasting__title {
  margin: 0 0 6px 0;
  font-size: 18px;
}

.shape-fasting__sub {
  opacity: 0.8;
  font-size: 13px;
  line-height: 1.4;
}

.shape-fasting__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin: 12px 0;
}

.shape-fasting__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shape-fasting__label {
  font-size: 12px;
  opacity: 0.8;
}

.shape-fasting__select {
  min-width: 220px;
  padding: 9px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: #fff;
}

.shape-fasting__btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  line-height: 1;
}

.shape-fasting__btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.shape-fasting__btn--start {
  background: #1f8f4a;
  color: #fff;
  border-color: rgba(0, 0, 0, 0.1);
}
.shape-fasting__btn--stop {
  background: #c0392b;
  color: #fff;
  border-color: rgba(0, 0, 0, 0.1);
}
.shape-fasting__btn--refresh {
  background: #eef2f6;
  color: #111;
  border-color: rgba(0, 0, 0, 0.12);
}
.shape-fasting__btn--delete {
  background: #fff;
  color: #111;
  border-color: rgba(0, 0, 0, 0.2);
  padding: 8px 10px;
  font-weight: 700;
}

.shape-fasting__btn--start:hover,
.shape-fasting__btn--stop:hover {
  filter: brightness(0.95);
}

.shape-fasting__btn--refresh:hover,
.shape-fasting__btn--delete:hover {
  background: #eef2f6;
}

.shape-fasting__panel {
  margin-top: 8px;
}

.shape-fasting__status {
  font-weight: 800;
  margin-bottom: 10px;
}

.shape-fasting__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 720px) {
  .shape-fasting__grid {
    grid-template-columns: 1fr;
  }
}

.shape-fasting__card {
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 14px;
  padding: 12px;
}

.shape-fasting__cardLabel {
  font-size: 12px;
  opacity: 0.75;
  margin-bottom: 6px;
}

.shape-fasting__cardValue {
  font-size: 18px;
  font-weight: 800;
}

.shape-fasting__countdown {
  font-variant-numeric: tabular-nums;
}

.shape-fasting__hint {
  margin-top: 10px;
  font-size: 12px;
  opacity: 0.85;
  min-height: 18px;
}

.shape-fasting--notice {
  border: 1px dashed rgba(0, 0, 0, 0.22);
  padding: 16px;
  border-radius: 14px;
  background: #fff;
}

/* Progress */
.shape-fasting__progressWrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shape-fasting__progressRail {
  position: relative;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.07), rgba(0, 0, 0, 0.03));
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.shape-fasting__progressFill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2ecc71 0%, #f1c40f 45%, #e67e22 70%, #c0392b 100%);
  filter: saturate(1.05);
}

.shape-fasting__progressFlame {
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%) rotate(15deg);
  border-radius: 50% 50% 50% 0;
  background: radial-gradient(
    circle at 30% 30%,
    #fff2a8 0%,
    #f39c12 35%,
    #e74c3c 70%,
    rgba(231, 76, 60, 0) 72%
  );
  opacity: 0.95;
  pointer-events: none;
  animation: shapeFlameFlicker 1.2s infinite ease-in-out;
  box-shadow: 0 0 12px rgba(231, 76, 60, 0.35);
}

@keyframes shapeFlameFlicker {
  0% {
    transform: translate(-50%, -50%) rotate(12deg) scale(0.95);
    opacity: 0.85;
  }
  50% {
    transform: translate(-50%, -55%) rotate(20deg) scale(1.05);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) rotate(15deg) scale(0.98);
    opacity: 0.9;
  }
}

.shape-fasting__progressMeta {
  font-size: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.shape-fasting__muted {
  opacity: 0.75;
}

/* Burn grid */
.shape-fasting__burnGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.shape-fasting__burnItem {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.02);
}

.shape-fasting__burnLabel {
  font-size: 12px;
  opacity: 0.75;
  margin-bottom: 6px;
}

.shape-fasting__burnValue {
  font-size: 16px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.shape-fasting__burnNote {
  font-size: 12px;
  opacity: 0.7;
  line-height: 1.35;
}

@media (max-width: 520px) {
  .shape-fasting__burnGrid {
    grid-template-columns: 1fr;
  }
}

/* Phase area */
.shape-fasting__phaseRow {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.shape-fasting__phaseGraphic {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.shape-fasting__phaseGraphic svg {
  width: 34px;
  height: 34px;
  display: block;
}

.shape-fasting__phaseContent {
  min-width: 0;
}

.shape-fasting__phaseTitle {
  font-weight: 900;
  font-size: 14px;
  margin-bottom: 6px;
}

.shape-fasting__phaseText {
  font-size: 13px;
  line-height: 1.35;
  opacity: 0.9;
}

.shape-fasting__phaseNote {
  margin-top: 10px;
  font-size: 12px;
  opacity: 0.75;
}

/* History */
.shape-fasting__history {
  margin-top: 16px;
  padding-bottom: 10px;
}

.shape-fasting__historyTitle {
  margin: 0 0 10px 0;
  font-size: 14px;
  opacity: 0.9;
}

.shape-fasting__historyScroll {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
}

.shape-fasting__historyScroll::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 26px;
  pointer-events: none;
  background: linear-gradient(270deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
}

.shape-fasting__historyTable {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  background: #fff;
}

.shape-fasting__historyTable th,
.shape-fasting__historyTable td {
  padding: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  text-align: left;
  font-size: 13px;
  vertical-align: middle;
}

.shape-fasting__badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  font-size: 12px;
}

.shape-fasting__swipeHint {
  display: none;
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.7;
}

@media (max-width: 520px) {
  .shape-fasting__controls {
    flex-direction: column;
    align-items: stretch;
  }
  .shape-fasting__select {
    min-width: 0;
    width: 100%;
  }
  .shape-fasting__btn {
    width: 100%;
  }
  .shape-fasting__swipeHint {
    display: block;
  }
  .shape-fasting__history {
    padding-bottom: 24px;
  }
  .shape-fasting__phaseGraphic {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    border-radius: 12px;
  }
  .shape-fasting__phaseGraphic svg {
    width: 30px;
    height: 30px;
  }
}

/* scrollbar webkit */
.shape-fasting__historyScroll::-webkit-scrollbar {
  height: 10px;
}
.shape-fasting__historyScroll::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 999px;
}
.shape-fasting__historyScroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 999px;
}

/* === Desktop Layout Fix: Progress / Status gleich hoch === */

@media (min-width: 768px) {

  .shape-fasting__grid {
    align-items: stretch;
  }

  .shape-fasting__card {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .shape-fasting__card > * {
    flex-shrink: 0;
  }

  /* Fortschrittskarte: Inhalt flexibel */
  .shape-fasting__card .shape-fasting__progressWrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  /* Statuskarte: Inhalt ausrichten */
  .shape-fasting__phaseCard {
    display: flex;
    flex-direction: column;
  }

  .shape-fasting__phaseRow {
    flex: 1;
    display: flex;
    align-items: center;
  }

}
