:is(body.admin-page, body.page-learn) .admin-ielts-wordlist {
  --iw-ink: #151922;
  --iw-muted: #667085;
  --iw-line: #e1e4e9;
  --iw-surface: #ffffff;
  --iw-accent: #d71920;
  color: var(--iw-ink);
  letter-spacing: 0;
}

.iw-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 14px 18px;
  align-items: center;
}

.iw-search {
  min-height: 44px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 9px;
  padding: 0 8px 0 14px;
  border: 1px solid #d5d9e0;
  border-radius: 8px;
  background: var(--iw-surface);
  color: #7b8493;
  box-sizing: border-box;
}

.iw-search:focus-within {
  border-color: #929dac;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.iw-search > svg,
.iw-search-clear svg,
.iw-pronounce svg,
.iw-mastery-box svg,
.iw-empty svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:is(body.admin-page, body.page-learn) .iw-search input {
  min-width: 0;
  width: 100%;
  min-height: 40px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--iw-ink);
  font: inherit;
  font-size: 14px;
  letter-spacing: 0;
}

.iw-search-clear,
.iw-pronounce {
  display: inline-grid;
  place-items: center;
  border: 0;
  color: #4b5565;
  background: transparent;
  cursor: pointer;
}

.iw-search-clear {
  width: 32px;
  height: 32px;
}

.iw-search-clear svg {
  width: 17px;
  height: 17px;
}

.iw-tier-tabs,
.iw-mastery-tabs {
  width: min(100%, 496px);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--iw-line);
  border-radius: 8px;
  background: #e9ecf1;
  box-sizing: border-box;
}

.iw-tier-tabs button,
.iw-mastery-tabs button,
.iw-alphabet button,
.iw-load-more {
  border: 0;
  font: inherit;
  letter-spacing: 0;
  cursor: pointer;
}

.iw-tier-tabs button,
.iw-mastery-tabs button {
  flex: 1 1 0;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  background: transparent;
  color: #596273;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.iw-tier-tabs button span,
.iw-mastery-tabs button span {
  margin-left: 3px;
  color: #8a93a2;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.iw-tier-tabs button.is-active,
.iw-mastery-tabs button.is-active {
  background: var(--iw-surface);
  color: var(--iw-ink);
  box-shadow: 0 1px 4px rgba(20, 28, 40, 0.08);
}

.iw-alphabet {
  grid-column: 1 / -1;
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.iw-mastery-tabs {
  flex: 0 0 auto;
}

.iw-alphabet button {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: transparent;
  color: #687284;
  font-size: 12px;
  font-weight: 700;
}

.iw-alphabet button:first-child {
  flex-basis: 44px;
  width: 44px;
}

.iw-alphabet button:hover,
.iw-alphabet button.is-active {
  background: #222832;
  color: #fff;
}

.iw-result-bar {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--iw-muted);
  font-size: 13px;
}

.iw-result-bar p {
  margin: 0;
}

.iw-list-shell {
  overflow: hidden;
  border: 1px solid var(--iw-line);
  border-radius: 8px;
  background: var(--iw-surface);
}

.iw-list-head,
.iw-word-row {
  display: grid;
  grid-template-columns: 64px minmax(190px, 1.1fr) 96px minmax(300px, 2.2fr) 68px 44px;
  align-items: center;
  column-gap: 16px;
}

.iw-list-head {
  min-height: 42px;
  padding: 0 18px;
  border-bottom: 1px solid var(--iw-line);
  background: #f6f7f9;
  color: #7b8493;
  font-size: 12px;
  font-weight: 650;
}

.iw-list-head span:nth-last-child(2) {
  text-align: center;
}

.iw-word-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.iw-word-row {
  min-height: 72px;
  padding: 10px 18px;
  border-bottom: 1px solid #eceef2;
  box-sizing: border-box;
  content-visibility: auto;
  contain-intrinsic-size: 72px;
}

.iw-word-row:last-child {
  border-bottom: 0;
}

.iw-word-row:hover {
  background: #fafbfc;
}

.iw-index {
  color: #929aa7;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.iw-word-main {
  min-width: 0;
}

.iw-word {
  display: block;
  overflow-wrap: anywhere;
  color: #151922;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0;
}

.iw-phonetic {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: #7b8493;
  font-size: 12px;
}

.iw-tier {
  width: fit-content;
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.iw-tier--primary {
  background: #e7f5ec;
  color: #207a45;
}

.iw-tier--intermediate {
  background: #e9f0ff;
  color: #315da8;
}

.iw-tier--advanced {
  background: #fce9ea;
  color: #a72a31;
}

.iw-meaning {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: #3e4653;
  font-size: 13px;
  line-height: 1.6;
}

.iw-meaning.is-pending {
  color: #9a6b16;
}

.iw-mastery {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  width: 36px;
  height: 36px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.iw-mastery-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.iw-mastery-box {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid #c6cbd3;
  border-radius: 6px;
  background: #fff;
  color: #fff;
  box-sizing: border-box;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.iw-mastery-box svg {
  width: 15px;
  height: 15px;
  opacity: 0;
  stroke-width: 2.6;
  transition: opacity 0.12s ease;
}

.iw-mastery:hover .iw-mastery-box {
  border-color: #7f8998;
}

.iw-mastery-input:focus-visible + .iw-mastery-box {
  outline: 3px solid rgba(37, 99, 235, 0.2);
  outline-offset: 2px;
}

.iw-mastery-input:checked + .iw-mastery-box {
  border-color: #207a45;
  background: #207a45;
  box-shadow: 0 0 0 3px rgba(32, 122, 69, 0.1);
}

.iw-mastery-input:checked + .iw-mastery-box svg {
  opacity: 1;
}

.iw-mastery-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

.iw-pronounce {
  width: 36px;
  height: 36px;
  border-radius: 6px;
}

.iw-pronounce:hover,
.iw-search-clear:hover {
  background: #eef0f3;
  color: var(--iw-accent);
}

.iw-pronounce.is-loading,
.iw-pronounce.is-playing {
  background: #fce9ea;
  color: var(--iw-accent);
}

.iw-pronounce.is-loading svg {
  animation: iwPronouncePulse 0.8s ease-in-out infinite alternate;
}

@keyframes iwPronouncePulse {
  from { opacity: 0.38; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .iw-pronounce.is-loading svg {
    animation: none;
  }
}

.iw-empty {
  min-height: 240px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: #8a93a2;
}

.iw-empty[hidden],
.iw-load-wrap[hidden] {
  display: none;
}

.iw-empty svg {
  width: 34px;
  height: 34px;
}

.iw-empty p {
  margin: 0;
  font-size: 14px;
}

.iw-load-wrap {
  display: flex;
  justify-content: center;
  padding: 20px 0 0;
}

.iw-load-more {
  min-width: 180px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid #d2d6dd;
  border-radius: 8px;
  background: var(--iw-surface);
  color: #343b47;
  font-size: 13px;
  font-weight: 650;
}

.iw-load-more:hover {
  border-color: #aeb5c0;
  background: #fafafa;
}

.iw-load-sentinel {
  height: 1px;
}

@media (max-width: 760px) {
  .iw-controls {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .iw-tier-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .iw-mastery-tabs {
    width: 100%;
    min-height: 40px;
  }

  .iw-tier-tabs button,
  .iw-mastery-tabs button {
    flex: 1 0 auto;
    padding-inline: 10px;
  }

  .iw-alphabet {
    grid-column: 1;
  }

  .iw-result-bar {
    min-height: 46px;
    flex-wrap: wrap;
    padding-block: 8px;
  }

  .iw-list-head {
    display: none;
  }

  .iw-word-row {
    grid-template-columns: minmax(0, 1fr) 40px 36px;
    grid-template-areas:
      "main mastery audio"
      "meta mastery audio"
      "meaning meaning meaning";
    gap: 5px 10px;
    min-height: 104px;
    padding: 13px 14px;
    contain-intrinsic-size: 104px;
  }

  .iw-index {
    display: none;
  }

  .iw-word-main { grid-area: main; }
  .iw-tier { grid-area: meta; }
  .iw-meaning { grid-area: meaning; padding-top: 3px; }
  .iw-mastery { grid-area: mastery; }
  .iw-pronounce { grid-area: audio; }
}
