:root {
  --primary: #5b21b6;
  --primary-dark: #43148a;
  --primary-light: #ede9fe;
  --accent: #7c3aed;
  --bg: #f6f5fb;
  --surface: #ffffff;
  --surface-2: #f9f8fd;
  --border: #e3e0ee;
  --text: #1f1d2b;
  --text-muted: #64607a;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --code-bg: #fcfcff;
  --shadow: 0 2px 10px rgba(31, 29, 43, 0.06);
  --radius: 10px;
}

/* 8 Bộ giao diện màu kiểu S.Tex */
body.theme-ocean {
  --primary: #0369a1; --primary-dark: #075985; --primary-light: #e0f2fe; --accent: #0284c7;
  --bg: #f3f8fc; --surface-2: #f0f6fb; --border: #d7e6f2;
}
body.theme-emerald {
  --primary: #047857; --primary-dark: #065f46; --primary-light: #d1fae5; --accent: #059669;
  --bg: #f2fbf7; --surface-2: #edf9f3; --border: #ccebd9;
}
body.theme-indigo {
  --primary: #3730a3; --primary-dark: #312e81; --primary-light: #e0e7ff; --accent: #4f46e5;
  --bg: #f5f6fc; --surface-2: #eef0fb; --border: #d8dcf5;
}
body.theme-amber {
  --primary: #b45309; --primary-dark: #92400e; --primary-light: #fef3c7; --accent: #d97706;
  --bg: #fdfaf3; --surface-2: #fbf4e4; --border: #eedcb8;
}
body.theme-bordeaux {
  --primary: #9f1239; --primary-dark: #881337; --primary-light: #ffe4e6; --accent: #be123c;
  --bg: #fdf5f6; --surface-2: #fbecee; --border: #f2d0d6;
}
body.theme-cream {
  --primary: #7c2d12; --primary-dark: #5c1f0c; --primary-light: #ffedd5; --accent: #b45309;
  --bg: #faf6ee; --surface: #fffdf8; --surface-2: #f5efe2; --border: #e6dcc8;
  --text: #2c241b; --text-muted: #756756; --code-bg: #fffcf5;
}
body.theme-dark {
  --primary: #7c3aed; --primary-dark: #5b21b6; --primary-light: #2e1d4d; --accent: #a78bfa;
  --bg: #13131d; --surface: #1b1b29; --surface-2: #232336; --border: #31314a;
  --text: #ecebf5; --text-muted: #a3a0bd; --code-bg: #161623;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--bg); color: var(--text); font-size: 13.5px; overflow: hidden;
}

/* Header & Primary Nav */
.topbar {
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  color: #fff; height: 48px; padding: 0 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  user-select: none; position: relative; z-index: 40;
}
.brand-group { display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 16px; }
.brand-badge {
  background: rgba(255, 255, 255, 0.2); padding: 2px 8px;
  border-radius: 999px; font-size: 11px; font-weight: 600;
}

.dropdown { position: relative; }
.dropdown-btn {
  border: 1px solid rgba(255,255,255,0.22); background: rgba(255,255,255,0.12);
  color: #fff; padding: 5px 10px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 12.5px;
}
.dropdown-btn:hover { background: rgba(255,255,255,0.22); }
.dropdown-menu {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 210px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 12px 28px rgba(0,0,0,0.18); padding: 6px; z-index: 60;
}
.dropdown.open .dropdown-menu { display: flex; flex-direction: column; gap: 2px; }
.dropdown-item {
  border: none; background: transparent; color: var(--text); text-align: left;
  padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 600;
}
.dropdown-item:hover { background: var(--primary-light); color: var(--primary-dark); }
body.theme-dark .dropdown-item:hover { color: #e9d5ff; }

.route-bar {
  background: var(--primary-dark);
  padding: 5px 14px;
  display: flex; align-items: center; gap: 5px; overflow-x: auto;
}
.nav-tab {
  border: none; background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.92);
  padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 12.5px;
  transition: 0.14s ease; white-space: nowrap;
}
.nav-tab:hover { background: rgba(255,255,255,0.22); color: #fff; }
.nav-tab.active { background: #fff; color: var(--primary-dark); }

.status-bar { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.pill {
  background: rgba(255,255,255,0.16); color: #fff; padding: 3px 9px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 5px; font-weight: 500; white-space: nowrap;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; }
.pill.warn .dot { background: #fbbf24; }
.theme-select {
  background: rgba(255,255,255,0.16); color: #fff; border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px; padding: 4px 8px; font-size: 12px; cursor: pointer;
}
.theme-select option { color: #1f1d2b; background: #fff; }

/* Main container */
.app-body { height: calc(100vh - 86px); display: flex; flex-direction: column; }
.view { display: none; height: 100%; overflow: hidden; }
.view.active { display: flex; flex-direction: column; }

/* Buttons & inputs */
.btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 5px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  transition: 0.14s ease; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--surface-2); border-color: var(--accent); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { filter: brightness(0.92); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-soft { background: var(--primary-light); color: var(--primary-dark); border-color: transparent; }
body.theme-dark .btn-soft { color: #e9d5ff; }
.btn-sm { padding: 4px 8px; font-size: 12px; border-radius: 6px; }

.input, .select, .textarea {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 6px 9px; font-size: 13px; outline: none; font-family: inherit;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); }

/* Compose toolbar & Math bar */
.doc-toolbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 7px 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.doc-title-input { width: 165px; font-weight: 700; }
.toolbar-sep { width: 1px; height: 22px; background: var(--border); margin: 0 2px; }

.math-bar {
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  padding: 5px 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
}
.math-chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 3px 7px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.math-chip:hover { border-color: var(--accent); background: var(--primary-light); }
.math-chip.tpl { background: var(--primary-light); color: var(--primary-dark); border-color: transparent; }
body.theme-dark .math-chip.tpl { color: #e9d5ff; }

/* Compose Workspace with Left Vertical Rail + Drawer + Split Editor/Preview */
.compose-shell {
  flex: 1; display: flex; min-height: 0; overflow: hidden;
}

.left-rail {
  width: 58px; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; padding: 6px 4px; gap: 4px;
  user-select: none; flex-shrink: 0;
}
.rail-btn {
  width: 50px; padding: 6px 2px; border: none; background: transparent; color: var(--text-muted);
  border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center;
  gap: 2px; font-size: 10.5px; font-weight: 600;
}
.rail-btn .ico { font-size: 16px; }
.rail-btn:hover { background: var(--surface-2); color: var(--text); }
.rail-btn.active { background: var(--primary-light); color: var(--primary-dark); }
body.theme-dark .rail-btn.active { color: #e9d5ff; }

.rail-drawer {
  width: 245px; background: var(--surface); border-right: 1px solid var(--border);
  display: none; flex-direction: column; min-height: 0; flex-shrink: 0;
}
.rail-drawer.open { display: flex; }
.rail-drawer-head {
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  font-weight: 700; display: flex; justify-content: space-between; align-items: center;
}
.rail-drawer-body { flex: 1; overflow: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }

.drawer-item {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  padding: 7px 9px; border-radius: 8px; cursor: pointer; text-align: left; font-size: 12.5px;
}
.drawer-item:hover { border-color: var(--accent); background: var(--primary-light); }
.drawer-item b { display: block; margin-bottom: 2px; }
.drawer-item small { color: var(--text-muted); font-size: 11px; }

.sym-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.sym-btn {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  padding: 7px 2px; border-radius: 7px; cursor: pointer; font-weight: 700; font-size: 13px;
}
.sym-btn:hover { border-color: var(--accent); background: var(--primary-light); }

/* Split pane */
.split-pane {
  flex: 1; display: grid; grid-template-columns: 1fr 1fr; min-height: 0; overflow: hidden;
}
.editor-pane {
  display: flex; flex-direction: column; border-right: 1px solid var(--border);
  min-height: 0; background: var(--code-bg);
}
.editor-wrap { flex: 1; display: flex; min-height: 0; position: relative; }
.line-gutter {
  width: 44px; padding: 12px 6px 12px 0; text-align: right; white-space: pre;
  font-family: "Cascadia Code", Consolas, monospace; font-size: 13px; line-height: 1.55;
  color: var(--text-muted); background: var(--surface-2); border-right: 1px solid var(--border);
  overflow: hidden; user-select: none;
}
.tex-editor {
  flex: 1; border: none; outline: none; resize: none; padding: 12px 14px;
  font-family: "Cascadia Code", Consolas, "Courier New", monospace;
  font-size: 13.5px; line-height: 1.55; background: var(--code-bg); color: var(--text);
  tab-size: 2; white-space: pre; overflow: auto;
}
.editor-footer {
  padding: 5px 12px; font-size: 12px; color: var(--text-muted);
  background: var(--surface-2); border-top: 1px solid var(--border);
  display: flex; justify-content: space-between;
}

.find-bar {
  display: none; padding: 6px 10px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  gap: 6px; align-items: center; flex-wrap: wrap;
}
.find-bar.open { display: flex; }

/* Preview Pane */
.preview-pane { display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.sub-tabs {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); padding: 0 12px; background: var(--surface);
}
.sub-tabs-left { display: flex; gap: 4px; }
.sub-tab {
  border: none; background: transparent; color: var(--text-muted);
  padding: 9px 11px; font-size: 13px; font-weight: 600; cursor: pointer;
  border-bottom: 2px solid transparent;
}
.sub-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.sub-panel { display: none; flex: 1; min-height: 0; overflow: auto; padding: 12px 16px; }
.sub-panel.active { display: flex; flex-direction: column; }
.preview-controls {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-muted);
}

/* Cards & Badges */
.q-card {
  border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 12px; box-shadow: var(--shadow); cursor: pointer;
}
.q-card:hover { border-color: var(--accent); }
.q-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge-mc { background: #ede9fe; color: #5b21b6; }
.badge-tf { background: #dbeafe; color: #1d4ed8; }
.badge-sa { background: #fef3c7; color: #b45309; }
.badge-es { background: #e5e7eb; color: #374151; }
.badge-id { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); font-family: monospace; }
.q-stem { line-height: 1.65; margin-bottom: 8px; }
.q-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin-top: 6px; }
.q-choices.tf-list { grid-template-columns: 1fr; }
.q-choice { padding: 5px 8px; border-radius: 6px; background: var(--surface-2); line-height: 1.5; }
.q-choice.is-true { background: rgba(5,150,105,0.12); border: 1px solid rgba(5,150,105,0.45); font-weight: 600; }
.q-sol {
  margin-top: 10px; padding: 8px 10px; border-left: 3px solid var(--primary);
  background: var(--surface-2); border-radius: 0 6px 6px 0; font-size: 13px; line-height: 1.6;
}
.tikz-placeholder {
  display: inline-block; margin: 6px 0; padding: 6px 10px;
  border: 1px dashed var(--accent); border-radius: 6px;
  background: var(--primary-light); color: var(--primary-dark); font-size: 12px; font-weight: 600;
}

.pdf-frame { flex: 1; width: 100%; border: 1px solid var(--border); border-radius: 8px; background: #525659; min-height: 380px; }
.issue-item { padding: 8px 10px; border-radius: 8px; margin-bottom: 8px; cursor: pointer; border-left: 4px solid var(--warning); background: var(--surface-2); }
.issue-item.error { border-left-color: var(--danger); }
.outline-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--border); cursor: pointer; }
.outline-row:hover { background: var(--surface-2); }

/* Bank layout */
.bank-layout { flex: 1; display: grid; grid-template-columns: 290px 1fr; min-height: 0; overflow: hidden; }
.bank-sidebar { border-right: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.bank-sidebar-head { padding: 10px 12px; border-bottom: 1px solid var(--border); font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.tree-scroll { flex: 1; overflow: auto; padding: 8px; }
.tree-node { padding: 5px 8px; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 12.5px; }
.tree-node:hover { background: var(--surface-2); }
.tree-node.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 700; }
.tree-children { margin-left: 14px; border-left: 1px dashed var(--border); padding-left: 4px; }
.bank-main { display: flex; flex-direction: column; min-height: 0; padding: 10px 14px; overflow: hidden; }
.bank-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; align-items: center; }
.bank-list { flex: 1; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.bank-row { display: grid; grid-template-columns: 28px 90px 46px 82px 1fr 110px; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.bank-row:hover { background: var(--surface-2); }
.bank-row.header { font-weight: 700; background: var(--surface-2); position: sticky; top: 0; z-index: 2; }

/* Page grids & cards */
.page-scroll { flex: 1; overflow: auto; padding: 16px 22px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; max-width: 1320px; margin: 0 auto; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; max-width: 1320px; margin: 0 auto; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 15px 17px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 10px 0; font-size: 15px; color: var(--primary); }
.form-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.form-row label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Sub-nav pills inside views (Figures, Bank, Templates) */
.view-subbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 7px 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.pill-tab {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.pill-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Canvas & Code side-by-side (Figures Studio) */
.fig-split {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 16px; max-width: 1320px; margin: 0 auto;
}
.canvas-stage {
  background: #ffffff; border: 1px solid var(--border); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.code-box {
  width: 100%; min-height: 280px; font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12.5px; line-height: 1.5; padding: 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--code-bg); color: var(--text); resize: vertical;
}

/* OMR Sheet Preview */
.omr-preview-paper {
  background: #fff; color: #111; border: 1px solid #cbd5e1; border-radius: 6px;
  padding: 20px; box-shadow: 0 4px 18px rgba(0,0,0,0.08); max-width: 820px; margin: 0 auto;
}
.omr-bubble {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border: 1.4px solid #1e293b; border-radius: 50%;
  font-size: 10px; font-weight: 700; margin: 1px 2px;
}

/* Matrix table */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { border: 1px solid var(--border); padding: 7px 9px; text-align: left; }
.tbl th { background: var(--surface-2); font-weight: 700; }

/* Floating Offline Assistant */
.assistant-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 80;
  width: 48px; height: 48px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-size: 20px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(91, 33, 182, 0.35);
}
.assistant-panel {
  position: fixed; right: 18px; bottom: 76px; z-index: 85;
  width: 370px; max-height: 72vh; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
  display: none; flex-direction: column; overflow: hidden;
}
.assistant-panel.open { display: flex; }
.assistant-head {
  background: var(--primary); color: #fff; padding: 10px 14px;
  display: flex; justify-content: space-between; align-items: center; font-weight: 700;
}
.assistant-body { padding: 12px; overflow: auto; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }

/* Modals & Toast */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,15,30,0.5);
  display: none; align-items: center; justify-content: center; z-index: 100;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  width: min(740px, 94vw); max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: 0 16px 40px rgba(0,0,0,0.25);
}
.modal-head { padding: 13px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 15px; }
.modal-body { padding: 15px 16px; overflow: auto; }
.modal-foot { padding: 11px 16px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

.toast-box { position: fixed; left: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: #1f1d2b; color: #fff; padding: 9px 14px; border-radius: 10px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,0.2); max-width: 420px; }
.toast.ok { background: #065f46; }
.toast.err { background: #991b1b; }
/* 3 Kiểu nút bấm giống S.Tex (Hiện đại / Mềm mại / Sắc nét) */
body.btn-soft-round .btn, body.btn-soft-round .nav-tab, body.btn-soft-round .math-chip { border-radius: 999px; }
body.btn-sharp .btn, body.btn-sharp .nav-tab, body.btn-sharp .math-chip, body.btn-sharp .card { border-radius: 3px; }

/* Autocomplete popup khi gõ \ */
.ac-popup {
  display: none; position: absolute; z-index: 95;
  background: var(--surface); border: 1px solid var(--accent); border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.18); min-width: 260px; max-height: 220px; overflow: auto; padding: 4px;
}
.ac-popup.open { display: block; }
.ac-item {
  padding: 6px 9px; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px;
}
.ac-item:hover, .ac-item.active { background: var(--primary-light); color: var(--primary-dark); }
body.theme-dark .ac-item:hover, body.theme-dark .ac-item.active { color: #e9d5ff; }

/* Focus fullscreen editor */
.split-pane.editor-only { grid-template-columns: 1fr 0fr; }
.split-pane.editor-only .preview-pane { display: none; }

/* Collapsed preview cards */
.q-card.collapsed .q-stem,
.q-card.collapsed .q-choices,
.q-card.collapsed .q-sol,
.q-card.collapsed .q-sa { display: none; }

.dropzone { border: 2px dashed var(--accent); border-radius: 10px; padding: 18px; text-align: center; background: var(--surface-2); cursor: pointer; margin-bottom: 10px; }
.dropzone:hover { background: var(--primary-light); }

/* Professional Global Loading Overlay */
.busy-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(18, 16, 36, 0.48);
  backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center;
}
.busy-overlay.open { display: flex; }
.busy-card {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 22px 28px; min-width: 320px; max-width: 440px;
  text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}
.busy-spinner {
  width: 36px; height: 36px; margin: 0 auto 12px auto;
  border: 3.5px solid var(--primary-light); border-top-color: var(--primary);
  border-radius: 50%; animation: stex-spin 0.8s linear infinite;
}
@keyframes stex-spin { to { transform: rotate(360deg); } }

/* Import summary badges */
.imp-summary {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px;
}
.imp-stat {
  padding: 6px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 700;
  background: var(--surface-2); border: 1px solid var(--border);
}
.imp-stat.ok { background: rgba(5,150,105,0.12); color: var(--success); border-color: rgba(5,150,105,0.3); }
.imp-stat.warn { background: rgba(217,119,6,0.12); color: var(--warning); border-color: rgba(217,119,6,0.3); }

/* Thin clean scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(100, 96, 122, 0.28); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100, 96, 122, 0.5); }
