/* Hero recorded-call player. Layout: chat card in the hero visual, with low-opacity
   layered panels behind it. Transcript motion uses transform/opacity only. */
.hero .hero-visual{
  --hp-radius:1.75rem;
  --hp-pad:1.25rem;
  position:relative;
  display:flex;
  flex-direction:column;
  width:100%;
  max-width:40rem;
  justify-self:end;
  overflow:visible;
}
.hp{position:relative;width:100%;}
.hp button{appearance:none;-webkit-appearance:none;font:inherit;color:inherit;}
.hp-stage{
  position:absolute;
  inset:-8% -12% -6%;
  pointer-events:none;
  z-index:0;
}
.hp-panel{
  position:absolute;
  border-radius:1.35rem;
  border:1px solid rgba(52,175,242,.1);
  background:
    linear-gradient(180deg, rgba(13,24,32,.55), rgba(9,14,18,.4)),
    repeating-linear-gradient(180deg, transparent 0 14px, rgba(244,243,245,.035) 14px 15px);
  box-shadow:0 24px 60px rgba(0,0,0,.28);
  opacity:.34;
  filter:saturate(.7);
}
.hp-panel::before,
.hp-panel::after{
  content:"";
  position:absolute;
  left:12%;
  right:18%;
  height:6px;
  border-radius:99px;
  background:rgba(244,243,245,.08);
}
.hp-panel::before{top:14%;}
.hp-panel::after{top:22%;width:46%;right:auto;}
.hp-panel-a{top:2%;left:0;width:58%;height:62%;transform:rotate(-7deg) translateX(-6%);opacity:.22;}
.hp-panel-b{top:8%;right:0;width:62%;height:70%;transform:rotate(6.5deg) translateX(8%);opacity:.2;
  background:
    linear-gradient(180deg, rgba(8,30,36,.5), rgba(9,14,18,.35)),
    radial-gradient(circle at 70% 30%, rgba(44,227,192,.1), transparent 50%);}
.hp-panel-c{bottom:4%;left:10%;width:70%;height:48%;transform:rotate(-3deg);opacity:.16;}

.hp-card{
  position:relative;
  z-index:1;
  display:flex;
  flex-direction:column;
  padding:1.15rem 1.15rem 1rem;
  border-radius:var(--hp-radius);
  background:linear-gradient(180deg, rgba(18,28,36,.96), rgba(10,14,20,.98));
  border:1px solid rgba(52,175,242,.18);
  box-shadow:
    0 0 0 1px rgba(44,227,192,.06),
    0 1px 0 rgba(255,255,255,.06) inset,
    0 8px 24px rgba(0,0,0,.28);
}
.hp-card::before{
  content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;
  background:linear-gradient(180deg, rgba(244,243,245,.05), transparent 22%);
}
/* No stacked under-layers or large halo; depth comes from the card border and a tight shadow. */
.hp::before,.hp::after{content:none;display:none;}

.hp-head{
  display:grid;
  grid-template-columns:auto 1fr;
  grid-template-areas:"brand vert" "play play";
  gap:.85rem .75rem;
  align-items:center;
  padding:.15rem .15rem .95rem;
  border-bottom:1px solid rgba(244,243,245,.07);
}
.hp-brand{grid-area:brand;display:flex;align-items:center;gap:.65rem;min-width:0;}
.hp-mark{
  flex:none;
  width:2.15rem;height:2.15rem;
  color:var(--label-teal);
}
.hp-mark svg{width:100%;height:100%;display:block;}
.hp-brand-copy{display:flex;flex-direction:column;gap:.1rem;min-width:0;}
.hp-brand-name{font-size:var(--fs-body-sm);font-weight:600;color:var(--text);letter-spacing:.01em;line-height:1.2;}
.hp-brand-sub{font-size:var(--fs-caption);color:var(--muted);line-height:1.2;}

.hp-vert{grid-area:vert;justify-self:end;position:relative;}
.hp-vert-btn{
  display:inline-flex;align-items:center;gap:.45rem;
  min-height:2.35rem;padding:.35rem .8rem .35rem .95rem;
  border-radius:999px;
  border:1px solid rgba(244,243,245,.14);
  background:rgba(244,243,245,.04);
  color:var(--text);
  font:inherit;font-size:var(--fs-small);font-weight:550;
  cursor:pointer;
}
.hp-vert-btn:hover{background:rgba(244,243,245,.07);border-color:rgba(244,243,245,.22);}
.hp-vert-btn:focus-visible{outline:2px solid var(--label-teal);outline-offset:3px;}
.hp-vert-btn svg{width:11px;height:11px;transition:transform .2s var(--ease-out,cubic-bezier(.22,1,.36,1));}
.hp-vert.is-open .hp-vert-btn svg{transform:rotate(180deg);}
.hp-vert-menu{
  position:absolute;top:calc(100% + .45rem);right:0;z-index:20;
  min-width:13.5rem;margin:0;padding:.4rem;
  list-style:none;
  border-radius:1rem;
  background:#10161c;
  border:1px solid rgba(244,243,245,.1);
  box-shadow:0 18px 40px rgba(0,0,0,.45),0 0 0 1px rgba(15,121,156,.12);
}
.hp-vert-menu[hidden]{display:none;}
.hp-vert-option{
  display:flex;align-items:center;justify-content:space-between;gap:.75rem;
  width:100%;padding:.7rem .8rem;
  border:0;border-radius:.7rem;
  background:transparent;color:var(--text);
  font:inherit;font-size:var(--fs-small);text-align:left;cursor:pointer;
}
.hp-vert-option:hover,.hp-vert-option:focus-visible{background:rgba(44,227,192,.1);outline:none;}
.hp-vert-option[aria-selected="true"]{color:var(--label-teal);}
.hp-vert-option[aria-disabled="true"]{
  color:var(--muted);cursor:not-allowed;opacity:.72;
  background:transparent;
}
.hp-vert-option[aria-disabled="true"]:hover{background:transparent;}
.hp-soon{font-size:var(--fs-caption);color:var(--subtle);font-weight:500;letter-spacing:.02em;}

.hp-transport{grid-area:play;display:grid;grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:"play wave time";align-items:center;gap:.75rem;min-width:0;}
.hp-play{
  flex:none;
  width:2.85rem;height:2.85rem;padding:0;
  border:0;border-radius:50%;
  background:var(--grad-brand,linear-gradient(90deg,#2CE3C0,#34AFF2));
  color:#07211d;
  box-shadow:0 8px 20px rgba(44,227,192,.22),0 0 0 1px rgba(52,175,242,.25);
  cursor:pointer;display:grid;place-items:center;
}
.hp-play:hover{filter:brightness(1.06);}
.hp-play:focus-visible{outline:2px solid var(--label-teal);outline-offset:3px;}
.hp-play svg{width:1.05rem;height:1.05rem;display:block;}
.hp-play .hp-ic-pause{display:none;}
.hp.is-playing .hp-play .hp-ic-play{display:none;}
.hp.is-playing .hp-play .hp-ic-pause{display:block;}

.hp-wave{
  position:relative;display:flex;align-items:center;gap:1.5px;
  height:2.35rem;min-width:0;max-width:100%;padding:0 .15rem;cursor:pointer;
  overflow:hidden;
  grid-area:wave;
}
.hp-bar{
  flex:1 1 0;min-width:0;
  height:var(--h,30%);
  max-height:100%;
  border-radius:99px;
  background:rgba(244,243,245,.22);
  transform-origin:center;
}
.hp-bar.is-played{background:var(--label-teal);box-shadow:0 0 8px rgba(44,227,192,.28);}
.hp-playhead{
  position:absolute;top:12%;bottom:12%;width:2px;margin-left:-1px;
  border-radius:99px;background:#fff;
  box-shadow:0 0 10px rgba(44,227,192,.8);
  pointer-events:none;
}
.hp-play{grid-area:play;}
.hp-time{
  grid-area:time;
  font-family:var(--font-mono,ui-monospace,monospace);
  font-size:var(--fs-caption);
  font-variant-numeric:tabular-nums;
  color:var(--muted);
  letter-spacing:.02em;white-space:nowrap;
  justify-self:end;
}

.hp-thread{
  position:relative;
  flex:1 1 auto;
  min-height:21rem;
  height:21rem;
  margin:0 -.25rem;
  padding:0;
  overflow:hidden;
}
/* Older messages fade out at the top through a mask; new ones arrive from below the bottom edge. */
@property --hp-fade-a{syntax:'<number>';inherits:false;initial-value:0;}
@property --hp-fade-stop{syntax:'<percentage>';inherits:false;initial-value:34%;}
.hp-thread{
  --hp-fade-a:0;--hp-fade-stop:34%;
  -webkit-mask-image:linear-gradient(180deg,rgba(0,0,0,var(--hp-fade-a)) 0,#000 var(--hp-fade-stop),#000 calc(100% - 1rem),transparent 100%);
  mask-image:linear-gradient(180deg,rgba(0,0,0,var(--hp-fade-a)) 0,#000 var(--hp-fade-stop),#000 calc(100% - 1rem),transparent 100%);
  transition:--hp-fade-a .5s cubic-bezier(.22,1,.36,1),--hp-fade-stop .5s cubic-bezier(.22,1,.36,1);
}
/* Before play the preview is top-anchored and unmasked at the top, so the first line shows in full. */
.hp.is-idle .hp-thread{--hp-fade-a:1;--hp-fade-stop:0%;}
.hp-thread-inner.is-preview{top:0;bottom:auto;padding-top:.35rem;}
.hp-thread-scroller{position:relative;height:100%;overflow:hidden;}
.hp-thread-inner{
  position:absolute;left:0;right:0;bottom:0;
  display:flex;flex-direction:column;gap:.9rem;
  padding:0 .95rem 1.35rem;
  will-change:transform;
  backface-visibility:hidden;
}

.hp-idle{
  margin:auto 0 0;
  padding:1.1rem 1.15rem;
  border-radius:1.2rem;
  color:var(--muted);
  font-size:var(--fs-small);
  line-height:1.5;
  text-align:center;
}

.hp-row{display:flex;flex-direction:column;max-width:86%;gap:.35rem;}
.hp-row.is-agent{align-self:flex-start;align-items:flex-start;}
.hp-row.is-caller{align-self:flex-end;align-items:flex-end;}
.hp-who{
  font-size:var(--fs-caption);
  font-weight:550;
  letter-spacing:.04em;
  text-transform:uppercase;
  color:var(--muted);
  padding:0 .2rem;
}
.hp-bubble{
  padding:1.05rem 1.25rem;
  border-radius:1.3rem;
  font-size:var(--fs-body-sm);
  line-height:1.52;
  color:var(--text);
  box-shadow:0 12px 28px rgba(0,0,0,.28);
}
.hp-row.is-agent .hp-bubble{
  border-radius:1.25rem 1.25rem 1.25rem .45rem;
  background:linear-gradient(180deg, rgba(22,48,54,.95), rgba(12,24,30,.96));
  border:1px solid rgba(44,227,192,.2);
  box-shadow:0 12px 28px rgba(0,0,0,.28), 0 0 0 1px rgba(44,227,192,.05);
}
.hp-row.is-caller .hp-bubble{
  border-radius:1.25rem 1.25rem .45rem 1.25rem;
  background:rgba(244,243,245,.08);
  border:1px solid rgba(244,243,245,.12);
}

/* Motion: the stack container slides up (transform set in JS); entering rows only fade.
   The first message of a call, and the idle prompt on load or switch, fade and rise 12px. */
.hp-row.is-enter,
.hp-typing{animation:hp-fade .42s cubic-bezier(.22,1,.36,1) both;}
.hp-row.is-first{animation:hp-rise-dim .4s cubic-bezier(.22,1,.36,1) both;}
.hp-idle.is-first{animation:hp-rise .4s cubic-bezier(.22,1,.36,1) .12s both;}
@keyframes hp-rise-dim{from{opacity:0;transform:translate3d(0,12px,0);}to{opacity:.5;transform:none;}}
@keyframes hp-fade{from{opacity:0;}to{opacity:1;}}
@keyframes hp-rise{from{opacity:0;transform:translate3d(0,12px,0);}to{opacity:1;transform:none;}}

.hp-typing{
  align-self:flex-start;
  display:inline-flex;align-items:center;gap:.35rem;
  min-height:2.7rem;padding:.85rem 1.1rem;
  border-radius:1.2rem 1.2rem 1.2rem .45rem;
  background:linear-gradient(180deg, rgba(22,48,54,.95), rgba(12,24,30,.96));
  border:1px solid rgba(44,227,192,.18);
}
.hp-typing i{
  width:.42rem;height:.42rem;border-radius:50%;
  background:var(--label-teal);
  opacity:.35;
  animation:hp-dot 1s ease-in-out infinite;
}
.hp-typing i:nth-child(2){animation-delay:.15s;}
.hp-typing i:nth-child(3){animation-delay:.3s;}
@keyframes hp-dot{0%,80%,100%{opacity:.28;transform:translateY(0);}40%{opacity:1;transform:translateY(-2px);}}


@media (prefers-reduced-motion:reduce){
  .hp-row.is-enter,
  .hp-row.is-first,
  .hp-idle.is-first,
  .hp-thread-inner,
  .hp-typing,
  .hp-typing i,
  .hp-vert-btn svg{animation:none;transition:none;transform:none;opacity:1;}
}

@media (max-width:1000px){
  .hero .hero-visual{justify-self:center;max-width:34rem;}
}
@media (max-width:700px){
  .hero .hero-visual{max-width:26.5rem;}
  .hp-thread{height:17rem;min-height:17rem;}
  .hp-transport{
    grid-template-columns:auto 1fr;
    grid-template-areas:"play time" "wave wave";
    gap:.55rem .75rem;
  }
  .hp-wave{gap:0;height:2.15rem;}
  .hp-bubble{padding:.95rem 1.1rem;}
}

/* No container: the player sits on the hero background. The idle prompt is centered in the thread. */
.hp-stage{display:none;}

/* Idle preview: faded first lines in the live stack, a small prompt beneath. */
.hp-row{transition:opacity .45s cubic-bezier(.22,1,.36,1);}
.hp-row.is-pending{opacity:.5;}
.hp-thread-scroller .hp-idle{
  position:absolute;left:0;right:0;bottom:1.1rem;z-index:1;
  margin:0;padding:0 1rem;border-radius:0;
  font-size:var(--fs-caption);letter-spacing:.01em;color:var(--muted);text-align:center;
  transition:opacity .35s ease,transform .35s cubic-bezier(.22,1,.36,1);
}
.hp:not(.is-idle) .hp-thread-scroller .hp-idle{opacity:0;transform:translate3d(0,6px,0);pointer-events:none;}
.hp-thread{min-height:16.5rem;height:16.5rem;}
@media (max-width:700px){.hp-thread{height:15rem;min-height:15rem;}}
@media (prefers-reduced-motion:reduce){.hp-row,.hp-thread-scroller .hp-idle,.hp-thread{transition:none;}}
@media (min-width:1001px){.hp-thread{height:15.25rem;min-height:15.25rem;}}

/* Phones: no waveform. A slim progress track (still the seek slider), a smaller play button,
   and a slightly tighter player. Text stays at 15px or more. */
@media (max-width:767.98px){
  .hp-head{gap:.7rem .6rem;padding:0 0 .8rem;}
  .hp-mark{width:1.85rem;height:1.85rem;}
  .hp-brand-name{font-size:.9375rem;}
  .hp-vert-btn{min-height:2.25rem;padding:.3rem .75rem .3rem .9rem;font-size:.9375rem;}
  .hp-transport{grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:"play wave time";gap:.75rem;}
  .hp-play{width:2.375rem;height:2.375rem;box-shadow:0 6px 16px rgba(44,227,192,.2),0 0 0 1px rgba(52,175,242,.22);}
  .hp-play svg{width:.85rem;height:.85rem;}
  .hp-wave{height:2rem;gap:0;padding:0;touch-action:none;overflow:visible;}
  .hp-wave .hp-bar{display:none;}
  .hp-wave::before,.hp-wave::after{content:"";position:absolute;left:0;top:50%;height:3px;margin-top:-1.5px;border-radius:99px;pointer-events:none;}
  .hp-wave::before{right:0;background:rgba(244,243,245,.14);}
  .hp-wave::after{width:calc(var(--hp-progress,0) * 100%);background:var(--grad-brand,linear-gradient(90deg,#2CE3C0,#34AFF2));box-shadow:0 0 10px rgba(44,227,192,.35);}
  .hp-playhead{top:50%;bottom:auto;width:11px;height:11px;margin:-5.5px 0 0 -5.5px;border-radius:50%;background:#fff;box-shadow:0 0 0 3px rgba(44,227,192,.22),0 0 10px rgba(44,227,192,.6);z-index:1;}
  .hp-time{font-size:.75rem;}
  .hp-thread-inner{gap:.75rem;padding:0 .35rem 1.1rem;}
  .hp-bubble{padding:.8rem 1rem;font-size:.9375rem;line-height:1.5;border-radius:1.1rem;}
  .hp-row.is-agent .hp-bubble{border-radius:1.1rem 1.1rem 1.1rem .4rem;}
  .hp-row.is-caller .hp-bubble{border-radius:1.1rem 1.1rem .4rem 1.1rem;}
  .hp-row{max-width:88%;gap:.3rem;}
  .hp-thread{height:14rem;min-height:14rem;}
}
@media (max-width:767.98px){.hp-card{padding:.95rem .85rem .8rem;border-radius:1.4rem;}}
