/* Fast — a quiet, paper-toned discipline log. Light-only by intent. */

:root {
  --bg: #ded7c7;          /* warm greige "desk" — stages the lit input above it */
  --surface: #fffdf9;
  --surface-2: #f2ede2;
  --ink: #23201b;
  --muted: #7c7568;       /* grey ramp re-seated a notch darker for the greige ground */
  --faint: #948d7e;
  --line: #d6cdbb;
  --line-strong: #c9c0ac;
  --accent: #b8543b;
  --accent-ink: #8f3f2c;
  --accent-soft: #f2ddd4;
  --good: #62855a;
  --good-soft: #e2ecdd;
  --drift: #b08a3e;
  --drift-soft: #f0e6cf;
  --radius: 16px;
  --radius-sm: 11px;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shadow: 0 1px 3px rgba(48, 38, 26, 0.08), 0 10px 30px rgba(48, 38, 26, 0.12);
  /* visual tiers: 1 = the input (brightest), 2 = its controls + the reply
     card (terracotta family), 3 = everything else (receded) */
  --tier1-bg: #ffffff;
  --tier2-bg: #fbe9e0;
  --ink-3: #655f54;
  --shadow-hero: 0 3px 8px rgba(42, 33, 22, 0.11), 0 22px 54px rgba(42, 33, 22, 0.20);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100dvh;
  /* subtle stage lighting: a soft halo up where the input sits, gathering to
     a warm shadow at the bottom/corners so the eye is pulled to the box */
  background-image:
    radial-gradient(135% 100% at 50% 16%, rgba(255, 253, 248, 0.55), rgba(255, 253, 248, 0) 46%),
    radial-gradient(160% 130% at 50% 112%, rgba(40, 31, 20, 0.16), rgba(40, 31, 20, 0) 60%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 20px calc(40px + env(safe-area-inset-bottom));
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea {
  font-family: inherit;
  color: inherit;
}

textarea { resize: none; }

::placeholder { color: var(--faint); }

/* ---------- boot / loading ---------- */
.boot {
  min-height: 100dvh;
  display: grid;
  place-items: center;
}
.boot-mark {
  font-family: var(--serif);
  font-size: 34px;
  letter-spacing: 0.02em;
  color: var(--ink);
  opacity: 0.35;
  animation: breathe 2.6s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.55; }
}

/* ---------- generic ---------- */
.serif { font-family: var(--serif); }

.fade-in { animation: fade 0.4s ease both; }
@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  background: var(--ink);
  color: var(--surface);
  transition: transform 0.08s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.block { width: 100%; }
.btn.ghost {
  background: transparent;
  color: var(--muted);
  font-weight: 500;
}
.btn.accent { background: var(--accent); }

/* ---------- sign-in ---------- */
.gate {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  padding: 40px 4px;
}
.gate-mark {
  font-family: var(--serif);
  font-size: clamp(32px, 11vw, 46px);
  line-height: 1;
  letter-spacing: 0.01em;
}
.gate-lead {
  font-size: 18px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 34ch;
}
.gate-lead b { color: var(--ink); font-weight: 600; }
.gate-actions { margin-top: 8px; }

.gbtn {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  box-shadow: var(--shadow);
}
.gbtn svg { width: 18px; height: 18px; }
.gate-note {
  font-size: 13px;
  color: var(--faint);
}
.gate-err {
  font-size: 13.5px;
  color: var(--accent-ink);
}

/* ---------- onboarding ---------- */
.onb {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 34px 0 24px;
}
.onb-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 30px;
}
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background 0.3s ease, width 0.3s ease;
}
.dot.on { background: var(--accent); width: 20px; border-radius: 4px; }
.dot.done { background: var(--accent-soft); }

.onb-body { flex: 1; display: flex; flex-direction: column; }
.onb-eyebrow {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.onb-title {
  font-family: var(--serif);
  font-size: 27px;
  line-height: 1.28;
  margin: 0 0 12px;
  letter-spacing: 0.01em;
}
.onb-sub {
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 22px;
  max-width: 40ch;
}
.field {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 17px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease;
}
.field:focus { outline: none; border-color: var(--accent); }
textarea.field { min-height: 118px; }

.onb-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
}

/* ---------- app shell ---------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 0 18px;
}

/* the composer is the hero — upper third, where thumbs and eyes land and the
   keyboard can't shove it around; history begins at the fold */
.hero {
  padding-top: 4vh;
}
/* TIER 3 — ambient chrome recedes so the input owns the page */
.today-line {
  margin: 2px 3px 18px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--faint);
}
.today-line b { color: var(--ink-3); font-weight: 600; }
.today-line .dot-sep { color: var(--line-strong); margin: 0 4px; }
.top-mark {
  font-family: var(--serif);
  font-size: 25px;
  letter-spacing: 0.01em;
  color: var(--ink-3);
}
.top-menu {
  font-size: 13px;
  color: var(--faint);
  padding: 7px 10px;
  border-radius: 9px;
}
.top-menu:active { background: var(--surface-2); }
.top-actions { display: flex; align-items: center; gap: 4px; }
.eye-btn {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  color: var(--faint);
}
.eye-btn svg { width: 19px; height: 19px; }
.eye-btn:active { background: var(--surface-2); }

/* calorie peek */
.cal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 17px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.cal-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.cal-left { display: flex; align-items: baseline; gap: 7px; }
.cal-num {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cal-left.over .cal-num { color: var(--accent); }
.cal-unit { font-size: 13px; color: var(--muted); }
.cal-meta { font-size: 12.5px; color: var(--faint); }
.cal-edit { font-size: 12.5px; color: var(--accent); text-decoration: underline; }
.cal-bar {
  margin-top: 12px;
  height: 7px;
  border-radius: 4px;
  background: var(--surface-2);
  overflow: hidden;
}
.cal-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--good);
  transition: width 0.4s ease;
}
.cal-fill.over { background: var(--accent); }
.cal-empty {
  display: flex;
  flex-direction: column;
  gap: 13px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}
.cal-empty .btn { align-self: flex-start; }

/* settings */
.settings { padding: 22px 0 40px; }
.set-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 22px;
}
.set-title { font-size: 18px; }
.set-goal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 19px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
  text-align: center;
}
.set-goal-label {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}
.set-goal-num { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.goal-input {
  width: 4.2em;
  border: none;
  border-bottom: 2px solid var(--line-strong);
  background: transparent;
  font-family: var(--serif);
  font-size: 40px;
  text-align: center;
  color: var(--ink);
  padding: 2px 0;
}
.goal-input:focus { outline: none; border-color: var(--accent); }
.set-goal-unit { font-size: 15px; color: var(--muted); }
.set-goal-hint { font-size: 12.5px; color: var(--faint); margin-top: 10px; line-height: 1.5; }

.set-group { margin-bottom: 20px; }
.set-lbl {
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  margin-bottom: 9px;
}
.opts { display: flex; gap: 8px; }
.opts.wrap { flex-wrap: wrap; }
.opt {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  transition: all 0.14s ease;
}
.opts.wrap .opt { flex-basis: calc(50% - 4px); }
.opt.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.opt-hint { font-size: 10.5px; font-weight: 500; opacity: 0.75; }

.set-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.set-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.set-field span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.set-field input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 12px 13px;
  font-size: 16px;
  color: var(--ink);
  box-shadow: var(--shadow);
}
.set-field input:focus { outline: none; border-color: var(--accent); }
.set-note { font-size: 12px; color: var(--faint); line-height: 1.5; margin-top: 6px; }

/* north star */
.north {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 19px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.north-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 9px;
}
.north-goal {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.4;
  margin: 0;
}
.ladder {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px dashed var(--line-strong);
  display: none;
  flex-direction: column;
  gap: 14px;
}
.ladder.open { display: flex; }
.rung-h {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 3px;
}
.rung-t {
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink);
}
.north-toggle {
  margin-top: 13px;
  font-size: 12.5px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.north-toggle .chev { transition: transform 0.2s ease; }
.north-toggle.open .chev { transform: rotate(90deg); }

/* composer */
/* TIER 1 — the input is the focal point of the page */
.composer {
  background: var(--tier1-bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 15px 15px 16px;
  box-shadow: var(--shadow-hero);
  margin-bottom: 26px;
  transition: border-color 0.2s ease;
}
.composer:focus-within { border-color: var(--accent); }
.chips { display: flex; gap: 8px; margin-bottom: 13px; }
.chip {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 6px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.14s ease;
}
.chip.on {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  color: var(--accent-ink);
}
.chip .emoji { font-size: 15px; }

.sub-row {
  display: flex;
  gap: 7px;
  margin-bottom: 12px;
}
.sub-chip {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--line-strong);
  font-size: 13px;
  color: var(--muted);
  background: var(--surface);
}
.sub-chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }

.mood-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}
.mood-row .lbl { font-size: 13px; color: var(--muted); margin-right: 2px; }
.mood {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-size: 15px;
  display: grid;
  place-items: center;
  background: var(--surface);
  filter: grayscale(0.5) opacity(0.55);
  transition: all 0.14s ease;
}
.mood.on { filter: none; border-color: var(--accent); transform: scale(1.12); }

.compose-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 16px;
  line-height: 1.55;
  min-height: 72px;
  padding: 4px 2px 10px;
}
.compose-input:focus { outline: none; }
.compose-input:disabled { opacity: 0.6; }

.compose-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.compose-hint {
  font-size: 12px;
  line-height: 1.5;
  color: var(--faint);
  max-width: 30ch;
}
.spark { color: var(--accent); font-weight: 700; }
.compose-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
}
/* TIER 2 — the input's controls live in the terracotta family */
.mic-btn {
  width: 40px; height: 40px;
  border-radius: 11px;
  border: 1px solid var(--accent-soft);
  background: var(--tier2-bg);
  font-size: 17px;
  display: grid; place-items: center;
  transition: all 0.15s ease;
}
.mic-btn:active { transform: scale(0.95); }
.mic-btn.live {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  animation: pulse 1.3s ease-in-out infinite;
}
.mic-btn.busy { cursor: default; }
/* the shared .spin is tuned for dark buttons; make it visible on the light mic */
.mic-btn .spin {
  border-color: rgba(184, 84, 59, 0.25);
  border-top-color: var(--accent);
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(184, 84, 59, 0.35); }
  50% { box-shadow: 0 0 0 7px rgba(184, 84, 59, 0); }
}
.log-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 22px;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
}
/* Empty state: alive and waiting, never grey/"broken" */
.log-btn:disabled {
  background: transparent;
  color: var(--accent-ink);
  box-shadow: inset 0 0 0 1px var(--accent-soft);
  opacity: 1;
}
.spin {
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 2px solid rgba(255, 253, 249, 0.35);
  border-top-color: var(--surface);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.composer.thinking { border-color: var(--accent-soft); }

.entry-note {
  margin-top: 5px;
  font-size: 13px;
  font-style: italic;
  line-height: 1.45;
  color: var(--accent-ink);
}
.entry-note .spark { font-style: normal; }

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  max-width: 90vw;
  background: var(--ink);
  color: var(--surface);
  font-size: 13.5px;
  line-height: 1.4;
  padding: 11px 17px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 60;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* AI error banner */
.ai-error {
  margin-top: 12px;
  border: 1px solid var(--accent-soft);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  animation: fade 0.3s ease both;
}
.ai-error-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-ink);
  line-height: 1.4;
}
.ai-error-x {
  flex: none;
  font-size: 17px;
  line-height: 1;
  color: var(--accent-ink);
  opacity: 0.6;
  padding: 0 2px;
}
.ai-error-detail {
  margin: 8px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--accent-ink);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  opacity: 0.85;
  max-height: 180px;
  overflow: auto;
}

/* today strip */
.today {
  display: flex;
  gap: 18px;
  padding: 0 3px 18px;
  font-size: 13px;
  color: var(--muted);
}
.today b { color: var(--ink); font-variant-numeric: tabular-nums; }
.today .sep { color: var(--line-strong); }

/* feed */
.day-group { margin-bottom: 26px; }
.day-head {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 3px 12px;
}
.entry {
  display: flex;
  gap: 13px;
  padding: 13px 3px;
  border-bottom: 1px solid var(--line);
}
.entry:last-child { border-bottom: none; }
.entry-ico {
  flex: none;
  width: 30px;
  font-size: 18px;
  text-align: center;
  line-height: 1.4;
}
/* left time rail — icon over the time. Turns the feed from a list into a day. */
.entry-rail {
  flex: none;
  width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.entry-rail .entry-ico { width: auto; }
.entry-time {
  margin-top: 2px;
  font-size: 10.5px;
  line-height: 1.3;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mood-dot { margin-left: 7px; font-size: 13px; }
/* one merged sub-line: quiet macros + the win tag */
.entry-sub {
  margin-top: 5px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 12px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.entry-main { flex: 1; min-width: 0; }
.entry-text {
  font-size: 15px;
  line-height: 1.5;
  word-wrap: break-word;
  color: var(--ink-3); /* tier 3: history recedes behind the input */
}
/* …but inside the tier-2 result card the entry text stays full ink */
.result-card .entry-text { color: var(--ink); }
.entry-meta {
  margin-top: 5px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 12px;
  color: var(--faint);
}
.tag {
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
}
.tag.served { background: var(--good-soft); color: var(--good); }
.tag.drift { background: var(--drift-soft); color: var(--drift); }
.tag.plain { background: var(--surface-2); color: var(--muted); }
/* small, quiet nutrition facts — never the highlight */
.entry-nutri {
  margin-top: 4px;
  font-size: 12px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.entry-del {
  flex: none;
  align-self: center;
  font-size: 15px;
  color: var(--faint);
  padding: 6px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.entry:hover .entry-del,
.entry:focus-within .entry-del { opacity: 1; }

.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.empty .serif { font-size: 19px; color: var(--ink); display: block; margin-bottom: 6px; }
.empty p { font-size: 14px; line-height: 1.6; margin: 0; }

/* menu sheet */
.sheet-scrim {
  position: fixed;
  inset: 0;
  background: rgba(35, 30, 25, 0.28);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 40;
  animation: fade 0.2s ease both;
}
.sheet {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  padding: 12px 16px calc(20px + env(safe-area-inset-bottom));
  animation: rise 0.24s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes rise { from { transform: translateY(100%); } to { transform: none; } }
.sheet-grip {
  width: 38px; height: 4px; border-radius: 2px;
  background: var(--line-strong);
  margin: 4px auto 14px;
}
.sheet-who {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 6px 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.sheet-who img { width: 38px; height: 38px; border-radius: 50%; }
.sheet-who .nm { font-size: 15px; font-weight: 600; }
.sheet-who .em { font-size: 13px; color: var(--muted); }
.sheet-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 8px;
  font-size: 15px;
  border-radius: 10px;
  color: var(--ink);
}
.sheet-item:active { background: var(--surface-2); }
.sheet-item.danger { color: var(--accent-ink); margin-top: 6px; }
.mi-state { float: right; color: var(--muted); font-weight: 400; }
/* grouped menu section labels */
.menu-sec {
  font-size: 10.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 12px 8px 3px;
}
.menu-sec:first-of-type { padding-top: 4px; }

/* desktop / large screens: a centered modal instead of a bottom sheet */
@media (min-width: 620px) and (min-height: 560px) {
  .sheet-scrim { align-items: center; padding: 20px; }
  .sheet {
    border-radius: 20px;
    max-width: 460px;
    max-height: 88vh;
    overflow-y: auto;
    padding-bottom: 20px;
    box-shadow: 0 20px 60px rgba(35, 30, 25, 0.28);
  }
  .sheet-grip { display: none; }
}


/* raw-text toggle active state (shares .eye-btn base) */
.eye-btn.on { color: var(--accent); background: var(--accent-soft); }

/* result spotlight (TIER 2) — appears above the input, settles into the feed */
.result-card {
  background: var(--tier2-bg);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  animation: resultIn 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes resultIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.result-card.leaving {
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.4, 0, 0.6, 1);
  opacity: 0;
  transform: translateY(30px);
}
.result-head {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.result-raw {
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
  margin-bottom: 6px;
  line-height: 1.45;
}
.result-reply {
  font-size: 17.5px;
  line-height: 1.45;
  color: var(--ink);
  margin: 2px 0 10px;
}
.result-head .spin.dark {
  display: inline-block;
  vertical-align: -2px;
  margin-right: 4px;
  border-color: var(--accent-soft);
  border-top-color: var(--accent);
}
.result-card.pending { border-style: dashed; }
.reply-who { font-size: 15px; margin-right: 2px; }

/* reply-voice chip — a quiet setting, NOT a competitor to the Log button.
   Sits left with the mic; only the tinted emoji dot carries the identity. */
.compose-foot { justify-content: space-between; align-items: center; }
.voice-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  transition: transform 0.1s ease, border-color 0.15s ease;
}
.voice-chip:active { transform: scale(0.96); }
.voice-chip:hover { border-color: var(--line-strong); }
.voice-emoji {
  font-size: 13px;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid rgba(60, 50, 35, 0.06);
}
.voice-name { max-width: 11ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* voice picker sheet */
.voice-title { font-size: 18px; text-align: center; margin: 2px 0 16px; }
.voice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  max-height: 60dvh;
  overflow-y: auto;
  padding-bottom: 4px;
}
.voice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-2);
  text-align: center;
  transition: transform 0.1s ease, border-color 0.15s ease;
}
.voice-card:active { transform: scale(0.97); }
.voice-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.voice-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 26px;
  border: 1px solid rgba(60, 50, 35, 0.06);
}
.voice-card-name { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.voice-card-when {
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}
.entry-raw {
  margin-top: 5px;
  font-size: 12.5px;
  font-style: italic;
  color: var(--faint);
  line-height: 1.45;
}

/* collapsed north-star chip (tap to expand) — tier 3, quiet until wanted */
.north-peek {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 22px;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.north-peek .chev { transition: transform 0.2s ease; }
.north-peek:active { background: var(--surface-2); }

/* north card — "now" focus line */
.north-now {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
}
.north-now-h {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  margin-right: 7px;
}

/* north-star setup — clarify questions */
.ns-q {
  display: block;
  margin-bottom: 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.ns-q .field { margin-top: 8px; font-weight: 400; min-height: 0; }

/* north-star setup — plan review */
.ns-plan {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 4px 0 4px;
}
.ns-rung {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  box-shadow: var(--shadow);
}
.ns-rung-h {
  flex: none;
  width: 92px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
}
.ns-rung-in {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
  padding: 2px 0;
}
.ns-rung-in:focus { outline: none; }
.ns-rung:focus-within { border-color: var(--accent); }

/* 2-minute reset — in the FEED it's a quiet link that TRAILS the ✦ line (saves
   a row). Generous padding keeps it thumb-catchable despite being inline. */
.reset-btn {
  display: inline; white-space: nowrap;
  margin: 0; padding: 6px 2px;
  border: none; background: transparent;
  font-size: 12px; font-weight: 700; color: var(--accent);
  opacity: 0.75; font-style: normal;
}
.reset-btn:hover { opacity: 1; text-decoration: underline; }
.reset-btn:active { transform: scale(0.97); }
/* …but on the result card there's only ONE, at the live moment — let it lead. */
.result-card .reset-btn {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 12px;
  padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--accent-soft); background: var(--tier2-bg);
  font-weight: 700; color: var(--accent-ink); opacity: 1;
}
.result-card .reset-btn:hover { text-decoration: none; }
.result-x {
  position: absolute; top: 6px; right: 8px;
  width: 30px; height: 30px; line-height: 1;
  font-size: 19px; color: var(--faint); background: transparent;
}
.result-x:hover { color: var(--muted); }
.result-card { position: relative; }
.result-head { padding-right: 28px; }
.result-card .reset-btn { margin-top: 12px; }

/* 2-minute path sheet */
.path-head {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--serif); font-size: 20px; margin: 2px 3px 16px;
}
.path-face { font-size: 24px; }

/* install help sheet (shown when the browser gives us no install API) */
.install-help { margin: 4px 0 16px; }
.install-help p { font-size: 15px; line-height: 1.5; color: var(--ink-2); margin: 0 0 10px; }
.install-help b { color: var(--ink); font-weight: 600; }
.ih-gl {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-2);
  vertical-align: -5px;
}
.install-note { font-size: 13.5px !important; color: var(--ink-3) !important; margin-bottom: 0 !important; }

/* day close — the morning-after reflection card */
.dayclose {
  position: relative;
  background: var(--tier2-bg);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius);
  padding: 13px 34px 14px 15px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.dayclose-head {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 5px;
}
.dayclose-line {
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
}
.dayclose-line .reply-who { margin-right: 4px; }
.dayclose-x {
  position: absolute;
  top: 8px; right: 8px;
  width: 24px; height: 24px;
  border-radius: 7px;
  color: var(--faint);
  font-size: 17px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.dayclose-x:active { background: rgba(0,0,0,0.05); }

/* north-star 6-week refresh chip */
.nsrefresh {
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  margin-bottom: 12px;
}
.nsrefresh-q { font-size: 14px; color: var(--ink); line-height: 1.4; }
.nsrefresh-q b { color: var(--accent-ink); font-weight: 600; }
.nsrefresh-acts { display: flex; gap: 8px; margin-top: 9px; }
.nsr-btn {
  font-size: 13px;
  padding: 6px 13px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: var(--surface-2);
}
.nsr-btn.edit { border-color: var(--accent-soft); color: var(--accent-ink); background: var(--accent-soft); }
.nsr-btn:active { transform: translateY(1px); }

/* header status glyphs — walker (direction) · rope (effort) · bowl (fuel) */
.top-actions { gap: 2px; }
.glyph-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 1px;
  padding: 1px 3px;
  border-radius: 9px;
}
.glyph-btn:active { background: var(--surface-2); }
.glyph-svg { display: block; overflow: visible; }
.glyph-svg.walk { width: 31px; height: 34px; }
.glyph-svg.rope { width: 22px; height: 37px; }
.glyph-svg.bowl { width: 30px; height: 24px; }
.glyph-svg.walk.lg { width: 66px; height: 76px; }
.glyph-svg.rope.lg { width: 44px; height: 76px; }
.glyph-svg.bowl.lg { width: 66px; height: 54px; }
.glyph-n {
  font-size: 9px;
  line-height: 1;
  color: var(--faint);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
/* figure parts (light-only app, so straight palette colors) */
.g-ln { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.g-ground { stroke: var(--line-strong); stroke-width: 1.5; stroke-linecap: round; }
.g-rope { fill: none; stroke: var(--line-strong); stroke-width: 2; stroke-linecap: round; }
.g-star { fill: var(--accent); stroke: none; }
.g-trail { fill: var(--accent); opacity: 0; }
.g-bowl { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.g-fill { fill: var(--accent); stroke: none; opacity: 0.32; }
.g-fillfull { fill: var(--accent); stroke: none; opacity: 0.85; }
.g-steam { fill: none; stroke: var(--faint); stroke-width: 1.5; stroke-linecap: round; opacity: 0; }
.g-stem { fill: none; stroke: var(--good); stroke-width: 2; stroke-linecap: round; }
.g-leaf { fill: var(--good); stroke: none; }

/* gentle, always-on life — but honor a reader's reduce-motion setting */
.a-tw, .a-bob, .a-legA, .a-legB, .a-wander, .a-sway, .a-hop, .a-steam, .a-trail, .a-leaf { transform-box: fill-box; }
@media (prefers-reduced-motion: no-preference) {
  .a-tw { transform-origin: center; animation: g-tw 2.6s ease-in-out infinite; }
  .a-bob { animation: g-bob 0.5s ease-in-out infinite; }
  .a-legA { animation: g-blink 0.5s steps(1, end) infinite; }
  .a-legB { animation: g-blink 0.5s steps(1, end) infinite; animation-delay: -0.25s; }
  .a-wander { transform-origin: 50% 100%; animation: g-wander 2.4s ease-in-out infinite; }
  .a-sway { transform-origin: 50% 0; animation: g-sway 3.1s ease-in-out infinite; }
  .a-hop { animation: g-hop 1.25s ease-in-out infinite; }
  .a-steam { animation: g-steam 2.3s ease-in-out infinite; }
  .a-trail { animation: g-trail 1.9s linear infinite; }
  .a-leaf { transform-origin: 50% 100%; animation: g-sway 3.6s ease-in-out infinite; }
}
@keyframes g-tw { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.72); } }
@keyframes g-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-1.4px); } }
@keyframes g-blink { 0%,49.9% { opacity: 1; } 50%,100% { opacity: 0; } }
@keyframes g-wander { 0%,100% { transform: rotate(-16deg); } 50% { transform: rotate(15deg); } }
@keyframes g-sway { 0%,100% { transform: rotate(-4.5deg); } 50% { transform: rotate(4.5deg); } }
@keyframes g-hop { 0%,100% { transform: translateY(0); } 35% { transform: translateY(-6px); } 70% { transform: translateY(0); } }
@keyframes g-steam { 0% { opacity: 0; transform: translateY(3px); } 30% { opacity: 0.7; } 100% { opacity: 0; transform: translateY(-10px); } }
@keyframes g-trail { 0% { opacity: 0; transform: translate(7px,-7px); } 25% { opacity: 0.6; } 100% { opacity: 0; transform: translate(-11px,11px); } }

.climb-hero { display: flex; align-items: center; gap: 14px; margin: 2px 0 4px; }

/* goal sheet — the "where you are" dashboard: star + 3 living instruments */
.goal-sheet .goal-eyebrow {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 2px 0 6px;
}
.goal-sheet .goal-eyebrow.mt { margin-top: 18px; }
.goal-vision { font-size: 20px; line-height: 1.36; color: var(--ink); margin: 0 0 12px; }
.goal-horizons { margin-bottom: 2px; }
.goal-rung { font-size: 14px; color: var(--ink); padding: 7px 0; border-top: 1px solid var(--line); }
.goal-rung span { display: inline-block; min-width: 104px; color: var(--muted); font-size: 12px; }
.goal-row { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); }
.goal-row:last-child { border-bottom: 1px solid var(--line); }
.goal-ico { flex: 0 0 52px; height: 52px; display: flex; align-items: center; justify-content: center; }
.goal-ico svg { display: block; overflow: visible; }
.goal-ico svg.walk { height: 48px; width: auto; }
.goal-ico svg.rope { height: 52px; width: auto; }
.goal-ico svg.bowl { height: 34px; width: auto; }
.goal-rtext { flex: 1; min-width: 0; }
.goal-line { font-size: 16px; color: var(--ink); font-weight: 500; }
.goal-dim { font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); margin-right: 8px; }
.goal-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.goal-bar { height: 4px; border-radius: 4px; background: var(--surface-2); margin-top: 8px; overflow: hidden; max-width: 220px; }
.goal-bar-fill { height: 100%; background: var(--accent); border-radius: 4px; }
.goal-bar-fill.over { background: var(--drift); }
.climb-pose { font-size: 15px; color: var(--ink); text-transform: capitalize; }
.climb-pose.plain { text-transform: none; }
.climb-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.climb-vision { font-size: 19px; color: var(--ink); line-height: 1.35; margin: 12px 0 10px; }
.climb-rung { font-size: 14px; color: var(--ink); padding: 8px 0; border-top: 1px solid var(--line); }
.climb-rung span { display: inline-block; min-width: 98px; color: var(--muted); font-size: 12px; }

/* locked composer — the paywall stand-in where the input would be */
.composer.locked {
  text-align: center;
  padding: 22px 20px;
}
.lock-title { font-size: 20px; color: var(--ink); margin-bottom: 6px; }
.lock-sub { font-size: 14px; line-height: 1.5; color: var(--muted); margin: 0 auto 16px; max-width: 34ch; }

/* paywall sheet */
.pay-title { font-size: 22px; color: var(--ink); margin: 2px 0 6px; }
.pay-sub { font-size: 14px; line-height: 1.5; color: var(--muted); margin-bottom: 16px; }
.plan-grid { display: flex; flex-direction: column; gap: 10px; }
.plan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
}
.plan:active { transform: translateY(1px); }
.plan.featured { border-color: var(--accent); background: var(--accent-soft); }
.plan-l { display: flex; flex-direction: column; gap: 2px; }
.plan-name { font-size: 16px; font-weight: 600; color: var(--ink); }
.plan-note { font-size: 12px; color: var(--accent-ink); }
.plan-price { font-size: 17px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.plan-per { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 2px; }
.pay-fine { font-size: 12px; color: var(--faint); text-align: center; margin-top: 14px; line-height: 1.5; }
.pay-fine a { color: var(--muted); text-decoration: underline; }
.sheet-legal { text-align: center; margin-top: 14px; font-size: 12px; color: var(--faint); }
.sheet-legal a { color: var(--muted); text-decoration: underline; margin: 0 4px; }

/* payment-success banner — slides down from the top, then auto-hides */
.success-banner {
  position: fixed;
  top: 0; left: 50%;
  transform: translate(-50%, -130%);
  background: var(--accent);
  color: #fff;
  padding: 12px 22px;
  border-radius: 0 0 16px 16px;
  font-size: 14.5px;
  font-weight: 500;
  z-index: 60;
  box-shadow: 0 10px 30px rgba(42, 33, 22, 0.28);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  max-width: 92vw;
  text-align: center;
}
.success-banner.show { transform: translate(-50%, 0); }

/* member badge in the menu + contact-form field spacing */
.member-badge {
  margin-left: auto;
  align-self: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.sheet .field { margin-bottom: 10px; }
.sheet textarea.field { min-height: 96px; }
.path-loading {
  display: flex; align-items: center; gap: 9px;
  color: var(--muted); font-size: 14.5px; padding: 8px 4px 24px;
}
.path-intro { font-size: 15px; color: var(--ink-3); margin: 0 3px 14px; line-height: 1.55; }
.path-steps { list-style: none; display: grid; gap: 11px; margin: 0 0 16px; padding: 0; }
.path-steps label {
  display: flex; align-items: flex-start; gap: 11px;
  font-size: 15.5px; line-height: 1.45; cursor: pointer; color: var(--ink);
}
.path-steps input { margin-top: 2px; width: 19px; height: 19px; accent-color: var(--accent); flex: none; }
.path-steps li.done span { color: var(--faint); text-decoration: line-through; }
.path-close { font-size: 16px; color: var(--ink); font-style: italic; margin: 0 3px 18px; line-height: 1.5; }
.path-done { width: 100%; }
