/* Sureword — Frontline Healthcare Voice Documentation Engine
 * Clinical Design System (WCAG 2.1 AAA / Field-Tested Standards)
 * No generic AI templates, no floating blobs, no decorative waveforms.
 */

:root {
  /* High-Contrast Clinical Palette (Tested for outdoor sunlight legibility) */
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;
  --primary-dark: #0b132b;

  --secondary: #334155;
  --secondary-hover: #1e293b;

  --accent: #b45309;
  --accent-hover: #92400e;
  --accent-light: #fffbeb;
  --accent-border: #f59e0b;

  --success: #047857;
  --success-hover: #065f46;
  --success-light: #ecfdf5;
  --success-border: #10b981;

  --danger: #b91c1c;
  --danger-hover: #991b1b;
  --danger-light: #fef2f2;
  --danger-border: #ef4444;

  /* Surfaces & High-Contrast Ink */
  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --bg-surface: #e2e8f0;
  
  --text-main: #0b132b;       /* 15:1 contrast against white */
  --text-secondary: #1e293b;  /* 9.5:1 contrast */
  --text-muted: #475569;      /* 5.2:1 contrast (WCAG AA compliant) */

  /* Resilient Field Borders */
  --border-subtle: #cbd5e1;
  --border-strong: #64748b;
  --border-focus: #0284c7;

  /* Touch Radii & Geometry */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  /* Structural Elevation (Subtle, non-floaty) */
  --shadow-subtle: 0 1px 3px 0 rgba(15, 23, 42, 0.08);
  --shadow-card: 0 2px 4px -1px rgba(15, 23, 42, 0.06), 0 4px 6px -2px rgba(15, 23, 42, 0.04);

  /* Native Typography Stack (Zero WebFont network latency for rural 2G/3G) */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Reset & Ergonomics */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Accessible Focus Outlines (WCAG 2.4.7 Focus Visible) */
:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 2px;
}

/* Skip Navigation Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--text-main);
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  z-index: 1000;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 1rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.app-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  background: #ffffff;
  border-bottom: 2px solid var(--border-subtle);
  box-shadow: var(--shadow-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.logo-wrapper {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1.1;
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.context-pill {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid #bae6fd;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.brand-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.2rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  background: var(--bg-surface);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  gap: 0.25rem;
}

.nav-tab {
  background: transparent;
  border: none;
  padding: 0.5rem 0.95rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
  min-height: 40px;
}

.nav-tab.active {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: var(--shadow-subtle);
}

.pill-counter {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
}

.system-status-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-selector-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lang-select {
  background: #ffffff;
  border: 2px solid var(--border-subtle);
  color: var(--text-main);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 40px;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%3E%3Cpath%20fill%3D%22%23475569%22%20d%3D%22M2%204l4%204%204-4z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 10px;
  transition: all 0.15s ease;
}
.lang-select:hover {
  border-color: var(--border-strong);
  background-color: var(--bg-surface);
}
.lang-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18);
}

.badge {
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  letter-spacing: 0.02em;
}
.badge-neutral { background: var(--bg-surface); color: var(--text-muted); border: 1px solid var(--border-subtle); }
.badge-live { background: var(--success-light); color: var(--success); border: 1px solid var(--success-border); }
.badge-fixture { background: var(--accent-light); color: var(--accent); border: 1px solid var(--accent-border); }
.badge-warning { background: var(--danger-light); color: var(--danger); border: 1px solid var(--danger-border); }

/* Offline Status Banner */
.offline-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  background: var(--warning-light, rgba(234, 179, 8, 0.12));
  color: var(--warning-text, #fef08a);
  border: 1px solid var(--warning-border, rgba(234, 179, 8, 0.35));
  border-radius: var(--radius-md, 8px);
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
}
.offline-banner[hidden] {
  display: none !important;
}
.offline-banner-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.offline-banner-icon {
  flex-shrink: 0;
  font-size: 1rem;
}

/* Dictation Audio Review Container */
.dictation-audio-container {
  margin-top: 1.25rem;
  padding: 0.875rem 1rem;
  background: var(--bg-surface, #1e293b);
  border: 1px solid var(--border-subtle, #334155);
  border-radius: var(--radius-md, 8px);
}
.dictation-audio-container[hidden] {
  display: none !important;
}
.dictation-audio-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.dictation-audio-icon {
  font-size: 1.1rem;
}
.dictation-audio-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main, #f8fafc);
}
.audio-player {
  width: 100%;
  height: 36px;
  border-radius: var(--radius-sm, 6px);
}

/* Main Layout */
.main-content {
  flex: 1;
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
}

.view-panel {
  display: none;
}
.view-panel.active {
  display: block;
}

.grid-layout {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .grid-layout {
    grid-template-columns: 1fr;
  }
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

.card-header, .form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border-subtle);
}

.card h2, .form-header h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.instruction {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* Presets Row */
.presets-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.presets-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.preset-chips {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.preset-chip {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s ease;
}
.preset-chip:hover {
  background: var(--primary-light);
  color: var(--primary-hover);
  border-color: var(--primary);
}

/* Mic Controls */
.mic-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  padding: 0.5rem 0 1rem 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 48px;
}

.btn-primary { background: var(--primary); color: #ffffff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }

.btn-secondary {
  background: #ffffff;
  border-color: var(--border-subtle);
  color: var(--text-main);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-surface);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-surface);
  color: var(--text-main);
}

.btn-success { background: var(--success); color: #ffffff; }
.btn-success:hover:not(:disabled) { background: var(--success-hover); }

.btn-accent { background: var(--accent); color: #ffffff; }
.btn-accent:hover:not(:disabled) { background: var(--accent-hover); }

.btn-speech {
  background: var(--primary-light);
  color: var(--primary-hover);
  border-color: #bae6fd;
}
.btn-speech:hover:not(:disabled) {
  background: #bae6fd;
}

.btn-sm {
  min-height: 38px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

.btn-record {
  width: 100%;
  min-height: 54px;
  font-size: 1.05rem;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.25);
}

.btn-recording {
  background: var(--danger) !important;
  border-color: #991b1b !important;
  animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.6); }
  70% { box-shadow: 0 0 0 14px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* Authentic Recording State (No Fake Oscillating Waves) */
.recording-state-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: var(--danger-light);
  border: 1.5px solid var(--danger-border);
  padding: 0.4rem 0.95rem;
  border-radius: var(--radius-full);
}

.rec-dot {
  color: var(--danger);
  font-size: 1.1rem;
  line-height: 1;
  animation: rec-blink 1.2s infinite;
}

@keyframes rec-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.rec-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--danger);
  letter-spacing: 0.08em;
}

.timer {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--danger);
}

/* Live Transcript Box */
.transcript-box {
  background: #f8fafc;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1.25rem;
}

.transcript-box-header {
  margin-bottom: 0.5rem;
}

.transcript-box h3 {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.transcript-text {
  font-size: 0.98rem;
  color: var(--text-main);
  line-height: 1.6;
  min-height: 3rem;
  font-weight: 500;
}

/* Patient Encounter Summary Card (OpenMRS Inspired) */
.patient-summary-card {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
  background: #f8fafc;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 900px) {
  .patient-summary-card {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .patient-summary-card {
    grid-template-columns: repeat(2, 1fr);
  }
}

.summary-col {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.summary-k {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.summary-v {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Clarification Banner (NHS Pattern) */
.clarification-box {
  background: var(--accent-light);
  border: 2px solid var(--accent-border);
  border-left: 6px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  margin-bottom: 1.35rem;
}

.clarification-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.alert-icon-wrapper {
  font-size: 1.4rem;
  line-height: 1;
}

.alert-content {
  flex: 1;
}

.clarification-header strong {
  color: var(--accent-hover);
  font-size: 1rem;
  font-weight: 800;
}

.clarify-text {
  color: #78350f;
  font-size: 0.92rem;
  margin-top: 0.2rem;
  line-height: 1.5;
  font-weight: 500;
}

.clarification-action {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.manual-input-inline {
  display: flex;
  flex: 1;
  gap: 0.4rem;
  min-width: 200px;
}

.manual-input-inline input {
  flex: 1;
  padding: 0.45rem 0.75rem;
  border: 2px solid var(--accent-border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: #ffffff;
  min-height: 40px;
}

/* Clinical Form Groups */
.fields-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group:focus-within {
  border-left: 3px solid var(--border-focus);
  padding-left: 0.75rem;
  transition: border-left 0.15s ease, padding-left 0.15s ease;
}

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.field-label-row label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.req-star {
  color: var(--danger);
}

.status-tag {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.tag-missing { background: var(--danger-light); color: var(--danger); border: 1px solid var(--danger-border); }
.tag-proposed { background: var(--accent-light); color: var(--accent); border: 1px solid var(--accent-border); }
.tag-needs_repeat { background: var(--danger-light); color: var(--danger); border: 2px solid var(--danger-border); font-weight: 800; }
.tag-user_confirmed { background: var(--success-light); color: var(--success); border: 1px solid var(--success-border); }
.tag-manually_edited { background: var(--primary-light); color: var(--primary); border: 1px solid #bae6fd; }

.input-with-reasons input {
  width: 100%;
  padding: 0.75rem 0.95rem;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 1rem; /* 16px prevents mobile auto-zoom */
  color: var(--text-main);
  background: #ffffff;
  min-height: 48px;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.input-readonly-voice {
  background-color: #f8fafc !important;
  color: var(--text-main);
  cursor: default;
  font-weight: 600;
  border-style: solid;
}
.input-readonly-voice:focus {
  background-color: #ffffff !important;
  border-color: var(--border-focus);
}

.opt-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-left: 0.35rem;
  text-transform: none;
}

.input-with-reasons input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18);
}

.input-with-reasons input[aria-invalid="true"] {
  border-color: var(--danger-border);
  background: #fff5f5;
}

.reasons-list {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--danger);
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* Explicit Commit Bar */
.commit-bar {
  margin-top: 1rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.commit-info {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.btn-commit {
  width: 100%;
  min-height: 52px;
  font-size: 1.05rem;
}
.btn-commit:disabled {
  background: var(--bg-surface);
  color: var(--text-muted);
  border-color: var(--border-subtle);
  cursor: not-allowed;
  box-shadow: none;
}

/* Committed Confirmation Card */
.committed-box {
  background: var(--success-light);
  border: 2px solid var(--success-border);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  margin-top: 1.35rem;
}

.committed-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.check-icon-badge {
  background: var(--success);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.committed-text-block h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--success);
}

.committed-text-block p {
  font-size: 0.9rem;
  color: var(--success);
  font-weight: 600;
}

.code-record-id {
  font-family: var(--font-mono);
  font-weight: 800;
  letter-spacing: 0.03em;
}

.committed-actions-row {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

/* Status Notifications */
.status-box {
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}
.status-info { background: var(--primary-light); color: var(--primary-hover); border: 1.5px solid #bae6fd; }
.status-error { background: var(--danger-light); color: var(--danger); border: 1.5px solid var(--danger-border); }
.status-success { background: var(--success-light); color: var(--success); border: 1.5px solid var(--success-border); }

/* Registry View */
.registry-card {
  padding: 1.5rem;
}

.registry-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.registry-header-row h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
}

.subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.registry-actions {
  display: flex;
  gap: 0.5rem;
}

.table-container {
  overflow-x: auto;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.registry-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.registry-table th {
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--border-subtle);
}

.registry-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1.5px solid var(--border-subtle);
  color: var(--text-main);
}

.registry-table tr:nth-child(even) td {
  background: #f8fafc;
}

.registry-table tr:hover td {
  background: var(--primary-light);
}

.table-empty {
  text-align: center;
  padding: 2.5rem !important;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.95rem;
}

/* Footer */
.app-footer {
  background: #ffffff;
  border-top: 2px solid var(--border-subtle);
  padding: 1.15rem 0;
  margin-top: auto;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.footer-links a {
  color: var(--primary);
  text-decoration: none;
}
.footer-links a:hover {
  text-decoration: underline;
}

.sep {
  color: var(--border-subtle);
}

.hidden {
  display: none !important;
}

/* Loading Spinner */
.loading-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 0.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn:disabled .loading-spinner {
  border-top-color: var(--text-muted);
}

/* Print Stylesheet */
@media print {
  .app-header,
  .app-footer,
  .mic-controls,
  .presets-row,
  .clarification-box,
  .commit-bar,
  .committed-box,
  .recording-state-indicator,
  .skip-link,
  .nav-tabs,
  .system-status-group,
  .registry-actions {
    display: none !important;
  }

  body {
    background: #ffffff;
    color: #000000;
    font-size: 12pt;
  }

  .app-wrapper {
    min-height: auto;
  }

  .card {
    border: 1px solid #999;
    box-shadow: none;
    break-inside: avoid;
  }

  .grid-layout {
    grid-template-columns: 1fr;
  }

  .registry-table {
    font-size: 10pt;
  }

  .registry-table th,
  .registry-table td {
    border: 1px solid #ccc;
    padding: 0.4rem;
  }
}

/* Reduced Motion Preference (WCAG 2.3.3) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
