/* ============================================================
   TRANSCRIPTION STUDIO - DASHBOARD STYLING
   Pixel-perfect 3-column workstation layout.
   Clean, modern, high-tier aesthetics, enlarged logs,
   responsive progress bar, and instant theme toggling.
   ============================================================ */

/* App Frame */
.dashboard-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-canvas);
}

/* Header */
.dash-header {
  height: 74px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  z-index: 20;
}

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

.header-logo {
  width: 62px;
  height: 62px;
  border: none;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
  box-shadow: none;
}

.header-titles {
  display: flex;
  flex-direction: column;
}

.header-main-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-subtitle {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Header Switch (Safety Backup) */
.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  margin-right: 8px;
}

.custom-switch {
  position: relative;
  width: 38px;
  height: 22px;
}

.custom-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-light);
  border-radius: 34px;
  transition: .3s;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: .3s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input:checked+.switch-slider {
  background-color: var(--accent-primary);
}

input:checked+.switch-slider:before {
  transform: translateX(16px);
}

/* 3-Column Main Workspace */
.dash-workspace {
  display: grid;
  grid-template-columns: 310px 1fr 340px;
  height: calc(100vh - 68px);
  overflow: hidden;
}

/* Left Panel - File Manager */
.left-panel {
  background-color: var(--bg-card);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  padding: 18px 16px;
  overflow: hidden;
}

.add-files-btn {
  width: 100%;
  height: 48px;
  font-size: 0.95rem;
  margin-bottom: 12px;
  border-radius: 8px;
}

.file-drop-area {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 14px;
  transition: all var(--transition-fast);
  background: var(--bg-canvas);
}

.file-drop-area:hover,
.file-drop-area.drag-over {
  border-color: var(--accent-primary);
  background: var(--accent-light);
  color: var(--accent-primary);
}

.panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.panel-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.panel-counter {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.files-queue-list {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
  margin-bottom: 14px;
}

.file-item-card {
  background: var(--bg-canvas);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: background-color var(--transition-fast);
}

.file-item-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
}

.file-item-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-grow: 1;
}

.file-item-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.file-item-remove {
  color: var(--text-subtle);
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  line-height: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  box-sizing: border-box;
  transition: all var(--transition-fast);
}

.file-item-remove svg {
  display: block;
  pointer-events: none;
  margin: auto;
}

.file-item-remove:hover {
  background-color: var(--danger-light);
  color: var(--danger);
  transform: scale(1.08);
}

.left-panel-bottom {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

.clear-btn {
  width: 100%;
  height: 38px;
  font-size: 0.85rem;
  border-radius: var(--radius-full);
}

.action-btn-row {
  display: grid;
  grid-template-columns: 2.3fr 1fr;
  gap: 8px;
}

.btn-generate {
  min-height: 52px;
  height: auto;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background-color: var(--success);
  color: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
  transition: all var(--transition-fast);
  line-height: 1.15;
  overflow: hidden;
}

.btn-generate .btn-gen-title {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.btn-generate .btn-gen-cost {
  font-size: 0.74rem;
  font-weight: 600;
  opacity: 0.92;
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-generate:hover:not(:disabled) {
  background-color: #15803D;
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.35);
  transform: translateY(-1px);
}

.btn-generate:disabled {
  background-color: var(--success-light);
  color: var(--success-text);
  cursor: not-allowed;
  opacity: 0.8;
  box-shadow: none;
}

.btn-stop {
  min-height: 52px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--danger-light);
  color: var(--danger-text);
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 16px;
  border: 1px solid rgba(220, 38, 38, 0.2);
  transition: all var(--transition-fast);
}

.btn-stop:hover:not(:disabled) {
  background-color: var(--danger);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.btn-stop:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Center Panel - Workstation, Controls, Logs */
.center-panel {
  background-color: var(--bg-canvas);
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  overflow: hidden;
  gap: 14px;
}

/* Status Bar Card */
.status-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

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

.status-indicator-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--text-subtle);
  transition: background-color var(--transition-fast);
}

.live-status-dot.active {
  background-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-ring);
  animation: pulseDot 1.5s infinite;
}

.live-status-dot.success {
  background-color: var(--success);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

.live-status-dot.error {
  background-color: var(--danger);
}

@keyframes pulseDot {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.15);
    opacity: 1;
  }

  100% {
    transform: scale(0.95);
    opacity: 0.8;
  }
}

.status-text-block {
  display: flex;
  flex-direction: column;
}

.status-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.status-detail {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Circular Spinner */
.circular-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-light);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.circular-spinner.active {
  display: block;
}

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

.status-right-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.eta-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.chunk-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Dropdown Filters Row */
.controls-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.control-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-label {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

/* Custom Interactive Theme-Matched Dropdown */
.custom-dropdown {
  position: relative;
  display: inline-flex;
}

.custom-dropdown-trigger {
  height: 38px;
  padding: 0 16px;
  background-color: var(--bg-card);
  border: 1.5px solid rgba(37, 99, 235, 0.28);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.08);
  transition: all var(--transition-fast);
  user-select: none;
}

.custom-dropdown-trigger:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.18);
  transform: translateY(-1px);
}

.custom-dropdown-trigger.open {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.custom-dropdown-trigger .chevron-sm {
  width: 10px;
  height: 10px;
  color: var(--accent-primary);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.custom-dropdown-trigger.open .chevron-sm {
  transform: rotate(180deg);
}

.custom-dropdown-trigger:disabled,
.custom-dropdown.disabled .custom-dropdown-trigger {
  opacity: 0.55;
  cursor: not-allowed !important;
  pointer-events: none !important;
  border-color: var(--border-light) !important;
  box-shadow: none !important;
  transform: none !important;
}

.custom-dropdown.disabled .custom-dropdown-menu {
  display: none !important;
}

.select-custom:disabled {
  opacity: 0.55;
  cursor: not-allowed !important;
  pointer-events: none !important;
  border-color: var(--border-light) !important;
  box-shadow: none !important;
  transform: none !important;
}

.add-files-btn:disabled,
.clear-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed !important;
  pointer-events: none !important;
  box-shadow: none !important;
  transform: none !important;
}

.file-drop-area.disabled {
  opacity: 0.5;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.custom-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  max-height: 280px;
  overflow: hidden;
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.14);
  padding: 6px;
  display: none;
  flex-direction: column;
  z-index: 100;
  animation: fadeIn 0.15s ease;
}

.custom-dropdown-menu.active {
  display: flex;
}

.custom-dropdown-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  padding: 2px 2px 6px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.custom-dropdown-search-wrap .search-icon {
  position: absolute;
  left: 10px;
  width: 12px;
  height: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.custom-dropdown-search {
  width: 100%;
  height: 30px;
  padding: 0 8px 0 26px;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
}

.custom-dropdown-search:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.custom-dropdown-items-container {
  overflow-y: auto;
  max-height: 215px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 2px;
}

.custom-dropdown-empty {
  padding: 16px 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
}

.custom-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.custom-dropdown-item:hover {
  background-color: var(--bg-card-hover);
  color: var(--accent-primary);
}

/* Slight blue colour highlight on the selected thing */
.custom-dropdown-item.selected {
  background-color: rgba(37, 99, 235, 0.14) !important;
  color: var(--accent-primary) !important;
  font-weight: 700;
}

.custom-dropdown-check {
  font-size: 0.8rem;
  color: var(--accent-primary);
  margin-left: 8px;
  display: none;
}

.custom-dropdown-item.selected .custom-dropdown-check {
  display: inline-block;
}

[data-theme="dark"] .custom-dropdown-trigger {
  background-color: var(--bg-card);
  border-color: rgba(59, 130, 246, 0.38);
}

[data-theme="dark"] .custom-dropdown-menu {
  background-color: #151A24;
  border-color: #242D3D;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .custom-dropdown-item:hover {
  background-color: #1E2638;
}

[data-theme="dark"] .custom-dropdown-item.selected {
  background-color: rgba(59, 130, 246, 0.25) !important;
  color: #60A5FA !important;
}

.select-custom {
  height: 38px;
  padding: 0 36px 0 16px;
  background-color: var(--bg-card);
  border: 1.5px solid rgba(37, 99, 235, 0.28);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563EB' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.08);
  transition: all var(--transition-fast);
}

.select-custom:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.18);
  transform: translateY(-1px);
}

.select-custom:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.22);
  background-color: var(--bg-card);
}

.select-custom option {
  background-color: var(--bg-card);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 500;
}

/* Slight blue colour highlight on the selected option */
.select-custom option:checked,
.select-custom option[selected] {
  background-color: rgba(37, 99, 235, 0.16) !important;
  color: var(--accent-primary) !important;
  font-weight: 700;
}

[data-theme="dark"] .select-custom {
  background-color: var(--bg-card);
  border-color: rgba(59, 130, 246, 0.38);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2360A5FA' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .select-custom:hover {
  border-color: #60A5FA;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .select-custom:focus {
  box-shadow: 0 0 0 3.5px rgba(59, 130, 246, 0.32);
}

[data-theme="dark"] .select-custom option {
  background-color: #151A24;
  color: #F1F5F9;
}

[data-theme="dark"] .select-custom option:checked {
  background-color: rgba(59, 130, 246, 0.28) !important;
  color: #60A5FA !important;
}

/* Progress Section */
.progress-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-track {
  flex-grow: 1;
  height: 8px;
  background-color: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-primary) 0%, #38BDF8 50%, var(--accent-primary) 100%);
  background-size: 200% 100%;
  animation: progressShimmer 2s infinite linear;
  border-radius: var(--radius-full);
  transition: width 0.4s ease-out;
}

@keyframes progressShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.progress-percentage {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font-mono);
  min-width: 42px;
  text-align: right;
}

/* Activity Log - Enlarged Typography as Requested */
.activity-log-card {
  flex-grow: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.log-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.log-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.log-actions .btn {
  border-radius: var(--radius-full);
}

.log-console {
  flex-grow: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  overflow-y: auto;
  font-family: var(--font-mono);
  /* A bit increased text size for maximum readability */
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

[data-theme="dark"] .log-console {
  background: #090C12;
  border-color: #1A2130;
  color: #CBD5E1;
}

.log-line {
  margin-bottom: 4px;
}

.log-time {
  color: var(--text-muted);
  margin-right: 6px;
  font-size: 0.8rem;
}

.log-info {
  color: var(--accent-primary);
}

.log-success {
  color: var(--success);
  font-weight: 600;
}

.log-error {
  color: var(--danger);
  font-weight: 600;
}

.log-processing {
  color: #38BDF8;
  font-weight: 600;
  display: inline-flex;
  align-items: baseline;
}

/* Repeating buffer animated dots (...) */
.buffer-dots {
  display: inline-flex;
  margin-left: 2px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.buffer-dots span {
  animation: dotPulse 1.4s infinite ease-in-out both;
}

.buffer-dots .dot-1 {
  animation-delay: 0.15s;
}

.buffer-dots .dot-2 {
  animation-delay: 0.35s;
}

.buffer-dots .dot-3 {
  animation-delay: 0.55s;
}

@keyframes dotPulse {

  0%,
  80%,
  100% {
    opacity: 0.15;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-1.5px);
  }
}

/* Right Panel - Wallet & Documents */
.right-panel {
  background-color: var(--bg-card);
  border-left: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  padding: 18px 16px;
  overflow-y: auto;
  gap: 14px;
}

/* Wallet Card */
.wallet-card {
  background: var(--bg-canvas);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.wallet-balance-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.wallet-balance-num {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--accent-primary);
  letter-spacing: -0.02em;
}

.btn-sync-wallet {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.btn-sync-wallet:hover {
  background: var(--accent-light);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
}

.btn-sync-wallet.spinning .sync-icon {
  animation: spin 0.8s linear infinite;
}

.wallet-hwid-badge {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-family: var(--font-mono);
}

.hwid-edit-pill-btn {
  color: var(--accent-primary);
  background: var(--accent-light);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.hwid-edit-pill-btn:hover {
  background: var(--accent-primary);
  color: #FFFFFF;
}

.wallet-stat-line {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

.wallet-buttons-row {
  display: flex;
  width: 100%;
  margin-top: 4px;
}

/* Sleek Rectangular Wallet Button with rounded edges */
.btn-wallet-recharge {
  width: 100%;
  height: 38px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0 10px;
  background-color: var(--danger-light);
  color: var(--danger-text);
  border: 1px solid rgba(220, 38, 38, 0.2);
  transition: all var(--transition-fast);
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}

.btn-wallet-recharge:hover {
  background-color: var(--danger);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
  transform: translateY(-1px);
}

.btn-wallet-status {
  height: 38px;
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0 8px;
  background-color: var(--success-light);
  color: var(--success-text);
  border: 1px solid rgba(22, 163, 74, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 4px rgba(22, 163, 74, 0.08);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.wallet-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #16A34A;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.25);
  flex-shrink: 0;
  display: inline-block;
}

.btn-history-pill {
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all var(--transition-fast);
}

.chevron-sm {
  width: 10px;
  height: 10px;
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  transition: transform var(--transition-fast);
}

.btn-wallet-recharge.open .chevron-sm,
.btn-history-pill.open .chevron-sm,
.custom-dropdown-trigger.open .chevron-sm {
  transform: rotate(180deg);
}

.btn-history-pill:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  color: var(--accent-primary);
}

/* QR Code Recharge Box */
.recharge-qr-box {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px;
  text-align: center;
  display: none;
  animation: fadeIn 0.2s ease;
  box-shadow: var(--shadow-md);
}

.recharge-qr-box.active {
  display: block;
}

.qr-image {
  width: 170px;
  height: 170px;
  object-fit: contain;
  margin: 10px auto;
  border-radius: var(--radius-sm);
  display: block;
}

.qr-instructions {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 8px;
}

/* Generated Documents Section */
.docs-section {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-height: 240px;
}

.doc-actions-bar {
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.doc-actions-bar .btn {
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  height: 32px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Safety Backup Warning Modal Card */
.modal-warning-card {
  border-top: 4px solid var(--warning);
  max-width: 540px;
}

.modal-warning-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-warning-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--warning-light);
  color: var(--warning-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.modal-warning-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
}

.modal-warning-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.modal-warning-body {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-secondary);
  background: var(--bg-canvas);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 22px;
}

.modal-warning-body ul {
  margin: 10px 0 0 18px;
}

.modal-warning-body li {
  margin-bottom: 6px;
}

.modal-warning-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.modal-warning-actions .btn {
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 0.88rem;
}

.docs-list {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.doc-item-card {
  background: var(--bg-canvas);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: all var(--transition-fast);
}

.doc-item-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
}

.doc-item-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-grow: 1;
}

.doc-item-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-item-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
}

.doc-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.doc-btn-icon {
  padding: 5px 9px;
  font-size: 0.78rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
}

.doc-btn-icon:hover {
  background: var(--accent-light);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
  transform: translateY(-1px);
}

.doc-btn-del:hover {
  background: var(--danger-light);
  color: var(--danger-text);
  border-color: var(--danger);
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.15);
}

/* Dedicated Export to DOCX & PDF Buttons with Icons */
.doc-btn-export {
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
  height: 28px;
  line-height: 1;
}

.doc-btn-export svg {
  flex-shrink: 0;
}

/* DOCX - Microsoft Word Blue Theme */
.doc-btn-docx {
  background-color: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.28);
  color: #1D4ED8;
}

.doc-btn-docx:hover {
  background-color: #2563EB;
  border-color: #1D4ED8;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

/* PDF - Adobe Red Theme */
.doc-btn-pdf {
  background-color: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.28);
  color: #DC2626;
}

.doc-btn-pdf:hover {
  background-color: #DC2626;
  border-color: #B91C1C;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
  transform: translateY(-1px);
}

[data-theme="dark"] .doc-btn-docx {
  background-color: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.35);
  color: #93C5FD;
}

[data-theme="dark"] .doc-btn-docx:hover {
  background-color: #3B82F6;
  color: #FFFFFF;
}

[data-theme="dark"] .doc-btn-pdf {
  background-color: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.35);
  color: #FCA5A5;
}

[data-theme="dark"] .doc-btn-pdf:hover {
  background-color: #EF4444;
  color: #FFFFFF;
}

/* Modal Document Action Bar */
.preview-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.btn-docx-export {
  background-color: #2563EB !important;
  color: #FFFFFF !important;
  border: 1px solid #1D4ED8 !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  border-radius: 8px !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.btn-docx-export:hover {
  background-color: #1D4ED8 !important;
  transform: translateY(-1px);
}

.btn-pdf-export {
  background-color: #DC2626 !important;
  color: #FFFFFF !important;
  border: 1px solid #B91C1C !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  border-radius: 8px !important;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25);
}

.btn-pdf-export:hover {
  background-color: #B91C1C !important;
  transform: translateY(-1px);
}

/* History Modal Table & Active Summary Banner */
.history-summary-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 14px;
  margin-bottom: 8px;
}

.history-stat-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-stat-col .stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.history-stat-col .stat-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-primary);
  font-family: var(--font-mono);
}

.history-stat-col .stat-sub {
  font-size: 0.76rem;
  color: var(--success);
  font-weight: 600;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  margin-top: 14px;
}

.history-table th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.72rem;
  padding: 10px 12px;
  text-align: left;
}

.history-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.history-table tr:hover td {
  background: var(--bg-card-hover);
}

/* Service Maintenance Notice Card Modal */
.modal-maintenance-card {
  border-top: 4px solid var(--accent-primary);
  max-width: 520px;
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-maintenance-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.modal-maintenance-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.15);
}

.modal-maintenance-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.modal-maintenance-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
}

.modal-maintenance-body {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-secondary);
  background: var(--bg-canvas);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 22px;
}

.maintenance-main-msg {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
  line-height: 1.5;
}

.maintenance-link {
  color: var(--accent-primary);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.maintenance-contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.contact-card-title {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.contact-icon {
  font-size: 1rem;
}

.contact-label {
  color: var(--text-muted);
  font-weight: 600;
  min-width: 120px;
}

.contact-val {
  color: var(--text-primary);
  font-weight: 700;
  text-decoration: none;
}

.contact-val:hover {
  color: var(--accent-primary);
}

.modal-maintenance-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.modal-maintenance-actions .btn {
  border-radius: 8px;
  padding: 10px 22px;
  font-size: 0.9rem;
}

/* ============================================================
   EXPORT OPTIONS MODAL & CARDS (DOCX & PDF WITH ICONS)
   ============================================================ */
.export-modal-card {
  padding: 26px;
  border-radius: var(--radius-lg);
  border-top: 4px solid var(--accent-primary);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.22);
}

.export-modal-header {
  margin-bottom: 20px;
}

.export-options-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.export-option-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
  width: 100%;
}

.export-option-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.export-option-docx:hover {
  border-color: #185ABD;
  background: rgba(24, 90, 189, 0.04);
}

.export-option-pdf:hover {
  border-color: #DC2626;
  background: rgba(220, 38, 38, 0.04);
}

.export-icon-box {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.export-option-info {
  flex-grow: 1;
}

.export-option-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.export-option-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.export-option-arrow {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.export-option-card:hover .export-option-arrow {
  transform: translateX(4px);
  color: var(--accent-primary);
}

.doc-btn-download:hover {
  background: var(--accent-light);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
  transform: translateY(-1px);
}

[data-theme="dark"] .export-option-docx:hover {
  background: rgba(37, 99, 235, 0.12);
}

[data-theme="dark"] .export-option-pdf:hover {
  background: rgba(220, 38, 38, 0.12);
}

/* Diagnostic Error Box in Maintenance Modal */
.maintenance-error-box-wrapper {
  margin-top: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.maintenance-error-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.maintenance-error-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--danger-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-copy-error {
  background: var(--bg-canvas);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all var(--transition-fast);
}

.btn-copy-error:hover {
  background: var(--accent-light);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 2px 5px rgba(37, 99, 235, 0.15);
}

.maintenance-error-scrollbox {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--danger);
  background: rgba(220, 38, 38, 0.04);
  border: 1px dashed rgba(220, 38, 38, 0.25);
  border-radius: 6px;
  padding: 10px 12px;
  max-height: 130px;
  overflow-y: auto;
  word-break: break-all;
  white-space: pre-wrap;
  user-select: all;
}

[data-theme="dark"] .maintenance-error-scrollbox {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.4);
  color: #F87171;
}

/* ============================================================
   JELLY BALL THEME TOGGLE (Squish & Bouncy Elastic Motion)
   ============================================================ */
.jelly-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  vertical-align: middle;
}

.jelly-track {
  position: relative;
  width: 60px;
  height: 30px;
  border-radius: 9999px;
  background: #F1F5F9;
  border: 1.8px solid #DCE3EE;
  box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.06), 0 2px 5px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  box-sizing: border-box;
  transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: visible;
}

.jelly-theme-toggle:active .jelly-track {
  transform: scale(0.96);
}

.jelly-icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
  z-index: 1;
}

.sun-icon {
  color: #F59E0B;
  opacity: 1;
  transform: scale(1);
}

.moon-icon {
  color: #94A3B8;
  opacity: 0.35;
  transform: scale(0.85);
}

.jelly-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  box-sizing: border-box;
  pointer-events: none;
  transform-origin: center center;
  z-index: 2;
  transform: translateX(30px);
  border: 3px solid #F59E0B;
  background: #FEF3C7;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
  transition: border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Dark Mode States (Burple Theme) */
[data-theme="dark"] .jelly-track {
  background: #1B132E;
  border-color: #3B2A63;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5), 0 0 12px rgba(168, 85, 247, 0.25);
}

[data-theme="dark"] .sun-icon {
  color: #6B5B88;
  opacity: 0.25;
  transform: scale(0.85);
}

[data-theme="dark"] .moon-icon {
  color: #FFFFFF;
  opacity: 1;
  transform: scale(1);
}

[data-theme="dark"] .jelly-thumb {
  transform: translateX(0px);
  border: 3px solid #FFFFFF;
  background: transparent;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Soft Bounce Animation Keyframes */
.jelly-thumb.animate-to-light {
  animation: softBounceToLight 0.42s cubic-bezier(0.34, 1.25, 0.64, 1) forwards;
}

.jelly-thumb.animate-to-dark {
  animation: softBounceToDark 0.42s cubic-bezier(0.34, 1.25, 0.64, 1) forwards;
}

@keyframes softBounceToLight {
  0% { transform: translateX(0px) scale(1, 1); }
  32% { transform: translateX(11px) scale(1.12, 0.92); }
  68% { transform: translateX(32px) scale(0.95, 1.05); }
  86% { transform: translateX(29.5px) scale(1.02, 0.99); }
  100% { transform: translateX(30px) scale(1, 1); }
}

@keyframes softBounceToDark {
  0% { transform: translateX(30px) scale(1, 1); }
  32% { transform: translateX(19px) scale(1.12, 0.92); }
  68% { transform: translateX(-2px) scale(0.95, 1.05); }
  86% { transform: translateX(0.5px) scale(1.02, 0.99); }
  100% { transform: translateX(0px) scale(1, 1); }
}

/* ============================================================
   AUDIO CLIPS & SIDEBAR FILE EDIT CONTROLS
   ============================================================ */
.file-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.file-item-edit {
  color: var(--text-muted);
  font-size: 0.85rem;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.file-item-edit:hover {
  background-color: var(--accent-light);
  border-color: var(--accent-dim);
  color: var(--accent-primary);
  transform: scale(1.08);
}

.file-clip-badge {
  font-size: 0.60rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: rgba(79, 126, 255, 0.12);
  color: var(--accent-primary);
  border: 1px solid rgba(79, 126, 255, 0.28);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  line-height: 1.25;
  flex-shrink: 0;
}

/* Modal: Audio Clip Studio */
.clip-editor-modal {
  max-width: 740px;
  width: 94%;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 20px;
  padding: 26px;
  background: var(--bg-card);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-light);
}

.clip-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 14px;
  padding-right: 52px;
}

.clip-modal-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.clip-modal-icon {
  font-size: 1.6rem;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-light);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.clip-modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.clip-modal-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.clip-stats-pill {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-canvas);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.clip-stats-sep {
  opacity: 0.4;
}

/* Waveform Canvas */
.waveform-container {
  background: linear-gradient(180deg, rgba(13, 15, 20, 0.95) 0%, rgba(19, 22, 30, 0.98) 100%);
  border: 1px solid rgba(79, 126, 255, 0.25);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 16px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
  transition: background 0.3s ease, border-color 0.3s ease;
}

[data-theme="light"] .waveform-container {
  background: linear-gradient(180deg, #F8FAFC 0%, #EEF2F6 100%);
  border: 1px solid #CBD5E1;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.05);
}

.clip-waveform-canvas {
  width: 100%;
  height: 95px;
  display: block;
  border-radius: 8px;
}

/* Timeline & Track Bar */
.audio-timeline-wrapper {
  margin-bottom: 14px;
}

.audio-timeline-times {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.time-mono {
  font-family: var(--font-mono);
}

.clip-track-bar {
  position: relative;
  height: 28px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  cursor: pointer;
  overflow: visible;
  user-select: none;
  touch-action: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
}

.clip-track-progress {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0%;
  background: rgba(79, 126, 255, 0.22);
  border-radius: 7px;
  pointer-events: none;
  transition: width 0.06s linear;
}

.clip-regions-container {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 7px;
}

.clip-region-span {
  position: absolute;
  top: 2px;
  bottom: 2px;
  background: rgba(34, 197, 94, 0.35);
  border: 1.5px solid #22C55E;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  color: #FFFFFF;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
  pointer-events: auto;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 0 4px;
  transition: background-color 0.2s, transform 0.1s;
}

.clip-region-span:hover {
  background: rgba(34, 197, 94, 0.55);
  border-color: #4ADE80;
  z-index: 3;
}

.clip-track-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0%;
  width: 2.5px;
  background: #EF4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
  pointer-events: none;
  z-index: 5;
  transition: left 0.06s linear;
}

.clip-track-playhead::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  background: #EF4444;
  border-radius: 50%;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35), 0 0 5px rgba(239, 68, 68, 0.6);
  transition: transform 0.1s ease;
}

.clip-track-bar:hover .clip-track-playhead::before {
  transform: translateX(-50%) scale(1.15);
}

/* Player Controls */
.clip-player-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  margin-bottom: 20px;
}

.player-left-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.clip-play-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  color: #FFFFFF;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(79, 126, 255, 0.4);
  transition: all var(--transition-fast);
  padding: 0;
  margin: 0;
  line-height: 0;
}

#clipPlayIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  width: 20px;
  height: 20px;
}

#clipPlayIcon svg {
  display: block;
  margin: auto;
}

.clip-play-btn:hover {
  background: var(--accent-hover);
  transform: scale(1.06);
}

.clip-ctrl-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  line-height: 1;
  box-sizing: border-box;
  transition: all var(--transition-fast);
}

.clip-ctrl-btn svg {
  display: block;
  flex-shrink: 0;
}

.clip-stop-btn {
  width: 34px;
  padding: 0;
}

.clip-ctrl-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.player-right-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.speed-control-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.speed-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-right: 2px;
}

.clip-speed-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.clip-speed-pill.active,
.clip-speed-pill:hover {
  background: var(--accent-primary);
  color: #FFFFFF;
  border-color: var(--accent-primary);
}

.volume-control-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vol-icon {
  font-size: 0.88rem;
}

.clip-volume-range {
  width: 75px;
  height: 4px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

/* Action Bar */
.clip-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 14px;
}

.clip-action-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
}

.clip-action-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.add-clip-trigger-btn {
  padding: 8px 18px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(79, 126, 255, 0.25);
}

/* List of Added Clips */
.clip-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 210px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 20px;
}

.clip-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  transition: all var(--transition-fast);
}

.clip-item-card:hover {
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
}

.clip-item-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.clip-item-badge {
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(34, 197, 94, 0.15);
  color: #16A34A;
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
}

[data-theme="dark"] .clip-item-badge {
  color: #4ADE80;
}

.clip-item-info {
  display: flex;
  flex-direction: column;
}

.clip-item-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
}

.clip-item-times {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.clip-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-clip-preview {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-clip-preview:hover {
  background: var(--accent-primary);
  color: #FFFFFF;
  border-color: var(--accent-primary);
}

.btn-clip-edit {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.btn-clip-edit:hover {
  background: var(--accent-light);
  color: var(--accent-primary);
  border-color: var(--accent-dim);
  transform: translateY(-1px);
}

.btn-clip-del {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: transparent;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  line-height: 0;
  box-sizing: border-box;
  transition: all var(--transition-fast);
}

.btn-clip-del svg {
  display: block;
  pointer-events: none;
  margin: auto;
}

.btn-clip-del:hover {
  background: var(--danger-light);
  color: var(--danger);
  transform: scale(1.08);
}

.clip-empty-state {
  text-align: center;
  padding: 24px 10px;
  color: var(--text-muted);
  font-size: 0.82rem;
  background: var(--bg-canvas);
  border: 1px dashed var(--border-light);
  border-radius: 10px;
}

.clip-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

/* Sub-modal: Add / Edit Clip Popup */
.sub-modal-overlay {
  z-index: 1050;
  backdrop-filter: blur(5px);
  overflow-y: auto;
  overflow-x: hidden;
}

.add-clip-card {
  max-width: 530px;
  width: 92%;
  box-sizing: border-box;
  border-radius: 20px;
  padding: 24px;
  background: var(--bg-card);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-light);
  overflow-x: hidden;
}

.add-clip-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.add-clip-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-light);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.add-clip-title {
  margin: 0;
  font-size: 1.15rem;
  color: var(--text-primary);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.add-clip-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}

.add-clip-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 22px;
}

.clip-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 2px;
}

.clip-input-group .control-label {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.input-custom {
  width: 100%;
  height: 42px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  box-sizing: border-box;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all var(--transition-fast);
}

.input-custom:focus {
  border-color: var(--accent-primary);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(79, 126, 255, 0.18);
  outline: none;
}

/* Mini Clip Range Audio Preview Player */
.sub-clip-preview-player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
}

.sub-clip-play-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(79, 126, 255, 0.35);
  padding: 0;
  margin: 0;
  line-height: 0;
}

.sub-clip-play-btn svg {
  display: block;
  margin: auto;
}

.sub-clip-play-btn:hover {
  background: var(--accent-hover);
  transform: scale(1.06);
}

.sub-clip-track-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sub-clip-track-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.sub-clip-preview-tag {
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.sub-clip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary);
}

.sub-clip-time-badge {
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.sub-clip-sep {
  opacity: 0.4;
  margin: 0 2px;
}

.sub-clip-track-bar {
  position: relative;
  height: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

.sub-clip-track-progress {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, #3B82F6, #60A5FA);
  border-radius: 3px;
  pointer-events: none;
}

.sub-clip-track-playhead {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  margin-left: -7px;
  border-radius: 50%;
  background: #EF4444;
  border: 2px solid #FFFFFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35), 0 0 6px rgba(239, 68, 68, 0.6);
  cursor: grab;
  z-index: 5;
  transition: transform 0.1s ease;
  pointer-events: auto;
}

.sub-clip-track-playhead:hover,
.sub-clip-track-playhead.dragging {
  transform: scale(1.25);
  cursor: grabbing;
  background: #DC2626;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.8);
}

/* Compact Time Point Cards (Start & End) */
.clip-time-card {
  background: var(--bg-canvas);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 8px 12px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.clip-time-card:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(79, 126, 255, 0.12);
}

.time-card-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.time-card-tag {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 100px;
}

.time-card-tag.start-tag {
  color: #16A34A;
}

[data-theme="dark"] .time-card-tag.start-tag {
  color: #4ADE80;
}

.time-card-tag.end-tag {
  color: #DC2626;
}

[data-theme="dark"] .time-card-tag.end-tag {
  color: #F87171;
}

.time-code-input {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  text-align: center;
  width: 95px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  color: var(--text-primary);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.time-code-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.time-quick-nudges {
  display: flex;
  align-items: center;
  gap: 5px;
}

.nudge-pill {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nudge-pill:hover {
  background: var(--accent-primary);
  color: #FFFFFF;
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.clip-duration-preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 10px 14px;
  background: var(--bg-canvas);
  border-radius: 10px;
  border: 1px solid var(--border-light);
}

.clip-feedback-hint {
  font-size: 0.76rem;
  font-weight: 700;
}

.clip-feedback-hint.error {
  color: var(--danger);
}

.clip-feedback-hint.success {
  color: var(--success);
}

.add-clip-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}