/* morning.css — the morning's stack (js/morning.js): the horizon's day from
 * 4:00 to noon. A short stack of cards with the one that matters on top:
 * the weigh-in's ruler (glass, the face's one blurred card), then what today
 * asks, the coach's one line and the meals assumed eaten (opaque cards with
 * the rim and the hairline). Every colour is a base.css token or a
 * color-mix() of one; the accent is the person's (identity), the hatch is a
 * doubt (a ± band, an assumed meal, a caution), and nothing here is red.
 * Sizes follow the text size (--fz); every control reaches 44 to the finger;
 * every move is a transform, an opacity or a height, on the shared curves. */

/* The morning is not a clock: no now line, no now pill. */
.hz[data-morning] .hz-rule { display: none; }

.mo-wrap { position: absolute; left: 0; right: 0; }
.mo {
  display: flex;
  flex-direction: column;
  max-width: 600px;
  margin: 0 auto;
}
.mo-top { position: relative; z-index: 1; }

/* ------------------------------------------------------------- the cards -- */

.mo-card {
  position: relative;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--lift);
  color: var(--ink);
}
/* The top card is the glass (base.css .glass), on its own radius. */
.mo-hero { position: relative; z-index: 1; overflow: hidden; padding: var(--pad-hero); }
.mo-lab {
  font: var(--t-label);
  color: var(--ink-2);
  white-space: nowrap;
}
.mo-lab b { font-weight: 500; color: var(--ink); }
.mo-line { margin-top: var(--s-2); font: var(--t-sub); color: var(--ink-2); }
.mo-mono { margin-top: var(--s-1); font: var(--t-label); color: var(--ink-2); overflow-wrap: anywhere; }
.mo-unit {
  margin-left: var(--s-1);
  font: 500 var(--t-cap-size)/1 var(--font-mono);
  letter-spacing: 0;
  color: var(--ink-2);
  vertical-align: top;
  white-space: nowrap;
}

/* --------------------------------------------------------- the weigh-in -- */

.mo-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.mo-title { font: 600 calc(18 * var(--fz))/1.2 var(--font); letter-spacing: -.02em; color: var(--ink); }
/* The context, a tag that opens the four: the person's ink on a hairline of
 * their mark, 44 to the finger. */
.mo-ctx {
  position: relative;
  flex: none;
  min-height: 30px;
  padding: 0 var(--s-3);
  border: 0;
  border-radius: 999px;
  background: none;
  box-shadow: inset 0 0 0 1px var(--accent-mark);
  color: var(--accent-ink);
  font: var(--t-label);
  cursor: pointer;
  transition: transform var(--dur-move) var(--ease-spring);
}
.mo-ctx::before { content: ""; position: absolute; inset: -7px 0; }
.mo-ctx:active { transform: scale(.95); }
.mo-ctx[aria-expanded="true"] { box-shadow: inset 0 0 0 1.5px var(--accent-mark); }
.mo-why { margin-top: var(--s-2); font: var(--t-sub); color: var(--ink-2); }
.mo-ctx-pick { margin-top: var(--s-3); }
.mo-fasted { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-top: var(--s-3); }
.mo-fasted-q { font: 560 var(--t-sub-size)/1.3 var(--font); color: var(--ink); margin-right: var(--s-1); }

/* The figure: the value under the needle, grey until the ruler moves. A tap
 * opens the keypad to type it instead. */
.mo-fig {
  display: block;
  width: 100%;
  min-height: var(--tap);
  margin-top: var(--s-3);
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: 200 calc(96 * var(--fz-xl))/1 var(--font);
  letter-spacing: -.065em;
  text-align: center;
  white-space: nowrap;
  cursor: text;
  transition: color var(--dur-move) var(--ease);
}
.mo-fig.is-ghost { color: var(--fuzz); }
.mo-fig.is-empty { font: 300 calc(40 * var(--fz-lg))/1.2 var(--font); letter-spacing: -.03em; color: var(--ink-2); }
.mo-fig-u {
  position: relative;
  top: .55em;
  margin-left: 6px;
  font: 500 var(--t-cap-size)/1 var(--font-mono);
  letter-spacing: 0;
  color: var(--ink-2);
  vertical-align: top;
}
.mo-cap {
  min-height: calc(18 * var(--fz));
  margin-top: var(--s-2);
  font: var(--t-label);
  color: var(--ink-2);
  text-align: center;
}
.mo-cap.is-asking { animation: mo-ask var(--dur-draw) var(--ease) 1; }
@keyframes mo-ask {
  20%, 60% { color: var(--accent-ink); transform: translate3d(-3px, 0, 0); }
  40%, 80% { color: var(--accent-ink); transform: translate3d(3px, 0, 0); }
}

/* Three prints: the slots, the one being set ringed in the person's mark. */
.mo-slots { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--s-2); margin-top: var(--s-3); }
.mo-slot {
  position: relative;
  min-height: 32px;
  padding: 0 var(--s-3);
  border: 0;
  border-radius: 999px;
  background: var(--quiet-bg);
  color: var(--ink-2);
  font: var(--t-label);
  cursor: pointer;
}
.mo-slot::before { content: ""; position: absolute; inset: -6px 0; }
.mo-slot.is-set { color: var(--ink); }
.mo-slot.is-on { background: none; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--accent-mark); }
.mo-slot-words { font: var(--t-label); color: var(--ink-2); }

/* The ruler you drag: the scale moves under a fixed needle, edges faded. */
.mo-scrub {
  position: relative;
  height: 76px;
  margin: var(--s-3) -18px 0;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  outline: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 20%, black 80%, transparent);
  mask-image: linear-gradient(90deg, transparent, black 20%, black 80%, transparent);
}
.mo-scrub.is-dragging { cursor: grabbing; }
.mo-scrub:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-ink); -webkit-mask-image: none; mask-image: none; }
.mo-scrub-track { position: absolute; left: 0; top: 8px; will-change: transform; }
.mo-scrub.is-snapping .mo-scrub-track { transition: transform var(--dur-settle) var(--ease-spring); }
.mo-scrub .ruler { max-width: none; }
.mo-scrub .ruler-needle { display: none; }
.mo-scrub .ruler-label-value { fill: var(--accent-ink); }
.mo-needle {
  position: absolute;
  left: 50%;
  top: 14px;
  width: 2px;
  height: 38px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--accent-mark);
  box-shadow: 0 0 12px 2px color-mix(in srgb, var(--accent-mark) 55%, transparent);
  pointer-events: none;
}
.mo-needle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -8px;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top: 7px solid var(--accent-mark);
}

.mo-ctl {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 10px;
  margin-top: var(--s-3);
}
.mo-ctl.is-solo { grid-template-columns: minmax(0, 1fr); }
.mo-step {
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--quiet-bg);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform var(--dur-move) var(--ease-spring);
}
.mo-step:active { transform: scale(.9); }
.pill-btn.pill-filled.mo-save { width: 100%; height: 52px; min-height: 52px; font-size: calc(17 * var(--fz)); }
.pill-btn.pill-filled.mo-save:not([aria-disabled="true"]) {
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--accent-mark) 80%, transparent);
}

/* Details: the sheet's own second sheet, one quiet row. */
.mo-details {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-2);
  width: 100%;
  min-height: var(--tap);
  margin-top: var(--s-2);
  padding: 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.mo-details-k { font: 560 var(--t-sub-size)/1.3 var(--font); }
.mo-details-sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--t-cap); color: var(--ink-2); }
.mo-details-go { color: var(--ink-3); }
.mo-later {
  display: block;
  min-height: var(--tap);
  margin: 0 auto;
  padding: 0 var(--s-4);
  border: 0;
  background: none;
  color: var(--ink-2);
  font: 560 var(--t-sub-size)/1 var(--font);
  cursor: pointer;
}

/* ----------------------------------------------------------- the landing -- */

.mo-land { cursor: pointer; }
.mo-land-head { display: flex; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.mo-land-mid, .mo-done-mid {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-1) var(--s-3);
  flex-wrap: wrap;
}
.mo-land-mid { margin-top: 10px; flex-wrap: nowrap; align-items: stretch; }
.mo-land-r {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--s-2);
  min-width: 0;
  padding-top: var(--s-1);
}
.mo-land-r .mo-unit { margin-left: 0; }
.mo-land-big, .mo-done-big {
  font: 200 calc(88 * var(--fz-xl))/.86 var(--font);
  letter-spacing: -.065em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--ink);
}
.mo-land-big .honest { display: inline-block; margin-left: -4px; animation: mo-rise var(--dur-draw) var(--ease-spring) both; }
@keyframes mo-rise {
  from { opacity: 0; transform: translate3d(0, 20px, 0) scale(.92); }
  to { opacity: 1; transform: none; }
}
.mo-rate { display: grid; justify-items: end; gap: 6px; text-align: right; white-space: nowrap; }
.mo-rate-n { font: 300 calc(30 * var(--fz-lg))/1 var(--font); letter-spacing: -.045em; color: var(--ink); }
.mo-rate-u { font: var(--t-label); color: var(--ink-2); }
.mo-ruler { margin: var(--s-4) -2px 0; }
.mo-ruler .ruler { width: 100%; }
.mo-ruler .is-landing { transition: transform var(--dur-draw) var(--ease-spring); }
.mo-cells {
  display: grid;
  grid-template-columns: repeat(var(--mo-cells, 3), minmax(0, 1fr));
  margin-top: 10px;
  border-top: 1px solid var(--line);
}
.mo-cell { display: grid; gap: 6px; padding: 11px 0 0 12px; min-width: 0; }
.mo-cell:first-child { padding-left: 0; }
.mo-cell + .mo-cell { border-left: 1px solid var(--line); }
.mo-cell-v { font: 300 var(--num-cell-size)/1 var(--font); letter-spacing: -.045em; color: var(--ink); white-space: nowrap; }
.mo-cell-s { font: var(--t-label); color: var(--ink-2); overflow-wrap: anywhere; }
.mo-land-done { margin-top: var(--s-3); }

/* -------------------------------------------------------- the done card -- */

.mo-done { padding: 13px var(--s-4) 14px; }
.mo-done-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.mo-check { display: inline-flex; align-items: center; gap: 6px; font: var(--t-label); color: var(--ink-2); white-space: nowrap; }
.mo-check i {
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--on-accent);
}
.mo-done-mid { margin-top: 6px; }
.mo-done-big { font-size: calc(48 * var(--fz-lg)); line-height: .9; }
.mo-done .mo-rate-n { font-size: calc(22 * var(--fz-lg)); }
.mo-done .mo-line { margin-top: var(--s-2); }

/* A build's guardrail, inside the top card. */
.mo-guard { margin-top: var(--s-3); padding-top: 10px; border-top: 1px solid var(--line); }
.mo-guard-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.mo-guard-title { font: 600 calc(15 * var(--fz))/1.2 var(--font); letter-spacing: -.01em; color: var(--ink); }
.mo-guard .mo-ruler { margin-top: var(--s-2); }
.mo-waist { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-top: var(--s-2); }
.mo-waist-track { position: relative; height: 6px; border-radius: 3px; background: var(--line); }
.mo-waist-track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--accent-mark); }
.mo-waist-track em { position: absolute; right: 0; top: -4px; bottom: -4px; width: 1.5px; background: var(--ink); }
.mo-waist-words { font: var(--t-label); color: var(--ink-2); white-space: nowrap; }

/* A doubt or a caution, hatched in the person's mark: "assumed", "Faster
 * than useful". Never red: neither is past a limit. */
.mo-hatch-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 10px 0 7px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px var(--accent-mark);
  color: var(--accent-ink);
  font: var(--t-label);
  white-space: nowrap;
}
.mo-hatch-tag::before {
  content: "";
  width: 12px;
  height: 12px;
  flex: none;
  border-radius: 3px;
  background: var(--hatch);
  box-shadow: inset 0 0 0 1px var(--accent-mark);
}

/* What is done folds into a pile that peeks out under the top card. */
.mo-pile { position: relative; z-index: 0; margin: -18px 12px 0; }
.mo-pile-a {
  display: block;
  min-height: 40px;
  padding: 22px var(--s-3) 6px;
  border-radius: 0 0 16px 16px;
  background: var(--surface-2);
  box-shadow: inset 0 -1px 0 var(--line), inset 1px 0 0 var(--line), inset -1px 0 0 var(--line);
  font: var(--t-label);
  font-style: normal;
  color: var(--ink-2);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  animation: mo-pile-in var(--dur-settle) var(--ease-spring) both;
}
.mo-pile-b {
  display: block;
  height: 8px;
  margin: 0 var(--s-4);
  border-radius: 0 0 12px 12px;
  background: var(--surface-2);
  box-shadow: inset 0 -1px 0 var(--line), inset 1px 0 0 var(--line), inset -1px 0 0 var(--line);
  opacity: .7;
}
@keyframes mo-pile-in {
  from { opacity: 0; transform: translate3d(0, -8px, 0); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------------------------- the queue, the day -- */

/* Before the weigh-in, what waits under it: a short stack, each row a step
 * further back. A tap brings the day up. */
.mo-queue { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-3); }
.mo-q {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 0 14px 0 10px;
  border: 0;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--lift);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform var(--dur-move) var(--ease-spring);
}
.mo-q:nth-child(2) { transform: scale(.975); }
.mo-q:nth-child(3) { transform: scale(.95); }
.mo-q:active { transform: scale(.94); }
.mo-q-mark, .mo-ask-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  background: color-mix(in srgb, var(--accent-mark) 14%, transparent);
}
.mo-q-words { min-width: 0; font: 500 calc(15 * var(--fz))/1.25 var(--font); letter-spacing: -.01em; color: var(--ink); }
.mo-q-meta { font: var(--t-label); color: var(--ink-2); white-space: nowrap; }

/* The coach's orb: the household's two marks turning together. */
.mo-orb {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--surface) 72%, transparent), transparent 46%),
    conic-gradient(from 210deg, var(--accent-alex), var(--accent-jordan), var(--accent-alex));
  box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--accent-jordan) 60%, transparent);
}

.mo-day { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-3); }
.mo[data-phase="day"] .mo-day { margin-top: var(--s-4); }
.mo-label { display: flex; align-items: baseline; justify-content: space-between; padding: 10px 4px 2px; }
.mo-label-t { font: 400 calc(20 * var(--fz))/1.1 var(--font); letter-spacing: -.025em; color: var(--ink); }
.mo-label-n { font: var(--t-label); color: var(--ink-2); }

.mo-coach {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--s-3);
  width: 100%;
  padding: 14px var(--s-4);
  border: 0;
  text-align: left;
  font: inherit;
}
button.mo-coach { cursor: pointer; }
.mo-coach .mo-orb { width: 40px; height: 40px; }
.mo-coach-words { display: grid; gap: 6px; min-width: 0; }
.mo-coach-h { font: 500 calc(16 * var(--fz))/1.35 var(--font); letter-spacing: -.01em; color: var(--ink); }
.mo-coach-why { font: var(--t-sub); color: var(--ink-2); }
.mo-coach-go { align-self: center; color: var(--ink-3); }

.mo-ask {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  min-height: 64px;
  padding: var(--s-2) var(--s-3);
  border: 0;
  text-align: left;
  font: inherit;
}
button.mo-ask { cursor: pointer; transition: transform var(--dur-move) var(--ease-spring); }
button.mo-ask:active { transform: scale(.985); }
.mo-ask-mark { width: 40px; height: 40px; }
.mo-ask-words { display: grid; gap: 4px; min-width: 0; }
.mo-ask-t { font: 600 calc(16 * var(--fz))/1.2 var(--font); letter-spacing: -.02em; color: var(--ink); }
.mo-ask-s { font: var(--t-label); color: var(--ink-2); overflow-wrap: anywhere; }
.mo-ask-end { display: flex; align-items: center; gap: 10px; }
.mo-ask-at { font: var(--t-label); color: var(--ink-2); white-space: nowrap; }
.mo-ask-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-2); }
.mo-ring {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1.5px var(--edge);
  color: transparent;
}
.mo-ring.is-done { background: var(--accent); color: var(--on-accent); box-shadow: none; }

/* A meal assumed eaten: the hatch down its edge, Confirm and Change. */
.mo-assumed { overflow: hidden; padding: 13px 14px 14px 18px; }
.mo-assumed::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--hatch);
}
.mo-assumed-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.mo-assumed-t { display: flex; align-items: center; gap: var(--s-2); min-width: 0; font: 600 calc(16 * var(--fz))/1.2 var(--font); letter-spacing: -.02em; color: var(--ink); }
.mo-assumed-t svg { flex: none; color: var(--accent-ink); }
.mo-assumed-s { margin-top: 6px; font: var(--t-label); color: var(--ink-2); overflow-wrap: anywhere; }
.mo-assumed-acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-top: 10px; }
.mo-assumed-note { flex: 1 1 9em; margin-left: var(--s-1); font: var(--t-cap); color: var(--ink-2); }
.mo-card.is-folding {
  animation: mo-fold var(--dur-settle) var(--ease-settle) both;
  pointer-events: none;
}
@keyframes mo-fold {
  to { opacity: 0; transform: translate3d(0, -12px, 0) scale(.96); }
}

/* The clock axis, with everything on it. */
.mo-whole {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  min-height: 56px;
  margin-top: var(--s-1);
  padding: var(--s-2) var(--s-4);
  border: 0;
  border-radius: var(--radius);
  background: none;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.mo-whole-words { display: grid; gap: 2px; min-width: 0; }
.mo-whole-t { font: 560 var(--t-body-size)/1.3 var(--font); }
.mo-whole-s { font: var(--t-cap); color: var(--ink-2); overflow-wrap: anywhere; }
.mo-whole-go { color: var(--ink-3); }

@media (prefers-reduced-motion: reduce) {
  .mo-scrub.is-snapping .mo-scrub-track,
  .mo-ruler .is-landing { transition: none; }
  .mo-land-big .honest, .mo-pile-a, .mo-card.is-folding, .mo-cap.is-asking { animation: none; }
}

/* "Why?" under the coach's line (cli/ask_why.py): a ghost pill, then the
 * answer in the line's own quiet voice. */
.mo-coach-ask { display: flex; flex-direction: column; align-items: flex-start; padding: 0 var(--s-4); }
.mo-coach-ask-btn { min-height: 44px; }
.mo-coach-ask-said { margin: 0; font: var(--t-sub); color: var(--ink); text-wrap: pretty; }
.mo-coach-ask-by { margin: 4px 0 0; font: var(--t-cap); color: var(--ink-3); }
