/* Aleli brand palette: Sheer (#f8eacc), Copper Cutie (#ad643b), Humid Green (#5b5424),
   Sun Butter (#ebb530) and Lavender Frosting (#b9b0d7). */
:root {
  --canvas: #f8eacc;   /* Sheer: page background */
  --bubble: #fdf6e6;   /* lighter Sheer for cards and the composer */
  --chip: #efdcb4;     /* deeper Sheer for chips and attachments */
  --ink: #5b5424;      /* Humid Green: primary text and filled buttons */
  --clay: #ad643b;     /* Copper Cutie: display type and decoration */
  --clay-deep: #8e4d2a;/* deeper copper that stays readable at small sizes */
  --tan: #7a6c45;      /* muted olive for secondary text and labels */
  --sun: #ebb530;      /* Sun Butter: small highlights */
  --lavender: #b9b0d7; /* Lavender Frosting */
  --lavender-soft: #e4dff0;
  --green: #5b5424;
  --match: #5b5424;          /* matches are Humid Green */
  --match-soft: #e3dfb8;
  --match-ink: #4a441c;
  --mismatch: #ad643b;       /* mismatches are Copper Cutie */
  --mismatch-soft: #f1d3bd;
  --mismatch-ink: #8a4723;
  --hairline: rgb(91 84 36 / 0.16);
  --recording: #b8452f;
  --shadow: 91 70 36;
  --scrim: rgb(45 38 14 / 0.3);

  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --content-width: 640px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #1d1a0e;
    --bubble: #2a2615;
    --chip: #38321b;
    --ink: #f8eacc;
    --clay: #d9875a;
    --clay-deep: #e8a47c;
    --tan: #c2b48c;
    --sun: #ebb530;
    --lavender: #b9b0d7;
    --lavender-soft: #3b3650;
    --green: #c9c27a;
    --match: #a39b4e;
    --match-soft: #3d3a1c;
    --match-ink: #d8d18c;
    --mismatch: #c9774a;
    --mismatch-soft: #4a2c1b;
    --mismatch-ink: #f0b38d;
    --hairline: rgb(248 234 204 / 0.13);
    --recording: #e07a64;
    --shadow: 0 0 0;
    --scrim: rgb(0 0 0 / 0.5);
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body { min-height: 100dvh; }

html.locked, html.locked body { overflow: hidden; }

[hidden] { display: none !important; }

h1, h2, p { margin: 0; font-weight: 400; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

button:focus-visible, a:focus-visible {
  outline: 2px solid var(--clay-deep);
  outline-offset: 3px;
}

svg { display: block; width: 100%; height: 100%; }

/* ---------- Shared pieces ---------- */

/* Small, letter-spaced uppercase label, like Aleli's navigation and taglines. */
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--tan);
}
.eyebrow.ink { color: var(--ink); }
.eyebrow.clay-deep { color: var(--clay-deep); }

.eyebrow-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.eyebrow-icon > span { width: 13px; height: 13px; }

/* Aleli's brush-stroke divider: a thin line that tapers to points at both ends. */
.tapered-rule {
  display: block;
  width: var(--w, 200px);
  height: 4px;
  background: var(--clay);
  clip-path: polygon(0 50%, 50% 0, 100% 50%, 50% 100%);
}

.top-bar {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  text-align: center;
}

.bar-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--ink);
}
.bar-button svg { width: 22px; height: 22px; }

.pill-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--canvas);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  box-shadow: 0 5px 12px rgb(var(--shadow) / 0.2);
  transition: transform 0.15s var(--ease), opacity 0.15s;
}
.pill-button:active { transform: scale(0.96); }
.pill-button.large { width: 240px; height: 56px; letter-spacing: 1.6px; box-shadow: none; }

.circle-button {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  transition: transform 0.15s var(--ease);
}
.circle-button:active { transform: scale(0.92); }
.circle-button svg { width: 18px; height: 18px; }
.circle-button.filled { background: var(--ink); color: var(--canvas); }
.circle-button.filled svg { width: 15px; height: 15px; }

.floating-card {
  background: var(--bubble);
  border: 1px solid var(--hairline);
  box-shadow: 0 8px 18px rgb(var(--shadow) / 0.08);
}

/* ---------- Home ---------- */

.home {
  max-width: var(--content-width);
  margin: 0 auto;
  min-height: 100dvh;
}

.home > .top-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding-top: var(--safe-top);
  min-height: calc(44px + var(--safe-top));
  background: var(--canvas);
}
.account-button { grid-column: 3; }
.brand-logo { grid-column: 2; justify-self: center; display: block; }
.brand-logo img { display: block; height: 32px; width: auto; margin-top: 6px; }

.home-content {
  padding: 24px 20px calc(40px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.journey { display: flex; flex-direction: column; gap: 14px; }
.journey-label { color: var(--green); }
.journey-week { font: 27px/1.18 var(--serif); color: var(--clay); letter-spacing: 0.2px; }
.welcome { font: 22px/1.3 var(--serif); color: var(--ink); margin-top: 6px; }
.journey-intro { font: 18px/1.45 var(--serif); color: var(--tan); }

.install-card {
  padding: 16px 16px 16px 18px;
  border-radius: 16px;
  background: var(--bubble);
  border: 1.5px solid var(--clay);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
}
.install-card p { font: 17px/1.4 var(--serif); color: var(--ink); grid-column: 1; }
.install-card .inline-icon { display: inline-block; width: 17px; height: 17px; vertical-align: -3px; color: var(--clay-deep); }
.install-card .dismiss { grid-column: 2; grid-row: 1; width: 28px; height: 28px; margin: -6px -6px 0 0; color: var(--tan); display: grid; place-items: center; }
.install-card .dismiss svg { width: 13px; height: 13px; }
.install-card .pill-button { grid-column: 1 / -1; justify-self: start; height: 40px; padding: 0 18px; font-size: 12px; box-shadow: none; margin-top: 4px; }

.actions { display: flex; flex-direction: column; gap: 12px; }
.actions > .eyebrow { margin-bottom: 2px; }

/* The three big choices. Each has a colored mark: green for a match, copper for a mismatch. */
.action-card {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 80px;
  padding: 16px 12px 16px 15px;
  border-radius: 22px;
  background: var(--bubble);
  text-align: left;
  box-shadow: inset 0 0 0 1px var(--hairline), 0 6px 16px rgb(var(--shadow) / 0.07);
  transition: transform 0.18s var(--ease);
}
.action-card:active { transform: scale(0.98); }
.action-mark {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.action-card.match .action-mark { background: var(--match); box-shadow: inset 0 0 0 6px var(--match-soft); }
.action-card.mismatch .action-mark { background: var(--mismatch); box-shadow: inset 0 0 0 6px var(--mismatch-soft); }
.action-card.explore .action-mark { background: var(--lavender-soft); color: var(--ink); }
.action-card.explore .action-mark svg { width: 20px; height: 20px; }
.action-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.action-text strong { font: 400 21px/1.2 var(--serif); color: var(--ink); }
/* One line each: the longest ("A moment you and your child connected") fits at 13px from about
   375px wide, and shrinks a little on narrower phones instead of wrapping. */
.action-text small {
  font-size: clamp(12px, 3.5vw, 13px);
  line-height: 1.35;
  color: var(--tan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* The journal's counts grow over time, so that one may wrap. */
.action-card.explore .action-text small { white-space: normal; }

.home-footer { text-align: center; margin-top: 8px; }
.home-footer a { font-size: 13px; color: var(--tan); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- My journal ---------- */

.journal {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 14;
  top: var(--vv-top, 0px);
  height: var(--vv-height, 100dvh);
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  transform: translateX(100%);
  transition: transform 0.38s var(--ease);
}
.journal.open { transform: none; }
.journal > .top-bar { padding-top: var(--safe-top); min-height: calc(44px + var(--safe-top)); }

.journal-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 8px 20px calc(40px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chips button {
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}
.filter-chips button[aria-checked="true"] { background: var(--ink); color: var(--canvas); }

.kind-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  white-space: nowrap;
}
.kind-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.kind-badge.match { background: var(--match-soft); color: var(--match-ink); }
.kind-badge.mismatch { background: var(--mismatch-soft); color: var(--mismatch-ink); }
.kind-badge:empty { display: none; }

.history { display: flex; flex-direction: column; gap: 24px; }
.empty-state { padding: 24px 4px; display: flex; flex-direction: column; gap: 8px; }
.empty-state p { font: 17px/1.45 var(--serif); color: var(--tan); }
.empty-state p:first-child { font-size: 22px; color: var(--ink); }
.day-group { display: flex; flex-direction: column; }
.day-group > .eyebrow { margin-bottom: 4px; }

.history-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 16px 0;
  text-align: left;
}
.history-row + .history-row { border-top: 1px solid var(--hairline); }
.history-row:active { opacity: 0.6; }
.history-row .meta { display: flex; align-items: center; gap: 10px; }
.history-row .meta .duration { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; }
.history-row .meta .duration span { width: 13px; height: 13px; }
.history-row .row-title { font: 20px/1.25 var(--serif); color: var(--ink); }
.history-row .row-text {
  font: 16px/1.4 var(--serif);
  color: var(--tan);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-line;
}
.history-row .row-text.placeholder { font-style: italic; }

/* ---------- Voice clips & waveforms ---------- */

.voice-clip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  max-width: 100%;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  background: var(--chip);
}
.voice-clip .play {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--canvas);
}
.voice-clip .play svg { width: 13px; height: 13px; }
.voice-clip .time { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--tan); min-width: 30px; }
.voice-clip .remove { width: 26px; height: 26px; margin-left: -4px; display: grid; place-items: center; color: var(--tan); }
.voice-clip .remove svg { width: 11px; height: 11px; }

.waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 22px;
  width: 180px;
  min-width: 110px;
  flex-shrink: 1;
}
.waveform i {
  flex: 1;
  min-height: 3px;
  border-radius: 2px;
  background: var(--tan);
  opacity: 0.4;
}
.waveform i.played { background: var(--clay-deep); opacity: 1; }

/* ---------- Sheets and pushed screens ---------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--scrim);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
.sheet-backdrop.visible { opacity: 1; }

.editor, .detail {
  position: fixed;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
}

.editor {
  --gap: calc(var(--safe-top) + 10px);
  z-index: 21;
  top: calc(var(--vv-top, 0px) + var(--gap));
  height: calc(var(--vv-height, 100dvh) - var(--gap));
  max-width: var(--content-width);
  margin: 0 auto;
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -4px 30px rgb(var(--shadow) / 0.12);
  transform: translateY(105%);
  transition: transform 0.42s var(--ease);
}
.editor.open { transform: none; }
.editor > .top-bar { min-height: 52px; }
.editor > .top-bar .eyebrow { grid-column: 2; }

.editor-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 8px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.editor-question { font: 28px/1.2 var(--serif); color: var(--clay); }
.editor[data-kind="match"] #editor-title { color: var(--match-ink); }
.editor[data-kind="mismatch"] #editor-title { color: var(--mismatch-ink); }

/* "Type it" and "Record a voice memo" sit side by side, each a tall card. */
.capture-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.choice-label { grid-column: 1 / -1; font: 18px/1.4 var(--serif); color: var(--tan); }
.choice-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  min-height: 168px;
  padding: 18px 16px;
  border-radius: 20px;
  background: var(--bubble);
  text-align: left;
  box-shadow: inset 0 0 0 1px var(--hairline), 0 6px 16px rgb(var(--shadow) / 0.07);
  transition: transform 0.18s var(--ease);
}
.choice-card:active { transform: scale(0.98); }
.choice-icon {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--canvas);
}
.choice-icon svg { width: 21px; height: 21px; }
.choice-card > span:last-child { display: flex; flex-direction: column; gap: 4px; }
.choice-card strong { font: 400 20px/1.2 var(--serif); color: var(--ink); }
.choice-card small { font-size: 13px; line-height: 1.35; color: var(--tan); }

.save-button { height: 52px; padding: 0 26px; letter-spacing: 1.2px; }

.accessory-row.transcribing { justify-content: center; gap: 12px; min-height: 52px; font: 17px var(--serif); color: var(--tan); }
.spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid var(--hairline);
  border-top-color: var(--clay);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.editor-scroll .tapered-rule { margin-bottom: 4px; }

.editor-text, .detail-text {
  display: block;
  width: 100%;
  border: 0;
  outline: 0;
  padding: 0;
  background: none;
  resize: none;
  overflow: hidden;
  color: var(--ink);
  caret-color: var(--clay-deep);
  -webkit-user-select: text;
  user-select: text;
}
.editor-text { font: 19px/1.55 var(--serif); min-height: 240px; flex: 1 0 auto; }
.editor-text::placeholder, .detail-text::placeholder { color: var(--tan); opacity: 0.7; }
.editor-text[readonly] { caret-color: transparent; }

.accessory-bar {
  flex: none;
  padding: 8px 16px calc(10px + var(--safe-bottom));
}
.keyboard-open .accessory-bar { padding-bottom: 10px; }

.accessory-row { display: flex; align-items: center; gap: 10px; }
.accessory-row .spacer { flex: 1; }

.floating-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bubble);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--hairline), 0 5px 12px rgb(var(--shadow) / 0.1);
  transition: transform 0.15s var(--ease);
}
.floating-icon:active { transform: scale(0.93); }
.floating-icon.prominent { background: var(--ink); color: var(--canvas); box-shadow: 0 5px 12px rgb(var(--shadow) / 0.2); }
.floating-icon svg { width: 20px; height: 20px; }

.capture-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 999px;
  background: var(--bubble);
  box-shadow: inset 0 0 0 1px var(--hairline), 0 6px 14px rgb(var(--shadow) / 0.12);
  animation: rise 0.28s var(--ease);
}
.capture-strip canvas { flex: 1; min-width: 0; height: 24px; }
.capture-strip .rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--recording);
  animation: pulse 1.4s ease-in-out infinite;
}
.capture-strip .elapsed { font-size: 15px; font-variant-numeric: tabular-nums; color: var(--ink); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes pulse { 50% { opacity: 0.25; } }

.detail {
  z-index: 15;
  top: var(--vv-top, 0px);
  height: var(--vv-height, 100dvh);
  transform: translateX(100%);
  transition: transform 0.38s var(--ease);
}
.detail.open { transform: none; }
.detail > .top-bar { padding-top: var(--safe-top); min-height: calc(44px + var(--safe-top)); }

.detail-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 20px 20px calc(40px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.detail-scroll:empty { display: none; }
#detail-prompt:empty, #detail-clip:empty, #editor-clip:empty { display: none; }
#detail-prompt { display: flex; flex-direction: column; gap: 18px; }
.detail-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-title { font: 30px/1.18 var(--serif); color: var(--clay); }
.detail-old-prompt { font: 17px/1.35 var(--serif); color: var(--clay-deep); }
.detail-text { font: 17px/1.5 var(--serif); min-height: 120px; }

/* ---------- Onboarding ---------- */

.onboarding {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--safe-top) 0 var(--safe-bottom);
  background: var(--canvas);
}

.onboarding-pages {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.onboarding-pages::-webkit-scrollbar { display: none; }

.onboarding-page {
  flex: 0 0 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding-top: 36px;
}
.onboarding-page h1 {
  font: 40px/1.02 var(--serif);
  color: var(--clay);
  text-align: center;
  padding: 0 24px;
  white-space: pre-line;
}

.illustration { position: relative; flex: 1; min-height: 0; width: 100%; }
.illo-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 320px;
  height: 360px;
  transform: translate(-50%, -50%) scale(var(--illo-scale, 1));
}
/* Elements are centered in the stage, then offset like the SwiftUI ZStack. */
.illo-stage > * {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) translate(var(--x, 0px), var(--y, 0px));
}

/* Arched paper frame, like the arches Aleli puts its photos in. Fades out at the bottom. */
.mock-arch {
  width: 236px;
  height: 340px;
  border-radius: 118px 118px 0 0;
  background: var(--chip);
  box-shadow: inset 0 0 0 1.5px rgb(212 155 114 / 0.6);
  padding: 64px 26px 0;
  -webkit-mask-image: linear-gradient(#000 72%, transparent);
  mask-image: linear-gradient(#000 72%, transparent);
  font-family: var(--serif);
}
.mock-arch .q { font-size: 14px; line-height: 1.3; color: var(--clay-deep); margin-bottom: 12px; }
.mock-arch .a {
  margin-left: 28px;
  padding: 10px;
  border-radius: 14px;
  background: var(--bubble);
  font-size: 13px;
  line-height: 1.3;
  color: var(--ink);
}
.mock-arch .faded { font-size: 14px; line-height: 1.35; color: var(--tan); }
.mock-arch .lines { display: flex; flex-direction: column; gap: 10px; padding-top: 150px; }
.mock-arch .lines i { display: block; height: 10px; border-radius: 5px; background: var(--bubble); }

.go-deeper-card {
  width: 236px;
  padding: 16px;
  border-radius: 14px;
  background: var(--bubble);
  box-shadow: inset 0 0 0 1.5px var(--clay), 0 8px 18px rgb(var(--shadow) / 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}
.go-deeper-card p { font: 17px/1.35 var(--serif); color: var(--ink); }
.go-deeper-card .kind-badge { align-self: flex-start; }

.illo-badge {
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--clay);
}
.illo-badge svg { width: 26px; height: 26px; }

.illo-clip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  border-radius: 23px;
}
.illo-clip .play { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--canvas); }
.illo-clip .play svg { width: 11px; height: 11px; }
.illo-clip .waveform { width: 120px; min-width: 0; height: 20px; }
.illo-clip .time { font-size: 13px; color: var(--tan); font-variant-numeric: tabular-nums; }

.illo-composer {
  width: 284px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 14px;
  border-radius: 22px;
  color: var(--ink);
}
.illo-composer > span:not(.send) { width: 17px; height: 17px; flex: none; }
.illo-composer .label { flex: 1; font: 15px var(--serif); color: var(--tan); }
.illo-composer .send { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--canvas); }
.illo-composer .send svg { width: 15px; height: 15px; }

.illo-entry {
  width: 270px;
  display: flex;
  gap: 14px;
  padding: 14px;
  border-radius: 24px;
  text-align: left;
}
.illo-entry .date {
  flex: none;
  width: 52px;
  height: 56px;
  border-radius: 12px;
  background: var(--chip);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.illo-entry .date small { font-size: 10px; font-weight: 600; letter-spacing: 1.5px; color: var(--tan); }
.illo-entry .date b { font: 400 22px/1.1 var(--serif); color: var(--clay); }
.illo-entry p { font: 13px/1.3 var(--serif); color: var(--ink); filter: blur(4px); margin-bottom: 8px; }
.illo-entry .tags { display: flex; gap: 6px; }
.illo-entry .tags span {
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 1.2px;
  color: var(--tan);
  padding: 4px 7px;
  border-radius: 8px;
}

.illo-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 22px;
  font: 15px var(--serif);
  color: var(--ink);
  white-space: nowrap;
}
.illo-pill span { width: 17px; height: 17px; }

.page-dots { display: flex; gap: 10px; margin-top: 8px; }
.page-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--clay); opacity: 0.3; transition: opacity 0.25s; }
.page-dots i.current { opacity: 1; }

.onboarding-subtitle {
  font: 20px/1.35 var(--serif);
  color: var(--tan);
  text-align: center;
  max-width: 420px;
  height: 84px;
  padding: 0 36px;
  margin-top: 20px;
  animation: fade 0.25s ease;
}
.onboarding .pill-button { margin: 12px 0 20px; }

@keyframes fade { from { opacity: 0; } }

/* ---------- Dialogs ---------- */

.dialog-layer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 10px 10px calc(10px + var(--safe-bottom));
  background: var(--scrim);
  animation: fade 0.2s ease;
}
.dialog-layer.alert { justify-content: center; }

.action-sheet {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: rise 0.3s var(--ease);
}
.sheet-group {
  border-radius: 14px;
  overflow: hidden;
  background: var(--bubble);
}
.sheet-header {
  padding: 14px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sheet-header strong { font-size: 13px; font-weight: 600; color: var(--tan); }
.sheet-header span { font-size: 13px; color: var(--tan); }
.sheet-group button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  font-size: 19px;
  color: var(--ink);
  border-top: 1px solid var(--hairline);
}
.sheet-group > button:first-child { border-top: 0; }
.sheet-group button span { width: 19px; height: 19px; }
.sheet-group button.destructive { color: var(--recording); }
.sheet-group button.cancel { font-weight: 600; }
.sheet-group button:active { background: var(--chip); }

.alert-box {
  width: 280px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bubble);
  text-align: center;
  animation: pop 0.25s var(--ease);
}
.alert-box .alert-body { padding: 20px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.alert-box strong { font-size: 17px; font-weight: 600; }
.alert-box span { font-size: 14px; line-height: 1.35; color: var(--tan); }
.alert-box button {
  width: 100%;
  min-height: 46px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  border-top: 1px solid var(--hairline);
}
.alert-box button:active { background: var(--chip); }

@keyframes pop { from { opacity: 0; transform: scale(1.08); } }

.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: calc(90px + var(--safe-bottom));
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--canvas);
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s, transform 0.25s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
