/* masa capture — mirrors site tokens (site/assets/css/tokens.css) */
:root{
  --bg:#EFE9DE;--surface:#E6E0D2;--sunk:#E0D9C8;--line:#D6CFBE;--ink:#22342E;
  --ink-soft:#5C6B62;--terra:#D8663F;--cta:#BE5330;--cta-h:#A8441F;--amber:#E0A24C;
  --teal:#4E6B60;--linen:#F3EDE0;--r-md:12px;--r-lg:16px;--gap:16px;--lh-body:1.6;
}
*{box-sizing:border-box}
body{
  margin:0;background:var(--bg);color:var(--ink);line-height:var(--lh-body);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
}
.app{max-width:520px;margin:0 auto;padding:20px var(--gap) 40px;display:grid;gap:var(--gap)}
.brand{text-align:center;padding-top:8px}
.brand-mark{
  display:inline-block;font-weight:800;letter-spacing:.02em;color:var(--linen);
  background:var(--terra);border-radius:var(--r-md);padding:2px 12px;font-size:1.1rem;
}
h1{font-size:1.5rem;margin:.5em 0 .2em}
.sub{color:var(--ink-soft);margin:0}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);padding:var(--gap)}
.card-primary{border:2px solid var(--teal);background:var(--linen)}
.card-primary[hidden]{display:none}
.card-primary .btn-send{display:block;text-align:center;text-decoration:none}
h2{font-size:1.05rem;margin:0 0 .35em}
.h-ic{vertical-align:-3px;color:var(--terra);fill:currentColor;margin-right:2px}
.hint{color:var(--ink-soft);font-size:.9rem;margin:0 0 12px}

.btn{
  font:inherit;font-weight:700;border:none;border-radius:var(--r-md);
  padding:12px 18px;cursor:pointer;color:var(--linen);background:var(--teal);
}
.btn:focus-visible{outline:3px solid var(--cta);outline-offset:2px}
.btn[disabled]{opacity:.45;cursor:not-allowed}
.btn-ghost{background:transparent;color:var(--ink);border:1px solid var(--line)}

/* masa's motion signature = the lab's spring-overshoot curve (mascot.html) —
   used on character moments (morphs); plain ease stays on simple fades */
:root{--spring:cubic-bezier(.34,1.38,.5,1);--accent:var(--terra)}

/* client greeting — their name on their link (accent colors the chip border +
   waveform bars; masa keeps the chrome, mascot, and CTAs) */
.client-chip{
  display:inline-block;margin:10px 0 0;padding:4px 14px;font-weight:700;font-size:.9rem;
  color:var(--ink);background:var(--linen);border:2px solid var(--accent);border-radius:999px;
}
.client-chip[hidden]{display:none}

.rec-row{display:flex;align-items:center;gap:12px}
.btn-rec{
  background:var(--cta);display:inline-flex;align-items:center;gap:10px;
  flex:none;max-width:280px;overflow:hidden;white-space:nowrap;
  transition:max-width .32s var(--spring),border-radius .32s var(--spring),background .2s ease,padding .32s var(--spring);
}
.btn-rec:hover{background:var(--cta-h)}
.rec-dot{width:12px;height:12px;border-radius:50%;background:var(--linen);flex:none}
.rec-stop{display:none;fill:var(--linen);flex:none}
/* recording: the pill COLLAPSES into the mascot — dough shape, terracotta, eyes
   fused into a stop square — and the live wave slides out beside it (same row) */
.btn-rec[aria-pressed="true"]{
  background:var(--terra);max-width:46px;width:46px;height:44px;padding:0;
  justify-content:center;border-radius:62% 38% 55% 45% / 58% 52% 48% 42%;
}
.btn-rec[aria-pressed="true"]:hover{background:var(--cta)}
.btn-rec[aria-pressed="true"] .rec-dot,
.btn-rec[aria-pressed="true"] #rec-label{display:none}
.btn-rec[aria-pressed="true"] .rec-stop{display:block;animation:pulse 1.6s ease-in-out infinite}
@keyframes pulse{50%{opacity:.45}}
.rec-time{font-variant-numeric:tabular-nums;color:var(--ink-soft);font-weight:700}
/* the recorder's timer earns its place only while recording — idle "0:00" is noise */
#rec-time{display:none}
.rec-row.recording #rec-time{display:inline}
.rec-wave{
  flex:1;min-width:0;height:44px;background:var(--sunk);border-radius:var(--r-md);
  max-width:0;opacity:0;transition:max-width .3s ease,opacity .25s ease;
}
.rec-row.recording .rec-wave{max-width:100%;opacity:1}
.rec-row.has-take{display:none} /* a take exists — re-record/discard live by the player */
.take-actions{display:flex;gap:8px}
.take-actions .btn{flex:1}
.email-hint{text-align:center;margin:0}
.email-hint a,#gate-card a{color:var(--teal);font-weight:700}
.email-hint[hidden]{display:none}
.a2hs{display:flex;gap:10px;align-items:center;justify-content:center;flex-wrap:wrap;text-align:center;margin:0}
.a2hs[hidden]{display:none}
.a2hs .btn-ghost{padding:6px 14px;font-size:.9rem}
.a2hs .dismiss{background:none;border:none;color:var(--ink-soft);font:inherit;font-size:.9rem;text-decoration:underline;cursor:pointer;padding:4px}
.a2hs .dismiss:focus-visible{outline:3px solid var(--cta);outline-offset:2px}
@media (prefers-reduced-motion:reduce){
  .btn-rec,.rec-wave{transition:none}
  .btn-rec[aria-pressed="true"] .rec-stop{animation:none}
}

/* THE mascot recipe — one construction everywhere (motion-lab standard):
   terra blob (the one border-radius) + eyes at the LAB RATIO — eye = 16.5%
   of blob width (7.5px @ 46px), centers 32% apart (gap 7px) — no strokes.
   Every depiction — receipt face, daydreaming record pill, daydreaming play
   button — uses exactly these two classes. */
.masa-face{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;flex:none;
  width:46px;height:44px;background:var(--terra);
  border-radius:62% 38% 55% 45% / 58% 52% 48% 42%;
}
.masa-face[hidden]{display:none}
.m-eye{display:none;width:7.5px;height:7.5px;border-radius:50%;background:var(--linen);flex:none}
.masa-face .m-eye{display:block;animation:blink 6.4s ease-in-out infinite}
@keyframes blink{0%,95.5%,100%{transform:scaleY(1)}97.5%{transform:scaleY(.12)}}

/* DAYDREAM — left alone, the controls themselves become the mascot and wake on
   any interaction. Never while recording or playing; never under reduced-motion. */
.btn-rec.daydream{
  background:var(--terra);max-width:46px;width:46px;height:44px;padding:0;gap:7px;
  justify-content:center;border-radius:62% 38% 55% 45% / 58% 52% 48% 42%;
}
.btn-rec.daydream .rec-dot,
.btn-rec.daydream #rec-label,
.btn-rec.daydream .rec-stop{display:none}
.btn-rec.daydream .m-eye{display:block;animation:blink 6.4s ease-in-out infinite}
.btn-rec.daydream .m-eye:last-child{animation-delay:.06s}

.btn-play.daydream:not(.playing) .play-glyphs{display:none}
.btn-play.daydream:not(.playing) .m-eye{display:block;animation:blink 6.4s ease-in-out infinite}
@media (prefers-reduced-motion:reduce){
  .masa-face .m-eye,.btn-rec.daydream .m-eye,.btn-play.daydream .m-eye{animation:none}
}
.status-row{display:flex;align-items:center;gap:8px;min-height:44px}

.rec-preview{margin-top:12px;display:grid;gap:8px}
.rec-preview[hidden]{display:none}
.player{display:flex;align-items:center;gap:12px}
/* the play button is a mini masa: dough-shaped, terracotta, its "eyes" are the glyph */
.btn-play{
  flex:none;width:46px;height:44px;border:none;cursor:pointer;gap:7px;
  background:var(--terra);display:inline-flex;align-items:center;justify-content:center;
  border-radius:62% 38% 55% 45% / 58% 52% 48% 42%;
}
.btn-play:hover{background:var(--cta)}
.btn-play:focus-visible{outline:3px solid var(--cta);outline-offset:3px}
.btn-play .g-play,.btn-play .g-pause{fill:var(--linen);transform-origin:center;transition:opacity .18s ease,transform .24s var(--spring)}
.btn-play .g-pause{opacity:0;transform:scale(.55)}          /* eyes tucked away */
.btn-play.playing .g-pause{opacity:1;transform:scale(1)}    /* eyes stand up = pause */
.btn-play.playing .g-play{opacity:0;transform:scale(.55)}   /* fused triangle rests */
@media (prefers-reduced-motion:reduce){
  .btn-play .g-play,.btn-play .g-pause{transition:none}
}
/* Telegram-style track: the bars ARE the progress; the range is an invisible,
   fully accessible overlay (no thumb chrome fighting the bars) */
.player-track{position:relative;flex:1;min-width:0;height:48px}
.player-track canvas{position:absolute;inset:0;width:100%;height:100%;background:var(--sunk);border-radius:var(--r-md)}
.seek-overlay{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.player-track:has(.seek-overlay:focus-visible){outline:3px solid var(--cta);outline-offset:2px;border-radius:var(--r-md)}

.fld{display:grid;gap:6px;font-weight:700;font-size:.9rem}
.fld input,.fld textarea{
  font:inherit;font-weight:400;color:var(--ink);background:var(--linen);
  border:1px solid var(--line);border-radius:var(--r-md);padding:10px 12px;width:100%;
}
.fld input:focus-visible,.fld textarea:focus-visible{outline:3px solid var(--cta);outline-offset:1px}
/* file input: style the NATIVE button (::file-selector-button — no JS, a11y intact,
   browser auto-translates the label text). Matches .btn / design language. */
.fld input[type=file]{padding:8px;font-weight:400;color:var(--ink-soft);cursor:pointer}
.fld input[type=file]::file-selector-button{
  font:inherit;font-weight:700;color:var(--linen);background:var(--teal);
  border:none;border-radius:var(--r-md);padding:10px 16px;margin-right:12px;cursor:pointer;
}
.fld input[type=file]::file-selector-button:hover{background:var(--cta-h)}
.file-list{list-style:none;margin:10px 0 0;padding:0;display:grid;gap:6px}
.file-list li{
  display:flex;justify-content:space-between;align-items:center;gap:8px;
  background:var(--sunk);border-radius:var(--r-md);padding:8px 12px;font-size:.9rem;
}
.file-list .rm{background:none;border:none;color:var(--cta);font:inherit;font-weight:700;cursor:pointer;padding:4px}
.file-list .rm:focus-visible{outline:3px solid var(--cta);outline-offset:2px}

.send-row{display:grid;gap:8px}
.send-row[hidden]{display:none} /* token gate hides the composer wholesale */
.btn-send{background:var(--cta);font-size:1.05rem;padding:14px}
.btn-send:hover:not([disabled]){background:var(--cta-h)}
.status{margin:0;min-height:1.4em;font-weight:700}
.status.ok{color:var(--teal)}
.status.err{color:var(--cta)}
.foot{color:var(--ink-soft);font-size:.8rem;text-align:center}
