:root {
  color-scheme: light;
  --blue: #0b91dc;
  --blue-dark: #075c8d;
  --blue-deep: #073f61;
  --aqua: #36c3ef;
  --aqua-soft: #dff7ff;
  --sky: #fff5e8;
  --ink: #113d56;
  --muted: #7e8586;
  --line: #eadfd4;
  --surface: #fffdf9;
  --canvas: #fff8ef;
  --green: #46af7b;
  --amber: #ed9f38;
  --red: #dc5b61;
  --shadow: 0 18px 48px rgba(5, 70, 108, .11);
  --shadow-soft: 0 8px 24px rgba(5, 70, 108, .08);
  font-family: Inter, ui-rounded, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #f1dcc6;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 12%, rgba(255,255,255,.88), transparent 22rem),
    linear-gradient(145deg, #f4d7ba 0%, #fff3e4 48%, #efd0b4 100%);
  line-height: 1.45;
  overscroll-behavior-y: none;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(11, 145, 220, .24);
  outline-offset: 2px;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: .55;
}

[hidden] {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
}

.ambient-one {
  width: 26rem;
  height: 26rem;
  top: -11rem;
  right: -7rem;
  background: rgba(244, 172, 96, .24);
}

.ambient-two {
  width: 19rem;
  height: 19rem;
  bottom: -8rem;
  left: -7rem;
  background: rgba(255, 236, 204, .66);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 540px);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--canvas);
  box-shadow: 0 0 70px rgba(8, 75, 111, .18);
  overflow: clip;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: max(13px, env(safe-area-inset-top)) 21px 10px;
  color: #fff;
  background: linear-gradient(125deg, #0a84d5, #11a9e5 65%, #33c4ef);
  box-shadow: 0 5px 18px rgba(7, 102, 160, .15);
}

.topbar::after {
  position: absolute;
  right: -45px;
  bottom: -58px;
  width: 155px;
  height: 105px;
  border: 26px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
  content: "";
}

.brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  color: #fff;
  background: none;
  font-size: 1.24rem;
  letter-spacing: -.03em;
  cursor: pointer;
}

.brand strong {
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .48);
  border-radius: 14px;
  background: #2aaee8;
  box-shadow: 0 4px 10px rgba(3, 74, 112, .18);
  overflow: hidden;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.icon-button,
.close-button {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  place-items: center;
  cursor: pointer;
}

.icon-button {
  position: relative;
  z-index: 2;
  color: #fff;
  background: rgba(255, 255, 255, .17);
}

.icon-button svg {
  width: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.connection-banner {
  position: sticky;
  z-index: 25;
  top: 72px;
  padding: 7px 18px;
  color: #6f4e13;
  background: #fff1bd;
  text-align: center;
  font-size: .78rem;
  font-weight: 650;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--amber);
}

main {
  min-height: calc(100dvh - 72px);
  padding: 24px 18px calc(112px + env(safe-area-inset-bottom));
}

.view {
  animation: view-in .28s ease both;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.greeting-row,
.section-heading,
.page-heading,
.sheet-header,
.metric-heading,
.chart-header,
.settings-card-heading,
.quiet-row,
.timezone-row {
  display: flex;
  align-items: center;
}

.greeting-row {
  justify-content: space-between;
  margin: 0 3px 18px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--blue);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .105em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  color: var(--blue-deep);
  font-size: clamp(1.65rem, 7vw, 2rem);
  line-height: 1.1;
  letter-spacing: -.045em;
}

h2 {
  margin-bottom: 0;
  color: var(--blue-deep);
  font-size: 1.15rem;
  line-height: 1.2;
  letter-spacing: -.025em;
}

.bone-pill {
  display: flex;
  min-width: 63px;
  height: 40px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 12px;
  border: 1px solid #f3d284;
  border-radius: 14px;
  background: linear-gradient(145deg, #fff9dc, #ffe59b);
  box-shadow: var(--shadow-soft);
  font-size: .95rem;
  cursor: pointer;
}

.bone-pill span {
  filter: sepia(1) saturate(2.2) drop-shadow(0 2px 2px rgba(126, 79, 4, .18));
}

.bone-pill strong {
  color: #805613;
}

.card {
  border: 1px solid rgba(230, 215, 201, .94);
  border-radius: 24px;
  background: rgba(255, 253, 249, .97);
  box-shadow: var(--shadow-soft);
}

.mascot-card {
  position: relative;
  display: grid;
  min-height: 218px;
  grid-template-columns: minmax(145px, 46%) 1fr;
  align-items: center;
  margin-bottom: 14px;
  padding: 11px 16px 11px 5px;
  overflow: hidden;
  background: linear-gradient(135deg, #ffe7ca 0%, #fffaf3 58%, #eaf8fc 100%);
}

.mascot-card.is-hot {
  border-color: #ffc7aa;
  background: linear-gradient(135deg, #fff0e9 0%, #fff 67%);
}

.mascot-glow {
  position: absolute;
  width: 180px;
  height: 180px;
  left: -22px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(54,195,239,.22), transparent 67%);
}

.is-hot .mascot-glow {
  background: radial-gradient(circle, rgba(255,133,70,.25), transparent 67%);
}

.mascot-image {
  position: relative;
  z-index: 2;
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: contain;
  filter: drop-shadow(0 11px 12px rgba(6, 66, 97, .14));
  transform-origin: 50% 82%;
  animation: mascot-wiggle 4.8s ease-in-out infinite;
}

@keyframes mascot-wiggle {
  0%, 42%, 100% { transform: rotate(0deg) translateY(0); }
  46% { transform: rotate(-1.2deg) translateY(-1px); }
  50% { transform: rotate(1deg) translateY(0); }
  54% { transform: rotate(-.6deg) translateY(-1px); }
  58% { transform: rotate(0deg) translateY(0); }
}

.mascot-copy {
  position: relative;
  z-index: 3;
  min-width: 0;
}

.mascot-copy h2 {
  margin-bottom: 8px;
  font-size: 1.18rem;
}

.mascot-copy > p:last-of-type {
  margin: 0;
  color: var(--muted);
  font-size: .72rem;
}

.weather-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  padding: 5px 9px;
  border-radius: 10px;
  color: #9a4d22;
  background: #fff0df;
  font-size: .65rem;
}

.heat-bonus-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  padding: 13px 14px;
  border: 1px solid #f3b99e;
  border-radius: 19px;
  color: #74391f;
  background: linear-gradient(120deg, #fff0ea, #fff9f5);
  box-shadow: 0 7px 20px rgba(175, 76, 31, .08);
}

.heat-icon {
  display: grid;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  place-items: center;
  background: #ffd7c1;
  font-size: 1.45rem;
}

.heat-bonus-card strong,
.heat-bonus-card p {
  display: block;
  margin: 0;
}

.heat-bonus-card .eyebrow {
  color: #d5632c;
}

.heat-bonus-card strong {
  font-size: .83rem;
}

.heat-bonus-card p:last-child {
  margin-top: 3px;
  color: #9d6044;
  font-size: .61rem;
  line-height: 1.4;
}

.hydration-card {
  position: relative;
  display: grid;
  min-height: 230px;
  place-items: center;
  padding: 20px 18px 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 15%, rgba(54, 195, 239, .16), transparent 34%),
    linear-gradient(160deg, #fffdf9, #fff3e6 58%, #edfaff);
}

.hydration-card::before,
.hydration-card::after {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.hydration-card::before {
  width: 165px;
  height: 165px;
  right: -105px;
  bottom: -52px;
  border: 25px solid rgba(50, 187, 235, .08);
}

.hydration-card::after {
  width: 75px;
  height: 75px;
  top: -34px;
  left: -26px;
  background: rgba(50, 187, 235, .07);
}

.progress-orb {
  position: relative;
  display: grid;
  width: 174px;
  height: 174px;
  padding: 10px;
  border-radius: 50%;
  background: conic-gradient(var(--aqua) var(--progress), #dceef4 0);
  box-shadow: 0 15px 35px rgba(16, 141, 199, .17);
  transition: background .6s ease;
}

.progress-orb::before {
  position: absolute;
  inset: 4px;
  border: 2px solid rgba(255,255,255,.85);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.progress-inner {
  position: relative;
  z-index: 1;
  display: grid;
  border: 5px solid #fff;
  border-radius: 50%;
  place-items: center;
  overflow: hidden;
  background: #f7fdff;
}

.water-fill {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: var(--fill);
  min-height: 0;
  background: linear-gradient(180deg, #52cdf4, #13a5e4);
  transition: height .75s cubic-bezier(.22,.8,.24,1);
  animation: water-shimmer 4s ease-in-out infinite;
}

@keyframes water-shimmer {
  0%, 100% { filter: saturate(1) brightness(1); }
  50% { filter: saturate(1.08) brightness(1.04); }
}

.water-fill::before,
.water-fill::after,
.water-fill span {
  position: absolute;
  top: -10px;
  width: 75px;
  height: 20px;
  border-radius: 50%;
  content: "";
}

.water-fill::before {
  left: -8px;
  background: #52cdf4;
  transform: rotate(5deg);
  animation: wave-left 3.2s ease-in-out infinite;
}

.water-fill::after {
  right: -12px;
  background: #52cdf4;
  transform: rotate(-7deg);
  animation: wave-right 3.7s ease-in-out infinite;
}

@keyframes wave-left {
  0%, 100% { transform: translateX(-3px) rotate(5deg); }
  50% { transform: translateX(10px) rotate(-2deg); }
}

@keyframes wave-right {
  0%, 100% { transform: translateX(4px) rotate(-7deg); }
  50% { transform: translateX(-10px) rotate(2deg); }
}

.water-fill span {
  left: 48px;
  background: #f7fdff;
  opacity: .42;
}

.progress-copy {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  flex-direction: column;
  color: var(--blue-deep);
  text-shadow: 0 1px 8px rgba(255,255,255,.9);
}

.progress-copy strong {
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -.05em;
}

.progress-copy span {
  margin-top: 7px;
  font-size: .75rem;
}

.hydration-summary {
  position: relative;
  z-index: 2;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 13px;
}

.summary-icon {
  display: grid;
  width: 35px;
  height: 35px;
  border-radius: 12px;
  place-items: center;
  background: var(--aqua-soft);
}

.hydration-summary p,
.hydration-summary strong {
  display: block;
  margin: 0;
}

.hydration-summary p {
  color: var(--muted);
  font-size: .72rem;
}

.hydration-summary strong {
  font-size: .88rem;
}

.notification-card {
  display: flex;
  min-height: 88px;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border-color: #bce7f6;
  background: linear-gradient(120deg, #e8faff, #fff);
}

.notification-card.is-warning {
  border-color: #f2d99c;
  background: linear-gradient(120deg, #fff8e8, #fff);
}

.notification-icon {
  display: grid;
  flex: 0 0 47px;
  width: 47px;
  height: 47px;
  border-radius: 16px;
  color: var(--blue);
  place-items: center;
  background: #ccefff;
}

.notification-icon svg {
  width: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.notification-copy {
  min-width: 0;
  flex: 1;
}

.notification-copy .eyebrow {
  margin-bottom: 2px;
  font-size: .61rem;
}

.notification-copy strong,
.notification-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-copy strong {
  color: var(--blue-deep);
  font-size: .92rem;
}

.notification-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: .68rem;
}

.small-button,
.text-button,
.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  border: 0;
  font-weight: 750;
  cursor: pointer;
}

.small-button {
  min-height: 36px;
  padding: 0 11px;
  border-radius: 12px;
  color: #fff;
  background: var(--blue);
  font-size: .7rem;
}

.section-heading {
  justify-content: space-between;
  margin: 28px 3px 13px;
}

.section-heading .eyebrow {
  margin-bottom: 2px;
}

.text-button {
  padding: 7px 0 7px 10px;
  color: var(--blue);
  background: transparent;
  font-size: .75rem;
}

.quick-drinks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}

.quick-drink {
  position: relative;
  min-width: 0;
  min-height: 106px;
  padding: 10px 5px 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 6px 17px rgba(7, 82, 120, .06);
  cursor: pointer;
  overflow: hidden;
}

.quick-drink::after {
  position: absolute;
  width: 50px;
  height: 50px;
  right: -25px;
  bottom: -25px;
  border-radius: 50%;
  background: var(--drink-color, var(--aqua));
  content: "";
  opacity: .11;
}

.drink-emoji {
  display: grid;
  width: 53px;
  height: 53px;
  margin: 0 auto 6px;
  border-radius: 18px;
  place-items: center;
  background: color-mix(in srgb, var(--drink-color, var(--aqua)) 17%, white);
  font-size: 1.8rem;
  filter: drop-shadow(0 4px 5px rgba(4, 55, 79, .08));
}

.quick-drink strong {
  display: block;
  overflow: hidden;
  color: var(--blue-deep);
  font-size: .69rem;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  margin-top: 20px;
}

.metric-card {
  min-width: 0;
  min-height: 174px;
  padding: 15px;
}

.metric-heading {
  justify-content: space-between;
  margin-bottom: 14px;
}

.metric-icon {
  display: grid;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  place-items: center;
  background: #e9f8ff;
}

.coffee-icon {
  background: #f5ece7;
}

.metric-badge {
  max-width: calc(100% - 42px);
  padding: 4px 7px;
  overflow: hidden;
  border-radius: 8px;
  color: #287a55;
  background: #e6f6ed;
  font-size: .55rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-badge.warning {
  color: #916015;
  background: #fff0ce;
}

.metric-badge.danger {
  color: #a83e45;
  background: #ffe5e6;
}

.metric-badge.blue {
  color: #0876b5;
  background: #def4ff;
}

.metric-card > p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: .7rem;
}

.metric-card > strong {
  display: block;
  color: var(--blue-deep);
  font-size: 1.48rem;
  letter-spacing: -.04em;
}

.metric-card > strong small {
  font-size: .7rem;
  letter-spacing: 0;
}

.mini-progress {
  height: 6px;
  margin: 14px 0 6px;
  border-radius: 99px;
  overflow: hidden;
  background: #e9eff2;
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #54bd83, #e3ae3f 72%, #df5e64);
  transition: width .45s ease;
}

.metric-card > small,
.metric-note {
  color: var(--muted);
  font-size: .62rem;
}

.animal-fact-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 15px;
}

.fact-animal {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  place-items: center;
  background: #d8f4ff;
  font-size: 1.5rem;
}

.animal-fact-card > div:last-child {
  min-width: 0;
  flex: 1;
}

.animal-fact-card h2,
.animal-fact-card p {
  margin: 0;
}

.animal-fact-card > div > p:last-child {
  margin-top: 4px;
  color: var(--muted);
  font-size: .66rem;
  line-height: 1.42;
}

.animal-fact-card {
  align-items: flex-start;
  background: linear-gradient(130deg, #f3f8eb, #fff);
}

.fact-animal {
  background: #eaf4db;
}

.metric-note {
  display: block;
  margin-top: 16px;
  line-height: 1.35;
}

.recent-heading {
  margin-top: 27px;
}

.recent-list,
.history-list {
  display: grid;
  gap: 9px;
}

.recent-item,
.history-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(8, 70, 103, .045);
}

.entry-icon {
  display: grid;
  flex: 0 0 43px;
  width: 43px;
  height: 43px;
  border-radius: 14px;
  place-items: center;
  background: color-mix(in srgb, var(--entry-color, var(--aqua)) 17%, white);
  font-size: 1.35rem;
}

.entry-copy {
  min-width: 0;
  flex: 1;
}

.entry-copy strong,
.entry-copy span {
  display: block;
}

.entry-copy strong {
  overflow: hidden;
  font-size: .82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: .64rem;
}

.entry-amount {
  text-align: right;
}

.entry-amount strong,
.entry-amount span {
  display: block;
}

.entry-amount strong {
  font-size: .8rem;
}

.entry-amount span {
  color: var(--muted);
  font-size: .58rem;
}

.delete-entry {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: #9bb0ba;
  place-items: center;
  background: transparent;
  font-size: 1.15rem;
  cursor: pointer;
}

.empty-state {
  padding: 30px 18px;
  border: 1px dashed #c8e0e9;
  border-radius: 20px;
  color: var(--muted);
  background: rgba(255,255,255,.55);
  text-align: center;
  font-size: .8rem;
}

.empty-state span {
  display: block;
  margin-bottom: 7px;
  font-size: 2rem;
}

.page-heading {
  align-items: flex-start;
  flex-direction: column;
  margin: 2px 3px 22px;
}

.page-heading p:last-child {
  max-width: 390px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: .82rem;
}

.chart-card {
  padding: 18px 14px 14px;
}

.chart-header {
  justify-content: flex-end;
  gap: 15px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: .61rem;
}

.chart-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-radius: 3px;
}

.chart-dot.water {
  background: var(--aqua);
}

.chart-dot.goal {
  border: 1px solid #8aa6b4;
  background: transparent;
}

.bar-chart {
  display: flex;
  height: 205px;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 2px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.bar-chart::-webkit-scrollbar {
  display: none;
}

.chart-column {
  display: flex;
  min-width: 28px;
  height: 100%;
  flex: 1 0 28px;
  align-items: center;
  flex-direction: column;
  justify-content: flex-end;
  gap: 7px;
}

.chart-track {
  position: relative;
  width: 100%;
  height: 165px;
  border-radius: 9px 9px 5px 5px;
  background: #edf4f7;
  overflow: hidden;
}

.chart-goal-line {
  position: absolute;
  z-index: 2;
  right: 0;
  left: 0;
  bottom: var(--goal-position, 80%);
  border-top: 1px dashed #879da8;
}

.chart-bar {
  position: absolute;
  right: 3px;
  bottom: 3px;
  left: 3px;
  height: var(--bar-height, 0%);
  min-height: 2px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #52cef3, #079ee0);
  transition: height .55s ease;
}

.chart-column.is-goal .chart-bar {
  background: linear-gradient(180deg, #58d4b0, #34ac79);
}

.chart-column > span {
  color: var(--muted);
  font-size: .56rem;
  text-transform: uppercase;
}

.history-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 12px;
  padding: 14px 5px;
}

.history-summary div {
  min-width: 0;
  padding: 4px 8px;
  text-align: center;
}

.history-summary div + div {
  border-left: 1px solid var(--line);
}

.history-summary span,
.history-summary strong {
  display: block;
}

.history-summary span {
  color: var(--muted);
  font-size: .57rem;
}

.history-summary strong {
  margin-top: 4px;
  overflow: hidden;
  font-size: .74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-day {
  margin: 18px 3px 7px;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.settings-card {
  margin-bottom: 13px;
  padding: 18px;
}

.settings-card-heading {
  gap: 11px;
  margin-bottom: 18px;
}

.settings-card-heading h2,
.settings-card-heading p {
  margin: 0;
}

.settings-card-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: .65rem;
}

.settings-icon {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  place-items: center;
  background: #e7f8ff;
  font-size: 1.28rem;
}

.toggle-heading > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.switch {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 48px;
  height: 28px;
}

.switch input {
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: #cbdce3;
  cursor: pointer;
  transition: .2s ease;
}

.switch span::before {
  position: absolute;
  width: 22px;
  height: 22px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.16);
  content: "";
  transition: .2s ease;
}

.switch input:checked + span {
  background: var(--blue);
}

.switch input:checked + span::before {
  transform: translateX(20px);
}

.field-label,
.stacked-field > span,
.field-grid label > span,
.custom-drink-fields label > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 19px;
}

input[type="range"] {
  min-width: 0;
  height: 7px;
  flex: 1;
  border-radius: 99px;
  accent-color: var(--blue);
}

.range-row output {
  min-width: 82px;
  padding: 8px 9px;
  border-radius: 11px;
  color: var(--blue-deep);
  background: #e9f8ff;
  text-align: center;
  font-size: .72rem;
  font-weight: 800;
}

.input-suffix {
  display: flex;
  min-height: 46px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f9fcfd;
  overflow: hidden;
}

.input-suffix input {
  min-width: 0;
  height: 44px;
  flex: 1;
  padding: 0 12px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.input-suffix > span {
  padding: 0 12px;
  color: var(--muted);
  font-size: .68rem;
}

.field-help {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: .6rem;
  line-height: 1.45;
}

.settings-fields {
  transition: opacity .2s ease;
}

.settings-fields.is-disabled {
  opacity: .48;
}

.field-grid {
  display: grid;
  gap: 11px;
}

.field-grid.two {
  grid-template-columns: 1fr 1fr;
}

.field-grid input,
.stacked-field input,
.stacked-field select,
.custom-drink-fields input {
  width: 100%;
  min-height: 46px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: #f9fcfd;
  outline: 0;
}

.stacked-field {
  display: block;
  margin-top: 16px;
}

.quiet-row {
  justify-content: space-between;
  margin-top: 20px;
  padding: 15px 0 12px;
  border-top: 1px solid var(--line);
}

.quiet-row strong,
.quiet-row span {
  display: block;
}

.quiet-row strong {
  font-size: .8rem;
}

.quiet-row div > span {
  margin-top: 2px;
  color: var(--muted);
  font-size: .62rem;
}

.timezone-row {
  gap: 8px;
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: .65rem;
}

.timezone-row > span {
  color: var(--muted);
}

.timezone-row strong {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-settings .button-row {
  margin-top: 0;
}

.full-button {
  width: 100%;
}

.weather-settings .full-button {
  margin-top: 13px;
}

.button-row {
  display: flex;
  gap: 9px;
  margin-top: 16px;
}

.button-row > * {
  flex: 1;
}

.button-row.vertical {
  flex-direction: column;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  min-height: 49px;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  border-radius: 15px;
  transition: transform .12s ease, box-shadow .2s ease;
}

.primary-button:active,
.secondary-button:active,
.ghost-button:active,
.danger-button:active,
.quick-drink:active {
  transform: scale(.975);
}

.primary-button {
  color: #fff;
  background: linear-gradient(120deg, #0a87d5, #14ace6);
  box-shadow: 0 9px 20px rgba(9, 142, 210, .22);
}

.secondary-button {
  color: #fff;
  background: var(--blue);
}

.ghost-button {
  border: 1px solid var(--line);
  color: var(--blue);
  background: #f4fbff;
}

.danger-button {
  color: #fff;
  background: var(--red);
}

.save-settings {
  width: 100%;
  margin: 4px 0 22px;
}

.data-card {
  margin-top: 6px;
}

.link-list {
  margin: 0 -5px -6px;
}

.link-list button {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  border: 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  font-size: .75rem;
  cursor: pointer;
}

.link-list button b {
  color: #9ab1bc;
  font-size: 1.35rem;
  font-weight: 400;
}

.link-list .danger-link {
  color: var(--red);
}

.medical-note,
.version-note {
  color: var(--muted);
  text-align: center;
  font-size: .61rem;
  line-height: 1.5;
}

.storage-warning {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 0 0 18px;
  padding: 14px;
  border-color: #ecd49a;
  color: #72561a;
  background: #fff9e8;
}

.storage-warning > span {
  font-size: 1.35rem;
}

.storage-warning p,
.storage-warning strong {
  display: block;
  margin: 0;
}

.storage-warning p {
  font-size: .64rem;
  line-height: 1.48;
}

.storage-warning strong {
  margin-bottom: 3px;
  font-size: .74rem;
}

.medical-note {
  padding: 2px 10px;
}

.version-note {
  margin: 18px 0 0;
}

.bottom-nav {
  position: fixed;
  z-index: 35;
  right: 50%;
  bottom: 0;
  left: 50%;
  display: grid;
  width: min(100%, 540px);
  min-height: calc(76px + env(safe-area-inset-bottom));
  grid-template-columns: 1fr 1fr 1.2fr 1fr 1fr 1fr;
  align-items: start;
  padding: 8px 9px calc(7px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(228, 210, 194, .94);
  background: rgba(255, 250, 243, .96);
  box-shadow: 0 -12px 30px rgba(5, 73, 108, .08);
  backdrop-filter: blur(17px);
  transform: translateX(-50%);
}

.nav-button {
  display: flex;
  min-height: 57px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 0;
  border: 0;
  color: #92adba;
  background: transparent;
  font-size: .52rem;
  font-weight: 750;
  cursor: pointer;
}

.nav-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.nav-button.is-active {
  color: var(--blue);
}

.add-nav-button {
  color: var(--blue);
}

.add-nav-button > span {
  display: grid;
  width: 47px;
  height: 47px;
  margin-top: -25px;
  border: 5px solid var(--canvas);
  border-radius: 17px;
  color: #fff;
  place-items: center;
  background: linear-gradient(135deg, #0a8bd8, #21b8e9);
  box-shadow: 0 8px 18px rgba(8, 133, 198, .28);
}

.add-nav-button > span svg {
  width: 23px;
}

.add-nav-button b {
  font-size: .52rem;
}

/* Dialogs */
dialog {
  border: 0;
  color: var(--ink);
}

dialog::backdrop {
  background: rgba(4, 35, 51, .48);
  backdrop-filter: blur(3px);
}

.bottom-sheet {
  width: min(100%, 540px);
  max-width: none;
  max-height: min(89dvh, 800px);
  margin: auto auto 0;
  padding: 0;
  border-radius: 28px 28px 0 0;
  background: #f7fcff;
  box-shadow: 0 -22px 60px rgba(3, 43, 65, .22);
}

.bottom-sheet[open] {
  animation: sheet-in .25s ease-out;
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(35px); }
  to { opacity: 1; transform: translateY(0); }
}

.sheet-shell {
  max-height: min(89dvh, 800px);
  padding: 8px 18px calc(22px + env(safe-area-inset-bottom));
  overflow-y: auto;
}

.sheet-handle {
  width: 45px;
  height: 5px;
  margin: 2px auto 14px;
  border-radius: 99px;
  background: #c8dce5;
}

.sheet-header {
  justify-content: space-between;
  margin-bottom: 16px;
}

.close-button {
  color: #6c8795;
  background: #eaf4f8;
  font-size: 1.55rem;
  line-height: 1;
}

.drink-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-height: 210px;
  padding: 2px 1px 7px;
  overflow-y: auto;
}

.picker-drink {
  min-width: 0;
  padding: 8px 3px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  cursor: pointer;
}

.picker-drink.is-selected {
  border-color: var(--blue);
  background: #e8f8ff;
  box-shadow: inset 0 0 0 1px var(--blue);
}

.picker-drink .drink-emoji {
  width: 42px;
  height: 42px;
  margin-bottom: 4px;
  border-radius: 13px;
  font-size: 1.45rem;
}

.picker-drink strong {
  display: block;
  overflow: hidden;
  font-size: .59rem;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-drink {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 16px;
  padding: 11px;
  border-radius: 17px;
  background: #eaf9ff;
}

.selected-drink .drink-emoji {
  width: 44px;
  height: 44px;
  margin: 0;
  border-radius: 14px;
}

.selected-drink strong,
.selected-drink span {
  display: block;
}

.selected-drink strong {
  font-size: .85rem;
}

.selected-drink span {
  color: var(--muted);
  font-size: .62rem;
}

.amount-fieldset {
  padding: 0;
  border: 0;
}

.amount-fieldset legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
}

.amount-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0 12px;
  padding: 12px;
  border: 1px solid #d8eaf2;
  border-radius: 15px;
  background: #fff;
}

.amount-slider-row input[type="range"] {
  min-width: 0;
  flex: 1;
}

.amount-slider-row output {
  min-width: 66px;
  color: var(--blue);
  font-size: .7rem;
  font-weight: 800;
  text-align: right;
}

.amount-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.amount-options button {
  min-height: 40px;
  padding: 0 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: #fff;
  font-size: .66rem;
  font-weight: 750;
  cursor: pointer;
}

.amount-options button.is-selected {
  border-color: var(--blue);
  color: var(--blue);
  background: #e7f7ff;
}

.custom-amount {
  margin-top: 9px;
}

.drink-notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 13px;
  padding: 11px 12px;
  border: 1px solid #cce3ed;
  border-radius: 14px;
  color: #436a7c;
  background: #eef9fd;
}

.drink-notice.warning {
  border-color: #ecd59d;
  color: #76591c;
  background: #fff9e9;
}

.drink-notice.danger {
  border-color: #eeb5b8;
  color: #903c42;
  background: #fff0f1;
}

.drink-notice p {
  margin: 0;
  font-size: .63rem;
  line-height: 1.45;
}

.custom-drink-fields {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #d7eaf2;
  border-radius: 17px;
  background: #fff;
}

.custom-drink-fields > label {
  display: block;
  margin-bottom: 11px;
}

.custom-drink-fields .field-grid input {
  padding-right: 5px;
}

.consumed-field {
  margin-bottom: 16px;
}

.sheet-shell > .primary-button {
  width: 100%;
}

.info-dialog {
  width: min(calc(100% - 32px), 430px);
  max-width: none;
  padding: 0;
  border-radius: 25px;
  background: transparent;
}

.info-dialog[open] {
  animation: dialog-in .2s ease-out;
}

@keyframes dialog-in {
  from { opacity: 0; transform: scale(.95); }
  to { opacity: 1; transform: scale(1); }
}

.dialog-card {
  position: relative;
  padding: 29px 23px 22px;
  border-radius: 25px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

.dialog-card > .close-button {
  position: absolute;
  top: 12px;
  right: 12px;
}

.dialog-card h2 {
  margin-bottom: 9px;
  font-size: 1.35rem;
}

.dialog-card > p {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: .79rem;
}

.dialog-card > .primary-button {
  width: 100%;
}

.dialog-illustration {
  display: grid;
  width: 70px;
  height: 70px;
  margin: 0 auto 15px;
  border-radius: 24px;
  place-items: center;
  background: #e3f7ff;
  font-size: 2.1rem;
}

.dialog-illustration.danger {
  background: #ffebec;
}

.text-dialog {
  max-height: 82dvh;
  overflow-y: auto;
  text-align: left;
}

.text-dialog .eyebrow {
  margin-bottom: 4px;
}

.text-dialog > .primary-button {
  margin-top: 3px;
}

.game-sheet .sheet-shell {
  padding-bottom: calc(25px + env(safe-area-inset-bottom));
}

.game-reward-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  color: #775919;
  background: #fff6d6;
}

.game-reward-note p {
  margin: 0;
  font-size: .62rem;
  line-height: 1.45;
}

.game-status {
  min-height: 38px;
  margin-bottom: 10px;
  color: var(--blue-deep);
  text-align: center;
  font-size: .78rem;
  font-weight: 800;
}

.connect-four-board {
  display: grid;
  width: min(100%, 390px);
  aspect-ratio: 7 / 6;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin: 0 auto;
  padding: 9px;
  border: 1px solid #0876ba;
  border-radius: 20px;
  background: linear-gradient(160deg, #0d9bdd, #0874bd);
  box-shadow: inset 0 2px 7px rgba(255,255,255,.24), 0 13px 28px rgba(4, 89, 138, .2);
}

.game-cell {
  position: relative;
  display: grid;
  padding: 0;
  border: 0;
  border-radius: 50%;
  place-items: center;
  overflow: hidden;
  background: #e9f5fa;
  box-shadow: inset 0 3px 7px rgba(3,71,106,.2);
}

button.game-cell[data-column] {
  cursor: pointer;
}

.game-cell:disabled {
  opacity: 1;
}

.drop {
  display: inline-block;
  width: 68%;
  height: 68%;
  border-radius: 54% 46% 62% 38% / 64% 40% 60% 36%;
  background: linear-gradient(145deg, #75ddff, #08a0e2 68%);
  box-shadow: inset 4px 4px 7px rgba(255,255,255,.48), 0 3px 6px rgba(0,65,102,.2);
  transform: rotate(45deg);
}

.drop.ai {
  background: linear-gradient(145deg, #355f79, #0d3149 70%);
}

.game-cell.is-new .drop {
  animation: drop-in .38s cubic-bezier(.18,.82,.27,1.12) both;
}

@keyframes drop-in {
  from { opacity: .2; transform: translateY(-320px) rotate(45deg); }
  75% { transform: translateY(4px) rotate(45deg); }
  to { opacity: 1; transform: translateY(0) rotate(45deg); }
}

.game-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 12px 0 17px;
  color: var(--muted);
  font-size: .62rem;
}

.game-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.game-legend .drop {
  width: 16px;
  height: 16px;
}

.dialog-illustration.bone {
  background: #fff2bd;
  filter: sepia(.2) saturate(1.3);
}

.bone-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 16px;
}

.bone-breakdown span {
  padding: 10px;
  border-radius: 13px;
  color: #765519;
  background: #fff8dc;
  font-size: .65rem;
}

.bone-breakdown b {
  display: block;
  margin-top: 2px;
  font-size: 1rem;
}

.onboarding-dialog .dialog-card {
  text-align: left;
}

.onboarding-dialog .dialog-illustration {
  margin-left: 0;
}

.onboarding-list {
  display: grid;
  gap: 9px;
  margin: 17px 0;
}

.onboarding-list > div {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  background: #f2f9fc;
}

.onboarding-list > div > span {
  font-size: 1.25rem;
}

.onboarding-list p,
.onboarding-list strong {
  display: block;
  margin: 0;
}

.onboarding-list p {
  color: var(--muted);
  font-size: .64rem;
  line-height: 1.43;
}

.onboarding-list strong {
  margin-bottom: 2px;
  color: var(--ink);
  font-size: .72rem;
}

.loading-screen {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  color: var(--blue-deep);
  background: linear-gradient(160deg, #fff0de, #fffaf2 62%, #edfaff);
  transition: opacity .3s ease, visibility .3s ease;
}

.loading-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-screen img {
  border-radius: 22px;
  box-shadow: 0 15px 35px rgba(7, 115, 172, .24);
  animation: breathe 1.7s ease-in-out infinite;
}

@keyframes breathe {
  50% { transform: translateY(-5px) scale(1.025); }
}

.loading-screen strong {
  margin-top: 17px;
  font-size: 1.22rem;
}

.loading-screen span {
  margin-top: 5px;
  color: var(--muted);
  font-size: .72rem;
}

.toast {
  position: fixed;
  z-index: 120;
  right: 50%;
  bottom: calc(91px + env(safe-area-inset-bottom));
  width: max-content;
  max-width: min(calc(100% - 32px), 480px);
  padding: 11px 15px;
  border-radius: 13px;
  color: #fff;
  background: rgba(7, 52, 76, .94);
  box-shadow: 0 11px 28px rgba(3, 35, 52, .24);
  font-size: .72rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translate(50%, 12px);
  transition: opacity .2s ease, transform .2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(50%, 0);
}

.toast.is-error {
  background: rgba(170, 48, 57, .96);
}

@media (max-width: 370px) {
  main { padding-right: 13px; padding-left: 13px; }
  .quick-drinks { gap: 6px; }
  .quick-drink { min-height: 100px; }
  .drink-emoji { width: 48px; height: 48px; }
  .metric-card { padding: 12px; }
  .notification-card { gap: 8px; padding: 11px; }
  .small-button { padding: 0 8px; }
  .mascot-card { grid-template-columns: 42% 1fr; padding-right: 10px; }
  .mascot-copy h2 { font-size: 1rem; }
  .connect-four-board { gap: 3px; padding: 7px; }
}

@media (min-width: 720px) {
  body { padding: 24px 0; }
  .app-shell { min-height: calc(100dvh - 48px); border-radius: 32px; }
  .topbar { border-radius: 32px 32px 0 0; }
  .bottom-nav { bottom: 24px; border-radius: 0 0 32px 32px; }
  .bottom-sheet { margin-bottom: 24px; border-radius: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
