:root {
  --ink: #0b2540;
  --muted: rgba(11, 37, 64, .55);
  --blue: #007aff;
  --sky: #5ac8fa;
  --glass: rgba(255, 255, 255, .38);
  --edge: rgba(255, 255, 255, .7);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: #dcecf7; overflow-x: hidden; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
h3 { font-size: 17px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; margin: 14px 0 0; }

.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background: linear-gradient(160deg, #e8f4fd 0%, #d3e7f6 45%, #f6e3ef 100%); }
.bg i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .75; animation: float 18s ease-in-out infinite alternate; }
.b1 { width: 420px; height: 420px; background: #8fd3fe; top: -120px; left: -100px; }
.b2 { width: 380px; height: 380px; background: #ffc6dd; bottom: -120px; right: -80px; animation-delay: -6s !important; }
.b3 { width: 300px; height: 300px; background: #b9b4ff; top: 40%; left: 55%; opacity: .45 !important; animation-delay: -12s !important; }
@keyframes float { to { transform: translate(60px, 40px) scale(1.15); } }

.glass {
  background: var(--glass);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--edge);
  box-shadow: 0 10px 40px rgba(20, 60, 110, .12), inset 0 1px 0 rgba(255,255,255,.9), inset 0 -1px 0 rgba(255,255,255,.25);
}

.screen { max-width: 560px; margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 18px 40px; }
.card { border-radius: 28px; padding: 22px; margin-bottom: 16px; }

.login { margin-top: 14vh; text-align: center; padding: 36px 26px; }
.drop { font-size: 52px; filter: drop-shadow(0 8px 16px rgba(0,122,255,.3)); }
.login h1 { font-size: 40px; margin: 6px 0 4px; }
.login form { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.field { font: inherit; font-size: 17px; padding: 15px 18px; border-radius: 16px; border: 1px solid var(--edge);
  background: rgba(255,255,255,.55); outline: none; color: var(--ink); text-align: center; }
.field:focus { border-color: var(--sky); box-shadow: 0 0 0 4px rgba(90,200,250,.25); }
.known { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.known button { border: 1px solid var(--edge); background: rgba(255,255,255,.5); border-radius: 999px; padding: 8px 14px; font-size: 14px; }

.btn { border: 0; border-radius: 16px; padding: 14px 18px; font-weight: 600; font-size: 16px; transition: transform .12s, filter .2s; }
.btn:active { transform: scale(.96); }
.btn.primary { color: #fff; background: linear-gradient(180deg, #4cb4ff, var(--blue));
  box-shadow: 0 8px 22px rgba(0,122,255,.35), inset 0 1px 0 rgba(255,255,255,.5); }
.btn.ghost { background: rgba(255,255,255,.5); border: 1px solid var(--edge); }
.btn.danger { color: #d70015; }

.top { display: flex; justify-content: space-between; align-items: center; margin: 6px 4px 16px; }
.top h2 { font-size: 30px; }
.pill { border-radius: 999px; width: 44px; height: 44px; font-size: 20px; }

.hero { display: flex; align-items: center; gap: 22px; }
.ring-wrap { position: relative; width: 150px; height: 150px; flex: none; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 11; stroke-linecap: round; }
.track { stroke: rgba(11,37,64,.08); }
.prog { stroke: url(#rg); stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1);
  filter: drop-shadow(0 0 6px rgba(0,122,255,.35)); }
.ring-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.big { font-size: 34px; font-weight: 700; letter-spacing: -.03em; }
.stats { display: grid; gap: 12px; flex: 1; }
.stats div { display: flex; flex-direction: column; }
.stats b { font-size: 19px; font-weight: 650; }
.cheer { font-size: 15px !important; }

.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }
.seg { display: inline-flex; background: rgba(11,37,64,.07); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.seg.wide { display: flex; margin: 6px 0 16px; }
.seg.wide button { flex: 1; padding: 10px; }

.glasses { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 10px 6px; }
.g { border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.g svg { width: 46px; height: 62px; overflow: visible; }
.g span { font-size: 11px; color: var(--muted); font-weight: 600; }
.g .cup { fill: rgba(255,255,255,.35); stroke: rgba(11,37,64,.18); stroke-width: 1.6; }
.g .water { transform-origin: 50% 100%; transform: scaleY(0); transition: transform .7s cubic-bezier(.2,.9,.25,1.2); }
.g .shine { fill: rgba(255,255,255,.7); }
.g.full .water { transform: scaleY(1); }
.g.full .cup { stroke: rgba(0,122,255,.45); }
.g.full span { color: var(--blue); }
.g.next { animation: pulse 1.8s ease-in-out infinite; }
.g .wave { animation: wave 2.4s linear infinite; }
@keyframes wave { from { transform: translateX(0); } to { transform: translateX(-24px); } }
@keyframes pulse { 50% { transform: translateY(-3px); } }
.g.pop { animation: pop .5s; }
@keyframes pop { 40% { transform: scale(1.18); } }

.actions { display: flex; gap: 10px; margin-top: 20px; }
.big-btn { flex: 1; font-size: 17px; padding: 16px; }

.week { display: flex; justify-content: space-between; align-items: flex-end; height: 130px; gap: 8px; margin-top: 14px; }
.day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 34px; border-radius: 10px; background: linear-gradient(180deg, var(--sky), var(--blue)); min-height: 4px; transition: height .6s; }
.bar.met { box-shadow: 0 0 12px rgba(0,122,255,.4); }
.bar.zero { background: rgba(11,37,64,.08); }
.day small { font-size: 11px; color: var(--muted); font-weight: 600; }
.day em { font-style: normal; font-size: 10px; color: var(--muted); }

.tip p { margin: 0; line-height: 1.5; font-size: 14px; }

dialog.sheet { border-radius: 26px; padding: 22px; width: min(92vw, 380px); color: var(--ink); background: rgba(255,255,255,.72); }
dialog::backdrop { background: rgba(11,37,64,.2); backdrop-filter: blur(4px); }
dialog form { display: flex; flex-direction: column; gap: 10px; }
dialog h3 { margin-bottom: 8px; }

@media (max-width: 420px) {
  .hero { flex-direction: column; text-align: center; }
  .stats { grid-template-columns: repeat(3, 1fr); width: 100%; }
  .stats div { align-items: center; }
  .stats b { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
