/* Text controls retain their existing compact shape. The microphone takes no flow space. */
.field-dictation-frame {
  position: relative;
  display: grid;
  min-width: 0;
  width: 100%;
  flex: 1 1 auto;
  align-self: stretch;
  color: var(--text);
}
html[data-theme] body[data-page] .field-dictation-frame { font: inherit; }
html[data-theme] body[data-page] .field-dictation-frame .field-dictation-input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding-right: 48px;
  box-sizing: border-box;
}
html[data-theme] body[data-page] .field-dictation-frame > .field-dictation-button {
  position: absolute;
  z-index: 1;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 11px;
  margin: 0;
  border: 0;
  border-radius: 6px;
  color: var(--accent-strong, var(--accent));
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}
html[data-theme="dark"] body[data-page] .field-dictation-frame > .field-dictation-button { color: var(--accent); }
html[data-theme] body[data-page] .field-dictation-frame > .field-dictation-button:hover { background: var(--accent-soft); }
html[data-theme] body[data-page] .field-dictation-frame > .field-dictation-button:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
html[data-theme] body[data-page] .field-dictation-frame > .field-dictation-button.listening { background: var(--danger); color: #fff; }
.field-dictation-button svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
html[data-theme] body[data-page] .field-dictation-multiline > .field-dictation-button { top: auto; bottom: 2px; transform: none; }
/* Address suggestions may mount after a synchronous inspection render. */
html[data-theme] body[data-page] .field-dictation-frame:has(> .address-autocomplete) > .field-dictation-button { top: 0; transform: none; }
.field-dictation-status {
  position: absolute;
  z-index: 2;
  right: 45px;
  bottom: 4px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  background: var(--surface);
  font-size: 11px;
  line-height: 18px;
  pointer-events: none;
}
.field-dictation-status:empty, .field-dictation-button[hidden] { display: none !important; }
body[data-page="inspection"] .room-dialog-fields label:has(> small) > .field-dictation-frame { flex-basis: 100%; }
html[data-theme] body[data-page="reports"] .report-search-field .field-dictation-with-clear > input.field-dictation-input { padding-right: 92px; }
html[data-theme] body[data-page="reports"] .field-dictation-with-clear > .field-dictation-button { right: 44px; }
html[data-theme] body[data-page="reports"] .report-search-field:has([data-report-clear][hidden]) .field-dictation-with-clear > input.field-dictation-input { padding-right: 48px; }
html[data-theme] body[data-page="reports"] .report-search-field:has([data-report-clear][hidden]) .field-dictation-with-clear > .field-dictation-button { right: 0; }
.field-dictation-notice {
  position: fixed;
  z-index: 1500;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(480px, calc(100vw - 24px));
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: var(--surface-2, var(--surface));
  box-shadow: var(--shadow);
  font-size: 14px;
  line-height: 1.45;
}
html[data-theme] body[data-page] .field-dictation-review { width: min(590px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow: auto; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.field-dictation-review .inspection-wizard { display: grid; gap: 16px; }
.field-dictation-review header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.field-dictation-review header h2 { font-size: 20px; overflow-wrap: anywhere; }
html[data-theme] body[data-page] .field-dictation-review .voice-privacy-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.field-dictation-review .voice-transcript-field { display: grid; gap: 7px; }
html[data-theme] body[data-page] .field-dictation-review textarea { width: 100%; min-height: 150px; padding: 10px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; font-size: 16px; }
.field-dictation-review footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
html[data-theme] body[data-page] .field-dictation-review footer button { min-height: 44px; padding: 8px 12px; color: var(--text); background: var(--surface-3); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
html[data-theme] body[data-page] .field-dictation-review footer [data-voice-append] { color: var(--text); border-color: var(--accent); }
@media print { .field-dictation-button, .field-dictation-status, .field-dictation-notice, .field-dictation-review { display: none !important; } }
