/* Phone layout only. The desktop and public audience display keep their layout. */
@media (max-width: 780px) {
  body:not(.audience-mode) .topbar {
    height: auto;
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 16px;
    padding: 18px;
  }
  body:not(.audience-mode) .brand { width: fit-content; max-width: 100%; font-size: 22px; gap: 10px; }
  body:not(.audience-mode) .brand-logo { width: 42px; height: 42px; }
  body:not(.audience-mode) .brand small { font-size: 9px; letter-spacing: 1.6px; }
  body:not(.audience-mode) .top-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 10px;
    width: 100%;
    min-width: 0;
  }
  body:not(.audience-mode) .top-actions .language-control {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    font-size: 13px;
  }
  body:not(.audience-mode) .language-control select { flex: 1; width: auto; min-width: 0; min-height: 44px; font-size: 16px; }
  body:not(.audience-mode) .top-actions .button {
    width: 100%; min-width: 0; min-height: 44px;
    padding: 11px 12px; font-size: 14px; white-space: normal;
    overflow-wrap: anywhere; text-align: center;
  }
  body:not(.audience-mode) #donatePublic,
  body:not(.audience-mode) #authButton { grid-column: 1 / -1; }
  body:not(.audience-mode) #getFullVersion { align-self: stretch; }
  body:not(.audience-mode) #logout { border: 1px solid var(--line); background: #fff; }
  body:not(.audience-mode) main,
  body:not(.audience-mode) .admin-page { padding: 22px 16px 0; }
  body:not(.audience-mode) .page-heading {
    flex-direction: column; align-items: stretch; gap: 14px; margin-bottom: 20px;
  }
  body:not(.audience-mode) .page-heading > div { min-width: 0; }
  body:not(.audience-mode) .page-heading h1 { font-size: clamp(23px, 6vw, 28px); line-height: 1.2; letter-spacing: -.7px; }
  body:not(.audience-mode) .page-heading .button { width: 100%; min-height: 44px; padding: 11px 14px; font-size: 14px; }
  body:not(.audience-mode) .workspace-grid { gap: 20px; }
  body:not(.audience-mode) .display-area,
  body:not(.audience-mode) .control-panel { min-width: 0; }
  body:not(.audience-mode) .stage {
    aspect-ratio: auto; min-height: 250px; padding: 16px;
    grid-template-columns: minmax(0, 1fr) 28%; gap: 12px; border-radius: 14px;
  }
  body:not(.audience-mode) .stage-core { min-height: 218px; gap: 14px; }
  body:not(.audience-mode) .stage-top { flex-direction: column; align-items: flex-start; gap: 5px; font-size: 9px; line-height: 1.4; letter-spacing: 1px; }
  body:not(.audience-mode) .stage-brand { font-size: 12px; }
  body:not(.audience-mode) .timer-block,
  body:not(.audience-mode) .people-block { margin-top: 0; }
  body:not(.audience-mode) .stage-label,
  body:not(.audience-mode) .people-block .stage-label { font-size: clamp(9px, 2.4cqw, 11px); line-height: 1.5; letter-spacing: 1px; }
  body:not(.audience-mode) .timer { font-size: clamp(27px, 10.5cqw, 62px); line-height: 1.15; letter-spacing: -.055em; white-space: nowrap; }
  body:not(.audience-mode) .people { font-size: clamp(28px, 8cqw, 42px); margin-bottom: 5px; }
  body:not(.audience-mode) .stage-bottom { min-height: 0; padding-top: 0; }
  body:not(.audience-mode) .public-stats { font-size: 9px; line-height: 1.5; letter-spacing: .2px; }
  body:not(.audience-mode) .public-stats strong { font-size: 11px; }
  body:not(.audience-mode) .public-stats span { display: inline-block; margin-right: 8px; }
  body:not(.audience-mode) .public-stats small { font-size: 9px; margin-top: 4px; }
  body:not(.audience-mode) .display-caption { flex-direction: column; gap: 6px; padding: 12px 0 16px; line-height: 1.5; }
  body:not(.audience-mode) .session-summary { grid-template-columns: 1fr; padding: 0; }
  body:not(.audience-mode) .session-summary > div {
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
    min-width: 0; padding: 14px 16px; border-right: 0; border-bottom: 1px solid var(--line);
  }
  body:not(.audience-mode) .session-summary > div:last-child { border-bottom: 0; }
  body:not(.audience-mode) .session-summary span { margin: 0; font-size: 10px; line-height: 1.5; letter-spacing: .8px; }
  body:not(.audience-mode) .session-summary strong { font-size: 18px; text-align: right; }
  body:not(.audience-mode) .estimate-note { font-size: 12px; line-height: 1.65; margin: 12px 0 0; }
  body:not(.audience-mode) .control-panel { padding: 20px; }
  body:not(.audience-mode) .control-panel input,
  body:not(.audience-mode) dialog input,
  body:not(.audience-mode) dialog select { font-size: 16px; }
  body:not(.audience-mode) .control-panel .input-pair input { font-size: 22px; }
  body:not(.audience-mode) .control-panel .button { min-height: 44px; }
  body:not(.audience-mode) footer { flex-wrap: wrap; line-height: 1.5; }
}
/* Let the header grow on tablets and phones held sideways as well. */
@media (min-width: 781px) and (max-width: 1100px) {
  body:not(.audience-mode) .topbar { height: auto; min-height: 80px; flex-wrap: wrap; gap: 16px; padding: 16px 24px; }
  body:not(.audience-mode) .top-actions { flex: 1 1 440px; min-width: 0; gap: 10px; }
  body:not(.audience-mode) .top-actions .button { min-height: 44px; }
}
@media (max-width: 780px) {
  body:not(.audience-mode) .stage.service-ended { min-height: 320px; }
  body:not(.audience-mode) .service-closed { padding: 18px; gap: 9px; }
  body:not(.audience-mode) .service-closed h2 { font-size: clamp(22px, 6cqw, 30px); }
  body:not(.audience-mode) .service-closed p,
  body:not(.audience-mode) .service-closed .closed-thanks { font-size: 12px; max-width: 100%; }
  body:not(.audience-mode) .closed-clock { font-size: 20px; }
  body:not(.audience-mode) #authDialog,
  body:not(.audience-mode) #infoDialog { max-height: calc(100dvh - 32px); overflow-y: auto; padding: 26px 22px; }
}
