/* Fixed application workspace. Only dialogs scroll. */
:root { --accent-ink: #0750F3; --accent-soft: rgba(7, 80, 243, 0.08); --record-soft: #fff0ef; }
:root[data-theme="dark"] { --accent-ink: #0D8FFA; --accent-soft: rgba(13, 143, 250, 0.16); --record-soft: #3d2428; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --accent-ink: #0D8FFA; --accent-soft: rgba(13, 143, 250, 0.16); --record-soft: #3d2428; } }
html:has(.app-shell), body:has(.app-shell) { width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
body:has(#mobile-mic.app-shell) { padding: 0 !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ui-icon { display: block; flex: none; width: 24px; height: 24px; pointer-events: none; }
[data-ui-icon] { display: inline-flex; align-items: center; justify-content: center; flex: none; }
#mobile-mic.app-shell[data-layout] {
  width: min(100%,640px); height: 100svh; height: var(--app-height,100dvh); min-height: 0; margin: 0 auto;
  padding: env(safe-area-inset-top) max(16px,env(safe-area-inset-right)) env(safe-area-inset-bottom) max(16px,env(safe-area-inset-left));
  display: grid; grid-template-rows: auto minmax(0,1fr) auto auto; gap: 0; overflow: hidden;
}
#mobile-mic.app-shell[data-layout] button { -webkit-tap-highlight-color: transparent; }
#mobile-mic.app-shell[data-layout] :is(button,input,select,summary):focus-visible { outline-color: var(--accent-ink); outline-offset: -3px; }
#mobile-mic.app-shell[data-layout] .app-header { display: block; min-width: 0; min-height: 0; padding: 8px 0; }
#mobile-mic.app-shell[data-layout] .device { display: flex; flex-wrap: nowrap; gap: 8px; padding: 0; border: 0; min-height: 48px; }
#mobile-mic.app-shell[data-layout] .device-name { flex: 1 1 auto; min-width: 0; gap: 8px; }
#mobile-mic.app-shell[data-layout] .device-label { display: none; }
#mobile-mic.app-shell[data-layout] .device-name svg { width: 24px; height: 24px; color: var(--muted); stroke-width: 1.8; }
#mobile-mic.app-shell[data-layout] .device strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mobile-mic.app-shell[data-layout] .device-tools { flex: none; display: flex; align-items: center; gap: 8px; }
#mobile-mic.app-shell[data-layout] .connection-state { font-size: 11px; max-width: 96px; line-height: 1.3; }
#mobile-mic.app-shell[data-layout] .settings-toggle { margin: 0; display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 14px; color: var(--text); background: transparent; }
#mobile-mic.app-shell[data-layout] .settings-toggle:hover { background: var(--well); }
#mobile-mic.app-shell[data-layout] .console { display: block; min-width: 0; min-height: 0; width: 100%; max-width: none; margin: 0; padding: 0; background: transparent; border: 0; border-radius: 0; overflow: hidden; }
#mobile-mic.app-shell[data-layout] .microphone-screen { display: flex; flex-direction: column; min-height: 0; height: 100%; gap: 8px; text-align: center; padding: 6px 0 12px; }
#mobile-mic.app-shell[data-layout] .capture-status { flex: 1 1 80px; display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 0; margin: 0; padding: 12px; gap: 10px; border: 0; background: transparent; }
#mobile-mic.app-shell[data-layout] .mic-symbol { flex: none; width: 48px; height: 52px; margin: 0; border: 0; border-radius: 0; background: transparent; color: var(--accent-ink); }
#mobile-mic.app-shell[data-layout] .mic-symbol svg { width: 40px; height: 40px; stroke-width: 1.8; }
#mobile-mic.app-shell[data-phase="recording"] .mic-symbol { color: var(--record); }
#mobile-mic.app-shell[data-phase="error"] .mic-symbol { color: var(--warning); }
#mobile-mic.app-shell[data-layout] #status { flex: none; font-size: 18px; line-height: 1.4; text-align: center; max-width: 100%; }
#mobile-mic.app-shell[data-layout] .recording-time { margin: 0; }
#mobile-mic.app-shell[data-layout] #duration { font-size: clamp(36px,7vh,64px); font-weight: 450; letter-spacing: -.04em; }
#mobile-mic.app-shell[data-layout] .timer-label { display: none; }
#mobile-mic.app-shell[data-layout] .microphone { justify-content: center; width: 100%; padding: 0; margin: 0; font-size: 12px; gap: 0; flex: none; }
#mobile-mic.app-shell[data-layout] .microphone > :first-child { display: none; }
#mobile-mic.app-shell[data-layout] #microphone-name { color: var(--muted); }
#mobile-mic.app-shell[data-layout] .meter-group { flex: none; margin: 0; width: min(100%,224px); }
#mobile-mic.app-shell[data-layout] .meter-group label { display: none; }
#mobile-mic.app-shell[data-layout] :is(.help,.quiet-hint,.result,.trust-status) { flex: none; font-size: 12px; line-height: 1.45; margin: 0; padding: 8px 10px; }
#mobile-mic.app-shell[data-connected="true"] .help, #mobile-mic.app-shell[data-layout] .settings-summary { display: none; }
#mobile-mic.app-shell[data-mode="command"][data-view="microphone"] #settings-summary { display: block; flex: none; align-self: center; margin: 0; padding: 4px 10px; font-size: 12px; color: var(--accent-ink); }
#mobile-mic.app-shell[data-layout] .result { padding: 0; background: transparent; color: var(--muted); }
#mobile-mic.app-shell[data-layout] .trust-settings { flex: none; margin: 0; min-height: 44px; font-size: 12px; }
#mobile-mic.app-shell[data-layout] .trusted-devices { flex: none; margin: 0; padding: 0; border: 0; }
#mobile-mic.app-shell[data-layout] .connection-actions { flex: none; margin: 0; gap: 4px; }
#mobile-mic.app-shell[data-layout] .connection-actions button { min-width: 44px; min-height: 44px; padding: 8px 10px; font-size: 13px; }
#mobile-mic.app-shell[data-layout] .connection-instruction { flex: none; margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
#mobile-mic.app-shell[data-connected="true"] .connection-instruction { display: none; }
#mobile-mic.app-shell[data-layout] .connection-more { flex: none; align-self: center; min-height: 44px; color: var(--accent-ink); padding: 8px 14px; font-size: 13px; }
#mobile-mic.app-shell[data-layout] .connection-more[data-primary="true"] { width: 100%; min-height: 56px; margin-top: 8px; border: 0; border-radius: 18px; background: var(--accent); color: #fff; font-size: 16px; font-weight: 600; }
#mobile-mic.app-shell[data-layout] .device-full-name { margin: 0 0 16px; padding: 12px; border-radius: 12px; background: var(--well); color: var(--text); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; white-space: normal; }
#mobile-mic.app-shell[data-layout] .trusted-options { display: grid; gap: 8px; margin: 8px 0 12px; }
#mobile-mic.app-shell[data-layout] .trusted-option { width: 100%; min-height: 48px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; text-align: start; white-space: normal; overflow-wrap: anywhere; line-height: 1.5; font-size: 14px; color: var(--text); background: var(--panel); }
#mobile-mic.app-shell[data-layout] .trusted-option[aria-pressed="true"] { border-color: var(--accent-ink); color: var(--accent-ink); background: var(--accent-soft); }
#mobile-mic.app-shell[data-layout] .feedback-card { flex: 0 1 auto; min-height: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); text-align: left; }
#mobile-mic.app-shell[data-layout] .feedback-heading { margin: 0; align-items: center; }
#mobile-mic.app-shell[data-layout] .copy-button { min-height: 44px; padding: 8px 12px; color: var(--accent-ink); background: var(--accent-soft); border: 0; border-radius: 12px; }
#mobile-mic.app-shell[data-layout] #feedback-text { font-size: 14px; line-height: 1.5; }
#mobile-mic.app-shell[data-layout] .feedback-text[data-expanded="false"] { -webkit-line-clamp: 2; }
#mobile-mic.app-shell[data-layout] #feedback-expand { padding: 8px 0; min-height: 44px; font-size: 13px; color: var(--accent-ink); }
#mobile-mic.app-shell[data-layout] #feedback-copy-status:empty { display: none; }
#mobile-mic.app-shell[data-layout] #feedback-copy-status { margin: 4px 0 0; }
#mobile-mic.app-shell[data-layout] .action-dock { display: block; position: static; transform: none; width: 100%; min-width: 0; padding: 8px 0 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
#mobile-mic.app-shell[data-layout] .primary-actions { display: block; margin: 0; }
#mobile-mic.app-shell[data-layout] .action-dock .primary { width: 100%; min-height: 56px; border-radius: 18px; padding: 12px; font-size: 16px; line-height: 1.3; }
#mobile-mic.app-shell[data-layout] .quick-modes { margin: 0 0 10px; background: var(--panel); border: 0; border-radius: 14px; padding: 4px; }
#mobile-mic.app-shell[data-layout] .quick-modes button { min-height: 44px; padding: 8px 6px; font-size: 13px; color: var(--muted); border-radius: 11px; }
#mobile-mic.app-shell[data-layout] .quick-modes button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); outline: 0; box-shadow: none; }
#mobile-mic.app-shell[data-layout] .dock-secondary { height: 44px; margin: 0; }
#mobile-mic.app-shell[data-layout] .dock-secondary .cancel { min-height: 44px; margin: 0; }
#mobile-mic.app-shell[data-layout] .panel-tabs { display: grid; grid-template-columns: 1fr 1fr; align-items: center; margin: 8px 0 0; padding: 6px 0 8px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; gap: 12px; }
#mobile-mic.app-shell[data-layout] .panel-tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 60px; padding: 5px 8px; border: 0; border-radius: 16px; font-size: 12px; line-height: 1.3; background: transparent; color: var(--muted); }
#mobile-mic.app-shell[data-layout] .panel-tabs [aria-selected="true"] { color: var(--accent-ink); background: var(--accent-soft); box-shadow: none; }
#mobile-mic.app-shell[data-layout] .panel-microphone-note { font-size: 12px; }
/* Feedback has a permanent slot; the six keys never move when a result arrives. */
#mobile-mic.app-shell[data-layout] .panel-controls { height: 100%; min-height: 0; padding: 4px 0 0; display: flex; flex-direction: column; gap: 8px; }
#mobile-mic.app-shell[data-layout] .panel-toolbar { flex: none; flex-wrap: nowrap; gap: 10px; align-items: center; }
#mobile-mic.app-shell[data-layout] .panel-group { flex: 1 1 auto; min-width: 0; max-width: none; }
#mobile-mic.app-shell[data-layout] .panel-group label { display: none; }
#mobile-mic.app-shell[data-layout] .panel-group select { width: 100%; min-height: 44px; padding: 8px 12px; background: var(--panel); border-radius: 12px; font-size: 14px; }
#mobile-mic.app-shell[data-layout] .panel-pin { flex: none; min-height: 44px; padding: 0 4px; font-size: 13px; max-width: 46%; }
#mobile-mic.app-shell[data-layout] .panel-follow { display: none; }
#mobile-mic.app-shell[data-layout] .panel-frontmost { flex: none; font-size: 12px; line-height: 1.4; margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#mobile-mic.app-shell[data-layout] .panel-feedback { flex: 0 0 48px; min-height: 48px; height: 48px; display: grid; align-items: center; min-width: 0; }
#mobile-mic.app-shell[data-layout] .panel-status { grid-area: 1 / 1; margin: 0; padding: 0; font-size: 12px; line-height: 1.4; text-align: left; color: var(--muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
#mobile-mic.app-shell[data-layout] .panel-grid { flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-rows: repeat(3,minmax(0,1fr)); gap: 10px; }
#mobile-mic.app-shell[data-layout] .panel-grid:empty { display: none; }
#mobile-mic.app-shell[data-layout] .panel-tile { position: relative; display: grid; grid-template-columns: minmax(0,1fr) 44px; min-height: 0; border-radius: 18px; border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
#mobile-mic.app-shell[data-layout] .panel-key { grid-column: 1; width: 100%; height: 100%; min-height: 44px; min-width: 0; padding: 10px 4px 10px 12px; gap: 9px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 0; border-radius: 17px; background: transparent; }
#mobile-mic.app-shell[data-layout] .panel-tile[data-information="false"] .panel-key { grid-column: 1 / -1; padding-right: 12px; }
#mobile-mic.app-shell[data-layout] .panel-key-icon { display: grid; place-items: center; min-height: 28px; color: var(--accent-ink); }
#mobile-mic.app-shell[data-layout] .panel-key-icon .ui-icon { width: 28px; height: 28px; }
#mobile-mic.app-shell[data-layout] .panel-key-labels { display: flex; flex-direction: column; align-items: center; gap: 5px; max-width: 100%; min-width: 0; }
#mobile-mic.app-shell[data-layout] .panel-key-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; font-size: 17px; line-height: 1.3; font-weight: 600; text-align: center; }
#mobile-mic.app-shell[data-layout] .panel-shortcut { max-width: 100%; font-family: inherit; font-size: 12px; line-height: 1.3; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mobile-mic.app-shell[data-layout] .panel-shortcut:empty { display: none; }
#mobile-mic.app-shell[data-layout] .panel-reason { display: none; }
#mobile-mic.app-shell[data-layout] .panel-info { position: static; display: grid; place-items: center; align-self: start; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 13px; background: transparent; color: var(--muted); }
#mobile-mic.app-shell[data-layout] .panel-info .ui-icon { width: 20px; height: 20px; }
#mobile-mic.app-shell[data-layout] .panel-info:hover { background: var(--well); color: var(--accent-ink); }
#mobile-mic.app-shell[data-layout] .panel-key:active:not(:disabled) { background: var(--accent-soft); }
#mobile-mic.app-shell[data-layout] .panel-key:disabled { opacity: .65; }
#mobile-mic.app-shell[data-layout] .panel-tile[data-status="pending"] .panel-key-icon { color: var(--accent-ink); }
#mobile-mic.app-shell[data-layout] .panel-tile:is([data-status="sent"],[data-status="completed"]) .panel-key-icon { color: var(--success); }
#mobile-mic.app-shell[data-layout] .panel-tile:is([data-status="failed"],[data-status="rejected"]) .panel-key-icon { color: var(--danger); }
#mobile-mic.app-shell[data-layout] .panel-tile[data-empty="true"] { visibility: hidden; pointer-events: none; }
#mobile-mic.app-shell[data-layout] .panel-pagination { flex: none; display: flex; align-items: center; justify-content: space-between; margin: 0; gap: 8px; }
#mobile-mic.app-shell[data-layout] .panel-pagination button { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 8px; border-radius: 12px; font-size: 12px; }
#mobile-mic.app-shell[data-layout] .panel-pagination button .ui-icon { width: 20px; height: 20px; }
#mobile-mic.app-shell[data-layout] .panel-pagination output { flex: 1; min-width: 0; font-size: 12px; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
#mobile-mic.app-shell[data-layout] .panel-notification { grid-area: 1 / 1; display: flex; align-items: center; min-width: 0; gap: 4px; }
#mobile-mic.app-shell[data-layout] .panel-notification:not(:has(#panel-result:not([hidden]))) { display: none; }
#mobile-mic.app-shell[data-layout] .panel-feedback:has(.panel-status:not([hidden])) .panel-notification { display: none; }
#mobile-mic.app-shell[data-layout] .panel-result { flex: 1; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; min-width: 0; margin: 0; padding: 0; border: 0; background: transparent; line-height: 1.4; font-size: 12px; overflow: hidden; }
#mobile-mic.app-shell[data-view="keypad"][data-connected="true"] .microphone-screen { display: none; }
#mobile-mic.app-shell[data-connected="false"] .panel-controls { display: none; }
#mobile-mic.app-shell[data-view="keypad"][data-connected="true"]:not([data-phase="recording"]):not([data-phase="starting"]):not([data-phase="stopping"]) .action-dock { display: none; }
#mobile-mic.app-shell[data-view="keypad"] .dock-secondary:not(:has(:not([hidden]))) { display: none; }
#mobile-mic.app-shell[data-view="keypad"][data-connected="true"]:is([data-phase="recording"],[data-phase="starting"],[data-phase="stopping"]) .action-dock { display: flex; align-items: stretch; gap: 8px; }
#mobile-mic.app-shell[data-view="keypad"][data-connected="true"] .action-dock .primary-actions { flex: 1; min-width: 0; }
#mobile-mic.app-shell[data-view="keypad"][data-connected="true"] .dock-secondary { flex: 0 0 30%; height: auto; }
#mobile-mic.app-shell[data-view="keypad"][data-connected="true"] .dock-secondary .cancel { height: 100%; padding: 8px; }
/* Short information panels fit their contents; long text and settings scroll inside. */
#mobile-mic.app-shell[data-layout] :is(.settings-sheet,.app-sheet) {
  position: fixed; inset: calc(var(--app-top,0px) + max(10px,env(safe-area-inset-top))) 0 auto; width: min(100% - 20px,560px); height: auto;
  max-height: calc(var(--app-height,100dvh) - max(10px,env(safe-area-inset-top)) - max(10px,env(safe-area-inset-bottom))); max-width: calc(100% - 20px); margin: 0 auto;
  padding: 0; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: var(--panel); color: var(--text);
}
#mobile-mic.app-shell[data-layout] .settings-sheet { height: min(720px,calc(var(--app-height,100dvh) - 20px)); }
#mobile-mic.app-shell[data-layout] dialog[open] { display: flex; flex-direction: column; }
#mobile-mic.app-shell[data-layout] dialog::backdrop { background: #0007; }
#mobile-mic.app-shell[data-layout] .sheet-header { flex: none; position: static; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 8px 12px 8px 20px; border-bottom: 1px solid var(--line); }
#mobile-mic.app-shell[data-layout] .sheet-header h2 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
#mobile-mic.app-shell[data-layout] .sheet-header button { flex: none; display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 14px; background: var(--well); color: var(--text); }
#mobile-mic.app-shell[data-layout] .sheet-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 20px max(20px,env(safe-area-inset-bottom)); scroll-padding-block: 16px; }
#mobile-mic.app-shell[data-layout] .content-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.7; user-select: text; -webkit-user-select: text; }
#mobile-mic.app-shell[data-layout] .content-tools { flex: none; padding: 12px 20px 0; }
#mobile-mic.app-shell[data-layout] .tonal-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 14px; border: 0; border-radius: 12px; color: var(--accent-ink); background: var(--accent-soft); }
#mobile-mic.app-shell[data-layout] #content-notice { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
#mobile-mic.app-shell[data-layout] #content-notice:empty { display: none; }
#mobile-mic.app-shell[data-layout] .settings-content { display: flex; flex-direction: column; gap: 16px; }
#mobile-mic.app-shell[data-layout] .settings-group { padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
#mobile-mic.app-shell[data-layout] .settings-group:not(:has(> :not(h3):not([hidden]))) { display: none; }
#mobile-mic.app-shell[data-layout] .settings-group h3 { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--accent-ink); }
#mobile-mic.app-shell[data-layout] .settings-group :is(.microphone-settings,.input-mode-settings,.phone-name-settings) { margin: 0 0 16px; }
#mobile-mic.app-shell[data-layout] .settings-group :is(input[type="text"],select) { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--well); color: var(--text); padding: 10px 12px; font-size: 16px; }
#mobile-mic.app-shell[data-layout] .settings-group :is(.hold-mode-settings,.trust-settings) { min-height: 48px; margin: 0; font-size: 14px; color: var(--text); justify-content: space-between; }
#mobile-mic.app-shell[data-layout] :is(.hold-mode-settings,.panel-pin,.trust-settings) input[type="checkbox"] { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 36px; height: 22px; min-height: 0; margin: 0; padding: 0; border: 1px solid var(--muted); border-radius: 20px; background: var(--well); cursor: pointer; }
#mobile-mic.app-shell[data-layout] :is(.hold-mode-settings,.panel-pin,.trust-settings) input[type="checkbox"]::before { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); }
#mobile-mic.app-shell[data-layout] :is(.hold-mode-settings,.panel-pin,.trust-settings) input[type="checkbox"]:checked { border-color: var(--accent-ink); background: var(--accent-soft); }
#mobile-mic.app-shell[data-layout] :is(.hold-mode-settings,.panel-pin,.trust-settings) input[type="checkbox"]:checked::before { left: 17px; background: var(--accent-ink); }
#mobile-mic.app-shell[data-layout] .hold-mode-settings input { order: 2; }
#mobile-mic.app-shell[data-layout] .settings-group .text-button { min-height: 44px; font-size: 13px; border-radius: 12px; background: var(--well); color: var(--text); }
#mobile-mic.app-shell[data-layout] .probe-settings { margin: 0 0 8px; padding: 0; background: transparent; }
#mobile-mic.app-shell[data-layout] .probe-settings .text-button { width: 100%; padding: 10px 12px; text-align: center; }
#mobile-mic.app-shell[data-layout] .preference-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 52px; font-size: 13px; }
#mobile-mic.app-shell[data-layout] .preference-row + .preference-row { margin-top: 8px; }
#mobile-mic.app-shell[data-layout] .preference-toggle { width: auto; max-width: 100%; min-height: 44px; height: auto; padding: 8px 12px; border-radius: 12px; gap: 8px; background: var(--well); }
#mobile-mic.app-shell[data-layout] .preference-toggle .ui-icon { width: 20px; height: 20px; }
#mobile-mic.app-shell[data-layout] .preference-menu { max-height: min(350px,45dvh); max-width: calc(100vw - 64px); overflow-y: auto; border-radius: 12px; padding: 6px; box-shadow: 0 12px 32px #0002; }
#mobile-mic.app-shell[data-layout] .preference-menu button { min-height: 44px; border-radius: 8px; padding: 10px 12px; }
#mobile-mic.app-shell[data-layout] .preference-menu button[aria-checked="true"] { color: var(--accent-ink); background: var(--accent-soft); }
#mobile-mic.app-shell[data-layout] .preference-menu button[aria-checked="true"]::after { color: var(--accent-ink); }
#mobile-mic.app-shell[data-layout] .settings-brand { align-self: center; padding: 4px 0; }
#mobile-mic.app-shell[data-layout] .settings-brand img { height: 28px; }
#mobile-mic.app-shell[data-layout] .page-help { padding: 0; margin: 0; border: 0; border-radius: 0; }
#mobile-mic.app-shell[data-layout] .page-help summary { padding-inline: 0; font-size: 13px; }
#mobile-mic.app-shell[data-layout] .page-help details > p { padding-inline: 0; }
#mobile-mic.app-shell[data-layout] .page-help .foreground-note { padding-inline: 0; }
#mobile-mic.app-shell[data-layout] :is(.settings-content,.connection-sheet) details { margin: 0; }
#mobile-mic.app-shell[data-layout] .sheet-content summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 48px; margin: 0; padding: 10px 0; list-style: none; color: var(--text); font-size: 14px; font-weight: 500; line-height: 1.5; }
#mobile-mic.app-shell[data-layout] .sheet-content summary::-webkit-details-marker { display: none; }
#mobile-mic.app-shell[data-layout] .sheet-content summary::after { content: ""; flex: none; width: 7px; height: 7px; margin-right: 3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); opacity: .65; }
#mobile-mic.app-shell[data-layout] .sheet-content details[open] > summary::after { transform: rotate(45deg); }
#mobile-mic.app-shell[data-layout] #keyboard-help p { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }
#mobile-mic.app-shell[data-layout] .pairing { margin: 0; }
#mobile-mic.app-shell[data-layout] :is(.pairing-alternatives,.recovery-help) { margin: 16px 0 0; }

/* A single quiet workspace: the icon communicates state, while the dock
   remains the only recording control. Colors are shared with existing semantic
   status tokens so dark mode and reduced-motion work without special assets. */
#mobile-mic.app-shell[data-layout] .app-header { padding-block: 10px; }
#mobile-mic.app-shell[data-layout] .device-name svg {
  width: 38px; height: 38px; padding: 8px; border-radius: 12px;
  color: var(--accent-ink); background: var(--accent-soft);
}
#mobile-mic.app-shell[data-layout] .device strong { font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
#mobile-mic.app-shell[data-layout] .connection-state {
  padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); white-space: nowrap;
}
#mobile-mic.app-shell[data-layout] .settings-toggle { background: var(--panel); border: 1px solid var(--line); }
#mobile-mic.app-shell[data-layout] .microphone-screen { gap: 10px; padding-top: 4px; }
#mobile-mic.app-shell[data-layout] .capture-status {
  position: relative;
  padding: 20px 14px; gap: 12px; border: 1px solid var(--line); border-radius: 24px;
  background: radial-gradient(ellipse at 50% 22%, var(--accent-soft), transparent 64%), var(--panel);
  box-shadow: 0 8px 28px #16223b0a;
}
#mobile-mic.app-shell[data-phase="recording"] .capture-status {
  background: radial-gradient(ellipse at 50% 22%, var(--record-soft), transparent 64%), var(--panel);
}
#mobile-mic.app-shell[data-layout] .capture-caption {
  position: absolute; top: 16px; left: 18px; font-size: 11px; font-weight: 650;
  letter-spacing: .035em; color: var(--muted);
}
#mobile-mic.app-shell[data-layout] .mic-symbol {
  width: 70px; height: 70px; border-radius: 22px;
  background: transparent; color: var(--accent-ink);
}
#mobile-mic.app-shell[data-layout] .mic-symbol svg { width: 34px; height: 34px; }
#mobile-mic.app-shell[data-phase="recording"] .mic-symbol { color: var(--danger); background: transparent; }
#mobile-mic.app-shell[data-phase="error"] .mic-symbol { color: var(--warning); background: transparent; }
#mobile-mic.app-shell[data-layout] #status { font-size: 17px; font-weight: 650; letter-spacing: -.015em; }
#mobile-mic.app-shell[data-layout] #duration { font-size: clamp(36px, 6vh, 54px); font-weight: 500; }
#mobile-mic.app-shell[data-layout] .meter-group { width: min(100%, 208px); }
#mobile-mic.app-shell[data-layout] .feedback-card {
  padding: 14px; border-radius: 18px; box-shadow: 0 4px 16px #16223b08;
}
#mobile-mic.app-shell[data-layout] .feedback-heading { gap: 8px; }
#mobile-mic.app-shell[data-layout] .action-dock .primary,
#mobile-mic.app-shell[data-layout] .connection-more[data-primary="true"] {
  border-radius: 16px; letter-spacing: -.01em; box-shadow: 0 5px 14px #075fcb1a;
}
#mobile-mic.app-shell[data-layout] .quick-modes { border: 1px solid var(--line); padding: 3px; }
#mobile-mic.app-shell[data-layout] .quick-modes button { font-weight: 550; }
#mobile-mic.app-shell[data-layout] .panel-tabs { gap: 6px; border-top: 0; padding-top: 6px; }
#mobile-mic.app-shell[data-layout] .panel-tabs button { min-height: 54px; border-radius: 14px; }
#mobile-mic.app-shell[data-layout] .panel-tile { border-radius: 16px; box-shadow: 0 4px 14px #16223b08; }
#mobile-mic.app-shell[data-layout] .panel-key { border-radius: 15px; }
#mobile-mic.app-shell[data-layout] :is(.settings-sheet,.app-sheet) { box-shadow: 0 18px 54px #0003; }
#mobile-mic.app-shell[data-layout] .sheet-header { padding-left: 20px; }
#mobile-mic.app-shell[data-layout] .settings-group { background: var(--well); border-color: transparent; }
#mobile-mic.app-shell[data-layout] .settings-group :is(input[type="text"],select) { background: var(--panel); }

@media (max-width: 360px) {
  #mobile-mic.app-shell[data-layout] { padding-inline: max(12px,env(safe-area-inset-left)) max(12px,env(safe-area-inset-right)); }
  #mobile-mic.app-shell[data-layout] .device-tools { gap: 4px; }
  #mobile-mic.app-shell[data-layout] .panel-key-title { font-size: 15px; }
  #mobile-mic.app-shell[data-layout] .panel-key { padding-left: 8px; }
  #mobile-mic.app-shell[data-layout] .settings-content { padding-inline: 12px; }
  #mobile-mic.app-shell[data-layout] .settings-group { padding: 12px; }
}
@media (max-height: 650px) {
  #mobile-mic.app-shell[data-layout] .app-header { padding-block: 4px; }
  #mobile-mic.app-shell[data-layout] .microphone-screen { gap: 4px; padding-block: 2px 6px; }
  #mobile-mic.app-shell[data-layout] .capture-status { gap: 6px; padding: 8px; border-radius: 18px; }
  #mobile-mic.app-shell[data-layout] .capture-caption { display: none; }
  #mobile-mic.app-shell[data-layout] .mic-symbol { width: 42px; height: 42px; border-radius: 14px; }
  #mobile-mic.app-shell[data-layout] .mic-symbol svg { width: 26px; height: 26px; }
  #mobile-mic.app-shell[data-layout] #status { font-size: 16px; }
  #mobile-mic.app-shell[data-layout] .feedback-card { padding: 8px 10px; }
  #mobile-mic.app-shell[data-layout] .panel-tabs { margin-top: 4px; padding-block: 4px; }
  #mobile-mic.app-shell[data-layout] .panel-tabs button { min-height: 52px; }
  #mobile-mic.app-shell[data-layout] .panel-controls { gap: 6px; }
  #mobile-mic.app-shell[data-layout] .panel-grid { gap: 8px; }
  #mobile-mic.app-shell[data-layout] .panel-key { gap: 5px; padding-block: 6px; }
  #mobile-mic.app-shell[data-layout] .panel-key-icon, #mobile-mic.app-shell[data-layout] .panel-key-icon .ui-icon { min-height: 24px; width: 24px; height: 24px; }
}
@media (orientation: portrait) and (max-height: 650px) {
  #mobile-mic.app-shell[data-layout] .panel-key { flex-direction: row; gap: 5px; padding: 4px 4px 4px 6px; }
  #mobile-mic.app-shell[data-layout] .panel-key-icon, #mobile-mic.app-shell[data-layout] .panel-key-icon .ui-icon { min-height: 20px; width: 20px; height: 20px; }
  #mobile-mic.app-shell[data-layout] .panel-key-labels { flex: 1; min-width: 0; gap: 2px; align-items: flex-start; }
  #mobile-mic.app-shell[data-layout] .panel-key-title { font-size: 15px; line-height: 1.2; text-align: left; }
  #mobile-mic.app-shell[data-layout] .panel-shortcut { font-size: 11px; }
  #mobile-mic.app-shell[data-layout] .panel-feedback { flex-basis: 44px; height: 44px; min-height: 44px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  #mobile-mic.app-shell[data-layout] { max-width: 960px; grid-template-columns: minmax(0,1fr) 220px; grid-template-rows: auto minmax(0,1fr) auto; column-gap: 20px; padding-inline: max(12px,env(safe-area-inset-left)) max(12px,env(safe-area-inset-right)); }
  #mobile-mic.app-shell[data-layout] .app-header { grid-column: 1 / -1; padding-block: 2px; }
  #mobile-mic.app-shell[data-layout] .console { grid-column: 1; grid-row: 2 / 4; }
  #mobile-mic.app-shell[data-layout] .action-dock { grid-column: 2; grid-row: 2; align-self: center; padding: 0; }
  #mobile-mic.app-shell[data-layout] .panel-tabs { grid-column: 2; grid-row: 3; margin: 0; }
  #mobile-mic.app-shell[data-layout] .panel-tabs button { flex-direction: row; min-height: 48px; gap: 6px; font-size: 12px; padding: 4px; }
  #mobile-mic.app-shell[data-layout] .panel-tabs .ui-icon { width: 20px; height: 20px; }
  #mobile-mic.app-shell[data-layout] .microphone-screen { gap: 4px; padding: 4px 0 8px; }
  #mobile-mic.app-shell[data-layout] .mic-symbol { display: none; }
  #mobile-mic.app-shell[data-layout] .capture-status { gap: 6px; flex-basis: 50px; }
  #mobile-mic.app-shell[data-layout] #status { font-size: 14px; }
  #mobile-mic.app-shell[data-layout] #duration { font-size: 36px; }
  #mobile-mic.app-shell[data-layout] .feedback-card { padding: 6px 10px; }
  #mobile-mic.app-shell[data-layout] .help { padding: 4px; font-size: 11px; }
  #mobile-mic.app-shell[data-layout] .connection-instruction { font-size: 12px; }
  #mobile-mic.app-shell[data-view="keypad"][data-connected="true"] .console { grid-column: 1 / -1; grid-row: 2; }
  #mobile-mic.app-shell[data-view="keypad"][data-connected="true"] .panel-tabs { grid-column: 1 / -1; grid-row: 3; }
  #mobile-mic.app-shell[data-view="keypad"][data-connected="true"] .panel-controls { display: grid; grid-template-columns: 124px minmax(0,1fr); grid-template-rows: auto minmax(0,1fr) auto; gap: 4px 10px; padding: 0 0 4px; }
  #mobile-mic.app-shell[data-view="keypad"][data-connected="true"] .panel-toolbar { grid-column: 1; grid-row: 1; flex-wrap: wrap; gap: 0; }
  #mobile-mic.app-shell[data-view="keypad"][data-connected="true"] .panel-pin { min-height: 44px; max-width: none; }
  #mobile-mic.app-shell[data-view="keypad"][data-connected="true"] .panel-frontmost { grid-column: 1; grid-row: 2; align-self: start; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  #mobile-mic.app-shell[data-view="keypad"][data-connected="true"] .panel-grid { grid-column: 2; grid-row: 1 / -1; grid-template-columns: repeat(3,minmax(0,1fr)); grid-template-rows: repeat(2,minmax(0,1fr)); }
  #mobile-mic.app-shell[data-view="keypad"][data-connected="true"] .panel-pagination { grid-column: 1; grid-row: 3; gap: 2px; }
  #mobile-mic.app-shell[data-view="keypad"][data-connected="true"] .panel-pagination button { font-size: 11px; padding: 6px; }
  #mobile-mic.app-shell[data-view="keypad"][data-connected="true"] .panel-feedback { grid-column: 1; grid-row: 2; align-self: end; }
  #mobile-mic.app-shell[data-view="keypad"][data-connected="true"]:is([data-phase="recording"],[data-phase="starting"],[data-phase="stopping"]) .action-dock { grid-column: 2; grid-row: 3; display: flex; align-items: center; gap: 6px; }
  #mobile-mic.app-shell[data-view="keypad"][data-connected="true"]:is([data-phase="recording"],[data-phase="starting"],[data-phase="stopping"]) .panel-tabs { grid-column: 1; }
  #mobile-mic.app-shell[data-view="keypad"][data-connected="true"] .action-dock .primary-actions { flex: 1; min-width: 0; }
  #mobile-mic.app-shell[data-view="keypad"][data-connected="true"] .dock-secondary { flex: 0 1 90px; height: auto; }
  #mobile-mic.app-shell[data-view="keypad"][data-connected="true"] .action-dock .primary { font-size: 12px; padding: 8px; min-height: 44px; }
  #mobile-mic.app-shell[data-view="keypad"][data-connected="true"] .dock-secondary .cancel { font-size: 11px; padding: 6px 4px; min-height: 44px; }
  #mobile-mic.app-shell[data-layout] .panel-key { gap: 4px; padding: 5px 3px 5px 6px; }
  #mobile-mic.app-shell[data-layout] .panel-key-labels { gap: 3px; }
  #mobile-mic.app-shell[data-layout] .panel-key-title { font-size: 13px; }
  #mobile-mic.app-shell[data-layout] .panel-key-icon, #mobile-mic.app-shell[data-layout] .panel-key-icon .ui-icon { min-height: 20px; width: 20px; height: 20px; }
  #mobile-mic.app-shell[data-layout] .panel-shortcut { font-size: 10px; }
}
@media (prefers-reduced-motion: no-preference) { .panel-tile[data-status="pending"] .panel-key-icon .ui-icon { animation: spin 1s linear infinite; } }
/* An executable key on this page replaces the matching dock action. Paging,
   lost authorization and recovery immediately restore the dock fallback. */
#mobile-mic.app-shell[data-view="keypad"][data-panel-stop="true"] .action-dock .primary-actions,
#mobile-mic.app-shell[data-view="keypad"][data-panel-cancel="true"] .action-dock .dock-secondary,
#mobile-mic.app-shell[data-view="keypad"][data-panel-stop="true"][data-panel-cancel="true"] .action-dock { display: none; }
#mobile-mic.app-shell[data-view="keypad"][data-panel-stop="true"] .action-dock .dock-secondary { flex: 1; }
#mobile-mic.app-shell[data-phase="recording"] .panel-tile[data-builtin="stop"]:has(.panel-key:not(:disabled)) { background: var(--record-soft); }
#mobile-mic.app-shell[data-phase="recording"] .panel-tile[data-builtin="stop"] .panel-key:not(:disabled) { color: var(--danger); }
#mobile-mic.app-shell[data-phase="recording"] .panel-tile[data-builtin="stop"] .panel-key:not(:disabled) .panel-key-icon { color: var(--danger); }
@media (orientation: landscape) and (max-height: 500px) {
  #mobile-mic.app-shell[data-view="keypad"][data-panel-stop="true"][data-panel-cancel="true"] .panel-tabs { grid-column: 1 / -1; }
  #mobile-mic.app-shell[data-layout] .panel-pagination output { font-size: 11px; }
}
