/* Global UI styles */

/* Button variations */
.btn-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-small {
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
}

.btn-large {
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
}

/* Form enhancements */
.form-section {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.form-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 1rem;
}

/* Card variations */
.card-hover {
  transition: box-shadow 0.2s ease, transform 0.1s ease;
}

.card-hover:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

/* Verification/help messaging */
.verification-status {
  margin-top: 0.5rem;
  font-weight: 500;
  color: #475569; /* slate-600 for professional neutral tone */
}

.verification-status i {
  margin-right: 6px;
  color: #64748b; /* slate-500 icon color */
}

.verification-status.pending {
  color: #475569; /* neutral text for guidance */
}

.verification-status.verified {
  color: #2f855a; /* refined green for success */
}

/* Professional summary styling */
.summary-container {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1rem;
  line-height: 1.6;
}

.summary-container h4 {
  margin: 0 0 1rem 0;
  color: #1e293b;
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.summary-text {
  color: #334155;
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.summary-text p {
  margin: 0 0 1rem 0;
}

.summary-text p:last-child {
  margin-bottom: 0;
}

/* Dynamic Form Styles */
.dynamic-form-field {
  margin-bottom: 1.5rem;
}

.dynamic-form-field label {
  display: block;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
  text-transform: capitalize;
}

.dynamic-form-field input,
.dynamic-form-field textarea,
.dynamic-form-field select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
}

.dynamic-form-field input:focus,
.dynamic-form-field textarea:focus,
.dynamic-form-field select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.dynamic-form-field textarea {
  min-height: 100px;
  resize: vertical;
}

/* Form nested objects and arrays */
.form-nested-object {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 1rem;
  margin-top: 0.5rem;
  background: #f9fafb;
}

.form-nested-object-title {
  font-weight: 500;
  color: #1f2937;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.form-array-container {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 1rem;
  margin-top: 0.5rem;
}

.form-array-item {
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: #fff;
}

.form-array-item:last-child {
  margin-bottom: 0;
}

.form-array-item-title {
  font-weight: 500;
  color: #4b5563;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

/* Form actions */
.form-actions-container {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
}

/* Collapsible Tab Navigation Styles */
.tab-container {
  margin: 1rem 0 2rem 0;
}

.tab-section {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 1rem;
  overflow: hidden;
  transition: all 0.2s ease;
}

.tab-section:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tab-header {
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.tab-header:hover {
  background: #f3f4f6;
}

.tab-header.active {
  background: #eff6ff;
  border-bottom-color: #2563eb;
}

.tab-button {
  width: 100%;
  background: none;
  border: none;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-transform: capitalize;
  transition: all 0.2s ease;
}

.tab-button:hover {
  color: #1f2937;
}

.tab-header.active .tab-button {
  color: #2563eb;
  font-weight: 600;
}

.tab-toggle-icon {
  transition: transform 0.2s ease;
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
  margin-left: auto;
}

.tab-header.active .tab-toggle-icon {
  transform: rotate(180deg);
}

/* Ensure tab button displays properly */
.tab-button {
  width: 100%;
  background: none;
  border: none;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  text-align: left;
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  text-transform: capitalize;
  transition: all 0.2s ease;
}

.tab-button span {
  flex: 1;
  text-align: left;
}

.tab-content {
  display: none;
  padding: 1.5rem;
  background: #fff;
  border-top: 1px solid #e5e7eb;
}

.tab-content.active {
  display: block;
}

.tab-close-section {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #f3f4f6;
  text-align: center;
}

.tab-close-btn {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-close-btn:hover {
  background: #e5e7eb;
  color: #374151;
}

/* Legacy tab styles for backward compatibility */
.tab-navigation {
  display: none;
}

/* General Info Section */
.general-info-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid #e5e7eb;
}

.general-info-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Hidden field styles */
.hidden-field {
  display: none !important;
}

/* Autocomplete styles */
.autocomplete-container {
  position: relative;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #d1d5db;
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.autocomplete-dropdown.show {
  display: block;
}

.autocomplete-item {
  padding: 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  transition: background-color 0.15s ease;
}

.autocomplete-item:hover {
  background-color: #f9fafb;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item.selected {
  background-color: #eff6ff;
}

.autocomplete-patient-id {
  font-weight: 600;
  color: #1f2937;
  font-size: 0.95rem;
}

.autocomplete-patient-name {
  color: #6b7280;
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.autocomplete-patient-mobile {
  color: #9ca3af;
  font-size: 0.8rem;
  margin-top: 0.125rem;
}

.autocomplete-loading {
  padding: 0.75rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.85rem;
}

.autocomplete-no-results {
  padding: 0.75rem;
  text-align: center;
  color: #9ca3af;
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .form-actions-container {
    flex-direction: column;
  }
  
  .form-actions-container .btn {
    width: 100%;
  }
  
  .tab-navigation {
    flex-wrap: wrap;
  }
  
  .tab-button {
    flex: 1;
    min-width: 120px;
  }
}

/* ========================================
   VOICE RECORDING FEATURES
   ======================================== */

/* Voice button in section controls */
.btn-voice {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary, #2563eb);
  border: 1px solid rgba(37, 99, 235, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  position: relative;
}

.btn-voice .voice-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.btn-voice .voice-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.btn-voice:hover {
  background: rgba(37, 99, 235, 0.15);
  transform: scale(1.05);
}

.btn-voice:active {
  transform: scale(0.95);
}

.btn-voice[data-state="recording"] {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.3);
  animation: pulse-recording 1.5s ease-in-out infinite;
}

.btn-voice[data-state="processing"] {
  background: rgba(251, 191, 36, 0.12);
  color: #f59e0b;
  cursor: not-allowed;
}

.btn-voice:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@keyframes pulse-recording {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}

/* Listening sheet */
.voice-listening-sheet {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(14, 165, 233, 0.05));
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.voice-listening-sheet.show {
  opacity: 1;
  transform: translateY(0);
}

.voice-sheet-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.voice-sheet-state {
  display: flex;
  align-items: center;
  gap: 16px;
}

.voice-sheet-icon {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

/* Waveform animation */
.voice-waveform {
  width: 40px;
  height: 24px;
}

.voice-waveform .wave-bar {
  fill: var(--primary, #2563eb);
  animation: wave-bounce 1.2s ease-in-out infinite;
}

.voice-waveform .wave-bar:nth-child(1) { animation-delay: 0s; }
.voice-waveform .wave-bar:nth-child(2) { animation-delay: 0.1s; }
.voice-waveform .wave-bar:nth-child(3) { animation-delay: 0.2s; }
.voice-waveform .wave-bar:nth-child(4) { animation-delay: 0.3s; }
.voice-waveform .wave-bar:nth-child(5) { animation-delay: 0.4s; }
.voice-waveform .wave-bar:nth-child(6) { animation-delay: 0.5s; }
.voice-waveform .wave-bar:nth-child(7) { animation-delay: 0.6s; }
.voice-waveform .wave-bar:nth-child(8) { animation-delay: 0.7s; }

@keyframes wave-bounce {
  0%, 100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(1.5);
  }
}

.voice-spinner .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(37, 99, 235, 0.2);
  border-top-color: var(--primary, #2563eb);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.voice-sheet-message {
  flex: 1;
}

.voice-status-text {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main, #1f2937);
  margin-bottom: 4px;
}

.voice-status-subtext {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted, #6b7280);
}

.voice-sheet-duration {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary, #2563eb);
  font-variant-numeric: tabular-nums;
}

.voice-sheet-transcript {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.1);
}

.transcript-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  margin-bottom: 6px;
}

.transcript-text {
  font-size: 0.95rem;
  color: var(--text-main, #1f2937);
  font-style: italic;
}

.voice-sheet-examples {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  padding: 12px;
}

.examples-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  margin-bottom: 8px;
}

.examples-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.voice-example-chip {
  padding: 6px 12px;
  background: white;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--primary, #2563eb);
  cursor: pointer;
  transition: all 0.2s ease;
}

.voice-example-chip:hover {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}

.voice-sheet-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.voice-sheet-error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.voice-sheet-error .error-text {
  color: #dc2626;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.voice-listening-sheet[data-state="error"] .voice-sheet-state,
.voice-listening-sheet[data-state="error"] .voice-sheet-actions,
.voice-listening-sheet[data-state="error"] .voice-sheet-examples {
  display: none;
}

.voice-listening-sheet[data-state="error"] .voice-sheet-error {
  display: block;
}

/* Change toolbar at bottom of section */
.voice-change-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 14px;
  padding: 16px 20px;
  margin-top: 20px;
  margin-bottom: 10px;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08);
}

.voice-change-toolbar.show {
  opacity: 1;
  transform: translateY(0);
}

.toolbar-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 200px;
}

.toolbar-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.toolbar-text {
  font-size: 0.96rem;
  color: var(--text-main, #1f2937);
  line-height: 1.4;
}

.toolbar-text strong {
  color: #059669;
  font-weight: 600;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Change badge */
.voice-change-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 999px;
  margin-left: 12px;
  animation: badge-appear 0.3s ease;
}

@keyframes badge-appear {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.badge-icon {
  color: #059669;
  font-weight: 600;
}

.badge-text {
  font-size: 0.85rem;
  color: #047857;
  font-weight: 500;
}

.voice-change-badge-close {
  background: none;
  border: none;
  color: #059669;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.voice-change-badge-close:hover {
  background: rgba(16, 185, 129, 0.2);
}

/* Changed field highlight */
.voice-changed-field {
  border-color: rgba(16, 185, 129, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
  animation: field-glow 0.5s ease;
}

@keyframes field-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
  }
}

/* History drawer */
.voice-history-drawer {
  background: #ffffff;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 12px;
  padding: 18px;
  margin-top: 16px;
  margin-bottom: 16px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.voice-history-drawer.show {
  max-height: 500px;
  opacity: 1;
  overflow-y: auto;
}

/* Custom scrollbar for history drawer */
.voice-history-drawer::-webkit-scrollbar {
  width: 8px;
}

.voice-history-drawer::-webkit-scrollbar-track {
  background: rgba(37, 99, 235, 0.05);
  border-radius: 10px;
}

.voice-history-drawer::-webkit-scrollbar-thumb {
  background: rgba(37, 99, 235, 0.2);
  border-radius: 10px;
}

.voice-history-drawer::-webkit-scrollbar-thumb:hover {
  background: rgba(37, 99, 235, 0.3);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 2px solid rgba(37, 99, 235, 0.12);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.drawer-header strong {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main, #1f2937);
  line-height: 1.4;
}

.drawer-count {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, 0.08);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.drawer-items {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.history-item {
  background: #fafbfc;
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: 10px;
  padding: 14px 16px;
  position: relative;
  transition: all 0.2s ease;
  animation: history-item-appear 0.3s ease backwards;
}

@keyframes history-item-appear {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger animation for multiple items */
.history-item:nth-child(1) { animation-delay: 0.05s; }
.history-item:nth-child(2) { animation-delay: 0.1s; }
.history-item:nth-child(3) { animation-delay: 0.15s; }
.history-item:nth-child(4) { animation-delay: 0.2s; }
.history-item:nth-child(5) { animation-delay: 0.25s; }

.history-item:hover {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.history-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
  padding-right: 70px; /* Make room for undo button with text */
}

.history-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-change-number {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
  min-width: 32px;
  text-align: center;
}

.history-action {
  font-size: 0.72rem;
  font-weight: 700;
  color: white;
  background: var(--primary, #2563eb);
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.history-time {
  font-size: 0.82rem;
  color: var(--text-muted, #6b7280);
  font-weight: 500;
}

.history-transcript {
  font-size: 0.92rem;
  color: var(--text-main, #1f2937);
  font-style: italic;
  margin-bottom: 8px;
  line-height: 1.5;
  padding: 8px 10px;
  background: rgba(37, 99, 235, 0.04);
  border-radius: 6px;
  border-left: 3px solid rgba(37, 99, 235, 0.3);
}

.history-changes {
  font-size: 0.88rem;
  color: var(--text-muted, #6b7280);
  line-height: 1.4;
  padding-left: 2px;
}

/* Undo button */
.btn-undo {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--danger, #b91c1c);
  background: rgba(185, 28, 28, 0.08);
  border: 1px solid rgba(185, 28, 28, 0.2);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-undo:hover {
  background: rgba(185, 28, 28, 0.15);
  border-color: rgba(185, 28, 28, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(185, 28, 28, 0.2);
}

.btn-undo:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Error banner */
.voice-error-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 12px 0;
  color: #dc2626;
}

.voice-error-banner .error-icon {
  font-size: 1.2rem;
}

/* Success toast */
.voice-success-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  padding: 12px 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.voice-success-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.voice-success-toast .toast-icon {
  color: #059669;
  font-size: 1.2rem;
  font-weight: 600;
}

.voice-success-toast span:last-child {
  color: var(--text-main, #1f2937);
  font-size: 0.95rem;
}

/* Command tooltip */
.voice-command-tooltip {
  position: fixed;
  bottom: 80px;
  right: 24px;
  background: white;
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 999;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.voice-command-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

.voice-command-tooltip strong {
  color: var(--primary, #2563eb);
  font-size: 0.85rem;
  margin-right: 6px;
}

/* Help modal */
.voice-help-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1100;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.voice-help-backdrop.show {
  opacity: 1;
}

.voice-help-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 1101;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.voice-help-modal.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.voice-help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.voice-help-header h3 {
  margin: 0;
  font-size: 1.3rem;
  color: var(--text-main, #1f2937);
}

.voice-help-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-muted, #6b7280);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.voice-help-close:hover {
  background: rgba(0, 0, 0, 0.05);
}

.voice-help-content {
  padding: 24px;
}

.voice-help-content section {
  margin-bottom: 24px;
}

.voice-help-content section:last-child {
  margin-bottom: 0;
}

.voice-help-content h4 {
  font-size: 1.1rem;
  color: var(--text-main, #1f2937);
  margin: 0 0 12px 0;
}

.voice-help-content ol,
.voice-help-content ul {
  margin: 0;
  padding-left: 20px;
}

.voice-help-content li {
  margin-bottom: 8px;
  color: var(--text-muted, #6b7280);
  line-height: 1.6;
}

.voice-help-content strong {
  color: var(--text-main, #1f2937);
}

/* Onboarding banner */
.voice-onboarding-banner {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(14, 165, 233, 0.08));
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 16px;
  padding: 18px 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.voice-onboarding-banner.show {
  opacity: 1;
  transform: translateY(0);
}

.onboarding-content {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.onboarding-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.onboarding-text strong {
  display: block;
  font-size: 1rem;
  color: var(--text-main, #1f2937);
  margin-bottom: 4px;
}

.onboarding-text p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted, #6b7280);
}

/* Floating help button */
.voice-help-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary, #2563eb);
  color: white;
  border: none;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 100;
}

.voice-help-trigger:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.5);
}

.voice-help-trigger:active {
  transform: scale(0.95);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .voice-sheet-state {
    flex-direction: column;
    text-align: center;
  }

  .voice-sheet-actions {
    flex-direction: column;
  }

  .voice-sheet-actions button {
    width: 100%;
  }

  .voice-change-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .toolbar-info {
    width: 100%;
  }

  .toolbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .toolbar-actions .btn-tertiary {
    flex: 1;
    min-width: 120px;
  }

  .drawer-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .drawer-header strong {
    font-size: 0.95rem;
  }

  .history-item {
    padding: 12px 14px;
  }

  .history-item-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding-right: 65px; /* Room for text undo button */
  }

  .history-header-left {
    width: 100%;
    justify-content: space-between;
  }

  .history-change-number {
    font-size: 0.75rem;
    padding: 3px 7px;
    min-width: 28px;
  }

  .history-action {
    font-size: 0.68rem;
    padding: 3px 8px;
  }

  .btn-undo {
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    font-size: 0.75rem;
  }

  .voice-success-toast,
  .voice-command-tooltip {
    right: 12px;
    left: 12px;
    max-width: calc(100% - 24px);
  }

  .voice-help-modal {
    width: 95%;
    max-height: 90vh;
  }
}

