/* Slice S8 — staff shared inbox (.ib-…) and the AI phone-call simulator (.ph-…). Tokens only (tokens.css). */

/* =================================================================== inbox */
.page[data-route^="/app/inbox"] { animation-name: ib-fade; }
@keyframes ib-fade { from { opacity: 0; } to { opacity: 1; } }

.ib { position: relative; min-width: 0; }
.ib-list { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ib-thread, .ib-side { min-width: 0; min-height: 0; }
.ib[data-view="list"] .ib-thread { display: none; }
.ib[data-view="thread"] .ib-list { display: none; }
.ib-side { display: none; }

/* ---- list head ---- */
.ib-list-head { display: flex; flex-direction: column; gap: 12px; padding-bottom: 12px; }
.ib-list-titles { display: flex; flex-direction: column; gap: 4px; }
.ib-h1 { font-size: clamp(26px, 6vw, 32px); }
.ib-sub { color: var(--ink-2); font-size: var(--fs-sm); max-width: 46ch; }
.ib-search { width: 100%; }
.ib-search .input { border-radius: var(--radius-pill); background: var(--surface); }
.ib-filters .segmented { width: 100%; }
.ib-filters .segmented-item { flex: 1 1 auto; white-space: nowrap; }

.ib-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--grad-glow), var(--surface);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-1);
}
.ib-stats-ring {
  --p: 0;
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: conic-gradient(var(--purple) calc(var(--p) * 1%), var(--purple-soft) 0);
}
.ib-stats-ring span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--purple);
  font-variant-numeric: tabular-nums;
}
.ib-stats-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ib-stats-main { font-weight: 600; font-size: 14px; line-height: 1.35; }
.ib-stats-sub { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--success-ink); font-weight: 600; }
.ib-stats-sub svg { flex: none; }

/* ---- rows ---- */
.ib-rows { display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.ib-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border-radius: var(--radius);
  text-align: left;
  color: var(--ink);
  background: transparent;
  transition: background-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.ib-row:hover { background: rgba(22, 0, 85, .045); }
.ib-row.is-selected { background: var(--surface); box-shadow: var(--shadow-1), inset 3px 0 0 var(--purple); }
.ib-row:focus-visible { outline: var(--focus); outline-offset: -2px; }
.ib-row-av { position: relative; flex: none; }
.ib-row-ch {
  position: absolute;
  right: -3px;
  bottom: -3px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  color: #fff;
  background: var(--whatsapp);
}
.ib-row.is-selected .ib-row-ch { border-color: var(--surface); }
.ib-ch-voice.ib-row-ch { background: var(--purple); }
.ib-ch-sms.ib-row-ch { background: var(--blue); }
.ib-row-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.ib-row-top, .ib-row-bottom { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ib-row-name { flex: 1; font-weight: 500; font-size: 15px; }
.ib-row-time { flex: none; font-size: 12px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.ib-row-preview { flex: 1; font-size: 13.5px; color: var(--ink-2); }
.ib-row.is-unread .ib-row-name { font-weight: 700; }
.ib-row.is-unread .ib-row-preview { color: var(--ink); font-weight: 500; }
.ib-row.is-unread .ib-row-time { color: var(--purple); font-weight: 600; }
.ib-row-unread {
  flex: none;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--purple);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.ib-row-tags { display: flex; gap: 6px; margin-top: 3px; }
.ib-row-tags .badge { height: 22px; font-size: 11.5px; }
.ib-row-skel { display: flex; align-items: center; gap: 12px; padding: 12px; }

/* ---- thread ---- */
.ib-thread {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  overflow: hidden;
}
.ib[data-view="thread"] .ib-thread {
  position: fixed;
  top: calc(var(--topbar-h) + var(--safe-top));
  bottom: calc(var(--tabbar-h) + var(--safe-bottom));
  left: 0;
  right: 0;
  z-index: 15;
}
.ib-th-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.ib-th-who { flex: 1; min-width: 0; }
.ib-th-name { font-family: var(--font-ui); font-size: 16px; font-weight: 600; letter-spacing: -0.005em; line-height: 1.25; }
.ib-th-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 2px; font-size: 12.5px; color: var(--ink-2); }
.ib-ch-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--success-tint);
  color: var(--success-ink);
  font-size: 11.5px;
  font-weight: 600;
}
.ib-ch-pill.ib-ch-voice { background: var(--purple-tint); color: var(--purple); }
.ib-ch-pill.ib-ch-sms { background: var(--info-tint); color: var(--info-ink); }
.ib-th-actions { display: flex; align-items: center; gap: 6px; flex: none; }

.ib-banner {
  flex: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 10px 12px 10px 16px;
  background: var(--purple-light);
  border-bottom: 1px solid var(--line-soft);
}
.ib-banner.is-human { background: var(--warning-tint); }
.ib-banner-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--warning-ink);
  box-shadow: var(--shadow-1);
}
.ib-banner-text { min-width: 0; flex: 1 1 180px; }
.ib-banner .ib-handoff-btn { flex: none; margin-left: auto; }
.ib-banner-title { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.ib-banner-body { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }

.ib-msgs {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 14px 20px;
  background: var(--cream-light);
}
.ib-day, .ib-call-sep { display: flex; justify-content: center; margin: 14px 0 8px; }
.ib-day span {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}
.ib-call-sep span {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--purple-tint);
  color: var(--purple);
  font-size: 12px;
  font-weight: 600;
}
.ib-call-sep.is-end span { background: var(--sand); color: var(--ink-2); }
.ib-call-outcome { padding: 1px 8px; border-radius: var(--radius-pill); background: var(--surface); color: var(--ink); font-weight: 700; }
.ib-call-outcome.is-booked { color: var(--success-ink); }
.ib-call-outcome.is-handoff { color: var(--warning-ink); }
.ib-call-outcome.is-red_flag { color: var(--danger-ink); }

.ib-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: min(78%, 560px); margin: 5px 0; }
.ib-msg.is-out { align-self: flex-end; align-items: flex-end; }
.ib-msg-from { display: flex; align-items: center; gap: 5px; margin: 0 6px 3px; font-size: 11.5px; font-weight: 600; color: var(--ink-muted); }
.ib-msg.is-leona .ib-msg-from { color: var(--purple); }
.ib-bubble {
  padding: 9px 13px 10px;
  border-radius: 18px 18px 18px 6px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  box-shadow: 0 1px 1px rgba(22, 0, 85, .04);
  font-size: 14.5px;
  line-height: 1.45;
  min-width: 0;
  max-width: 100%;
}
.ib-msg.is-out .ib-bubble { border-radius: 18px 18px 6px 18px; }
.ib-msg.is-leona .ib-bubble { background: var(--purple-tint); border-color: transparent; }
.ib-msg.is-staff .ib-bubble, .ib-msg.is-doctor .ib-bubble { background: var(--purple); border-color: transparent; color: var(--on-dark); }
.ib-msg.is-voice.is-patient .ib-bubble { border-style: dashed; border-color: var(--line-strong); }
.ib-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.ib-msg.is-staff .ib-link { color: var(--lavender); }
.ib-link { word-break: break-all; }
.ib-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ib-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(37, 0, 142, .22);
  background: rgba(255, 255, 255, .6);
  color: var(--purple);
  font-size: 12.5px;
  font-weight: 600;
  cursor: default;
}
.ib-btn.is-link { border-style: dashed; }
.ib-meta { display: flex; align-items: center; gap: 8px; margin: 3px 6px 0; font-size: 11px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.ib-meta-ch { display: inline-flex; align-items: center; gap: 3px; }
.ib-meta-kind { padding: 0 6px; border-radius: var(--radius-pill); background: rgba(37, 0, 142, .07); color: var(--purple); font-weight: 600; }
.ib-no-msgs { margin: auto; max-width: 360px; }
.ib-skel-bubble { display: flex; margin: 8px 0; }
.ib-skel-bubble.is-out { justify-content: flex-end; }
.ib-thread-loading { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.ib-thread-error { padding: 12px; display: flex; flex-direction: column; gap: 12px; }

.ib-composer {
  flex: none;
  padding: 10px 12px 10px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.ib-composer-row { display: flex; align-items: flex-end; gap: 8px; }
.ib-input.textarea {
  flex: 1;
  min-height: 44px;
  max-height: 160px;
  padding: 11px 16px;
  border-radius: 22px;
  resize: none;
  line-height: 1.4;
}
.ib-send.btn { width: 44px; padding: 0; flex: none; }
.ib-hint { margin: 6px 6px 0; font-size: 12px; color: var(--ink-muted); }

.ib-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 1;
  padding: 48px 24px;
  text-align: center;
  background: var(--grad-glow), var(--surface);
}
.ib-pick-mark {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-2);
  margin-bottom: 6px;
}
.ib-pick-title { font-size: var(--fs-xl); }
.ib-pick-text { max-width: 38ch; color: var(--ink-2); }

/* ---- patient panel ---- */
.ib-side-inner { display: flex; flex-direction: column; gap: 18px; }
.ib-pt-head { display: flex; align-items: center; gap: 14px; }
.ib-pt-who { min-width: 0; }
.ib-pt-name { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 500; letter-spacing: var(--track-tight); line-height: 1.2; }
.ib-pt-sub { color: var(--ink-2); font-size: 13.5px; margin-top: 2px; }
.ib-pt-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ib-pt-note { color: var(--ink-2); font-size: 14px; }
.ib-pt-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ib-pt-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--cream-light);
  border: 1px solid var(--line-soft);
  min-width: 0;
}
.ib-pt-stat span { font-size: 11.5px; color: var(--ink-muted); }
.ib-pt-stat strong { font-size: 15px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-pt-block { display: flex; flex-direction: column; gap: 8px; }
.ib-pt-label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.ib-pt-family { display: flex; flex-wrap: wrap; gap: 6px; }
.ib-pt-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 10px;
  border-radius: var(--radius-pill);
  background: var(--purple-light);
  font-size: 13px;
  font-weight: 500;
}
.ib-pt-chip small { color: var(--ink-muted); font-size: 11.5px; }
.ib-pt-appts { display: flex; flex-direction: column; gap: 8px; }
.ib-appt {
  --dc: var(--violet);
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  box-shadow: inset 3px 0 0 var(--dc);
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.ib-appt:hover { border-color: var(--line-strong); box-shadow: inset 3px 0 0 var(--dc), var(--shadow-1); }
.ib-appt-when { display: flex; flex-direction: column; flex: none; min-width: 64px; font-size: 13px; font-variant-numeric: tabular-nums; }
.ib-appt-when span { color: var(--ink-2); }
.ib-appt-what { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: 13.5px; font-weight: 500; }
.ib-appt-what small { color: var(--ink-muted); font-weight: 400; font-size: 12px; }
.ib-pt-empty { color: var(--ink-muted); font-size: 13.5px; }
.ib-pt-actions { display: flex; flex-direction: column; gap: 6px; }

/* ---- responsive ---- */
@media (max-width: 1279px) {
  .ib-try.btn { width: var(--btn-h); padding: 0; }
  .ib-try .btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 519px) {
  .ib-ch-lbl { display: none; }
  .ib-ch-pill { padding: 3px 6px; }
  .ib-banner { padding: 8px 12px; }
  .ib-banner-mark, .ib-banner-body { display: none; }
  .ib-banner-text { flex-basis: 120px; }
}
@media (max-width: 899px) {
  .ib-list-head { padding-top: 2px; }
  .ib-thread .ib-msg { max-width: 86%; }
  .ib-composer { padding-bottom: 10px; }
}
@media (min-width: 900px) {
  .ib {
    display: grid;
    grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
    gap: 20px;
    height: calc(100dvh - var(--topbar-h) - var(--tabbar-h) - 52px - var(--safe-top) - var(--safe-bottom));
    min-height: 460px;
  }
  .ib[data-view] .ib-list, .ib[data-view] .ib-thread { display: flex; }
  .ib[data-view="thread"] .ib-thread { position: relative; inset: auto; z-index: auto; }
  .ib-thread { border-radius: var(--radius-lg); border: 1px solid var(--line-soft); box-shadow: var(--shadow-2); }
  .ib-rows { flex: 1; overflow-y: auto; margin: 0 -6px; padding: 0 6px 12px; scrollbar-width: thin; }
  .ib-back { display: none; }
  .ib-th-head { padding: 12px 16px; }
  .ib-msgs { padding: 18px 24px 24px; }
  .ib-composer { padding: 12px 16px 12px; }
}
@media (min-width: 1024px) {
  .ib { height: calc(100dvh - var(--topbar-h) - 84px); }
  .ib-list-titles { display: none; }
}
@media (min-width: 1200px) {
  .ib { grid-template-columns: minmax(300px, 340px) minmax(0, 1fr); }
}
@media (min-width: 1320px) {
  .ib { grid-template-columns: minmax(300px, 340px) minmax(0, 1fr) 300px; }
  .ib-side {
    display: block;
    overflow-y: auto;
    padding: 20px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--line-soft);
    box-shadow: var(--shadow-1);
  }
  .ib-side:empty { display: none; }
  .ib:has(.ib-side:empty) { grid-template-columns: minmax(300px, 340px) minmax(0, 1fr); }
  .ib-side-btn { display: none; }
}

/* =================================================================== phone simulator */
.ph {
  --ph-ink: var(--on-dark);
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--grad-glow), var(--cream);
  color: var(--ink);
}
.ph-top {
  width: 100%;
  max-width: 1120px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(14px + var(--safe-top)) 20px 10px;
}
.ph-top-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 0; }
.ph-top-title { font-weight: 600; font-size: 14px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-top-spacer { flex: 1; }
.ph-layout {
  width: 100%;
  max-width: 1120px;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-items: start;
  gap: 32px;
  padding: 8px 20px 24px;
}
.ph-intro { display: none; }

/* the phone */
.ph-device {
  position: relative;
  width: 100%;
  max-width: 400px;
  height: min(800px, calc(100dvh - 150px));
  min-height: 560px;
  border-radius: 44px;
  padding: 10px;
  background: var(--purple-dark);
  box-shadow: var(--shadow-3), inset 0 0 0 2px rgba(255, 255, 255, .06);
}
.ph-screen {
  position: relative;
  height: 100%;
  border-radius: 34px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--cream-light);
}
.ph-notch {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 96px;
  height: 26px;
  transform: translateX(-50%);
  border-radius: var(--radius-pill);
  background: var(--purple-dark);
  z-index: 3;
}
.ph-status { display: flex; justify-content: space-between; padding: 12px 26px 4px; font-size: 12.5px; font-weight: 600; color: var(--ink); z-index: 2; }
.ph-screen.is-call .ph-status { color: var(--ph-ink); }

/* picker screen */
.ph-pick { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 18px 18px 18px; gap: 14px; overflow-y: auto; scrollbar-width: none; }
.ph-pick::-webkit-scrollbar { display: none; }
.ph-pick-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding-top: 12px; }
.ph-clinic-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-2);
}
.ph-clinic-name { font-size: var(--fs-xl); }
.ph-clinic-sub { color: var(--ink-2); font-size: 13.5px; }
.ph-label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); margin-top: 4px; }
.ph-personas { display: flex; flex-direction: column; gap: 8px; }
.ph-persona {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  text-align: left;
  transition: border-color var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}
.ph-persona:hover { border-color: var(--line-strong); }
.ph-persona.is-selected { border-color: var(--purple); box-shadow: var(--shadow-1), var(--ring); }
.ph-persona-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ph-persona-name { font-weight: 600; font-size: 14.5px; }
.ph-persona-sub { font-size: 12.5px; color: var(--ink-2); }
.ph-persona-phone { font-size: 12px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.ph-persona-check { color: var(--purple); opacity: 0; transition: opacity var(--dur-2) var(--ease); }
.ph-persona.is-selected .ph-persona-check { opacity: 1; }
.ph-custom { display: flex; flex-direction: column; gap: 8px; }
.ph-dial {
  position: sticky;
  bottom: -18px;
  margin: auto -18px -18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 18px 16px;
  background: linear-gradient(to bottom, rgba(251, 249, 247, 0) 0, var(--cream-light) 22px);
}
.ph-call-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  border-radius: var(--radius-pill);
  background: var(--green);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 10px 24px rgba(0, 189, 129, .32);
  transition: transform var(--dur-1) var(--ease), background-color var(--dur-2) var(--ease);
}
.ph-call-btn:hover { background: #00a974; }
.ph-call-btn:active { transform: scale(.98); }
.ph-call-btn:disabled { opacity: .5; }
.ph-dial-note { font-size: 12px; color: var(--ink-muted); text-align: center; }
.ph-warn { font-size: 12.5px; }

/* in-call screen */
.ph-screen.is-call { background: radial-gradient(120% 70% at 50% 0%, #3a1aa8 0%, var(--purple) 38%, var(--purple-dark) 100%); color: var(--ph-ink); }
.ph-call { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ph-call-head { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 20px 0; text-align: center; }
.ph-call-name { font-family: var(--font-display); font-size: 22px; font-weight: 500; color: var(--ph-ink); letter-spacing: var(--track-tight); }
.ph-call-timer { font-size: 13.5px; color: var(--on-dark-2); font-variant-numeric: tabular-nums; }
.ph-call-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .1);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ph-ink);
}
.ph-call-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--lavender); }
.ph-call[data-mode="listening"] .ph-call-status i { background: var(--green); animation: ph-blink 1.2s infinite; }
.ph-call[data-mode="speaking"] .ph-call-status i { background: var(--peach); }
@keyframes ph-blink { 50% { opacity: .3; } }

.ph-orb-wrap { position: relative; display: grid; place-items: center; height: 150px; flex: none; }
.ph-orb {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0%, var(--lavender) 28%, var(--lavender-2) 55%, var(--peach) 100%);
  box-shadow: 0 0 40px rgba(196, 175, 250, .55), 0 0 90px rgba(248, 199, 173, .25);
  transition: transform var(--dur-3) var(--ease);
}
.ph-orb::before, .ph-orb::after {
  content: '';
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 2px solid rgba(196, 175, 250, .35);
  opacity: 0;
}
.ph-call[data-mode="speaking"] .ph-orb { animation: ph-breathe 1.1s ease-in-out infinite; }
.ph-call[data-mode="speaking"] .ph-orb::before { animation: ph-ring 1.6s ease-out infinite; }
.ph-call[data-mode="speaking"] .ph-orb::after { animation: ph-ring 1.6s ease-out .8s infinite; }
.ph-call[data-mode="listening"] .ph-orb { transform: scale(.86); }
.ph-call[data-mode="thinking"] .ph-orb { animation: ph-spin 2.4s linear infinite; background: conic-gradient(from 0deg, var(--lavender), var(--peach), var(--lavender-2), var(--lavender)); }
.ph-call[data-mode="muted"] .ph-orb, .ph-call[data-mode="typing"] .ph-orb { transform: scale(.8); filter: saturate(.5); }
@keyframes ph-breathe { 50% { transform: scale(1.1); } }
@keyframes ph-ring { from { opacity: .9; transform: scale(.85); } to { opacity: 0; transform: scale(1.5); } }
@keyframes ph-spin { to { transform: rotate(360deg) scale(.9); } }
.ph-wave { position: absolute; bottom: 8px; display: flex; align-items: center; gap: 4px; height: 26px; }
.ph-wave span { width: 4px; height: 6px; border-radius: 3px; background: rgba(251, 249, 247, .55); transition: height 120ms var(--ease); }
.ph-call[data-mode="listening"] .ph-wave span, .ph-call[data-mode="speaking"] .ph-wave span { animation: ph-bar .9s ease-in-out infinite; }
.ph-call[data-mode="speaking"] .ph-wave span { background: var(--peach); }
.ph-wave span:nth-child(2) { animation-delay: .1s !important; }
.ph-wave span:nth-child(3) { animation-delay: .25s !important; }
.ph-wave span:nth-child(4) { animation-delay: .05s !important; }
.ph-wave span:nth-child(5) { animation-delay: .3s !important; }
.ph-wave span:nth-child(6) { animation-delay: .15s !important; }
.ph-wave span:nth-child(7) { animation-delay: .2s !important; }
@keyframes ph-bar { 0%, 100% { height: 6px; } 50% { height: 24px; } }

.ph-transcript {
  flex: 1;
  min-height: 96px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 14px 12px;
  scrollbar-width: thin;
  mask-image: linear-gradient(to bottom, transparent 0, #000 18px);
}
.ph-bubble {
  max-width: 88%;
  padding: 8px 12px 9px;
  border-radius: 16px 16px 16px 5px;
  background: rgba(255, 255, 255, .12);
  color: var(--ph-ink);
  font-size: 13.5px;
  line-height: 1.45;
  animation: ph-pop var(--dur-3) var(--ease-out);
}
.ph-bubble b { display: flex; align-items: center; gap: 5px; margin-bottom: 2px; font-size: 11px; font-weight: 600; color: var(--lavender); letter-spacing: .02em; }
.ph-bubble.is-me { align-self: flex-end; border-radius: 16px 16px 5px 16px; background: var(--surface); color: var(--ink); }
.ph-bubble.is-me b { color: var(--ink-muted); justify-content: flex-end; }
.ph-bubble.is-interim { opacity: .65; font-style: italic; }
@keyframes ph-pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.ph-type { display: flex; flex-direction: column; gap: 8px; padding: 0 14px 10px; }
.ph-type-row { display: flex; gap: 8px; }
.ph-type-row .input { flex: 1; min-height: 44px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, .96); }
.ph-type-row .btn { width: 44px; padding: 0; flex: none; }
.ph-phrases { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.ph-phrases::-webkit-scrollbar { display: none; }
.ph-phrase {
  flex: none;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .12);
  color: var(--ph-ink);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, .14);
}
.ph-phrase:hover { background: rgba(255, 255, 255, .2); }
.ph-notice { margin: 0 14px 8px; padding: 8px 12px; border-radius: var(--radius-sm); background: rgba(255, 166, 0, .16); color: var(--ph-ink); font-size: 12.5px; }

.ph-controls { flex: none; display: flex; justify-content: space-evenly; align-items: flex-start; padding: 8px 12px calc(16px + var(--safe-bottom)); }
.ph-ctrl { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; color: var(--on-dark-2); min-width: 64px; }
.ph-ctrl-btn {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: var(--ph-ink);
  transition: background-color var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}
.ph-ctrl-btn:hover { background: rgba(255, 255, 255, .22); }
.ph-ctrl-btn:active { transform: scale(.94); }
.ph-ctrl-btn[aria-pressed="true"] { background: var(--cream-light); color: var(--purple); }
.ph-ctrl-btn.is-hangup { background: var(--red); color: #fff; box-shadow: 0 10px 24px rgba(255, 57, 86, .35); }
.ph-ctrl-btn.is-hangup:hover { background: var(--danger-strong); }
.ph-ctrl-btn:focus-visible { outline: var(--focus-on-dark); outline-offset: 3px; }

/* ringing */
.ph-ringing { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 20px; }
.ph-ring-mark { position: relative; display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; background: var(--surface); }
.ph-ring-mark::before, .ph-ring-mark::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(196, 175, 250, .6); animation: ph-ring 1.4s ease-out infinite; }
.ph-ring-mark::after { animation-delay: .7s; }
.ph-ringing p { color: var(--on-dark-2); }

/* ended screen */
.ph-ended { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 20px 18px 20px; }
.ph-ended-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding-top: 8px; }
.ph-ended-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--sand); color: var(--ink-2); }
.ph-ended-icon.is-booked { background: var(--success-tint); color: var(--success-ink); }
.ph-ended-title { font-size: var(--fs-lg); }
.ph-ended-sub { color: var(--ink-2); font-size: 13.5px; }
.ph-booked {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-2);
  border: 1px solid var(--line-soft);
}
.ph-booked-top { display: flex; align-items: center; gap: 10px; }
.ph-booked-wa { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--whatsapp); color: #fff; flex: none; }
.ph-booked-title { font-weight: 700; font-size: 15px; }
.ph-booked-sub { font-size: 12.5px; color: var(--ink-2); }
.ph-booked-when { font-family: var(--font-display); font-size: 20px; font-weight: 500; letter-spacing: var(--track-tight); }
.ph-booked-meta { font-size: 13.5px; color: var(--ink-2); }
.ph-booked-money { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--success-tint); color: var(--success-ink); font-size: 13px; font-weight: 600; }
.ph-ended-actions { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.ph-log { display: flex; flex-direction: column; gap: 6px; }
.ph-log p { font-size: 13px; line-height: 1.45; padding: 8px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-soft); }
.ph-log p.is-me { background: var(--purple-light); border-color: transparent; }
.ph-log b { display: block; font-size: 11px; color: var(--ink-muted); }

.ph-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 560px;
  padding: 0 20px calc(18px + var(--safe-bottom));
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-2);
}
.ph-foot svg { flex: none; color: var(--purple); }

@media (max-width: 519px) {
  .ph-top { padding: calc(10px + var(--safe-top)) 14px 6px; }
  .ph-layout { padding: 0 0 12px; }
  .ph-device {
    max-width: none;
    height: calc(100dvh - 64px - var(--safe-top));
    min-height: 520px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .ph-screen { border-radius: 24px 24px 0 0; box-shadow: var(--shadow-2); }
  .ph-notch, .ph-status { display: none; }
  .ph-pick { padding-top: 18px; }
  .ph-foot { display: none; }
}
@media (min-width: 960px) {
  .ph-layout { grid-template-columns: minmax(0, 1fr) 400px; align-items: center; gap: 56px; padding-top: 16px; }
  .ph-intro { display: flex; flex-direction: column; gap: 18px; max-width: 480px; justify-self: end; }
  .ph-intro h1 { font-size: clamp(34px, 3.6vw, 46px); }
  .ph-intro .lead { max-width: 44ch; }
  .ph-points { display: flex; flex-direction: column; gap: 12px; margin: 4px 0 0; padding: 0; list-style: none; }
  .ph-points li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; color: var(--ink-2); }
  .ph-points li svg { flex: none; margin-top: 2px; color: var(--purple); }
  .ph-points strong { color: var(--ink); }
}
@media (max-height: 860px) {
  .ph-orb-wrap { height: 104px; }
  .ph-orb { width: 68px; height: 68px; }
  .ph-wave { bottom: 2px; height: 20px; }
  .ph-call-head { padding-top: 4px; }
  .ph-call-name { font-size: 19px; }
  .ph-ctrl-btn { width: 50px; height: 50px; }
  .ph-controls { padding-top: 4px; padding-bottom: calc(12px + var(--safe-bottom)); }
}
.ph-call.is-typing .ph-orb-wrap { height: 84px; }
.ph-call.is-typing .ph-orb { width: 56px; height: 56px; }
.ph-call.is-typing .ph-orb::before, .ph-call.is-typing .ph-orb::after { inset: -8px; }
.ph-call.is-typing .ph-wave { display: none; }
.ph-call.is-typing .ph-orb-wrap { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  .ph-orb, .ph-orb::before, .ph-orb::after, .ph-wave span, .ph-ring-mark::before, .ph-ring-mark::after { animation: none !important; }
}
