:root, [data-theme="obsidian"] {
  --bg-deep: #030205;
  --bg-surface: #0a0812;
  --bg-elevated: #151122;
  --border-subtle: #27203a;
  --border-glow: #8b31d0;
  
  --accent-purple: #8b31d0;
  --accent-purple-bright: #b56cf8;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-amber: #f59e0b;
  --accent-cyan: #06b6d4;
  
  --text-main: #f5f2fc;
  --text-muted: #a39cb8;
  --text-dim: #675f7e;

  --font-ui: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="slate"] {
  --bg-deep: #090a0f;
  --bg-surface: #10121a;
  --bg-elevated: #1a1e2b;
  --border-subtle: #2e354a;
  --accent-purple: #64748b;
  --accent-purple-bright: #94a3b8;
  --text-main: #f8fafc;
  --text-muted: #a5b4c9;
  --text-dim: #5c687e;
}

[data-theme="nord"] {
  --bg-deep: #0b0e14;
  --bg-surface: #121722;
  --bg-elevated: #1c2436;
  --border-subtle: #2e3b54;
  --accent-purple: #5e81ac;
  --accent-purple-bright: #88c0d0;
  --text-main: #eceff4;
  --text-muted: #b0bfd6;
  --text-dim: #5c6b84;
}

[data-theme="amber"] {
  --bg-deep: #080603;
  --bg-surface: #130f08;
  --bg-elevated: #1f180e;
  --border-subtle: #362915;
  --accent-purple: #b45309;
  --accent-purple-bright: #f59e0b;
  --text-main: #fef3c7;
  --text-muted: #c9ad87;
  --text-dim: #735e40;
}

[data-theme="cyberpunk"] {
  --bg-deep: #020208;
  --bg-surface: #080718;
  --bg-elevated: #140f30;
  --border-subtle: #332063;
  --accent-purple: #a855f7;
  --accent-purple-bright: #ec4899;
  --text-main: #fdf4ff;
  --text-muted: #bda6cc;
  --text-dim: #6f548a;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0 !important;
  padding: 0 !important;
  background-color: var(--bg-deep) !important;
  color: var(--text-main);
  font-family: var(--font-ui);
  width: 100%;
  max-width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  user-select: auto;
}

.app-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  height: 100%;
  height: 100dvh;
  background-color: var(--bg-deep);
  position: relative;
  overflow-x: hidden;
  padding-top: env(safe-area-inset-top, 0);
}

/* ==================== ШАПКА ==================== */
.app-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 14px 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  width: 100%;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
}

.waveform-container {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-shrink: 1;
}

#waveform-canvas {
  width: 80px;
  height: 24px;
  background: transparent;
  display: block;
  flex-shrink: 0;
}

.vad-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.vad-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}

.vad-badge.speaking {
  border-color: rgba(181, 108, 248, 0.6);
  color: #fff;
}
.vad-badge.speaking .vad-dot {
  background: var(--accent-purple-bright);
  box-shadow: 0 0 8px var(--accent-purple-bright);
}
.vad-badge.uploading .vad-dot, .vad-badge.paused .vad-dot {
  background: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
}
.vad-badge.recording-manual {
  border-color: var(--accent-purple-bright);
  color: var(--accent-purple-bright);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Кнопки в шапке */
.pill-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
}
.pill-btn:active { transform: scale(0.97); }
.pill-btn.highlight {
  background: rgba(181, 108, 248, 0.16);
  border-color: rgba(181, 108, 248, 0.45);
  color: var(--accent-purple-bright);
}

/* Переключатель вкладок */
.mode-tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
}

.mode-tabs {
  display: flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 3px;
  flex: 1;
  max-width: 290px;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}
.tab-btn.active {
  background: var(--accent-purple);
  color: #fff;
  box-shadow: 0 2px 6px rgba(139, 49, 208, 0.35);
}

.scroll-status {
  font-size: 11.5px;
  font-family: var(--font-mono);
  font-weight: 600;
}
.live-indicator {
  color: var(--accent-green);
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Телеметрия */
.telemetry-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-muted);
  padding-top: 5px;
  border-top: 1px solid rgba(39, 32, 58, 0.6);
  width: 100%;
}
.telem-left, .telem-right { display: flex; align-items: center; gap: 6px; }
.telem-left span, .telem-right span { font-weight: 600; }
.telem-sep { color: var(--border-subtle); }
.cost-glow strong {
  color: var(--accent-green);
  text-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

/* ==================== ПОИСК ==================== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  width: 100%;
}
.search-input {
  flex: 1;
  min-width: 0;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 13.5px;
  padding: 8px 10px;
  border-radius: 8px;
  outline: none;
}
.search-count { font-size: 12px; font-family: var(--font-mono); color: var(--text-muted); }
.search-nav { display: flex; gap: 4px; }
.search-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 13px;
  padding: 5px 9px;
  border-radius: 6px;
}
.search-btn.close { color: #f87171; }
.search-match { background: rgba(245, 158, 11, 0.4); color: #fff; border-radius: 3px; }
.search-match.current { background: rgba(245, 158, 11, 0.9); color: #000; font-weight: 700; }

/* ==================== VIEWPORT ==================== */
.viewport {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  padding: 16px 14px;
  scroll-behavior: smooth;
  user-select: text !important;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.view-content { display: none; width: 100%; }
.view-content.active { display: block; }

.continuous-text {
  font-size: 19px;
  line-height: 1.7;
  color: var(--text-muted);
  overflow-wrap: anywhere;
  word-break: break-word;
  outline: none;
  min-height: 90px;
}
.continuous-text.editing {
  border: 1px dashed rgba(181, 108, 248, 0.5);
  padding: 8px;
  border-radius: 8px;
}
.continuous-text .placeholder {
  color: var(--text-dim);
  font-style: italic;
  font-size: 15px;
}

.phrase-block { display: inline; transition: opacity 0.3s ease; }
.phrase-block.faded { opacity: 0.35; }
.phrase-orig { color: var(--text-main); font-weight: 500; }
.phrase-orig.latest {
  color: var(--accent-purple-bright);
  font-weight: 600;
  text-shadow: 0 0 12px rgba(181, 108, 248, 0.4);
}
.phrase-trans {
  color: var(--accent-cyan);
  font-size: 0.9em;
  opacity: 0.9;
  margin-left: 5px;
  font-style: italic;
}

/* Карточки */
.cards-list { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.speech-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-purple);
  border-radius: 10px;
  padding: 12px 14px;
  width: 100%;
}
.speech-card.bookmarked { border-right: 4px solid var(--accent-amber); }
.speech-card.error { border-left-color: var(--accent-red); }

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.card-quick-actions { display: flex; gap: 6px; }
.card-action-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
}
.card-text {
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--text-main);
  outline: none;
  word-break: break-word;
}
.card-trans {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(39, 32, 58, 0.8);
  color: var(--accent-cyan);
  font-size: 14px;
}

/* Таблица логов */
.table-scroll-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.log-table {
  width: 100%;
  min-width: 390px;
  border-collapse: collapse;
  font-size: 13px;
  font-family: var(--font-mono);
}
.log-table th, .log-table td {
  padding: 8px 9px;
  border-bottom: 1px solid rgba(39, 32, 58, 0.7);
}
.log-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-align: left;
}
.log-table td.dim { color: var(--text-muted); }
.log-table td.cost { color: var(--accent-green); font-weight: 600; }
.log-table td.error-text { color: var(--accent-red); }

/* Индикатор пульсации */
.processing-pulse {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--accent-purple-bright);
}
.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-purple-bright);
  animation: pulseDot 1.4s infinite ease-in-out both;
}
.pulse-dot:nth-child(1) { animation-delay: -0.32s; }
.pulse-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes pulseDot {
  0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

/* ==================== НИЖНЯЯ ПАНЕЛЬ (DOCK) ==================== */
.mobile-dock {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 8px 12px calc(12px + env(safe-area-inset-bottom, 0)) 12px;
  width: 100%;
  flex-shrink: 0;
  z-index: 50;
}

.dock-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 6px;
}

.dock-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 8px;
  cursor: pointer;
  flex: 1;
  min-height: 48px;
}
.dock-btn:active { transform: scale(0.94); }
.dock-icon {
  font-size: 20px;
  line-height: 1;
}
.dock-label {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-ui);
  letter-spacing: 0.2px;
}

/* Крупная кнопка Старт/Пауза */
.dock-cta-wrap {
  flex: 1.5;
  display: flex;
  justify-content: center;
  align-items: center;
}

.dock-cta-btn {
  background: var(--accent-purple);
  border: 1px solid var(--accent-purple-bright);
  color: #fff;
  border-radius: 26px;
  height: 48px;
  width: 100%;
  max-width: 116px;
  font-weight: 700;
  font-size: 15.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(139, 49, 208, 0.45);
  transition: all 0.15s ease;
}
.dock-cta-btn.paused {
  background: rgba(245, 158, 11, 0.22);
  border-color: var(--accent-amber);
  color: #fbbf24;
  box-shadow: none;
}
.dock-cta-btn:active { transform: scale(0.95); }

/* Ручной режим */
.dock-manual-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.dock-cta-btn.send-btn {
  font-size: 13px;
  background: rgba(139, 49, 208, 0.35);
  max-width: none;
}
.timer-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-purple-bright);
}
.dock-btn.discard-btn {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  padding: 0;
  flex: none;
}

/* ==================== ШТОРКА ИНСТРУМЕНТОВ ==================== */
.tools-drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
}
.tools-drawer.open { display: block; }
.tools-drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 2, 5, 0.75);
  backdrop-filter: blur(5px);
}
.tools-drawer-card {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(16px + env(safe-area-inset-bottom, 0)) 16px;
  animation: slideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 82dvh;
  overflow-y: auto;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.tools-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.tools-drawer-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.tool-tile {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: 12px;
  padding: 13px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.tool-tile .tile-icon { font-size: 20px; }
.tool-tile:active { background: rgba(181, 108, 248, 0.2); }
.tool-tile.danger { color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }
.tool-tile.highlight { color: var(--accent-purple-bright); border-color: rgba(181, 108, 248, 0.45); }
.tool-dropdown-wrap { width: 100%; grid-column: span 3; }
.tool-tile.full { width: 100%; flex-direction: row; justify-content: center; padding: 11px; }

/* Экспорт */
.dropdown { position: relative; }
.dropdown-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  z-index: 120;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.85);
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu button {
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid rgba(39, 32, 58, 0.5);
}
.dropdown-menu button:last-child { border-bottom: none; }

/* ==================== МОДАЛЬНЫЕ ОКНА ==================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(3, 2, 5, 0.85);
  backdrop-filter: blur(6px);
  z-index: 110;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.modal-overlay.active { display: flex; }

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 100%;
  max-height: 88dvh;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0)) 16px;
  display: flex;
  flex-direction: column;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.modal-header h3 { font-size: 17px; font-weight: 700; color: var(--text-main); margin: 0; }
.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  padding: 4px 8px;
  cursor: pointer;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  min-height: 0;
}
.setting-row-2 { display: flex; flex-direction: column; gap: 10px; }
.setting-group { display: flex; flex-direction: column; gap: 5px; }
.setting-group label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.setting-label-row { display: flex; justify-content: space-between; align-items: center; }
.badge-val { font-size: 12px; font-family: var(--font-mono); font-weight: 700; color: var(--accent-purple-bright); }

.custom-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  width: 100%;
}
.custom-input:focus { border-color: var(--accent-purple-bright); }

.setting-box-block { background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 10px 12px; }
.setting-toggle-row { display: flex; align-items: center; gap: 10px; }
.toggle-title { font-size: 13.5px; font-weight: 600; color: var(--text-main); }
.toggle-container { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.toggle-container input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background-color: var(--border-subtle); border-radius: 20px; transition: .2s; }
.toggle-slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: .2s; }
input:checked + .toggle-slider { background-color: var(--accent-purple); }
input:checked + .toggle-slider:before { transform: translateX(16px); }

input[type="range"] {
  appearance: none; width: 100%; height: 6px; background: var(--bg-elevated); border-radius: 3px; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent-purple-bright); cursor: pointer;
}

.modal-footer { margin-top: 12px; }
.action-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 8px;
  cursor: pointer;
}
.action-btn.primary { background: var(--accent-purple); color: #fff; border-color: var(--accent-purple-bright); }
.action-btn.full { width: 100%; padding: 12px; font-size: 14.5px; }

.tasks-container, .summary-box, .archive-text-view {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-main);
  max-height: 52dvh;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* Чат */
.chat-card { height: 86dvh; }
.chat-header-left { display: flex; align-items: center; gap: 8px; }
.chat-threads-wrap { display: flex; align-items: center; gap: 6px; }
.chat-select { background: var(--bg-elevated); border: 1px solid var(--border-subtle); color: var(--text-main); font-size: 12px; font-weight: 600; padding: 5px; border-radius: 6px; }
.chat-tool-btn { background: var(--bg-elevated); border: 1px solid var(--border-subtle); color: var(--text-muted); font-weight: 600; padding: 5px 8px; border-radius: 6px; font-size: 12px; }

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-bubble { max-width: 88%; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; word-break: break-word; }
.chat-bubble.user { align-self: flex-end; background: var(--accent-purple); color: #fff; font-weight: 500; }
.chat-bubble.assistant { align-self: flex-start; background: var(--bg-elevated); border: 1px solid var(--border-subtle); color: var(--text-main); }
.chat-quick-prompts { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0; scrollbar-width: none; }
.chip { background: var(--bg-elevated); border: 1px solid var(--border-subtle); color: var(--text-muted); font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.chat-footer { display: flex; gap: 8px; margin-top: 6px; }
.chat-input { flex: 1; background: var(--bg-elevated); border: 1px solid var(--border-subtle); color: var(--text-main); padding: 10px; border-radius: 8px; font-size: 13.5px; outline: none; resize: none; }

/* Шторка архива */
.sidebar-drawer {
  position: fixed;
  inset: 0 auto 0 -100%;
  width: 85%;
  max-width: 320px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  z-index: 120;
  display: flex;
  flex-direction: column;
  transition: left 0.2s ease;
}
.sidebar-drawer.open { left: 0; }
.sidebar-header { display: flex; justify-content: space-between; align-items: center; padding: 14px; border-bottom: 1px solid var(--border-subtle); }
.sidebar-list { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.session-item-btn { width: 100%; text-align: left; background: transparent; border: none; color: var(--text-muted); font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; padding: 10px; border-radius: 6px; }

/* ==================== ДЕСКТОП (>= 769px) ==================== */
@media (min-width: 769px) {
  .app-shell {
    max-width: 1040px;
    margin: 0 auto;
    border-left: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
  }
  
  #waveform-canvas { width: 120px; }
  
  .setting-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .modal-overlay {
    align-items: center;
    padding: 20px;
  }
  
  .modal-card {
    border-radius: 14px;
    border: 1px solid var(--border-subtle);
    width: 540px;
  }
  .modal-card.wide { width: 700px; }
  .modal-card.small-modal { width: 400px; }

  .tools-drawer-card {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    bottom: auto;
    width: 480px;
    border-radius: 14px;
    border: 1px solid var(--border-subtle);
  }
}
