html {
  box-sizing: border-box;
  height: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
*, *:before, *:after {
  box-sizing: inherit;
}

/*
 * The HTML hidden attribute must always win.  The login overlay uses
 * display:flex when visible; without this rule some browsers keep the overlay
 * visible even after JavaScript sets loginOverlay.hidden = true.
 */
[hidden] {
  display: none !important;
}

body {
  height: 100%;
  min-height: 100%;
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7f9;
  color: #1f2933;
  max-width: 100%;
  overflow-x: hidden;
}

/* The dictation app page is viewport-locked; help.html remains a normal
   scrollable document because it does not use the fd-appPage body class. */
body.fd-appPage {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

/* v30/v32 layout: keep controls visible and let only the scratchpad scroll. */
#appShell {
  height: 100%;
  min-height: 0;
  max-height: 100vh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

body.fd-busy, body.fd-busy * {
  cursor: progress !important;
}

.fd-note-heading {
  font-weight: 700;
  text-transform: uppercase;
}
.fd-note-heading-underlined {
  text-decoration: underline;
  text-underline-offset: 0.12em;
}
header, .toolbar, .statusbar, .layout {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}
.versionInfo {
  margin-left: auto;
  color: #64748b;
  font-size: 0.82rem;
  white-space: nowrap;
}

header {
  padding: 20px 20px 10px 20px;
  flex: 0 0 auto;
}
#appShell header {
  padding: 8px 16px 4px 16px;
}
#appShell .brandLogoBox {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  font-size: 22px;
}
#appShell .brandLogo {
  width: 42px;
  height: 42px;
}
#appShell h1 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.15;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
/*
 * The existing Toothless logo stays unchanged.  v67 renders it as a normal
 * visible image so a cold browser cache cannot leave the login page blank while
 * JavaScript waits to flip logo-state classes.  The fallback letter appears only
 * after a genuine image error.
 */
.brandLogoBox {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background: #d9f99d;
  color: #102a43;
  font-weight: 800;
  font-size: 28px;
  line-height: 1;
}
.brandLogo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 50%;
  display: block;
  position: absolute;
  inset: 0;
  opacity: 1;
}
.brandLogo.fd-logo-error,
.brandLogoBox.fd-logo-error .brandLogo {
  display: none;
}
.brandLogoFallback {
  display: none;
  user-select: none;
}
.brandLogoBox.fd-logo-error .brandLogoFallback {
  display: inline-block;
}

h1 { margin: 0 0 8px 0; }
.subtle { color: #52606d; margin: 0; }
.toolbar {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 6px 16px 4px 16px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}
.toolbarButtons {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
}
button {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid #9aa5b1;
  border-radius: 6px;
  background: white;
  color: #1f2933;
  padding: 7px 10px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  min-height: 34px;
  transition: background-color 120ms ease, border-color 120ms ease, transform 80ms ease, box-shadow 120ms ease;
}
button:disabled { opacity: 0.45; cursor: not-allowed; color: #52606d; }
button:active:not(:disabled) {
  transform: translateY(1px);
  background: #eef7ff;
  border-color: #2563eb;
}
.secretLabel { margin-left: auto; font-size: 13px; color: #52606d; }
.secretLabel input { margin-left: 6px; padding: 6px; }
.passwordManagerUsername {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.statusbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 16px;
  color: #52606d;
  flex: 0 0 auto;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 12px;
  padding: 6px 16px 12px 16px;
  min-width: 0;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.layoutNoEvents {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
}

/* v89 mode-aware layout: General Dictation does not use Review Notes, so
   the frame is removed and the scratchpad reclaims the full width/height. */
.layoutReviewHidden,
.layout.layoutNoEvents.layoutReviewHidden {
  grid-template-columns: minmax(0, 1fr);
}
.layoutReviewHidden .reviewPane {
  display: none !important;
}
.editorPane, .reviewPane {
  background: white;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  padding: 10px;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.editorPane h2, .reviewPane h2 {
  flex: 0 0 auto;
  margin: 0 0 8px 0;
  font-size: 1rem;
  line-height: 1.2;
}
.editor {
  min-height: 0;
  flex: 1 1 auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  outline: none;
  line-height: 1.45;
  font-family: Calibri, Arial, sans-serif;
  font-size: 12pt;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  padding: 12px;
  background: #fff;
}
.fd-segment {
  white-space: pre-wrap;
  transition: background-color 900ms ease, border-color 900ms ease;
}
/* Real zero-width anchor used only to paint the caret after trailing dictated
   New Line/New Paragraph breaks.  JavaScript strips it from all plain text. */
.fd-live-caret-anchor {
  display: inline;
  white-space: pre;
}
/*
 * Segment colors mirror the transcription pipeline:
 *   fd-live / fd-background-pending: darker blue = live-only or still pending.
 *   fd-background-voted: lighter blue = background vendors voted and updated text.
 *   fd-final: plain/white = OpenAI Finalize Note has produced final text.
 * Yellow fd-review-highlight is reserved for Finalize Note review items.
 * v38 rolling chunks use child fd-segment-part spans so a pending later chunk
 * never repaints an earlier background-voted chunk.
 */
.fd-segment.fd-live {
  background-color: #dbeafe;
  border-bottom: 1px dotted #7b8794;
}
.fd-segment.fd-background-pending {
  background-color: #dbeafe;
  border-bottom: 1px dotted #7b8794;
}
.fd-segment.fd-background-voted {
  background-color: #eef7ff;
  border-bottom: 1px dotted #b6c7d6;
}
.fd-segment.fd-final {
  background-color: transparent;
  border-bottom: 1px dotted transparent;
}

.fd-segment.fd-rolling-display {
  background-color: transparent;
  border-bottom: 1px dotted transparent;
}
.fd-segment-part {
  white-space: pre-wrap;
  transition: background-color 900ms ease, border-color 900ms ease;
}
.fd-segment-part.fd-live,
.fd-segment-part.fd-background-pending {
  background-color: #dbeafe;
  border-bottom: 1px dotted #7b8794;
}
.fd-segment-part.fd-background-voted {
  background-color: #eef7ff;
  border-bottom: 1px dotted #b6c7d6;
}
.fd-segment-part.fd-final {
  background-color: transparent;
  border-bottom: 1px dotted transparent;
}
.fd-review-highlight {
  background: #fff3bf;
  border-bottom: 2px solid #f08c00;
  cursor: help;
  transition: background-color 800ms ease, border-color 800ms ease;
}
.reviewNotes {
  white-space: pre-wrap;
  font-family: Calibri, Arial, sans-serif;
  font-size: 12pt;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  padding: 8px;
  min-height: 92px;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
}
.events {
  height: 260px;
  overflow-x: auto;
  overflow-y: auto;
  white-space: pre;
  max-width: 100%;
  background: #102a43;
  color: #d9e2ec;
  padding: 10px;
  border-radius: 6px;
  font-size: 12px;
}


/* v67 first-load logo preload: the logo fallback letter stays hidden while
   the image downloads, but the login card itself remains visible.  Login must
   never depend on image decode(), cached image events, or diagnostic JavaScript. */
.loginOverlay.fd-login-logo-wait .loginDialog {
  visibility: visible;
}

/* v26 login and email controls.  The login dialog is a normal form so
   browser password managers can save/fill credentials.  The form submits
   normally to /api/login; JavaScript does not intercept it because Chrome
   Password Manager is more reliable with native form submission. */
.loginOverlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 42, 67, 0.22);
  z-index: 1000;
}
.loginDialog {
  width: min(420px, calc(100vw - 32px));
  background: white;
  border: 1px solid #d9e2ec;
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 12px 34px rgba(16, 42, 67, 0.22);
}
.loginBrand { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.loginBrand h1 { font-size: 24px; margin: 0; }
.loginHelp { color: #52606d; margin: 0 0 14px 0; }
.loginDialog label { display: block; font-size: 14px; margin: 12px 0; color: #334e68; }
.loginDialog input { box-sizing: border-box; width: 100%; padding: 9px; margin-top: 4px; }
#loginBtn {
  background: #102a43;
  border-color: #102a43;
  color: #ffffff;
  width: 100%;
}
.loginMessage { margin-top: 10px; color: #b42318; min-height: 1.2em; }
.accountBlock {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: 0 0 auto;
  min-width: 250px;
}
.accountSessionRow { display: flex; align-items: center; justify-content: flex-end; gap: 8px; width: 100%; }
.emailLabel { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #52606d; }
.emailLabel input { margin-left: 0; padding: 5px 6px; min-width: 240px; }
.currentUser { min-height: 1.2em; font-size: 12px; line-height: 1.2; color: #52606d; text-align: right; }

@media (max-width: 900px) {
  header, .toolbar, .statusbar, .layout { max-width: 100%; }
  .layout { padding-left: 8px; padding-right: 8px; }
  .toolbar { padding-left: 8px; padding-right: 8px; flex-wrap: wrap; }
  .toolbarButtons { gap: 6px; }
  .accountBlock { margin-left: 0; width: 100%; align-items: flex-end; }
  .accountSessionRow { justify-content: flex-end; }
  .emailLabel { width: auto; }
  .emailLabel input { min-width: 0; width: min(100%, 320px); }
  .secretLabel { margin-left: 0; width: 100%; }
  .secretLabel input { max-width: 100%; }
  .brand { align-items: center; }
  .brandLogoBox { width: 48px; height: 48px; flex-basis: 48px; font-size: 24px; }
  .brandLogo { width: 48px; height: 48px; }
  #appShell .brandLogoBox { width: 38px; height: 38px; flex-basis: 38px; font-size: 20px; }
  #appShell .brandLogo { width: 38px; height: 38px; }
  h1 { font-size: 1.45rem; }
  #appShell h1 { font-size: 1.2rem; }
}
@media (max-width: 720px) {
  .layout,
  .layout.layoutNoEvents,
  .layoutNoEvents {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(90px, 18vh);
    padding-left: 8px;
    padding-right: 8px;
  }
  .layoutReviewHidden,
  .layout.layoutNoEvents.layoutReviewHidden {
    grid-template-rows: minmax(0, 1fr);
  }
  .reviewPane { max-height: 18vh; }
}
@media (max-width: 640px) {
  .accountBlock { align-items: stretch; }
  .accountSessionRow { justify-content: space-between; }
  .emailLabel { justify-content: flex-start; width: 100%; }
  .emailLabel input { width: 100%; }
}



/* v26 toolbar simplification.  The same button starts and stops dictation;
   this active style helps users see when the microphone is currently open. */
button.dictationActive {
  background: #fee2e2;
  border-color: #ef4444;
  color: #7f1d1d;
}

/* Buttons visibly flash for both clicks and recognized verbal UI commands. */
button.fd-command-flash {
  animation: fdCommandFlash 650ms ease-out;
}
button.fd-command-flash-disabled {
  animation: fdCommandFlashDisabled 650ms ease-out;
}
@keyframes fdCommandFlash {
  0% { background: #dbeafe; border-color: #2563eb; box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.75); }
  45% { background: #bfdbfe; border-color: #1d4ed8; box-shadow: 0 0 0 7px rgba(37, 99, 235, 0.24); }
  100% { background: white; border-color: #9aa5b1; box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}
@keyframes fdCommandFlashDisabled {
  0% { background: #f1f5f9; border-color: #64748b; box-shadow: 0 0 0 0 rgba(100, 116, 139, 0.75); }
  45% { background: #e2e8f0; border-color: #475569; box-shadow: 0 0 0 7px rgba(100, 116, 139, 0.24); }
  100% { background: white; border-color: #9aa5b1; box-shadow: 0 0 0 0 rgba(100, 116, 139, 0); }
}

/* v26 production UI: Raw Events is removed from the normal page.  Keep this
   class only so a developer can temporarily add a hidden diagnostic panel
   without changing the JavaScript. */
.eventsDebugOnly {
  display: none;
}

/* Visible manual version footer used by help.html. */
.manualVersionFooter {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid #d9e2ec;
  color: #52606d;
  font-size: 13px;
  text-align: right;
}

/* v28 visible Finalize Note progress indicator.  This is intentionally
   implemented with ordinary HTML/CSS rather than a cursor-only busy state so it
   works on touch devices such as iPhone and iPad Safari. */
.finalizeOverlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 42, 67, 0.18);
  padding: 20px;
}
.finalizePanel {
  width: min(430px, calc(100vw - 36px));
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  background: #ffffff;
  border: 1px solid #b6c7d6;
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(16, 42, 67, 0.26);
  padding: 18px;
}
.finalizeDragon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eef7ff;
  /* v28: keep the Finalize indicator professional and restrained.
     The logo is static; only the subtle progress sweep animates. */
}
.finalizeDragon img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}
.finalizeText strong {
  display: block;
  margin-bottom: 4px;
  color: #102a43;
}
.finalizeHint {
  margin-top: 4px;
  color: #52606d;
  font-size: 13px;
}
.finalizeSweep {
  grid-column: 1 / -1;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(59,130,246,0), rgba(59,130,246,0.85), rgba(59,130,246,0));
  animation: fdFinalizeSweep 1200ms linear infinite;
}
@keyframes fdFinalizeSweep {
  0% { transform: translateX(-85%); }
  100% { transform: translateX(85%); }
}
@media (prefers-reduced-motion: reduce) {
  .finalizeSweep { animation: none; }
}

/* Finalize failure state.  The controls are re-enabled, but the overlay briefly
   remains visible so iOS/touch users get a clear non-cursor failure signal. */
.finalizeOverlay.finalizeOverlayError {
  background: rgba(127, 29, 29, 0.12);
}
.finalizeOverlay.finalizeOverlayError .finalizePanel {
  border-color: #ef4444;
}
.finalizeOverlay.finalizeOverlayError .finalizeDragon {
  background: #fee2e2;
  animation: none;
}
.finalizeOverlay.finalizeOverlayError .finalizeSweep {
  display: none;
}

/* v44 audio replay drop target. */
.editor.fd-audio-drop-target {
  outline: 3px dashed currentColor;
  outline-offset: -8px;
}

/* v67 Auto Text variable fields.  The brackets used in Settings are not shown
   in the live scratchpad; fields are editable highlighted spans instead. */
.fd-autotext-field {
  background: #f3e8ff;
  outline: 1px solid #a855f7;
  border-radius: 3px;
  padding: 0 1px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.fd-autotext-field.fd-autotext-field-active {
  background: #e9d5ff;
  outline: 2px solid #7e22ce;
}
.fd-autotext-field.fd-autotext-field-empty::before {
  content: "\00a0\00a0";
}

.fd-autotext-exit-line {
  min-height: 1.25em;
  cursor: text;
}
.fd-autotext-exit-anchor {
  display: inline-block;
  width: 0;
  min-width: 0;
  min-height: 1.1em;
  overflow: hidden;
  vertical-align: baseline;
}
.fd-autotext-exit-line:hover {
  outline: 1px dotted #a855f7;
  outline-offset: 1px;
}

/* v67 Settings dialog and Auto Text editor. */
.settingsOverlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 42, 67, 0.24);
  padding: 18px;
}
.settingsDialog {
  width: min(920px, calc(100vw - 28px));
  height: min(720px, calc(100vh - 28px));
  height: min(720px, calc(100dvh - 28px));
  min-height: min(640px, calc(100vh - 28px));
  min-height: min(640px, calc(100dvh - 28px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #b6c7d6;
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(16, 42, 67, 0.26);
}
.settingsHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px 16px;
  border-bottom: 1px solid #d9e2ec;
}
.settingsHeader h2 {
  margin: 0;
  font-size: 1.15rem;
}

.modeBadge {
  margin-left: 12px;
  color: #52606d;
  font-size: 0.9rem;
}
.logoutBtn {
  align-self: flex-end;
  border: 1px solid #b6c7d6;
  background: #ffffff;
  color: #334e68;
  border-radius: 8px;
  padding: 5px 10px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}
.logoutBtn:hover {
  background: #eef7ff;
  border-color: #2563eb;
}
.logoutBtn:disabled {
  opacity: 0.65;
  cursor: wait;
}
.settingsTab {
  border: 1px solid #d9e2ec;
  background: #ffffff;
  border-radius: 8px 8px 0 0;
  padding: 8px 12px;
  cursor: pointer;
  color: #334e68;
  font-weight: 700;
}
.settingsTab:focus {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
}
.settingsFormLayout {
  display: grid;
  gap: 8px;
  max-width: 620px;
}
.settingsFormLayout label {
  color: #334e68;
  font-weight: 700;
}
.settingsFormLayout select {
  width: min(100%, 360px);
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  padding: 7px;
  font: inherit;
}
.modeDescriptions {
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
}
.modeDescriptions p {
  margin: 0 0 7px 0;
}
.modeDescriptions p:last-child {
  margin-bottom: 0;
}

.settingsTabs {
  display: flex;
  gap: 6px;
  padding: 10px 16px 0 16px;
}
.settingsTab.settingsTabActive {
  background: #eef7ff;
  border-color: #2563eb;
}
.settingsPanel {
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px 16px 16px 16px;
  overflow: auto;
}
.autoTextLayout {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 14px;
  min-height: 420px;
}
.autoTextListPane, .autoTextEditorPane {
  min-width: 0;
}
.autoTextListPane label, .autoTextEditorPane label {
  display: block;
  color: #334e68;
  font-weight: 700;
  margin-bottom: 5px;
}
#autoTextEntryList {
  width: 100%;
  min-height: 300px;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  padding: 4px;
  font: inherit;
}
.autoTextListButtons, .autoTextActions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
#autoTextTriggerInput, #autoTextContentInput {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  padding: 8px;
  font: inherit;
  resize: vertical;
}
#autoTextContentInput {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.35;
}
.autoTextHint {
  margin: 5px 0 10px 0;
  color: #52606d;
  font-size: 13px;
}
.autoTextDirtyIndicator {
  color: #7c2d12;
  font-size: 13px;
}
.autoTextMessage {
  min-height: 1.3em;
  margin-top: 8px;
  color: #52606d;
  font-size: 13px;
}
.autoTextMessage.autoTextMessageError {
  color: #b42318;
}
@media (max-width: 720px) {
  .settingsDialog {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    height: calc(100dvh - 16px);
    min-height: 0;
  }
  .autoTextLayout {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }
  #autoTextEntryList {
    min-height: 140px;
  }
}

/* v67 custom Toothless-style toolbar/action icons.  These CSS-only icons keep the
   existing logo unchanged while giving toolbar buttons a consistent rounded,
   clinical productivity look with purple active states and browser tooltips. */
.fd-iconButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  border-radius: 9px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease, color 120ms ease;
}
.fd-iconButton:hover {
  background: #f5f3ff;
  border-color: #b4a7f5;
}
.fd-iconButton:focus-visible {
  outline: 2px solid #8b5cf6;
  outline-offset: 2px;
}
.fd-iconButton:disabled {
  color: #94a3b8;
  background: #f8fafc;
  cursor: not-allowed;
  opacity: 0.72;
}
.fd-iconButton.fd-buttonActive,
.fd-iconButton[aria-pressed="true"],
.fd-iconButton.dictationActive {
  background: #ede9fe;
  border-color: #8b5cf6;
  color: #5b21b6;
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.25);
}
.fd-actionButton .fd-icon {
  width: 18px;
  height: 18px;
}
.fd-buttonText {
  line-height: 1;
}
.fd-icon {
  width: 19px;
  height: 19px;
  display: inline-block;
  position: relative;
  flex: 0 0 auto;
  color: currentColor;
}

.fd-svgIcon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  flex: 0 0 auto;
}
.fd-svgIcon svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fd-icon::before,
.fd-icon::after {
  box-sizing: border-box;
}
.fd-icon-bold::before { content: "B"; font-weight: 850; font-size: 18px; line-height: 19px; font-family: Georgia, "Times New Roman", serif; }
.fd-icon-italic::before { content: "I"; font-style: italic; font-weight: 700; font-size: 18px; line-height: 19px; font-family: Georgia, "Times New Roman", serif; }
.fd-icon-underline::before { content: "U"; font-weight: 750; font-size: 17px; line-height: 18px; text-decoration: underline; font-family: Georgia, "Times New Roman", serif; }
.fd-icon-align-left::before,
.fd-icon-align-center::before,
.fd-icon-align-right::before {
  content: "";
  position: absolute;
  inset: 3px 2px;
  border-radius: 2px;
}
.fd-icon-align-left::before {
  background:
    linear-gradient(currentColor, currentColor) left 0 / 15px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left 5px / 10px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left 10px / 15px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left 15px / 8px 2px no-repeat;
}
.fd-icon-align-center::before {
  background:
    linear-gradient(currentColor, currentColor) center 0 / 15px 2px no-repeat,
    linear-gradient(currentColor, currentColor) center 5px / 10px 2px no-repeat,
    linear-gradient(currentColor, currentColor) center 10px / 15px 2px no-repeat,
    linear-gradient(currentColor, currentColor) center 15px / 8px 2px no-repeat;
}
.fd-icon-align-right::before {
  background:
    linear-gradient(currentColor, currentColor) right 0 / 15px 2px no-repeat,
    linear-gradient(currentColor, currentColor) right 5px / 10px 2px no-repeat,
    linear-gradient(currentColor, currentColor) right 10px / 15px 2px no-repeat,
    linear-gradient(currentColor, currentColor) right 15px / 8px 2px no-repeat;
}
.fd-icon-align-left::after,
.fd-icon-align-center::after,
.fd-icon-align-right::after { content: none; }
.fd-icon-print::before {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h8v4H6z'/%3E%3Cpath d='M5 13H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1'/%3E%3Cpath d='M6 11h8v6H6z'/%3E%3Cpath d='M14.5 9.5h.01'/%3E%3C/g%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h8v4H6z'/%3E%3Cpath d='M5 13H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1'/%3E%3Cpath d='M6 11h8v6H6z'/%3E%3Cpath d='M14.5 9.5h.01'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: 20px 20px;
  mask-size: 20px 20px;
}
.fd-icon-print::after { content: none; }
.fd-icon-copy::before { content: ""; position: absolute; left: 6px; top: 3px; width: 10px; height: 12px; border: 2px solid currentColor; border-radius: 2px; }
.fd-icon-copy::after { content: ""; position: absolute; left: 2px; top: 7px; width: 10px; height: 12px; border: 2px solid currentColor; border-radius: 2px; background: #fff; }
.fd-icon-email::before { content: ""; position: absolute; left: 2px; top: 5px; width: 15px; height: 11px; border: 2px solid currentColor; border-radius: 3px; }
.fd-icon-email::after { content: ""; position: absolute; left: 4px; top: 7px; width: 11px; height: 8px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transform-origin: center; }
.fd-icon-clear::before,
.fd-icon-clear::after { content: ""; position: absolute; left: 3px; top: 8px; width: 14px; height: 2px; border-radius: 2px; background: currentColor; }
.fd-icon-clear::before { transform: rotate(45deg); }
.fd-icon-clear::after { transform: rotate(-45deg); }
.fd-icon-stop::before { content: ""; position: absolute; left: 4px; top: 4px; width: 11px; height: 11px; border-radius: 2px; background: currentColor; }
.fd-icon-finalize::before { content: ""; position: absolute; inset: 2px; border: 2px solid currentColor; border-radius: 50%; }
.fd-icon-finalize::after { content: ""; position: absolute; left: 6px; top: 8px; width: 8px; height: 4px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); }
.fd-icon-settings::before { content: "⚙"; font-size: 18px; line-height: 19px; }
.fd-icon-help::before { content: "?"; position: absolute; inset: 2px; display: grid; place-items: center; border: 2px solid currentColor; border-radius: 50%; font-weight: 800; font-size: 13px; }
.fd-icon-microphone::before { content: ""; position: absolute; left: 6px; top: 2px; width: 8px; height: 11px; border: 2px solid currentColor; border-radius: 5px; }
.fd-icon-microphone::after { content: ""; position: absolute; left: 4px; top: 9px; width: 12px; height: 8px; border-bottom: 2px solid currentColor; border-left: 2px solid transparent; border-right: 2px solid transparent; box-shadow: 5px 5px 0 -3px currentColor; }

.formatToolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  overflow-x: visible;
  row-gap: 7px;
  column-gap: 7px;
  gap: 7px;
  padding: 8px;
  border: 1px solid #d8dee9;
  border-radius: 10px;
  background: #ffffff;
  margin-bottom: 8px;
}
.formatToolbar .fd-formatButton {
  width: 34px;
  height: 32px;
  padding: 4px;
}
.formatSeparator {
  width: 2px;
  min-width: 2px;
  height: 28px;
  background: #94a3b8;
  margin: 0 4px;
  flex: 0 0 2px;
  align-self: center;
}
.formatSelectLabel {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #475569;
  font-size: 12px;
  font-weight: 650;
}
.formatSelectLabel select {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #1f2933;
  padding: 5px 7px;
  min-height: 32px;
}
.fd-rich-left { text-align: left; }
.fd-rich-center { text-align: center; }
.fd-rich-right { text-align: right; }

.microphoneSettingsLayout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  max-width: 720px;
}
.microphoneDeviceRow {
  display: flex;
  gap: 8px;
  align-items: center;
}
.microphoneDeviceRow select {
  flex: 1 1 auto;
  min-width: 0;
}
.sliderLabel {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 650;
  color: #334155;
}
.microphoneCheckboxes {
  display: grid;
  gap: 6px;
  color: #334155;
}
.microphoneMeter {
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.microphoneLevelMeter {
  height: 100%;
  width: 0%;
  background: #8b5cf6;
  transition: width 80ms linear;
}

@media print {
  body.fd-appPage {
    height: auto;
    overflow: visible;
    background: #fff;
  }
  header, .toolbar, .statusbar, .formatToolbar, .reviewPane, .finalizeOverlay, .settingsOverlay, .modalOverlay {
    display: none !important;
  }
  #appShell, .layout, .editorPane {
    display: block !important;
    height: auto !important;
    max-height: none !important;
    max-width: none !important;
    overflow: visible !important;
  }
  .editorPane h2 {
    display: none;
  }
  .editor {
    border: 0 !important;
    box-shadow: none !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    background: #fff !important;
    color: #000 !important;
  }
  .fd-live, .fd-background-pending, .fd-background-voted, .fd-final, .fd-autotext-field {
    background: transparent !important;
    border-color: transparent !important;
    outline: 0 !important;
  }
  .fd-live-caret-anchor, .fd-autotext-exit-line, .fd-autotext-exit-anchor {
    display: none !important;
  }
}


/* v67 replay-file status banner. */
.replayBanner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px solid #c4b5fd;
  border-radius: 10px;
  background: #f5f3ff;
  color: #4c1d95;
  font-size: 0.94rem;
}
.replayBanner[hidden] {
  display: none !important;
}
.replayBannerIcon {
  width: 22px;
  height: 22px;
}
.replayBannerText {
  font-weight: 650;
}
.replayProgressText {
  color: #6d28d9;
  margin-left: auto;
  white-space: nowrap;
}
.replayClearBtn {
  border: 1px solid #b4a7f5;
  background: #ffffff;
  color: #5b21b6;
  border-radius: 8px;
  padding: 4px 9px;
  cursor: pointer;
}
.replayClearBtn:hover {
  background: #ede9fe;
}
.fd-actionSvgIcon {
  width: 19px;
  height: 19px;
}
.microphoneHelpText {
  margin: -4px 0 8px;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.35;
}
.microphoneInlineHelp {
  display: block;
  color: #64748b;
  font-size: 0.86rem;
  line-height: 1.25;
  margin-left: 22px;
}
#loginBtn:disabled {
  opacity: 0.7;
  cursor: wait;
}

/* v67 app boot guard: while the chunked JavaScript loader has not confirmed
   that handlers are bound, app-shell controls look and behave disabled instead
   of appearing clickable but inert. */
.fd-js-pending #appShell button,
.fd-js-pending #appShell select {
  pointer-events: none;
  opacity: 0.55;
}

.appLoadFailure {
  position: fixed;
  left: 1rem;
  right: 1rem;
  top: 1rem;
  z-index: 2000;
  padding: 0.85rem 1rem;
  border: 1px solid #9f1239;
  border-radius: 0.65rem;
  background: #fff1f2;
  color: #7f1d1d;
  box-shadow: 0 0.45rem 1.5rem rgba(15, 23, 42, 0.18);
  font-weight: 700;
}


/* v67 toolbar and panel layout cleanup. */
.appHeader { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-right: 16px; }
.accountToolbar { align-items: flex-start; padding-top: 4px; padding-bottom: 4px; }
.accountBlock { min-width: 0; }
.headerAccountBlock { margin-left: auto; display: flex; justify-content: flex-end; }
.accountSessionRow { gap: 10px; }
.logoutBtn { align-self: auto; min-height: 32px; padding: 6px 10px; font: inherit; font-weight: 600; }
.formatToolbar { gap: 6px; row-gap: 7px; overflow-x: visible; flex-wrap: wrap; }
.toolbarGroup { display: inline-flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.helpSettingsToolbarGroup { flex: 0 0 auto; }
.fd-iconOnly { width: 34px; min-width: 34px; padding: 4px; gap: 0; }
.fd-iconOnly .fd-buttonText { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.fd-iconButton.fd-nextAction { background: #dcfce7; border-color: #16a34a; color: #14532d; box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.22); }
.fd-iconButton.fd-nextAction.fd-nextActionPulse { animation: fdNextActionPulse 2s ease-in-out infinite; }
@keyframes fdNextActionPulse {
  0%, 100% { background: #ffffff; border-color: #cbd5e1; color: #334155; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
  50% { background: #dcfce7; border-color: #16a34a; color: #14532d; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.24); }
}
@media (prefers-reduced-motion: reduce) {
  .fd-iconButton.fd-nextAction.fd-nextActionPulse { animation: none; }
}
.fd-iconButton.fd-stopAction, .fd-iconButton.dictationActive.fd-stopAction { background: #fee2e2; border-color: #dc2626; color: #7f1d1d; box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.22); }
.panelFooter { flex: 0 0 auto; min-height: 1.45em; margin-top: 6px; color: #52606d; font-size: 0.84rem; line-height: 1.35; }
.editorStatusbar { display: flex; align-items: center; }
.reviewMeta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.reviewMeta .versionInfo, .reviewMeta .modeBadge { margin-left: 0; font-size: 0.84rem; color: #64748b; white-space: nowrap; }
.modalOverlay { position: fixed; inset: 0; z-index: 1800; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(15, 23, 42, 0.42); }
.modalDialog { width: min(420px, calc(100vw - 32px)); background: #ffffff; border: 1px solid #d9e2ec; border-radius: 14px; box-shadow: 0 20px 48px rgba(15, 23, 42, 0.28); padding: 18px; }
.modalDialog h2 { margin: 0 0 12px 0; font-size: 1.1rem; }
.modalField { display: grid; gap: 6px; color: #334e68; font-weight: 650; }
.modalField input { width: 100%; padding: 8px 9px; border: 1px solid #b6c7d6; border-radius: 8px; font: inherit; }
.modalMessage { min-height: 1.3em; margin-top: 8px; color: #52606d; font-size: 0.9rem; }
.modalActions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.primaryButton { background: #102a43; color: #ffffff; border-color: #102a43; }
.dangerButton { background: #b91c1c; color: #ffffff; border-color: #991b1b; }
.emailLabel { display: none !important; }
@media (max-width: 720px) { .reviewMeta { justify-content: flex-start; } .formatToolbar { align-items: center; } .toolbarGroup { gap: 5px; } .appHeader { align-items: flex-start; } .headerAccountBlock { width: 100%; justify-content: flex-start; } }
@media print { .panelFooter, .modalOverlay { display: none !important; } }

.fd-clearNoteButton:not(:disabled):hover, .fd-clearNoteButton:not(:disabled):focus-visible { border-color: #dc2626; color: #7f1d1d; }

/* v67 toolbar layout: the main workflow/editing toolbar lives above both panels
   so the Dictation Scratchpad and Review Notes panels align. */
.accountToolbar .formatToolbar { flex: 1 1 100%; margin: 0; min-width: 0; }
.accountToolbar .accountBlock { flex: 0 0 auto; }

/* v89 same-user mirroring: mirror clients are read-only until Take Control. */
.fd-readOnlyMirror {
  background-image: repeating-linear-gradient(135deg, rgba(148, 163, 184, 0.08) 0, rgba(148, 163, 184, 0.08) 6px, transparent 6px, transparent 12px);
}
.fd-takeControlButton[hidden] {
  display: none !important;
}

/* v89 clients/mirroring management */
.clientsSettingsLayout {
  display: grid;
  gap: 0.7rem;
}
.clientsList {
  display: grid;
  gap: 0.5rem;
}
.clientsRow {
  align-items: center;
  border: 1px solid rgba(120, 120, 120, 0.35);
  border-radius: 0.5rem;
  display: flex;
  gap: 0.7rem;
  justify-content: space-between;
  padding: 0.55rem 0.7rem;
}
.clientsInfo {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}
.clientsInfo span {
  color: #555;
  font-size: 0.9rem;
}

/* v89 Settings > Clients tab. */
.clientsList{display:flex;flex-direction:column;gap:.55rem;margin-top:.5rem}.clientSessionRow{border:1px solid #d6dce5;border-radius:10px;padding:.6rem .75rem;background:#fff}.clientSessionTitle{font-weight:700;color:#1f2933}.clientSessionDetail{font-size:.9rem;color:#52606d;margin:.15rem 0 .45rem}.clientLogoutBtn{padding:.35rem .65rem;border:1px solid #b42318;color:#b42318;background:#fff;border-radius:8px}.clientLogoutBtn:hover{background:#fff5f5}

/* v89 shared-state Clients table. */
.clientsTable {
  border-collapse: collapse;
  width: 100%;
}
.clientsTable th,
.clientsTable td {
  border-bottom: 1px solid #d6dce5;
  padding: 0.45rem 0.5rem;
  text-align: left;
  vertical-align: top;
}
.clientsTable small {
  color: #52606d;
}
.clientsTable button[disabled] {
  opacity: 0.6;
}
