/* Say it from anywhere (assets/say-anywhere.js): the "From your recording" mode of the right panel (side-panel.css),
   the phone corner mark and the "Added to N places · Undo" receipt. Journal's controls (app-content-controls.css,
   loaded with the sheet) for buttons and menus; accent through --app-accent* only. Phrase ↔ piece tones are the
   Say the trade pairs (say-it.css .stt-tone-*). */
.say-anywhere{--sa-ink:var(--text-primary,#1d1d22);--sa-muted:var(--text-secondary,#6b6b75);--sa-line:var(--app-border-soft,#e7e8eb);
  --sa-tone-1:var(--app-accent-text,var(--app-accent,#443ab8));--sa-tone-2:#449a6b;--sa-tone-3:#9a7b4f;--sa-tone-4:#5b6577;
  display:flex;flex-direction:column;gap:0;color:var(--sa-ink);font-size:14px;line-height:20px;background:transparent}
html.dark .say-anywhere,[data-theme=dark] .say-anywhere{--sa-tone-2:#7db894;--sa-tone-3:#c5b38f;--sa-tone-4:#9fb0c7}
.tsb-side-panel[data-mode=say] .tsb-side-panel-body{padding-top:0}
.tsb-side-panel .say-anywhere,.tsb-side-panel .say-anywhere-foot{font-size:14px;line-height:20px;background:transparent}
.say-anywhere *{box-sizing:border-box}
.say-anywhere [hidden]{display:none!important}
.sa-tone-1{--sa-tone:var(--sa-tone-1)}.sa-tone-2{--sa-tone:var(--sa-tone-2)}.sa-tone-3{--sa-tone:var(--sa-tone-3)}.sa-tone-4{--sa-tone:var(--sa-tone-4)}

/* Your words: typed in while TSB sorts them (covers the real wait), then each piece's words underlined in its tone. */
.sa-words{padding:16px 0;border-bottom:1px solid var(--sa-line)}
.sa-words-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 8px;color:var(--sa-muted);font-size:12px;line-height:16px}
.sa-words-head b{color:var(--sa-ink);font-weight:600;font-size:14px;line-height:20px}
.sa-words-text{margin:0;font-size:16px;line-height:26px;text-wrap:pretty;white-space:pre-wrap;overflow-wrap:anywhere}
.sa-words.is-folded .sa-words-text{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:var(--sa-muted);font-size:14px;line-height:22px}
.sa-words-text.is-typing::after{content:'';display:inline-block;width:2px;height:18px;margin-left:2px;vertical-align:-3px;background:var(--app-accent,#443ab8);animation:sa-caret 1s steps(2,end) infinite}
@keyframes sa-caret{50%{opacity:0}}
.sa-words-text.is-listening{min-height:52px;background:linear-gradient(var(--sa-line),var(--sa-line)) 0 7px/78% 12px no-repeat,linear-gradient(var(--sa-line),var(--sa-line)) 0 33px/52% 12px no-repeat;animation:sa-breathe 1.4s ease-in-out infinite}
@keyframes sa-breathe{50%{opacity:.45}}
.sa-status{margin:8px 0 0;color:var(--sa-muted);font-size:14px;line-height:20px}
.sa-status:empty{display:none}
.sa-status.is-error{color:var(--app-negative-text,#c4342d)}
.sa-said{text-decoration:underline;text-decoration-color:var(--sa-tone);text-decoration-thickness:2px;text-underline-offset:5px;border-radius:3px;cursor:default;transition:background-color .16s ease}
.sa-said.is-lit{background:color-mix(in srgb,var(--sa-tone) 16%,transparent)}
.sa-said.is-gone{text-decoration-style:dotted;text-decoration-color:var(--sa-line)}
.sa-link{display:inline;padding:0;border:0;background:none;color:var(--app-accent-text,#443ab8);font:500 14px/20px var(--ui-font,'TSB Inter',Inter,sans-serif);cursor:pointer;white-space:nowrap}
.sa-link:hover{text-decoration:underline}
.sa-link:focus-visible{outline:2px solid var(--app-accent,#443ab8);outline-offset:2px;border-radius:3px}
.sa-words-head .sa-link{font-size:12px;line-height:16px}
.sa-voice{display:flex;align-items:center;gap:8px}
.sa-voice{gap:16px}
.sa-voice audio{display:none}
.sa-kept{display:inline-flex;align-items:center;gap:8px;color:var(--sa-muted);font-size:12px;line-height:16px}
.sa-kept.is-error{color:var(--app-negative-text,#c4342d)}

/* The pieces: flat, hairline between them; one left edge. */
.sa-pieces{list-style:none;margin:0;padding:0}
.sa-piece{position:relative;padding:16px 0;border-bottom:1px solid var(--sa-line);transition:opacity .2s ease}
.sa-piece:last-child{border-bottom:0}
.sa-piece.is-entering{opacity:0;transform:translateY(6px)}
.sa-piece{transition:opacity .28s ease,transform .28s ease}
.sa-piece-top{display:flex;align-items:center;gap:8px;min-height:32px}
.sa-chip{display:inline-flex;align-items:center;gap:6px;min-width:0;max-width:100%;height:32px;margin:0;padding:0 8px;border:1px solid var(--app-border-default,var(--sa-line));border-radius:6px;background:transparent;color:var(--sa-ink);font:500 14px/20px var(--ui-font,'TSB Inter',Inter,sans-serif);cursor:pointer;text-align:left}
.sa-chip>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sa-chip svg{width:16px;height:16px;flex:none;stroke-width:2;color:var(--sa-muted)}
.sa-chip:hover,.sa-chip[aria-expanded=true]{border-color:var(--app-accent,#443ab8);background:var(--app-accent-soft,#ecebfa);color:var(--app-accent-text,#443ab8)}
.sa-chip:hover svg,.sa-chip[aria-expanded=true] svg{color:inherit}
.sa-chip:focus-visible{outline:2px solid var(--app-accent,#443ab8);outline-offset:2px}
.sa-chip.is-attach{border-color:color-mix(in srgb,var(--app-accent,#443ab8) 40%,var(--sa-line))}
.sa-piece-top .sa-spacer{flex:1}
.sa-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;flex:none;padding:0;border:0;border-radius:6px;background:transparent;color:var(--sa-muted);cursor:pointer}
.sa-icon-btn:hover,.sa-icon-btn[aria-expanded=true]{background:var(--app-action-bg-hover,color-mix(in srgb,currentColor 8%,transparent));color:var(--sa-ink)}
.sa-icon-btn:focus-visible{outline:2px solid var(--app-accent,#443ab8);outline-offset:1px}
.sa-icon-btn svg{width:20px;height:20px;stroke-width:2}
.sa-add{display:inline-flex;align-items:center;height:32px;padding:0 8px;margin-right:-8px;border:0;border-radius:6px;background:transparent;color:var(--app-accent-text,#443ab8);font:600 14px/20px var(--ui-font,'TSB Inter',Inter,sans-serif);cursor:pointer;white-space:nowrap}
.sa-add:hover:not(:disabled){background:var(--app-accent-soft,#ecebfa)}
.sa-add:disabled{color:var(--sa-muted);cursor:default;opacity:.6}
.sa-add:focus-visible{outline:2px solid var(--app-accent,#443ab8);outline-offset:1px}
.sa-quote{margin:12px 0 0;color:var(--sa-muted);font-size:14px;line-height:22px;text-wrap:pretty}
.sa-quote .sa-said{color:var(--sa-ink)}
.sa-split{display:inline;margin:0 2px;padding:0 4px;border:1px dashed var(--app-accent,#443ab8);border-radius:4px;background:transparent;color:var(--app-accent-text,#443ab8);font:500 12px/16px var(--ui-font,'TSB Inter',Inter,sans-serif);cursor:pointer;vertical-align:1px}
.sa-split:hover{background:var(--app-accent-soft,#ecebfa)}
.sa-value{margin:8px 0 0;font-size:14px;line-height:22px;text-wrap:pretty}
.sa-value-label{margin-right:8px;color:var(--sa-muted);font-size:12px;line-height:16px}
.sa-trade{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;margin:8px 0 0;font-size:14px;line-height:22px}
.sa-trade b{font-size:16px;font-weight:600}
.sa-trade .is-long{color:var(--app-positive-text,#2e7d53);font-weight:600}
.sa-trade .is-short{color:var(--app-negative-text,#c4342d);font-weight:600}
.sa-trade .is-gain{color:var(--app-positive-text,#2e7d53);font-weight:600}
.sa-trade .is-loss{color:var(--app-negative-text,#c4342d);font-weight:600}
.sa-trade .sa-muted{color:var(--sa-muted)}
.sa-note{margin:8px 0 0;color:var(--sa-muted);font-size:14px;line-height:20px;text-wrap:pretty}
.sa-note.is-error{color:var(--app-negative-text,#c4342d);font-size:14px;line-height:20px}

/* Where should this go? — never a silent guess. */
.sa-ask{margin:12px 0 0}
.sa-ask h3{margin:0;font-size:16px;line-height:24px;font-weight:600}
.sa-ask p{margin:4px 0 0;color:var(--sa-muted);font-size:14px;line-height:20px}
.sa-likely{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0 0}
.say-anywhere .sa-likely .app-action-btn{min-height:36px;padding:6px 12px;font-weight:500}

/* Added / dropped: the card keeps one line with its way back. */
.sa-piece.is-added .sa-quote,.sa-piece.is-added .sa-value,.sa-piece.is-added .sa-trade,.sa-piece.is-added .sa-note{display:none}
.sa-done{display:flex;flex-wrap:wrap;align-items:center;gap:4px 16px;min-height:32px;color:var(--sa-muted)}
.sa-done b{color:var(--sa-ink);font-weight:500}
.sa-done svg{width:16px;height:16px;color:var(--app-positive-text,#2e7d53);stroke-width:2;vertical-align:-3px;margin-right:6px}
.sa-piece.is-dropped{padding:12px 0}

/* The menus: Journal's action menu frame (app-content-controls.css .app-content-menu), fixed beside its chip. */
.say-anywhere-menu-host{display:contents}
.say-anywhere-menu-host .say-anywhere-menu.app-content-menu{position:fixed;right:auto;top:auto;z-index:10500;width:300px;max-height:min(440px,calc(100dvh - 96px))}
.say-anywhere-menu .sa-menu-group{margin:8px 8px 4px;color:var(--jw-muted,#6b6b75);font-size:12px;line-height:16px}
.say-anywhere-menu .sa-menu-group:first-child{margin-top:4px}
.say-anywhere-menu hr{width:100%;margin:4px 0;border:0;border-top:1px solid var(--jw-line,#e7e8eb)}
.say-anywhere-menu .app-action-btn{width:100%;font-weight:500;text-align:left;gap:8px}
.say-anywhere-menu .app-action-btn[aria-checked=true]{color:var(--jw-accent-text,#443ab8);background:var(--jw-accent-soft,#ecebfa)}
.say-anywhere-menu .app-action-btn:hover:not(:disabled){background:var(--jw-hover)}
.say-anywhere-menu .app-action-btn>span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.say-anywhere-menu .app-action-btn small{color:var(--jw-muted);font-size:12px;font-weight:400}
.say-anywhere-menu .app-action-btn.is-danger{color:var(--app-negative-text,#c4342d)}

/* Footer: one line of state, Add all on the right. */
.say-anywhere-foot{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%}
.say-anywhere-foot p{margin:0;color:var(--text-secondary,#6b6b75);font-size:12px;line-height:16px;text-wrap:pretty}
.say-anywhere-foot .app-action-btn{flex:none;min-width:112px}

/* The receipt after Add: one line, Undo, a link to each place. Bottom right of the page, out of the way. */
.say-receipt{position:fixed;right:24px;bottom:24px;z-index:10400;display:flex;align-items:flex-start;gap:12px;width:max-content;max-width:min(560px,calc(100vw - 48px));padding:12px 8px 12px 16px;border:1px solid var(--app-border-default,#e4e4e7);border-radius:12px;background:var(--bg-primary,#fff);color:var(--text-primary,#1d1d22);box-shadow:0 8px 32px #18181b14;font:400 14px/20px var(--ui-font,'TSB Inter',Inter,sans-serif)}
.say-receipt[hidden]{display:none}
.say-receipt>svg{width:20px;height:20px;flex:none;margin-top:6px;color:var(--app-positive-text,#2e7d53);stroke-width:2}
.say-receipt-body{flex:1;min-width:0;padding-top:6px}
.say-receipt-body p{margin:0}
.say-receipt-line{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px}
.say-receipt-line b{font-weight:600}
.say-receipt-links{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px!important}
.say-receipt-links :is(a,span){display:inline-flex;align-items:center;max-width:100%;height:28px;padding:0 8px;border:1px solid var(--app-border-default,var(--sa-line,#d9dbde));border-radius:6px;color:var(--sa-ink,var(--text-primary));font:500 14px/20px var(--ui-font,'TSB Inter',Inter,sans-serif);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-decoration:none}
.say-receipt-links a:hover{border-color:var(--app-accent,#443ab8);background:var(--app-accent-soft,#ecebfa);color:var(--app-accent-text,#443ab8)}
.say-receipt .sa-link{font-weight:600}
.say-receipt-source{margin-top:4px!important;color:var(--text-secondary,#6b6b75);font-size:12px;line-height:16px}
.say-receipt-source a{color:var(--app-accent-text,#443ab8);text-decoration:none}
.say-receipt-source a:hover{text-decoration:underline}
.say-receipt .sa-receipt-note{margin-top:8px!important;color:var(--app-negative-text,#c4342d);text-wrap:pretty}
html.has-side-panel .say-receipt{right:calc(var(--tsb-side-panel-width,420px) + 24px)}

/* Phone: the corner mark; no rail there. It sits 16 px above whatever owns the bottom edge (the shell's
   --shell-bottom-reserve: the Get started bar, a page's own bottom bar) and steps aside while recording or with the
   sheet open. */
.say-anywhere-corner{display:none}
@media(max-width:767px){
 .say-anywhere-corner{position:fixed;right:16px;bottom:calc(max(var(--shell-bottom-reserve,0px),env(safe-area-inset-bottom,0px)) + 16px);z-index:95;display:inline-flex;align-items:center;justify-content:center;width:52px;height:52px;padding:0;border:0;border-radius:16px;background:var(--app-accent,#443ab8);color:var(--app-action-primary-color,#fff);box-shadow:0 6px 20px #18181b26;cursor:pointer}
 .say-anywhere-corner svg{width:26px;height:26px;stroke-width:1.8}
 .say-anywhere-corner:focus-visible{outline:2px solid var(--app-accent,#443ab8);outline-offset:3px}
 html.is-saying-it .say-anywhere-corner,html.has-side-panel .say-anywhere-corner,html.say-corner-hidden .say-anywhere-corner,body.sidebar-mobile-open .say-anywhere-corner,body:has(.ob3-rail.is-open-mobile) .say-anywhere-corner{display:none} /* the open Get started sheet too: the mark covered its step 4 (19 Nov rail sheet) */
 /* The page's last action never sits under the mark. */
 body.workspace-shell-native{padding-bottom:calc(var(--shell-bottom-reserve,0px) + 84px)}
 .say-receipt{left:16px;right:16px;bottom:calc(16px + env(safe-area-inset-bottom,0px));width:auto;max-width:none}
 .tsb-side-panel[data-mode=say]{height:min(78dvh,680px)}
 html.has-side-panel .say-receipt{right:16px}
 .say-anywhere-menu-host .say-anywhere-menu.app-content-menu{left:16px!important;right:16px;width:auto;bottom:calc(16px + env(safe-area-inset-bottom,0px));top:auto!important;max-height:min(60dvh,440px)}
 .say-anywhere-menu .app-action-btn{min-height:44px}
 .sa-words-text{font-size:16px;line-height:24px}
 .say-anywhere-foot p{max-width:170px}
}
@media(prefers-reduced-motion:reduce){.sa-words-text.is-typing::after,.sa-words-text.is-listening{animation:none}.sa-piece{transition:none}.sa-piece.is-entering{opacity:1;transform:none}}
html[data-reduce-motion=true] .sa-piece{transition:none}
