/* Water Intake Calculator — page-specific presentation.

   Shared shell, panels, hero (.rp-hero), stat tiles (.rp-tiles), FAQ, related cards and Cozy's
   pick come from styles.css and results.css. This file adds the tracker form, the water bottle,
   the drink breakdown, the container comparison and the reference chart. Scoped to .water-page. */

.water-page .water-scope {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------------------------------------------------------------- The form */

.water-page .water-system { margin-bottom: 4px; }
.water-page .water-control-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}
.water-page .water-system .segmented { margin-bottom: 14px; }
.water-page .segmented button:focus-visible,
.water-page .chips .chip:focus-visible { outline: 2px solid var(--highlight); outline-offset: 2px; }
.water-page .water-presets { margin: -2px 0 18px; }
.water-page .water-subhead {
  margin: 24px 0 10px;
  font-size: 1rem;
}
.water-page .water-quick-add {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 16px;
}
.water-page .water-quick-add .btn-secondary { width: 100%; margin-top: 0; }
.water-page .water-custom {
  margin: 0 0 20px;
  padding: 14px;
  border-radius: 12px;
  background: var(--accent);
  border: 1px solid var(--border);
}
.water-page .water-custom h3 { margin: 0 0 12px; font-size: 0.95rem; }
.water-page .water-custom .hint { margin-bottom: 0; }
.water-page .water-log-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.water-page .water-log-head .water-subhead { margin-bottom: 10px; }
.water-page .water-log-head .link-btn { min-height: 36px; }
.water-page .water-entries { display: grid; gap: 8px; }
.water-page .water-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--card);
}
.water-page .water-entry-icon { flex: none; font-size: 1.2rem; }
.water-page .water-entry-copy { display: grid; gap: 2px; min-width: 0; flex: 1; }
.water-page .water-entry-copy strong { font-size: 0.9rem; }
.water-page .water-entry-copy span { font-size: 0.78rem; color: var(--muted); overflow-wrap: anywhere; }
.water-page .water-entry-remove {
  flex: none;
  font: inherit;
  font-size: 0.78rem;
  min-height: 44px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.water-page .water-entry-remove:hover,
.water-page .water-entry-remove:focus-visible {
  border-color: var(--danger);
  color: var(--danger);
}
.water-page .water-entry-remove:focus-visible { outline: 2px solid var(--highlight); outline-offset: 2px; }
.water-page .water-empty {
  margin: 10px 0 0;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}
.water-page .water-context {
  margin: 18px 0 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0;
}
.water-page .water-context summary {
  cursor: pointer;
  padding: 12px 0;
  font-weight: 600;
  font-size: 0.9rem;
}
.water-page .water-context summary:focus-visible { outline: 2px solid var(--highlight); outline-offset: 2px; }
.water-page .water-context p { margin: 0 0 10px; color: var(--muted); font-size: 0.84rem; line-height: 1.55; }
.water-page .water-context p:last-child { margin-bottom: 12px; }

/* ---------------------------------------------------------------- The results */

.water-page .water-tabs { margin-top: 2px; flex-wrap: wrap; }
.water-page .water-tabs button[aria-selected="true"] {
  background: var(--card);
  color: var(--primary);
  box-shadow: var(--shadow);
}
.water-page .water-hero .value { overflow-wrap: anywhere; }
.water-page .water-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.water-page .water-stats .stat .value { font-size: 1.02rem; }
.water-page .water-progress { margin: 4px 0 4px; }
.water-page .water-progress-track {
  height: 18px;
  overflow: hidden;
  border-radius: 9px;
  background: var(--accent);
  border: 1px solid var(--border);
}
.water-page .water-progress-track > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 9px;
  background: var(--primary);
  transition: width 220ms ease;
}
.water-page .water-progress-labels {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 14px;
  margin-top: 7px;
  font-size: 0.8rem;
  color: var(--muted);
}
.water-page .water-progress-labels span:last-child { text-align: right; }

/* ---------------------------------------------------------------- The fillable bottle */

.water-page .water-bottle-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  margin: 14px 0 0;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--accent);
}
.water-page .water-bottle {
  position: relative;
  width: 120px;
  height: 258px;
  margin: 0 auto;
}
.water-page .water-bottle-cap {
  position: absolute;
  top: 0;
  left: 50%;
  width: 44px;
  height: 17px;
  transform: translateX(-50%);
  border-radius: 5px 5px 2px 2px;
  background: var(--highlight);
}
.water-page .water-bottle-neck {
  position: absolute;
  top: 15px;
  left: 50%;
  width: 34px;
  height: 20px;
  transform: translateX(-50%);
  border-inline: 3px solid var(--primary);
  background: var(--card);
}
.water-page .water-bottle-body {
  position: absolute;
  inset: 32px 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 3px solid var(--primary);
  border-radius: 18px 18px 24px 24px;
  background: var(--card);
}
.water-page .water-bottle-fill {
  position: absolute;
  inset: auto 0 0;
  height: 0;
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  opacity: 0.88;
  transition: height 320ms ease;
}
.water-page .water-bottle-label {
  position: relative;
  z-index: 1;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--card);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  max-width: calc(100% - 8px);
  text-align: center;
  white-space: normal;
  line-height: 1.2;
}
.water-page .water-bottle-copy strong { display: block; font-size: 1rem; line-height: 1.45; }
.water-page .water-bottle-copy p { margin: 8px 0 0; font-size: 0.88rem; line-height: 1.55; }
.water-page .water-bottle-copy .rp-assumption { margin-top: 10px; }

/* ---------------------------------------------------------------- The drink breakdown */

.water-page .water-breakdown-bar {
  display: flex;
  height: 20px;
  margin: 12px 0 10px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--border);
}
.water-page .water-seg { min-width: 2px; border-right: 2px solid var(--card); }
.water-page .water-seg:last-child { border-right: 0; }
.water-page .water-seg-water, .water-page .water-dot-water { background: var(--primary); }
.water-page .water-seg-tea, .water-page .water-dot-tea { background: var(--highlight); }
.water-page .water-seg-coffee, .water-page .water-dot-coffee { background: var(--fees); }
.water-page .water-seg-milk, .water-page .water-dot-milk { background: var(--rest); }
.water-page .water-seg-sparkling, .water-page .water-dot-sparkling { background: var(--growth); }
.water-page .water-seg-other, .water-page .water-dot-other { background: var(--muted); }
.water-page .water-breakdown-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.water-page .water-breakdown-legend li {
  display: grid;
  grid-template-columns: 11px minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 7px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
}
.water-page .water-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  align-self: center;
}
.water-page .water-legend-name { min-width: 0; overflow-wrap: anywhere; }
.water-page .water-legend-percent { color: var(--muted); }

/* ---------------------------------------------------------------- The container cards */

.water-page .water-container-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.water-page .water-container-cards article {
  min-width: 0;
  padding: 14px;
  border-top: 3px solid var(--highlight);
  border-radius: 12px;
  background: var(--accent);
}
.water-page .water-card-label {
  display: block;
  min-height: 2.4em;
  font-size: 0.76rem;
  line-height: 1.2;
  color: var(--muted);
}
.water-page .water-container-cards strong {
  display: block;
  margin-top: 4px;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}
.water-page .water-container-cards p {
  margin: 5px 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}

/* ---------------------------------------------------------------- Published guides */

.water-page .water-ref-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 0;
}
.water-page .water-ref-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--accent);
}
.water-page .water-source-chip {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.water-page .water-ref-card h4 { margin: 8px 0 4px; font-size: 0.92rem; }
.water-page .water-ref-card > strong { display: block; font-size: 1.05rem; }
.water-page .water-ref-card p { margin: 6px 0 0; font-size: 0.78rem; line-height: 1.45; color: var(--muted); }
.water-page .water-ref-card .water-derived { color: var(--text); }
.water-page .water-ref-card a { display: inline-block; margin-top: 8px; font-size: 0.78rem; overflow-wrap: anywhere; }

.water-page .water-ref-chart { display: grid; gap: 10px; margin-top: 12px; }
.water-page .water-ref-row { min-width: 0; }
.water-page .water-ref-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px 8px;
  font-size: 0.8rem;
}
.water-page .water-ref-head strong { margin-left: auto; }
.water-page .water-ref-track {
  height: 16px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--accent);
  border: 1px solid var(--border);
}
.water-page .water-ref-track > span {
  display: block;
  height: 100%;
  border-radius: 8px;
  background: var(--primary);
}
.water-page .water-ref-row:nth-child(3) .water-ref-track > span,
.water-page .water-ref-row:nth-child(4) .water-ref-track > span { background: var(--highlight); }

.water-page .water-nhs {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(210px, 0.65fr);
  gap: 18px;
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--accent);
}
.water-page .water-nhs h3 { margin: 8px 0 6px; font-size: 1rem; }
.water-page .water-nhs p { margin: 0; font-size: 0.82rem; line-height: 1.5; color: var(--muted); }
.water-page .water-nhs-cup label { display: block; margin-bottom: 5px; font-size: 0.78rem; font-weight: 600; }
.water-page .water-nhs-cup select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text);
}
.water-page .water-nhs-cup select:focus { outline: 2px solid var(--highlight); outline-offset: 1px; }
.water-page .water-nhs-cup p { margin-top: 8px; color: var(--text); }


/* ---------------------------------------------------------------- The fun-fact tiles */

.water-page .fact-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.water-page .fact {
  grid-column: span 3;
  min-width: 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--accent);
}
.water-page .fact:nth-child(-n+3) { grid-column: span 2; }
.water-page .fact h3 {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 0.95rem;
  line-height: 1.35;
}
.water-page .fact-emoji { flex: none; line-height: 1.3; }
.water-page .fact p { margin: 0; font-size: 0.88rem; line-height: 1.6; }
.water-page .formula { white-space: normal; overflow-wrap: anywhere; }
.water-page .water-source-list { overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .water-page .fact-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .water-page .fact,
  .water-page .fact:nth-child(-n+3) { grid-column: auto; }
  .water-page .fact:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .water-page .fact-list { grid-template-columns: minmax(0, 1fr); }
  .water-page .fact:last-child:nth-child(odd) { grid-column: auto; }
}


@media (max-width: 900px) {
  .water-page .water-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .water-page .water-container-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .water-page .water-ref-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .water-page .water-quick-add { grid-template-columns: minmax(0, 1fr); }
  .water-page .water-bottle-row { grid-template-columns: 130px minmax(0, 1fr); gap: 16px; }
  .water-page .water-bottle { width: 108px; height: 236px; }
  .water-page .water-bottle-body { inset: 32px 8px 0; }
  .water-page .water-breakdown-legend { grid-template-columns: minmax(0, 1fr); }
  .water-page .water-container-cards { grid-template-columns: minmax(0, 1fr); }
  .water-page .water-ref-cards { grid-template-columns: minmax(0, 1fr); }
  .water-page .water-nhs { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 520px) {
  .water-page .water-stats { grid-template-columns: minmax(0, 1fr); }
  .water-page .water-tabs button { flex: 1 1 100%; }
  .water-page .water-bottle-row { grid-template-columns: minmax(0, 1fr); text-align: center; }
  .water-page .water-bottle-copy { text-align: left; }
  .water-page .water-ref-head strong { margin-left: 0; }
  .water-page .water-progress-labels span:last-child { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .water-page .water-progress-track > span,
  .water-page .water-bottle-fill { transition: none; }
}



