:root {
  color-scheme: light;
  --bg: #f6abc0;
  --ink: #2f2228;
  --muted: #755964;
  --panel: #ffffff;
  --panel-strong: #fff3f7;
  --line: #ecd2da;
  --brand: #b84f73;
  --brand-ink: #ffffff;
  --accent: #7f5261;
  --soft: #f7e6ec;
  --sage: #e9f1ec;
  --shadow: 0 8px 22px rgba(92, 31, 58, 0.06);
  font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.72), transparent 26rem),
    radial-gradient(circle at 84% 4%, rgba(255, 209, 128, 0.72), transparent 22rem),
    radial-gradient(circle at 12% 86%, rgba(255, 95, 154, 0.58), transparent 24rem),
    linear-gradient(135deg, #ffe1ec 0%, #ff9fcb 34%, #cfa7f6 66%, #ffb86c 100%);
  background-attachment: fixed;
  background-size: 125% 125%, 130% 130%, 145% 145%, 240% 240%;
  animation: lovable-drift 18s ease-in-out infinite alternate;
  color: var(--ink);
}

@keyframes lovable-drift {
  0% {
    background-position: 0% 0%, 100% 0%, 0% 100%, 0% 50%;
  }

  50% {
    background-position: 12% 8%, 82% 18%, 18% 84%, 65% 42%;
  }

  100% {
    background-position: 22% 16%, 70% 28%, 30% 72%, 100% 50%;
  }
}

button,
input,
textarea {
  box-sizing: border-box;
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 24px 16px 36px;
}

.topbar,
.section-heading,
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 18px;
}

.eyebrow,
.section-heading span,
.summary-grid span,
label span,
.hint,
.status-line {
  color: var(--muted);
  font-size: 0.8rem;
}

.eyebrow {
  margin: 0 0 4px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.1rem, 11vw, 3.5rem);
}

h2 {
  font-size: 1.08rem;
}

.hero-panel,
.chart-panel,
.history-panel,
.summary-grid article,
dialog {
  background: var(--panel);
  border: 0;
  box-shadow: var(--shadow);
}

.hero-panel {
  border-radius: 24px;
  padding: 18px;
}

.entry-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.date-row,
.toggle-grid,
.stepper-grid,
.summary-grid {
  display: grid;
  gap: 10px;
}

.date-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

input,
textarea {
  min-width: 0;
  width: 100%;
  border: 1px solid #ead4dc;
  border-radius: 999px;
  background: #fffafb;
  color: var(--ink);
  outline: none;
  padding: 13px 14px;
}

textarea {
  border-radius: 18px;
  resize: vertical;
}

input:focus,
textarea:focus,
button:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(184, 92, 122, 0.16);
}

input[type="date"],
input[type="time"] {
  padding-left: 14px;
  padding-right: 12px;
}

.milk-control {
  display: grid;
  place-items: center;
  min-height: 310px;
  border: 0;
  border-radius: 34px;
  background: transparent;
  padding: 16px 18px 20px;
}

.milk-orbit {
  position: relative;
  display: grid;
  width: min(100%, 300px);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(184, 79, 115, 0.14);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.98) 0 40%, rgba(255, 243, 247, 0.86) 41% 61%, transparent 62%),
    conic-gradient(from 15deg, rgba(184, 79, 115, 0.14), rgba(255, 173, 102, 0.14), rgba(188, 134, 242, 0.16), rgba(184, 79, 115, 0.14));
}

.milk-core {
  display: grid;
  width: 57%;
  aspect-ratio: 1;
  align-content: center;
  justify-items: center;
  gap: 4px;
  border: 8px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: #fffafb;
  box-shadow: inset 0 0 0 1px rgba(184, 79, 115, 0.08);
  text-align: center;
}

.milk-core span {
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.milk-core strong {
  display: grid;
  justify-items: center;
  gap: 0;
  font-size: clamp(2.45rem, 14vw, 4.55rem);
  font-weight: 800;
  line-height: 1;
}

.milk-core input {
  width: min(28vw, 112px);
  border: 0;
  border-bottom: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  text-align: right;
  font-size: inherit;
  font-weight: inherit;
}

.milk-core .milk-unit {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: lowercase;
}

.orbit-button,
.text-button,
.icon-button {
  border: 1px solid #ead4dc;
  background: #fffafb;
  color: var(--ink);
}

.orbit-button {
  position: absolute;
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 6px solid #ffffff;
  border-radius: 999px;
  background: linear-gradient(145deg, #ff8db7, #b84f73);
  color: white;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(108, 42, 70, 0.16);
}

.orbit-button-top {
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
}

.orbit-button-right {
  top: 50%;
  right: -22px;
  transform: translateY(-50%);
}

.orbit-button-bottom {
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
}

.orbit-button-left {
  top: 50%;
  left: -22px;
  transform: translateY(-50%);
}

.toggle-grid {
  grid-template-columns: repeat(3, 1fr);
  justify-items: center;
}

.pill-toggle {
  position: relative;
}

.pill-toggle input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.pill-toggle span {
  display: grid;
  width: 68px;
  height: 68px;
  min-height: 68px;
  place-items: center;
  border: 6px solid #ffffff;
  border-radius: 999px;
  background: linear-gradient(145deg, #fffafb, #fff0f6);
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(108, 42, 70, 0.1);
}

.pill-toggle input:checked + span {
  border-color: var(--brand);
  background: linear-gradient(145deg, #ff8db7, #b84f73);
  color: var(--brand-ink);
}

.primary-button {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(110deg, #ff7faf 0%, #b84f73 42%, #bc86f2 72%, #ffad66 100%);
  background-size: 220% 220%;
  color: var(--brand-ink);
  font-weight: 800;
  animation: button-gradient-drift 8s ease-in-out infinite alternate;
  box-shadow: 0 8px 18px rgba(184, 79, 115, 0.18);
}

@keyframes button-gradient-drift {
  0% {
    background-position: 0% 50%;
  }

  100% {
    background-position: 100% 50%;
  }
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  font-size: 1.1rem;
}

.text-button {
  min-height: 36px;
  border-radius: 999px;
  padding: 0 14px;
  font-weight: 650;
}

.status-line {
  min-height: 1.25rem;
  margin: -6px 0 0;
}

.summary-grid {
  grid-template-columns: repeat(3, 1fr);
  margin: 14px 0;
}

.summary-grid article,
.chart-panel,
.history-panel {
  border-radius: 20px;
  padding: 15px;
}

.summary-grid article {
  display: grid;
  min-height: 82px;
  align-content: space-between;
}

.summary-grid strong {
  font-size: 1.28rem;
  font-weight: 800;
}

.chart-panel,
.history-panel {
  margin-top: 14px;
}

.chart {
  min-height: 190px;
  margin-top: 10px;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.history-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(104px, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #f0dbe2;
  border-radius: 16px;
  background: #fffafb;
  padding: 9px 10px;
}

.history-time {
  display: inline-block;
  width: 44px;
  flex: 0 0 44px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.history-main {
  display: flex;
  min-height: 30px;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 9px;
  min-width: 0;
}

.history-main strong {
  display: inline-block;
  width: 68px;
  flex: 0 0 68px;
  margin-top: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.history-main small {
  display: block;
  flex-basis: 100%;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.history-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}

.badge {
  border-radius: 999px;
  background: linear-gradient(135deg, #ff75aa, #b84f73 58%, #bc86f2);
  color: white;
  padding: 3px 7px;
  font-size: 0.74rem;
  font-weight: 700;
}

.delete-button {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  min-height: 30px;
  border: 1px solid rgba(184, 92, 122, 0.46);
  border-radius: 999px;
  background: #fffafb;
  color: #88425a;
  padding: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

dialog {
  width: min(calc(100% - 28px), 520px);
  border-radius: 20px;
  color: var(--ink);
  padding: 0;
}

dialog::backdrop {
  background: rgba(53, 40, 46, 0.34);
}

.settings-form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

@media (max-width: 520px) {
  .app-shell {
    padding: 16px 12px 26px;
  }

  .hero-panel {
    border-radius: 24px;
    padding: 14px;
  }

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

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

  .summary-grid article {
    min-height: 64px;
  }

  .badges {
    justify-content: flex-end;
  }

  .history-actions {
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  body,
  .primary-button {
    animation: none;
  }
}
