/* today — see public/css/app.css for tokens. Use tokens only; every rule must work in both themes.
   The hero is navy in both themes, so the few rules inside it use white
   with alpha, exactly as app.css's own hero rules do. Motion is transform and
   opacity only; app.css's reduce-motion switch stops all of it. */

/* ------------------------------------------------------------------ hero */
.hero-top { display: flex; align-items: flex-start; gap: var(--sp-2); }
.hero-top h1 { flex: 1 1 auto; min-width: 0; font-weight: 700; letter-spacing: -.01em; }
.hero .hero-help {
  margin: -8px -8px 0 0;
  color: rgba(255,255,255,.88); background: rgba(255,255,255,.1); border-color: transparent;
}
.hero .hero-help:hover { color: #fff; background: rgba(255,255,255,.18); }
.hero .icon-btn:focus-visible { outline-color: #fff; }
.hero-row { margin-top: 2px; }
.hero-purpose {
  margin-top: var(--sp-2); max-width: 30em;
  font-size: var(--fs-body); line-height: 1.5; color: rgba(255,255,255,.88);
}
/* A tappable word on the sea: the underline and the hover stay white. */
.hero .term { text-decoration-color: rgba(255,255,255,.7); }
.hero .term:hover { color: #fff; }
.hero .term:focus-visible { outline-color: #fff; }

/* Aboard, the sky is the open sea's: a cool light and a few stars. Home port
   is the harbour at dusk. Scenery only — neither is a score. */
.hero[data-phase="at-sea"]::before {
  background:
    radial-gradient(1.5px 1.5px at 14% 30%, rgba(255,255,255,.75), transparent 70%),
    radial-gradient(1.5px 1.5px at 33% 22%, rgba(255,255,255,.55), transparent 70%),
    radial-gradient(1px 1px at 52% 34%, rgba(255,255,255,.6), transparent 70%),
    radial-gradient(1.5px 1.5px at 61% 26%, rgba(255,255,255,.5), transparent 70%),
    radial-gradient(55% 42% at 82% 12%, rgba(206,232,255,.32), transparent 70%),
    radial-gradient(45% 30% at 18% 92%, rgba(69,195,178,.22), transparent 75%);
}
.hero[data-phase="home-port"]::before {
  background:
    radial-gradient(55% 45% at 22% 16%, rgba(255,196,120,.42), transparent 72%),
    radial-gradient(40% 32% at 84% 22%, rgba(255,164,112,.26), transparent 72%);
}

/* Looking back at a past day. */
.today-past { align-items: center; }
.today-past .btn { margin: -6px -6px -6px 0; color: var(--accent-text); }

.card-title { font-size: var(--fs-h3); font-weight: 650; line-height: 1.3; }

/* The keepsake's door into the ship's log. */
.keepsake-log {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3);
  margin-top: var(--sp-3); padding-top: var(--sp-3);
  border-top: 1px solid color-mix(in srgb, var(--sand-deep) 80%, transparent);
}
.keepsake-log-note { flex: 1 1 200px; min-width: 0; line-height: 1.5; color: var(--ink-2); }
.keepsake-log-open { flex: none; }
/* Reminders are only paused when the person paused them; this is the way there. */
.keepsake-quiet { margin-top: var(--sp-2); }

/* ------------------------------------------------------------ tour offer */
.tour-offer { display: flex; align-items: flex-start; gap: var(--sp-3); }
.tour-offer-icon {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--tint-accent); color: var(--accent-text);
}
.tour-offer .small { margin-top: 2px; line-height: 1.5; }
.tour-offer-actions { margin-top: var(--sp-3); }
.tour-offer-actions .btn.quiet { color: var(--accent-text); }

/* ------------------------------------------------- getting under way */
/* components/setup.js — the same card on Today and in the Guide.
   An overline, a plain count and rows — no percentage and no bar: setup is
   guidance, and guidance never scores. */
.checklist { padding: var(--sp-3) 0 var(--sp-1); }
.checklist-head {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 0 var(--sp-2) 0 var(--pad);
}
.checklist-title {
  flex: 1 1 auto; min-width: 0;
  font-family: var(--font-display); font-size: var(--fs-overline); font-weight: 650;
  text-transform: uppercase; letter-spacing: .08em; line-height: 1.3; color: var(--ink-3);
}
.checklist-count { flex: none; font-size: var(--fs-note); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.checklist-hide { color: var(--accent-text); }
.checklist .item-lead { background: transparent; }
.check-dot {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid var(--line-strong); background: var(--surface);
}
.checklist .is-done .check-dot { background: var(--grad-accent); border-color: transparent; color: var(--on-accent); }
.checklist .is-done .item-title { color: var(--ink-3); font-weight: 500; }

/* --------------------------------------------------------------- feeling */
.feel-head { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.feel-title { flex: 1 1 auto; min-width: 0; font-family: var(--font); font-size: var(--fs-md); font-weight: 600; line-height: 1.35; letter-spacing: 0; }
.feel-head .term { flex: none; font-size: var(--fs-note); color: var(--ink-3); white-space: nowrap; }
/* Five words across a 320px phone: the padding gives way before the words do. */
.feel-row { gap: 6px; }
.feel-row .chip { min-width: 0; padding: 9px 4px; }
.feel-sheet-row { margin-bottom: var(--sp-3); }

/* ------------------------------------------------------------- the band */
.band-off .item-sub { color: var(--ink-3); }
.energy-detail { display: flex; align-items: flex-start; gap: var(--sp-3); margin-top: var(--sp-3); }
.energy-override { margin-top: 6px; }
.energy-term { margin-top: 6px; font-size: var(--fs-note); color: var(--ink-2); }
.energy-actions { margin-top: var(--sp-3); }
.energy-actions:empty { display: none; }
.energy-error { margin-top: var(--sp-2); }
.energy-meta .small { line-height: 1.4; }

/* At sea: said under the headline, where it is seen before anything else. */
.energy-atsea {
  display: block; margin-top: 6px; padding-left: 10px;
  border-left: 2px solid color-mix(in srgb, var(--seaglass) 55%, transparent);
  font-size: var(--fs-note); line-height: 1.45; color: var(--ink-2);
}

/* "Not a number yet", one calm mark per state (plan W2.1). The dot in the
   summary: dashed only while something is on its way. */
.energy-dot.state-pending { background: transparent; border: 1.5px dashed var(--line-strong); }
.energy-dot.state-unscorable { background: var(--surface); border: 1.5px solid var(--line-strong); }
.energy-dot.state-calibrating { background: var(--line-soft); border: 1.5px solid var(--line-strong); }

/* Where the recovery ring would be: never an empty ring, which reads as 0%. */
.state-disc { flex: none; width: 64px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.state-disc-ring {
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid var(--line-strong); background: var(--surface);
}
.state-disc-word {
  font-size: var(--fs-caption); line-height: 1.25; text-align: center; color: var(--pending-text);
}
.state-disc-mark { display: block; }
.state-disc[data-state="pending"] .state-disc-ring { border-style: dashed; }
.state-disc[data-state="pending"] .state-disc-mark {
  width: 20px; height: 4px;
  background: radial-gradient(circle, var(--line-strong) 1.6px, transparent 2px) 0 0 / 7px 4px repeat-x;
}
.state-disc[data-state="unscorable"] .state-disc-mark { width: 16px; height: 3px; border-radius: 2px; background: var(--line-strong); }
.state-disc[data-state="calibrating"] .state-disc-ring { border-color: transparent; background: var(--line-soft); }
.state-disc[data-state="calibrating"] .state-disc-mark {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); border-right-color: transparent;
}
.state-disc[data-state="unavailable"] .state-disc-ring { border-color: transparent; background: transparent; align-items: end; }
.state-disc[data-state="unavailable"] .state-disc-mark { width: 26px; height: 2px; margin-bottom: 14px; border-radius: 1px; background: var(--line-strong); }

/* The readings: three small tiles, each a door into the day sheet. A
   measured one sits on a seaglass waterline; one that is not a number yet
   takes its state's mark — dashed only while it is on its way. */
.readings {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 76px), 1fr));
  gap: var(--sp-2); margin-top: var(--sp-3);
}
.reading {
  appearance: none; font: inherit; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-width: 0; min-height: 68px; padding: 9px 10px 10px;
  border: 1px solid color-mix(in srgb, var(--seaglass) 30%, transparent); border-radius: var(--r-sm);
  background: linear-gradient(180deg, var(--surface) 0%, color-mix(in srgb, var(--seaglass-wash) 75%, var(--surface)) 100%);
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--seaglass) 45%, transparent);
  color: var(--ink);
  transition: transform var(--dur-1) var(--ease), border-color var(--dur-2) var(--ease);
}
.reading:active { transform: scale(.97); }
.reading:hover { border-color: color-mix(in srgb, var(--seaglass) 60%, transparent); }
.reading:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.reading-glyph { font-size: 1rem; line-height: 1.1; }
.reading-value {
  font-family: var(--font-display); font-size: 1.0625rem; font-weight: 650; line-height: 1.2;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.reading-label { font-size: var(--fs-caption); line-height: 1.3; color: var(--ink-3); }
.reading[data-state="pending"] { border: 1.5px dashed var(--line-strong); background: var(--surface); box-shadow: none; }
.reading[data-state="unscorable"],
.reading[data-state="unavailable"] { border-color: var(--line); background: var(--surface); box-shadow: none; }
.reading[data-state="calibrating"] { border-color: var(--line); background: var(--line-soft); box-shadow: none; }
.reading:not([data-state="measured"]) .reading-value { color: var(--pending-text); }

.energy-state-note { margin-top: var(--sp-2); line-height: 1.5; }
.energy-open-note {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
  margin-top: var(--sp-2); font-size: var(--fs-note); line-height: 1.5; color: var(--ink-3);
}
/* One ship-time tag across the app: its look lives in wearable.css. */
.tag.ship-tag .term { color: inherit; }

/* ----------------------------------------------------------- commitments */
.mission-count { font-weight: 650; font-size: var(--fs-body); margin-bottom: 10px; }
.split-note { margin-bottom: 10px; line-height: 1.5; }
.paused-note { margin-top: var(--sp-1); line-height: 1.5; }
.paused-link { margin: -4px 0 -4px -6px; color: var(--accent-text); vertical-align: middle; }
/* Each paused commitment by name, with when it comes back. */
.paused-list { list-style: none; margin: 0 0 2px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.paused-list li { display: flex; align-items: baseline; gap: 6px; line-height: 1.5; }
.paused-emoji { flex: none; }
.mission-card .empty + .paused-note { margin-top: 0; }

.mission-title .mission-emoji { flex: none; font-size: 1.05rem; line-height: 1; }
.mission-title .mission-name { min-width: 0; }

/* The check: an empty ring that fills, not an emoji that looks like an avatar. */
.mission-check { position: relative; color: var(--ink-2); }
.mission-check:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: 50%; }
.mission.cleared .mission-check { border-style: dashed; color: var(--ink-3); font-size: 1.3rem; }
/* Part-way: the ring fills to the share reached. Calm, never a warning. */
.mission.partial .mission-check { border-color: transparent; }
.check-ring {
  position: absolute; inset: -2px; border-radius: 50%;
  background: conic-gradient(var(--seaglass) calc(var(--p, 0) * 1%), var(--line) 0);
}
.check-ring::after {
  content: ''; position: absolute; inset: 6px; border-radius: 50%;
  background: var(--surface);
}
/* An optimistic row is not "loading": it keeps its full colour. */
.mission[aria-busy="true"] { opacity: 1; cursor: progress; }
.mission-check.pop { animation: today-tick var(--dur-3) var(--ease); }
@keyframes today-tick {
  0% { transform: scale(.82); }
  60% { transform: scale(1.08); }
  100% { transform: none; }
}

/* "Why is this ticked?" — a real row, in readable ink, not a 20px link. */
.mission-source {
  display: flex; align-items: center; gap: var(--sp-2);
  width: 100%; min-height: var(--tap-min); margin-top: var(--sp-2); padding: 6px 6px 6px 10px;
  border: 1px solid color-mix(in srgb, var(--seaglass) 30%, transparent); border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--surface) 65%, transparent);
  color: var(--ink-2); font: inherit; font-size: var(--fs-note); text-align: left; cursor: pointer;
  transition: background var(--dur-1) var(--ease);
}
.mission-source:active { background: var(--surface); }
.mission-source:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.mission-source-icon { flex: none; display: grid; place-items: center; color: var(--accent-text); }
.mission-source .item-chev { color: var(--ink-3); margin-right: 0; }
.mission-auto-note { align-self: center; padding: 0 4px; }
.mission-terms { margin-top: var(--sp-2); font-size: var(--fs-note); line-height: 1.5; color: var(--ink-3); }
.mission-body .hint-callout { margin: var(--sp-2) 0 0; }
.mission-suggest {
  margin-top: var(--sp-2); padding: var(--sp-2) 10px;
  border-radius: var(--r-sm); background: var(--seaglass-wash);
  border: 1px solid color-mix(in srgb, var(--seaglass) 30%, transparent);
}
.mission-suggest .small { margin-bottom: 6px; line-height: 1.45; }

/* "…and why isn't it?" — one quiet line on an open commitment. Solid: dashed
   is kept for "on its way", which is the one case that gets it. */
.mission-why {
  display: flex; align-items: center; gap: var(--sp-2);
  width: 100%; min-height: var(--tap-min); margin-top: var(--sp-2); padding: 6px 6px 6px 10px;
  border: 1px solid var(--line-soft); border-radius: var(--r-sm); background: transparent;
  color: var(--ink-3); font: inherit; font-size: var(--fs-note); line-height: 1.4; text-align: left; cursor: pointer;
}
.mission-why b { color: var(--ink-2); font-weight: 600; }
.mission-why.is-pending { border-style: dashed; border-color: var(--line-strong); }
.mission-why:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.mission-why .item-chev { color: var(--ink-3); margin-right: 0; }

/* "The band filled this in" (W2.7). At rest — and always, under reduced
   motion — this is simply a done row: the check drawn, the source line there.
   The motion lives only in the block below. */
.fill-wake {
  display: none; position: absolute; left: 74px; right: 14px; bottom: 3px; height: 14px;
  pointer-events: none;
}
.fill-wake svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fill-wake-line {
  fill: none; stroke: var(--seaglass); stroke-width: 1.6; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 0; vector-effect: non-scaling-stroke; opacity: .75;
}
.fill-sail { position: absolute; left: 0; right: 0; top: -11px; display: flex; justify-content: flex-end; color: var(--accent-text); }
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-reduce-motion]) .mission.just-filled .mission-check { animation: today-fill-disc var(--dur-3) var(--ease) both; }
  :root:not([data-reduce-motion]) .mission.just-filled .fill-check path {
    stroke-dasharray: 1; animation: today-draw var(--dur-3) var(--ease) 140ms both;
  }
  :root:not([data-reduce-motion]) .mission.just-filled .fill-wake { display: block; animation: today-wake-fade 1.9s linear both; }
  :root:not([data-reduce-motion]) .mission.just-filled .fill-wake-line { animation: today-draw 900ms var(--ease) 220ms both; }
  :root:not([data-reduce-motion]) .mission.just-filled .fill-sail { animation: today-sail 1.2s var(--ease) 220ms both; }
  :root:not([data-reduce-motion]) .mission-source.is-new { animation: today-source-in var(--dur-3) var(--ease) 380ms both; }
}
@keyframes today-fill-disc {
  0% { transform: scale(.72); opacity: .25; }
  65% { transform: scale(1.06); opacity: 1; }
  100% { transform: none; opacity: 1; }
}
@keyframes today-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes today-sail { from { transform: translateX(calc(-100% + 18px)); } to { transform: none; } }
@keyframes today-wake-fade { 0%, 72% { opacity: 1; } 100% { opacity: 0; } }
@keyframes today-source-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* The sheets a row opens. */
.source-card { margin-bottom: var(--sp-3); }

/* "Why this is ticked — and why it isn't." */
.why-list {
  list-style: none; margin: 0 0 var(--sp-3); padding: 0;
  border: 1px solid var(--line-soft); border-radius: var(--r); background: var(--surface-2);
}
.why-row { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; }
.why-row + .why-row { border-top: 1px solid var(--line-soft); }
.why-mark {
  flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; line-height: 1;
}
.is-used .why-mark { background: var(--grad-accent); color: var(--on-accent); }
.is-excluded .why-mark { background: var(--line-soft); color: var(--ink-2); }
.why-row.is-pending .why-mark { background: transparent; border: 1.5px dashed var(--line-strong); }
.why-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.why-label { font-size: var(--fs-body); font-weight: 600; line-height: 1.35; color: var(--ink); }
.why-reason { font-size: var(--fs-note); line-height: 1.45; color: var(--ink-3); }
.why-zones {
  margin: 0 0 var(--sp-3); padding: var(--sp-3);
  border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line-soft);
}
.why-zones > .overline:first-child { margin-top: 0; }
.why-zones-lead { margin-bottom: var(--sp-2); line-height: 1.5; color: var(--ink-2); }
.why-zone-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: var(--fs-note); color: var(--ink-2); }
.why-day { margin-top: var(--sp-2); color: var(--accent-text); }

/* celebrate.js: where a moment came from, when it was not the tap just made. */
.celebrate-from { margin-top: 6px; text-align: center; font-size: var(--fs-note); line-height: 1.5; color: var(--ink-3); }
.source-note { margin-bottom: 14px; line-height: 1.55; }
.source-delete { margin-top: 10px; }
.qty-chips { margin-top: var(--sp-2); }

/* ------------------------------------------------------------- logging */
.today-log { margin-bottom: 14px; }
.today-log .log-main { min-height: var(--tap); margin-bottom: var(--sp-2); }
.today-walks .btn { flex: 1 1 140px; }

/* ------------------------------------------------------- waiting on you */
.wait-note { margin: 0 2px var(--sp-2); line-height: 1.5; }
/* A walk row holds its own answers on a second line: at 375px the question
   and two labelled 44px buttons do not fit side by side. */
.item.wait-walk { flex-wrap: wrap; row-gap: var(--sp-2); padding-top: 12px; padding-bottom: 12px; }
.wait-when { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.wait-answers {
  flex-basis: 100%; display: flex; flex-wrap: wrap; gap: var(--sp-2);
  padding-left: calc(40px + var(--sp-3));
}
.wait-walk.is-answered { opacity: .45; transition: opacity var(--dur-2) var(--ease); }
@media (max-width: 360px) { .wait-answers { padding-left: 0; } }

/* ---------------------------------------------------------- together */
.port-sub { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.port-sub .bar { width: 100%; }
/* The word "port", explained beside the row — it cannot sit inside it, because
   the row is itself a button. */
.port-note { margin: var(--sp-2) 2px 0; line-height: 1.5; }

/* ------------------------------------------------------------- walks.js */
.source-tag .term { color: inherit; }
.walk-custom, .walk-time { margin-top: var(--sp-2); }
.walk-time[hidden] { display: none; }
.walk-count { margin: 0 2px var(--sp-3); line-height: 1.5; }
.walk-route { margin-bottom: var(--sp-2); }
.walk-note { margin-top: var(--sp-3); line-height: 1.5; }
/* Yes / No and the five effort words share the row width, and wrap at 320px. */
.walk-dog .chip { flex: 1 1 88px; justify-content: center; }
.walk-when { margin-bottom: 14px; }
.merge-lead { margin-bottom: 14px; line-height: 1.55; }
.merge-choices { margin-bottom: var(--sp-2); }
/* Walks past the first three, one tap in. */
.wait-more { padding: 0 var(--pad); }
.wait-more > summary { position: relative; }
.item-group > .wait-more::before {
  content: ''; position: absolute; left: var(--pad); right: 0; height: 1px;
  margin-top: -1px; background: var(--line-soft);
}
.item-group > .wait-more { position: relative; }
.wait-more .wait-walk { padding-left: 0; padding-right: 0; border-top: 1px solid var(--line-soft); }
