#page-hoje {
  --pace-track: #d9ccaf;
  --pace-deficit: #a89b87;
  --pace-accent: #4d9b88;
  --pace-behind-ink: #655546;
  --pace-ahead-ink: #174f40;
}

@media (prefers-color-scheme: dark) {
  #page-hoje {
    --pace-track: #315f52;
    --pace-deficit: #a99e8d;
    --pace-accent: #79bfae;
    --pace-behind-ink: #e2d6c2;
    --pace-ahead-ink: #a8bfaf;
  }
}

.hydration-metrics,
.pace-details {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1.25rem;
  margin: 0;
}

.hydration-metrics dt,
.pace-details dt {
  color: var(--muted);
  font-size: .875rem;
}

.hydration-metrics dd,
.pace-details dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

#total,
#pending {
  font-size: clamp(1.3rem, 5vw, 2.1rem);
  font-weight: 700;
  overflow-wrap: anywhere;
}

#pending-metric dt::before {
  content: "";
  display: inline-block;
  width: .5rem;
  height: .5rem;
  margin-inline-end: .35rem;
  border-radius: 50%;
  background: currentColor;
  vertical-align: .08em;
}

#pending-metric[data-pace="behind"] dt::before {
  background: var(--pace-deficit);
}

#pending-metric[data-pace="ahead"] dt::before {
  background: var(--pace-accent);
}

#pending-metric[data-pace="above-goal"] dt::before {
  visibility: hidden;
}

#pending-metric[data-pace="behind"] dd {
  color: var(--pace-behind-ink);
}

#pending-metric[data-pace="ahead"] dd,
#pending-metric[data-pace="above-goal"] dd {
  color: var(--pace-ahead-ink);
}

.hydration-pace {
  grid-column: 1 / -1;
}

.pace-track {
  display: grid;
  height: .4375rem;
  border-radius: 1rem;
  overflow: hidden;
  background: var(--pace-track);
}

.pace-track span {
  grid-area: 1 / 1;
}

.pace-reference {
  width: var(--pace-reference, 0%);
  background: var(--pace-deficit);
}

.pace-consumed {
  width: var(--pace-consumed, 0%);
  background: var(--pace-accent);
}

.pace-details {
  justify-content: space-between;
  margin-top: .55rem;
}

.pace-details div:last-child {
  text-align: end;
}

#define-goal {
  grid-column: 1 / -1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .55rem .85rem;
  border-radius: .625rem;
  background: var(--accent);
  color: var(--on);
  font-weight: 700;
}

/* Compact hydration panel reuses the native widget artwork. */
main { padding: max(12px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(48px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
header { min-height: 60px; flex-wrap: nowrap; gap: 8px; margin-bottom: 14px; }
.brand { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 28px; line-height: 1; }
.brand svg { width: 18px; height: 24px; fill: none; stroke: var(--accent); stroke-width: 1.8; }
header nav { margin: 0 0 0 auto; border: 0; flex-wrap: nowrap; gap: 4px; }
header nav a { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; border: 0; font-size: 14px; font-weight: 600; }
header nav .home-link { display: none; }
header nav .settings-link { width: 48px; padding: 12px; }
header svg, .today-actions svg, #records svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
header #install:not([hidden]) { position: fixed; bottom: 12px; right: 20px; z-index: 1; }
#today-title, #date { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#page-hoje .summary { display: block; padding: 16px; border: 0; border-radius: 18px; margin: 0 0 14px; }
#page-hoje .hydration-metrics { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
#page-hoje .hydration-metrics dt { font-size: 12px; font-weight: 400; white-space: nowrap; }
#page-hoje .hydration-metrics dt::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 50%; background: var(--water); }
#page-hoje #pending-metric[data-pace="behind"] dt::before { background: var(--pace-deficit); }
#page-hoje #pending-metric[data-pace="above-goal"] dt::before { display: none; }
#page-hoje #total { font-size: 36px; font-weight: 700; line-height: 1.25; margin-top: 4px; }
#page-hoje #total small { font-size: 45%; }
#page-hoje #pending { font-size: 20px; font-weight: 700; line-height: 1.4; }
#page-hoje .hydration-widget { display: grid; grid-template-columns: 100px minmax(0, 1fr); align-items: center; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
#page-hoje #cup { display: block; width: 100%; max-width: 100px; height: auto; margin: 0; }
.widget-content { min-width: 0; }
#page-hoje .hydration-widget .hydration-metrics { grid-template-columns: minmax(0, 1fr); }
#page-hoje .hydration-widget dt { white-space: normal; }
.cup-detail { margin: 4px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
#page-hoje .hydration-widget .today-actions { margin: 0; }
#page-hoje .hydration-widget .today-actions button { min-width: 0; padding-inline: 4px; }
@media (max-width: 359px) {
  #page-hoje .hydration-widget { grid-template-columns: 72px minmax(0, 1fr); gap: 10px; padding: 12px; }
}
#page-hoje .hydration-pace { margin-top: 13px; }
#page-hoje .pace-track { height: 7px; }
#page-hoje .pace-details { margin-top: 10px; gap: 4px 8px; flex-wrap: wrap; }
#page-hoje .pace-details div { display: flex; gap: 3px; }
#page-hoje .pace-details dt, #page-hoje .pace-details dd { font-size: 12px; color: var(--muted); }
#page-hoje .pace-details div:first-child dt::after { content: ":"; }
.today-actions { display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: 8px; }
.today-actions button { height: 50px; border: 0; border-radius: 14px; padding: 0; font-size: 16px; }
#change-cup { display: flex; align-items: center; justify-content: center; background: var(--card); }
.records-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 16px 0 7px; }
.records-heading h2 { font-size: 14px; margin: 0; }
#today-window { font-size: 12px; color: var(--muted); white-space: nowrap; }
#records .record { display: grid; grid-template-columns: 57px minmax(0, 1fr) auto; gap: 8px; min-height: 56px; padding: 0; }
#records .record small { font-size: 12px; }
#records .record strong { font-size: 14px; overflow-wrap: anywhere; }
#records .actions { flex-wrap: nowrap; gap: 0; }
#records button { width: 48px; height: 48px; padding: 13px; border: 0; background: transparent; }
@media (max-width: 330px) {
  main { padding-left: 12px; padding-right: 12px; }
  .brand { font-size: 26px; gap: 5px; }
  header nav a { padding-inline: 4px; }
  #page-hoje .hydration-metrics { grid-template-columns: minmax(0, 1fr); }
  #records .record { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 4px; }
}
