.learning-modes,
.sounds-group-nav {
  display: grid;
  gap: .3rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: .3rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--cream);
}

.learning-modes { position: sticky; top: .25rem; z-index: 4; }
.learning-modes a,
.sounds-group-nav a {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: .3rem .15rem;
  border-radius: 11px;
  color: var(--green-dark);
  font-size: clamp(.77rem, 3.4vw, .94rem);
  font-weight: 750;
  text-align: center;
  text-decoration: none;
  line-height: 1.3;
}
.learning-modes a:hover,
.sounds-group-nav a:hover { background: var(--green-pale); }
.learning-modes a[aria-current],
.sounds-group-nav a[aria-current] { color: var(--card); background: var(--green); }
[data-learning-part] { scroll-margin-top: 4.2rem; }

.sounds-group-nav {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 28rem;
  margin-block-end: .95rem;
}
.sounds-group .sounds-subgroup {
  padding: clamp(.73rem, 2.8vw, 1.12rem);
  border-radius: 16px;
}

.vocab-groups:not(.has-topic) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.vocab-groups:not(.has-topic) > details {
  background: var(--cream);
  border-radius: 15px;
}
.vocab-groups:not(.has-topic) summary {
  height: 100%;
  min-height: 62px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.vocab-groups:not(.has-topic) summary:hover { background: var(--green-pale); border-radius: 14px; }
.vocab-groups:not(.has-topic) .vocab-topic-count {
  display: block;
  float: none;
  margin-inline: 1em 0;
}
.vocab-groups.has-topic > details {
  border-radius: 16px;
  background: var(--cream);
}
.vocab-browse-topics {
  min-height: 44px;
  margin-block-end: .45rem;
  padding: .3rem .65rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--green-dark);
  background: var(--card);
  font-weight: 750;
  cursor: pointer;
}
.vocab-notebook { margin-block: .9rem 0; }

.vocab-grid.vocab-shelf {
  position: relative;
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  gap: .65rem;
  max-width: 30rem;
  margin-inline: auto;
  overflow-x: auto;
  padding-block: .25rem .4rem;
  scroll-snap-type: x mandatory;
  scroll-margin-block-start: 4.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.vocab-shelf .vocab-entry { scroll-snap-align: start; scroll-snap-stop: always; gap: .48rem; }
.vocab-shelf .vocab-word {
  min-height: 9rem;
  padding: .9rem .8rem .85rem;
  border-radius: 18px;
  background: var(--card);
}
.vocab-shelf .vocab-word-picture-slot { width: min(100%, clamp(9rem, 44vw, 13rem)); }
.vocab-shelf .vocab-word-title { font-size: clamp(1.65rem, 7vw, 2.15rem); word-break: keep-all; }
.vocab-shelf .vocab-word-translation { min-block-size: 0; font-size: 1rem; }
.vocab-shelf .vocab-word-action { font-size: .77rem; font-weight: 700; color: var(--green); margin-block-start: .35rem; }
.vocab-shelf .vocab-mastery-control { font-size: .9rem; }
.vocab-shelf :focus-visible { outline-offset: -3px; }
.vocab-shelf-controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .5rem;
  max-width: 30rem;
  margin: .42rem auto;
  color: var(--muted);
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}
.vocab-shelf-controls button {
  justify-self: start;
  min-height: 44px;
  padding: .32rem .65rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--green-dark);
  background: var(--card);
  font-weight: 750;
  cursor: pointer;
}
.vocab-shelf-controls button:last-child { justify-self: end; }
.vocab-shelf-controls button[aria-disabled="true"] { opacity: .55; cursor: default; }

@media (min-width: 700px) {
  .vocab-groups:not(.has-topic) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
