/* =========================
   KROK HUB - ULTRA MODERN DESIGN
   Glassmorphism + Gradient Animations
   ========================= */

/* ===== CSS VARIABLES ===== */
:root {
  /* Colors */
  --bg: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f8fafc 100%);
  --card: rgba(255, 255, 255, 0.8);
  --ink: #0f172a;
  --muted: #64748b;
  --line: rgba(226, 232, 240, 0.8);

  --blue: #0ea5e9;
  --blue-dark: #0284c7;
  --purple: #6366f1;
  --purple-dark: #4f46e5;
  --green: #10b981;
  --green-dark: #059669;
  --green-soft: #d1fae5;

  /* Shadows */
  --shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.15);

  /* Layout */
  --container-w: 1200px;
  --gap: 20px;
  --radius: 24px;
  --field-h: 52px;

  /* Animation */
  --dur-fast: 0.18s;
  --dur: 0.3s;
  --dur-slow: 0.6s;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bgPulse {
  from {
    transform: rotate(0deg) scale(1);
  }
  to {
    transform: rotate(10deg) scale(1.1);
  }
}

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(14, 165, 233, 0.25);
  }
}

@keyframes krokShineX {
  to { transform: translateX(160%); }
}

@keyframes krokScan {
  0% { transform: translateX(0); }
  100% { transform: translateX(500%); }
}

@keyframes demoPulse {
  0%, 100% {
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.25);
  }
  50% {
    box-shadow: 0 16px 50px rgba(16, 185, 129, 0.35);
  }
}

@keyframes demoFloat {
  0%, 100% {
    transform: translateY(0) scale(1.02);
  }
  50% {
    transform: translateY(-6px) scale(1.03);
  }
}

@keyframes particlesFloat {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 0.4;
  }
  25% {
    transform: translate(20px, -30px) rotate(90deg);
    opacity: 0.7;
  }
  50% {
    transform: translate(-15px, -50px) rotate(180deg);
    opacity: 0.4;
  }
  75% {
    transform: translate(-30px, -20px) rotate(270deg);
    opacity: 0.6;
  }
  100% {
    transform: translate(0, 0) rotate(360deg);
    opacity: 0.4;
  }
}

/* ===== BASE ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  height: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  min-height: 100vh;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f8fafc 100%);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  animation: fadeIn 0.6s var(--ease);
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(14, 165, 233, 0.08) 0%, transparent 50%),
              radial-gradient(circle at 70% 80%, rgba(99, 102, 241, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: bgPulse 20s ease-in-out infinite alternate;
}

/* ===== CONTAINER ===== */
.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 28px 20px 36px;
  position: relative;
  z-index: 1;
}

/* ===== HEADING ===== */
h1 {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  margin: 8px 0 20px;
  position: relative;
  background: linear-gradient(135deg, var(--blue) 0%, var(--purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: slideInDown 0.6s var(--ease);
}

h1::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -12px;
  transform: translateX(-50%);
  width: 140px;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green) 0%, var(--blue) 50%, var(--purple) 100%);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
  animation: shimmer 2.5s linear infinite;
}

/* ===== KROK PILL ===== */
.krok-pill {
  display: grid;
  place-items: center;
  gap: 10px;
  margin: 12px auto 18px;
}

.krok-pill__badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 12px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.9) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12);
  transition: all 0.3s var(--ease);
}

.krok-pill__badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
}

.krok-logo {
  display: block;
  height: clamp(24px, 2.4vw, 32px);
}

.krok-logo text {
  font-weight: 700;
  letter-spacing: 0.2px;
  font-size: 35px;
}

.krok-logo .t-krok {
  fill: var(--ink);
}

.krok-logo .t-dot {
  fill: var(--muted);
}

.krok-logo .t-hub {
  fill: url(#hubGrad);
}

.shine-rect {
  transform: translateX(-60%);
  animation: krokShineX 2.8s linear infinite;
}

.krok-pill__underline {
  position: relative;
  height: 3px;
  width: min(240px, 70vw);
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.4), rgba(14, 165, 233, 0.4));
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.2);
}

.krok-pill__scan {
  position: absolute;
  top: 0;
  left: -25%;
  width: 25%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  animation: krokScan 2.2s linear infinite;
}

/* Beta chip */
.beta-chip {
  height: 18px;
  line-height: 18px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(14, 165, 233, 0.3);
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: var(--blue-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.85;
  box-shadow: 0 2px 4px rgba(14, 165, 233, 0.15);
  pointer-events: none;
  z-index: 2;
}

.beta-chip--corner {
  position: absolute;
  top: 8px;
  right: 14px;
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin: 14px auto 20px;
  position: relative;
  animation: fadeInUp 0.5s var(--ease) 0.1s both;
}

.tab-btn {
  position: relative;
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.9) 100%);
  backdrop-filter: blur(12px);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: #475569;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  isolation: isolate;
}

.tab-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 100%), rgba(14, 165, 233, 0.15), transparent 60%);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  pointer-events: none;
}

.tab-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  border-color: rgba(14, 165, 233, 0.3);
}

.tab-btn:hover::before {
  opacity: 1;
}

.tab-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--blue) 0%, var(--purple) 100%);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.4);
  font-weight: 800;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeInUp 0.4s var(--ease);
}

/* ===== SEARCH BAR ===== */
.hub-search {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin: 8px 0 20px;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s var(--ease) 0.2s both;
}

.hub-search input,
.hub-search select {
  height: var(--field-h);
  line-height: var(--field-h);
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.9) 100%);
  backdrop-filter: blur(12px);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  outline: none;
  transition: all 0.3s var(--ease);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.hub-search input {
  width: min(760px, 100%);
}

.hub-search input::placeholder {
  color: #94a3b8;
}

.hub-search input:focus,
.hub-search select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15),
              0 8px 24px rgba(14, 165, 233, 0.2);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 1);
}

.hub-search select {
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 45px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%2364748b' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 18px 18px;
}

.search-header {
  margin: 10px 0 14px;
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--muted);
  animation: fadeIn 0.3s var(--ease);
}

mark {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  padding: 0.1em 0.3em;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.15);
  animation: glow 2s ease-in-out infinite;
}

/* ===== GRID (CARDS) ===== */
.test-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  list-style: none;
}

@media (max-width: 1024px) {
  .test-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .test-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== CARD ===== */
.test-item {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(249, 251, 255, 0.9) 100%);
  backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: 22px 20px 26px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08),
              0 2px 8px rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.8);
  position: relative;
  overflow: hidden;
  transition: all 0.4s var(--ease);
  animation: cardIn 0.5s var(--ease);
}

.test-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(14, 165, 233, 0.08), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.test-item:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 48px rgba(14, 165, 233, 0.15),
              0 8px 24px rgba(15, 23, 42, 0.12);
  border-color: rgba(14, 165, 233, 0.3);
}

.test-item:hover::before {
  opacity: 1;
}

.test-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 19px;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.3;
}

/* Demo booklet special card */
.test-item.demo-booklet {
  position: relative;
  border: 3px dashed var(--green) !important;
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.95) 0%, rgba(240, 253, 244, 0.95) 100%);
  box-shadow: 0 12px 40px rgba(16, 185, 129, 0.25);
  transform: scale(1.02);
  z-index: 10;
  animation: demoPulse 4s ease-in-out infinite, demoFloat 6s ease-in-out infinite;
  overflow: visible;
}

.demo-booklet::before {
  content: '';
  position: absolute;
  inset: -20px;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 80%, var(--green) 0%, transparent 8%),
    radial-gradient(circle at 80% 20%, var(--green) 0%, transparent 8%),
    radial-gradient(circle at 40% 40%, var(--green) 0%, transparent 8%),
    radial-gradient(circle at 60% 60%, var(--green) 0%, transparent 8%);
  opacity: 0.6;
  animation: particlesFloat 12s linear infinite;
  z-index: -1;
}

/* ── ПСИХО-БУКЛЕТ: фіолетовий, БЕЗ партіклів/анімації ── */
.test-item.psy-booklet {
  position: relative;
  border: 3px dashed #8b5cf6 !important;
  background: linear-gradient(135deg, rgba(245,243,255,0.95) 0%, rgba(243,240,255,0.95) 100%);
  box-shadow: 0 12px 36px rgba(139,92,246,0.20);
  z-index: 9;
  overflow: visible;
}
.psy-booklet::before { content: none !important; display: none !important; }
.psy-booklet .booklet-ic { width: 30px; height: 30px; flex-shrink: 0; }
.demo-booklet .booklet-ic { width: 30px; height: 30px; flex-shrink: 0; }
/* У дарку чорні SVG-іконки буклетів → світлі (інакше зливаються) */
body.dark-mode .booklet-ic { filter: invert(1) brightness(.95); }
body.dark-mode .test-item.psy-booklet {
  border-color: #a78bfa !important;
  background: linear-gradient(135deg, rgba(124,92,246,0.14) 0%, rgba(99,102,241,0.10) 100%);
  box-shadow: 0 12px 36px rgba(0,0,0,0.35);
}

/* Progress badge */
.test-progress {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  height: 36px;
  padding: 0 14px;
  font-size: 15px;
  font-weight: 800;
  color: var(--green-dark);
  background: linear-gradient(135deg, rgba(209, 250, 229, 0.8) 0%, rgba(167, 243, 208, 0.8) 100%);
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
  transition: all 0.3s var(--ease);
}

.test-item:hover .test-progress {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

/* Buttons */
.test-buttons {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: nowrap;
}

.start-btn,
.history-btn {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
  padding: 13px 16px;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  user-select: none;
  isolation: isolate;
  transition: all 0.3s var(--ease);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.history-btn {
  flex: 1.25 1 0;
  background: linear-gradient(135deg, var(--blue) 0%, #5aa1f1 100%);
  color: #ffffff;
}

.start-btn {
  flex: 0.75 1 0;
  background: linear-gradient(135deg, var(--green) 0%, #12c09a 100%);
  color: #ffffff;
}

.start-btn::after,
.history-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(400px 50px at var(--rx, 50%) var(--ry, 50%), rgba(255, 255, 255, 0.35), transparent 60%);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  pointer-events: none;
}

.start-btn:hover::after,
.history-btn:hover::after {
  opacity: 1;
}

.start-btn:hover,
.history-btn:hover {
  transform: translateY(-2px);
  filter: saturate(110%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.start-btn:active,
.history-btn:active {
  transform: translateY(0);
}

/* ===== MODALS ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1005;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s var(--ease);
}

.modal-content {
  width: 90%;
  max-width: 680px;
  max-height: 85vh;
  overflow: auto;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
  backdrop-filter: blur(20px);
  color: var(--ink);
  padding: 24px 28px;
  border-radius: 32px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3),
              0 8px 24px rgba(15, 23, 42, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.8);
  position: relative;
  animation: modalPop 0.4s var(--ease);
}

.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.3);
  border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--blue) 0%, var(--purple) 100%);
  border-radius: 10px;
}

.modal-content h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--blue) 0%, var(--purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: #64748b;
  background: linear-gradient(135deg, rgba(241, 245, 249, 0.8) 0%, rgba(226, 232, 240, 0.8) 100%);
  cursor: pointer;
  border: 1px solid rgba(203, 213, 225, 0.8);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
  transition: all 0.3s var(--ease);
}

.close:hover {
  transform: rotate(90deg) scale(1.1);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.2) 100%);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}

/* History table */
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.history-table th,
.history-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.history-table th {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  font-weight: 800;
  position: sticky;
  top: 0;
  z-index: 1;
}

.history-table tr:hover td {
  background: #f8fafc;
  transition: background 0.2s var(--ease);
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.pagination button {
  padding: 10px 16px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  transition: all 0.3s var(--ease);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.pagination button:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, var(--blue) 0%, var(--purple) 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.pagination button.disabled {
  background: #f1f5f9;
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ===== SEARCH RESULTS ===== */
#searchResults.search-view {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 8px;
}

.search-view .test-grid {
  display: block;
}

.search-view .test-item {
  margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(249, 251, 255, 0.9) 100%);
  backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
  animation: cardIn 0.4s var(--ease);
}

.search-view .test-item h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
}

.search-view .test-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 4px 0 10px;
}

.search-view .test-meta .chip {
  font-size: 10px;
  line-height: 1;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #64748b;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  font-weight: 600;
  letter-spacing: .01em;
  animation: fadeIn 0.3s var(--ease);
}

.search-view ul {
  list-style: none;
}

.search-view ul li {
  position: relative;
  padding: 16px 20px;
  margin: 12px 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  color: var(--ink);
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  transition: all 0.3s var(--ease);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.search-view ul li:hover {
  transform: translateX(6px);
  background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.3);
}

.search-view ul li.correct {
  background: linear-gradient(135deg, var(--green-soft) 0%, #a7f3d0 100%);
  color: #065f46;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--green);
  border-color: rgba(16, 185, 129, 0.4);
}

.search-view ul li.correct::after {
  content: '✔';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--green);
  font-weight: 900;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
  animation: modalPop 0.3s var(--ease) 0.05s forwards;
}

/* ===== ARCHIVE PANEL ===== */
#panel-archive .test-item {
  margin-bottom: 24px;
  padding: 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.9) 100%);
  backdrop-filter: blur(20px);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.8);
  position: relative;
  transition: all 0.3s var(--ease);
  animation: fadeIn 0.4s var(--ease);
}

/* КРИТИЧНО: архів у стовпчик, не сіткою */
#grid-archive.test-grid,
#panel-archive .test-grid {
  display: block !important;
  grid-template-columns: unset !important;
  max-width: 900px;
  margin: 0 auto;
}

#panel-archive .test-item {
  margin-bottom: 24px;
  padding: 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.9) 100%);
  backdrop-filter: blur(20px);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.8);
  position: relative;
  transition: all 0.3s var(--ease);
  animation: fadeIn 0.4s var(--ease);
}

#panel-archive .test-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
}

#panel-archive .test-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

#panel-archive .question-number {
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

#panel-archive .test-item h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 16px;
  line-height: 1.4;
}

#panel-archive .test-item ul {
  list-style: none;
}

#panel-archive .test-item ul li {
  padding: 16px 20px;
  margin: 12px 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  cursor: default;
  transition: all 0.3s var(--ease);
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  position: relative;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

#panel-archive .test-item ul li:hover {
  background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
  transform: translateX(6px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.3);
}

#panel-archive .test-item ul li.correct {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--green);
  border-color: rgba(16, 185, 129, 0.4);
}

#panel-archive .test-item ul li.correct::after {
  content: '✔';
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--green);
  font-size: 18px;
  font-weight: 900;
  width: 26px;
  height: 26px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

#panel-archive .test-item ul li.incorrect {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}

#panel-archive .test-item ul li.incorrect::after {
  content: '✘';
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #ef4444;
  font-size: 18px;
  font-weight: 900;
  width: 26px;
  height: 26px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
  animation: modalPop 0.3s var(--ease) 0.05s forwards;
}

#panel-archive .test-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 6px 0 10px;
}

#panel-archive .test-meta .chip {
  font-size: 10px;
  line-height: 1;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #64748b;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  font-weight: 600;
  letter-spacing: .01em;
}

#panel-archive .test-meta .chip strong {
  font-weight: 700;
  opacity: .7;
  margin-right: 2px;
}

@media (max-width: 600px) {
  #panel-archive .test-meta {
    gap: 4px;
    margin: 4px 0 8px;
  }
  #panel-archive .test-meta .chip {
    font-size: 9px;
    padding: 3px 7px;
  }
}

#panel-archive .vidgets_for_test {
  display: flex;
  align-items: center;
  gap: 12px;
}

#panel-archive .divforarchive,
#panel-archive .discussion-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(248, 250, 252, 0.8) 100%);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

#panel-archive .divforarchive:hover,
#panel-archive .discussion-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.25);
  background: linear-gradient(135deg, rgba(209, 250, 229, 0.4) 0%, rgba(167, 243, 208, 0.4) 100%);
  border-color: rgba(16, 185, 129, 0.3);
}

#panel-archive .divforarchive img,
#panel-archive .discussion-btn img {
  width: 22px;
  height: 22px;
}

/* Якщо в архіві видно фіксовані бари — резервуємо простір знизу,
   щоб футер не з'являвся під ними при скролі до низу сторінки. */
body.has-arch-bars {
  padding-bottom: 110px;
}
@media (max-width: 768px) {
  body.has-arch-bars {
    /* Мобільний bottom-nav (72px) вже додає свій padding;
       тут залишаємо ще місце для arch-progress (bottom:116) і arch-controls. */
    padding-bottom: 200px;
  }
}

/* Archive progress */
.arch-progress {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 20px;
  width: min(1000px, 92vw);
  height: 24px;
  background: linear-gradient(135deg, rgba(241, 245, 249, 0.9) 0%, rgba(226, 232, 240, 0.9) 100%);
  backdrop-filter: blur(12px);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
  z-index: 1003;
  display: none;
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.arch-green,
.arch-red {
  height: 100%;
  position: absolute;
  top: 0;
  transition: width 0.6s var(--ease);
}

.arch-green {
  left: 0;
  background: linear-gradient(90deg, var(--green) 0%, #34d399 100%);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.arch-red {
  right: 0;
  background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
  transform: scaleX(-1);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.arch-controls {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 52px;
  z-index: 1004;
  display: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.arch-counter {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
  backdrop-filter: blur(12px);
  padding: 12px 18px;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
  font-weight: 800;
  border: 1px solid rgba(226, 232, 240, 0.8);
  color: var(--ink);
}

.arch-finish {
  padding: 12px 20px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
  transition: all 0.3s var(--ease);
}

.arch-finish:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.45);
}

/* Archive filters */
#archiveFilters.archive-filters {
  display: none;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 250, 252, 0.92) 100%);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
  margin: 12px 0 16px;
}

#archiveFilters > div {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

#archiveFilters select,
#archiveFilters button {
  height: var(--field-h);
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  transition: all 0.3s var(--ease);
}

#archiveFilters .history-btn {
  background: rgba(255, 255, 255, 0.9) !important;
  color: var(--ink) !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06) !important;
  border: 1px solid var(--line) !important;
  filter: none !important;
}

#archiveFilters select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  padding: 0 45px 0 18px;
  line-height: var(--field-h);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%2364748b' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 18px 18px;
}

#archiveFilters select:focus,
#archiveFilters button:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15),
              0 4px 16px rgba(14, 165, 233, 0.2);
  transform: translateY(-1px);
}

#archiveFilters select:hover,
#archiveFilters button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

#archiveFilters #archFilteredCount {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

/* ===== TOPICS MODAL ===== */
.modal--open {
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%);
  backdrop-filter: blur(8px);
}

.topics {
  width: min(980px, 92vw);
  max-height: 86vh;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
  backdrop-filter: blur(20px);
  border-radius: 32px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 0.4s var(--ease);
}

.topics__header {
  padding: 16px 20px;
  border-bottom: 2px solid rgba(226, 232, 240, 0.8);
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  align-items: center;
}

.topics__title {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--blue) 0%, var(--purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.topics__search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.topics__search input {
  border: none;
  outline: none;
  font: inherit;
  width: 220px;
  min-width: 0;
  background: transparent;
  color: var(--ink);
}

.topics__close {
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  color: #64748b;
  transition: all 0.3s var(--ease);
}

.topics__close:hover {
  color: #ef4444;
  transform: rotate(90deg);
}

.topics__body {
  padding: 16px 20px;
  overflow: auto;
  scroll-behavior: smooth;
}

.topics__body::-webkit-scrollbar {
  width: 8px;
}

.topics__body::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.3);
  border-radius: 10px;
}

.topics__body::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--blue) 0%, var(--purple) 100%);
  border-radius: 10px;
}

.subject {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.subject__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  transition: all 0.3s var(--ease);
}

.subject__head:hover {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

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

.subject__name {
  font-weight: 700;
  color: var(--ink);
  font-size: 15px;
}

.badge {
  font-size: 12px;
  line-height: 1;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 999px;
  padding: 5px 10px;
  font-weight: 700;
}

.subject__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.subject__btn {
  border: none;
  border-radius: 999px;
  padding: 7px 12px;
  background: linear-gradient(135deg, rgba(226, 232, 240, 0.8) 0%, rgba(203, 213, 225, 0.8) 100%);
  color: #475569;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.3s var(--ease);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.subject__btn:hover {
  background: linear-gradient(135deg, var(--blue) 0%, var(--purple) 100%);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.subject__icon {
  transition: transform 0.3s var(--ease);
  color: #64748b;
}

.subject--collapsed .subject__icon {
  transform: rotate(-90deg);
}

.subject__body {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.subject--collapsed .subject__body {
  display: none;
}

.topic-pill {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
  cursor: pointer;
  transition: all 0.3s var(--ease);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.topic-pill:hover {
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
  transform: translateY(-1px);
  border-color: rgba(14, 165, 233, 0.3);
  background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
}

.topic-pill input {
  flex: 0 0 auto;
  accent-color: var(--green);
  transform: translateY(2px);
  width: 18px;
  height: 18px;
}

.topic-pill span {
  display: block;
  flex: 1 1 auto;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  line-height: 1.3;
  font-size: 13px;
  font-weight: 500;
}

.topics__footer {
  padding: 14px 20px;
  border-top: 2px solid rgba(226, 232, 240, 0.8);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
  backdrop-filter: blur(12px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  bottom: 0;
}

.footer__left {
  font-size: 14px;
  font-weight: 600;
  color: #475569;
}

.footer__actions {
  display: flex;
  gap: 10px;
}

.btn {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.9) 0%, rgba(241, 245, 249, 0.9) 100%);
  backdrop-filter: blur(8px);
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  transition: all 0.3s var(--ease);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.btn--primary {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.btn--primary:hover {
  filter: brightness(1.05);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn--ghost:hover {
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  transform: translateY(-1px);
}

/* ===== SPINNER ===== */
.loading-spinner {
  display: none;
  margin: 16px auto;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(14, 165, 233, 0.2);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ===== TOAST ===== */
#hubToast {
  position: fixed;
  right: 24px;
  top: 24px;
  z-index: 1100;
  padding: 12px 18px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
  font-weight: 700;
  font-size: 14px;
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.3s var(--ease);
}

/* ===== DARK MODE TOGGLE ===== */
.dark-mode-toggle {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 2px solid var(--green);
  color: var(--green);
  border-radius: 50%;
  cursor: pointer;
  z-index: 1001;
  transition: all 0.3s var(--ease);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.25);
  animation: pulse 3s ease-in-out infinite;
}

.dark-mode-toggle:hover {
  transform: translateY(-3px) scale(1.05);
  background: rgba(16, 185, 129, 0.1);
  box-shadow: 0 12px 32px rgba(16, 185, 129, 0.35);
}

#mode-icon {
  font-size: 26px;
  transition: transform 0.3s var(--ease);
}

.dark-mode-toggle:hover #mode-icon {
  transform: rotate(15deg) scale(1.1);
}

/* ===== DARK MODE =====
   Палітра уніфікована з сторінкою тестів (main.css):
   - фон #0b1220, картки #172033, hover #1f2a44 / #26344f
   - текст #e2e8f0, muted #94a3b8, бордери rgba(148,163,184,.10)
   - correct/incorrect — прозорі тінти, не суцільні кольори */
/* === ТЕМНИЙ РЕЖИМ — спрощений: нейтральний темний фон, білий текст,
   без градієнтів/світіння, м'який зелений / червоний для відповідей. === */
body.dark-mode {
  --bg: #0f0f11;
  --card: #1a1a1d;
  --card-2: #242428;
  --card-3: #2e2e33;
  --ink: #f4f4f5;
  --muted: #a1a1aa;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.15);
  background: #0f0f11;
  color: var(--ink);
}

/* Без декоративних радіальних градієнтів на тлі */
body.dark-mode::before {
  background: none;
}

body.dark-mode .tab-btn {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
}

body.dark-mode .tab-btn:hover {
  background: var(--card-2);
  border-color: var(--line-strong);
}

/* Активна вкладка — суцільна світліша поверхня + м'який зелений обідок (без градієнта) */
body.dark-mode .tab-btn.active {
  background: var(--card-3);
  color: var(--ink);
  border-color: rgba(74, 160, 110, 0.5);
  box-shadow: none;
}

body.dark-mode .test-item {
  background: var(--card);
  border-color: var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02);
}

body.dark-mode .test-item:hover {
  border-color: var(--line-strong);
}

/* Без кутового світіння на картці */
body.dark-mode .test-item::before {
  background: none;
}

body.dark-mode .test-title {
  color: var(--ink);
}

body.dark-mode .test-progress {
  border-color: rgba(74, 160, 110, 0.35);
  background: rgba(74, 160, 110, 0.14);
  color: #9ed4b4;
}

body.dark-mode .modal-content {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

body.dark-mode .close {
  background: var(--card-2);
  color: var(--ink);
  border-color: var(--line);
}

body.dark-mode .history-table th {
  background: var(--card-2);
  color: var(--ink);
}

body.dark-mode .history-table td {
  color: var(--ink);
  border-bottom-color: var(--line);
}

body.dark-mode .history-table tr:hover td {
  background: var(--card-2);
}

body.dark-mode .hub-search input,
body.dark-mode .hub-search select {
  background: var(--card-2);
  color: var(--ink);
  border-color: var(--line);
}

body.dark-mode .hub-search input::placeholder {
  color: var(--muted);
}

body.dark-mode .search-view ul li {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
}

body.dark-mode .search-view ul li:hover {
  background: var(--card-2);
  border-color: var(--line-strong);
}

body.dark-mode .search-view .test-meta .chip {
  background: var(--card-2);
  color: var(--ink);
  border-color: var(--line);
}

body.dark-mode mark {
  background: rgba(255,255,255, 0.30);
  color: #e0e7ff;
  border-radius: 4px;
  padding: 0 2px;
}

/* Архівні тести — м'які прозорі тінти замість суцільних блоків */
body.dark-mode #panel-archive .test-item {
  background: var(--card);
  border-color: var(--line);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
}

body.dark-mode #panel-archive .test-item ul li {
  background: var(--card-2);
  color: var(--ink);
  border: none;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.06);
}

body.dark-mode #panel-archive .test-item ul li:hover {
  background: var(--card-3);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.14);
}

body.dark-mode #panel-archive .test-item ul li.selected {
  background: #2e2e33;
  box-shadow: inset 0 0 0 1px rgba(255,255,255, 0.35);
}

body.dark-mode #panel-archive .test-item ul li.correct {
  background: rgba(74,160,110, 0.14);
  color: #9ed4b4;
  box-shadow: inset 0 0 0 1px rgba(74,160,110, 0.45);
}

body.dark-mode #panel-archive .test-item ul li.correct::after {
  color: #9ed4b4;
  background: rgba(74,160,110, 0.18);
  border: 1px solid rgba(74,160,110, 0.40);
}

body.dark-mode #panel-archive .test-item ul li.incorrect {
  background: rgba(220,80,80, 0.14);
  color: #f0a8a8;
  box-shadow: inset 0 0 0 1px rgba(220,80,80, 0.45);
}

body.dark-mode #panel-archive .test-item ul li.incorrect::after {
  color: #f0a8a8;
  background: rgba(220,80,80, 0.18);
  border: 1px solid rgba(220,80,80, 0.40);
}

body.dark-mode #panel-archive .test-meta .chip {
  background: var(--card-2);
  color: var(--ink);
  border-color: var(--line);
}

body.dark-mode #panel-archive .question-number {
  background: rgba(255,255,255, 0.12);
  border-color: rgba(255,255,255, 0.25);
  color: #e4e4e7;
}

body.dark-mode #panel-archive .divforarchive,
body.dark-mode #panel-archive .discussion-btn {
  background: var(--card-2);
  border-color: var(--line);
  color: var(--ink);
}

body.dark-mode #panel-archive .divforarchive:hover,
body.dark-mode #panel-archive .discussion-btn:hover {
  background: rgba(255,255,255, 0.16);
  border-color: rgba(255,255,255, 0.40);
}

body.dark-mode .arch-progress {
  background: var(--card-2);
  border: 1px solid var(--line);
}

body.dark-mode .arch-counter {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
}

/* Старий блок селектів у архіві — лишаємо як fallback (.af перевизначить, де є) */
body.dark-mode #archiveFilters.archive-filters {
  background: var(--card);
  border-color: var(--line);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

body.dark-mode #archiveFilters select,
body.dark-mode #archiveFilters button,
body.dark-mode #archiveFilters .history-btn {
  background: var(--card-2) !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
}

body.dark-mode .topics {
  background: var(--card);
  border-color: var(--line);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

body.dark-mode .topics__header {
  background: var(--card-2);
  border-color: var(--line);
}

body.dark-mode .topics__search {
  background: var(--card-2);
  border-color: var(--line);
}

body.dark-mode .topics__search input {
  color: var(--ink);
}

body.dark-mode .topics__search input::placeholder {
  color: var(--muted);
}

body.dark-mode .subject {
  background: rgba(31, 41, 65, 0.5);
  border-color: var(--line);
}

body.dark-mode .subject__head {
  background: var(--card-2);
}

body.dark-mode .subject__head:hover {
  background: var(--card-3);
}

body.dark-mode .subject__name {
  color: var(--ink);
}

body.dark-mode .badge {
  background: rgba(255,255,255, 0.12);
  border-color: rgba(255,255,255, 0.25);
  color: #e4e4e7;
}

body.dark-mode .subject__btn {
  background: var(--card-2);
  color: var(--ink);
  border: 1px solid var(--line);
}

body.dark-mode .subject__btn:hover {
  background: var(--card-3);
  border-color: var(--line-strong);
}

body.dark-mode .topic-pill {
  background: var(--card-2);
  border-color: var(--line);
  color: var(--ink);
}

body.dark-mode .topic-pill:hover {
  background: var(--card-3);
}

body.dark-mode .topics__footer {
  background: var(--card);
  border-color: var(--line);
}

body.dark-mode .btn {
  background: var(--card-2);
  border-color: var(--line);
  color: var(--ink);
}

body.dark-mode .btn:hover {
  background: var(--card-3);
  border-color: var(--line-strong);
}

body.dark-mode .btn--primary,
body.dark-mode .btn--primary:hover {
  background: #3a7d5f;
  color: #fff;
  border-color: transparent;
}

body.dark-mode .krok-pill__badge {
  background: var(--card-2);
  color: var(--ink);
  border-color: var(--line);
}

body.dark-mode .beta-chip {
  background: var(--card-2);
  border-color: var(--line);
  color: var(--muted);
}

body.dark-mode .demo-booklet {
  background: var(--card);
  border-color: rgba(74,160,110, 0.40) !important;
  box-shadow: 0 4px 18px rgba(74,160,110, 0.10);
}

/* Скролбари у dark-режимі */
body.dark-mode ::-webkit-scrollbar-track {
  background: rgba(148, 163, 184, 0.06);
}

body.dark-mode ::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 10px;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.40);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  h1::after {
    width: 100px;
    height: 4px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 20px 16px 32px;
  }

  .test-item {
    padding: 18px 16px 22px;
  }

  .test-title {
    font-size: 17px;
  }

  .test-progress {
    height: 32px;
    font-size: 14px;
  }

  .tabs {
    gap: 8px;
  }

  .tab-btn {
    padding: 10px 16px;
    font-size: 13px;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 16px 12px 28px;
  }

  .loading-spinner {
    width: 32px;
    height: 32px;
    border-width: 3px;
  }

  .modal-content {
    width: 96%;
    padding: 20px;
    border-radius: 24px;
  }

  .history-table th,
  .history-table td {
    padding: 10px 12px;
    font-size: 13px;
  }

  .start-btn,
  .history-btn {
    font-size: 13px;
    padding: 11px 14px;
  }

  h1 {
    font-size: 24px;
  }

  h1::after {
    width: 80px;
    height: 3px;
  }

  .modal--open {
    align-items: flex-end;
  }

  .topics {
    width: 100vw;
    max-height: 92vh;
    border-radius: 24px 24px 0 0;
  }

  .subject__body {
    grid-template-columns: 1fr;
  }

  .subject__head {
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 10px;
    align-items: start;
  }

  #archiveFilters > div {
    align-items: stretch;
  }

  #archiveFilters select,
  #archiveFilters button {
    width: 100%;
    max-width: none !important;
  }

  .beta-chip {
    height: 16px;
    line-height: 16px;
    padding: 0 6px;
    font-size: 9px;
  }

  .beta-chip--corner {
    top: 6px;
    right: 12px;
  }
}

@media (max-width: 480px) {
  .start-btn,
  .history-btn {
    white-space: normal;
    line-height: 1.2;
  }

  .history-btn {
    flex: 1.15 1 0;
  }

  .start-btn {
    flex: 0.85 1 0;
  }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ===== MODAL OPEN STATE ===== */
body.modal-open {
  overflow: hidden !important;
  touch-action: none;
}

/* ========================================
   MOBILE PERFORMANCE - KROK HUB
   ======================================== */

@media (max-width: 900px) {
  /* Відключити backdrop-filter */
  .krok-pill__badge,
  .tab-btn,
  .hub-search input,
  .hub-search select,
  .test-item,
  .modal,
  .modal-content,
  .close,
  .history-table,
  .arch-progress,
  .arch-counter,
  #archiveFilters,
  .topics,
  .topics__search,
  .subject,
  .topic-pill,
  .topics__footer,
  .btn,
  .search-view ul li,
  #panel-archive .test-item,
  #panel-archive .test-item ul li,
  #panel-archive .divforarchive,
  #panel-archive .discussion-btn {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* Solid backgrounds замість gradient+backdrop */
  body {
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%) !important;
  }

  body.dark-mode {
    background: #0f0f11 !important;
  }

  .krok-pill__badge {
    background: #ffffff !important;
  }

  body.dark-mode .krok-pill__badge {
    background: #1a1a1d !important;
  }

  .tab-btn {
    background: #ffffff !important;
  }

  body.dark-mode .tab-btn {
    background: #1a1a1d !important;
  }

  .tab-btn.active {
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%) !important;
  }

  .hub-search input,
  .hub-search select {
    background: #ffffff !important;
  }

  body.dark-mode .hub-search input,
  body.dark-mode .hub-search select {
    background: #242428 !important;
  }

  .test-item {
    background: #ffffff !important;
  }

  body.dark-mode .test-item {
    background: #1a1a1d !important;
  }

  .demo-booklet {
    background: #ecfdf5 !important;
  }

  body.dark-mode .demo-booklet {
    background: #1a1a1d !important;
  }

  .test-progress {
    background: rgba(209, 250, 229, 0.9) !important;
  }

  body.dark-mode .test-progress {
    background: rgba(74,160,110, 0.18) !important;
  }

  .start-btn {
    background: #10b981 !important;
  }

  .history-btn {
    background: #0ea5e9 !important;
  }

  .modal-content {
    background: #ffffff !important;
  }

  body.dark-mode .modal-content {
    background: #1a1a1d !important;
  }

  .close {
    background: #f1f5f9 !important;
  }

  body.dark-mode .close {
    background: #242428 !important;
  }

  .arch-progress {
    background: #f1f5f9 !important;
  }

  body.dark-mode .arch-progress {
    background: #242428 !important;
  }

  .arch-counter {
    background: #ffffff !important;
  }

  body.dark-mode .arch-counter {
    background: #1a1a1d !important;
  }

  .arch-finish {
    background: #ef4444 !important;
  }

  #archiveFilters {
    background: #ffffff !important;
  }

  body.dark-mode #archiveFilters {
    background: #1a1a1d !important;
  }

  #archiveFilters select,
  #archiveFilters button,
  #archiveFilters .history-btn {
    background: #f9fafb !important;
  }

  body.dark-mode #archiveFilters select,
  body.dark-mode #archiveFilters button,
  body.dark-mode #archiveFilters .history-btn {
    background: #242428 !important;
  }

  .topics {
    background: #ffffff !important;
  }

  body.dark-mode .topics {
    background: #1a1a1d !important;
  }

  .topics__search {
    background: #ffffff !important;
  }

  body.dark-mode .topics__search {
    background: #242428 !important;
  }

  .subject {
    background: #f9fafb !important;
  }

  body.dark-mode .subject {
    background: #242428 !important;
  }

  .subject__head {
    background: #f8fafc !important;
  }

  body.dark-mode .subject__head {
    background: #242428 !important;
  }

  .subject__head:hover {
    background: #f1f5f9 !important;
  }

  body.dark-mode .subject__head:hover {
    background: #2e2e33 !important;
  }

  .subject__btn {
    background: #e2e8f0 !important;
  }

  body.dark-mode .subject__btn {
    background: #242428 !important;
  }

  .topic-pill {
    background: #ffffff !important;
  }

  body.dark-mode .topic-pill {
    background: #242428 !important;
  }

  .topics__footer {
    background: #ffffff !important;
  }

  body.dark-mode .topics__footer {
    background: #1a1a1d !important;
  }

  .btn {
    background: #f8fafc !important;
  }

  body.dark-mode .btn {
    background: #242428 !important;
  }

  .btn--primary {
    background: #10b981 !important;
  }

  .search-view ul li {
    background: #ffffff !important;
  }

  body.dark-mode .search-view ul li {
    background: #1a1a1d !important;
  }

  .search-view .test-meta .chip {
    background: #f1f5f9 !important;
  }

  body.dark-mode .search-view .test-meta .chip {
    background: #242428 !important;
  }

  #panel-archive .test-item {
    background: #ffffff !important;
  }

  body.dark-mode #panel-archive .test-item {
    background: #1a1a1d !important;
  }

  #panel-archive .test-item ul li {
    background: #f9fafb !important;
  }

  body.dark-mode #panel-archive .test-item ul li {
    background: #242428 !important;
  }

  #panel-archive .divforarchive,
  #panel-archive .discussion-btn {
    background: #ffffff !important;
  }

  body.dark-mode #panel-archive .divforarchive,
  body.dark-mode #panel-archive .discussion-btn {
    background: #242428 !important;
  }

  #panel-archive .test-meta .chip {
    background: #f1f5f9 !important;
  }

  body.dark-mode #panel-archive .test-meta .chip {
    background: #242428 !important;
  }

  /* Спростити тіні */
  .krok-pill__badge,
  .tab-btn,
  .hub-search input,
  .hub-search select,
  .test-item,
  .modal-content {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08) !important;
  }

  body.dark-mode .krok-pill__badge,
  body.dark-mode .tab-btn,
  body.dark-mode .hub-search input,
  body.dark-mode .hub-search select,
  body.dark-mode .test-item,
  body.dark-mode .modal-content {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22) !important;
  }

  .tab-btn.active {
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3) !important;
  }

  .test-item:hover {
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.12) !important;
  }

  .demo-booklet {
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.2) !important;
  }

  .start-btn,
  .history-btn,
  .arch-finish {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
  }

  .close,
  .arch-counter,
  .topics__footer {
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08) !important;
  }

  /* Прибрати декоративні ::before та ::after */
  body::before,
  .test-item::before,
  h1::after,
  .demo-booklet::before,
  .tab-btn::before,
  .start-btn::after,
  .history-btn::after {
    display: none !important;
  }

  /* Спростити gradient text */
  h1 {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    background-clip: unset !important;
    color: #0ea5e9 !important;
  }

  body.dark-mode h1 {
    color: #60a5fa !important;
  }

  .topics__title,
  .modal-content h3 {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    background-clip: unset !important;
    color: #0ea5e9 !important;
  }

  body.dark-mode .topics__title,
  body.dark-mode .modal-content h3 {
    color: #60a5fa !important;
  }

  /* Відключити hover transforms */
  .krok-pill__badge:hover,
  .tab-btn:hover,
  .hub-search input:focus,
  .hub-search select:focus,
  .start-btn:hover,
  .history-btn:hover,
  .close:hover,
  .pagination button:hover,
  .subject__btn:hover,
  .topic-pill:hover,
  .btn--primary:hover,
  .btn--ghost:hover,
  .arch-finish:hover,
  .dark-mode-toggle:hover,
  .topics__close:hover {
    transform: none !important;
  }

  /* Але залишити вертикальний рух на test-item */
  .test-item:hover {
    transform: translateY(-4px) !important;
  }

  .demo-booklet {
    transform: none !important;
  }

  #panel-archive .test-item:hover {
    transform: translateY(-4px) !important;
  }

  /* Спростити hover на відповідях */
  .search-view ul li:hover {
    transform: none !important;
  }

  #panel-archive .test-item ul li:hover {
    transform: none !important;
  }

  /* Спростити transitions */
  .krok-pill__badge,
  .tab-btn,
  .hub-search input,
  .hub-search select,
  .test-item,
  .start-btn,
  .history-btn,
  .close,
  .pagination button,
  .subject,
  .subject__head,
  .subject__btn,
  .topic-pill,
  .btn,
  .arch-finish,
  .dark-mode-toggle,
  .search-view ul li,
  #panel-archive .test-item,
  #panel-archive .test-item ul li,
  #panel-archive .divforarchive,
  #panel-archive .discussion-btn {
    transition-duration: 0.15s !important;
  }

  .test-progress {
    transition-duration: 0.2s !important;
  }

  .arch-green,
  .arch-red {
    transition-duration: 0.4s !important;
  }

  /* Відключити анімації */
  body,
  h1,
  .tabs,
  .hub-search,
  .test-item,
  .modal,
  .modal-content,
  .topics,
  .search-view .test-item,
  .search-view .test-meta .chip,
  #panel-archive .test-item,
  .tab-panel {
    animation: none !important;
  }

  /* Відключити анімації на checked answers */
  .search-view ul li.correct::after,
  #panel-archive .test-item ul li.correct::after,
  #panel-archive .test-item ul li.incorrect::after {
    animation: none !important;
  }

  /* Відключити KROK logo анімації */
  .shine-rect {
    animation: none !important;
  }

  .krok-pill__scan {
    animation: none !important;
  }

  /* Відключити demo booklet анімації */
  .demo-booklet {
    animation: none !important;
  }

  /* Відключити dark mode toggle pulse */
  .dark-mode-toggle {
    animation: none !important;
  }

  #mode-icon {
    transition-duration: 0.2s !important;
  }

  .dark-mode-toggle:hover #mode-icon {
    transform: none !important;
  }

  /* Відключити mark glow */
  mark {
    animation: none !important;
  }

  /* Спростити mark background */
  mark {
    background: #fef3c7 !important;
  }

  body.dark-mode mark {
    background: rgba(255,255,255, 0.30) !important;
    color: #e0e7ff !important;
  }

  /* Спростити beta chip */
  .beta-chip {
    background: #dbeafe !important;
  }

  body.dark-mode .beta-chip {
    background: #242428 !important;
  }

  /* Спростити badge */
  .badge {
    background: #eef2ff !important;
  }

  body.dark-mode .badge {
    background: rgba(255,255,255, 0.12) !important;
    color: #e4e4e7 !important;
  }

  /* Спростити correct/incorrect states */
  .search-view ul li.correct {
    background: #d1fae5 !important;
  }

  #panel-archive .test-item ul li.correct {
    background: #d1fae5 !important;
  }

  body.dark-mode #panel-archive .test-item ul li.correct {
    background: rgba(74,160,110, 0.14) !important;
    color: #9ed4b4 !important;
    box-shadow: inset 0 0 0 1px rgba(74,160,110, 0.45) !important;
  }

  #panel-archive .test-item ul li.incorrect {
    background: #fee2e2 !important;
  }

  body.dark-mode #panel-archive .test-item ul li.incorrect {
    background: rgba(220,80,80, 0.14) !important;
    color: #f0a8a8 !important;
    box-shadow: inset 0 0 0 1px rgba(220,80,80, 0.45) !important;
  }

  /* Спростити subject__icon rotation */
  .subject__icon {
    transition-duration: 0.2s !important;
  }

  /* Спростити toast */
  #hubToast {
    background: #10b981 !important;
  }

  /* Спростити scrollbar */
  .modal-content::-webkit-scrollbar-thumb,
  .topics__body::-webkit-scrollbar-thumb {
    background: #0ea5e9 !important;
  }

  /* Спростити krok-pill__underline */
  .krok-pill__underline {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.5), rgba(14, 165, 233, 0.5)) !important;
  }

  /* Спростити history table hover */
  .history-table tr:hover td {
    transition-duration: 0.1s !important;
  }

  body.dark-mode .history-table th {
    background: #242428 !important;
  }

  /* Спростити progress bars */
  .arch-green {
    background: #10b981 !important;
    box-shadow: none !important;
  }

  .arch-red {
    background: #ef4444 !important;
    box-shadow: none !important;
  }

  /* Спростити topics header */
  .topics__header {
    background: #f8fafc !important;
  }

  body.dark-mode .topics__header {
    background: #242428 !important;
  }
}

/* Для дуже слабких пристроїв */
@media (max-width: 480px) and (max-height: 800px) {
  /* Мінімальні тіні */
  .krok-pill__badge,
  .tab-btn,
  .test-item,
  .modal-content {
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06) !important;
  }

  body.dark-mode .krok-pill__badge,
  body.dark-mode .tab-btn,
  body.dark-mode .test-item,
  body.dark-mode .modal-content {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
  }

  /* Відключити всі анімації */
  * {
    animation: none !important;
  }

  /* Відключити всі складні transitions */
  * {
    transition-duration: 0.1s !important;
  }

  /* Спростити всі gradients на кнопках */
  .start-btn {
    background: #10b981 !important;
  }

  .history-btn {
    background: #0ea5e9 !important;
  }

  .arch-finish {
    background: #ef4444 !important;
  }

  .btn--primary {
    background: #10b981 !important;
  }

  .tab-btn.active {
    background: #0ea5e9 !important;
  }

  /* Зменшити padding */
  .container {
    padding: 16px 12px 28px !important;
  }

  .test-item {
    padding: 16px 14px 20px !important;
  }

  .modal-content {
    padding: 18px 16px !important;
  }

  .topics {
    padding: 0 !important;
  }

  /* Спростити test-progress */
  .test-progress {
    background: rgba(209, 250, 229, 1) !important;
    box-shadow: none !important;
  }

  body.dark-mode .test-progress {
    background: rgba(74,160,110, 0.3) !important;
  }

  /* Спростити demo booklet */
  .demo-booklet {
    transform: none !important;
    border-width: 2px !important;
  }
}

/* Для landscape орієнтації */
@media (max-width: 900px) and (max-height: 500px) {
  .container {
    padding: 16px 12px 28px !important;
  }

  .test-item {
    padding: 16px 14px 20px !important;
    margin-bottom: 16px !important;
  }

  .tabs {
    margin: 10px auto 14px !important;
  }

  .hub-search {
    margin: 6px 0 14px !important;
  }
}