/* css/components/tests-hub.css — Unified Tests hub */

.tests-hub-section {
  min-height: 0;
}

.dashboard-center--tests-hub {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  gap: var(--tests-hub-scroll-gap, 14px);
  --tests-hub-scroll-gap: 14px;
}

/* No document scroll — only the inner list area scrolls */
html:has(.dashboard-center--tests-hub),
body:has(.dashboard-center--tests-hub) {
  overflow: hidden;
  height: 100%;
}

body:has(.dashboard-center--tests-hub) #app,
body:has(.dashboard-center--tests-hub) .app-container,
body:has(.dashboard-center--tests-hub) #main-content {
  overflow: hidden;
  height: 100%;
  min-height: 0;
}

body:has(.dashboard-center--tests-hub) .dashboard-layout--crossword-scroll {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
  box-sizing: border-box;
}

@media (min-width: 769px) {
  body:has(.dashboard-center--tests-hub) .dashboard-layout--crossword-scroll {
    height: calc(100dvh - var(--dashboard-top-spacing, 28px));
    max-height: calc(100dvh - var(--dashboard-top-spacing, 28px));
  }

  .dashboard-center--tests-hub {
    height: 100%;
    max-height: 100%;
    min-height: 0;
  }
}

/* Header sits outside the scroll container — never moves while list scrolls */
.dashboard-center--tests-hub .cw-section-header.cw-section-header--tests.cw-section-header--duo {
  flex-wrap: nowrap;
  flex-shrink: 0;
  position: relative;
  top: auto;
  z-index: 2;
  margin-bottom: 0;
  box-shadow:
    0 4px 0 color-mix(in srgb, var(--cw-header-color, #58cc02) 72%, #000),
    0 8px 24px color-mix(in srgb, var(--cw-header-color, #58cc02) 22%, transparent);
}

.dashboard-center--tests-hub .cw-page-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-top: 0;
  position: relative;
  z-index: 0;
  scrollbar-gutter: stable;
}

/* Tests hub scrollbar — header color, hover-reveal on desktop */
.dashboard-center--tests-hub .tests-hub-scroll {
  --scroll-size-y: 7px;
  --scroll-thumb: color-mix(in srgb, var(--cw-header-color, #58cc02) 34%, transparent);
  --scroll-thumb-hover: color-mix(in srgb, var(--cw-header-color, #58cc02) 52%, transparent);
  --scroll-thumb-active: color-mix(in srgb, var(--cw-header-color, #58cc02) 62%, transparent);
  --scroll-track: transparent;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

.dashboard-center--tests-hub .tests-hub-scroll::-webkit-scrollbar {
  width: var(--scroll-size-y);
}

.dashboard-center--tests-hub .tests-hub-scroll::-webkit-scrollbar-track {
  background: var(--scroll-track);
  border-radius: var(--scroll-radius, 999px);
  margin: 10px 0 10px 8px;
}

.dashboard-center--tests-hub .tests-hub-scroll::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: var(--scroll-radius, 999px);
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: var(--scroll-transition, background 0.22s ease);
}

.dashboard-center--tests-hub .tests-hub-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
}

.dashboard-center--tests-hub .tests-hub-scroll::-webkit-scrollbar-thumb:active {
  background: var(--scroll-thumb-active);
}

@media (hover: hover) and (pointer: fine) {
  .dashboard-center--tests-hub .tests-hub-scroll {
    scrollbar-color: transparent transparent;
  }

  .dashboard-center--tests-hub .tests-hub-scroll:hover {
    scrollbar-color: var(--scroll-thumb) var(--scroll-track);
  }

  .dashboard-center--tests-hub .tests-hub-scroll::-webkit-scrollbar-thumb {
    background: transparent;
  }

  .dashboard-center--tests-hub .tests-hub-scroll:hover::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
  }

  .dashboard-center--tests-hub .tests-hub-scroll:hover::-webkit-scrollbar-thumb:hover {
    background: var(--scroll-thumb-hover);
  }

  .dashboard-center--tests-hub .tests-hub-scroll:hover::-webkit-scrollbar-thumb:active {
    background: var(--scroll-thumb-active);
  }
}

.dashboard-center--tests-hub .cw-page-content > .mobile-nav-top-bar {
  flex-shrink: 0;
  position: relative;
  top: auto;
  z-index: auto;
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 2px;
}

.dashboard-center--tests-hub .tests-hub-page {
  padding-top: 0;
}

.dashboard-center--tests-hub .cw-section-header-text {
  flex: 1;
  min-width: 0;
  width: auto;
  padding: 0;
  text-align: left;
}

.dashboard-center--tests-hub .cw-section-header {
  justify-content: space-between;
  text-align: left;
}

.dashboard-center--tests-hub .tests-mode-kicker,
.dashboard-center--tests-hub .cw-section-title {
  text-align: left;
}

.dashboard-center--tests-hub .cw-section-header--picker .cw-section-title {
  white-space: nowrap;
}

.dashboard-center--tests-hub .cw-section-header--level .cw-section-title {
  white-space: nowrap;
  text-transform: lowercase;
}

.cw-section-header--tests.cw-section-header--level,
.cw-section-header--tests.cw-section-header--picker {
  background: var(--cw-header-color, #58cc02);
}

/* Practice / Simulation — icon toggle inside header */
.tests-mode-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.tests-mode-kicker-icon {
  font-size: 0.95rem;
  opacity: 0.95;
}

.tests-mode-help-btn--header {
  width: 36px;
  height: 36px;
  margin-left: auto;
  margin-right: 6px;
  border-radius: 11px;
  border: 2px solid rgba(255, 255, 255, 0.34);
  border-bottom-width: 3px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  box-shadow: none;
}

/* Floating help button — bottom right, above mobile nav */
.tests-mode-help-fab {
  display: none;
  position: fixed;
  right: calc(var(--mobile-hub-pad-x, 16px) + 4px);
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  z-index: 1250;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-bottom-width: 4px;
  background: #58cc02;
  color: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 0 color-mix(in srgb, #58cc02 72%, #000),
    0 8px 20px rgba(0, 0, 0, 0.18);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.tests-mode-help-fab:hover {
  filter: brightness(1.05);
}

.tests-mode-help-fab:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
  box-shadow: 0 2px 0 color-mix(in srgb, #58cc02 72%, #000);
}

.tests-mode-help-fab .material-symbols-outlined {
  font-size: 1.35rem;
}

@media (max-width: 768px), (max-height: 520px) and (orientation: landscape) and (max-width: 1024px) {
  .tests-mode-help-fab {
    display: flex;
  }
}

.tests-full-exam-bar {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 4px;
}

.tests-mode-header-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 4px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.tests-mode-header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  border-radius: 11px;
  background: transparent;
  color: rgba(255, 255, 255, 0.58);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.tests-mode-header-btn .material-symbols-outlined {
  font-size: 1.2rem;
}

.tests-mode-header-btn.active {
  background: rgba(255, 255, 255, 0.96);
  color: var(--cw-header-color, #3b82f6);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
}

.tests-mode-header-btn:not(.active):hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.14);
}

.tests-mode-header-btn:active {
  transform: translateY(1px);
}

.tests-mode-help-btn--inline {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.tests-mode-help-btn:hover {
  border-color: #1cb0f6;
}

.tests-mode-help-btn:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.tests-mode-help-btn .material-symbols-outlined {
  font-size: 1.15rem;
}

@media (min-width: 769px) {
  .dashboard-center--tests-hub .tests-section-cards,
  .dashboard-center--tests-hub .tests-section-cards-grid,
  .dashboard-center--tests-hub .tests-full-exam-bar {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }

  .dashboard-center--tests-hub .cw-page-content {
    padding-left: 0;
    padding-right: 0;
  }
}

@keyframes testsModeHelpFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes testsModeHelpPopIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tests-mode-help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: testsModeHelpFadeIn 0.18s ease;
}

.tests-mode-help-modal {
  position: relative;
  background: #fff;
  border-radius: 24px;
  border: 2px solid #e5e5e5;
  border-bottom-width: 5px;
  border-bottom-color: #d0d0d0;
  max-width: 540px;
  width: 100%;
  padding: 22px 22px 20px;
  font-family: 'Nunito', sans-serif;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.14);
  animation: testsModeHelpPopIn 0.22s ease;
}

.tests-mode-help-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 2px solid #e5e5e5;
  border-bottom-width: 3px;
  border-radius: 50%;
  background: #fff;
  color: #94a3b8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s, border-color 0.12s, color 0.12s;
}

.tests-mode-help-close:hover {
  border-color: #cbd5e1;
  color: #64748b;
}

.tests-mode-help-close:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.tests-mode-help-close .material-symbols-outlined {
  font-size: 1.1rem;
}

.tests-mode-help-hero {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 36px 18px 0;
}

.tests-mode-help-mascot {
  width: 72px;
  height: auto;
  flex-shrink: 0;
}

.tests-mode-help-speech {
  position: relative;
  flex: 1;
  background: #fff8e6;
  border: 2px solid #f0e0b8;
  border-radius: 16px;
  padding: 12px 16px;
  margin-top: 6px;
}

.tests-mode-help-speech::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 22px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 10px solid #f0e0b8;
}

.tests-mode-help-speech::after {
  content: '';
  position: absolute;
  left: -7px;
  top: 23px;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 9px solid #fff8e6;
}

.tests-mode-help-kicker {
  margin: 0 0 2px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ff9600;
}

.tests-mode-help-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
  color: #3c3c3c;
  line-height: 1.25;
}

.tests-mode-help-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tests-mode-help-card {
  position: relative;
  border-radius: 16px;
  padding: 14px 12px 12px;
  border: 2px solid transparent;
  border-bottom-width: 4px;
}

.tests-mode-help-card--practice {
  background: #f0fdf4;
  border-color: #86efac;
  border-bottom-color: #4ade80;
}

.tests-mode-help-card--simulation {
  background: #faf5ff;
  border-color: #d8b4fe;
  border-bottom-color: #c084fc;
}

.tests-mode-help-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.tests-mode-help-card-badge {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tests-mode-help-card--practice .tests-mode-help-card-badge {
  background: #58cc02;
  color: #fff;
  box-shadow: 0 3px 0 #46a302;
}

.tests-mode-help-card--simulation .tests-mode-help-card-badge {
  background: #ce82ff;
  color: #fff;
  box-shadow: 0 3px 0 #a855f7;
}

.tests-mode-help-card-badge .material-symbols-outlined {
  font-size: 1.15rem;
}

.tests-mode-help-card-head {
  font-weight: 900;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tests-mode-help-card--practice .tests-mode-help-card-head { color: #166534; }
.tests-mode-help-card--simulation .tests-mode-help-card-head { color: #6b21a8; }

.tests-mode-help-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.tests-mode-help-list li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.4;
  color: #4b5563;
}

.tests-mode-help-check {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.tests-mode-help-check .material-symbols-outlined {
  font-size: 0.85rem;
  font-weight: 700;
}

.tests-mode-help-card--practice .tests-mode-help-check {
  background: #dcfce7;
  color: #16a34a;
}

.tests-mode-help-card--simulation .tests-mode-help-check {
  background: #f3e8ff;
  color: #9333ea;
}

.tests-mode-help-foot {
  margin: 14px 0 16px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #94a3b8;
  text-align: center;
  line-height: 1.45;
}

.tests-mode-help-cta {
  display: block;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 16px;
  background: #ff9600;
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 0.92rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 4px 0 #e68600;
  transition: filter 0.15s, transform 0.1s, box-shadow 0.1s;
}

.tests-mode-help-cta:hover {
  filter: brightness(1.05);
}

.tests-mode-help-cta:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #e68600;
}

.tests-path-map .bento-card-mixed,
.tests-path-map .mixed-test-card {
  width: 100%;
  max-width: 100%;
}

.dashboard-center--tests-hub .cw-path-map {
  min-height: 0;
}

/* Mobile: one scroll region inside cw-page-content (stats bar scrolls away there) */
@media (max-width: 768px), (max-height: 520px) and (orientation: landscape) and (max-width: 1024px) {
  body:has(.dashboard-center--tests-hub) .app-container {
    padding-top: 0;
    padding-bottom: 0;
    height: 100dvh;
    max-height: 100dvh;
  }

  .dashboard-center--tests-hub.dashboard-center--mobile-hub {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  .dashboard-center--tests-hub.dashboard-center--mobile-hub .cw-section-header.cw-section-header--tests.cw-section-header--duo {
    margin-left: var(--mobile-hub-pad-x, 16px);
    margin-right: var(--mobile-hub-pad-x, 16px);
    margin-top: var(--learning-stage-header-gap, 10px);
    justify-content: space-between;
    text-align: left;
  }

  .dashboard-center--tests-hub .cw-section-header-text {
    width: auto;
    flex: 1;
    min-width: 0;
    padding: 0;
    text-align: left;
  }

  .dashboard-center--tests-hub .cw-section-header--level .cw-section-header-text {
    padding-left: 48px;
  }

  .dashboard-center--tests-hub .tests-mode-kicker,
  .dashboard-center--tests-hub .cw-section-title {
    text-align: left;
    align-self: flex-start;
  }

  .dashboard-center--tests-hub.dashboard-center--mobile-hub .cw-page-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-left: var(--mobile-hub-pad-x, 16px);
    padding-right: var(--mobile-hub-pad-x, 16px);
    padding-top: 0;
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
  }

  .dashboard-center--tests-hub .tests-hub-page {
    padding-top: 0;
  }
}

/* ── Random Test path card (Duolingo style) ── */
.tests-random-path-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #c4b5fd;
  border-bottom-width: 4px;
  border-radius: 18px;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 55%, #e0e7ff 100%);
  color: #4c1d95;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
  transition: transform 0.1s, box-shadow 0.1s;
}

.tests-random-path-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.12);
}

.tests-random-path-card:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.tests-random-path-card--locked {
  border-color: #d1d5db;
  border-bottom-color: #9ca3af;
  background: #f8fafc;
  color: #64748b;
}

.tests-random-path-card--progress {
  border-color: #fcd34d;
  border-bottom-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #78350f;
}

.tests-random-path-card--done {
  border-color: #86efac;
  border-bottom-color: #22c55e;
  background: linear-gradient(135deg, #ecfdf5 0%, #dcfce7 100%);
  color: #166534;
}

.tests-random-path-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: #fff;
  box-shadow: 0 4px 0 #5b21b6;
}

.tests-random-path-card--locked .tests-random-path-icon-wrap {
  background: #94a3b8;
  box-shadow: 0 4px 0 #64748b;
}

.tests-random-path-card--progress .tests-random-path-icon-wrap {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 4px 0 #b45309;
}

.tests-random-path-card--done .tests-random-path-icon-wrap {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  box-shadow: 0 4px 0 #15803d;
}

.tests-random-path-icon-wrap .material-symbols-outlined {
  font-size: 1.5rem;
}

.tests-random-path-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tests-random-path-title {
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.2;
}

.tests-random-path-sub {
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.85;
}

.tests-random-path-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.14);
  font-size: 0.72rem;
  font-weight: 800;
}

.tests-random-path-lock .material-symbols-outlined {
  font-size: 1.1rem;
  color: #94a3b8;
}

.tests-random-path-chevron {
  flex-shrink: 0;
  color: inherit;
  opacity: 0.6;
}

.tests-random-path-chevron .material-symbols-outlined {
  font-size: 1.4rem;
}

/* ── Random Test dedicated page ── */
.tests-random-empty,
.tests-random-locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px 56px;
  text-align: center;
  font-family: 'Nunito', sans-serif;
}

.tests-random-empty-icon,
.tests-random-locked-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 24px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: #fff;
  box-shadow: 0 6px 0 #5b21b6;
}

.tests-random-locked-icon {
  background: #94a3b8;
  box-shadow: 0 6px 0 #64748b;
}

.tests-random-empty-icon .material-symbols-outlined,
.tests-random-locked-icon .material-symbols-outlined {
  font-size: 2.4rem;
}

.tests-random-empty h2,
.tests-random-locked h2 {
  margin: 8px 0 0;
  font-size: 1.35rem;
  font-weight: 900;
  color: #1e293b;
}

.tests-random-empty p,
.tests-random-locked p {
  margin: 0;
  max-width: 420px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1.5;
}

.tests-random-generate-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: 16px;
  background: #8b5cf6;
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 4px 0 #6d28d9;
  transition: transform 0.1s, box-shadow 0.1s;
}

.tests-random-generate-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #6d28d9;
}

.tests-random-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
}

.tests-random-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 2px solid #e5e5e5;
  border-bottom-width: 3px;
  border-radius: 14px;
  background: #fff;
  color: #475569;
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s;
}

.tests-random-action-btn:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.tests-random-action-btn--primary {
  border-color: #c4b5fd;
  border-bottom-color: #8b5cf6;
  background: #8b5cf6;
  color: #fff;
}

.tests-random-progress-pill {
  margin-left: auto;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.12);
  color: #6d28d9;
  font-family: 'Nunito', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
}

.tests-path-cell--locked {
  opacity: 0.72;
}

.tests-path-lock {
  position: absolute;
  bottom: 3px;
  right: 3px;
  font-size: 0.65rem;
  color: #94a3b8;
}

.tests-path-lock .material-symbols-outlined {
  font-size: 0.85rem;
}

/* ── Tests path list (one row per test) ── */
.tests-path-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.tests-path-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.tests-path-row-main,
.tests-path-section {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 2px solid #e5e7eb;
  border-bottom-width: 3px;
  border-radius: 12px;
  box-sizing: border-box;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.1s ease;
}

.tests-path-row-main {
  display: grid;
  flex-shrink: 0;
  width: 76px;
  min-width: 76px;
  max-width: 76px;
  height: 52px;
  min-height: 52px;
  max-height: 52px;
  padding: 0;
  background: #f3f4f6;
  border-color: #e5e7eb;
  border-bottom-color: #d1d5db;
  border-bottom-width: 3px;
  box-shadow: 0 3px 0 #d1d5db;
  color: #6b7280;
}

.tests-path-row-main .tests-path-cell-face {
  grid-area: 1 / 1;
}

.tests-path-row-main .tests-path-cell-face--hover {
  display: flex;
  visibility: hidden;
}

.tests-path-row-main:hover,
.tests-path-section:hover {
  transform: translateY(-1px);
  z-index: 2;
}

.tests-path-row-main:active,
.tests-path-section:active {
  transform: translateY(2px);
  box-shadow: none;
}

.tests-path-cell-face {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 2px 4px;
  box-sizing: border-box;
  text-align: center;
  line-height: 1.05;
}

.tests-path-cell-face--default {
  font-family: 'Nunito', sans-serif;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.tests-path-cell-face--test {
  flex-direction: row;
}

.tests-path-test-label {
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #6b7280;
  white-space: nowrap;
}

.tests-path-cell-face--hover {
  display: none;
  font-family: 'Nunito', sans-serif;
  font-size: 0.68rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: #374151;
}

.tests-path-row-main:hover .tests-path-cell-face--default,
.tests-path-row-main:focus-visible .tests-path-cell-face--default {
  visibility: hidden;
}

.tests-path-row-main:hover .tests-path-cell-face--hover,
.tests-path-row-main:focus-visible .tests-path-cell-face--hover {
  visibility: visible;
}

.tests-path-row--pending .tests-path-row-main {
  background: #f3f4f6;
  border-color: #e5e7eb;
  border-bottom-color: #d1d5db;
  box-shadow: 0 3px 0 #d1d5db;
}

.tests-path-row--pending .tests-path-test-label {
  color: #6b7280;
}

.tests-path-row--progress .tests-path-row-main {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #fcd34d;
  border-bottom-color: #f59e0b;
  box-shadow: 0 3px 0 #f59e0b;
}

.tests-path-row--progress .tests-path-test-label {
  color: #b45309;
}

.tests-path-row--done .tests-path-row-main {
  background: linear-gradient(135deg, #ecfdf5 0%, #dcfce7 100%);
  border-color: #86efac;
  border-bottom-color: #22c55e;
  box-shadow: 0 3px 0 #22c55e;
}

.tests-path-row--done .tests-path-test-label {
  color: #166534;
}

.tests-path-row--current .tests-path-row-main {
  border-color: var(--cw-icon-color, #1cb0f6);
  border-bottom-color: color-mix(in srgb, var(--cw-icon-color, #1cb0f6) 75%, #000);
  box-shadow:
    0 3px 0 color-mix(in srgb, var(--cw-icon-color, #1cb0f6) 55%, #fff),
    0 0 0 2px color-mix(in srgb, var(--cw-icon-color, #1cb0f6) 30%, transparent);
}

.tests-path-row--current.tests-path-row--pending .tests-path-row-main {
  background: color-mix(in srgb, var(--cw-card-bg, #eff6ff) 55%, #f3f4f6);
}

.tests-path-row--current.tests-path-row--progress .tests-path-row-main {
  background: color-mix(in srgb, var(--cw-card-bg, #eff6ff) 35%, #fef3c7);
}

.tests-path-row--current.tests-path-row--done .tests-path-row-main {
  background: color-mix(in srgb, var(--cw-card-bg, #eff6ff) 35%, #dcfce7);
}

.tests-path-row--current .tests-path-row-main .tests-path-test-label {
  color: var(--cw-card-text, #1e3a8a);
}

.tests-path-row--locked .tests-path-row-main {
  opacity: 0.65;
}

.tests-path-row-lock {
  position: absolute;
  bottom: 2px;
  right: 3px;
  color: #94a3b8;
  line-height: 1;
  pointer-events: none;
}

.tests-path-row-lock .material-symbols-outlined {
  font-size: 0.7rem;
}

.tests-path-row-sections {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.tests-path-section {
  width: auto;
  flex-shrink: 0;
  min-height: 52px;
  padding: 8px 12px 8px 14px;
}

.tests-path-cell-face--section {
  flex-direction: row;
  gap: 10px;
  justify-content: flex-start;
}

.tests-path-section-label {
  display: block;
  font-family: 'Nunito', sans-serif;
  font-size: 0.68rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--tps-title, #374151);
  white-space: nowrap;
}

.tests-path-section-score {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
}

.tests-path-section-score-detail {
  display: block;
  font-family: 'Nunito', sans-serif;
  font-size: 0.58rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--tps-title, #374151);
  white-space: normal;
  text-align: left;
}

.tests-path-section-stars {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1px;
  line-height: 1;
  flex-shrink: 0;
}

.tests-path-section-star {
  font-size: 0.5rem;
  line-height: 1;
  color: var(--tps-accent, #1cb0f6);
  opacity: 0.35;
}

.tests-path-section-star--filled {
  opacity: 1;
}

@media (min-width: 769px) {
  .tests-path-section-label {
    font-size: 0.78rem;
  }

  .tests-path-section-score-detail {
    font-size: 0.66rem;
  }

  .tests-path-section-star {
    font-size: 0.58rem;
  }

  .tests-path-section {
    flex: 1;
    min-width: 118px;
    padding: 10px 14px 10px 16px;
  }

  .tests-path-section-img,
  .tests-path-section-fallback.is-visible {
    width: 28px;
    height: 28px;
    max-width: 28px;
    max-height: 28px;
    margin-left: auto;
  }

  .tests-path-section-fallback.is-visible {
    font-size: 1.35rem;
  }

  .tests-path-cell-face--section {
    gap: 8px;
    justify-content: flex-start;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .tests-path-row {
    align-items: stretch;
  }

  .tests-path-row-sections {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-content: stretch;
  }

  .tests-path-section {
    width: 100%;
    min-width: 0;
    padding: 0;
    min-height: 56px;
    border-radius: 10px;
  }

  .tests-path-cell-face--section {
    flex-direction: column;
    gap: 2px;
    justify-content: center;
  }

  .tests-path-section-img,
  .tests-path-section-fallback {
    order: 1;
  }

  .tests-path-section-label {
    order: 2;
    font-size: 0.52rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
  }

  .tests-path-section-score {
    align-items: center;
    width: 100%;
  }

  .tests-path-section-score-detail {
    display: none;
  }

  .tests-path-section-stars {
    justify-content: center;
    gap: 0;
  }

  .tests-path-section-star {
    font-size: 0.42rem;
  }

  .tests-path-section-img,
  .tests-path-section-fallback.is-visible {
    width: 22px;
    height: 22px;
    max-width: 22px;
    max-height: 22px;
    margin-left: 0;
  }

  .tests-path-section-fallback.is-visible {
    font-size: 1.1rem;
  }

  .tests-path-row-main {
    width: 68px;
    min-width: 68px;
    max-width: 68px;
    height: auto;
    min-height: 56px;
    max-height: none;
    align-self: stretch;
    padding: 0;
    border-radius: 10px;
  }

  .tests-path-test-label {
    font-size: 0.76rem;
  }

  .tests-path-cell-face--hover {
    font-size: 0.62rem;
  }
}

.tests-path-section {
  background: var(--tps-bg, #fff);
  border-color: var(--tps-border, #e5e5e5);
  border-bottom-color: color-mix(in srgb, var(--tps-border, #d0d0d0) 80%, #9ca3af);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--tps-border, #d0d0d0) 65%, #fff);
}

.tests-path-section-img {
  width: 32px;
  height: 32px;
  max-width: 32px;
  max-height: 32px;
  object-fit: contain;
  pointer-events: none;
}

.tests-path-section-img.is-hidden {
  display: none;
}

.tests-path-section-fallback {
  display: none;
  font-size: 1.45rem;
  color: var(--tps-accent, #1cb0f6);
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 48;
}

.tests-path-section-fallback.is-visible {
  display: flex;
}

.tests-path-section--locked {
  opacity: 0.55;
  cursor: not-allowed;
}

.tests-path-section-lock {
  position: absolute;
  top: 2px;
  right: 3px;
  color: #94a3b8;
  line-height: 1;
  pointer-events: none;
}

.tests-path-section-lock .material-symbols-outlined {
  font-size: 0.65rem;
}

@media (max-width: 480px) {
  .tests-path-row,
  .tests-path-row-sections {
    gap: 6px;
  }

  .tests-path-row-main {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    height: auto;
    min-height: 44px;
    max-height: none;
    align-self: stretch;
    padding: 0;
  }

  .tests-path-section {
    min-height: 44px;
  }

  .tests-path-test-label {
    font-size: 0.7rem;
  }
}

.tests-section-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  padding-bottom: 0;
}

.tests-full-exam-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: 16px;
  background: #ce82ff;
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 4px 0 #a855f7;
  transition: transform 0.1s, box-shadow 0.1s;
  flex-shrink: 0;
}

.tests-full-exam-btn--inline {
  align-self: center;
  width: min(100%, 300px);
  padding: 11px 20px;
  border-radius: 14px;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  box-shadow: 0 3px 0 #a855f7;
}

.tests-full-exam-btn--inline .material-symbols-outlined {
  font-size: 1.1rem;
}

.tests-full-exam-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #a855f7;
}

.tests-full-exam-btn--inline:active {
  box-shadow: 0 1px 0 #a855f7;
}

.tests-section-cards-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  width: 100%;
}

@media (min-width: 769px) {
  .tests-section-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Tests level picker — Duolingo-style Cambridge exam cards */
.cw-level-cards.tests-level-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  padding: 4px 0 8px;
  box-sizing: border-box;
}

.tests-level-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.tests-level-continue {
  display: none;
}

@media (min-width: 769px) {
  .tests-level-continue {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 10px 14px;
    background: #fff;
    border: 1.5px solid color-mix(in srgb, var(--tl-border, #e5e5e5) 70%, #fff);
    border-radius: 14px;
    cursor: pointer;
    text-align: left;
    transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.1s ease;
    box-sizing: border-box;
  }

  .tests-level-continue:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--tl-accent, #1cb0f6) 16%, transparent);
    border-color: color-mix(in srgb, var(--tl-accent, #1cb0f6) 45%, #fff);
  }

  .tests-level-continue:active {
    transform: translateY(1px);
    box-shadow: none;
  }

  .tests-level-continue:focus {
    outline: none;
  }

  .tests-level-continue:focus-visible {
    outline: 3px solid var(--tl-accent, #1cb0f6);
    outline-offset: 2px;
  }

  .tests-level-continue .material-symbols-outlined {
    flex-shrink: 0;
    font-size: 1.35rem;
    color: var(--tl-accent, #1cb0f6);
  }

  .tests-level-continue-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
  }

  .tests-level-continue-label {
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--tl-accent, #1cb0f6);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.2;
  }

  .tests-level-continue-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.25;
  }

  .tests-level-continue-sub {
    font-size: 0.74rem;
    font-weight: 600;
    color: #64748b;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.tests-level-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 18px 20px;
  background: var(--tl-bg, #fff);
  border: 2px solid var(--tl-border, #e5e5e5);
  border-bottom: 4px solid var(--tl-shadow, #d0d0d0);
  border-radius: 18px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.1s ease;
  box-sizing: border-box;
}

.tests-level-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--tl-shadow, #d0d0d0) 28%, transparent);
}

.tests-level-card:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
  box-shadow: none;
}

.tests-level-card:focus {
  outline: none;
}

.tests-level-card:focus-visible {
  outline: 3px solid var(--tl-accent, #1cb0f6);
  outline-offset: 2px;
}

.tests-level-card-ring {
  position: relative;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
}

.tests-level-card-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.tests-level-card-ring-track,
.tests-level-card-ring-fill {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
}

.tests-level-card-ring-fill {
  transition: stroke-dasharray 0.3s ease;
}

.tests-level-card-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Nunito', sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
  pointer-events: none;
}

.tests-level-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tests-level-card-badge {
  font-family: 'Nunito', sans-serif;
  font-size: clamp(1.65rem, 2.8vw, 2rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
}

.tests-level-card-avg {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tests-level-card-avg--empty .tests-level-card-avg-label {
  font-size: 0.72rem;
  line-height: 1.35;
}

.tests-level-card-avg-value {
  font-family: 'Nunito', sans-serif;
  font-size: 1.15rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.tests-level-card-avg-label {
  font-family: 'Nunito', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  color: #9aa3af;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

@media (max-width: 768px) {
  .cw-level-cards.tests-level-cards {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 8px 0 14px;
  }

  .tests-level-card {
    padding: 16px 18px;
    gap: 14px;
  }

  .tests-level-card-ring {
    width: 56px;
    height: 56px;
  }

  .tests-level-card-badge {
    font-size: 1.75rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .tests-level-card {
    padding: 16px 14px;
    gap: 12px;
  }

  .tests-level-card-ring {
    width: 56px;
    height: 56px;
  }

  .tests-level-card-ring-label {
    font-size: 0.65rem;
  }

  .tests-level-card-badge {
    font-size: 1.55rem;
  }

  .tests-level-card-avg-value {
    font-size: 1rem;
  }
}

.tests-section-card {
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: 148px;
  background: var(--tests-card-bg, #fff);
  border: 2px solid var(--tests-card-border, #e5e5e5);
  border-bottom-width: 4px;
  border-radius: 18px;
  overflow: hidden;
  transition: transform 0.12s, box-shadow 0.12s;
}

.tests-section-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.tests-section-card-body {
  flex: 1;
  min-width: 0;
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1;
}

.tests-section-card-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.tests-section-card-icon {
  font-size: 1.35rem;
  color: var(--tests-card-accent, #1cb0f6);
}

.tests-section-card-title {
  margin: 0;
  font-family: 'Nunito', sans-serif;
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--tests-card-title, #3c3c3c);
  text-align: left;
}

.tests-section-card-parts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.tests-section-card-parts.tests-section-card-parts--grid {
  display: grid;
  grid-template-columns: repeat(4, 34px);
  gap: 6px;
  align-items: center;
}

.tests-part-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  height: 34px;
  padding: 0;
  box-sizing: border-box;
  border-radius: 10px;
  border: 2px solid #d1d5db;
  border-bottom-width: 3px;
  background: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  color: #64748b;
  cursor: pointer;
  transition: transform 0.08s, border-color 0.12s, background 0.12s, color 0.12s;
}

.tests-part-chip:hover:not(.tests-part-chip--locked) {
  border-color: var(--tests-card-accent, #1cb0f6);
  color: var(--tests-card-accent, #1cb0f6);
}

.tests-part-chip:active:not(.tests-part-chip--locked) {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.tests-part-chip--done {
  background: #dcfce7;
  border-color: #86efac;
  border-bottom-color: #4ade80;
  color: #166534;
}

.tests-part-chip--progress {
  background: #fef3c7;
  border-color: #fcd34d;
  border-bottom-color: #fbbf24;
  color: #b45309;
}

.tests-part-chip--locked {
  opacity: 0.55;
  cursor: not-allowed;
}

.tests-section-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.tests-section-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border: none;
  border-radius: 12px;
  background: var(--tests-card-accent, #1cb0f6);
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--tests-card-accent, #1cb0f6) 70%, #000);
}

.tests-section-play-btn:active {
  transform: translateY(2px);
  box-shadow: none;
}

.tests-section-play-btn--locked {
  background: #94a3b8;
  box-shadow: 0 3px 0 #64748b;
}

.tests-section-results-btn {
  width: 36px;
  height: 36px;
  border: 2px solid #e5e5e5;
  border-bottom-width: 3px;
  border-radius: 10px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tests-section-card-art {
  position: relative;
  width: 148px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px 0 0;
  pointer-events: none;
}

.tests-section-card-img {
  width: 100%;
  max-width: 136px;
  max-height: 136px;
  object-fit: contain;
  object-position: center;
}

.tests-section-card--reading .tests-section-card-art,
.tests-section-card--listening .tests-section-card-art,
.tests-section-card--writing .tests-section-card-art {
  width: 178px;
}

.tests-section-card--reading .tests-section-card-img,
.tests-section-card--listening .tests-section-card-img,
.tests-section-card--writing .tests-section-card-img {
  max-width: 168px;
  max-height: 168px;
}

.tests-section-card--listening .tests-section-card-img {
  transform: rotate(-14deg);
}

.tests-section-card-img.is-hidden {
  display: none;
}

.tests-section-card-fallback {
  display: none;
  font-size: 3.5rem;
  color: var(--tests-card-accent, #1cb0f6);
  opacity: 0.25;
  align-self: center;
}

.tests-section-card-fallback.is-visible {
  display: block;
}

.tests-free-badge {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 7px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
}

.tests-section-card--locked {
  opacity: 0.88;
}

.tests-sidebar-stats {
  background: linear-gradient(145deg, #bbf7d0 0%, #86efac 100%);
  border-radius: 16px;
  padding: 18px 16px 14px;
  margin-bottom: 12px;
  box-shadow: 0 3px 12px rgba(34, 197, 94, 0.18);
}

.tests-sidebar-mode {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #166534;
  margin-bottom: 12px;
}

.tests-sidebar-stats .cw-sidebar-stat-num {
  color: #14532d;
}

.tests-sidebar-stats .cw-sidebar-stat-label,
.tests-sidebar-stats .cw-sidebar-prog-label {
  color: #166534;
}

.tests-sidebar-stats .cw-sidebar-prog-fill {
  background: linear-gradient(90deg, #22c55e 0%, #15803d 100%);
}

.bento-card-tests {
  background: linear-gradient(135deg, #ecfccb 0%, #d9f99d 55%, #fef08a 100%);
  color: #365314;
  cursor: pointer;
  min-height: 180px;
}

.bento-card-tests .bento-card-title {
  color: #3f6212;
}

.bento-card-tests::after {
  content: '';
  position: absolute;
  bottom: -30px;
  right: -10px;
  width: 200px;
  height: 240px;
  opacity: 1;
  background-image: url(../../Assets/images/Ascent.png);
  background-repeat: no-repeat;
  background-size: contain;
  background-position: bottom right;
  pointer-events: none;
}

@media (max-width: 900px) {
  .tests-section-card-art {
    width: 112px;
  }

  .tests-section-card--reading .tests-section-card-art,
  .tests-section-card--listening .tests-section-card-art,
  .tests-section-card--writing .tests-section-card-art {
    width: 132px;
  }

  .tests-section-card-img {
    max-width: 104px;
    max-height: 104px;
  }

  .tests-section-card--reading .tests-section-card-img,
  .tests-section-card--listening .tests-section-card-img,
  .tests-section-card--writing .tests-section-card-img {
    max-width: 124px;
    max-height: 124px;
  }
}

@media (max-width: 768px) {
  .dashboard-center--tests-hub .tests-section-cards-grid {
    width: 100%;
  }

  .dashboard-center--tests-hub .tests-mode-header-btn {
    width: 34px;
    height: 34px;
  }

  .dashboard-center--tests-hub .tests-mode-header-btn .material-symbols-outlined {
    font-size: 1.1rem;
  }

  .tests-mode-help-cards {
    grid-template-columns: 1fr;
  }

  .tests-mode-help-hero {
    margin-right: 28px;
  }

  .tests-mode-help-mascot {
    width: 56px;
  }

  .tests-mode-help-speech {
    padding: 10px 12px;
  }

  .tests-mode-help-title {
    font-size: 1.05rem;
  }

  .tests-section-card {
    min-height: 120px;
    overflow: hidden;
  }

  .tests-section-card-body {
    padding-right: 92px;
  }

  .tests-section-card-art {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 92px;
    padding: 10px 8px 10px 0;
    justify-content: flex-end;
    align-items: center;
  }

  .tests-section-card--reading .tests-section-card-art,
  .tests-section-card--listening .tests-section-card-art,
  .tests-section-card--writing .tests-section-card-art {
    width: 100px;
  }

  .tests-section-card-img {
    max-width: 84px;
    max-height: 84px;
    object-position: right center;
  }

  .tests-section-card--reading .tests-section-card-img,
  .tests-section-card--listening .tests-section-card-img,
  .tests-section-card--writing .tests-section-card-img {
    max-width: 92px;
    max-height: 92px;
  }

  .tests-section-card--listening .tests-section-card-img {
    transform: rotate(-10deg);
  }

  .tests-full-exam-btn--inline {
    width: min(100%, 280px);
    padding: 12px 18px;
    font-size: 0.82rem;
  }

  /* Larger touch targets for part chips on mobile */
  .tests-part-chip {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 0.88rem;
  }

  .tests-section-card-parts.tests-section-card-parts--grid {
    grid-template-columns: repeat(4, 40px);
  }

  /* Section play button: taller for easier tapping */
  .tests-section-play-btn {
    padding: 10px 16px;
    min-height: 40px;
    font-size: 0.82rem;
  }

  .tests-section-results-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .bento-card-tests {
    min-height: 70px !important;
  }

  .bento-card-tests::after {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .tests-section-card-body {
    padding: 14px 80px 12px 14px;
  }

  .tests-section-card-art {
    width: 76px;
    padding-right: 6px;
  }

  .tests-section-card--reading .tests-section-card-art,
  .tests-section-card--listening .tests-section-card-art,
  .tests-section-card--writing .tests-section-card-art {
    width: 84px;
  }

  .tests-section-card-img {
    max-width: 72px;
    max-height: 72px;
  }

  .tests-section-card--reading .tests-section-card-img,
  .tests-section-card--listening .tests-section-card-img,
  .tests-section-card--writing .tests-section-card-img {
    max-width: 78px;
    max-height: 78px;
  }

  /* Section card title row wraps nicely */
  .tests-section-card-title-row {
    gap: 6px;
  }
}

/* Very small phones: further compaction */
@media (max-width: 360px) {
  .tests-part-chip {
    width: 36px;
    min-width: 36px;
    max-width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 0.82rem;
  }

  .tests-section-card-parts.tests-section-card-parts--grid {
    grid-template-columns: repeat(4, 36px);
  }

  .tests-section-card {
    min-height: 100px;
  }

  .tests-section-card-body {
    padding: 12px 72px 10px 12px;
    gap: 8px;
  }

  .tests-section-card-art {
    width: 68px;
  }

  .tests-section-card--reading .tests-section-card-art,
  .tests-section-card--listening .tests-section-card-art,
  .tests-section-card--writing .tests-section-card-art {
    width: 74px;
  }

  .tests-section-card-img {
    max-width: 64px;
    max-height: 64px;
  }

  .tests-section-card--reading .tests-section-card-img,
  .tests-section-card--listening .tests-section-card-img,
  .tests-section-card--writing .tests-section-card-img {
    max-width: 68px;
    max-height: 68px;
  }

  .tests-section-card-title {
    font-size: 0.95rem;
  }
}
