/* Happy Path. Phone: design/happy-path.html. Desktop (640px and up): the Portal's desktop block, below. */
/* Brand tokens: swap in official Mayo values here */
:root{
  --blue:#0E3293;        /* primary: Mayo-style deep blue (confirm official value) */
  --blue-press:#0A2670;
  --blue-soft:#EEF1FA;
  --ink:#0B0B0C;
  --ink-2:#4B5059;
  --muted:#7A808A;
  --line:#E6E8EC;
  --fill:#F4F5F7;
  --bg:#FFFFFF;
  --canvas:#EEF0F3;
  --font:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  color-scheme:light;
}
*{box-sizing:border-box;}
html,body{margin:0;height:100%;}
body{font-family:var(--font);color:var(--ink);background:var(--bg);-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent;}
button,textarea{font:inherit;color:inherit;}
button{background:none;border:0;padding:0;cursor:pointer;}
[hidden]{display:none!important;}
:focus-visible{outline:3px solid color-mix(in srgb,var(--blue) 45%,transparent);outline-offset:3px;border-radius:8px;}

.device{position:relative;height:100dvh;overflow:hidden;background:var(--bg);}
@media (min-width:640px){
  body{background:var(--canvas);display:flex;align-items:center;justify-content:center;min-height:100%;padding:24px 16px;}
  .device{width:390px;height:844px;border-radius:44px;box-shadow:0 0 0 10px #111,0 30px 80px rgba(0,0,0,.18);}
}
.screen{position:absolute;inset:0;display:flex;flex-direction:column;overflow-y:auto;padding:calc(env(safe-area-inset-top,0px) + 16px) 24px 0;}
.grow{flex:1;}

h1{font-size:32px;line-height:1.1;letter-spacing:-0.02em;margin:0;font-weight:700;text-wrap:balance;}
h2.sec{font-size:15px;font-weight:600;color:var(--muted);margin:0;}
.sub{font-size:17px;color:var(--ink-2);margin:10px 0 0;line-height:1.4;}
.small{font-size:14px;color:var(--muted);margin:0;}
.brand{font-size:15px;font-weight:700;letter-spacing:-0.01em;}
.brand span{font-weight:400;color:var(--muted);}
.text-btn{font-size:17px;color:var(--blue);font-weight:600;min-height:44px;display:inline-flex;align-items:center;gap:4px;}
.chev{color:var(--muted);flex:none;}

/* Dock: primary actions in the thumb zone */
.dock{position:sticky;bottom:0;margin:auto -24px 0;padding:14px 24px calc(env(safe-area-inset-bottom,0px) + 24px);background:linear-gradient(to top,var(--bg) 72%,rgba(255,255,255,0));display:flex;gap:10px;align-items:center;}
.composer{flex:1;min-height:54px;border-radius:27px;background:var(--fill);border:1px solid var(--line);padding:0 20px;font-size:17px;color:var(--muted);text-align:left;display:flex;align-items:center;}
.mic{width:54px;height:54px;border-radius:50%;background:var(--blue);color:#fff;display:grid;place-items:center;flex:none;position:relative;}
.mic:active{background:var(--blue-press);}
.mic svg{width:24px;height:24px;}
.mic.outline{background:var(--bg);color:var(--blue);box-shadow:inset 0 0 0 2px var(--blue);}
.mic.on{background:var(--blue);color:#fff;box-shadow:none;}
.mic.on::before,.mic.on::after{content:"";position:absolute;inset:-8px;border-radius:50%;border:2px solid var(--blue);opacity:0;animation:ring 1.8s ease-out infinite;}
.mic.on::after{animation-delay:.9s;}
@keyframes ring{0%{transform:scale(.9);opacity:.5}100%{transform:scale(1.3);opacity:0}}
.pill{flex:1;min-height:54px;border-radius:16px;background:var(--blue);color:#fff;font-size:17px;font-weight:600;display:flex;align-items:center;justify-content:center;gap:8px;}
.pill:active{background:var(--blue-press);}
.pill:disabled{opacity:.35;cursor:not-allowed;}
.pill.quiet{background:var(--fill);color:var(--blue);}

/* Home */
.home-hero{padding-top:36px;}
.ideas{margin-top:40px;}
.idea-row{width:100%;text-align:left;display:flex;align-items:center;gap:12px;padding:16px 0;border-bottom:1px solid var(--line);min-height:64px;}
.idea-row .t{font-size:17px;font-weight:600;display:block;}
.idea-row .n{font-size:15px;color:var(--ink-2);display:block;margin-top:2px;}
.idea-row .chev{margin-left:auto;}

/* Capture: type or talk, same box */
.cap-top{display:flex;justify-content:space-between;align-items:center;}
#cap-text{flex:1;width:100%;border:0;outline:none;resize:none;font-size:24px;line-height:1.35;letter-spacing:-0.01em;padding:20px 0;background:transparent;min-height:200px;}
#cap-text::placeholder{color:#A4A9B1;}
.listening{font-size:15px;color:var(--blue);font-weight:600;display:flex;align-items:center;gap:8px;min-height:22px;}
.listening i{width:8px;height:8px;border-radius:50%;background:var(--blue);animation:blink 1s ease-in-out infinite;}
@keyframes blink{50%{opacity:.25}}

/* Result */
.stamp{margin-top:8px;}
.words{margin-top:18px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);}
.words summary{list-style:none;display:flex;justify-content:space-between;align-items:center;min-height:52px;font-size:17px;font-weight:600;cursor:pointer;}
.words summary::-webkit-details-marker{display:none;}
.words summary .chev{transition:transform .2s;}
.words[open] summary .chev{transform:rotate(90deg);}
.words p{margin:0 0 12px;font-size:17px;line-height:1.5;color:var(--ink-2);white-space:pre-wrap;}
.read{background:var(--fill);border-radius:12px;padding:12px 14px;margin-bottom:16px;display:flex;gap:12px;align-items:flex-start;}
.read div{flex:1;font-size:15px;line-height:1.45;color:var(--ink-2);}
.read b{display:block;color:var(--ink);font-size:14px;margin-bottom:2px;}
.read button{font-size:15px;color:var(--blue);font-weight:600;min-height:32px;}

.answers{display:flex;flex-direction:column;}
.answer{width:100%;text-align:left;display:grid;grid-template-columns:1fr auto;gap:4px 12px;align-items:center;padding:18px 0;border-bottom:1px solid var(--line);}
.answer .q{font-size:15px;color:var(--muted);font-weight:600;}
.answer .a{grid-column:1;font-size:18px;line-height:1.35;font-weight:500;}
.answer .chev{grid-column:2;grid-row:1 / span 3;}
.bar{grid-column:1;height:6px;border-radius:3px;background:var(--line);overflow:hidden;margin-top:8px;}
.bar i{display:block;height:100%;background:var(--blue);border-radius:3px;}
.next{margin-top:24px;background:var(--blue);color:#fff;border-radius:20px;padding:20px;}
.next .q{font-size:15px;font-weight:600;opacity:.8;}
.next p{margin:6px 0 0;font-size:20px;line-height:1.35;font-weight:600;}

/* Skeleton while a check is still running */
.sk{display:block;height:18px;border-radius:6px;background:linear-gradient(90deg,var(--fill) 0%,#E9EBEF 50%,var(--fill) 100%);background-size:200% 100%;animation:shim 1.2s linear infinite;}
.sk.w70{width:70%;} .sk.w90{width:90%;} .sk.w50{width:50%;}
.sk.dark{background:linear-gradient(90deg,rgba(255,255,255,.18) 0%,rgba(255,255,255,.32) 50%,rgba(255,255,255,.18) 100%);background-size:200% 100%;margin-top:10px;height:20px;}
@keyframes shim{to{background-position:-200% 0}}
.pending .chev{opacity:.3;}

/* Tools */
.tools{margin-top:32px;}
.tool-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px;}
.tool{background:var(--fill);border-radius:16px;padding:14px;min-height:84px;text-align:left;display:flex;flex-direction:column;justify-content:space-between;gap:10px;}
.tool:active{background:#E9EBEF;}
.tool svg{width:22px;height:22px;color:var(--blue);}
.tool span{font-size:16px;font-weight:600;line-height:1.25;}
.tool.wide{grid-column:1 / -1;flex-direction:row;align-items:center;justify-content:flex-start;gap:12px;min-height:60px;background:var(--bg);box-shadow:inset 0 0 0 2px var(--blue);color:var(--blue);}
.tool.wide span{color:var(--blue);}
.tail{height:24px;}
.tools.submit{margin-top:24px;}
.tool.span{grid-column:1 / -1;flex-direction:row;align-items:center;justify-content:flex-start;gap:12px;min-height:60px;}
.sub-h{font-size:15px;font-weight:600;color:var(--muted);margin:22px 0 0;}
.path{list-style:none;margin:8px 0 0;padding:0;counter-reset:step;}
.path li{display:grid;grid-template-columns:26px 1fr;gap:2px 12px;padding:12px 0;border-top:1px solid var(--line);counter-increment:step;}
.path li::before{content:counter(step);grid-row:1 / span 2;width:24px;height:24px;border-radius:50%;background:var(--blue-soft);color:var(--blue);font-weight:700;font-size:13px;display:grid;place-items:center;}
.path li.done::before{content:"\2713";background:var(--blue);color:#fff;}
.path b{font-size:16px;}
.path span{font-size:15px;color:var(--ink-2);line-height:1.4;}
.path em{font-style:normal;color:var(--blue);font-weight:600;}
.prereq{display:flex;gap:12px;align-items:flex-start;padding:12px 14px;border-radius:12px;background:var(--fill);margin-top:8px;}
.prereq .ok{width:22px;height:22px;border-radius:50%;background:var(--line);color:transparent;display:grid;place-items:center;flex:none;margin-top:1px;}
.prereq.done .ok{background:var(--blue);color:#fff;}
.prereq b{display:block;font-size:16px;}
.prereq span{display:block;font-size:15px;color:var(--ink-2);}
.ack{display:flex;gap:12px;align-items:flex-start;padding:14px;border-radius:14px;background:var(--blue-soft);margin-top:16px;cursor:pointer;}
.ack input{width:24px;height:24px;accent-color:var(--blue);flex:none;margin:1px 0 0;}
.ack strong{display:block;font-size:16px;line-height:1.35;}
.ack span{display:block;font-size:14px;color:var(--ink-2);margin-top:2px;}
.linklike{font-size:15px;color:var(--blue);font-weight:600;margin-top:6px;min-height:32px;}
.ask.col{flex-direction:column;align-items:stretch;}
.ask.col .seg{display:flex;}
.ask.col .seg button{flex:1;}

/* Sheets: the second and last level */
.scrim{position:absolute;inset:0;background:rgba(0,0,0,.32);opacity:0;transition:opacity .2s;z-index:10;}
.scrim.show{opacity:1;}
.sheet{position:absolute;left:0;right:0;bottom:0;max-height:88%;background:var(--bg);border-radius:24px 24px 0 0;z-index:11;display:flex;flex-direction:column;transform:translateY(100%);transition:transform .28s cubic-bezier(.2,.8,.2,1);}
.sheet.show{transform:none;}
.grab{width:40px;height:5px;border-radius:3px;background:var(--line);margin:10px auto 0;flex:none;}
.sheet-body{overflow-y:auto;padding:16px 24px 8px;}
.sheet h2{font-size:24px;margin:0;letter-spacing:-0.015em;}
.sheet .lead{font-size:18px;margin:8px 0 0;color:var(--ink-2);line-height:1.4;}
.sheet .prose{font-size:18px;line-height:1.5;margin:14px 0 0;}
.list{margin:16px 0 0;padding:0;list-style:none;}
.list li{padding:14px 0;border-top:1px solid var(--line);}
.list b{font-size:17px;display:block;}
.list span{font-size:16px;color:var(--ink-2);line-height:1.45;display:block;margin-top:2px;}
.list em{font-style:normal;font-size:15px;color:var(--blue);font-weight:600;display:block;margin-top:6px;}
.list a{font-size:15px;color:var(--blue);font-weight:600;text-decoration:none;display:inline-block;margin-top:6px;}
.steps{display:grid;grid-template-columns:repeat(10,1fr);gap:4px;margin-top:18px;}
.steps i{height:8px;border-radius:2px;background:var(--line);}
.steps i.now{background:var(--blue);}
.steps-cap{display:flex;justify-content:space-between;margin-top:6px;}
.dots{display:flex;gap:6px;margin-top:14px;}
.dots i{width:14px;height:14px;border-radius:50%;background:var(--line);}
.dots i.on{background:var(--blue);}
.doc{margin-top:14px;border:1px solid var(--line);border-radius:14px;padding:16px;display:flex;flex-direction:column;gap:10px;}
.doc b{font-size:13px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);}
.doc p{margin:2px 0 0;font-size:15px;line-height:1.45;}
.source-note{font-size:14px;color:var(--muted);margin:14px 0 0;line-height:1.45;}
.sheet-foot{padding:12px 24px calc(env(safe-area-inset-bottom,0px) + 20px);flex:none;display:flex;gap:10px;}

.toast{position:absolute;left:50%;top:calc(env(safe-area-inset-top,0px) + 14px);transform:translateX(-50%);background:var(--ink);color:#fff;font-size:15px;font-weight:600;padding:9px 16px;border-radius:20px;z-index:20;white-space:nowrap;}

/* Next-step action and disclosure */
.next-btn{margin-top:14px;min-height:44px;padding:0 16px;border-radius:12px;background:#fff;color:var(--blue);font-size:16px;font-weight:600;display:inline-flex;align-items:center;}
.next-btn[hidden]{display:none!important;}
.preview{margin-top:18px;}
.preview .disc{margin-top:0;padding-bottom:6px;}
.disc{margin-top:14px;display:flex;flex-direction:column;}
.disc>div{padding:12px 0;border-top:1px solid var(--line);}
.disc b{font-size:13px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);display:block;}
.disc p{margin:3px 0 0;font-size:16px;line-height:1.45;}
.confirm-h{font-size:15px;font-weight:600;margin:18px 0 0;}
.confirm{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:12px;background:var(--fill);margin-top:8px;}
.confirm div{flex:1;font-size:15px;line-height:1.4;color:var(--ink-2);}
.confirm div strong{display:block;color:var(--ink);font-size:16px;}
.confirm button{font-size:15px;color:var(--blue);font-weight:600;min-height:36px;}
.status{font-size:15px;color:var(--blue);font-weight:600;}
.ask{display:flex;align-items:center;gap:12px;padding:14px;border-radius:14px;background:var(--blue-soft);margin-top:16px;}
.ask>div:first-child{flex:1;}
.ask strong{display:block;font-size:16px;}
.ask span{display:block;font-size:14px;color:var(--ink-2);margin-top:2px;}
.seg{display:flex;background:#fff;border-radius:10px;padding:3px;gap:3px;flex:none;box-shadow:inset 0 0 0 1px var(--line);}
.seg button{min-width:52px;min-height:38px;border-radius:8px;font-size:15px;font-weight:600;color:var(--ink-2);}
.seg button[aria-pressed="true"]{background:var(--blue);color:#fff;}
.auto{display:flex;gap:12px;align-items:flex-start;padding:12px 0;border-top:1px solid var(--line);}
.auto:first-of-type{border-top:0;}
.auto .ok{width:22px;height:22px;border-radius:50%;background:var(--blue-soft);color:var(--blue);display:grid;place-items:center;flex:none;margin-top:1px;}
.auto>div{flex:1;min-width:0;}
.auto strong{display:block;font-size:16px;}
.auto span{display:block;font-size:15px;color:var(--ink-2);margin-top:1px;}
.auto small{display:block;font-size:13px;color:var(--muted);margin-top:3px;}
.auto button{font-size:15px;color:var(--blue);font-weight:600;min-height:32px;flex:none;}

@media (prefers-reduced-motion:reduce){
  .mic.on::before,.mic.on::after,.sk,.listening i{animation:none;}
  .sheet,.scrim{transition:none;}
}

/* Happy Path additions, same tokens */
.who-row{display:flex;align-items:center;gap:12px;padding:12px 0;border-top:1px solid var(--line);}
.who-row .lt{width:10px;height:10px;border-radius:50%;background:var(--blue);flex:none;}
.who-row .lt.none{background:transparent;box-shadow:inset 0 0 0 2px var(--muted);}
.who-row div{flex:1;}
.who-row b{display:block;font-size:16px;}
.who-row span{display:block;font-size:15px;color:var(--ink-2);}
.who-row em{font-style:normal;font-size:14px;color:var(--muted);white-space:nowrap;}
.tag{display:inline-block;font-size:13px;font-weight:600;color:var(--blue);background:var(--blue-soft);border-radius:6px;padding:1px 7px;margin-right:6px;}
.tag.new{color:var(--ink);background:var(--fill);}
.src{font-size:14px;color:var(--muted);display:block;margin-top:4px;}
.typing-caret{display:inline-block;width:2px;height:1.1em;background:var(--blue);vertical-align:-2px;animation:blink 1s steps(1) infinite;}

/* ===== Desktop and wide windows (portal-desktop.html) =====
   Phones (under 640px) are untouched: everything below applies from 640px up.
   Same brand, type, colors and copy as the phone. What changes on a big screen:
   - no phone frame; a top bar with the brand and "Install app"
   - one centered reading column
   - Home: you type or talk right on the page, in a large box, instead of opening a capture screen
   - detail panels slide in from the right; from 1100px they sit beside the answers
   - hover, focus and keyboard (Cmd/Ctrl+Enter saves, Esc closes a panel)
   - Firefox and Brave: record, then the server writes it down, with a timer and a clear wait state */
.topbar,.sheet-head,.kbd-hint,.compose,.when,.home-note{display:none;}
.rec-time{font-variant-numeric:tabular-nums;}
.writing{display:none;}
.writing.on{display:block;}
.writing .sk{height:22px;margin-top:14px;}
.writing .sk:first-child{margin-top:4px;}

@media (min-width:640px){
  body{background:var(--bg);display:block;padding:0;min-height:0;}
  .device{width:auto;height:100dvh;border-radius:0;box-shadow:none;}

  /* Top bar */
  .topbar{display:flex;position:absolute;top:0;left:0;right:0;height:64px;align-items:center;justify-content:space-between;padding:0 24px 0 20px;background:rgba(255,255,255,.86);-webkit-backdrop-filter:saturate(1.6) blur(14px);backdrop-filter:saturate(1.6) blur(14px);z-index:11;transition:box-shadow .2s,right .3s cubic-bezier(.2,.8,.2,1);}
  .device.scrolled .topbar{box-shadow:0 1px 0 var(--line);}
  .topbar .brand{min-height:44px;display:inline-flex;align-items:center;gap:10px;padding:0 6px;border-radius:10px;}
  .logo{width:28px;height:28px;border-radius:8px;background:var(--blue);color:#fff;display:grid;place-items:center;}
  .logo svg{width:18px;height:18px;}
  .install{min-height:38px;padding:0 14px;border-radius:10px;font-size:15px;font-weight:600;color:var(--ink-2);display:inline-flex;align-items:center;gap:8px;transition:background .15s,color .15s;}
  .install svg{color:var(--blue);}
  .install:hover{background:var(--fill);color:var(--ink);}

  .screen{top:0;padding:64px 32px 0;transition:right .3s cubic-bezier(.2,.8,.2,1);scroll-padding-top:80px;}
  .screen > *{width:100%;max-width:680px;margin-left:auto;margin-right:auto;flex-shrink:0;}
  .screen > .grow{flex:1;}
  .screen > .brand{display:none;}
  .screen > .dock{margin:auto auto 0;padding:18px 0 28px;}

  /* Home: the box is the page */
  #s-home > .dock{display:none;}
  .home-hero{padding-top:88px;}
  h1{font-size:48px;letter-spacing:-0.025em;}
  .sub{font-size:19px;margin-top:12px;}
  .compose{display:block;margin-top:32px;border:1px solid var(--line);border-radius:22px;background:var(--bg);box-shadow:0 1px 2px rgba(11,11,12,.04),0 8px 24px rgba(11,11,12,.05);transition:border-color .15s,box-shadow .15s;}
  .compose:focus-within,.compose.live{border-color:color-mix(in srgb,var(--blue) 55%,var(--line));box-shadow:0 0 0 4px var(--blue-soft),0 8px 24px rgba(11,11,12,.05);}
  .compose textarea{display:block;width:100%;border:0;outline:none;resize:none;background:transparent;font:inherit;font-size:21px;line-height:1.45;letter-spacing:-0.01em;color:var(--ink);padding:22px 24px 8px;min-height:120px;max-height:320px;}
  .compose textarea::placeholder{color:#A4A9B1;}
  .compose .writing{padding:22px 24px 8px;height:120px;overflow:hidden;}
  .writing .sk{margin-top:12px;}
  .compose-bar{display:flex;align-items:center;gap:12px;padding:10px 12px 12px 24px;}
  .compose-bar .listening{flex:1;}
  .compose-bar .kbd-hint{margin-left:auto;}
  .compose-bar .listening:not([hidden]) ~ .kbd-hint{display:none;}
  #s-cap .dock .kbd-hint{margin-left:auto;}
  .compose .mic{width:46px;height:46px;}
  .compose .mic svg{width:21px;height:21px;}
  .compose .pill{flex:none;min-height:46px;padding:0 22px;border-radius:14px;font-size:16px;}
  .home-note{display:flex;align-items:center;gap:6px;margin-top:12px;font-size:14px;color:var(--muted);}
  .ideas{margin-top:56px;}
  .when{display:block;font-size:14px;color:var(--muted);margin-left:auto;white-space:nowrap;}
  .idea-row .when + .chev{margin-left:8px;}
  .idea-row{width:calc(100% + 24px);max-width:704px;margin:0 -12px;padding:16px 12px;border-radius:14px;border-bottom-color:transparent;position:relative;transition:background .15s;}
  .idea-row::after{content:"";position:absolute;left:12px;right:12px;bottom:0;border-bottom:1px solid var(--line);}
  .idea-row:hover{background:var(--fill);}
  .kbd-hint{display:inline;font-size:13px;color:var(--muted);white-space:nowrap;}
  .kbd-hint kbd{font:inherit;font-weight:600;color:var(--ink-2);background:var(--fill);border:1px solid var(--line);border-bottom-width:2px;border-radius:6px;padding:1px 6px;margin:0 1px;}

  /* Buttons */
  .mic{transition:background .15s,box-shadow .15s;}
  .mic:hover{background:var(--blue-press);}
  .mic.outline:hover{background:var(--blue-soft);}
  .mic.on:hover{background:var(--blue-press);}
  .mic:disabled{opacity:.35;cursor:default;}
  .mic.outline:disabled:hover{background:var(--bg);}
  .pill{transition:background .15s,opacity .15s;}
  .pill:not(:disabled):hover{background:var(--blue-press);}
  .pill.quiet:not(:disabled):hover{background:#E9EBEF;}
  .composer{cursor:text;transition:border-color .15s;}
  .composer:hover{border-color:#D0D4DA;}
  .text-btn{border-radius:10px;padding:0 8px;margin-left:-8px;transition:background .15s;}
  .text-btn:hover{background:var(--blue-soft);}

  /* Capture (Add a thought) */
  .cap-top{padding-top:20px;}
  #cap-text{font-size:28px;}
  #s-cap .writing{padding:20px 0;}
  #s-cap .dock{gap:14px;}
  #s-cap .dock .listening{flex:1;}
  #s-cap .pill{flex:0 0 auto;padding:0 26px;}

  /* Result */
  .answer{width:calc(100% + 32px);max-width:712px;margin:0 -16px;padding:18px 16px;border-radius:14px;border-bottom-color:transparent;position:relative;transition:background .15s;}
  .answer::after{content:"";position:absolute;left:16px;right:16px;bottom:0;border-bottom:1px solid var(--line);}
  .answer:hover{background:var(--fill);}
  .answer .chev{transition:transform .15s,color .15s;}
  .answer:hover .chev{transform:translateX(2px);color:var(--ink-2);}
  .answer.active{background:var(--blue-soft);}
  .answer.active::after,.answer:hover::after{border-color:transparent;}
  .answer.active .chev{color:var(--blue);}
  .words summary{border-radius:10px;}
  .tools:not(.submit) .tool-grid{grid-template-columns:repeat(4,1fr);}
  .tools.submit .tool.wide{grid-column:auto;}
  .tool{transition:background .15s,box-shadow .15s;}
  .tool:hover{background:#E9EBEF;}
  .tool.wide:hover{background:var(--blue-soft);}
  .tool.active{background:var(--blue-soft);box-shadow:inset 0 0 0 2px var(--blue);}
  .next-btn{transition:background .15s;}
  .next-btn:hover{background:var(--blue-soft);}
  .tail{height:40px;}

  /* Detail panel */
  .scrim{background:rgba(11,11,12,.18);z-index:12;}
  .sheet{top:0;left:auto;right:0;bottom:0;width:480px;max-height:none;border-radius:0;box-shadow:-1px 0 0 var(--line),-28px 0 56px rgba(11,11,12,.07);transform:translateX(100%);z-index:13;}
  .sheet .grab,.sheet > .sheet-x{display:none;}
  .sheet-head{display:flex;align-items:center;gap:12px;height:64px;padding:0 16px 0 32px;flex:none;border-bottom:1px solid transparent;transition:border-color .2s;}
  .sheet.scrolled .sheet-head{border-bottom-color:var(--line);}
  .sheet-ctx{flex:1;min-width:0;font-size:14px;font-weight:600;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .sheet-head .x{width:38px;height:38px;border-radius:10px;display:grid;place-items:center;color:var(--ink-2);transition:background .15s;}
  .sheet-head .x:hover{background:var(--fill);color:var(--ink);}
  .sheet-body{flex:1;padding:8px 32px 28px;}
  .sheet h2{font-size:26px;}
  .sheet-foot{padding:16px 32px 24px;border-top:1px solid var(--line);flex-direction:row-reverse;justify-content:flex-start;}
  .sheet-foot .pill{flex:0 0 auto;min-height:46px;padding:0 22px;border-radius:12px;font-size:16px;}
  .sheet-foot [data-close]{display:none;}
  .sheet.no-foot .sheet-foot{display:none;}
  .list a:hover,.linklike:hover{text-decoration:underline;text-underline-offset:3px;}

  .toast{top:auto;bottom:112px;box-shadow:0 8px 24px rgba(11,11,12,.18);z-index:20;}
}
@media (min-width:1100px){
  .scrim{display:none!important;}
  .device.panel .screen{right:480px;}
  .device.panel .topbar{right:480px;}
}
@media (min-width:640px) and (prefers-reduced-motion:reduce){
  .screen,.sheet{transition:none;}
}

/* Desktop: "Add a thought" grows in place */
.thought{display:none;}
@media (min-width:640px){
  #s-result > .dock > .composer,#s-result > .dock > .mic{display:none;}
  #s-result > .dock{padding:14px 0 24px;}
  .thought{display:flex;align-items:center;flex:1;gap:8px;min-height:56px;border:1px solid var(--line);background:var(--fill);border-radius:28px;padding:6px 6px 6px 22px;transition:border-color .15s,box-shadow .2s,background .15s,border-radius .2s;}
  .thought:hover{border-color:#D0D4DA;}
  .thought textarea{flex:1;min-width:0;border:0;outline:none;resize:none;background:transparent;font:inherit;font-size:17px;line-height:1.45;color:var(--ink);padding:10px 0;height:44px;overflow:hidden;}
  .thought textarea::placeholder{color:var(--muted);}
  .thought-bar{display:flex;align-items:center;gap:10px;flex:none;}
  .thought .mic{width:44px;height:44px;}
  .thought .mic svg{width:20px;height:20px;}
  .thought .kbd-hint,.thought .pill{display:none;}
  .thought.open{display:block;background:var(--bg);border-radius:20px;padding:8px 10px 10px 22px;border-color:color-mix(in srgb,var(--blue) 55%,var(--line));box-shadow:0 0 0 4px var(--blue-soft),0 -10px 40px rgba(11,11,12,.08);}
  .thought.open textarea{display:block;width:100%;padding:12px 0 6px;overflow:auto;}
  .thought .writing{padding:12px 0 6px;height:92px;overflow:hidden;}
  .thought .writing .sk{height:18px;}
  .thought.open .thought-bar{padding-top:6px;}
  .thought .listening{flex:1;}
  .thought.open .kbd-hint{display:inline;margin-left:auto;}
  .thought.open .listening:not([hidden]) ~ .kbd-hint{display:none;}
  .thought.open .pill{display:flex;flex:none;min-height:44px;padding:0 20px;border-radius:12px;font-size:16px;}
  .thought:not(.open) .mic.outline{background:var(--blue);color:#fff;box-shadow:none;}
}

/* Desktop: app sheets the mockup doesn't show */
@media (min-width:640px){
  .sheet-body h2{padding-right:0;}
  .sheet-body h2:focus{outline:none;}
}

/* First visit: invite code and full name */
.join{margin-top:36px;display:flex;flex-direction:column;gap:18px;}
.field span{display:block;font-size:15px;font-weight:600;color:var(--muted);margin-bottom:8px;}
.field input{width:100%;min-height:54px;border-radius:16px;background:var(--fill);border:1px solid var(--line);padding:0 18px;font:inherit;font-size:17px;color:var(--ink);outline:none;}
.field input:focus{border-color:var(--blue);background:var(--bg);}
.join-err{margin:0;font-size:15px;color:#B42318;line-height:1.4;}

/* Recording (Firefox, Brave, Vivaldi): the mic becomes a stop button, small bars follow
   the voice, and a quiet timer runs. Writing it down: a spinner on the mic. No words needed. */
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;}
.mic .stop{display:none;}
.mic.rec svg{display:none;}
.mic.rec .stop{display:block;width:14px;height:14px;border-radius:3px;background:#fff;}
.mic.rec::before,.mic.rec::after{display:none;}
.listening.rec>i,.listening.quiet>i{display:none;}
.lv{display:inline-flex;align-items:center;gap:3px;height:20px;}
.lv b{display:block;width:3px;height:4px;border-radius:2px;background:var(--blue);transition:height .08s linear;}
.listening.rec .rec-time{font-size:14px;font-weight:500;color:var(--muted);margin-left:6px;}
.mic.busy,.mic.busy:disabled,.mic.busy:disabled:hover{opacity:1;background:var(--bg);box-shadow:inset 0 0 0 2px var(--line);cursor:default;}
.mic.busy svg{visibility:hidden;}
.mic.busy::before{content:"";position:absolute;inset:-2px;border-radius:50%;border:2px solid transparent;border-top-color:var(--blue);animation:spin .9s linear infinite;opacity:1;}
@keyframes spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.mic.busy::before{animation-duration:2.4s;}}

/* Change "How we read it" */
.read-edit{width:100%;margin-top:16px;border:1px solid var(--line);border-radius:14px;background:var(--fill);padding:14px;font:inherit;font-size:17px;line-height:1.45;color:var(--ink);resize:none;outline:none;}
.read-edit:focus{border-color:var(--blue);background:var(--bg);}

/* Sent: the tile shows what happened, in the quiet style */
.tool.wide.done{box-shadow:none;background:var(--blue-soft);}
