#listen .demo__wrap { display: flex; flex-direction: column; align-items: flex-start; }
#listen .lede { margin-top: 14px; }
#listen .demo__tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 40px; }
#listen .demo__tab {
  display: inline-flex; align-items: center; gap: 9px; height: 44px; padding: 0 18px 0 16px;
  border: 0; border-radius: 999px; background: var(--paper2); color: var(--ink2);
  font: 500 14.5px/1 var(--sans); cursor: pointer; transition: background-color .25s, color .25s;
}
#listen .demo__tab:hover { background: var(--rule); }
#listen .demo__tab[aria-selected="true"] { background: var(--ink); color: var(--paper); }
#listen .demo__tabn { font-size: 12px; opacity: .55; }

#listen .demo__stage { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 26px; align-items: start; margin-top: 30px; width: 100%; }
#listen .demo__card { grid-column: 1; position: relative; overflow: hidden; display: grid; grid-template-rows: auto auto 1fr auto; height: clamp(460px, 52vh, 560px); padding: 22px 22px 0; }
#listen .demo__notes { grid-column: 2; display: none; position: relative; }
#listen .demo__notes:empty::before {
  content: "Notes appear here as the call plays."; display: block; max-width: 28ch;
  font: italic 400 13px/1.4 var(--serif); color: var(--ink3); padding-top: 4px;
}

#listen .demo__head { grid-area: 1 / 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 16px; border-bottom: 1px dashed var(--rule); flex-wrap: wrap; }
#listen .demo__dir { margin: 0 0 2px; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 600; }
#listen .demo__name { margin: 0; }
#listen .demo__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#listen .demo__lock { color: var(--ink2); }
#listen .demo__lock[hidden] { display: none; }
#listen .demo__lock svg { flex: none; opacity: .7; }
#listen .demo__status { position: relative; }
#listen .demo__status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
#listen .demo__status[data-state="thinking"]::before { animation: listenPulse 1.1s ease-in-out infinite; animation-play-state: paused; }
#listen.vis .demo__status[data-state="thinking"]::before { animation-play-state: running; }
#listen .demo__timer { color: var(--ink3); min-width: 3.4em; text-align: right; }

#listen .demo__wave { grid-area: 2 / 1; display: flex; align-items: center; justify-content: center; gap: 3px; height: 48px; padding-block: 10px; --wc: var(--ink3); }
#listen .demo__wave[data-state="them"] { --wc: var(--ink); }
#listen .demo__wave[data-state="ai"] { --wc: var(--terra); }
#listen .demo__wave[data-state="you"] { --wc: var(--sage); }
#listen .demo__wave .bar { width: 3px; height: 28px; border-radius: 2px; background: var(--wc); transform: scaleY(.14); transition: transform .3s var(--ease-out), background-color .25s; will-change: transform; }
#listen .demo__wave.live .bar { animation: listenWave var(--dur, 1.1s) ease-in-out var(--del, 0s) infinite alternate; animation-play-state: paused; }
#listen.vis .demo__wave.live .bar { animation-play-state: running; }
@keyframes listenWave { from { transform: scaleY(.16); } to { transform: scaleY(1); } }
@keyframes listenPulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

#listen .demo__transcript { grid-area: 3 / 1; position: relative; z-index: 1; overflow: hidden; margin: 6px -6px 0; padding: 0 6px; mask-image: linear-gradient(to bottom, transparent, #000 24px, #000 calc(100% - 10px), transparent); }
#listen .demo__scroller { display: flex; flex-direction: column; will-change: transform; padding-bottom: 14px; }

#listen .demo__line { display: flex; gap: 12px; padding-block: 9px; opacity: 0; transform: translateY(6px); transition: opacity .35s var(--ease-out), transform .35s var(--ease-out); }
#listen .demo__line.in { opacity: 1; transform: none; }
#listen .demo__tag { flex: none; width: 64px; padding-top: 3px; font: 600 12px/1.3 var(--sans); letter-spacing: .03em; text-transform: uppercase; color: var(--ink3); }
#listen .demo__line--ai .demo__tag { color: var(--ai); }
#listen .demo__line--you .demo__tag { color: var(--you); }
#listen .demo__content { flex: 1; min-width: 0; }
#listen .demo__text { font: 400 16.5px/1.5 var(--serif); color: var(--ink); }
#listen .demo__text .w { display: inline-block; opacity: 0; transform: translateY(4px); transition: opacity .22s var(--ease-out), transform .22s var(--ease-out); }
#listen .demo__text .w.in { opacity: 1; transform: none; }
#listen .demo__gloss { margin-top: 3px; font-size: 13px; font-style: italic; color: var(--ink3); opacity: 0; transition: opacity .4s var(--ease-out); }
#listen .demo__gloss.in { opacity: 1; }

#listen .demo__line--system { justify-content: center; text-align: center; padding-block: 12px; }
#listen .demo__line--system .demo__tag { display: none; }
#listen .demo__line--system .demo__content { flex: none; }
#listen .demo__line--system .demo__text { font-style: italic; font-size: 14px; color: var(--ink3); }

#listen .demo__note { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--paper2); color: var(--ink2); font: 500 12px/1 var(--sans); white-space: nowrap; }
#listen .demo__note::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--terra); flex: none; }
#listen .demo__content .demo__linenote.demo__note { height: auto; width: fit-content; max-width: 100%; white-space: normal; line-height: 1.4; padding: 5px 11px; margin-top: 7px; }
#listen .demo__content .demo__linenote.demo__note::before { display: none; }
#listen aside .demo__note {
  display: flex; align-items: flex-start; gap: 8px; height: auto; width: 100%; white-space: normal;
  position: absolute; top: 0; left: 0; right: 0;
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-sm);
  padding: 9px 12px; font: 400 14px/1.4 var(--sans); color: var(--ink2);
  opacity: 0; transition: opacity .4s var(--ease-out), transform .4s var(--ease-out), background-color .3s;
}
#listen aside .demo__note::before {
  content: ""; flex: none; width: 7px; height: 7px; margin-top: 4px; border-radius: 50%;
  background: var(--ink3);
}
#listen aside .demo__note[data-kind="ai"]::before { background: var(--terra); }
#listen aside .demo__note[data-kind="you"]::before { background: var(--sage); }
#listen aside .demo__note.in { opacity: 1; }
#listen aside .demo__note.old { opacity: .45; }

#listen .demo__outcome {
  grid-area: 3 / 1; position: relative; z-index: 2;
  display: flex; flex-direction: column; justify-content: center; background: var(--card);
  margin: 0 -22px; padding: 22px 22px 20px; box-shadow: 0 -18px 30px -24px rgba(32, 28, 23, .35);
  transform: translateY(18px); opacity: 0; transition: transform .45s var(--ease-out), opacity .45s var(--ease-out);
}
#listen .demo__outcome.show { transform: none; opacity: 1; }
#listen .demo__outcard-k { margin: 0 0 6px; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
#listen .demo__summary { margin: 0; }
#listen .demo__next { margin: 8px 0 0; color: var(--ink2); font-size: 14.5px; }
#listen .demo__next::before { content: "Next: "; font-weight: 600; color: var(--ink); }
#listen .demo__strip { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 18px; }
#listen .demo__striprow { display: flex; align-items: center; gap: 10px; }
#listen .demo__striplabel { flex: none; width: 108px; color: var(--ink3); }
#listen .demo__bars { flex: 1; display: flex; align-items: center; justify-content: center; gap: 2px; height: 22px; overflow: hidden; }
#listen .demo__bars span { flex: none; width: 3px; border-radius: 2px; background: var(--ink); opacity: .6; }
#listen .demo__bars--ai span { background: var(--terra); opacity: .75; }
#listen .demo__again { align-self: flex-start; }

#listen .demo__controls { grid-area: 4 / 1; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-block: 16px; margin-top: auto; }
#listen .demo__ctrlbtns { display: flex; gap: 8px; }
#listen .demo__iconbtn {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border: 0; border-radius: 999px; background: var(--paper2); color: var(--ink2); cursor: pointer;
  transition: background-color .2s, color .2s;
}
#listen .demo__iconbtn:hover { background: var(--rule); color: var(--ink); }
#listen .demo__iconbtn:disabled { opacity: .4; cursor: default; }
#listen [data-role="play"] svg { display: none; }
#listen [data-role="play"] svg.show { display: block; }
#listen .demo__toggle { display: flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--paper2); }
#listen .demo__seg {
  border: 0; background: transparent; height: 34px; padding: 0 18px; border-radius: 999px;
  font: 600 13.5px/1 var(--sans); color: var(--ink2); cursor: pointer; transition: background-color .25s, color .25s;
}
#listen [data-role="seg-ai"][aria-pressed="true"] { background: var(--ai); color: var(--paper); }
#listen [data-role="seg-me"][aria-pressed="true"] { background: var(--you); color: var(--paper); }
#listen .demo__seg:disabled { opacity: .5; cursor: default; }

@media (max-width: 880px) {
  #listen .demo__stage { grid-template-columns: 1fr; margin-top: 22px; }
  #listen .demo__card { height: clamp(560px, 78vh, 700px); padding: 18px 16px 0; }
  #listen .demo__content .demo__linenote.demo__note { display: block; }
  #listen .demo__outcome { margin: 0 -16px; }
  #listen .demo__tag { width: 58px; }
  #listen .demo__meta { min-height: 68px; align-content: flex-start; }
}
@media (min-width: 881px) {
  #listen .demo__notes { display: flex; }
  #listen .demo__content .demo__linenote.demo__note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  #listen .demo__line { opacity: 1; transform: none; transition: none; }
  #listen .demo__text .w { opacity: 1; transform: none; transition: none; }
  #listen .demo__gloss { opacity: 1; transition: none; }
  #listen aside .demo__note { opacity: 1; transform: none; transition: none; }
  #listen .demo__outcome { transform: none; opacity: 1; transition: none; }
  #listen .demo__wave .bar { animation: none !important; }
}
