:root {
  --bg: #0b111e;
  --bg-elevated: #121a2b;
  --bg-card: #162035;
  --bg-card-hover: #1c2842;
  --bg-input: #0e1626;
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --primary: #38bdf8;
  --primary-solid: #0284c7;
  --primary-soft: rgba(56, 189, 248, 0.14);
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.16);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.16);
  --yellow: #f59e0b;
  --yellow-soft: rgba(245, 158, 11, 0.16);
  --blue: #3b82f6;
  --blue-soft: rgba(59, 130, 246, 0.16);
  --purple: #a855f7;
  --purple-soft: rgba(168, 85, 247, 0.16);
  --shadow: 0 12px 32px rgba(2, 6, 23, 0.42);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 248px;
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

html[data-theme="light"] {
  --bg: #f1f5f9;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #f8fafc;
  --border: rgba(15, 23, 42, 0.11);
  --border-strong: rgba(15, 23, 42, 0.22);
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --primary: #0284c7;
  --primary-solid: #0284c7;
  --primary-soft: rgba(2, 132, 199, 0.1);
  --green-soft: rgba(16, 185, 129, 0.12);
  --red-soft: rgba(239, 68, 68, 0.12);
  --yellow-soft: rgba(245, 158, 11, 0.14);
  --blue-soft: rgba(59, 130, 246, 0.12);
  --purple-soft: rgba(168, 85, 247, 0.12);
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100%;
  overflow-x: hidden;
}

button, input, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Boot Loader */
.boot-loader {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-muted);
}

.boot-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--border-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Shell Layout */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  font-size: 15px;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

.brand-text h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-text span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.15s ease;
  text-align: left;
  width: 100%;
}

.nav-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}

.nav-btn.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.nav-badge {
  margin-left: auto;
  background: var(--yellow-soft);
  color: var(--yellow);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  font-family: var(--font-mono);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.sync-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.sync-dot.syncing { background: var(--yellow); animation: pulse 1s infinite; }
.sync-dot.error { background: var(--red); }

@keyframes pulse {
  50% { opacity: 0.4; }
}

.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.content-wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 28px 60px;
}

/* Cards & Grids */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.page-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.page-header p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.card-sm {
  padding: 14px 16px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-value {
  font-size: 26px;
  font-weight: 800;
  margin: 6px 0 4px;
  font-family: var(--font-mono);
  letter-spacing: -0.03em;
}

.kpi-sub {
  font-size: 12px;
  color: var(--text-dim);
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-input);
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  transition: width 0.25s ease;
}

.progress-fill.green { background: linear-gradient(90deg, #059669, #10b981); }
.progress-fill.yellow { background: linear-gradient(90deg, #d97706, #f59e0b); }
.progress-fill.red { background: linear-gradient(90deg, #dc2626, #ef4444); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary-solid);
  color: #fff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
}

.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }

.btn-secondary {
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.btn-secondary:hover { background: var(--bg-card-hover); }

.btn-ghost {
  color: var(--text-muted);
  padding: 8px 10px;
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--bg-card-hover);
}

.btn-danger {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.btn-danger:hover { background: rgba(239, 68, 68, 0.24); }

.btn-sm {
  padding: 6px 11px;
  font-size: 12.5px;
  border-radius: 8px;
}

.btn-lg {
  padding: 13px 22px;
  font-size: 15px;
}

/* Badges & Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}

.pill-primary { background: var(--primary-soft); color: var(--primary); }
.pill-green { background: var(--green-soft); color: var(--green); border-color: rgba(16, 185, 129, 0.25); }
.pill-red { background: var(--red-soft); color: var(--red); border-color: rgba(239, 68, 68, 0.25); }
.pill-yellow { background: var(--yellow-soft); color: var(--yellow); border-color: rgba(245, 158, 11, 0.25); }
.pill-purple { background: var(--purple-soft); color: var(--purple); border-color: rgba(168, 85, 247, 0.25); }
.pill-muted { background: var(--bg-input); color: var(--text-muted); border-color: var(--border); }

/* Resume Banner */
.resume-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.18), rgba(245, 158, 11, 0.1));
  border: 1px solid rgba(56, 189, 248, 0.35);
  margin-bottom: 20px;
}

/* Tema Rows */
.tema-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tema-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.8fr) 1.2fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.tema-title {
  font-weight: 700;
  font-size: 14.5px;
}

.tema-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.tema-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tema-stats-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.tema-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Quick Presets Grid */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.preset-card {
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 16px;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preset-card:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.preset-card strong { font-size: 14.5px; }
.preset-card span { font-size: 12.5px; color: var(--text-muted); }

/* Builder Controls */
.filter-section {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.filter-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.builder-tema-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.builder-tema-row.selected {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.05);
}

.check-box {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  transition: all 0.12s ease;
}

.check-box.checked {
  background: var(--primary-solid);
  border-color: var(--primary-solid);
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
}

.stepper button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-weight: 700;
  color: var(--text);
}

.stepper button:hover { background: var(--bg-card-hover); }

.stepper input {
  width: 46px;
  text-align: center;
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  outline: none;
}

.builder-footer {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.text-input {
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  outline: none;
  font-size: 14px;
}

.text-input:focus { border-color: var(--primary); }

/* Test Runner (ATPLQ Style) */
.runner-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.runner-topbar {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 12px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.runner-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.runner-title-wrap {
  min-width: 0;
}

.runner-title {
  font-weight: 700;
  font-size: 14.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.runner-sub {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.runner-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.timer-box {
  padding: 6px 11px;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13.5px;
}

.timer-box.warn {
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.45);
  background: var(--red-soft);
}

.runner-main {
  flex: 1;
  max-width: 1220px;
  width: 100%;
  margin: 0 auto;
  padding: 22px 24px 90px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 20px;
  align-items: start;
}

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.q-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}

.q-id-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.flag-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.flag-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  display: grid;
  place-items: center;
  font-size: 14px;
  transition: all 0.14s ease;
}

.flag-btn:hover { transform: translateY(-1px); border-color: var(--border-strong); }

.flag-btn.active-pin { background: var(--purple-soft); border-color: var(--purple); box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2); }
.flag-btn.active-red { background: var(--red-soft); border-color: var(--red); box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2); }
.flag-btn.active-yellow { background: var(--yellow-soft); border-color: var(--yellow); box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2); }
.flag-btn.active-green { background: var(--green-soft); border-color: var(--green); box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2); }
.flag-btn.active-blue { background: var(--blue-soft); border-color: var(--blue); box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2); }

.flag-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.flag-dot.red { background: var(--red); }
.flag-dot.yellow { background: var(--yellow); }
.flag-dot.green { background: var(--green); }
.flag-dot.blue { background: var(--blue); }

.q-text {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.48;
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.option-btn {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  transition: all 0.14s ease;
  min-height: 56px;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

.option-btn:disabled { cursor: default; }

.option-letter {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}

.option-text {
  font-size: 15px;
  line-height: 1.45;
  font-weight: 500;
  padding-top: 2px;
}

.option-btn.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.option-btn.selected .option-letter {
  background: var(--primary-solid);
  border-color: var(--primary-solid);
  color: #fff;
}

.option-btn.correct {
  border-color: var(--green);
  background: var(--green-soft);
}
.option-btn.correct .option-letter {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.option-btn.wrong {
  border-color: var(--red);
  background: var(--red-soft);
}
.option-btn.wrong .option-letter {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.feedback-banner {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.feedback-banner.wrong {
  background: var(--red-soft);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.feedback-banner.correct {
  background: var(--green-soft);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.q-footer-nav {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Navigator Matrix */
.matrix-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  position: sticky;
  top: 76px;
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.matrix-tile {
  position: relative;
  height: 38px;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--text-muted);
  display: grid;
  place-items: center;
}

.matrix-tile:hover { border-color: var(--border-strong); color: var(--text); }
.matrix-tile.current { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25); color: var(--text); }
.matrix-tile.correct { background: var(--green-soft); border-color: rgba(16, 185, 129, 0.5); color: var(--green); }
.matrix-tile.wrong { background: var(--red-soft); border-color: rgba(239, 68, 68, 0.5); color: var(--red); }
.matrix-tile.answered { background: var(--primary-soft); border-color: rgba(56, 189, 248, 0.5); color: var(--primary); }

.tile-flag {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.tile-pin {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 8px;
  line-height: 1;
}
.tile-seen {
  position: absolute;
  bottom: 2px;
  right: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-dim);
}

/* Saved Tests */
.test-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.test-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 1fr auto;
  align-items: center;
  gap: 16px;
}

/* Exam Verdict */
.verdict-card {
  border-radius: 18px;
  padding: 26px;
  margin-bottom: 20px;
  border: 1.5px solid var(--border);
}
.verdict-card.apto {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(56, 189, 248, 0.08));
  border-color: rgba(16, 185, 129, 0.45);
}
.verdict-card.no-apto {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.16), rgba(245, 158, 11, 0.08));
  border-color: rgba(239, 68, 68, 0.45);
}

/* Bank Browser */
.bank-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
}

/* Toast */
.toast-root {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
}

/* Mobile Bottom Nav */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  z-index: 45;
  grid-template-columns: repeat(5, 1fr);
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 2px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.mobile-nav-btn.active { color: var(--primary); }

/* Mobile Matrix Drawer Toggle */
.mobile-matrix-toggle { display: none; }

/* Responsive */
@media (max-width: 980px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-section { grid-template-columns: 1fr; }
  .runner-main { grid-template-columns: 1fr; }
  .matrix-card { display: none; position: static; }
  .matrix-card.open { display: block; }
  .mobile-matrix-toggle { display: inline-flex; }
  .test-item { grid-template-columns: 1fr; }
  .tema-row { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .sidebar { display: none; }
  .mobile-topbar { display: flex; }
  .mobile-bottom-nav { display: grid; }
  .content-wrap { padding: 16px 14px 92px; }
  .runner-topbar {
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .runner-meta {
    width: 100%;
    gap: 10px;
  }
  .runner-controls {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }
  .runner-main { padding: 14px 12px 90px; }
  .question-card { padding: 16px; }
  .q-text { font-size: 16px; }
  .toast-root { bottom: 76px; right: 12px; left: 12px; align-items: center; }
}
