/* /call: voice call and video call (Beta). Phone first (390 px), then laptop. Every box 2px corners; nothing
   rounder. Colours come from app.css (light and dark). The glow around QuantyGPT's picture is CSS only. */
.call-main h1 { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.call-main h1[hidden] { display: none; }
.call-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin: .9rem 0; }
.call-modes a {
  display: flex; align-items: center; justify-content: center; min-height: 44px; padding: .3rem .5rem;
  border: 1px solid var(--line); border-radius: 2px; background: var(--surface); color: var(--text);
  text-decoration: none; font-weight: 600; font-size: .92rem;
}
.call-modes a[aria-current="page"] { border-color: var(--mint); background: var(--surface-raised); }
.call-off-link, .call-log a { color: var(--mint); text-decoration: underline; }

/* The stage: voice call shows a small picture beside the status; video call shows her large. */
.call-stage {
  position: relative; display: grid; grid-template-columns: 6rem minmax(0, 1fr); align-items: center; gap: .9rem;
  padding: .9rem; border: 1px solid var(--line); border-radius: 2px; background: var(--surface);
}
.call-face { position: relative; margin: 0; }
.call-face img {  /* no border of its own: the stage is the one frame */
  display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; object-position: center top;
  border-radius: 2px; border: 0; background: #0b1424;
  box-shadow: 0 0 0 0 transparent; transition: box-shadow .3s ease;
}
.call-face figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.call-self { display: none; }
.call-status { margin: 0; font-weight: 600; line-height: 1.4; }
.call-status span[hidden] { display: none; }

.call-page[data-call-mode="video"] .call-stage {
  display: block; padding: 0; overflow: hidden; background: #0b1424; border-color: #0b1424;
}
/* The top and side padding is wider than her speaking glow, so the stage never cuts it. */
.call-page[data-call-mode="video"] .call-face { width: min(100%, 50vh, 30rem); margin: 0 auto; padding: 1.6rem 1.6rem 3.4rem; }
.call-page[data-call-mode="video"] .call-self {
  position: absolute; right: .6rem; bottom: .6rem; display: grid; place-content: center; gap: .1rem;
  width: 5.5rem; aspect-ratio: 3 / 4; padding: .3rem; text-align: center;
  border: 1px solid #3a4a66; border-radius: 2px; background: #16233a; color: #c9d4e6; font-size: .72rem;
}
.call-page[data-call-mode="video"] .call-self span:first-child { font-weight: 700; color: #ffffff; }
.call-page[data-call-mode="video"] .call-status {
  position: absolute; left: .6rem; right: 6.8rem; bottom: .7rem; color: #ffffff; font-size: .9rem;
}

/* Listening: a steady thin line. Speaking: the soft glow pulses (CSS only). */
.call-stage[data-call-state="listening"] .call-face img { box-shadow: 0 0 0 2px var(--mint); }
.call-stage[data-call-state="thinking"] .call-face img { box-shadow: 0 0 0 1px var(--mint); }
.call-stage[data-call-state="speaking"] .call-face img { animation: call-glow 1.4s ease-in-out infinite alternate; }
@keyframes call-glow {
  from { box-shadow: 0 0 0 2px var(--mint), 0 0 8px 2px var(--mint); }
  to { box-shadow: 0 0 0 3px var(--mint), 0 0 26px 9px var(--mint); }
}
@media (prefers-reduced-motion: reduce) {
  .call-stage[data-call-state="speaking"] .call-face img { animation: none; box-shadow: 0 0 0 3px var(--mint), 0 0 14px 4px var(--mint); }
}

/* What she is saying (or what was heard): at most five lines, then it scrolls, so the controls stay in view. */
.call-caption {
  max-height: calc(7.5em + .9rem); margin: .6rem 0 0; padding: .45rem .6rem; overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--line); border-radius: 2px; background: var(--surface); color: var(--text);
  font-size: .95rem; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-line;
}
.call-caption:empty { display: none; }

.call-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin: .8rem 0; }
.call-lang { grid-column: 1 / -1; display: grid; gap: .25rem; font-size: .85rem; color: var(--muted); }
.call-lang select {
  min-height: 44px; padding: 0 .6rem; border: 1px solid var(--line); border-radius: 2px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 1rem;
}
.call-button {
  min-height: 56px; padding: .4rem .6rem; border: 1px solid var(--text); border-radius: 2px;
  background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: 1.05rem; cursor: pointer;
}
.call-button span[hidden] { display: none; }
.call-start { background: var(--mint); border-color: var(--mint); color: var(--on-accent); }
.call-start[aria-pressed="true"] { background: #b3261e; border-color: #b3261e; color: #ffffff; }
.call-mute[aria-pressed="true"] { border-color: var(--mint); background: var(--surface-raised); }
.call-button:disabled { opacity: .5; cursor: not-allowed; }
.call-button[hidden] { display: none; }
.call-page[data-call-typed] .call-controls { grid-template-columns: minmax(0, 1fr); }

/* Voice like QuantPower's Quanty (voice.js): the 5-second countdown with Send now, and Stop while she speaks. */
.call-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .6rem 0; padding: .5rem .6rem;
  border: 1px solid var(--mint); border-radius: 2px; background: var(--surface); color: var(--text); font-size: .95rem;
}
.call-bar[hidden], .call-stop[hidden] { display: none; }
.call-bar span { flex: 1 1 10rem; }
.call-bar-button {
  min-height: 44px; padding: 0 .9rem; border: 1px solid var(--text); border-radius: 2px;
  background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer;
}
.call-stop { display: block; margin: .6rem 0; }
.call-line span[hidden] { display: none; }
.call-line { margin: .5rem 0; padding: .6rem .7rem; border: 1px solid var(--mint); border-left-width: 3px; border-radius: 2px; background: var(--surface); }
.call-type { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: .4rem .5rem; margin: .8rem 0; }
.call-type label { grid-column: 1 / -1; font-size: .85rem; color: var(--muted); }
.call-type textarea {
  width: 100%; padding: .6rem; border: 1px solid var(--line); border-radius: 2px;
  background: var(--surface); color: var(--text); font: inherit; resize: vertical;
}
.call-type .ask-button { min-height: 44px; }
/* A doubt from a Wisdompedia lesson: what it is about, and the way back. */
.call-doubt {
  margin: 0 0 .8rem; padding: .55rem .7rem; border: 1px solid var(--line); border-left: 3px solid var(--mint);
  border-radius: 2px; background: var(--surface); font-size: .92rem; line-height: 1.45; overflow-wrap: anywhere;
}
.call-doubt[hidden] { display: none; }
.call-doubt a { color: var(--mint); text-decoration: underline; white-space: nowrap; }

/* "Show my screen" (Beta): one still frame of a laptop screen, or a photo of a notebook on a phone. */
.call-show { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin: .6rem 0; }
.call-show .call-bar-button { width: 100%; padding: .3rem .5rem; font-size: .92rem; line-height: 1.25; }
.call-show[data-call-share="photo"] { grid-template-columns: minmax(0, 1fr); }  /* a phone: the photo button alone */
.call-show [hidden], .call-file { display: none; }
.call-show-hint { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.35; }
.call-shot {
  display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: .6rem; align-items: start; margin: .6rem 0;
  padding: .5rem; border: 1px solid var(--mint); border-radius: 2px; background: var(--surface);
}
.call-shot[hidden] { display: none; }
.call-shot img {
  display: block; width: 100%; height: auto; max-height: 9rem; object-fit: contain;
  border: 1px solid var(--line); border-radius: 2px; background: #0b1424;
}
.call-shot figcaption { display: grid; gap: .4rem; font-size: .88rem; line-height: 1.4; }
.call-shot figcaption .call-bar-button { justify-self: start; }
.call-line a { color: var(--mint); text-decoration: underline; }
.call-you-shot { margin: .2rem 0 0; color: var(--muted); font-size: .82rem; }
.call-free { margin: .3rem 0; color: var(--muted); font-size: .85rem; }
.call-log { margin-top: 1rem; }
.call-privacy { margin: 1rem 0 0; color: var(--muted); font-size: .85rem; }

/* Inside the one signed-in screen (QG_ONE_SCREEN), on a phone: the tab above already says Voice call or Video call,
   so the title goes, and the stage is tighter, so her picture, the caption, the controls and the type box fit the
   frame without scrolling. */
@media (max-width: 55.99rem) {
  .qg-framed .call-main h1 { display: none; }
  .qg-framed .call-stage { grid-template-columns: 4.5rem minmax(0, 1fr); gap: .7rem; padding: .6rem; }
  .qg-framed .call-controls { margin: .6rem 0; }
  .qg-framed .call-button { min-height: 48px; }
  .qg-framed .call-page[data-call-mode="video"] .call-face { width: min(100%, 38vh, 22rem); }
  .qg-framed .call-type textarea { min-height: 2.9rem; }
}

@media (min-width: 56rem) {
  .call-stage { grid-template-columns: 8rem minmax(0, 1fr); }
  .call-controls { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); align-items: end; }
  .call-lang { grid-column: auto; }
  .call-shot { grid-template-columns: 12rem minmax(0, 1fr); }
  .call-shot img { max-height: 12rem; }
  .call-page[data-call-typed] .call-controls { grid-template-columns: minmax(0, 1fr); }
  .call-page[data-call-mode="video"] .call-self { width: 7.5rem; }
  .call-page[data-call-mode="video"] .call-status { right: 8.8rem; }
}
