* {
  box-sizing: border-box;
}

:root {
  --blue: #1689d8;
  --blue-dark: #0871be;
  --blue-soft: #e9f7ff;
  --ink: #153246;
  --muted: #718895;
}

:root.dark-theme {
  --blue: #54c7ff;
  --blue-dark: #8bdcff;
  --blue-soft: #09283a;
  --ink: #e9f7ff;
  --muted: #9db6c4;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  background:
    radial-gradient(circle at 15% 18%, rgba(105, 201, 255, .20), transparent 26%),
    radial-gradient(circle at 85% 80%, rgba(22, 137, 216, .12), transparent 30%),
    #f4fbff;
}

.dark-theme body {
  background:
    radial-gradient(circle at 15% 18%, rgba(84, 199, 255, .16), transparent 28%),
    radial-gradient(circle at 85% 80%, rgba(35, 168, 236, .12), transparent 32%),
    #061824;
}

.app {
  width: min(100%, 800px);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.drop {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  font-size: 24px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(21, 84, 124, .10);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
}

h1 {
  margin: 0;
  font-size: clamp(25px, 4vw, 32px);
  letter-spacing: -.8px;
}

.date {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 14px;
  text-transform: capitalize;
}

.header-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.beta-toggle {
  border: 0;
  border-radius: 999px;
  padding: 9px 13px;
  color: white;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.2px;
  background: linear-gradient(135deg, #7c3aed, #159ae4);
  box-shadow: 0 10px 24px rgba(78, 70, 229, .22);
}

.beta-toggle.active {
  background: linear-gradient(135deg, #18b776, #159ae4);
}

.card {
  min-height: 420px;
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  overflow: hidden;
  border: 1px solid rgba(108, 175, 213, .22);
  border-radius: 28px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 24px 60px rgba(20, 84, 123, .12);
}

.water-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 390px;
  overflow: hidden;
  background: linear-gradient(145deg, #e7f8ff, #cceeff);
}

.water-visual::before,
.water-visual::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.7);
}

.water-visual::before { width: 310px; height: 310px; }
.water-visual::after { width: 240px; height: 240px; }

.bottle {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 18px 18px rgba(16, 105, 157, .2));
}

.bottle-cap {
  width: 56px;
  height: 22px;
  border-radius: 8px 8px 4px 4px;
  background: repeating-linear-gradient(90deg, #158ad1 0 4px, #41a9e4 4px 7px);
}

.bottle-neck {
  width: 48px;
  height: 24px;
  background: rgba(255,255,255,.65);
  border-inline: 2px solid rgba(54,157,212,.25);
}

.bottle-body {
  position: relative;
  width: 124px;
  height: 245px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 3px solid rgba(255,255,255,.78);
  border-radius: 25px 25px 32px 32px;
  background: rgba(255,255,255,.42);
  box-shadow: inset 10px 0 18px rgba(255,255,255,.38);
}

.bottle-body::after {
  content: "";
  position: absolute;
  inset: 18px 12px;
  border-block: 1px solid rgba(24,132,193,.13);
  border-radius: 18px;
}

.bottle-body > span {
  z-index: 2;
  color: rgba(8, 100, 155, .65);
  font-weight: 700;
  font-size: 23px;
  line-height: .8;
  text-align: center;
}

.bottle-body small { font-size: 11px; letter-spacing: 1px; }

.water {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 18%;
  transition: height .45s cubic-bezier(.2,.8,.2,1);
  background: linear-gradient(#49c4f1, #168fd9);
}

.water::before {
  content: "";
  position: absolute;
  width: 160px;
  height: 22px;
  left: -18px;
  top: -10px;
  border-radius: 45%;
  background: #72d5f7;
}

.stats {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px clamp(30px, 7vw, 68px);
}

.label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 15px;
}

.total {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.total strong {
  color: var(--blue-dark);
  font-size: clamp(54px, 9vw, 76px);
  line-height: 1;
  letter-spacing: -4px;
}

.total span {
  color: var(--muted);
  font-size: 20px;
  font-weight: 500;
}

.bottles {
  margin: 12px 0 6px;
  color: var(--muted);
}

.bottles strong { color: var(--ink); }

.percentage {
  margin: 0 0 22px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 600;
}

.goal {
  margin-bottom: 24px;
  padding: 14px 16px;
  border: 1px solid #dceff9;
  border-radius: 14px;
  background: #f5fbff;
}

.goal-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 13px;
}

.goal-heading strong { color: var(--blue-dark); font-size: 14px; }

.goal-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dceef8;
}

.goal-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #48c5ed, #1285d2);
  transition: width .4s ease;
}

.goal p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.goal p.completed { color: #198856; font-weight: 700; }

.goal:has(.completed) {
  animation: goal-pop .85s ease;
  border-color: rgba(37, 168, 107, .35);
  background: #f0fff8;
}

.bottle.celebrating {
  animation: bottle-celebration 1.3s ease;
}

.bottle.celebrating .water::before {
  animation: wave-party .6s ease-in-out 5;
}

.celebration {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  pointer-events: none;
}

.celebration.active {
  background:
    radial-gradient(circle at 50% 46%, rgba(87, 218, 255, .30), rgba(9, 88, 150, .12) 34%, transparent 66%),
    linear-gradient(180deg, rgba(233, 248, 255, .08), rgba(12, 97, 157, .14));
  animation: celebration-backdrop 5.4s ease forwards;
}

.wave-floor {
  position: absolute;
  right: -5%;
  bottom: -76px;
  left: -5%;
  height: 210px;
  overflow: hidden;
  opacity: 0;
  animation: wave-floor-show 5.2s ease forwards;
}

.wave-floor::before,
.wave-floor::after,
.wave-floor span {
  content: "";
  position: absolute;
  right: -15%;
  left: -15%;
  border-radius: 48% 52% 0 0;
  background: linear-gradient(180deg, rgba(115, 218, 250, .70), rgba(12, 127, 203, .52));
}

.wave-floor::before {
  bottom: 0;
  height: 150px;
  animation: wave-sway 2.1s ease-in-out infinite alternate;
}

.wave-floor::after {
  bottom: 28px;
  height: 120px;
  opacity: .72;
  animation: wave-sway 1.65s ease-in-out infinite alternate-reverse;
}

.wave-floor span:first-child {
  bottom: 78px;
  height: 65px;
  opacity: .42;
  animation: wave-sway 1.35s ease-in-out infinite alternate;
}

.wave-floor span:last-child {
  bottom: 110px;
  height: 46px;
  opacity: .28;
  animation: wave-sway 1.9s ease-in-out infinite alternate-reverse;
}

.splash-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  opacity: 0;
}

.ring-one {
  width: 120px;
  height: 120px;
  border: 4px solid rgba(94, 219, 255, .85);
  box-shadow: 0 0 0 18px rgba(94, 219, 255, .15), inset 0 0 28px rgba(255,255,255,.9);
  animation: splash-ring 1.45s ease-out .05s forwards;
}

.ring-two {
  width: 72px;
  height: 72px;
  border: 3px solid rgba(255, 255, 255, .92);
  box-shadow: 0 0 44px rgba(72, 197, 237, .65);
  animation: splash-ring 1.75s ease-out .28s forwards;
}

.gold-burst {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 215, 83, .38) 0 9deg, transparent 9deg 18deg);
  filter: blur(.2px);
  opacity: 0;
  transform: translate(-50%, -50%);
}

.celebration.super-streak .gold-burst {
  display: block;
  animation: gold-burst 5s ease forwards, shine-spin 7s linear infinite;
}

.celebration.super-streak .celebration-card::before {
  background: conic-gradient(from 90deg, #ffe27a, #fff, #35d0ff, #ffcb3d, #ffe27a);
}

.celebration.super-streak .hydro-icon,
.celebration.super-streak .mini-bottle {
  filter: drop-shadow(0 10px 16px rgba(184, 132, 10, .22));
}

.celebration-card {
  pointer-events: auto;
  position: absolute;
  top: 48%;
  left: 50%;
  width: min(88vw, 410px);
  padding: 30px 25px 24px;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 32px;
  text-align: center;
  color: var(--ink);
  background:
    linear-gradient(155deg, rgba(255,255,255,.98), rgba(231, 250, 255, .96)),
    radial-gradient(circle at 20% 0, rgba(90, 220, 255, .38), transparent 35%);
  box-shadow: 0 32px 95px rgba(8, 80, 132, .28);
  transform: translate(-50%, -50%) scale(.72);
  opacity: 0;
  animation: celebration-card 5s cubic-bezier(.18,.9,.22,1) forwards;
}

.celebration-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: inherit;
  background: conic-gradient(from 90deg, #61d8ff, #fff, #33c3ff, #98f5d1, #61d8ff);
  filter: blur(12px);
  opacity: .7;
  animation: shine-spin 2.6s linear infinite;
}

.streak-ribbon {
  width: max-content;
  max-width: 100%;
  margin: -12px auto 13px;
  padding: 8px 13px;
  border-radius: 999px;
  color: #0b7850;
  font-size: 12px;
  font-weight: 900;
  background: linear-gradient(135deg, #e6fff3, #d9f5ff);
  box-shadow: inset 0 0 0 1px rgba(30, 181, 109, .14);
}

.celebration.super-streak .streak-ribbon {
  color: #8a5a00;
  background: linear-gradient(135deg, #fff6d1, #e7fbff);
}

.celebration-icon {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin: 0 auto 10px;
  border-radius: 25px;
  font-size: 38px;
  background: linear-gradient(135deg, #eaffff, #6bd7ff 58%, #19a4e7);
  box-shadow: 0 16px 34px rgba(22, 137, 216, .28);
  animation: icon-float .9s ease-in-out infinite alternate;
}

.celebration-kicker {
  margin: 0 0 3px;
  color: #12a96b;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.celebration-card strong {
  display: block;
  color: var(--blue-dark);
  font-size: clamp(30px, 7vw, 42px);
  line-height: 1;
  letter-spacing: -1.4px;
}

.celebration-card p:not(.celebration-kicker) {
  margin: 11px auto 18px;
  max-width: 310px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.new-achievements {
  display: grid;
  gap: 6px;
  width: min(100%, 295px);
  margin: 0 auto 16px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(233, 248, 255, .86);
  box-shadow: inset 0 0 0 1px rgba(87, 183, 232, .18);
}

.new-achievements small {
  color: var(--blue-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.new-achievements b {
  color: var(--ink);
  font-size: 14px;
}

.celebration-story-button {
  margin: 0 auto 14px;
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  color: white;
  font-size: 13px;
  font-weight: 900;
  background: linear-gradient(135deg, #7c3aed, #159ae4);
  box-shadow: 0 12px 24px rgba(45, 104, 190, .20);
}

.celebration-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.celebration-badges span {
  display: inline-flex;
  padding: 9px 13px;
  border-radius: 999px;
  color: #087647;
  font-size: 12px;
  font-weight: 900;
  background: #e6fff3;
  box-shadow: inset 0 0 0 1px rgba(30, 181, 109, .12);
}

.hydro-icon,
.aqua-bubble,
.splash-drop,
.mini-bottle {
  position: absolute;
  opacity: 0;
  will-change: transform, opacity;
}

.hydro-icon {
  bottom: -70px;
  left: var(--left);
  font-size: var(--size);
  filter: drop-shadow(0 8px 12px rgba(13, 96, 153, .22));
  animation: hydro-rise var(--duration) cubic-bezier(.16,.72,.28,1) var(--delay) forwards;
}

.aqua-bubble {
  bottom: -46px;
  left: var(--left);
  width: var(--size);
  height: var(--size);
  border: 2px solid rgba(139, 225, 255, .9);
  border-radius: 50%;
  background: rgba(255,255,255,.42);
  box-shadow: inset -4px -5px 11px rgba(72, 197, 237, .18), 0 0 14px rgba(107, 215, 255, .24);
  animation: bubble-rise var(--duration) ease-out var(--delay) forwards;
}

.splash-drop {
  top: 50%;
  left: 50%;
  font-size: var(--size);
  filter: drop-shadow(0 8px 12px rgba(13, 96, 153, .22));
  animation: splash-pop 1.35s cubic-bezier(.12,.82,.24,1) var(--delay) forwards;
}

.mini-bottle {
  bottom: -100px;
  left: var(--left);
  width: 34px;
  height: 74px;
  border: 2px solid rgba(255,255,255,.92);
  border-radius: 12px 12px 16px 16px;
  background: rgba(255,255,255,.46);
  box-shadow: inset 8px 0 12px rgba(255,255,255,.36), 0 10px 20px rgba(13, 96, 153, .20);
  overflow: hidden;
  animation: bottle-rise var(--duration) cubic-bezier(.18,.75,.28,1) var(--delay) forwards;
}

.mini-bottle::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 9px;
  width: 13px;
  height: 14px;
  border-radius: 5px 5px 2px 2px;
  background: #159ae4;
}

.mini-bottle::after {
  content: "";
  position: absolute;
  top: 12px;
  left: 7px;
  width: 5px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255,255,255,.62);
}

.mini-bottle i {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(#6bdcff, #168fd9);
}

@keyframes goal-pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@keyframes bottle-celebration {
  0%, 100% { transform: scale(1) rotate(0deg); }
  18% { transform: scale(1.1) rotate(-3deg); }
  42% { transform: scale(1.03) rotate(3deg); }
  66% { transform: scale(1.09) rotate(-2deg); }
}

@keyframes wave-party {
  0%, 100% { transform: translateX(0) scaleX(1); }
  50% { transform: translateX(-22px) scaleX(1.35); }
}

@keyframes celebration-backdrop {
  0% { opacity: 0; backdrop-filter: blur(0); }
  10%, 86% { opacity: 1; backdrop-filter: blur(2.5px); }
  100% { opacity: 0; backdrop-filter: blur(0); }
}

@keyframes wave-floor-show {
  0% { opacity: 0; transform: translateY(80px); }
  12%, 84% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(90px); }
}

@keyframes wave-sway {
  from { transform: translateX(-28px) scaleX(1.02); }
  to { transform: translateX(28px) scaleX(1.08); }
}

@keyframes splash-ring {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(.18); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(7); }
}

@keyframes celebration-card {
  0% { opacity: 0; transform: translate(-50%, -38%) scale(.72) rotate(-2deg); }
  10%, 82% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
  92% { opacity: 1; transform: translate(-50%, -52%) scale(1.02); }
  100% { opacity: 0; transform: translate(-50%, -62%) scale(.94); }
}

@keyframes icon-float {
  from { transform: translateY(0) rotate(-5deg) scale(1); }
  to { transform: translateY(-8px) rotate(5deg) scale(1.06); }
}

@keyframes shine-spin {
  to { transform: rotate(360deg); }
}

@keyframes gold-burst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.35) rotate(0); }
  10%, 82% { opacity: .58; transform: translate(-50%, -50%) scale(1) rotate(18deg); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.2) rotate(35deg); }
}

@keyframes hydro-rise {
  0% { opacity: 0; transform: translate3d(0, 0, 0) scale(.45) rotate(-18deg); }
  12% { opacity: 1; }
  82% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--drift), -116vh, 0) scale(1.15) rotate(var(--rotate)); }
}

@keyframes bubble-rise {
  0% { opacity: 0; transform: translate3d(0, 0, 0) scale(.35); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--drift), -105vh, 0) scale(1.25); }
}

@keyframes bottle-rise {
  0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0) scale(.62); }
  14% { opacity: 1; }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--drift), -112vh, 0) rotate(var(--rotate)) scale(1); }
}

@keyframes splash-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.45) rotate(0); }
  16% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) translate(var(--x), var(--y)) scale(1.15) rotate(520deg); }
}

@media (prefers-reduced-motion: reduce) {
  .goal:has(.completed),
  .bottle.celebrating,
  .bottle.celebrating .water::before,
  .celebration.active,
  .wave-floor,
  .wave-floor::before,
  .wave-floor::after,
  .wave-floor span,
  .gold-burst,
  .splash-ring,
  .celebration-card,
  .celebration-card::before,
  .celebration-icon,
  .hydro-icon,
  .aqua-bubble,
  .splash-drop,
  .mini-bottle {
    animation: none;
  }
}

button { 
  font: inherit;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(22, 137, 216, .35);
  outline-offset: 3px;
}

.add-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border: 0;
  border-radius: 15px;
  padding: 16px 18px;
  color: white;
  font-weight: 700;
  background: linear-gradient(135deg, #159ae4, #0876c7);
  box-shadow: 0 10px 22px rgba(11, 125, 199, .24);
  transition: transform .15s, box-shadow .15s;
}

.add-button:hover { transform: translateY(-2px); box-shadow: 0 13px 27px rgba(11,125,199,.3); }
.add-button:active { transform: translateY(1px) scale(.99); }
.plus { font-size: 25px; font-weight: 400; line-height: 16px; }

.secondary-actions {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-top: 18px;
}

.secondary-actions button {
  padding: 5px 0;
  border: 0;
  color: var(--muted);
  font-size: 12px;
  background: transparent;
}

.secondary-actions button:hover:not(:disabled) { color: var(--blue-dark); }
.secondary-actions button:disabled { opacity: .38; cursor: not-allowed; }

.goal-settings {
  margin-top: 17px;
  padding-top: 15px;
  border-top: 1px solid #e4eef3;
  color: var(--muted);
  font-size: 12px;
}

.goal-settings summary {
  width: max-content;
  margin: auto;
  color: var(--blue-dark);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.goal-settings summary::-webkit-details-marker { display: none; }

.settings-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 15px;
  text-align: left;
}

.settings-fields label {
  display: grid;
  gap: 5px;
  font-weight: 600;
}

.settings-fields label > span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
}

.settings-fields input {
  width: 100%;
  min-width: 0;
  padding: 9px 8px;
  border: 1px solid #cfe2ec;
  border-radius: 9px;
  outline: none;
  color: var(--ink);
  font: inherit;
  background: white;
}

.settings-fields input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(22, 137, 216, .12);
}

.goal-settings .goal-formula {
  margin: 12px 0 2px;
  color: var(--ink);
  font-weight: 600;
}

.goal-settings small { font-size: 10px; line-height: 1.35; }

.history-card {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(108, 175, 213, .22);
  border-radius: 22px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 12px 30px rgba(20, 84, 123, .08);
}

.history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.history-heading h2 {
  margin: 0;
  font-size: 18px;
}

.history-heading button {
  border: 0;
  color: var(--muted);
  font-size: 12px;
  background: transparent;
}

.history-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
  background: #f5fbff;
}

.history-list strong { color: var(--ink); }
.history-list small { color: var(--blue-dark); font-weight: 700; }
.history-list .empty { display: block; text-align: center; }

.achievements-card {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 18px;
  align-items: center;
  margin-top: 18px;
  padding: 20px;
  border: 1px solid rgba(108, 175, 213, .22);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255,255,255,.94), rgba(240, 251, 255, .92));
  box-shadow: 0 12px 30px rgba(20, 84, 123, .08);
}

.achievements-card h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -.3px;
}

.streak {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.streak strong {
  color: var(--blue-dark);
  font-size: 28px;
  line-height: 1;
}

.achievements-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.achievements-list li {
  display: flex;
  gap: 9px;
  align-items: center;
  min-height: 70px;
  padding: 10px;
  border-radius: 14px;
  background: #f5fbff;
  box-shadow: inset 0 0 0 1px rgba(108, 175, 213, .14);
  transition: transform .2s, opacity .2s;
}

.achievements-list li.unlocked {
  background: linear-gradient(135deg, #f0fff8, #effaff);
}

.achievements-list li.locked {
  opacity: .45;
  filter: grayscale(.75);
}

.achievements-list span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 12px;
  font-size: 18px;
  background: white;
}

.achievements-list li > div {
  flex: 1;
}

.achievements-list strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
}

.achievements-list small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.insights-card {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid rgba(108, 175, 213, .22);
  border-radius: 24px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 12px 30px rgba(20, 84, 123, .08);
}

.insights-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.insights-heading h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -.4px;
}

.insights-heading button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  color: white;
  font-size: 12px;
  font-weight: 800;
  background: linear-gradient(135deg, #159ae4, #0876c7);
  box-shadow: 0 10px 22px rgba(11, 125, 199, .18);
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.insight-box {
  min-height: 170px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, #f5fbff, #ffffff);
  box-shadow: inset 0 0 0 1px rgba(108, 175, 213, .16);
}

.insight-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 10px;
  border-radius: 14px;
  font-size: 19px;
  background: #e9f7ff;
}

.insight-box h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.insight-box p,
.insight-box small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.mini-progress {
  height: 9px;
  overflow: hidden;
  margin: 12px 0 8px;
  border-radius: 999px;
  background: #dceef8;
}

.mini-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #48c5ed, #18b776);
  transition: width .4s ease;
}

.reminder-status {
  display: block;
  margin-top: 5px;
  color: var(--blue-dark) !important;
  font-weight: 800;
}

.monthly-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0 0;
}

.monthly-stats div {
  padding: 10px;
  border-radius: 14px;
  text-align: center;
  background: white;
}

.monthly-stats dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.monthly-stats dd {
  margin: 4px 0 0;
  color: var(--blue-dark);
  font-size: 15px;
  font-weight: 900;
}

.weekly-ranking {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.weekly-ranking li {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: white;
}

.weekly-ranking strong {
  color: var(--ink);
  font-size: 12px;
  text-transform: capitalize;
}

.weekly-ranking small {
  color: var(--blue-dark);
  font-weight: 800;
}

.calendar-heading {
  display: flex;
  gap: 10px;
  align-items: center;
}

.calendar-heading .insight-icon { margin: 0; }

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

.calendar-weekdays {
  margin: 12px 0 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.calendar-grid span,
.calendar-grid button {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  background: #eef7fc;
}

.calendar-grid button {
  transition: transform .15s, box-shadow .15s;
}

.calendar-grid button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 7px 14px rgba(16, 105, 157, .12);
}

.calendar-grid button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.calendar-edit-note {
  display: block;
  margin-top: 11px;
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.calendar-grid .done {
  color: #087647;
  background: linear-gradient(135deg, #dffff0, #e8fbff);
  box-shadow: inset 0 0 0 1px rgba(30, 181, 109, .18);
}

.calendar-grid .partial {
  color: var(--blue-dark);
  background: #e9f7ff;
}

.calendar-grid .today {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.calendar-grid .great {
  color: #8a5a00;
  background: linear-gradient(135deg, #fff2ba, #e7fbff);
  box-shadow: inset 0 0 0 1px rgba(219, 166, 30, .24);
}

.calendar-grid .calendar-empty {
  background: transparent;
}

.beta-lab {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid rgba(124, 58, 237, .20);
  border-radius: 26px;
  background:
    radial-gradient(circle at 12% 10%, rgba(124, 58, 237, .10), transparent 28%),
    rgba(255,255,255,.94);
  box-shadow: 0 18px 46px rgba(48, 70, 140, .10);
}

.beta-lab-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 16px;
}

.beta-lab-heading h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -.4px;
}

.beta-lab-heading p:not(.eyebrow) {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.beta-lab-heading button,
.quick-add-actions button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  color: white;
  font-size: 12px;
  font-weight: 800;
  background: linear-gradient(135deg, #7c3aed, #159ae4);
}

.beta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.beta-box {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, #f8fbff, #ffffff);
  box-shadow: inset 0 0 0 1px rgba(108, 175, 213, .16);
}

.beta-box h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.beta-box p,
.beta-box small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.quick-add-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.quick-add-actions button {
  background: linear-gradient(135deg, #159ae4, #18b776);
}

.beta-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.beta-box label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.beta-box select,
.beta-box input {
  width: 100%;
  min-width: 0;
  padding: 9px 8px;
  border: 1px solid #cfe2ec;
  border-radius: 10px;
  color: var(--ink);
  font: inherit;
  background: white;
}

.bar-chart {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 130px;
  margin: 10px 0 16px;
  padding: 10px;
  border-radius: 16px;
  background: #eef7fc;
}

.bar-chart div {
  flex: 1;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 6px;
  height: 100%;
  min-width: 0;
  text-align: center;
}

.bar-chart div span {
  align-self: end;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, #6bdcff, #168fd9);
}

.bar-chart small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-bars {
  display: flex;
  align-items: end;
  gap: 3px;
  height: 70px;
  padding: 8px;
  border-radius: 14px;
  background: #eef7fc;
}

.mini-bars span {
  flex: 1;
  min-width: 3px;
  border-radius: 999px;
  background: #cfe2ec;
}

.mini-bars .partial { background: #74cef3; }
.mini-bars .done { background: #25a86b; }
.mini-bars .great { background: #f1bd35; }

.health-dashboard {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 0;
}

.health-dashboard div {
  padding: 11px;
  border-radius: 14px;
  background: #f5fbff;
}

.health-dashboard dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.health-dashboard dd {
  margin: 5px 0 0;
  color: var(--blue-dark);
  font-size: 14px;
  font-weight: 900;
}

.dark-theme .card,
.dark-theme .history-card,
.dark-theme .achievements-card,
.dark-theme .insights-card,
.dark-theme .beta-lab {
  border-color: rgba(112, 210, 255, .14);
  background: rgba(8, 31, 45, .92);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .24);
}

.dark-theme .drop,
.dark-theme .goal,
.dark-theme .history-list li,
.dark-theme .achievements-list li,
.dark-theme .insight-box,
.dark-theme .beta-box,
.dark-theme .monthly-stats div,
.dark-theme .weekly-ranking li,
.dark-theme .health-dashboard div {
  background: rgba(13, 45, 63, .9);
}

.dark-theme .water-visual {
  background: linear-gradient(145deg, #082a3d, #0b3f5c);
}

.dark-theme .calendar-grid .calendar-empty {
  background: transparent;
}

.dark-theme input,
.dark-theme select,
.dark-theme textarea,
.dark-theme .bar-chart,
.dark-theme .mini-bars,
.dark-theme .calendar-grid span,
.dark-theme .calendar-grid button {
  border-color: rgba(142, 217, 255, .16);
  color: var(--ink);
  background: #082638;
}

.support-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin: 0 0 18px;
  padding: 20px;
  border: 1px solid rgba(108, 175, 213, .22);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255,255,255,.94), rgba(235, 250, 255, .94));
  box-shadow: 0 12px 30px rgba(20, 84, 123, .08);
}

.support-card h2 {
  margin: 0;
  font-size: 21px;
}

.support-card p:not(.eyebrow) {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.support-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.support-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  border: 0;
  border-radius: 999px;
  padding: 11px 15px;
  color: white;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 10px 22px rgba(11, 125, 199, .18);
}

.support-button.pix { background: linear-gradient(135deg, #159ae4, #18b776); }
.support-button.suggestion { background: linear-gradient(135deg, #7c3aed, #159ae4); }

.story-button {
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  color: white;
  font-size: 10px;
  font-weight: 900;
  background: linear-gradient(135deg, #159ae4, #7c3aed);
  box-shadow: 0 8px 16px rgba(45, 104, 190, .16);
}

.dark-theme .support-card {
  border-color: rgba(112, 210, 255, .14);
  background: rgba(8, 31, 45, .92);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .24);
}

.save-note {
  margin: 18px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.save-note span { color: #25a86b; font-weight: bold; }

dialog {
  width: min(90%, 370px);
  padding: 0;
  border: 0;
  border-radius: 22px;
  color: var(--ink);
  text-align: center;
  background: white;
  box-shadow: 0 24px 80px rgba(8, 46, 70, .25);
}

.dark-theme dialog {
  background: #081f2d;
}

dialog::backdrop { background: rgba(16, 47, 67, .38); backdrop-filter: blur(3px); }
dialog form { position: relative; padding: 30px; }
.dialog-icon { width: 45px; height: 45px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 50%; color: #d84d4d; font-size: 22px; background: #fff0f0; }
.pix-icon { color: #087647; background: #e6fff3; }
.story-icon { color: #8a5a00; background: #fff6d1; }
.calendar-icon { color: var(--blue-dark); background: #e9f7ff; }
dialog h2 { margin: 0; font-size: 21px; }
dialog p { margin: 8px 0 24px; color: var(--muted); font-size: 14px; }
.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  background: #edf2f5;
}
.dialog-actions { display: flex; gap: 10px; }
.dialog-actions button { flex: 1; padding: 11px; border: 0; border-radius: 10px; color: var(--ink); background: #edf2f5; }
.dialog-actions .danger { color: white; background: #d95252; }

.pix-dialog,
.story-dialog,
.day-entry-dialog {
  width: min(92%, 420px);
}

.pix-qr {
  width: 210px;
  max-width: 100%;
  aspect-ratio: 1;
  margin: 0 auto 16px;
  display: block;
  border: 10px solid white;
  border-radius: 18px;
  background: white;
  box-shadow: 0 12px 30px rgba(8, 80, 132, .12);
}

.pix-copy-field {
  display: grid;
  gap: 7px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
}

.pix-copy-field textarea {
  width: 100%;
  resize: none;
  padding: 10px;
  border: 1px solid #cfe2ec;
  border-radius: 12px;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  line-height: 1.35;
  background: #f5fbff;
}

.copy-pix-button,
.story-actions button {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  color: white;
  font-size: 13px;
  font-weight: 900;
  background: linear-gradient(135deg, #159ae4, #18b776);
}

.copy-pix-button { margin-top: 14px; }
.pix-copy-status,
.story-status {
  display: block;
  min-height: 17px;
  margin-top: 9px;
  color: #198856;
  font-size: 12px;
  font-weight: 800;
}

.story-preview {
  width: min(100%, 245px);
  aspect-ratio: 9 / 16;
  object-fit: cover;
  display: block;
  margin: 0 auto 16px;
  border-radius: 24px;
  background: #e9f7ff;
  box-shadow: 0 18px 42px rgba(8, 80, 132, .18);
}

.story-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.story-actions button:first-child {
  background: linear-gradient(135deg, #7c3aed, #159ae4);
}

.day-entry-field {
  display: grid;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
}

.day-entry-field span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  text-transform: none;
}

.day-entry-field input {
  width: 100%;
  padding: 12px;
  border: 1px solid #cfe2ec;
  border-radius: 12px;
  color: var(--ink);
  font: inherit;
  background: #f5fbff;
}

.day-entry-goal,
.day-entry-status {
  display: block;
  min-height: 17px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.day-entry-status {
  color: #198856;
}

.day-entry-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.day-entry-actions button {
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  color: white;
  font-size: 13px;
  font-weight: 900;
  background: linear-gradient(135deg, #159ae4, #18b776);
}

.day-entry-actions .ghost-danger {
  color: #d95252;
  background: #fff0f0;
}

.day-entry-actions button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

@media (max-width: 620px) {
  body { display: block; padding: 22px 16px; }
  header { align-items: center; }
  .date { max-width: 105px; text-align: right; line-height: 1.3; }
  .card { grid-template-columns: 1fr; }
  .water-visual { min-height: 275px; }
  .bottle { transform: scale(.77); }
  .stats { padding: 32px 28px 35px; text-align: center; }
  .total { justify-content: center; }
  .bottles { margin-bottom: 20px; }
  .goal-heading { text-align: left; }
  .settings-fields { grid-template-columns: 1fr; }
  .history-list li { grid-template-columns: 1fr auto; }
  .history-list small { grid-column: 1 / -1; }
  .achievements-card { grid-template-columns: 1fr; }
  .achievements-list { grid-template-columns: 1fr; }
  .insights-heading,
  .beta-lab-heading,
  .support-card { align-items: flex-start; flex-direction: column; }
  .insights-grid,
  .beta-grid { grid-template-columns: 1fr; }
  .monthly-stats,
  .beta-fields,
  .health-dashboard { grid-template-columns: 1fr; }
  .support-actions,
  .support-button { width: 100%; }
  .weekly-ranking li { grid-template-columns: 32px 1fr; }
  .weekly-ranking small { grid-column: 2; }
  .story-actions,
  .day-entry-actions { grid-template-columns: 1fr; }
}
