/* Only the existing Comms app embedded inside Louhos Mobile. */
html.comms-mobile { scrollbar-gutter: auto; }
.comms-mobile body { margin: 0; height: 100dvh; overflow: hidden; font-size: 16px; }
.comms-mobile .comms-frame.comms-frame {
  width: 100%; max-width: none; margin: 0; padding: 0 0 8px;
  height: 100dvh; display: flex; flex-direction: column; gap: 12px; overflow: hidden;
}
.comms-mobile body .comms-app > .louhos-header.louhos-header { display: none !important; }
.comms-mobile .comms-app > .louhos-footer,
.comms-mobile .comms-app > .mobile-note,
.comms-mobile .louhos-site-notice,
.comms-mobile .louhos-save-status { display: none !important; }
.comms-mobile .workspace-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; margin: 0; flex: 0 0 auto; gap: 12px; }
.comms-mobile .mobile-room-heading { display: grid; gap: 6px; min-width: 0; }
.comms-mobile .comms-app .workspace-tools { width: auto; gap: 8px; }
.comms-mobile .mobile-room-heading .connection-chip {
  min-height: 24px; padding: 0 !important; border: 0 !important; background: transparent !important;
  font-size: .875rem !important; border-radius: 0 !important; white-space: normal;
}
.comms-mobile .mobile-icon-button { width: 48px; height: 48px; padding: 0; }
.comms-mobile .mobile-icon-button svg, .comms-mobile .talk-button svg {
  width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}
.comms-mobile .mobile-action-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.comms-mobile .comms-app:has(#call:not([hidden])) { padding-top: 0; height: 100dvh; }
.comms-mobile .workspace-heading h1 { font-size: 1.5rem; }
.comms-mobile .notice { flex: 0 0 auto; max-height: 96px; overflow-y: auto; margin: 0; padding: 12px 14px; font-size: .875rem; }

/* A room list and a lower action dock, rather than a panel inside a panel. */
.comms-mobile .comms-lobby { --ui-control-height: 44px; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 24px; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 16px; }
.comms-mobile .lobby-join { flex: 0 0 auto; }
.comms-mobile .quick-join-form { grid-template-columns: minmax(0,1fr); padding: 18px; }
.comms-mobile .quick-join-form > .btn { justify-self: start; }
.comms-mobile #rooms-panel {
  flex: 0 0 auto; height: auto; display: flex; flex-direction: column; border: 0; background: transparent;
}
.comms-mobile #rooms-panel > .join-body {
  flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0;
}
.comms-mobile #rooms-list { min-height: 0; }
.comms-mobile #rooms-list .room-row {
  display: flex; flex-wrap: wrap; gap: 12px; min-height: 76px; margin: 0;
  padding: 14px 12px; border: 0; border-bottom: 1px solid var(--border);
  border-radius: 0; background: var(--surface);
}
.comms-mobile #rooms-list .room-row:first-child { border-radius: 6px 6px 0 0; }
.comms-mobile #rooms-list .room-row:last-child { border-radius: 0 0 6px 6px; }
.comms-mobile #rooms-list .room-row:only-child { border-radius: 6px; }
.comms-mobile #rooms-list .room-copy { flex: 1; min-width: min(130px, 100%); }
.comms-mobile #rooms-list .room-actions { width: auto; }
.comms-mobile #rooms-list .room-actions > .btn { flex: 0 1 auto; }
.comms-mobile #rooms-panel > .panel-head {
  flex: 0 0 auto; min-height: 0; padding: 0 0 16px; margin-top: 0;
  border: 0;
}
.comms-mobile #call .ptt-hint {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.comms-mobile #rooms-panel .room-toolbar { display: flex; }
.comms-mobile .workspace-tools > .btn { min-height: 44px; }
.comms-mobile .comms-app #rooms-panel .room-toolbar > .btn {
  height: var(--ui-control-height); min-height: var(--ui-control-height); max-height: var(--ui-control-height); font-size: inherit; white-space: nowrap;
}
.comms-mobile .rooms-bottom { flex: 0 0 auto; margin-top: 8px; padding-top: 8px; border: 0; gap: 8px; }
.comms-mobile .preview-link { min-height: 44px; font-size: .8rem; }
.comms-mobile .rooms-bottom > .btn { min-height: 44px; }

/* The participant list scrolls; the microphone controls stay within thumb reach. */
.comms-mobile #call { gap: 4px; }
.comms-mobile #call .layout {
  grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 12px;
}
.comms-mobile #call .people-panel { border: 0; background: transparent; }
.comms-mobile #call .people-panel .panel-head {
  min-height: 40px; padding: 0 0 12px; border: 0; align-items: center;
}
.comms-mobile #call .people-panel .panel-head h2 { font-size: 1rem; color: var(--muted); font-weight: 400; }
.comms-mobile #call .participant-list { grid-template-columns: minmax(0, 1fr); padding: 0; gap: 10px; }
.comms-mobile #call .participant-list .voice-person {
  min-height: 90px; padding: 14px 16px; gap: 8px 14px; grid-template-columns: 40px minmax(0, 1fr);
  grid-template-areas: "avatar copy" "avatar meter";
}
.comms-mobile #call .voice-person > .voice-meter { height: 8px; }
.comms-mobile #call .person-avatar { width: 40px; height: 40px; }
.comms-mobile #call .person-copy strong { font-size: 1rem; white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.comms-mobile #call .person-copy span { font-size: .875rem; }
.comms-mobile #call .talk-panel { align-self: stretch; max-height: min(340px, 60dvh); border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; }
.comms-mobile #call .talk-panel .panel-head {
  min-height: 44px; padding: 14px 0 0; border: 0; align-items: center;
}
.comms-mobile #call .talk-panel .panel-head h2 { font-size: 1rem; }
.comms-mobile #call .talk-body {
  display: flex; flex-direction: column; gap: 14px; padding: 12px 0 0; overflow-y: auto;
}
.comms-mobile #call .speaker-stage { display: block; }
.comms-mobile #call .speaker-kicker { display: none; }
.comms-mobile #call .stage-meter { height: 8px; }
.comms-mobile #call .mic-console { display: flex; flex: 0 0 auto; min-height: 0; gap: 8px; }
.comms-mobile #call .audio-actions:not(:has(> :not([hidden]))) { display: none; }
.comms-mobile #call .audio-actions > .btn { min-height: 44px; }
.comms-mobile #call .talk-button {
  flex: 0 0 auto; height: auto; min-height: 80px; max-height: none; padding: 16px;
  font-size: 1.25rem; border-radius: 5px;
}
.comms-mobile #call .call-volume {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center;
  margin: 0; padding: 0; border: 0;
}
.comms-mobile #call .call-volume input { height: 44px; }
.comms-mobile #call .call-volume label { grid-column: 1 / -1; font-size: 1rem; }
.comms-mobile .mobile-volume-reset { min-width: 68px; min-height: 48px; font-size: .875rem; padding: 0 12px; }
.comms-mobile #call .panel-help { padding: 8px 0; }
.comms-mobile #call .call-actions { justify-content: center; }
.comms-mobile #call #leave { min-height: 44px; width: 100%; background: transparent; border-color: transparent; }
.comms-mobile .btn:active:not(:disabled):not(.talk-button) { filter: brightness(.85); }
.comms-mobile .room-actions > .btn,
.comms-mobile .cue-settings-card .btn { min-height: 44px; }
.comms-mobile .cue-settings-card .cue-settings-close { width: 44px; min-width: 44px; }
.comms-mobile .field input, .comms-mobile .cue-settings-card select { min-height: 48px; font-size: 16px; }
/* Mobile subpages replace the content, not a popup laid over the room. */
.comms-mobile.has-comms-page .comms-app > :not(dialog) { display: none !important; }
.comms-mobile dialog[data-mobile-page] {
  position: fixed; inset: 0; width: 100%; max-width: none; height: 100dvh;
  max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0;
  background: var(--bg); color: var(--text); box-shadow: none; overflow: hidden;
}
.comms-mobile dialog[data-mobile-page][open] { display: block; }
.comms-mobile dialog[data-mobile-page][open]:not([data-current-page]) { display: none; }
.comms-mobile dialog[data-mobile-page]::backdrop { background: transparent; backdrop-filter: none; }
.comms-mobile dialog[data-mobile-page] > .cue-settings-card {
  display: block; height: 100%; max-height: none; padding: 0 0 20px;
  overflow-y: auto; overscroll-behavior: contain;
}
.comms-mobile .mobile-page-bar {
  position: sticky; top: 0; z-index: 1; display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center;
  gap: 10px; padding: 0 0 10px; margin-bottom: 16px; border-bottom: 1px solid var(--border); background: var(--bg);
}
.comms-mobile .mobile-page-back { width: 44px; min-height: 44px; padding: 0; font-size: 0; }
.comms-mobile .mobile-page-back::before { content: '‹'; font-size: 1.6rem; line-height: 1; }
.comms-mobile dialog[data-mobile-page] .cue-settings-intro { padding: 16px 0; min-width: 0; }
.comms-mobile dialog[data-mobile-page] .cue-settings-intro h2 { font-size: 1.35rem; overflow-wrap: anywhere; }
.comms-mobile dialog[data-mobile-page] .cue-settings-close { display: none; }
.comms-mobile .mobile-setting-group { border: 1px solid var(--border); border-radius: 6px; background: var(--surface); margin-bottom: 20px; }
.comms-mobile .mobile-setting-group > .cue-setting-row { padding: 16px; gap: 12px; }
.comms-mobile .mobile-setting-group > .cue-setting-row:first-child { border-top: 0; }
.comms-mobile .mobile-setting-group > .help { padding: 0 16px 16px; margin: 0; }
.comms-mobile .cue-settings-card .mobile-volume-setting { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
.comms-mobile .cue-settings-card .mobile-volume-setting > label { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.comms-mobile .cue-settings-card .mobile-volume-setting > input[type="range"] { width: 100%; height: 44px; }
.comms-mobile #listen-volume-value, .comms-mobile #call-volume-value { font-variant-numeric: tabular-nums; }
.comms-mobile .cue-settings-section-title { padding: 0 2px 12px; font-size: .875rem; letter-spacing: .05em; }
.comms-mobile .cue-settings-card .cue-setting-row:has(> input[type="checkbox"]) { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.comms-mobile .cue-settings-card .cue-setting-row > input[type="checkbox"] { width: 44px !important; height: 28px !important; min-height: 28px !important; margin: 0 !important; }
.comms-mobile .cue-settings-card .cue-setting-row > input[type="checkbox"]::after { top: 4px; left: 4px; width: 18px; height: 18px; }
.comms-mobile .cue-settings-card .cue-setting-row > input[type="checkbox"]:checked::after { transform: translateX(16px); }
.comms-mobile .cue-settings-card .cue-setting-row strong { font-size: 1rem; }
.comms-mobile .cue-settings-card .cue-setting-row small { font-size: .875rem; }
.comms-mobile .cue-settings-card .cue-setting-row select { min-height: 48px; }
.comms-mobile #room-management > .cue-settings-card > .cue-settings-actions:last-child { position: static; background: transparent; }
.comms-mobile #room-management > .cue-settings-card > .cue-settings-actions:last-child > [data-close-dialog] { display: none; }
.comms-mobile dialog[data-mobile-page] .cue-settings-actions { margin-top: 14px; padding-top: 12px; flex-wrap: wrap; }
.comms-mobile dialog[data-mobile-page] > .cue-settings-card > .cue-settings-actions:last-child {
  position: sticky; bottom: -20px; padding-block: 12px; background: var(--bg);
}
/* Short landscape frames retain controls without consuming the entire member list. */
@media (min-width: 480px) and (max-height: 440px) {
  .comms-mobile #call .layout { grid-template-columns: minmax(0, 1fr) minmax(180px, .8fr); grid-template-rows: minmax(0, 1fr); }
  .comms-mobile #call .talk-panel { height: 100%; max-height: 100%; }
  .comms-mobile #call .talk-button { min-height: 60px; }
  .comms-mobile #call .call-volume { gap: 4px 8px; }
}
