.brand--link {
  color: inherit;
  text-decoration: none;
}

.mylist-shell {
  max-width: 1180px;
  padding-top: clamp(0.9rem, 2vw, 1.4rem);
}

.mylist-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.35fr);
  gap: clamp(1rem, 3vw, 1.6rem);
  align-items: start;
}

.mylist-panel {
  min-height: 540px;
  padding: clamp(1rem, 2vw, 1.25rem);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 16px 36px rgba(21, 42, 102, 0.08);
}

.mylist-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.mylist-panel__header h1,
.mylist-panel__header h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
}

.mylist-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.icon-button,
.mylist-action {
  border-radius: 0.5rem;
  font-weight: 600;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 1.4rem;
  line-height: 1;
}

.mylist-action {
  min-height: 40px;
  padding: 0.5rem 0.9rem;
  border-color: #b8c7df;
  background: #fff;
  color: var(--ink);
}

.mylist-action--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.mylist-action:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.mylist-action:disabled:hover {
  box-shadow: none;
  transform: none;
}

.filter-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin-bottom: 0.9rem;
  padding: 0.3rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: var(--surface);
}

.filter-tab {
  padding: 0.5rem 0.45rem;
  border: none;
  border-radius: 0.45rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.filter-tab.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 14px rgba(21, 42, 102, 0.08);
}

.wrong-word-list {
  display: grid;
  gap: 0.55rem;
}

.empty-state {
  margin: 0;
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: 0.65rem;
  color: var(--muted);
  font: 0.95rem/1.5 "Space Grotesk", "Trebuchet MS", sans-serif;
}

.word-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem;
  border: 1px solid #dbe4f3;
  border-radius: 0.65rem;
  background: #fff;
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
}

.word-row input {
  width: 18px;
  height: 18px;
}

.word-row__text {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 1.05rem;
  font-weight: 600;
}

.word-row__count {
  color: var(--danger);
  font-size: 0.9rem;
}

.status-pill {
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill--not-learnt {
  background: #fff0d8;
  color: var(--accent-dark);
}

.status-pill--learnt {
  background: #dcfce7;
  color: var(--success);
}

.mylist-status {
  min-height: 1.25rem;
  margin: 0.75rem 0 0;
  color: var(--muted);
  font: 0.9rem "Space Grotesk", "Trebuchet MS", sans-serif;
}

.mylist-status.is-error {
  color: var(--danger);
  font-weight: 600;
}

.test-count {
  color: var(--muted);
  font: 600 0.86rem "Space Grotesk", "Trebuchet MS", sans-serif;
}

.test-output {
  display: grid;
  gap: 0.85rem;
}

.learning-loading {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: #fff;
  color: var(--muted);
  font: 600 0.98rem "Space Grotesk", "Trebuchet MS", sans-serif;
}

.learning-loading__spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #dbe4f3;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: mylist-spin 0.8s linear infinite;
}

.learning-loading__dots {
  display: inline-flex;
  gap: 0.2rem;
  align-items: flex-end;
  min-width: 32px;
}

.learning-loading__dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: mylist-pulse 1s ease-in-out infinite;
}

.learning-loading__dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.learning-loading__dots span:nth-child(3) {
  animation-delay: 0.3s;
}

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

@keyframes mylist-pulse {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

.test-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem 1rem;
  padding: 1rem;
  border: 1px solid #dbe4f3;
  border-radius: 0.7rem;
  background: #fff;
}

.test-card__main {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.test-card__word {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--brand);
  font: 600 clamp(1.55rem, 3vw, 2.05rem)/1.15 "Space Grotesk", "Trebuchet MS", sans-serif;
}

.test-card__meaning,
.test-card__sentence {
  margin: 0;
  overflow-wrap: anywhere;
  font: 1rem/1.55 "Space Grotesk", "Trebuchet MS", sans-serif;
}

.test-card__meaning {
  color: var(--accent-dark);
  font-weight: 600;
}

.test-card__sentence {
  color: var(--ink);
}

.mark-learnt {
  align-self: start;
  border-color: var(--success);
  border-radius: 0.5rem;
  background: #dcfce7;
  color: var(--success);
  font-weight: 700;
}

.mark-learnt:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.add-words-modal {
  max-width: 640px;
}

.add-words-textarea {
  width: 100%;
  min-height: 220px;
  margin-top: 0.9rem;
  resize: vertical;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  color: var(--ink);
  font: 1.05rem/1.5 "Space Grotesk", "Trebuchet MS", sans-serif;
}

@media (max-width: 860px) {
  .mylist-layout {
    grid-template-columns: 1fr;
  }

  .mylist-panel {
    min-height: auto;
  }
}

@media (max-width: 540px) {
  .mylist-panel__header,
  .test-card {
    grid-template-columns: 1fr;
  }

  .mylist-panel__header {
    align-items: stretch;
  }

  .mylist-actions {
    justify-content: start;
  }

  .mark-learnt {
    justify-self: start;
  }
}
