/* call-widget.css -- the call page inside the website button's panel.
 *
 * The website button can open this page in a frame inside its own small panel, about 384 px wide
 * and 480 to 620 px tall, on a computer. call-boot.js then marks the page html[data-ui="widget"]
 * before the first paint, and only then does anything here apply: every rule starts with that
 * selector, so the page on its own address looks exactly as before.
 *
 * In the panel the page is the panel's body: the panel's own header already names the business,
 * so the page's header (the Echo Calls mark and the language list) and the business's big name are
 * not drawn. The page is exactly the frame's size and never scrolls as a whole; what does not fit
 * (a ticket, the form, a long notice) scrolls inside the middle, so Start, Mute and End never
 * leave the frame. During the call it keeps the call page's rule: the last two messages whole,
 * the round Mute and End always on screen; the assistant sits small beside its name, as in a
 * call screen's top row. Light, on the page's warm grey, edge to edge.
 */

html[data-ui="widget"],
html[data-ui="widget"] body {
  block-size: 100%;
  overflow: hidden;
  background: var(--ground);
}

/* The whole frame, one column, whatever the frame's shape: a short, wide frame gets the same
   column, never the side-by-side layout the page uses for a phone on its side. */
html[data-ui="widget"] .pc {
  display: flex;
  flex-direction: column;
  block-size: 100%;
  min-block-size: 0;
  max-inline-size: none;
  margin: 0;
  padding-block: 8px 10px;
  padding-inline: 4px;
  --pc-disc: 56px;
}
html[data-ui="widget"] .pc-top { display: none; }

/* The business's name stays for screen readers (the frame's heading), not on screen. */
html[data-ui="widget"] .pc-live__biz {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* The middle takes the room between the top and the buttons and scrolls inside it. Its own
   side padding keeps a ticket's shadow and a focus ring inside the scrolling box. */
html[data-ui="widget"] .pc-main {
  flex: 1 1 auto;
  min-block-size: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  justify-content: center;
  justify-content: safe center;
  gap: 12px;
  padding-block: 8px;
  padding-inline: 12px;
  scrollbar-width: thin;
}

/* -- before the call ------------------------------------------------------- */

/* The screen before the call is the visitor's own: a call starts only when they press Start here.
   The assistant, "You'll speak with ..." and the link's welcome sit together in the middle; Start,
   the fine print and the privacy link stay under them in the frame. */
html[data-ui="widget"] .pc[data-view="ready"] .pc-main {
  justify-content: center;
  justify-content: safe center;
  gap: 8px;
  padding-block-start: 8px;
}
html[data-ui="widget"] .pc-agent { margin-block-start: 2px; font-size: 16px; }
html[data-ui="widget"] .pc-welcome__head { font-size: 18px; }
html[data-ui="widget"] .pc-welcome__line { font-size: 15px; }
html[data-ui="widget"] .pc-cover { block-size: 80px; }
html[data-ui="widget"] .pc[data-view="notice"] .pc-state__title,
html[data-ui="widget"] .pc[data-view="link"] .pc-state__title,
html[data-ui="widget"] .pc[data-view="paused"] .pc-state__title { font-size: 19px; }
html[data-ui="widget"] .pc-help { font-size: 14px; }

/* -- the buttons ----------------------------------------------------------- */

/* Start full width; under it the fine print, then the privacy link and "Powered by" share
   one quiet line. */
html[data-ui="widget"] .pc-dock {
  flex: none;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  column-gap: 12px;
  row-gap: 8px;
  padding-block-start: 6px;
  padding-inline: 12px;
}
html[data-ui="widget"] .pc-dock > * { flex-basis: 100%; }
html[data-ui="widget"] .pc-dock > .pc-privacy,
html[data-ui="widget"] .pc-dock > .pc-powered { flex-basis: auto; }
html[data-ui="widget"] .pc-btn {
  min-height: 52px;
  padding-block: 12px;
  border-radius: 999px;
  font-size: 17px;
}
html[data-ui="widget"] .pc-btn--start { min-height: 56px; }
html[data-ui="widget"] .pc[data-view="ended"] .pc-btn--start[data-tone="secondary"] { min-height: 48px; font-size: 15px; }
html[data-ui="widget"] .pc-btn--audio { min-height: 48px; font-size: 15px; }
html[data-ui="widget"] .pc-fine { max-width: 40ch; font-size: 12px; }
/* A mouse, not a thumb: the panel's call runs only on computers. */
html[data-ui="widget"] .pc-privacy { min-height: 28px; font-size: 12px; }

/* Mute and End: round, a little smaller than on a phone, the label under each. */
html[data-ui="widget"] .pc-incall { gap: 44px; }
html[data-ui="widget"] .pc-ctl { grid-template-rows: 64px auto; row-gap: 4px; }
html[data-ui="widget"] .pc-ctl__label { font-size: 13px; }
html[data-ui="widget"] .pc-round--mute { width: 58px; height: 58px; }
html[data-ui="widget"] .pc-round--mute svg { width: 26px; height: 26px; }
html[data-ui="widget"] .pc-round--end { width: 64px; height: 64px; }
html[data-ui="widget"] .pc-round--end svg { width: 30px; height: 30px; }

/* -- in the call ----------------------------------------------------------- */

/* One short top row (the assistant small, its name, the AI pill), the clock and "listening"
   under it, then the words. The words take the rest and scroll in their own box. */
html[data-ui="widget"] .pc[data-incall="true"] { --pc-disc: 36px; }
html[data-ui="widget"] .pc[data-incall="true"] .pc-main {
  justify-content: flex-start;
  gap: 8px;
  padding-block: 2px 4px;
}
html[data-ui="widget"] .pc[data-incall="true"] .pc-live {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  column-gap: 12px;
  row-gap: 2px;
}
/* By its id: the call page's own short-screen rules put the avatar on a row of its own. */
html[data-ui="widget"] .pc[data-incall="true"] #pc-avatar {
  flex-basis: auto;
  width: calc(var(--pc-disc) * 1.6);
  height: calc(var(--pc-disc) * 1.6);
  margin: 0;
}
@media (min-height: 440px) {
  html[data-ui="widget"] .pc[data-incall="true"]:not([data-screen="open"]) #pc-avatar:not([data-gone="true"]) { display: grid; }
}
@media (max-height: 439px) {
  html[data-ui="widget"] .pc[data-incall="true"] #pc-avatar { display: none; }
}
html[data-ui="widget"] .pc[data-incall="true"] .pc-live__name { font-size: 19px; line-height: 1.3; letter-spacing: -.01em; }
html[data-ui="widget"][dir="rtl"] .pc[data-incall="true"] .pc-live__name { line-height: 1.45; letter-spacing: 0; }
html[data-ui="widget"] .pc[data-incall="true"] .pc-live__pill { min-height: 24px; padding-inline: 10px; font-size: 12px; }
html[data-ui="widget"] .pc[data-incall="true"] .pc-state {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  column-gap: 10px;
  row-gap: 2px;
  margin-block-start: 0;
}
html[data-ui="widget"] .pc[data-incall="true"] .pc-state__title { flex-basis: 100%; }
html[data-ui="widget"] .pc[data-incall="true"] .pc-dots { display: none; }
html[data-ui="widget"] .pc[data-incall="true"] .pc-clock { font-size: 16px; gap: 8px; }
html[data-ui="widget"] .pc[data-incall="true"] .pc-clock::before { width: 8px; height: 8px; }
html[data-ui="widget"] .pc[data-incall="true"] .pc-state__detail { font-size: 14px; }
html[data-ui="widget"] .pc[data-incall="true"] .pc-transcript {
  flex: 1 1 0;
  min-block-size: 0;
  display: flex;
  flex-direction: column;
  max-inline-size: none;
}
/* An item on the screen keeps its own smaller box for the words (call-screen.css). */
html[data-ui="widget"] .pc[data-incall="true"]:not([data-screen="open"]) .pc-transcript__log {
  flex: 0 1 auto;
  min-block-size: 0;
  max-block-size: 100%;
}
html[data-ui="widget"] .pc-transcript__log { --pc-fade: 24px; gap: 8px; }
html[data-ui="widget"] .pc-turn { max-inline-size: 88%; padding-block: 9px; padding-inline: 13px; font-size: 15px; }
html[data-ui="widget"] .pc[data-incall="true"] .pc-powered { display: none; }

/* -- after the call, and the form ------------------------------------------ */

html[data-ui="widget"] .pc[data-view="ended"] .pc-state__title { font-size: 18px; }
html[data-ui="widget"] .pc[data-view="ended"] .pc-clock { font-size: 22px; }
html[data-ui="widget"] .pc-ticket { padding-inline: 16px; }
html[data-ui="widget"] .pc-ticket__time { font-size: 24px; }
html[data-ui="widget"] .pc-thanks { padding-block: 18px; padding-inline: 16px; }
html[data-ui="widget"] .pc-form { gap: 12px; padding-block: 14px; padding-inline: 14px; }
