/* Phone layout, layout only: no colours, font sizes or radii of its own. Loaded for the "phone" query
       (max-width: 640px), (max-height: 480px)
   which is the same query as PHONE in shared.js and .wide-only in components.css (narrow screens AND short landscape screens).
   There is no chat panel and no transcript on a phone: the live caption is the text channel.
   Vertical budget (portrait and landscape alike): top bar | stage (fills what is left, orbs shrink first) | bottom block (dock, topic row).
   Nothing is sized from the viewport height except through that budget, so nothing can be drawn under the top bar. */
:root { --pad:var(--s-4); --topbar:56px; --call:56px; --call-end:64px; }
.app { inset:0 0 auto 0; height:100vh; height:100dvh; }
.brand .logo { height:28px; }
.orb-space { min-height:0; max-height:none; width:100%; }

/* live caption: the only text channel. Whole current sentence, never clamped; a reserved zone so the layout does not jump. */
.caption { display:block; -webkit-line-clamp:unset; max-width:100%; min-height:calc(3 * var(--fs-lg) * var(--lh-base)); max-height:32dvh; margin-top:var(--s-3); overflow-y:auto; }
.readout .hint { min-height:0; }

/* bottom block: round call buttons in the thumb zone, no labels (each has an aria-label) */
.ctl-label { display:none; }
.dock:has(.ctl) { gap:var(--s-5); align-items:center; }
.readout h1 { font-size:var(--fs-xl); }
.dock-wrap { width:100%; padding-top:var(--s-2); padding-bottom:calc(var(--s-3) + env(safe-area-inset-bottom)); }
.dock { width:min(100%, 560px); }
.dock .btn-primary { flex:1 1 auto; }

/* podcast */
.opt { display:none; }
.stage { --orb-max:min(40dvh, 320px); }
.duo { gap:var(--s-2); }
.voice { padding-left:0; padding-right:0; }
.ep-kicker, .ep-meta { display:none; }
.ep-title { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; margin-bottom:var(--s-2); font-size:var(--fs-lg); }
.turn { max-width:94%; }
.dock:has(#topicWrap) { flex-wrap:wrap; }
#topicWrap { flex:1 1 100%; }
.dock #go, .dock #stop { flex:1 1 100%; }
/* while playing: [question field][mic][send] on one row, [pause][stop] under it */
.dock:has(#ask:not([hidden])) { flex-wrap:wrap; }
.ask { flex:1 1 100%; }
.dock:has(#ask:not([hidden])) #stop { flex:1 1 0; }
.ask-field { padding:0 var(--s-4); }
.ask-field .ico { display:none; }
.ask .btn-icon, #pause { flex:none; width:var(--control); height:var(--control); }
#topicWrap { order:-1; }   /* phones: topic field on its own row, then [length][start] */
.seg { flex:none; min-height:var(--call); }
.seg button { min-width:44px; padding:0 var(--s-2); }
.dock:has(#length:not([hidden])) #go { flex:1 1 0; min-width:0; padding:0 var(--s-4); }

/* short screens: iPhone SE portrait, every landscape phone */
@media (max-height: 700px) {
  :root { --control:44px; --call:52px; --call-end:60px; }
  .dock-wrap { gap:var(--s-2); padding-bottom:calc(var(--s-2) + env(safe-area-inset-bottom)); }
}
@media (max-height: 600px) { .idle-note, .voice .role { display:none; } }
@media (max-height: 480px) {
  :root { --topbar:48px; --call:48px; --call-end:56px; }
  .caption { min-height:calc(2 * var(--fs-lg) * var(--lh-base)); margin-top:var(--s-2); }
  .readout h1 { font-size:var(--fs-lg); }
  .readout .hint { display:none; }
  .ep-title { -webkit-line-clamp:1; margin-bottom:var(--s-1); }
  .dock:has(#topicWrap) { flex-wrap:nowrap; }
  #topicWrap { flex:1 1 auto; }
  .dock #go, .dock #stop { flex:0 0 auto; }
  /* landscape phones: no room for two rows under the voices: one row */
  .dock:has(#ask:not([hidden])) { flex-wrap:nowrap; }
  .ask { flex:1 1 auto; }
  .dock:has(#ask:not([hidden])) #stop { flex:0 0 auto; }
  #topicWrap { flex:1 1 0; }
  .dock:has(#length:not([hidden])) #go { flex:0 0 auto; }
}
/* very short landscape (568x320): something has to give so the orbs stay visible: topic cards (the typed topic remains) and the episode title (progress remains) */
@media (max-height: 360px) { #library, .ep-title, .ep-chapter { display:none !important; } .voice .chip { margin-top:var(--s-1); } }

/* phones: the cards are one swipeable row of short tiles */
.topic-card { flex:0 0 min(62%, 220px); }
