/* ── App shell ── */
body {
  overscroll-behavior-y: contain;
}

#app {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  background: var(--color-bg);
}

/* ── Page transitions ── */
.page-enter {
  animation: pageIn var(--duration-normal) var(--ease-out) forwards;
}

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

/* ── Page wrapper ── */
.page {
  padding: calc(var(--space-6) + var(--space-1)) var(--space-6) var(--space-6);
  padding-bottom: var(--space-6);
  min-height: 100dvh;
}

#app.app--with-bottom-nav .page {
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + var(--space-4));
}

.page--no-nav {
  padding-bottom: var(--space-4);
}

/* ── Topbar (shared navigation header) ── */
.topbar {
  display: grid;
  grid-template-columns: 2.25rem 1fr 2.25rem;
  align-items: center;
  margin-bottom: var(--space-3);
}

.topbar__btn {
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.topbar__btn svg {
  width: 1.1rem;
  height: 1.1rem;
}

.topbar__btn--ghost {
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.topbar__title {
  text-align: center;
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
}

/* ── Reusable icon buttons ── */
.icon-btn {
  --icon-btn-size: 2.25rem;
  width: var(--icon-btn-size);
  height: var(--icon-btn-size);
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast), opacity var(--duration-fast);
  -webkit-tap-highlight-color: transparent;
}

.icon-btn svg,
.icon-btn i {
  width: 0.95rem;
  height: 0.95rem;
  font-size: 0.95rem;
  line-height: 1;
}

.icon-btn--subtle {
  --icon-btn-size: 1.875rem;
  background: transparent;
  color: var(--color-text-muted);
  box-shadow: none;
  opacity: 0.8;
}

.icon-btn--subtle:hover {
  opacity: 1;
  background: var(--color-surface-alt);
}

.icon-btn--subtle:active {
  opacity: 1;
}

/* ── User row ── */
.user-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.user-row__avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--color-primary-bg);
  flex-shrink: 0;
}

.user-row__info {
  flex: 1;
  min-width: 0;
}

.user-row__name {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-row__sub {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

/* ── Bottom Navigation (barra flotante + muesca + FAB) ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  z-index: 100;
  padding: 0 var(--space-4) calc(var(--safe-bottom) + var(--space-2));
  padding-top: 1rem; /* compacto sin perder espacio para el FAB */
  pointer-events: none;
}

.bottom-nav__surface {
  position: relative;
  width: 100%;
  color: var(--color-surface);
  filter: drop-shadow(0 0.375rem 1rem rgba(17, 24, 39, 0.1))
    drop-shadow(0 0.125rem 0.25rem rgba(17, 24, 39, 0.04));
  pointer-events: auto;
}

.bottom-nav__shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.bottom-nav__row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 4rem;
  padding: var(--space-1) var(--space-1) var(--space-2);
}

.bottom-nav__fab-slot {
  position: relative;
  width: 3.5rem;
  height: 1px;
  align-self: start;
  justify-self: center;
  margin-top: 0;
}

.bottom-nav__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-1) var(--space-1) 0;
  border-radius: var(--radius-lg);
  transition: color var(--duration-fast) var(--ease-out);
  color: var(--color-icon);
  min-height: 2.9rem;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav__btn--active {
  color: var(--color-icon-active);
}

.bottom-nav__btn svg {
  width: 1.35rem;
  height: 1.35rem;
}

/* FAB centrado en la muesca (mitad arriba de la barra) */
.bottom-nav__cta {
  position: absolute;
  left: 50%;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0;
  padding: 0;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-md), 0 0 0 3px var(--color-primary-bg);
  transform: translate(-50%, -50%);
  transition: transform var(--duration-fast) var(--ease-spring),
    box-shadow var(--duration-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav__cta:active {
  transform: translate(-50%, -50%) scale(0.94);
}

.bottom-nav__cta--disabled,
.bottom-nav__cta[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--color-text-muted);
  box-shadow: var(--shadow-sm);
}

.bottom-nav__cta--disabled:active,
.bottom-nav__cta[aria-disabled="true"]:active {
  transform: translate(-50%, -50%);
}

.bottom-nav__cta svg {
  width: 1.625rem;
  height: 1.625rem;
}

/* ── Bottom Sheet ── */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.4);
  z-index: 200;
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
  pointer-events: none;
}

.sheet-overlay--visible {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 100%);
  width: 100%;
  max-width: var(--max-width);
  background: var(--color-surface);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  padding: var(--space-5);
  padding-bottom: calc(var(--space-6) + var(--safe-bottom));
  z-index: 201;
  box-shadow: var(--shadow-sheet);
  transition: transform var(--duration-slow) var(--ease-out);
  max-height: 85dvh;
  overflow-y: auto;
}

.sheet--variant-prep-test {
  height: 75dvh;
  max-height: 75dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sheet--variant-prep-test .prep-test {
  flex: 1;
  min-height: 0;
}

.sheet--visible {
  transform: translate(-50%, 0);
}

.sheet__handle {
  width: 2.5rem;
  height: 0.25rem;
  background: var(--color-border);
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-5);
}

.sheet__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-4);
  text-align: center;
}

/* ── Toast ── */
.toast {
  position: fixed;
  top: calc(var(--space-4) + var(--safe-top));
  left: 50%;
  transform: translate(-50%, calc(-100% - var(--space-3)));
  opacity: 0;
  visibility: hidden;
  max-width: calc(var(--max-width) - var(--space-8));
  width: max-content;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  z-index: 300;
  box-shadow: var(--shadow-lg);
  transition:
    transform var(--duration-normal) var(--ease-spring),
    opacity var(--duration-fast) var(--ease-out),
    visibility 0s linear var(--duration-fast);
  pointer-events: none;
}

.toast--visible {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
  transition:
    transform var(--duration-normal) var(--ease-spring),
    opacity var(--duration-fast) var(--ease-out),
    visibility 0s;
}

.toast--offline {
  background: var(--color-text);
  color: #fff;
}

.toast--online {
  background: var(--color-success);
  color: #fff;
}

.toast--error {
  background: var(--color-error);
  color: #fff;
}

/* ── Stat cards ── */
.stats-dashboard {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-height: min(70dvh, 42rem);
}

.stats-dashboard__chart-section {
  flex: 2;
  min-height: 0;
}

.stats-dashboard__metrics-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.stats-dashboard__metrics-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.stats-dashboard__metrics-caption {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.stats-chart {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5);
}

.stats-chart__meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.stats-chart__title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}

.stats-chart__description {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.stats-chart__frame {
  flex: 1;
  min-height: 15rem;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(238,241,244,.9) 0%, rgba(255,255,255,1) 100%);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.stats-chart__canvas {
  height: 100%;
  padding: var(--space-3) var(--space-2) var(--space-2);
}

.stats-chart__status {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-align: center;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.stat-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--color-border);
  text-align: left;
}

.stat-card__value {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  line-height: var(--leading-tight);
}

.stat-card__label {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-top: var(--space-1);
}

@media (max-width: 380px) {
  .stats-dashboard {
    min-height: auto;
  }

  .stats-chart__frame {
    min-height: 13.5rem;
  }
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: var(--space-1);
  background: var(--color-surface-alt);
  border-radius: var(--radius-xl);
  padding: 4px;
  margin-bottom: var(--space-5);
}

.tabs__btn {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  border: none;
  background: transparent;
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast);
  -webkit-tap-highlight-color: transparent;
}

.tabs__btn--active {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-xs);
  font-weight: var(--weight-semibold);
}

/* ── Ranking list ── */
.ranking-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  margin-inline: auto;
  width: fit-content;
}

.ranking-header__nav {
  justify-self: center;
}

.ranking-header__nav:disabled {
  opacity: 0.35;
  pointer-events: none;
}

.ranking-header__date {
  text-align: center;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  text-transform: capitalize;
  min-width: 8.5rem;
}

.ranking-metrics-header {
  display: flex;
  justify-content: flex-end;
  padding-inline: var(--space-4);
  margin-bottom: var(--space-1);
}

.ranking-metrics-header__label {
  min-width: 5rem;
  text-align: right;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.ranking-list__empty {
  margin: 0;
  padding: var(--space-6) var(--space-4);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Superficie estándar reutilizable en listas interactivas */
:is(.ranking-item, .profile-row) {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--color-border);
}

.ranking-item {
  transition: box-shadow var(--duration-fast) var(--ease-out);
}

.ranking-item__pos {
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  border-radius: var(--radius-full);
  background: var(--color-primary-bg);
  color: var(--color-primary);
  flex-shrink: 0;
}

.ranking-item__pos--gold   { background: #ECEFF3; color: #4B5563; }
.ranking-item__pos--silver { background: #EFF1F4; color: #6B7280; }
.ranking-item__pos--bronze { background: #F3F4F6; color: #6B7280; }

.ranking-item__avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--color-primary-bg);
  border: 2px solid transparent;
  flex-shrink: 0;
}

.ranking-item__avatar--gold   { border-color: #D4AF37; }
.ranking-item__avatar--silver { border-color: #C0C0C0; }
.ranking-item__avatar--bronze { border-color: #CD7F32; }

.ranking-item__name {
  flex: 1;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-item__score {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  line-height: 1.1;
}

.ranking-item__metrics {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  margin-left: auto;
  gap: 2px;
  transform: translateY(-1px);
}

.ranking-item__avg {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  line-height: 1;
}

.ranking-item__score,
.ranking-item__avg {
  min-width: 5rem;
  text-align: right;
  white-space: nowrap;
}

/* ── Activity timeline ── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-left: var(--space-5);
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--color-border);
  border-radius: 1px;
}

.timeline__item {
  position: relative;
}

.timeline__dot {
  position: absolute;
  left: calc(-1 * var(--space-5) + 2px);
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  border: 2px solid var(--color-bg);
}

.timeline__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.timeline__desc {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.timeline__time {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

.timeline__empty {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  padding-left: var(--space-1);
}

/* ── Profile ── */
.profile-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.profile-public-name__hint {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
  margin: calc(-1 * var(--space-1)) 0 0;
}

.profile-public-name-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.profile-public-name-page .profile-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.input-group__label {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.input-group__field {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  color: var(--color-text);
  outline: none;
}

.input-group__field:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 20%, transparent);
}

.profile-public-name__feedback {
  min-height: 1.25rem;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.profile-public-name__submit {
  width: 100%;
}

.profile-contact-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.profile-contact__hint {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  margin: calc(-1 * var(--space-1)) 0 0;
}

.profile-contact__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.profile-contact__textarea {
  min-height: 8.5rem;
  resize: vertical;
}

.profile-contact__email {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.profile-contact__length {
  min-height: 1rem;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.profile-contact__length--error {
  color: var(--color-error);
}

.profile-contact__feedback {
  min-height: 1.25rem;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.profile-contact__submit {
  width: 100%;
}

.profile-subscription-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.profile-subscription__hint {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  margin: calc(-1 * var(--space-1)) 0 0;
}

.profile-subscription__actions .btn {
  width: 100%;
}

.profile-subscription__inline-hint {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

.profile-subscription__plans {
  display: grid;
  gap: var(--space-2);
}

.profile-subscription__status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: var(--radius-full);
  padding: 0.15rem 0.55rem;
  font-weight: var(--weight-semibold);
}

.profile-subscription__status--active {
  border: 1px solid color-mix(in srgb, var(--color-success, #16A34A) 35%, var(--color-border));
  background: color-mix(in srgb, var(--color-success, #16A34A) 12%, var(--color-surface));
  color: var(--color-success, #15803D);
}

.profile-subscription__status--warning {
  border: 1px solid color-mix(in srgb, #F59E0B 45%, var(--color-border));
  background: color-mix(in srgb, #F59E0B 12%, var(--color-surface));
  color: #B45309;
}

.profile-subscription__status--muted {
  border: 1px solid var(--color-border);
  background: color-mix(in srgb, var(--color-border) 35%, var(--color-surface));
  color: var(--color-text-secondary);
}


.profile-hero {
  text-align: center;
  padding-top: var(--space-2);
}

.profile-hero__avatar-wrap {
  position: relative;
  width: fit-content;
  margin: 0 auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.profile-hero__avatar-wrap:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
}

.profile-hero__avatar {
  width: 5.25rem;
  height: 5.25rem;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: #E5E7EB;
  box-shadow: 0 0 0 4px var(--color-surface), var(--shadow-md);
}

.profile-hero__avatar--fallback {
  background: var(--color-primary-bg);
}

.profile-hero__edit-btn {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-hero__edit-btn svg {
  width: 0.9rem;
  height: 0.9rem;
}

.profile-hero__name {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin-top: var(--space-3);
}

.profile-hero__badge {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-1);
}

.profile-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.profile-row {
  transition: box-shadow var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.profile-row + .profile-row {
  border-top: none;
}

.profile-row--button {
  width: 100%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a.profile-row--button {
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
}

.profile-row--button:active {
  transform: translateY(1px);
  box-shadow: var(--shadow-xs);
}

.profile-row--button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.profile-row--meta {
  cursor: default;
}

.profile-row--meta .profile-row__value {
  font-variant-numeric: tabular-nums;
  color: var(--color-text-secondary);
}

.profile-row--readonly {
  /* Mantener el mismo borde/fondo base que el resto de filas. */
  border-style: solid;
  border-color: var(--color-border);
  background: var(--color-surface);
}

.profile-row--readonly .profile-row__label {
  color: color-mix(in srgb, var(--color-primary) 60%, var(--color-text-muted));
}

.profile-row__meta-badge {
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--color-primary) 26%, var(--color-border));
  background: color-mix(in srgb, var(--color-primary-bg) 62%, var(--color-surface));
  color: color-mix(in srgb, var(--color-primary) 78%, var(--color-text));
  border-radius: var(--radius-full);
  padding: 0.15rem 0.55rem;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  white-space: nowrap;
}

.profile-row--danger {
  border-color: #F3D7D7;
  color: var(--color-error);
}

.profile-row--danger .profile-row__icon {
  color: var(--color-error);
  background: color-mix(in srgb, var(--color-error) 12%, var(--color-surface-alt));
}

.profile-row--danger .profile-row__value {
  color: var(--color-error);
  font-weight: var(--weight-semibold);
}

.profile-reset-app {
  width: 100%;
  margin-top: calc(-1 * var(--space-1));
  border-radius: var(--radius-xl);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.profile-reset-app:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: var(--shadow-xs);
}

.profile-reset-app:disabled {
  opacity: 0.6;
  cursor: wait;
}

.profile-reset-app svg {
  width: 1rem;
  height: 1rem;
}

/* ── Avatar route ── */
.profile-avatar-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.profile-avatar-page--busy {
  pointer-events: none;
  opacity: 0.85;
}

.profile-avatar__current,
.profile-avatar__upload,
.profile-avatar__presets {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs);
  padding: var(--space-4);
}

.profile-avatar__current {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.profile-avatar__current-wrap {
  position: relative;
}

.profile-avatar__label {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.profile-avatar__current-img {
  width: 6rem;
  height: 6rem;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: #E5E7EB;
}

.profile-avatar__current-img--fallback {
  background: var(--color-primary-bg);
}

.profile-avatar__remove-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 1.5rem;
  height: 1.5rem;
  border: none;
  border-radius: var(--radius-full);
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.profile-avatar__remove-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.profile-avatar__section-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}

.profile-avatar__hint {
  margin-top: var(--space-1);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

.profile-avatar__file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.profile-avatar__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.profile-avatar__option {
  border: 2px solid transparent;
  border-radius: var(--radius-xl);
  background: transparent;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.profile-avatar__option:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.profile-avatar__option--selected {
  border-color: var(--color-primary);
}

.profile-avatar__option-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.profile-avatar__skeleton {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-xl);
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 45%, #e5e7eb 65%);
  background-size: 220% 100%;
  animation: avatarSkeletonShimmer 1.1s linear infinite;
}

@keyframes avatarSkeletonShimmer {
  from { background-position: 100% 0; }
  to { background-position: -120% 0; }
}

.profile-avatar__empty {
  margin-top: var(--space-3);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

/* Shared button tokens used by profile actions and sheets */
.btn {
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-out), opacity var(--duration-fast) var(--ease-out);
}

.btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
}

.btn--outline {
  border-color: var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
}

.btn--danger {
  background: var(--color-error);
  color: #fff;
}

/* ── Reusable Confirm Dialog ── */
.confirm-dialog__overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.confirm-dialog {
  width: 100%;
  max-width: 26rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.confirm-dialog:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.confirm-dialog__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

.confirm-dialog__message {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
}

.confirm-dialog__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.profile-row__icon {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  background: var(--color-surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-row__icon svg {
  width: 1rem;
  height: 1rem;
}

.profile-row__text {
  flex: 1;
  min-width: 0;
}

.profile-row__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.profile-row__value {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-row__value--single {
  flex: 1;
}

.profile-row__chevron {
  width: 1rem;
  height: 1rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.profile-section__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-3);
}

.profile-doc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.profile-doc-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--color-border);
  min-height: 6.25rem;
}

.profile-doc-card__icon {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  background: var(--color-surface-alt);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-doc-card__icon svg {
  width: 0.95rem;
  height: 0.95rem;
}

.profile-doc-card__title {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.profile-doc-card__id {
  margin-top: 2px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  word-break: break-word;
}

.profile-logout {
  width: 100%;
  margin-top: var(--space-2);
  border: none;
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
  border: 1px solid #F3D7D7;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  color: var(--color-error);
  font-weight: var(--weight-semibold);
  -webkit-tap-highlight-color: transparent;
}

.profile-logout svg {
  width: 1rem;
  height: 1rem;
}

/* ── Login ── */
.login-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100dvh;
  padding: var(--space-8) var(--space-6);
}

.login-page__logo {
  width: 4rem;
  height: 4rem;
  border-radius: var(--radius-xl);
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  margin: 0 auto var(--space-6);
  box-shadow: var(--shadow-md);
}

.login-page__title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  text-align: center;
  margin-bottom: var(--space-1);
}

.login-page__subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-align: center;
  margin-bottom: var(--space-8);
}

.login-page__auth {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.login-page__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  padding: var(--space-1);
  background: var(--color-surface-secondary, #f0f2f5);
  border-radius: var(--radius-lg);
}

.login-page__tab {
  padding: var(--space-3) var(--space-4);
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.login-page__tab--active {
  background: var(--color-surface, #fff);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

.login-page__panel--hidden {
  display: none;
}

.login-page__terms {
  margin-top: calc(-1 * var(--space-2));
}

.login-page__terms-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  line-height: 1.4;
}

.login-page__terms-input {
  flex-shrink: 0;
  margin-top: 0.2rem;
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--color-primary);
}

.login-page__terms-text {
  flex: 1;
}

.onboarding-page .profile-avatar__grid {
  margin-bottom: var(--space-4);
}

.onboarding-avatar__grid {
  max-width: 100%;
}

.login-page__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.login-page__error {
  padding: var(--space-3) var(--space-4);
  background: var(--color-error-bg);
  color: var(--color-error);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  text-align: center;
  display: none;
}

.login-page__error--visible {
  display: block;
}

.login-page__success {
  padding: var(--space-3) var(--space-4);
  background: var(--color-success-bg, #e8f5e9);
  color: var(--color-success, #2e7d32);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  text-align: center;
}

.login-page__links {
  margin: calc(-1 * var(--space-2)) 0 0;
  text-align: right;
}

.login-page__links--center {
  text-align: center;
  margin-top: var(--space-4);
}

.login-page__link {
  font-size: var(--text-sm);
  color: var(--color-primary);
  text-decoration: none;
}

.login-page__link:hover {
  text-decoration: underline;
}

.login-page__link--button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.input-group--password .input-group__password-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}

.input-group--password .input-group__field {
  flex: 1;
  padding-right: 5.5rem;
}

.input-group__toggle-password {
  position: absolute;
  right: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
}

.input-group__toggle-password:hover {
  color: var(--color-primary);
}

/* ── Section header ── */
.section-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-3);
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: var(--space-10) var(--space-4);
  color: var(--color-text-secondary);
}

.empty-state__icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-3);
}

.empty-state__text {
  font-size: var(--text-sm);
}

/* ── Quick actions grid (home) ── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-3);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--color-border);
  cursor: pointer;
  border: none;
  transition: transform var(--duration-fast) var(--ease-spring),
              box-shadow var(--duration-fast);
  -webkit-tap-highlight-color: transparent;
}

.quick-action:active {
  transform: scale(0.97);
  box-shadow: none;
}

.quick-action__icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.quick-action__icon--primary  { background: var(--color-primary-bg); }
.quick-action__icon--success  { background: var(--color-success-bg); }
.quick-action__icon--warning  { background: var(--color-warning-bg); }
.quick-action__icon--error    { background: var(--color-error-bg); }

.quick-action__label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
}

/* ── Preparation test sheet ── */
.prep-test {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-height: 100%;
}

.prep-test__view {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 100%;
}

.prep-test__view[hidden] {
  display: none;
}

.prep-test__subtitle {
  margin: calc(var(--space-4) * -1) 0 var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-align: center;
}

.prep-test__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
}

.prep-test__row--stacked {
  align-items: flex-start;
}

.prep-test__label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
}

.prep-test__value {
  min-width: 2.5rem;
  text-align: center;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}

.prep-test__meta {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.prep-test__stepper {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.prep-test__step-btn {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
  color: var(--color-text);
  font-size: var(--text-lg);
  line-height: 1;
  cursor: pointer;
  transition: background var(--duration-fast), transform var(--duration-fast);
}

.prep-test__step-btn:active {
  transform: scale(0.95);
}

.prep-test__toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.prep-test__toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.prep-test__toggle-track {
  width: 2.5rem;
  height: 1.45rem;
  border-radius: var(--radius-full);
  background: var(--color-border);
  padding: 2px;
  display: inline-flex;
  align-items: center;
  transition: background var(--duration-fast);
}

.prep-test__toggle-thumb {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
  transition: transform var(--duration-fast) var(--ease-out);
}

.prep-test__toggle input:checked + .prep-test__toggle-track {
  background: var(--color-primary);
}

.prep-test__toggle input:checked + .prep-test__toggle-track .prep-test__toggle-thumb {
  transform: translateX(1.02rem);
}

.prep-test__topics {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.prep-test__link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  cursor: pointer;
}

.prep-test__link-btn svg,
.prep-test__back-btn svg {
  width: 1rem;
  height: 1rem;
}

.prep-test__hint {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  text-align: center;
}

.prep-test__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: var(--space-2);
}

.prep-test__topics-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: var(--space-2);
}

.prep-test__topics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.prep-test__topics-title {
  margin: 0;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}

.prep-test__back-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
  color: var(--color-text);
  font-size: var(--text-sm);
  cursor: pointer;
}

.prep-test__topic-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.prep-test__topic-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  cursor: pointer;
}

.prep-test__topic-item--locked {
  opacity: 0.65;
  cursor: not-allowed;
}

.prep-test__topic-item--locked .prep-test__topic-name {
  text-decoration: line-through;
}

.prep-test__topic-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.prep-test__topic-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
}

.prep-test__check {
  accent-color: var(--color-primary);
  width: 1rem;
  height: 1rem;
}

/* ── Competitive dashboard (home) ── */
.compete {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.compete__scores {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  padding: var(--space-5) var(--space-5) var(--space-4);
}

.compete__title {
  margin: 0;
}

.compete__title-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.compete__title-meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.compete__col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.compete__col--right {
  align-items: flex-end;
  text-align: right;
}

.compete__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.compete__value-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.compete__value-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-1);
}

.compete__col--right .compete__value-row {
  justify-content: flex-end;
}

.compete__value {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  line-height: 1;
  color: var(--color-text);
}

.compete__value--muted {
  font-size: var(--text-2xl);
  color: var(--color-text-muted);
  font-weight: var(--weight-semibold);
}

.compete__trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  line-height: 1;
  white-space: nowrap;
}

.compete__trend svg {
  width: 0.625rem;
  height: 0.625rem;
}

.compete__trend--up {
  color: #059669;
  background: #ECFDF5;
}

.compete__trend--down {
  color: #DC2626;
  background: #FEF2F2;
}

.compete__trend--neutral {
  color: var(--color-text-muted);
  background: var(--color-surface-alt);
}

.compete__vs {
  align-self: center;
  flex: 0 0 auto;
  padding: 0 var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.compete__chart-clip {
  height: 180px;
  overflow: hidden;
  opacity: 1;
  transition: height var(--duration-normal) var(--ease-out),
    opacity var(--duration-fast) var(--ease-out);
}

.compete__chart-clip--hidden {
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.compete__chart {
  padding: 0 var(--space-3) var(--space-2);
  height: 180px;
}

.compete__divider {
  height: 1px;
  background: var(--color-border);
  margin: 0 var(--space-5);
}

.compete__ranking {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
}

.compete__rank-pos {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  line-height: 1;
}

.compete__rank-lead {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
}

.compete__rank-info {
  flex: 1;
  min-width: 0;
}

.compete__rank-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
}

.compete__rank-detail {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: 1px;
}

/* ── Quick test card (home) ── */
.quick-test {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.quick-test__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-5);
  padding-bottom: var(--space-4);
}

.quick-test__title-wrap {
  min-width: 0;
}

.quick-test__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  line-height: var(--leading-tight);
}

.quick-test__prompt {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: font-size var(--duration-normal) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.quick-test__toggle {
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 1.1rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.quick-test__body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows var(--duration-normal) var(--ease-out),
    opacity var(--duration-normal) var(--ease-out);
}

.quick-test__body-inner {
  min-height: 0;
  overflow: hidden;
}

.quick-test__options {
  padding: 0 var(--space-5) var(--space-5);
}

.quick-test__option {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text);
  background: transparent;
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-4);
}

.quick-test__option + .quick-test__option {
  margin-top: var(--space-2);
}

.quick-test__option input[type='radio'] {
  accent-color: var(--color-primary);
}

.quick-test-slot {
  margin-top: var(--space-4);
}

.quick-test--resume .quick-test__prompt {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.quick-test__resume-actions {
  padding: 0 var(--space-5) var(--space-5);
}

.quick-test__resume-actions .btn.btn--full {
  width: 100%;
}

.quick-test--expanded .quick-test__body {
  grid-template-rows: 1fr;
  opacity: 1;
  transition: grid-template-rows var(--duration-normal) var(--ease-out),
    opacity var(--duration-fast) var(--ease-out);
}

.quick-test--expanded .quick-test__toggle {
  color: var(--color-primary);
}

.quick-test--expanded .quick-test__prompt {
  font-size: var(--text-base);
  color: var(--color-text);
  font-weight: var(--weight-medium);
}

/* ── Scrollable hide ── */
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.hide-scrollbar::-webkit-scrollbar { display: none; }

