:root {
  color-scheme: light;
  --surface: #fffef9;
  --muted: #54606d;
  --rule: #c5c9cc;
  --soft: #f1f3f3;
  --edge: #1d242b;
  --accent: #3848c5;
  --level0: #ecedeb;
  --level1: #c7e9fd;
  --level2: #87d4f4;
  --level3: #549cdd;
  --level4: #56beb7;
}
[hidden] {
  display: none !important;
}
.gauge-scene {
  position: absolute;
  inset: 0 0 -7px 40%;
  overflow: hidden;
  isolation: isolate;
  pointer-events: none;
}
.gauge {
  position: absolute;
  width: 92%;
  height: 100%;
  right: 1%;
  bottom: -1%;
  overflow: visible;
}
.vessel {
  animation: vessel-hover 5s ease-in-out infinite;
  transform-origin: 50% 50%;
}
.gauge-shadow {
  animation: shadowPulse 5s ease-in-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}
.tide {
  animation: swell 4s linear infinite;
}
.tide.back {
  animation-direction: reverse;
  animation-duration: 6s;
}
.bubble {
  animation: rise 3s ease-in infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.b2 {
  animation-delay: -1s;
}
.b3 {
  animation-delay: -2.3s;
}
.dialog-art .gauge-scene {
  inset: 0 16%;
}
.gauge-scene .aura {
  animation-duration: 7s;
}
.gauge-scene .s2 {
  right: 12%;
}
@keyframes vessel-hover {
  50% {
    transform: translateY(-3px) rotate(2deg);
  }
}
@keyframes swell {
  from {
    transform: translateX(-20px);
  }
  to {
    transform: translateX(60px);
  }
}
@keyframes rise {
  0% {
    transform: translateY(4px) scale(0.5);
    opacity: 0;
  }
  30% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-23px) scale(1.15);
    opacity: 0;
  }
}
@keyframes ripple {
  from {
    transform: scale(0.94);
    opacity: 0.2;
  }
  to {
    transform: scale(1.07);
    opacity: 0;
  }
}
@keyframes sip-up {
  0% {
    opacity: 0;
    transform: translateY(5px);
  }
  18% {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateY(-30px);
  }
}
@keyframes bloom {
  0% {
    filter: brightness(0.85);
  }
  32% {
    filter: brightness(1.42);
  }
  100% {
    filter: brightness(1);
  }
}
@keyframes chart-grow {
  from {
    transform: scaleY(0);
  }
}
.sip-float {
  position: absolute;
  right: 9%;
  bottom: 18%;
  font: 800 13px var(--mono);
  font-style: normal;
  color: #eaff99;
  text-shadow: 1px 2px #17295e;
  animation: sip-up 1.15s ease-out both;
  pointer-events: none;
}
.hero .meter span {
  transform-origin: left;
}
.goal-met:before {
  background:
    radial-gradient(ellipse at 82% 48%, #258a96 0, transparent 58%),
    linear-gradient(115deg, #27448e, #3459ab 65%, #256576);
}
.goal-met .hero-label {
  color: #edffad;
  border-color: #dfffab9c;
  background: #092d5a77;
}
.goal-met .meter span {
  background: linear-gradient(90deg, #7cefd5, #edff9b);
}
.goal-party .gauge {
  animation: bloom 1.1s ease-out;
}
.goal-fountain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}
.hero-copy .replay {
  pointer-events: auto;
  font: 650 11px var(--mono);
  color: #eaffad;
  background: #143d6380;
  border: 1px solid #e3ffac85;
  padding: 6px 9px;
  border-radius: 20px;
  margin-top: 8px;
  cursor: pointer;
}
.repeat-btn,
.snooze {
  box-shadow: none;
  background: transparent;
}
.repeat-btn {
  margin-top: 12px;
  border: 1px dashed var(--rule);
  padding: 7px;
  min-height: 32px;
  color: var(--muted);
  gap: 7px;
}
.snooze {
  margin-left: 8px;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.entry .edit {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.entry .edit + .delete {
  margin-left: -7px;
}
.streak,
.week-foot,
.calendar-legend {
  font: 600 11px var(--mono);
}
.streak {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ffe4bf;
  color: #553724;
  padding: 5px 8px;
  border-radius: 30px;
}
.week-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin: 17px 0;
}
.week-days button {
  display: grid;
  justify-items: center;
  gap: 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 4px 0;
}
.week-days button:hover,
.bar-item:hover {
  background: var(--soft);
}
.week-days small,
.calendar-grid small {
  font: 600 10px var(--mono);
  color: var(--muted);
}
.week-days b {
  font: 600 10px var(--mono);
}
.week-drop {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #223a4e;
}
.level-0 {
  background: var(--level0);
}
.level-1 {
  background: var(--level1);
}
.level-2 {
  background: var(--level2);
}
.level-3 {
  background: var(--level3);
}
.level-4 {
  background: var(--level4);
}
.week-foot {
  padding-top: 12px;
  border-top: 1px dashed var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
}
.week-foot b {
  color: var(--ink);
}
.achievements {
  margin-top: 11px;
}
.achievement {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.achievement > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
}
.achievement.earned > span {
  background: #e2f6a0;
  color: #32462a;
}
.achievement > div {
  display: grid;
  gap: 3px;
}
.achievement b {
  font-size: 13px;
}
.achievement small {
  font: 11px var(--mono);
  color: var(--muted);
}
.achievement > svg {
  margin-left: auto;
  color: var(--accent);
}
.calendar-card h2 {
  font-size: 22px;
  letter-spacing: -0.05em;
}
.month-nav {
  display: flex;
  gap: 7px;
}
.month-nav button {
  font-size: 24px;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin: 13px 0;
}
.calendar-grid small {
  text-align: center;
  padding: 6px;
}
.cell {
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 0;
  min-height: 33px;
  font: 650 12px var(--mono);
  color: var(--ink);
}
.cell[aria-pressed="true"] {
  border: 2px solid var(--accent);
}
.cell:hover:enabled {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.cell:disabled,
.month-nav button:disabled {
  opacity: 0.42;
  cursor: default;
}
.calendar-legend {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  justify-content: flex-end;
}
.calendar-legend i {
  width: 11px;
  height: 11px;
  border-radius: 3px;
}
.bar-track i {
  animation: chart-grow 0.45s ease-out;
  transform-origin: bottom;
}
.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}
.backup-actions button {
  font-size: 12px;
}
.journal-dialog {
  padding-top: 33px;
}
.journal-dialog h2 {
  padding-right: 34px;
}
.preset-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
}
.preset-field img {
  width: 28px;
}
.preset-field input {
  width: 85px;
  margin-left: auto;
}
.full-input,
.preset-field input,
.quiet-times input {
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--edge);
  border-radius: 5px;
  padding: 10px;
}
.full-input {
  width: 100%;
  min-width: 0;
}
.time-label {
  margin-top: 16px;
}
.quiet-label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  font-weight: 650;
  margin: 14px 0 8px;
}
.quiet-label input {
  width: 17px;
  height: 17px;
  accent-color: var(--blue);
}
.quiet-times {
  display: flex;
  gap: 12px;
}
.quiet-times label {
  display: grid;
  gap: 4px;
  flex: 1;
  min-width: 0;
  font: 12px var(--mono);
}
.quiet-times input {
  width: 100%;
  min-width: 0;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .serving:hover img {
    transform: translateY(-2px) rotate(-8deg) scale(1.09);
  }
  .serving img {
    transition: transform 0.23s ease;
  }
  .week-days button:hover .week-drop {
    transform: translateY(-3px);
  }
  .week-drop {
    transition: transform 0.2s;
  }
  .gauge-scene:after {
    content: "";
    position: absolute;
    inset: 9% 12%;
    border-radius: 50%;
    background: #c9ffff;
    filter: blur(28px);
    opacity: 0;
    z-index: -1;
  }
  .hero:hover .gauge-scene:after {
    animation: ripple 2s ease-out;
  }
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #eef3f8;
    --edge: #55657b;
    --blue: #a4b1ff;
    --paper: #0e1626;
    --surface: #192638;
    --soft: #26374b;
    --muted: #b6c4d6;
    --rule: #465870;
    --accent: #aab8ff;
    --line: 2px solid #526079;
    --shadow: 4px 4px 0 #070c15;
    --level0: #293849;
    --level1: #274659;
    --level2: #30617a;
    --level3: #287d92;
    --level4: #23897c;
  }
  body {
    background-image: radial-gradient(#9fb6da29 0.8px, transparent 1px);
  }
  header {
    background: #121c2fed;
    border-bottom-color: #4a586d;
  }
  .card,
  dialog,
  .btn,
  .icon-btn,
  .chips button,
  .field-group select,
  .amount-input,
  .content-card input[type="date"],
  .skip {
    background: var(--surface);
    color: var(--ink);
  }
  nav a,
  .date,
  .date svg,
  .card-desc,
  .settings-copy,
  .setting-row p,
  .dialog-description,
  .field-help,
  .empty p,
  .entry-name small,
  .entry strong small,
  footer,
  .amount-input span,
  .tile-text small {
    color: var(--muted);
    stroke: initial;
  }
  .date svg {
    stroke: currentColor;
  }
  nav a:hover:not([aria-current]) {
    background: var(--soft);
  }
  nav a[aria-current],
  .chips button.chosen {
    color: #e5e9ff;
    background: #354169;
    border-color: #9dacff;
    box-shadow: 2px 2px #080f21;
  }
  .btn,
  .serving,
  .icon-btn,
  dialog {
    border-color: var(--edge);
    box-shadow: 2px 2px #080f19;
  }
  .btn:active,
  .serving:active {
    box-shadow: none;
  }
  .hero {
    background: #273c83;
  }
  .hero:before {
    background:
      radial-gradient(ellipse at 81% 30%, #465aac 0, transparent 57%),
      linear-gradient(115deg, #172858, #293977 70%, #273c68);
  }
  .hero.goal-met:before {
    background:
      radial-gradient(ellipse at 83% 40%, #24676a, transparent 62%),
      linear-gradient(115deg, #173552, #1e4252 75%, #173b4c);
  }
  .local-status {
    background: #263c35;
    color: #cbf6d2;
    border-color: #608470;
  }
  .local-status i {
    background: #96e984;
  }
  .icon-box {
    color: #19283b;
    border-color: #0f1729;
  }
  .glass {
    background: #203e56;
  }
  .bottle {
    background: #234338;
  }
  .large {
    background: #3c3352;
  }
  .custom {
    background: #4b3636;
  }
  .reminders {
    background-color: #403920;
    border-color: #827542;
  }
  .reminder-copy p {
    color: #e0d9b8;
  }
  .state {
    background: #302e22;
    color: #e6e1ca;
  }
  .state.on i {
    background: #8ad99e;
  }
  .reminder-btn {
    background: #343526;
  }
  .snooze,
  .entry .edit,
  .delete,
  .repeat-btn {
    background: transparent;
    box-shadow: none;
  }
  .entry .edit,
  .delete {
    border-color: transparent;
    color: var(--muted);
  }
  .delete:hover {
    background: #59383d;
    color: #ffc4c4;
  }
  .count,
  .bar-track {
    background: var(--soft);
    border-color: var(--rule);
  }
  .entry,
  .log-card .row-heading,
  .setting-row,
  footer {
    border-color: var(--rule);
  }
  .text-link {
    color: var(--accent);
  }
  .primary {
    background: #475cc5;
    color: white;
  }
  .dialog-art.blue {
    background-color: #273776;
  }
  .dialog-art.yellow {
    background-color: #64572a;
  }
  .dialog-art.lilac {
    background-color: #463b61;
  }
  .dialog-art > svg {
    filter: drop-shadow(2px 3px #302c23);
  }
  .step {
    background: var(--soft);
    border-color: var(--rule);
  }
  .streak {
    background: #523d29;
    color: #ffdfaa;
  }
  .week-drop {
    color: #def4ff;
  }
  .achievement.earned > span {
    background: #344a37;
    color: #d4ffbb;
  }
  .toggle {
    border-color: var(--edge);
  }
  .toggle::before {
    border-color: #182331;
  }
  #toast {
    background: #23364cf2;
    border-color: #768ba6;
  }
  .entry-art {
    border-color: var(--rule);
  }
}
@media (max-width: 680px) {
  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }
  header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 8;
  }
  .header-inner {
    height: 60px;
    min-height: 60px;
    display: flex;
    gap: 10px;
    padding: 0;
  }
  .header-inner nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 4px;
    padding: 5px max(8px, env(safe-area-inset-right))
      calc(5px + env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--surface) 93%, transparent);
    backdrop-filter: blur(18px);
    border-top: 1.5px solid var(--edge);
  }
  nav a {
    flex: 1;
    max-width: 145px;
    justify-content: center;
    gap: 3px;
    flex-direction: column;
    font-size: 10px;
    min-height: 46px;
    padding: 4px;
    border-radius: 8px;
  }
  nav a svg {
    width: 19px;
    height: 19px;
  }
  nav a[aria-current] {
    box-shadow: none;
  }
  #toast {
    bottom: calc(72px + env(safe-area-inset-bottom));
    width: max-content;
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .shell {
    width: calc(100% - 28px);
  }
  .header-inner .brand {
    font-size: 30px;
  }
  .intro {
    align-items: flex-start;
  }
  .intro > .btn {
    min-height: 42px;
  }
  .hero {
    min-height: 255px;
  }
  .gauge-scene {
    left: 49%;
    bottom: 0;
  }
  .gauge {
    width: 111%;
    right: -4%;
  }
  .hero-copy .replay {
    min-height: 34px;
  }
  .servings {
    gap: 10px;
  }
  .serving {
    min-height: 66px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  .btn,
  .icon-btn,
  .month-nav button {
    min-height: 44px;
  }
  .entry .icon-btn {
    width: 38px;
    min-height: 44px;
  }
  .entry {
    gap: 7px;
  }
  .entry-name {
    min-width: 0;
  }
  .week-days {
    gap: 1px;
  }
  .week-days button {
    min-height: 60px;
  }
  .week-drop {
    width: 30px;
    height: 30px;
  }
  .week-foot {
    font-size: 10px;
  }
  .cell {
    min-height: 40px;
  }
  .backup-actions .btn {
    flex-grow: 1;
  }
  .calendar-grid {
    gap: 3px;
  }
  dialog {
    position: fixed;
    inset: auto 0 0;
    margin: 0 auto;
    width: 100%;
    max-width: 520px;
    max-height: 92dvh;
    border-radius: 18px 18px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -8px 46px #11193244;
  }
  dialog[open] {
    animation: sheet-up 0.26s ease-out;
  }
  .dialog-body {
    padding: 21px;
  }
  .journal-dialog {
    padding-top: 32px;
  }
  .dialog-close {
    width: 44px;
    height: 44px;
  }
  .dialog-art {
    height: 106px;
  }
  .dialog-art .gauge-scene {
    inset: 0 18%;
  }
  .chips button,
  .toggle-line,
  .quiet-label {
    min-height: 40px;
  }
  .preset-field input,
  .full-input,
  .quiet-times input,
  .field-group select {
    font-size: 16px;
  }
  .field-help {
    line-height: 1.5;
  }
  .bar-item {
    font-size: 10px;
  }
  .settings-grid,
  .history-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .date {
    line-height: 1.2;
  }
  .content-card input[type="date"] {
    min-height: 40px;
  }
}
@keyframes sheet-up {
  from {
    transform: translateY(32px);
    opacity: 0.4;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@media (max-width: 365px) {
  .hero-copy {
    padding-left: 14px;
  }
  .intro h1 {
    font-size: 32px;
  }
  .week-foot {
    flex-wrap: wrap;
  }
  .week-card .row-heading {
    flex-wrap: wrap;
  }
  .entry .icon-btn {
    width: 31px;
  }
  .calendar-grid {
    gap: 2px;
  }
  .history-layout .row-heading {
    flex-wrap: wrap;
  }
  .hero-label {
    font-size: 8px;
  }
  .hero-copy .replay {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .replay {
    display: none;
  }
  .goal-fountain,
  .sip-float {
    display: none;
  }
}
