/* today.css — Today page (#/) and History page styles. Owned by the today agent. */

/* ---- counter card: diaper goals ---- */
.today-count { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.today-goal-num { display: inline-flex; align-items: baseline; justify-content: center; gap: 1px; }
.today-goal-of { font-size: .8125rem; font-weight: 500; color: var(--muted-foreground); }
.today-goal-check {
  display: none; align-self: center; margin-inline-start: 4px;
  width: 1rem; height: 1rem; border-radius: 9999px;
  background: var(--pastel-mint); color: var(--pastel-mint-fg);
  place-items: center;
}
.today-goal-check svg { width: .7rem; height: .7rem; stroke-width: 3; }
.today-goal[data-done=true] .today-goal-check { display: inline-grid; }
.today-goal-bar {
  width: 100%; max-width: 4.5rem; height: 4px; margin-top: 6px;
  border-radius: 9999px; overflow: hidden;
  background: color-mix(in oklab, var(--muted-foreground) 18%, transparent);
}
.today-goal-bar > span {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: var(--pastel-lavender-fg); opacity: .55;
  transition: width .4s ease, background-color .4s ease;
}
.today-goal[data-goal=wet] .today-goal-bar > span { background: var(--pastel-sky-fg); }
.today-goal[data-goal=dirty] .today-goal-bar > span { background: var(--pastel-sand-fg); }
.today-goal[data-done=true] .today-goal-bar > span { background: var(--pastel-mint-fg); opacity: .7; }

/* ---- next-feed banner + progress bar ---- */
.feed-banner {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 14px 12px; border-radius: 1rem;
  font-size: .875rem; line-height: 1.25rem; font-weight: 500;
  background: color-mix(in oklab, var(--pastel-lavender) 55%, transparent);
  color: var(--foreground);
  transition: background-color .4s ease;
}
.feed-banner-row { display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.feed-banner-row svg { flex-shrink: 0; color: var(--pastel-lavender-fg); }
/* fills left → right (physical, even in RTL) with the elapsed percent on the filled part */
.feed-progress {
  position: relative; height: 20px; border-radius: 9999px; overflow: hidden; direction: ltr;
  background: color-mix(in oklab, var(--pastel-lavender-fg) 14%, var(--background));
}
.feed-progress-fill {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: color-mix(in oklab, var(--pastel-lavender-fg) 60%, var(--pastel-lavender));
  transition: width 1s linear, background-color .4s ease;
}
.feed-progress-pct {
  position: absolute; top: 0; bottom: 0; display: flex; align-items: center;
  transform: translateX(-100%); padding: 0 8px;
  font-size: .75rem; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums;
  color: #fff; white-space: nowrap; pointer-events: none;
  transition: left 1s linear;
}
.feed-banner[data-pct-outside=true] .feed-progress-pct { transform: none; color: var(--pastel-lavender-fg); }
.feed-banner[data-state=overdue] { background: color-mix(in oklab, var(--pastel-rose) 75%, transparent); }
.feed-banner[data-state=overdue] .feed-banner-row svg { color: var(--pastel-rose-fg); }
.feed-banner[data-state=overdue] .feed-progress { background: color-mix(in oklab, var(--pastel-rose-fg) 14%, var(--background)); }
.feed-banner[data-state=overdue] .feed-progress-fill { background: color-mix(in oklab, var(--pastel-rose-fg) 65%, var(--pastel-rose)); }

/* ---- history: load more ---- */
.history-more {
  display: flex; width: 100%; min-height: 3rem; align-items: center; justify-content: center; gap: 6px;
  border-radius: 1rem; border: 2px dashed var(--border); background: transparent;
  font-weight: 600; color: var(--muted-foreground); cursor: pointer;
  transition: background-color .2s ease;
}
.history-more:hover { background: var(--secondary); }
.history-more:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.history-more-hint { font-weight: 400; font-size: .75rem; }
section > h2[tabindex="-1"]:focus { outline: none; }

@media (prefers-reduced-motion: reduce) {
  .feed-banner, .feed-progress-fill, .feed-progress-pct, .today-goal-bar > span, .history-more { transition: none; }
}

/* ---- vitamin D: the label is struck through once today's dose is marked ---- */
.vitamin-row[data-done=true] .vitamin-label {
  color: var(--muted-foreground);
  text-decoration: line-through 2px currentColor;
}

/* ---- history: soft blue rows for pee, light brown rows for poop ---- */
.history-row-wet {
  background: color-mix(in oklab, var(--pastel-sky) 45%, var(--card));
  border-color: color-mix(in oklab, var(--pastel-sky-fg) 18%, transparent);
}
.history-row-dirty {
  background: color-mix(in oklab, var(--pastel-sand) 60%, var(--card));
  border-color: color-mix(in oklab, var(--pastel-sand-fg) 20%, transparent);
}
.history-row-wet > span:first-child { background: var(--pastel-sky); color: var(--pastel-sky-fg); }
.history-row-dirty > span:first-child { background: var(--pastel-sand); color: var(--pastel-sand-fg); }

/* ---- history: one card per day with a 24-hour ribbon (left = 00:00, right = 24:00) ---- */
.history-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .75rem; color: var(--muted-foreground); }
.history-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.history-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 9999px; }
.history-swatch-n, .history-swatch-n-right { background: color-mix(in oklab, var(--pastel-lavender-fg) 55%, var(--pastel-lavender)); }
.history-swatch-n-left { background: color-mix(in oklab, var(--pastel-rose-fg) 45%, var(--pastel-rose)); }
.history-swatch-wet { background: color-mix(in oklab, var(--pastel-sky-fg) 45%, var(--pastel-sky)); }
.history-swatch-dirty { background: color-mix(in oklab, var(--pastel-sand-fg) 55%, var(--pastel-sand)); }
.history-swatch-other { background: var(--muted-foreground); }

.history-day {
  background: var(--card); color: var(--card-foreground);
  border: 1px solid var(--border); border-radius: 1.5rem;
  padding: 12px 14px 14px; box-shadow: 0 1px 3px 0 #0000000f;
  display: flex; flex-direction: column; gap: 10px;
}
.history-day-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; padding: 2px 0; background: none; border: 0; color: inherit; cursor: pointer; text-align: start;
  border-radius: .5rem;
}
.history-day-head:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.history-day-title { font-size: .95rem; font-weight: 600; }
.history-day-toggle {
  font-size: .75rem; font-weight: 500; color: var(--pastel-lavender-fg);
  background: color-mix(in oklab, var(--pastel-lavender) 60%, transparent);
  padding: 3px 10px; border-radius: 9999px;
}

.history-ribbon { direction: ltr; padding: 0 2px; }
.history-track {
  position: relative; height: 54px; border-radius: 10px; overflow: hidden;
  background: color-mix(in oklab, var(--secondary) 80%, transparent);
}
.history-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: color-mix(in oklab, var(--foreground) 6%, transparent); }
.history-grid.is-major { background: color-mix(in oklab, var(--foreground) 14%, transparent); }
.history-seg { position: absolute; top: 5px; height: 14px; border-radius: 4px; min-width: 4px; }
.history-dot {
  position: absolute; top: 24px; width: 11px; height: 11px; margin-left: -5.5px; border-radius: 9999px;
  box-shadow: 0 0 0 1.5px var(--card);
}
.history-now { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--primary); opacity: .7; }
.history-axis { position: relative; height: 16px; margin-top: 3px; }
.history-axis-label {
  position: absolute; top: 0; transform: translateX(-50%);
  font-size: .625rem; line-height: 16px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.history-axis-label:first-child { transform: none; }
.history-axis-label:last-child { transform: translateX(-100%); }

.history-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.history-chip { font-size: .75rem; font-weight: 500; padding: 2px 10px; border-radius: 9999px; }
.history-chip-n { background: var(--pastel-lavender); color: var(--pastel-lavender-fg); }
.history-chip-wet { background: var(--pastel-sky); color: var(--pastel-sky-fg); }
.history-chip-dirty { background: var(--pastel-sand); color: var(--pastel-sand-fg); }
.history-list { margin-top: 2px; }

/* rows inside a day card: a little tighter, and labels wrap instead of being cut off */
.history-day { padding-inline: 10px; }
.history-list .truncate { white-space: normal; overflow: visible; text-overflow: clip; }
.history-list li > div { padding: 10px; gap: 8px; box-shadow: none; }
.history-list li > div > span:first-child { width: 2.25rem; height: 2.25rem; }
.history-list button { width: 2.25rem; height: 2.25rem; }
.history-axis-caption { font-size: .625rem; color: var(--muted-foreground); text-align: center; margin-top: 1px; }

/* a feeding mark on the ribbon: a fixed-width pill starting at the feeding start */
.history-seg.history-swatch-n { width: 7px; margin-left: -3.5px; height: 14px; border-radius: 9999px; }

/* hour labels under the next-feed bar (same left → right direction as the bar) */
.feed-axis { position: relative; height: 16px; direction: ltr; margin-top: -2px; }
.feed-axis-label {
  position: absolute; top: 0; transform: translateX(-50%);
  font-size: .6875rem; line-height: 16px; font-weight: 500; font-variant-numeric: tabular-nums;
  color: var(--muted-foreground); white-space: nowrap;
}
.feed-axis-label.is-start { transform: none; color: var(--foreground); }
.feed-axis-label.is-end { transform: translateX(-100%); color: var(--foreground); }

/* three lanes so events at the same hour never hide each other:
   nursing on top, pee in the middle, poop at the bottom */
.history-dot.history-swatch-wet { top: 22px; }
.history-dot.history-swatch-dirty { top: 37px; }
.history-track::before, .history-track::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1px;
  background: color-mix(in oklab, var(--foreground) 5%, transparent);
}
.history-track::before { top: 20px; }
.history-track::after { top: 35px; }

/* ---- next-feed banner: reminder bell at the inline end of the row (left in RTL) ---- */
.feed-banner-row { position: relative; min-height: 2rem; padding-inline: 2.25rem; }
.feed-bell {
  position: absolute; inset-inline-end: -8px; top: 50%; translate: 0 -50%;
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 9999px; background: transparent; cursor: pointer;
  color: var(--muted-foreground); -webkit-tap-highlight-color: transparent;
}
.feed-bell::before { /* the visible 32px circle inside the 40px touch target */
  content: ""; position: absolute; inset: 4px; border-radius: inherit;
  border: 1.5px solid color-mix(in oklab, var(--pastel-lavender-fg) 35%, transparent);
  background: color-mix(in oklab, var(--background) 70%, transparent);
  transition: background-color .2s ease, border-color .2s ease;
}
.feed-bell svg { position: relative; width: 1.125rem; height: 1.125rem; }
.feed-bell[data-on=true] { color: #fff; }
.feed-bell[data-on=true]::before {
  border-color: transparent;
  background: color-mix(in oklab, var(--pastel-lavender-fg) 80%, var(--pastel-lavender));
}
.feed-bell[data-on=true] svg { fill: currentColor; }
.feed-bell:active::before { transform: scale(.92); }
.feed-bell:focus-visible { outline: none; }
.feed-bell:focus-visible::before { box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--ring); }
.feed-bell[aria-busy=true] { opacity: .6; cursor: progress; }
.feed-bell[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .feed-bell::before { transition: none; } }

/* daily verdict next to the chips: green when both diaper goals were met, red otherwise */
.history-chip-ok, .history-chip-bad { display: inline-flex; align-items: center; gap: 4px; }
.history-chip-ok svg, .history-chip-bad svg { width: 14px; height: 14px; stroke-width: 3; }
.history-chip-ok { background: oklch(90% .09 150); color: oklch(38% .11 150); }
.history-chip-bad { background: oklch(90% .07 25); color: oklch(45% .16 25); }

/* ---- "טיפות מספר 30": auto-ticked box, label, count X/5 and a soft but clear "+" ---- */
.drops-row .drops-check { cursor: default; }
.drops-count {
  margin-inline-start: auto; font-size: 1rem; font-weight: 500;
  color: var(--muted-foreground); font-variant-numeric: tabular-nums;
}
.drops-count b { font-size: 1.25rem; font-weight: 700; color: var(--foreground); }
.drops-plus {
  display: grid; place-items: center; flex-shrink: 0;
  width: 44px; height: 44px; border-radius: 9999px; cursor: pointer;
  background: var(--pastel-lavender); color: var(--pastel-lavender-fg);
  border: 0; box-shadow: 0 0 0 1.5px color-mix(in oklab, var(--pastel-lavender-fg) 30%, transparent), 0 1px 3px #0000001a;
  transition: transform .12s ease, opacity .2s ease, background-color .2s ease;
}
.drops-plus svg { width: 22px; height: 22px; stroke-width: 2.5; }
.drops-plus:active:not(:disabled) { transform: scale(.95); }
.drops-plus:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.drops-plus:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.drops-row[data-done=true] .drops-label {
  color: var(--muted-foreground);
  text-decoration: line-through 2px currentColor;
}
@media (prefers-reduced-motion: reduce) { .drops-plus { transition: none; } }
