:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --border: #e8ecf1;
  --text: #1e293b;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --martin: #2563eb;
  --martin-soft: #f1f5f9;
  --drop: #dbeafe;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  --radius: 12px;
  /* Default panel widths: 15% / 15% / 35% / 35% */
  --w-menu: 15%;
  --w-files: 15%;
  --w-chat: 35%;
  --w-table: 35%;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}

.shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ---- 4-panel layout: Menu | Files | Chat | Table ---- */
.app {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
  gap: 0;
  padding: 0;
  background: var(--bg);
}

.panel {
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  transition:
    flex-basis 0.28s ease,
    width 0.28s ease,
    min-width 0.28s ease,
    max-width 0.28s ease,
    opacity 0.22s ease,
    border-color 0.2s ease;
}

.panel:last-child { border-right: none; }

.menu-panel {
  flex: 0 0 var(--w-menu);
  width: var(--w-menu);
  max-width: 280px;
  min-width: 160px;
}

.file-panel {
  flex: 0 0 var(--w-files);
  width: var(--w-files);
  max-width: 320px;
  min-width: 160px;
}

.chat-panel {
  flex: 1 1 var(--w-chat);
  min-width: 280px;
  border-left: none;
  position: relative;
  overflow: hidden;
}

.workspace {
  flex: 1 1 var(--w-table);
  min-width: 280px;
  min-height: 0;
  border-right: none;
  overflow: hidden;
}

/* Collapse: only menu + files */
.app.menu-panel-collapsed .menu-panel {
  flex-basis: 0 !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  opacity: 0;
  pointer-events: none;
  border-right-color: transparent;
  overflow: hidden;
}

.app.file-panel-collapsed .file-panel {
  flex-basis: 0 !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  opacity: 0;
  pointer-events: none;
  border-right-color: transparent;
  overflow: hidden;
}

.app.menu-panel-collapsed #resizeMenuFiles,
.app.file-panel-collapsed #resizeFilesChat {
  width: 0;
  min-width: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Expand buttons: show only when neighbor is collapsed */
.panel-expand-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  flex-shrink: 0;
  padding: 0;
}

.panel-expand-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Expand controls live in chat header so they stay reachable when side panels hide */
.app.menu-panel-collapsed #menuPanelExpand {
  display: inline-flex;
}

.app.file-panel-collapsed #filePanelExpand {
  display: inline-flex;
}

.app.menu-panel-collapsed #menuPanelExpand::after {
  content: none;
}

.panel-collapse-btn {
  flex-shrink: 0;
  margin-left: auto;
}

.file-add-btn {
  flex-shrink: 0;
  font-weight: 600;
  font-size: 18px;
  line-height: 1;
  color: var(--accent);
  border-color: #bfdbfe;
  background: var(--accent-soft);
}

.file-add-btn:hover {
  background: #dbeafe;
  border-color: var(--accent);
}

.resize-handle {
  flex-shrink: 0;
  width: 5px;
  cursor: col-resize;
  background: transparent;
  position: relative;
  z-index: 5;
  transition: background 0.15s;
}

.resize-handle:hover,
.resize-handle.dragging {
  background: var(--accent);
}

.resize-handle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 28px;
  border-radius: 2px;
  background: #cbd5e1;
  opacity: 0.7;
}

.resize-handle:hover::after,
.resize-handle.dragging::after {
  background: #fff;
  opacity: 1;
}

body.is-resizing {
  cursor: col-resize;
  user-select: none;
}

body.is-resizing .panel {
  transition: none;
}

body.is-resizing .resize-handle.dragging {
  background: var(--accent);
}

.panel-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.panel-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}

.panel-header .badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 0;
}

.icon-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  padding: 0;
  flex-shrink: 0;
}

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* ---- Menu panel ---- */
.menu-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-new-project {
  width: 100%;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 12px;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
  transition: filter 0.15s, transform 0.1s;
}

.btn-new-project:hover {
  filter: brightness(1.06);
}

.btn-new-project:active {
  transform: scale(0.98);
}

.menu-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 6px 0;
}

.projects-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-group {
  border-radius: 10px;
  overflow: hidden;
}

.project-group-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  border: none;
  background: transparent;
  padding: 8px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
}

.project-group-head:hover {
  background: #f1f5f9;
}

.project-group-head .chev {
  color: var(--muted);
  font-size: 11px;
  width: 14px;
  flex-shrink: 0;
}

.project-group-head .proj-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-audits {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 0 0 4px 12px;
}

.project-group.open .project-audits {
  display: flex;
}

.project-audit {
  border: none;
  background: transparent;
  text-align: left;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-audit:hover {
  background: #f1f5f9;
  color: var(--text);
}

.project-audit.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.project-group-head.project-audit-flat.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.project-group-head.project-audit-flat .chev {
  color: var(--accent);
  font-size: 8px;
}

.projects-menu-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 8px 6px;
  line-height: 1.4;
}

.menu-footer {
  border-top: 1px solid var(--border);
  padding: 10px 12px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-footer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.menu-footer .logout-btn {
  margin-left: auto;
}

/* ---- File upload loader ---- */
.file-upload-loader {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  border-bottom: 1px solid #dbeafe;
  flex-shrink: 0;
}

.file-upload-loader.hidden {
  display: none !important;
}

/* ---- Status dots on files ---- */
.tree-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-left: auto;
  background: #cbd5e1;
}

.tree-status-dot.ready {
  background: #22c55e;
}

.tree-status-dot.pending {
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.tree-status-dot.parsing {
  background: var(--accent);
  animation: pulse-dot 1s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

/* Hide scope checkboxes — multi via Ctrl/⌘ */
.tree-scope-check {
  display: none !important;
}

/* ---- Add file/folder modal ---- */
.add-file-modal {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.add-file-modal.hidden {
  display: none !important;
}

.add-file-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
}

.add-file-modal-box {
  position: relative;
  width: min(380px, 92vw);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.add-file-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.add-file-modal-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.add-file-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
}

.add-file-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--border);
  background: #fafbfc;
  border-radius: 12px;
  padding: 14px 14px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.add-file-choice:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.add-file-choice-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.add-file-choice-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.add-file-choice-text strong {
  font-size: 13px;
  color: var(--text);
}

.add-file-choice-text small {
  font-size: 11px;
  color: var(--muted);
}

/* Chat attach (paperclip) */
.chat-attach-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.chat-attach-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.chat-input #chatSend {
  min-width: 56px;
  width: auto;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
}

/* --- File zone --- */
.file-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 0 12px 6px;
  font-size: 11px;
  color: var(--muted);
}
.file-breadcrumb:empty { display: none; }
.file-breadcrumb .crumb {
  border: none;
  background: none;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--muted);
  font-size: 11px;
}
.file-breadcrumb .crumb:hover { background: #f1f5f9; color: var(--accent); }
.file-breadcrumb .crumb.active { color: var(--accent); font-weight: 600; }
.file-breadcrumb .crumb-sep { opacity: 0.45; user-select: none; }

.file-zone { flex: 1; overflow: auto; padding: 8px 0; }

.tree-item {
  user-select: none;
  font-size: 13px;
}

.tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 6px;
  margin: 0 6px;
}

.tree-row:hover { background: #f1f5f9; }
.tree-row.selected { background: var(--accent-soft); color: var(--accent); }
.tree-row.in-scope { box-shadow: inset 3px 0 0 var(--accent, #2563eb); }
.tree-row .tree-scope-check {
  margin: 0 4px 0 0;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--accent, #2563eb);
}
.tree-chevron {
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 4px;
}
.tree-chevron:hover { background: #e2e8f0; color: #334155; }
.tree-chevron--spacer { display: inline-block; pointer-events: none; }
.file-scope-badge {
  margin: 4px 10px 0;
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 8px;
  background: var(--accent-soft, #dbeafe);
  color: var(--accent, #1d4ed8);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.file-scope-badge.hidden { display: none !important; }
.file-scope-badge-label {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.9;
}
.file-scope-badge-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 88px;
  overflow-y: auto;
}
.file-scope-hint {
  margin: 6px 10px 8px;
  font-size: 11px;
  opacity: 0.65;
  line-height: 1.3;
}

/* Workset strip — what Marlon will process (pending parse / scope) */
.workset-strip {
  flex-shrink: 0;
  border-top: 1px solid var(--border, #e2e8f0);
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  padding: 8px 10px 6px;
}
.workset-strip.hidden { display: none !important; }
.workset-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  min-width: 0;
}
.workset-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #475569;
}
.workset-count {
  font-size: 11px;
  color: var(--muted, #64748b);
  font-weight: 500;
}
.workset-clear {
  margin-left: auto;
  border: 1px solid var(--border, #e2e8f0);
  background: #fff;
  color: #64748b;
  font-size: 11px;
  border-radius: 6px;
  padding: 2px 8px;
  cursor: pointer;
  flex-shrink: 0;
}
.workset-clear:hover {
  border-color: #fca5a5;
  color: #b91c1c;
  background: #fef2f2;
}
.workset-clear.hidden { display: none !important; }
.workset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 96px;
  overflow-y: auto;
}
.workset-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 4px 8px 4px 6px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 12px;
  line-height: 1.2;
  color: #0f172a;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}
.workset-chip-icon {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
  letter-spacing: -0.02em;
  color: #fff;
}
.workset-chip-icon.is-pdf { background: #dc2626; }
.workset-chip-icon.is-xlsx,
.workset-chip-icon.is-xls,
.workset-chip-icon.is-xlsm { background: #16a34a; }
.workset-chip-icon.is-docx { background: #2563eb; }
.workset-chip-icon.is-html { background: #ea580c; }
.workset-chip-icon.is-xml { background: #7c3aed; }
.workset-chip-icon.is-csv,
.workset-chip-icon.is-tsv,
.workset-chip-icon.is-txt { background: #475569; }
.workset-chip-icon.is-folder { background: #0ea5e9; }
.workset-chip-icon.is-file { background: #94a3b8; }
.workset-chip-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}
.workset-chip.is-more {
  color: #64748b;
  font-weight: 600;
  border-style: dashed;
}

/* Wave 3 plan card */
.plan-card {
  margin: 8px 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border, #e2e8f0);
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  max-width: 420px;
}
.plan-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.plan-card-status {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.7;
}
.plan-card-goal {
  font-size: 13px;
  margin-bottom: 8px;
  color: #334155;
}
.plan-card-steps {
  margin: 0 0 10px 1.1rem;
  padding: 0;
  font-size: 13px;
  line-height: 1.45;
}
.plan-step {
  margin: 2px 0;
}
.plan-step--done { color: #15803d; }
.plan-step--running { color: #1d4ed8; font-weight: 600; }
.plan-step--failed { color: #b91c1c; }
.plan-step--skipped { opacity: 0.55; }
.plan-step-icon {
  display: inline-block;
  width: 1.1em;
}
.plan-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.plan-card-actions button {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  cursor: pointer;
}
.plan-card-actions button.primary {
  background: var(--accent, #2563eb);
  border-color: var(--accent, #2563eb);
  color: #fff;
}
.plan-card-actions.hidden { display: none; }
.tree-row.dragging { opacity: 0.5; }

.tree-row.folder { font-weight: 500; }
.tree-row.folder.uploaded { cursor: grab; }
.tree-row.folder.uploaded:active { cursor: grabbing; }
.tree-row.file { padding-left: 28px; }
.tree-row .icon { width: 16px; text-align: center; opacity: 0.7; flex-shrink: 0; }
.tree-row .tree-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-row .tree-count {
  margin-left: 4px;
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
}

.tree-row.selected {
  background: var(--accent-soft);
  color: var(--accent);
}

.tree-row.file .tree-label {
  flex: 1;
}

.upload-btn {
  margin: 8px 12px;
  padding: 8px;
  font-size: 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #fafafa;
  cursor: pointer;
  text-align: center;
  color: var(--muted);
}
.upload-btn:hover { border-color: var(--accent); color: var(--accent); }
.upload-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.upload-btn-secondary {
  font-size: 12px;
  opacity: 0.95;
}

/* --- Center workspace (width controlled by 4-panel layout) --- */
.workspace {
  /* flex set in layout block above */
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.toolbar input {
  flex: 1;
  min-width: 120px;
  max-width: none;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}

.toolbar .icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
}

.toolbar .ocr-learn-btn:not(:disabled) {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background: #eff6ff;
}
.toolbar .ocr-learn-btn:not(:disabled):hover {
  background: #dbeafe;
  border-color: #93c5fd;
}
.toolbar .icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.table-area {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.drop-overlay {
  position: absolute;
  inset: 12px;
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  background: rgba(219, 234, 254, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  pointer-events: none;
}

.drop-overlay.visible { display: flex; }
.table-area.drag-over .drop-overlay { display: flex; }

.table-wrap {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
  padding: 0 12px;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
  min-width: 88px;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}

.data-table td.cell-data {
  cursor: pointer;
}

.data-table td.cell-data:hover {
  background: #eff6ff;
  outline: 1px solid #93c5fd;
}

.data-table th:first-child,
.data-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #f8fafc;
  min-width: 44px;
  max-width: 56px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  border-right: 1px solid #e2e8f0;
  box-shadow: 2px 0 4px -2px rgba(15, 23, 42, 0.08);
}

.data-table th:first-child {
  z-index: 3;
  background: #f1f5f9;
}

.data-table tr:hover td:first-child {
  background: #f1f5f9;
}

/* ФНС: достоверно / недостоверно */
.data-table td.cell-data.cell-tone-ok {
  background: #dcfce7 !important;
  color: #166534;
  font-weight: 600;
}
.data-table td.cell-data.cell-tone-bad {
  background: #fee2e2 !important;
  color: #991b1b;
  font-weight: 600;
}
.data-table td.cell-data.cell-tone-warn {
  background: #fef9c3 !important;
  color: #854d0e;
  font-weight: 500;
}
.data-table tr:hover td.cell-data.cell-tone-ok { background: #bbf7d0 !important; }
.data-table tr:hover td.cell-data.cell-tone-bad { background: #fecaca !important; }
.data-table tr:hover td.cell-data.cell-tone-warn { background: #fef08a !important; }

/* Excel↔Word audit: совпало = салатовый, не найдено = красный, расхождение = оранжевый */
.data-table tr.row-tone-ok td,
.data-table tr.preview-row.row-tone-ok td {
  background: #d9f99d !important;
}
.data-table tr.row-tone-missing td,
.data-table tr.preview-row.row-tone-missing td {
  background: #fecaca !important;
}
.data-table tr.row-tone-mismatch td,
.data-table tr.preview-row.row-tone-mismatch td {
  background: #fed7aa !important;
}
.data-table tr.row-tone-ok:hover td {
  background: #bef264 !important;
}
.data-table tr.row-tone-missing:hover td {
  background: #fca5a5 !important;
}
.data-table tr.row-tone-mismatch:hover td {
  background: #fdba74 !important;
}

.data-table td.cell-data.truncated::after {
  content: '…';
  color: var(--muted);
}

.data-table th {
  background: #f8fafc;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: normal;
  line-height: 1.25;
  cursor: default;
}

.data-table th::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  cursor: col-resize;
}

.data-table tr:hover td { background: #f8fafc; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  text-align: center;
  padding: 40px;
  gap: 12px;
}

.empty-state .drop-hint {
  padding: 24px 32px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  max-width: 420px;
}

.tabs-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  overflow-x: auto;
  overflow-y: hidden;
  flex-shrink: 0;
  background: #fafbfc;
}

.tab-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border-radius: 8px;
  border: 1px solid transparent;
  flex-shrink: 0;
}

.tab-wrap.active {
  background: #fff;
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.tab-wrap .tab {
  border: none;
  box-shadow: none;
}

.tab-wrap.active .tab {
  border: none;
  box-shadow: none;
}

.tab-close {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 4px 8px 4px 2px;
  border-radius: 0 8px 8px 0;
}

.tab-close:hover {
  color: #c0392b;
  background: #fdecea;
}

.tab {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}

.tab:hover { background: #fff; border-color: var(--border); }
.tab.active {
  background: #fff;
  border-color: var(--border);
  color: var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow);
}

.tab.add { color: var(--accent); font-weight: 600; }

.status-bar {
  padding: 6px 16px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.status-bar.has-pagination .table-pagination {
  margin-left: auto;
}

.status-bar:not(.has-pagination) #statusUpdated {
  margin-left: auto;
}

.table-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-pagination.hidden {
  display: none;
}

.page-btn {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 12px;
  cursor: pointer;
  line-height: 1.4;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.page-goto {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.page-input {
  width: 4.2em;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  font-variant-numeric: tabular-nums;
  background: var(--panel);
  color: var(--text);
  -moz-appearance: textfield;
}

.page-input::-webkit-outer-spin-button,
.page-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.page-input:focus {
  outline: none;
  border-color: var(--accent);
}

.page-total {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.page-range {
  color: var(--muted);
}

/* --- Martin chat --- */
.martin-header {
  gap: 10px;
}

.martin-header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.martin-header-text small.chat-active-title {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  margin-top: 2px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-scope {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.active-table-badge {
  font-size: 11px;
  font-weight: 600;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}

.martin-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #c9a227;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 100%;
}

.msg-row.bot {
  align-self: flex-start;
}

.msg-row.thinking .msg.bot {
  display: flex;
  align-items: center;
  gap: 6px;
}

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #c9a227;
}

.msg-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  max-width: calc(100% - 36px);
}

.msg-col .msg.bot {
  align-self: flex-start;
}

.msg {
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.msg.bot {
  background: #f1f5f9;
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.msg.user {
  align-self: flex-end;
  max-width: 92%;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg.system {
  align-self: center;
  max-width: 92%;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 12px;
  padding: 6px 12px;
}

.msg strong {
  font-weight: 700;
  color: #0f172a;
  background: rgba(59, 130, 246, 0.14);
  padding: 0 3px;
  border-radius: 3px;
}

.msg em {
  font-style: italic;
  color: #334155;
}

.msg .msg-h2,
.msg .msg-h3 {
  display: block;
  font-weight: 700;
  color: #0f172a;
  margin: 2px 0 4px;
  line-height: 1.35;
}

.msg .msg-h2 {
  font-size: 1.05em;
}

.msg .msg-h3 {
  font-size: 1em;
  color: #1e293b;
}

.msg .msg-inline-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
  padding: 1px 5px;
  border-radius: 4px;
}

.msg .msg-code {
  display: block;
  margin: 6px 0;
  padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.4;
  background: rgba(15, 23, 42, 0.06);
  border-radius: 8px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg.user strong {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.msg.user .msg-inline-code,
.msg.user .msg-code {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.thinking-dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  margin-left: 2px;
}

.thinking-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--martin);
  opacity: 0.35;
  animation: thinking-bounce 1.2s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.15s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes thinking-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40% { transform: translateY(-4px); opacity: 1; }
}

.msg-feedback {
  display: flex;
  gap: 4px;
  padding-left: 2px;
}

.feedback-btn {
  padding: 2px 8px;
  font-size: 14px;
  line-height: 1.2;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s, background 0.15s, border-color 0.15s;
}

.feedback-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.7);
}

.feedback-btn.active {
  opacity: 1;
  background: #fff;
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.chat-input {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: flex-end;
}

.chat-input textarea {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  overflow-y: auto;
  min-height: 40px;
  max-height: 120px;
  line-height: 1.4;
}

.chat-input textarea:disabled,
.chat-input button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.chat-input--busy textarea,
.chat-input--busy button {
  opacity: 0.55;
}

.chat-input button#chatSend {
  width: auto;
  min-width: 56px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  padding: 0 14px;
}

.mode-tabs-top {
  display: flex;
  gap: 4px;
  padding: 8px 12px 0;
  background: var(--bg);
  flex-shrink: 0;
}

.mode-tab {
  padding: 8px 16px;
  border: none;
  background: transparent;
  font-size: 13px;
  cursor: pointer;
  color: var(--muted);
  border-radius: 8px 8px 0 0;
}

.mode-tab.active {
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
}

.parse-progress {
  font-size: 12px;
  color: var(--martin);
  padding: 4px 16px;
  flex-shrink: 0;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

.transform-bar {
  flex-shrink: 0;
  padding: 8px 16px;
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
}

.transform-bar .summary {
  flex: 1;
  min-width: 180px;
  color: #92400e;
}

.transform-bar .actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.transform-bar button {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}

.transform-bar button.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.transform-bar button.danger {
  color: #b91c1c;
  border-color: #fecaca;
}

.transform-bar.preview-active {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.msg .msg-feedback {
  margin-top: 0;
}

.data-table tr.preview-row td {
  background: #f0fdf4;
}

.data-table.preview-mode th {
  background: #dbeafe;
}

.cell-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.cell-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.cell-modal-box {
  position: relative;
  width: min(720px, 92vw);
  max-height: min(70vh, 640px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cell-modal.audit-inspect-open,
.cell-modal:has(.audit-inspect-open) {
  padding: 8px 6px;
  align-items: stretch;
}

.cell-modal-box.audit-inspect-open {
  width: calc(100vw - 12px) !important;
  max-width: none !important;
  height: calc(100vh - 16px) !important;
  max-height: calc(100vh - 16px) !important;
  border-radius: 10px;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr);
}

.cell-modal-box.audit-inspect-open > .cell-modal-head {
  grid-row: 1;
}

.cell-modal-box.audit-inspect-open > .cell-modal-body {
  display: none !important;
}

.cell-modal-box.audit-inspect-open > #auditInspect:not(.hidden) {
  position: absolute;
  top: 52px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(220px, var(--audit-inspect-word, 50%)) 8px minmax(220px, 1fr);
  min-height: 0;
  height: auto;
}

.audit-inspect:not(.hidden) {
  min-height: 0;
  flex: 1 1 auto;
}

.cell-peek {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.cell-peek.hidden {
  display: none;
}

.cell-peek-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
}

.cell-peek-box {
  position: relative;
  width: min(640px, 92vw);
  max-height: min(60vh, 480px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cell-peek-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
}

.cell-peek-body {
  margin: 0;
  padding: 16px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
}

.audit-inspect {
  display: grid;
  grid-template-columns: minmax(220px, var(--audit-inspect-word, 50%)) 8px minmax(220px, 1fr);
  gap: 0;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.audit-inspect.word-analog-paste {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
}

.audit-inspect.hidden {
  display: none;
}

.word-analog-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  flex: 1;
  padding: 10px 12px 12px;
}

.word-analog-label {
  font-size: 12px;
  color: var(--muted, #64748b);
}

.word-analog-caption {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}

.word-analog-preview {
  max-height: 42%;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel, #fff);
}

.word-analog-preview.hidden {
  display: none;
}

.word-analog-preview .audit-inspect-mini {
  margin: 0;
}

.word-analog-text {
  flex: 1;
  min-height: 120px;
  width: 100%;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font: 13px/1.4 ui-monospace, Consolas, monospace;
}

.word-analog-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.word-analog-hint {
  font-size: 12px;
  color: var(--muted, #64748b);
}

.word-analog-paste .audit-inspect-pane:first-child {
  min-width: 0;
}

.audit-inspect-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--border);
}

.audit-inspect-pane:last-child {
  border-right: none;
}

.audit-inspect-split {
  width: 8px;
  cursor: col-resize;
  background: #e2e8f0;
  border-left: 1px solid #cbd5e1;
  border-right: 1px solid #cbd5e1;
  z-index: 3;
}

.audit-inspect-split:hover,
.audit-inspect-split.dragging {
  background: #93c5fd;
}

.audit-inspect-pane-title {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.audit-inspect-scroll {
  overflow: auto;
  flex: 1;
  min-height: 240px;
  padding: 8px;
  -webkit-overflow-scrolling: touch;
}

.ddu-inspect-pdf {
  width: 100%;
  height: 100%;
  min-height: 70vh;
  border: 0;
  background: #525659;
}

.audit-inspect.ddu-inspect-open #auditInspectWordTitle {
  display: none;
}

.audit-inspect-scroll.ddu-pdf-host {
  padding: 0;
  background: #525659;
  overflow: auto;
}

.ddu-inspect-pdf-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 8px 24px;
}

.ddu-inspect-page {
  display: block;
  max-width: 100%;
  height: auto;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.ddu-inspect-fields input {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  font: inherit;
  cursor: text;
}

.ddu-inspect-fields td {
  cursor: default;
}

.ddu-inspect-corpus {
  margin: 0;
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.45;
}

.ddu-inspect-save-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.ddu-inspect-save-status {
  font-size: 13px;
  color: #64748b;
}

.ddu-inspect-prompt {
  margin-top: 16px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 8px 10px 12px;
  background: #f8fafc;
}

.ddu-inspect-prompt summary {
  cursor: pointer;
  font-weight: 650;
}

.ddu-inspect-prompt-hint {
  margin: 8px 0;
  font-size: 12px;
  color: #64748b;
}

.ddu-inspect-prompt textarea {
  width: 100%;
  min-height: 220px;
  box-sizing: border-box;
  font: 12px/1.4 ui-monospace, Consolas, monospace;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  padding: 8px;
  resize: vertical;
}

.audit-inspect-word-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.audit-inspect-period-cap {
  font-size: 12px;
  font-weight: 650;
  color: #334155;
  margin: 0 0 8px;
  padding: 4px 2px 0;
}

.audit-inspect-mini {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 12px;
}

.audit-inspect-mini.audit-inspect-word-table {
  table-layout: auto;
  width: max-content;
  min-width: 100%;
}

.audit-inspect-mini th,
.audit-inspect-mini td {
  border: 1px solid #e2e8f0;
  padding: 4px 8px;
  white-space: normal;
  max-width: none;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
  line-height: 1.3;
}

.audit-inspect-mini.audit-inspect-word-table th,
.audit-inspect-mini.audit-inspect-word-table td {
  min-width: 5.25rem;
  max-width: 14rem;
  overflow-wrap: break-word;
  word-break: normal;
}

.audit-inspect-mini.audit-inspect-word-table td.is-num {
  min-width: 4.75rem;
  max-width: 8.5rem;
}

.audit-inspect-mini.audit-inspect-word-table .audit-inspect-th-long,
.audit-inspect-mini.audit-inspect-word-table td:first-child {
  min-width: 10rem;
  max-width: 20rem;
}

.audit-inspect-mini td.is-num {
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
  max-width: none;
}

.audit-inspect-mini thead th.audit-inspect-th-band {
  text-align: center;
  background: #e8eef6;
  font-size: 11px;
}

.audit-inspect-mini thead th.audit-inspect-th-sub {
  font-weight: 500;
  font-size: 11px;
  color: #475569;
  background: #f8fafc;
}

.audit-inspect-mini thead th.audit-inspect-th-long {
  max-width: none;
  font-weight: 600;
  overflow-wrap: break-word;
}

.audit-inspect-mini thead tr:nth-child(2) th {
  top: 2.35em;
}

.audit-inspect-mini td:not(.audit-inspect-actions) {
  cursor: pointer;
}

.audit-inspect-mini th {
  background: #f1f5f9;
  position: sticky;
  top: 0;
  z-index: 1;
}

.audit-inspect-mini th::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  cursor: col-resize;
}

.audit-inspect-mini tr.hit td {
  background: #fef9c3;
}

.audit-inspect-hint {
  margin: 0 0 8px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.35;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.audit-inspect-mini tr.focus-src td {
  background: #dbeafe !important;
  box-shadow: inset 3px 0 0 #2563eb;
}

.audit-inspect-mini tr.focus-hit td {
  background: #fef08a !important;
  box-shadow: inset 3px 0 0 #ca8a04;
}

.audit-inspect-mini tr.focus-soft td {
  background: #f8fafc !important;
  box-shadow: inset 3px 0 0 #94a3b8;
}

.audit-inspect-mini td.cell-hit {
  outline: 2px solid #dc2626;
  outline-offset: -2px;
  background: #fee2e2 !important;
  font-weight: 600;
}

.audit-inspect-excel-table tbody tr[data-excel-i] {
  cursor: pointer;
}

.audit-inspect-word-table tbody tr[data-word-ri] {
  cursor: pointer;
}

.audit-inspect-mini tr.tone-ok td {
  background: #f0fdf4;
}

.audit-inspect-mini tr.tone-missing td {
  background: #fff7ed;
}

.audit-inspect-mini tr.tone-mismatch td {
  background: #fef2f2;
}

.audit-inspect-mini tr.hit.tone-ok td,
.audit-inspect-mini tr.hit.tone-missing td,
.audit-inspect-mini tr.hit.tone-mismatch td {
  box-shadow: inset 3px 0 0 #eab308;
}

.audit-inspect-mini td.audit-inspect-actions,
.audit-inspect-mini th.audit-inspect-actions-h {
  white-space: normal;
  max-width: none;
  position: sticky;
  right: 0;
  z-index: 2;
}

.audit-inspect-mini th.audit-inspect-actions-h {
  background: #f1f5f9;
}

.audit-inspect-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.audit-status-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
}

.audit-status-btn.is-on {
  font-weight: 700;
}

.audit-status-btn[data-audit-status="совпало"].is-on {
  background: #dcfce7;
  border-color: #86efac;
}

.audit-status-btn[data-audit-status="не найдено"].is-on {
  background: #ffedd5;
  border-color: #fdba74;
}

.audit-status-btn[data-audit-status="расхождение"].is-on {
  background: #fee2e2;
  border-color: #fca5a5;
}

.audit-add-word-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}

.audit-inspect-empty {
  padding: 16px;
  color: #64748b;
  font-size: 13px;
}

tr.audit-row-clickable {
  cursor: pointer;
}

.cell-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
}

.cell-modal-close {
  border: none;
  background: #f1f5f9;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.cell-modal-body {
  margin: 0;
  padding: 16px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  flex: 1;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-overlay.hidden {
  display: none;
}

.login-box {
  background: var(--panel);
  border-radius: 14px;
  padding: 28px 32px;
  width: min(380px, 100%);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-box h2 {
  margin: 0;
  font-size: 20px;
}

.login-sub {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.login-box input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}

.login-box button[type="submit"] {
  border: none;
  background: var(--martin);
  color: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.login-error {
  margin: 0;
  font-size: 12px;
  color: #dc2626;
}

.user-badge {
  padding: 4px 12px 8px;
  font-size: 11px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.logout-btn {
  margin-left: auto;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
  color: var(--muted);
}

.martin-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.martin-header-text {
  flex: 1;
  min-width: 0;
}

/* Marlon IDE — гаечный ключ (не путать с ⚙ AI Config) */
.ide-open-btn {
  margin-left: auto;
  margin-right: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--muted);
  transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease;
  flex-shrink: 0;
}
.ide-open-btn:hover {
  color: var(--accent, #2563eb);
  background: var(--accent-soft, #eff6ff);
  border-color: #bfdbfe;
}
.ide-open-btn:active {
  transform: scale(0.96);
}
.ide-open-wrench {
  display: block;
}

.chat-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.chat-drawer-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.chat-drawer-config {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}
.chat-drawer-config:hover {
  color: var(--accent, #2563eb);
  background: var(--accent-soft, #eff6ff);
}

.chat-sessions-bar--hidden {
  display: none !important;
}

.chat-list-toggle {
  margin-left: 0;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  flex-shrink: 0;
}

.chat-list-toggle:hover,
.chat-list-toggle.open {
  border-color: var(--martin);
  color: var(--martin);
  background: var(--martin-soft);
}

.martin-logout {
  margin-left: 0;
}

.chat-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(240px, 88vw);
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 24px rgba(15, 23, 42, 0.12);
  transform: translateX(100%);
  transition: transform 0.22s ease;
  pointer-events: none;
}

.chat-drawer.open {
  transform: translateX(0);
  pointer-events: auto;
}

.chat-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-drawer-close {
  border: none;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 2px 6px;
  border-radius: 6px;
}

.chat-drawer-close:hover {
  color: var(--text);
  background: var(--bg);
}

.chat-drawer-new {
  margin: 10px 10px 6px;
  border: 1px dashed var(--martin);
  background: var(--martin-soft);
  color: var(--martin);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  flex-shrink: 0;
}

.chat-drawer-new:hover {
  background: #ede9fe;
}

.chat-drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-drawer-item {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-radius: 10px;
  border: 1px solid transparent;
  overflow: hidden;
}

.chat-drawer-item.active {
  border-color: var(--martin);
  background: var(--martin-soft);
}

.chat-drawer-item-btn {
  flex: 1;
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 10px;
  cursor: pointer;
  min-width: 0;
}

.chat-drawer-item-title {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-drawer-item-meta {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}

.chat-drawer-item.active .chat-drawer-item-title {
  color: var(--martin);
}

.chat-drawer-item-del {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  padding: 0 10px;
  cursor: pointer;
  flex-shrink: 0;
}

.chat-drawer-item-del:hover {
  color: #dc2626;
  background: #fee2e2;
}

.chat-drawer-empty {
  margin: 12px 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.chat-sessions-bar {
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-shrink: 0;
}

.chat-tab {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
  color: var(--muted);
}

.chat-tab.active {
  border-color: var(--martin);
  background: var(--martin-soft);
  color: var(--martin);
  font-weight: 600;
}

.chat-tab.add {
  color: var(--martin);
  font-weight: 700;
}

.chat-tab-wrap {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border-radius: 999px;
  padding-right: 2px;
  background: transparent;
}

.chat-tab-wrap.active {
  background: var(--martin-soft);
}

.chat-tab-del {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
  border-radius: 999px;
}

.chat-tab-del:hover {
  color: #dc2626;
  background: #fee2e2;
}

#appShell.app-locked {
  filter: blur(4px);
  pointer-events: none;
}

#appShell.app-bootstrapping {
  pointer-events: none;
}

#appShell.app-bootstrapping::after {
  content: 'Загружаю чаты и таблицы…';
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.25);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  pointer-events: none;
}

.audit-contracts-btn {
  margin-left: auto;
  margin-right: 2px;
  font-size: 16px;
}

.settings-btn {
  margin-left: 0;
  margin-right: 4px;
  font-size: 15px;
}

.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.settings-modal.hidden {
  display: none;
}

.settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.settings-box {
  position: relative;
  width: min(920px, 100%);
  max-height: min(88vh, 900px);
  background: var(--panel);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.settings-head h2 {
  margin: 0;
  font-size: 18px;
}

.settings-close {
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  color: var(--muted);
}

.settings-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.settings-tab {
  border: none;
  background: transparent;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
}

.settings-tab.active {
  background: #e0e7ff;
  color: #312e81;
  font-weight: 600;
}

.settings-body {
  flex: 1;
  overflow: auto;
  padding: 14px 18px;
}

.settings-pane {
  display: none;
}

.settings-pane.active {
  display: block;
}

.settings-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin: 10px 0 6px;
}

.settings-textarea,
.settings-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}

.settings-textarea {
  resize: vertical;
  min-height: 80px;
}

.settings-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
}

.settings-btn-primary {
  border: none;
  background: #4f46e5;
  color: #fff;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
}

.settings-btn-primary:hover {
  background: #4338ca;
}

.settings-btn-danger {
  padding: 8px 14px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff;
  color: #b91c1c;
  font-size: 13px;
  cursor: pointer;
}

.settings-btn-danger:hover {
  background: #fef2f2;
}

.text-file-preview {
  margin: 0;
  padding: 16px 20px;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
  height: 100%;
  box-sizing: border-box;
  color: #0f172a;
  background: #fff;
}

.docx-document-wrap {
  overflow: auto;
  height: 100%;
  box-sizing: border-box;
  padding: 20px 28px 40px;
  background: #fff;
  color: #0f172a;
}

.docx-document {
  max-width: 820px;
  margin: 0 auto;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

.docx-document h1,
.docx-document h2,
.docx-document h3,
.docx-document h4,
.docx-document h5,
.docx-document h6 {
  margin: 1.25em 0 0.5em;
  line-height: 1.25;
  color: #0f172a;
}

.docx-document h1 { font-size: 1.6rem; }
.docx-document h2 { font-size: 1.35rem; }
.docx-document h3 { font-size: 1.15rem; }

.docx-document p,
.docx-document li {
  margin: 0.45em 0;
}

.docx-document .docx-table,
.docx-document table.docx-table {
  table-layout: fixed;
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 13px;
}

.docx-document .docx-table th,
.docx-document .docx-table td {
  border: 1px solid #cbd5e1;
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}

.docx-document .docx-table th {
  background: #f1f5f9;
  font-weight: 600;
}

/* Word parse preview (word_document_parse.js emits word-* classes) */
.docx-document-wrap .word-doc-preview {
  max-width: 820px;
  margin: 0 auto;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

.docx-document-wrap .word-doc-preview .word-p {
  margin: 0.45em 0;
}

.docx-document-wrap .word-table,
.docx-document-wrap table.word-table {
  table-layout: fixed;
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 13px;
}

.docx-document-wrap .word-table th,
.docx-document-wrap .word-table td {
  border: 1px solid #cbd5e1;
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}

.docx-document-wrap .word-table th {
  background: #f1f5f9;
  font-weight: 600;
  position: relative;
}

.docx-document-wrap .word-table th::after,
.docx-document .docx-table th::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  cursor: col-resize;
}

.settings-status {
  font-size: 12px;
  color: var(--muted);
}

.settings-split {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px;
  min-height: 360px;
}

.settings-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: auto;
  max-height: 420px;
}

.settings-list-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
}

.settings-list-item.active {
  background: #eef2ff;
}

.settings-detail {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  overflow: auto;
}

.settings-hint {
  color: var(--muted);
  font-size: 13px;
}

.settings-simulate {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.settings-simulate-out {
  margin-top: 8px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
  white-space: pre-wrap;
  max-height: 180px;
  overflow: auto;
}

.settings-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.settings-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.ai-config-box {
  width: min(1080px, 100%);
}

.ai-config-tabs {
  flex-wrap: wrap;
}

.ai-catalog-wrap {
  max-height: 480px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.ai-catalog-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.ai-catalog-table th,
.ai-catalog-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.ai-catalog-table th {
  background: #f8fafc;
  position: sticky;
  top: 0;
}

.ai-catalog-open {
  border: none;
  background: #eef2ff;
  color: #3730a3;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 11px;
}

.settings-btn-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}

.audit-contracts-box {
  width: min(980px, 100%);
}

.audit-contracts-split {
  grid-template-columns: 260px 1fr;
  min-height: 420px;
}

.audit-contracts-list-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.audit-contracts-list-item.active {
  background: #eef2ff;
}

.audit-contracts-list-item .ac-trigger {
  display: block;
  font-weight: 600;
  font-size: 13px;
  color: #1e1b4b;
}

.audit-contracts-list-item .ac-desc {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.audit-contracts-list-item .ac-meta {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #94a3b8;
}

.ocr-prompt-badge {
  display: inline-block;
  margin-top: 4px;
  margin-right: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 10px;
  background: #e2e8f0;
  color: #475569;
}

.ocr-prompt-badge.editable {
  background: #dcfce7;
  color: #166534;
}

.ocr-prompt-source {
  margin: 8px 0 10px;
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}

.ac-readonly-banner {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 12px;
}

.ac-tables-preview {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.ac-tables-preview h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

.ac-table-card {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}

.ac-table-card:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.ac-table-card .ac-table-name {
  font-weight: 600;
  font-size: 13px;
}

.ac-table-card .ac-table-meta {
  font-size: 11px;
  color: var(--muted);
  margin: 2px 0 6px;
}

.ac-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  background: #fff;
}

.ac-mini-table th,
.ac-mini-table td {
  border: 1px solid var(--border);
  padding: 3px 6px;
  text-align: left;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ac-mini-table th {
  background: #e2e8f0;
}

.ac-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 16px 12px;
}

.ac-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  vertical-align: middle;
}

.ac-badge-parsing {
  background: #dbeafe;
  color: #1e40af;
}

/* ── Marlon IDE dock (thumbs-down → Grok) ───────────────── */
.grok-fix-dock {
  --grok-dock-width: min(820px, 46vw);
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 10050;
  display: flex;
  align-items: stretch;
  pointer-events: none;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
}
.grok-fix-dock.hidden { display: none !important; }
.grok-fix-dock:not(.hidden) { pointer-events: auto; }

.grok-fix-dock-tab {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 44px;
  margin-top: 72px;
  height: fit-content;
  padding: 14px 8px;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 12px 0 0 12px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  color: var(--muted);
  box-shadow: -4px 0 24px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.grok-fix-dock-tab:hover {
  color: var(--accent);
  border-color: #bfdbfe;
  background: rgba(239, 246, 255, 0.95);
}
.grok-fix-dock-tab .grok-fix-wrench-icon { width: 18px; height: 18px; }

.grok-fix-dock.grok-fix-collapsed .grok-fix-panel {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}
.grok-fix-dock.grok-fix-collapsed .grok-fix-dock-tab { display: flex; }

.grok-fix-panel {
  width: var(--grok-dock-width);
  min-width: 420px;
  max-width: 920px;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(24px) saturate(180%);
  color: var(--text);
  border-left: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: -12px 0 48px rgba(15, 23, 42, 0.1);
  overflow: hidden;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.24s ease;
}

.grok-fix-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(248, 250, 252, 0.85);
  flex-shrink: 0;
}
.grok-fix-head-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.grok-fix-head-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}
.grok-fix-head strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.grok-fix-sub {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  letter-spacing: 0.01em;
}
.grok-fix-head-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
}
.grok-fix-learn-btn {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  line-height: 1.2;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.grok-fix-learn-btn:hover:not(:disabled) {
  background: #dbeafe;
  border-color: #93c5fd;
}
.grok-fix-learn-btn.is-active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}
.grok-fix-learn-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.grok-fix-learn-btn--footer {
  font-size: 12px;
  padding: 6px 10px;
}
.grok-fix-reextract {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: rgba(236, 253, 245, 0.9);
  flex-shrink: 0;
}
.grok-fix-reextract.hidden { display: none; }
.grok-fix-reextract-btn {
  border: none;
  background: #059669;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}
.grok-fix-reextract-btn:hover { filter: brightness(1.06); }
.grok-fix-reextract-hint {
  font-size: 11px;
  color: #047857;
}
.grok-fix-icon-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, color 0.12s ease;
}
.grok-fix-icon-btn:hover {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text);
}
.grok-fix-icon-btn:active { transform: scale(0.96); }

.grok-fix-context-drawer {
  border-bottom: 1px solid var(--border);
  padding: 10px 14px 12px;
  background: rgba(248, 250, 252, 0.6);
  max-height: 180px;
  overflow: auto;
}
.grok-fix-context-drawer.hidden { display: none; }
.grok-fix-context-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
}
.grok-fix-context-drawer pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 11px;
  line-height: 1.45;
  color: #475569;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}

.grok-fix-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 220px;
  scroll-behavior: smooth;
}

.grok-fix-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex: 1;
  min-height: 200px;
  padding: 24px 16px;
  color: var(--muted);
  font-size: 14px;
}
.grok-fix-loading.hidden { display: none !important; }
.grok-fix-panel.grok-fix-session-loading .grok-fix-msgs {
  display: none;
}
.grok-fix-loading-spin {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(37, 99, 235, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: grok-attach-spin 0.75s linear infinite;
}
.grok-fix-status[data-kind="info"]::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  vertical-align: -2px;
  border: 2px solid rgba(37, 99, 235, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: grok-attach-spin 0.75s linear infinite;
}
.grok-fix-panel:not(.grok-fix-session-loading) .grok-fix-status[data-kind="info"]::before {
  display: none;
}

.grok-fix-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  white-space: normal;
  word-break: break-word;
  letter-spacing: 0.005em;
}
.grok-fix-msg strong {
  font-weight: 700;
  color: #0f172a;
  background: rgba(59, 130, 246, 0.14);
  padding: 0 3px;
  border-radius: 3px;
}
.grok-fix-msg em {
  font-style: italic;
  color: #334155;
}
.grok-fix-msg .msg-h2,
.grok-fix-msg .msg-h3 {
  display: block;
  font-weight: 700;
  color: #0f172a;
  margin: 2px 0 4px;
  line-height: 1.35;
}
.grok-fix-msg .msg-inline-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
  padding: 1px 5px;
  border-radius: 4px;
}
.grok-fix-msg .msg-code {
  display: block;
  margin: 6px 0;
  padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.4;
  background: rgba(15, 23, 42, 0.06);
  border-radius: 8px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.grok-fix-msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.grok-fix-msg.user strong {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.grok-fix-msg.user .msg-inline-code,
.grok-fix-msg.user .msg-code {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.grok-fix-msg.assistant {
  align-self: flex-start;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.grok-fix-status {
  padding: 8px 16px;
  font-size: 12px;
  border-top: 1px solid var(--border);
  background: rgba(248, 250, 252, 0.9);
  color: var(--muted);
  flex-shrink: 0;
}
.grok-fix-status[data-kind="ok"] { color: #059669; }
.grok-fix-status[data-kind="err"] { color: #dc2626; }
.grok-fix-status[data-kind="info"] { color: var(--accent); }

.grok-fix-composer {
  border-top: 1px solid var(--border);
  padding: 12px 14px 14px;
  background: rgba(255, 255, 255, 0.95);
  flex-shrink: 0;
}

.grok-fix-attach-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  padding: 2px 0;
}
.grok-fix-attach-strip.hidden { display: none; }

.grok-fix-attach-chip {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #f8fafc;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  flex-shrink: 0;
}
.grok-fix-attach-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.grok-fix-attach-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.12s ease, transform 0.1s ease;
}
.grok-fix-attach-remove:hover {
  background: rgba(220, 38, 38, 0.92);
}
.grok-fix-attach-remove:active { transform: scale(0.94); }

.grok-fix-attach-chip.is-uploading img {
  opacity: 0.72;
}
.grok-fix-attach-chip.is-error {
  border-color: #fca5a5;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.12);
}
.grok-fix-attach-err {
  position: absolute;
  bottom: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.grok-fix-attach-busy {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.35);
  pointer-events: none;
}
.grok-fix-attach-busy::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(37, 99, 235, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: grok-attach-spin 0.7s linear infinite;
}
@keyframes grok-attach-spin {
  to { transform: rotate(360deg); }
}

.grok-fix-composer-shell {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.grok-fix-composer-shell:focus-within {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.grok-fix-composer-shell textarea {
  flex: 1;
  resize: none;
  min-height: 44px;
  max-height: 160px;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 6px 2px;
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
}
.grok-fix-composer-shell textarea:focus { outline: none; }
.grok-fix-send {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: filter 0.12s ease, transform 0.1s ease;
}
.grok-fix-send:hover { filter: brightness(1.06); }
.grok-fix-send:active { transform: scale(0.96); }
.grok-fix-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.grok-fix-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  padding: 0 2px;
}
.grok-fix-attach {
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  background: #fff;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.grok-fix-attach:hover {
  border-color: #bfdbfe;
  color: var(--accent);
}
.grok-fix-attach.disabled {
  opacity: 0.45;
  pointer-events: none;
}
.grok-fix-hint {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
}

/* Compact AI work stream inside IDE chat — only while job runs (no empty black strip) */
.grok-fix-stream-host {
  flex-shrink: 0;
  padding: 0 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.grok-fix-stream-host.hidden {
  display: none !important;
}
.grok-fix-stream {
  /* Slightly narrower than assistant bubbles (max-width: 88%) */
  width: 82%;
  max-width: 82%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0f172a;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}
.grok-fix-stream-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  background: rgba(2, 6, 23, 0.55);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  user-select: none;
}
.grok-fix-stream-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.45);
  animation: grok-stream-pulse 1.4s ease-out infinite;
  flex-shrink: 0;
}
.grok-fix-stream.is-done .grok-fix-stream-dot {
  background: #64748b;
  box-shadow: none;
  animation: none;
}
.grok-fix-stream.is-done .grok-fix-stream-label {
  color: #64748b;
}
@keyframes grok-stream-pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.45); }
  70% { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
.grok-fix-stream-body {
  margin: 0;
  /* Exactly ~5 lines of mono stream */
  height: calc(1.4em * 5);
  max-height: calc(1.4em * 5);
  overflow: auto;
  padding: 6px 10px 8px;
  background: transparent;
  color: #86efac;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
/* Legacy class kept empty so old cached markup cannot paint a full-width black bar */
.grok-fix-term-wrap,
.grok-fix-term {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .grok-fix-dock,
  .grok-fix-panel {
    transition: opacity 0.2s ease;
  }
  .grok-fix-dock.grok-fix-collapsed .grok-fix-panel {
    transform: none;
  }
}

@media (max-width: 900px) {
  .grok-fix-dock { --grok-dock-width: min(100vw, 100%); }
  .grok-fix-panel { min-width: 0; width: 100vw; }
}

/* ── Parse Learn Studio (3-panel training window) ───────── */
.learn-studio {
  position: fixed;
  inset: 0;
  z-index: 10100;
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
}
.learn-studio.hidden { display: none !important; }

.learn-studio-shell {
  display: flex;
  flex-direction: column;
  margin: 18px;
  flex: 1;
  min-height: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.learn-studio-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.learn-studio-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.learn-studio-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #dbeafe 0%, #eff6ff 100%);
  color: #1d4ed8;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}
.learn-studio-brand strong {
  display: block;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #0f172a;
}
.learn-studio-brand small {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}
.learn-studio-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.learn-studio-more {
  position: relative;
}
.learn-studio-more > summary {
  list-style: none;
  cursor: pointer;
}
.learn-studio-more > summary::-webkit-details-marker { display: none; }
.learn-studio-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  padding: 6px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  z-index: 5;
}
.learn-studio-more-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
}
.learn-studio-more-menu button:hover:not(:disabled) {
  background: #f1f5f9;
  color: #1d4ed8;
}
.learn-studio-more-menu button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.learn-studio-btn {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, opacity 0.12s ease, transform 0.12s ease;
}
.learn-studio-btn:hover:not(:disabled) {
  background: #dbeafe;
  border-color: #93c5fd;
}
.learn-studio-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.learn-studio-btn-primary {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}
.learn-studio-btn-primary:hover:not(:disabled) {
  background: #1e40af;
  border-color: #1e40af;
  color: #fff;
}
.learn-studio-btn-success {
  background: #059669;
  border-color: #059669;
  color: #fff;
}
.learn-studio-btn-success:hover:not(:disabled) {
  filter: brightness(1.06);
  color: #fff;
}
.learn-studio-btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  padding: 4px 8px;
}
.learn-studio-btn-ghost:hover:not(:disabled) {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text);
}

.learn-studio-steps {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-shrink: 0;
}
.learn-studio-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}
.learn-studio-step:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.learn-studio-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: #e2e8f0;
  color: #475569;
}
.learn-studio-step.is-done {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.learn-studio-step.is-done .learn-studio-step-num {
  background: #059669;
  color: #fff;
}
.learn-studio-step.is-active {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}
.learn-studio-step.is-active .learn-studio-step-num {
  background: #1d4ed8;
  color: #fff;
}
.learn-studio-step-sep {
  width: 18px;
  height: 2px;
  background: #e2e8f0;
  flex-shrink: 0;
  border-radius: 1px;
}

.learn-studio-ready {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.learn-studio-ready-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e2e8f0;
}
.learn-studio-ready-item.is-on {
  color: #047857;
  border-color: #a7f3d0;
  background: #ecfdf5;
}
.learn-studio-ready-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
}
.learn-studio-ready-item.is-on .learn-studio-ready-dot {
  background: #059669;
}
.learn-studio-ready-hint {
  margin-left: auto;
  font-size: 11px;
  color: #64748b;
}

.learn-studio-body {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(360px, 1.6fr) minmax(220px, 1fr);
  gap: 0;
  flex: 1;
  min-height: 0;
  background: #fff;
}

.learn-studio-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--border);
  transition: box-shadow 0.25s ease, background 0.25s ease;
}
.learn-studio-col:last-child { border-right: none; }
.learn-studio-col.is-focused {
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.35);
  background: #f8fbff;
}
.learn-studio-col-chat {
  background: linear-gradient(180deg, #fafbfc 0%, #fff 40%);
}

.learn-studio-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  flex-shrink: 0;
}
.learn-studio-col-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.learn-studio-col-badge {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: #e2e8f0;
  color: #334155;
}
.learn-studio-col-chat .learn-studio-col-badge {
  background: #dbeafe;
  color: #1d4ed8;
}
.learn-studio-col-head span {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.learn-studio-drop {
  margin: 12px;
  padding: 20px 14px 16px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
}
.learn-studio-drop:hover,
.learn-studio-drop.is-dragover {
  border-color: #60a5fa;
  background: #eff6ff;
  transform: translateY(-1px);
}
.learn-studio-drop-icon {
  font-size: 22px;
  line-height: 1;
  margin-bottom: 8px;
  opacity: 0.9;
}
.learn-studio-drop strong {
  display: block;
  font-size: 13px;
  color: #1e293b;
  margin-bottom: 4px;
}
.learn-studio-drop small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  max-width: 240px;
  margin: 0 auto;
}
.learn-studio-drop-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
  flex-wrap: wrap;
}
.learn-studio-drop-actions button {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  min-height: 32px;
}
.learn-studio-drop-actions button:hover {
  border-color: #93c5fd;
  color: #1d4ed8;
}

.learn-studio-welcome {
  align-self: stretch !important;
  max-width: 100% !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0;
  border-radius: 14px !important;
  padding: 14px 16px !important;
  color: #0f172a !important;
  white-space: normal !important;
}
.learn-studio-welcome-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.learn-studio-welcome-steps {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  line-height: 1.4;
  color: #334155;
}
.learn-studio-welcome-steps li.done {
  color: #047857;
}
.learn-studio-welcome-steps li.done b::before {
  content: '✓ ';
}
.learn-studio-welcome-note {
  margin: 12px 0 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

.learn-studio-status[data-kind="err"] {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}
.learn-studio-status[data-kind="ok"] {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.learn-studio-file-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.learn-studio-file {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}
.learn-studio-file-main {
  flex: 1;
  min-width: 0;
}
.learn-studio-file-name {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
  word-break: break-word;
}
.learn-studio-file-meta {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.learn-studio-kind {
  display: inline-flex;
  align-items: center;
  margin-top: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: #e2e8f0;
  color: #334155;
}
.learn-studio-kind[data-kind="pdf_unknown"],
.learn-studio-kind[data-kind="pdf_text"],
.learn-studio-kind[data-kind="pdf_scan"] { background: #fee2e2; color: #b91c1c; }
.learn-studio-kind[data-kind="excel"] { background: #dcfce7; color: #166534; }
.learn-studio-kind[data-kind="text_1c"] { background: #e0e7ff; color: #3730a3; }
.learn-studio-kind[data-kind="html"] { background: #ffedd5; color: #c2410c; }
.learn-studio-kind[data-kind="xml"] { background: #f3e8ff; color: #6b21a8; }
.learn-studio-kind[data-kind="word"] { background: #dbeafe; color: #1d4ed8; }
.learn-studio-kind[data-kind="scan_image"] { background: #fce7f3; color: #9d174d; }
.learn-studio-file-remove {
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}
.learn-studio-file-remove:hover { color: #dc2626; }
.learn-studio-empty {
  padding: 16px 8px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.learn-studio-summary {
  margin: 0 12px 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  font-size: 11px;
  color: #475569;
  line-height: 1.4;
  flex-shrink: 0;
}

.learn-studio-msgs {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.learn-studio-msg {
  max-width: 92%;
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.learn-studio-msg.user {
  align-self: flex-end;
  background: #1d4ed8;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.learn-studio-msg.assistant,
.learn-studio-msg.bot {
  align-self: flex-start;
  background: #f1f5f9;
  color: #0f172a;
  border-bottom-left-radius: 4px;
}
.learn-studio-msg.system {
  align-self: center;
  max-width: 100%;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.learn-studio-stream {
  margin: 0 12px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  max-height: 140px;
  overflow: auto;
  flex-shrink: 0;
}
.learn-studio-stream.hidden { display: none; }
.learn-studio-stream pre {
  margin: 0;
  padding: 8px 10px;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.learn-studio-status {
  margin: 0 12px 8px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  flex-shrink: 0;
}
.learn-studio-status.hidden { display: none; }
.learn-studio-status[data-kind="ok"] { background: #ecfdf5; color: #047857; }
.learn-studio-status[data-kind="err"] { background: #fef2f2; color: #b91c1c; }
.learn-studio-status[data-kind="info"] { background: #eff6ff; color: #1d4ed8; }

.learn-studio-composer {
  border-top: 1px solid var(--border);
  padding: 10px 12px 12px;
  background: #fff;
  flex-shrink: 0;
}
.learn-studio-composer-shell {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.learn-studio-composer textarea {
  flex: 1;
  min-height: 56px;
  max-height: 140px;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  background: #f8fafc;
}
.learn-studio-composer textarea:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.learn-studio-send {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: #1d4ed8;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.learn-studio-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.learn-studio-composer-hint {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .learn-studio-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(160px, 0.7fr) minmax(280px, 1.4fr) minmax(160px, 0.7fr);
    overflow: auto;
  }
  .learn-studio-col {
    border-right: none;
    border-bottom: 1px solid var(--border);
    min-height: 180px;
  }
  .learn-studio-shell { margin: 8px; }
}


/* parse-train (from prod master) */
.parse-train-shell {
  --pt-bg: #f4f6fa;
  --pt-card: #ffffff;
  --pt-border: #d8dee8;
  --pt-text: #1a2332;
  --pt-muted: #5a6578;
  --pt-accent: #3b6fd4;
  --pt-accent-soft: rgba(59, 111, 212, 0.1);
  --pt-green: #1a9f63;
  --pt-amber: #c48800;
  --pt-red: #d64550;
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  flex-direction: column;
  background: var(--pt-bg);
  color: var(--pt-text);
  font-family: inherit;
}
.parse-train-shell.hidden {
  display: none !important;
}
body.parse-train-open {
  overflow: hidden;
}
body.parse-train-open .grok-fix-dock {
  /* keep dock under train shell; do not destroy state */
  z-index: 1000;
}

.parse-train-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: var(--pt-card);
  border-bottom: 1px solid var(--pt-border);
  flex-shrink: 0;
}
.parse-train-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.parse-train-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b6fd4, #6d5bb8);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.parse-train-brand strong {
  display: block;
  font-size: 15px;
}
.parse-train-brand small {
  display: block;
  font-size: 12px;
  color: var(--pt-muted);
  margin-top: 2px;
}
.parse-train-top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.parse-train-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(59, 111, 212, 0.35);
  background: var(--pt-accent);
  color: #fff;
  cursor: pointer;
}
.parse-train-btn:hover {
  filter: brightness(1.05);
}
.parse-train-btn.ghost {
  background: #fff;
  color: var(--pt-muted);
  border-color: var(--pt-border);
}
.parse-train-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

.parse-train-cjm {
  display: flex;
  gap: 0;
  overflow-x: auto;
  background: var(--pt-card);
  border-bottom: 1px solid var(--pt-border);
  padding: 0 8px;
  flex-shrink: 0;
}
.parse-train-cjm-step {
  flex: 1;
  min-width: 108px;
  padding: 10px 8px 12px;
  border: none;
  background: none;
  font: inherit;
  font-size: 11px;
  color: #8b95a8;
  cursor: pointer;
  text-align: left;
  border-bottom: 2px solid transparent;
}
.parse-train-cjm-step .n {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #eef1f6;
  font-size: 10px;
  font-weight: 700;
  margin-right: 4px;
}
.parse-train-cjm-step .lab {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: inherit;
}
.parse-train-cjm-step.active {
  color: var(--pt-accent);
  border-bottom-color: var(--pt-accent);
}
.parse-train-cjm-step.active .n {
  background: var(--pt-accent-soft);
  color: var(--pt-accent);
}
.parse-train-cjm-step.done {
  color: var(--pt-green);
}
.parse-train-cjm-step.done .n {
  background: rgba(26, 159, 99, 0.12);
  color: var(--pt-green);
}

.parse-train-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px 18px 24px;
}
.parse-train-status {
  flex-shrink: 0;
  margin: 0 18px 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  background: var(--pt-accent-soft);
  border: 1px solid rgba(59, 111, 212, 0.25);
  color: #2a4f9e;
}
.parse-train-status.err {
  background: rgba(214, 69, 80, 0.1);
  border-color: rgba(214, 69, 80, 0.28);
  color: #a32d36;
}
.parse-train-status.ok {
  background: rgba(26, 159, 99, 0.12);
  border-color: rgba(26, 159, 99, 0.28);
  color: #0f6b42;
}

.parse-train-card {
  background: var(--pt-card);
  border: 1px solid var(--pt-border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(20, 30, 50, 0.05);
}
.parse-train-h2 {
  font-size: 16px;
  font-weight: 650;
  margin: 0 0 6px;
}
.parse-train-muted {
  color: var(--pt-muted);
  font-size: 13px;
  margin: 0 0 12px;
}
.parse-train-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--pt-border);
}
.parse-train-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.parse-train-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.15fr);
  gap: 12px;
  min-height: calc(100vh - 200px);
}
@media (max-width: 960px) {
  .parse-train-grid2,
  .parse-train-workspace {
    grid-template-columns: 1fr;
  }
}
.parse-train-chat {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--pt-border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  min-height: 380px;
  max-height: calc(100vh - 210px);
}
.parse-train-chat-head {
  padding: 10px 12px;
  background: #eef1f6;
  border-bottom: 1px solid var(--pt-border);
  font-size: 12px;
  color: var(--pt-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.parse-train-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.parse-train-bubble {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
}
.parse-train-bubble.user {
  align-self: flex-end;
  background: #e8f0fc;
  border: 1px solid rgba(59, 111, 212, 0.22);
}
.parse-train-bubble.bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--pt-border);
}
.parse-train-bubble .who {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8b95a8;
  margin-bottom: 4px;
  font-weight: 650;
}
.parse-train-chat-input {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--pt-border);
  background: #fafbfc;
}
.parse-train-chat-input input {
  flex: 1;
  border: 1px solid var(--pt-border);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
}
.parse-train-preview {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--pt-border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  min-height: 380px;
  max-height: calc(100vh - 210px);
}
.parse-train-tabs {
  display: flex;
  flex-wrap: wrap;
  background: #eef1f6;
  border-bottom: 1px solid var(--pt-border);
}
.parse-train-tabs button {
  font: inherit;
  font-size: 12px;
  padding: 10px 12px;
  border: none;
  background: none;
  color: #8b95a8;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.parse-train-tabs button.on {
  color: var(--pt-accent);
  border-bottom-color: var(--pt-accent);
  font-weight: 600;
}
.parse-train-preview-body {
  flex: 1;
  overflow: auto;
  padding: 12px;
}
.parse-train-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  font-family: ui-monospace, Consolas, monospace;
}
.parse-train-table th,
.parse-train-table td {
  border: 1px solid var(--pt-border);
  padding: 6px 8px;
  text-align: left;
}
.parse-train-table th {
  background: #eef1f6;
  color: var(--pt-muted);
}
.parse-train-table tr.miss td {
  background: rgba(214, 69, 80, 0.08);
}
.parse-train-doc {
  font-size: 13px;
  line-height: 1.55;
  padding: 8px;
}
.parse-train-doc h3 {
  margin: 0 0 10px;
  font-size: 15px;
}
.parse-train-doc p {
  margin: 0 0 10px;
  color: var(--pt-muted);
}
.parse-train-alert {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin: 10px 0;
}
.parse-train-alert.bad {
  background: rgba(214, 69, 80, 0.1);
  border: 1px solid rgba(214, 69, 80, 0.28);
  color: #a32d36;
}
.parse-train-alert.ok {
  background: rgba(26, 159, 99, 0.12);
  border: 1px solid rgba(26, 159, 99, 0.28);
  color: #0f6b42;
}
.parse-train-alert.warn {
  background: rgba(196, 136, 0, 0.12);
  border: 1px solid rgba(196, 136, 0, 0.28);
  color: #8a6200;
}
.parse-train-chip {
  display: inline-block;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--pt-border);
  background: #eef1f6;
  color: var(--pt-muted);
  cursor: pointer;
  margin: 0 6px 6px 0;
  font: inherit;
}
.parse-train-chip.on {
  background: var(--pt-accent-soft);
  border-color: rgba(59, 111, 212, 0.35);
  color: var(--pt-accent);
  font-weight: 600;
}
.parse-train-file {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--pt-border);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  background: #fafbfc;
}
.parse-train-file .ext {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--pt-accent-soft);
  color: var(--pt-accent);
}
.parse-train-score {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 6px;
}
.parse-train-score .id {
  width: 130px;
  font-family: ui-monospace, Consolas, monospace;
  color: var(--pt-accent);
}
.parse-train-score .track {
  flex: 1;
  height: 8px;
  background: #eef1f6;
  border-radius: 4px;
  overflow: hidden;
}
.parse-train-score .fill {
  height: 100%;
  background: linear-gradient(90deg, #3b6fd4, #6d5bb8);
}
.parse-train-input {
  width: 100%;
  border: 1px solid var(--pt-border);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  box-sizing: border-box;
}
.parse-train-check {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--pt-border);
  font-size: 13px;
}
.parse-train-check .ic {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.parse-train-check .ic.pass {
  background: rgba(26, 159, 99, 0.12);
  color: var(--pt-green);
}
.parse-train-check .ic.fail {
  background: rgba(214, 69, 80, 0.1);
  color: var(--pt-red);
}
.parse-train-check .ic.warn {
  background: rgba(196, 136, 0, 0.12);
  color: var(--pt-amber);
}

/* ---- Проекты / чаты: компактные действия строк, inline-edit, confirm ---- */
.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.project-group-head:hover .row-actions,
.project-audit:hover .row-actions,
.project-group-head:focus-within .row-actions,
.project-audit:focus-within .row-actions,
.project-group-head.active .row-actions,
.project-audit.active .row-actions {
  opacity: 1;
}
.row-action-btn {
  width: 24px;
  height: 24px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.row-action-btn:hover,
.row-action-btn:focus-visible {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: #bfdbfe;
  outline: none;
}
.row-action-btn.danger:hover,
.row-action-btn.danger:focus-visible {
  color: #c0392b;
  background: #fdecea;
  border-color: #f5b7b1;
}
.row-action-btn:disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

.project-group-head.project-row {
  cursor: default;
  padding: 6px 6px 6px 4px;
}
.project-group-head.project-row .proj-name {
  flex: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
}
.project-group-head.project-row .proj-name:hover {
  color: var(--accent);
}
.project-chev {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.project-group.is-current > .project-group-head .proj-name {
  color: var(--accent);
}

.project-audit.chat-row {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px 6px 6px 10px;
}
.project-audit.chat-row .chat-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-audit.project-new-chat {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  padding: 5px 6px 5px 10px;
}
.project-audit.project-new-chat:hover {
  color: var(--accent);
  background: var(--accent-soft);
}
.project-audit.project-new-chat:disabled {
  opacity: 0.5;
  cursor: default;
}
.project-new-chat-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  border: 1px dashed currentColor;
  border-radius: 4px;
}

.inline-edit {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.inline-edit-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 12px;
  padding: 3px 6px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  outline: none;
  background: #fff;
  color: var(--text);
}
.inline-edit-input.invalid {
  border-color: #c0392b;
  background: #fff5f5;
}
.inline-edit.is-busy {
  opacity: 0.6;
}
.inline-edit .inline-edit-ok {
  color: #15803d;
}
.inline-edit .inline-edit-ok:hover {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
}
.project-group-head.is-editing,
.project-audit.is-editing {
  background: var(--accent-soft);
}

.confirm-modal-box {
  width: min(440px, 92vw);
}
.confirm-modal-body {
  margin: 0;
  padding: 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
}
.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 16px 16px;
}
.confirm-btn-cancel,
.confirm-btn-danger,
.confirm-btn-primary {
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
}
.confirm-btn-cancel {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
}
.confirm-btn-cancel:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.confirm-btn-danger {
  border: 1px solid #c0392b;
  background: #c0392b;
  color: #fff;
}
.confirm-btn-danger:hover {
  filter: brightness(1.08);
}
.confirm-btn-primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}
.confirm-btn-primary:hover {
  filter: brightness(1.06);
}
.confirm-btn-danger:disabled,
.confirm-btn-primary:disabled,
.confirm-btn-cancel:disabled {
  opacity: 0.5;
  cursor: default;
}
