:root {
  color-scheme: light;
  --page: #e9edf2;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-tint: #eff5fb;
  --line: #c3cedc;
  --line-soft: #e0e7f0;
  --row: #ffffff;
  --row-alt: #f5f8fc;
  --head: #e4edf7;
  --ink: #162033;
  --muted: #647084;
  --brand: #ff9418;
  --brand-dark: #da7600;
  --brand-soft: #ffe7bd;
  --accent: #1c70ad;
  --accent-ink: #155486;
  --accent-soft: #e1f0fd;
  --tag: #e8eef6;
  --tag-text: #324154;
  --link: #1565aa;
  --shadow: 0 12px 30px rgba(31, 45, 68, 0.15);
  --shadow-soft: 0 6px 16px rgba(31, 45, 68, 0.11);
  --danger: #9f2d20;
  --danger-soft: #fff1ef;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  background: var(--page);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

.shell {
  --topbar-sticky-offset: 76px;
  width: min(1120px, 100%);
  max-width: 100%;
  margin: 0 auto;
  background: var(--surface);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.shell.is-trainer-home {
  border-left: 0;
  border-right: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 42px;
  gap: 20px;
  align-items: center;
  padding: 15px 30px 14px;
  min-height: var(--topbar-sticky-offset);
  background: var(--brand);
  border-bottom: 1px solid var(--brand-dark);
  box-shadow: 0 5px 14px rgba(119, 48, 9, 0.18);
}

.brand {
  width: max-content;
  justify-self: start;
  color: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 3rem;
  line-height: 0.86;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0;
  align-self: center;
  text-shadow: none;
  transform: translateY(-2px);
}

.brand {
  -webkit-user-select: none;
  user-select: none;
}

.brand-button {
  display: inline-block;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  text-align: left;
  cursor: pointer;
}

.brand-button:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.8);
  outline-offset: 6px;
  border-radius: 6px;
}

.shell.is-trainer-home .topbar {
  grid-template-columns: minmax(320px, max-content) minmax(0, 1fr) 42px;
}

.shell.is-trainer-home .brand {
  font-size: 2.55rem;
}

.lookup {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  width: 100%;
  max-width: 680px;
}

.shell.is-trainer-home .lookup {
  display: none;
}

.language-state,
.home-stats {
  grid-column: 1 / -1;
}

.controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

select {
  height: 36px;
  min-width: 178px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.98rem;
  padding: 0 9px;
  box-shadow: 0 2px 7px rgba(107, 43, 10, 0.13);
}

select:focus,
.search input:focus {
  outline: 2px solid var(--accent-soft);
  outline-offset: 1px;
}

.pair-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  color: #ffffff;
  font-size: 0;
  font-weight: 900;
  line-height: 1;
  text-shadow: none;
}

.pair-arrow::before {
  content: "\279C";
  font-size: 1.55rem;
  line-height: 1;
}

.swap {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
}

.search-combobox {
  position: relative;
  min-width: 0;
  width: 100%;
}

.search {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  height: 42px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(107, 43, 10, 0.14);
}

.search.has-voice {
  grid-template-columns: 42px minmax(0, 1fr) 44px;
}

.search.has-clear {
  grid-template-columns: minmax(0, 1fr) 34px 44px;
}

.search.has-voice.has-clear {
  grid-template-columns: 42px minmax(0, 1fr) 34px 44px;
}

.search::before {
  content: "";
  display: none;
}

.search input {
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 1.12rem;
  padding: 0 12px;
}

.search button {
  display: grid;
  place-items: center;
  border: 0;
  border-left: 1px solid #d5dde7;
  background: #ffffff;
  color: var(--accent-ink);
  cursor: pointer;
}

.search button:hover {
  background: #eef6fd;
}

.search .search-clear-button {
  font-size: 1.38rem;
  font-weight: 500;
  line-height: 1;
  border-left: 0;
  background: transparent;
  color: #69768b;
}

.search-clear-button[hidden] {
  display: none !important;
}

.search .search-clear-button:hover {
  background: transparent;
  color: var(--accent-ink);
}

.search-combobox.is-search-loading .search {
  border-color: rgba(255, 148, 24, 0.72);
}

.search-loading-bar {
  position: absolute;
  z-index: 22;
  left: 0;
  right: 44px;
  bottom: 0;
  height: 4px;
  overflow: hidden;
  border-radius: 0 999px 999px 0;
  background: rgba(255, 148, 24, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
  pointer-events: none;
}

.search.has-voice .search-loading-bar {
  left: 42px;
  right: 44px;
}

.search.has-clear .search-loading-bar {
  right: 78px;
}

.search-loading-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 64%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.78) 28%, rgba(255, 148, 24, 0.82) 58%, rgba(255, 255, 255, 0));
  animation: searchLoadingSlide 1.55s cubic-bezier(0.45, 0, 0.2, 1) infinite;
}

@keyframes searchLoadingSlide {
  0% {
    transform: translateX(-105%);
  }
  100% {
    transform: translateX(170%);
  }
}

@keyframes voiceWavePulse {
  0%,
  100% {
    transform: scaleY(0.42);
    opacity: 0.45;
  }
  45% {
    transform: scaleY(1);
    opacity: 1;
  }
}

@keyframes sourceLanguageListeningPulse {
  0%,
  100% {
    border-color: #ff9418;
    box-shadow:
      0 2px 7px rgba(21, 84, 134, 0.22),
      0 0 0 2px rgba(255, 148, 24, 0.78);
  }
  50% {
    border-color: #b65300;
    box-shadow:
      0 2px 7px rgba(21, 84, 134, 0.22),
      0 0 0 2px rgba(182, 83, 0, 0.98);
  }
}

.search button[hidden],
.voice-search-button {
  display: none;
}

.search.has-voice .voice-search-button {
  display: grid;
  position: relative;
  place-items: center;
}

.voice-search-button > svg {
  grid-area: 1 / 1;
}

.voice-search-button.is-listening {
  background: #ffffff;
  color: #111111;
}

.search-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.voice-icon {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.voice-recording-icon {
  display: none;
  width: 24px;
  height: 24px;
  fill: currentColor;
  stroke: none;
  overflow: visible;
}

.voice-wave-bar {
  transform-box: fill-box;
  transform-origin: center;
  animation: voiceWavePulse 0.9s ease-in-out infinite;
}

.voice-wave-bar-2 {
  animation-delay: 0.12s;
}

.voice-wave-bar-3 {
  animation-delay: 0.24s;
}

.voice-wave-bar-4 {
  animation-delay: 0.36s;
}

.voice-search-button.is-listening .voice-icon {
  display: none !important;
}

.voice-search-button.is-listening .voice-recording-icon {
  display: block;
}

.trainer-account-wrap {
  grid-column: 3;
  justify-self: end;
  align-self: center;
  position: relative;
}

.trainer-icon-link {
  display: inline-grid;
  place-items: center;
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 3px 10px rgba(107, 43, 10, 0.16);
  text-decoration: none;
}

.trainer-account-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 9px);
  right: 0;
  display: grid;
  gap: 7px;
  width: min(260px, calc(100vw - 24px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f2f4f7;
  color: var(--ink);
  box-shadow: 0 12px 26px rgba(8, 33, 59, 0.22);
}

.trainer-account-menu[hidden] {
  display: none;
}

.trainer-account-menu-label,
.trainer-account-menu span {
  color: var(--muted);
  font-size: 0.78rem;
}

.trainer-account-menu strong,
.trainer-account-menu span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trainer-account-menu a,
.trainer-account-menu button {
  min-height: 36px;
  display: grid;
  align-items: center;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  padding: 0 10px;
}

.trainer-account-menu a:hover,
.trainer-account-menu button:hover {
  background: #ffffff;
}

.trainer-account-menu #logoutButton {
  color: #b3342c;
}

.trainer-icon-link:hover {
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.28);
}

.trainer-icon-link.is-auth-pending {
  pointer-events: none;
}

.trainer-icon-link.is-auth-pending .trainer-link-default-icon,
.trainer-icon-link.is-auth-pending .trainer-link-account,
.trainer-icon-link.is-auth-pending .trainer-link-tooltip {
  visibility: hidden;
}

.trainer-icon-link.is-signed-in {
  border-color: #ffffff;
  background: #ffb347;
  color: #7a3200;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.55),
    0 6px 16px rgba(107, 43, 10, 0.24);
}

.trainer-icon-link.is-signed-in:hover {
  border-color: #ffffff;
  background: #ffc164;
}

.trainer-link-tooltip {
  position: absolute;
  z-index: 50;
  top: calc(100% + 9px);
  right: 0;
  display: grid;
  gap: 3px;
  min-width: 170px;
  max-width: min(300px, calc(100vw - 24px));
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 6px;
  background: rgba(8, 33, 59, 0.94);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(8, 33, 59, 0.22);
  font-size: 0.78rem;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.trainer-link-tooltip[hidden] {
  display: none;
}

.trainer-link-tooltip strong,
.trainer-link-tooltip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trainer-link-tooltip strong {
  font-size: 0.8rem;
}

.trainer-link-tooltip span:last-child {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.74rem;
}

.trainer-icon-link.is-signed-in:hover .trainer-link-tooltip,
.trainer-icon-link.is-signed-in:focus-visible .trainer-link-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.trainer-icon-link:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
}

.trainer-link-default-icon,
.trainer-link-account {
  display: inline-grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.trainer-link-default-icon[hidden],
.trainer-link-account[hidden] {
  display: none;
}

.trainer-link-default-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trainer-link-account {
  overflow: hidden;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
}

.trainer-link-account img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 0;
  max-width: 100%;
  max-height: min(340px, 52vh);
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 16px 34px rgba(31, 45, 68, 0.18);
}

.suggestions.is-loading .suggestion-option {
  opacity: 0.82;
  pointer-events: none;
}

.suggestion-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 40px;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: var(--ink);
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
}

.suggestion-option:last-child {
  border-bottom: 0;
}

.suggestion-option:hover,
.suggestion-option.is-active {
  background: var(--accent-soft);
}

.suggestion-option.is-exact-query {
  background: rgba(255, 148, 24, 0.08);
}

.suggestion-option.is-exact-query:hover,
.suggestion-option.is-exact-query.is-active {
  background: rgba(255, 148, 24, 0.16);
}

.suggestion-main {
  min-width: 0;
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-main mark {
  border-radius: 3px;
  background: rgba(28, 112, 173, 0.16);
  color: inherit;
  font-weight: inherit;
  padding: 0 1px;
}

.suggestion-meta {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.suggestion-lang {
  min-width: 28px;
  border-radius: 4px;
  background: var(--tag);
  color: var(--tag-text);
  padding: 2px 5px;
  text-align: center;
  text-transform: uppercase;
}

.suggestion-empty {
  color: var(--muted);
  padding: 10px 12px;
  font-size: 0.88rem;
}

.home-stats {
  display: none;
}

.language-switcher {
  position: sticky;
  top: var(--topbar-sticky-offset);
  z-index: 55;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 10px 28px;
  background: var(--brand-soft);
  border-bottom: 1px solid #f0c175;
  box-shadow: 0 4px 12px rgba(31, 45, 68, 0.1);
  overflow-x: auto;
}

.language-group {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.language-group-source {
  justify-content: flex-start;
}

.language-group-target {
  justify-content: flex-end;
}

.language-switcher button,
.language-switcher a[data-language-switch] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 28px;
  border: 1px solid #d4b36d;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.56);
  color: #253044;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0;
  cursor: pointer;
  text-decoration: none;
}

.language-switcher button:hover,
.language-switcher a[data-language-switch]:hover {
  background: #ffffff;
  border-color: #b88726;
}

.language-switcher button:disabled {
  cursor: not-allowed;
}

.language-switcher button.is-active,
.language-switcher a[data-language-switch].is-active {
  background: var(--accent);
  border-color: var(--accent-ink);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 2px 7px rgba(21, 84, 134, 0.22);
}

.language-switcher.is-source-listening .language-group-source button.is-active,
.language-switcher.is-source-listening .language-group-source a[data-language-switch].is-active {
  animation: sourceLanguageListeningPulse 1.05s ease-in-out infinite;
}

.language-switcher button.is-unavailable,
.language-switcher a[data-language-switch].is-unavailable {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(124, 100, 58, 0.28);
  color: rgba(37, 48, 68, 0.36);
  box-shadow: none;
}

.language-switcher button.is-unavailable:hover,
.language-switcher a[data-language-switch].is-unavailable:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(124, 100, 58, 0.28);
}

.language-swap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b5230;
  font-size: 1.08rem;
  font-weight: 900;
}

.mobile-language-popover {
  display: none;
}

.pwa-install-banner,
.install-notice {
  position: fixed;
  left: 50%;
  top: 96px;
  z-index: 70;
  width: min(720px, calc(100vw - 24px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 30px;
  align-items: center;
  gap: 10px;
  padding: 6px 22px;
  border-bottom: 1px solid #c9d7e6;
  border: 1px solid #c9d7e6;
  box-shadow: 0 8px 22px rgba(31, 45, 68, 0.14);
  background: #f6fbff;
  color: #1c3148;
  font-size: 0.9rem;
}

.pwa-install-banner[hidden],
.install-notice[hidden] {
  display: none;
}

.is-translationclick .pwa-install-banner,
.is-translationclick .install-notice {
  display: none !important;
}

.pwa-install-copy,
.install-copy {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
}

.pwa-install-copy strong,
.install-copy strong {
  color: var(--accent-ink);
}

.pwa-install-copy strong {
  font-size: 1.12rem;
  font-weight: 400;
}

.pwa-install-copy span,
.install-copy span {
  color: var(--muted);
}

.pwa-install-copy span {
  display: none;
}

.pwa-install-banner.is-ios-install {
  order: -1;
  position: sticky;
  top: 0;
  left: auto;
  right: auto;
  grid-template-columns: minmax(0, 1fr) auto 30px;
  width: 100%;
  transform: none;
  box-sizing: border-box;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  padding: calc(6px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left));
  box-shadow: 0 4px 14px rgba(31, 45, 68, 0.12);
}

.page-bottom-ad {
  width: 100%;
  min-height: 72px;
  padding: 12px 16px;
  border-top: 1px solid var(--line-soft);
  background: #ffffff;
}

.page-bottom-ad .adsbygoogle {
  min-height: 50px;
  overflow: hidden;
}

.pwa-install-action,
.pwa-install-close,
.install-action,
.install-close {
  border: 1px solid var(--accent-ink);
  border-radius: 5px;
  cursor: pointer;
  font-weight: 800;
}

.pwa-install-action,
.install-action {
  min-width: 136px;
  min-height: 38px;
  padding: 0 18px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.95rem;
}

.pwa-install-close,
.install-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: #ffffff;
  color: var(--accent-ink);
  font-size: 1.1rem;
  line-height: 1;
}

.blocker-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 15, 24, 0.68);
}

.blocker-dialog-overlay[hidden] {
  display: none;
}

.blocker-dialog {
  position: relative;
  width: min(440px, 100%);
  padding: 24px 24px 22px;
  border: 1px solid rgba(31, 121, 178, 0.26);
  background: #ffffff;
  color: #13263a;
  box-shadow: 0 18px 44px rgba(18, 35, 54, 0.26);
  outline: none;
}

.blocker-dialog h2 {
  margin: 0 0 10px;
  color: var(--accent-ink);
  font-size: 1.25rem;
  line-height: 1.18;
}

.blocker-dialog p {
  margin: 0 0 20px;
  color: #3d5268;
  font-size: 0.96rem;
  line-height: 1.48;
}

.blocker-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.blocker-dialog-refresh,
.blocker-dialog-close {
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid rgba(31, 121, 178, 0.28);
  border-radius: 5px;
  cursor: pointer;
  font-weight: 800;
}

.blocker-dialog-refresh {
  border: 1px solid var(--accent-ink);
  background: var(--accent);
  color: #ffffff;
}

.blocker-dialog-close {
  background: #ffffff;
  color: var(--accent-ink);
}

.blocker-dialog-close:disabled {
  cursor: wait;
  opacity: 0.58;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 28px 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.status-row.is-empty {
  display: none;
}

.shell.is-trainer-home .status-row {
  display: none !important;
}

.source-note {
  color: var(--muted);
}

.results {
  padding: 22px 22px 44px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 2px 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.breadcrumbs a {
  color: var(--accent-ink);
  text-decoration: none;
  text-underline-offset: 2px;
}

.breadcrumbs a:hover {
  color: var(--link);
  text-decoration: underline;
}

.entry-heading {
  margin: 0 0 12px;
  color: #102033;
  font-size: clamp(1.28rem, 2.2vw, 1.65rem);
  line-height: 1.16;
  font-weight: 800;
}

.answer-first {
  margin: 0 0 14px;
  padding: 11px 13px;
  border: 1px solid #c7d8e9;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: #f8fbff;
  color: #1a2b40;
  box-shadow: 0 2px 7px rgba(31, 45, 68, 0.06);
}

.answer-first p {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.42;
}

.answer-first p + p {
  margin-top: 5px;
}

.answer-first a {
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration: none;
  text-underline-offset: 2px;
}

.answer-first a:hover {
  color: var(--link);
  text-decoration: underline;
}

.answer-example {
  color: #59677a;
  font-size: 0.84rem !important;
}

.geo-faq {
  margin: 18px 0 0;
  padding: 13px 0 0;
  border-top: 1px solid var(--line-soft);
}

.geo-faq h2 {
  margin: 0 0 8px;
  color: #102033;
  font-size: 1rem;
  line-height: 1.22;
  font-weight: 800;
}

.geo-faq-item {
  margin: 0 0 8px;
}

.geo-faq-item h3 {
  margin: 0 0 2px;
  color: #263449;
  font-size: 0.88rem;
  line-height: 1.28;
  font-weight: 800;
}

.geo-faq-item p {
  margin: 0;
  color: #59677a;
  font-size: 0.84rem;
  line-height: 1.35;
}

.shell.is-home .home-stats {
  display: none;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.82rem;
  font-weight: 700;
}

.home-panel {
  display: none;
}

.shell.is-home .home-panel {
  display: grid;
  flex: 1 0 auto;
  place-items: center;
  padding: 34px 28px 46px;
}

.shell.is-history-home .home-panel {
  align-content: start;
  place-items: start center;
  padding: 0 0 46px;
}

.shell.is-trainer-home .home-panel {
  place-items: start stretch;
  padding: 0 0 46px;
}

.shell.is-trainer-home.is-learn-challenge-active .home-panel {
  padding: 0 0 46px;
}

.shell.is-trainer-home .home-start-grid,
.shell.is-trainer-home .language-switcher {
  display: none;
}

.shell.is-home .results {
  display: none;
}

.word-quiz-card[hidden],
.trainer-card[hidden] {
  display: none !important;
}

.trainer-card {
  display: grid;
  gap: 22px;
  width: min(720px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 24px;
}

.shell.is-trainer-home .trainer-card {
  width: 100%;
  max-width: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  gap: 0;
  padding: 0;
}

.shell.is-trainer-home .trainer-card.is-learn-challenge-active {
  background: transparent;
  padding: 0;
}

.shell.is-trainer-home .trainer-card.is-learn-challenge-active .learn-page-heading {
  display: none;
}

.shell.is-trainer-home .trainer-legacy-panel {
  display: none !important;
}

.home-history-card {
  width: 100%;
  display: block;
  color: var(--ink);
}

.pair-topic-overview {
  display: grid;
  gap: 12px;
  width: min(1120px, calc(100% - 56px));
  margin: 0 auto 22px;
  padding: 18px 0 0;
}

.pair-topic-head {
  display: grid;
  gap: 6px;
  padding: 2px 10px 1px;
}

.pair-topic-kicker {
  margin: 0;
  color: var(--accent-ink);
  font-size: 0.82rem;
  font-weight: 900;
}

.pair-topic-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.18rem, 2.2vw, 1.45rem);
  line-height: 1.15;
  letter-spacing: 0;
}

.pair-topic-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.pair-topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 12px;
}

.pair-topic-card {
  display: grid;
  gap: 7px;
  min-height: 112px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #ffffff;
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
}

.pair-topic-card strong {
  color: var(--accent-ink);
  font-size: 1rem;
}

.pair-topic-card span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.pair-topic-page {
  display: grid;
  gap: 12px;
}

.home-start-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  width: min(1120px, 100%);
}

.shell.is-history-home .home-start-grid {
  width: min(1120px, calc(100% - 56px));
}

.home-random-card {
  width: 100%;
  display: block;
  color: var(--ink);
}

.home-history-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 26px 28px 22px;
  border-bottom: 1px solid var(--brand-dark);
  background: var(--brand);
  color: #ffffff;
}

.home-history-kicker {
  margin: 0 0 4px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.85rem;
  font-weight: 800;
}

.home-history-head h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.6rem, 3.4vw, 2.35rem);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 0;
}

.home-trainer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  text-decoration: none;
}

.home-trainer-link:hover {
  background: rgba(255, 255, 255, 0.22);
}

.home-history-list {
  display: block;
  padding: 0;
}

.home-history-entry {
  width: 100%;
  margin-bottom: 0;
}

.home-random-entry {
  width: 100%;
  margin-bottom: 0;
}

.home-history-table .word-cell[colspan="3"],
.home-random-table .word-cell[colspan="3"] {
  color: var(--muted);
  font-weight: 700;
}

.home-history-intro,
.home-history-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.home-history-items {
  display: grid;
  gap: 8px;
}

.home-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(31, 45, 68, 0.06);
}

.home-history-item:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.home-history-query {
  min-width: 0;
  font-size: 1.05rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.home-history-pair {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.home-history-pair-link {
  color: var(--muted);
  font-weight: 700;
}

.word-quiz-card {
  width: min(760px, 100%);
  min-height: 500px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  overflow: hidden;
}

.shell.is-trainer-home .word-quiz-card {
  width: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: none;
}

.word-quiz-head {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 30px 24px 22px;
  border-bottom: 1px solid var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 5px 14px rgba(21, 84, 134, 0.18);
}

.word-quiz-head h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.9rem, 4.2vw, 2.8rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

.word-quiz-head h1 span:last-child {
  color: #ffffff;
}

.word-quiz-pair {
  color: rgba(255, 255, 255, 0.82);
  font-size: 1rem;
}

.shell.is-trainer-home .word-quiz-pair {
  display: none;
}

.shell.is-trainer-home .word-quiz-head {
  gap: 2px;
  padding: 18px 16px 12px;
}

.shell.is-trainer-home .word-quiz-head h1 {
  font-size: clamp(1.55rem, 3.4vw, 2.15rem);
}

.shell.is-trainer-home .word-quiz-dots {
  min-height: 22px;
  padding-top: 0;
}

.word-quiz-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  align-items: end;
  min-height: 32px;
  padding-top: 10px;
}

.word-quiz-dot {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.28);
}

.word-quiz-dot.is-current {
  border-color: #ffffff;
  background: #ffffff;
}

.word-quiz-dot.is-correct {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.28);
}

.word-quiz-dot.is-wrong {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.28);
}

.word-quiz-dot.is-correct::after,
.word-quiz-dot.is-wrong::after {
  position: absolute;
  top: 0;
  left: 50%;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(119, 48, 9, 0.2);
  transform: translate(-50%, -24%);
  box-shadow: none;
}

.word-quiz-dot.is-correct::after {
  content: "\2713";
  background: transparent;
}

.word-quiz-dot.is-wrong::after {
  content: "\00d7";
  background: transparent;
  width: 34px;
  height: 34px;
  font-size: 2rem;
  font-weight: 500;
  transform: translate(-50%, -27%);
}

.word-quiz-body,
.word-quiz-question {
  display: grid;
  min-width: 0;
}

.word-quiz-body {
  align-content: start;
  padding: 32px 24px 36px;
}

.word-quiz-question {
  gap: 22px;
}

.word-quiz-term {
  display: flex;
  justify-content: center;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
  text-align: center;
}

.word-quiz-term-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 100%;
  min-width: 0;
}

.word-quiz-term strong {
  max-width: 100%;
  min-width: 0;
  color: var(--ink);
  font-size: clamp(2rem, 6vw, 3.1rem);
  line-height: 1.05;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.word-quiz-term span {
  color: var(--muted);
  font-size: 0.9rem;
}

.word-quiz-sound {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(28, 112, 173, 0.28);
  border-radius: 999px;
  background: #f3f8fc;
  color: var(--accent);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84), 0 2px 7px rgba(21, 84, 134, 0.1);
  transform: translateY(2px);
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.word-quiz-sound:hover,
.word-quiz-sound:focus-visible {
  border-color: rgba(28, 112, 173, 0.58);
  background: #ffffff;
  color: var(--accent-ink);
  transform: translateY(1px);
}

.word-quiz-sound:focus-visible {
  outline: 2px solid rgba(28, 112, 173, 0.24);
  outline-offset: 2px;
}

.word-quiz-sound.is-speaking {
  border-color: rgba(255, 145, 0, 0.52);
  background: #fff5e8;
  color: var(--brand-dark);
}

.word-quiz-sound svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.25;
}

.word-quiz-sentence {
  max-width: 620px;
  justify-self: center;
  margin: -8px 0 2px;
  color: rgba(16, 32, 51, 0.76);
  font-size: clamp(0.95rem, 2vw, 1.08rem);
  line-height: 1.35;
  text-align: center;
}

.word-quiz-target-sentence {
  min-height: 32px;
  margin: -2px 0 0;
  color: rgba(16, 32, 51, 0.82);
  transition: opacity 140ms ease, transform 140ms ease;
}

.word-quiz-cloze-sentence {
  margin: -4px auto 0;
}

.word-quiz-target-sentence.is-placeholder {
  opacity: 0.88;
}

.word-quiz-cloze-gap {
  display: inline-block;
  width: 7.5em;
  max-width: min(7.5em, 56vw);
  height: 0.9em;
  margin: 0 3px -0.08em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 -2px 0 rgba(15, 84, 134, 0.24);
}

.word-quiz-target-sentence.is-revealed {
  opacity: 1;
  transform: translateY(-1px);
}

.word-quiz-sentence-hit {
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.42);
  padding: 0 2px;
}

.word-quiz-cloze-answer {
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 -2px 0 rgba(15, 84, 134, 0.2);
  animation: quizClozeReveal 900ms ease-out both;
}

@keyframes quizClozeReveal {
  0%,
  100% {
    background: rgba(255, 255, 255, 0.62);
  }

  35% {
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18);
  }
}

.word-quiz-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 22px;
}

.word-quiz-option {
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  font-weight: 500;
  line-height: 1.15;
  cursor: pointer;
  padding: 16px 18px;
  box-shadow: 0 3px 8px rgba(31, 45, 68, 0.08);
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 0.42s ease,
    border-color 0.42s ease,
    box-shadow 0.42s ease,
    color 0.42s ease,
    opacity 0.42s ease,
    transform 0.42s ease;
}

@media (hover: hover) and (pointer: fine) {
  .word-quiz-option:hover:not(:disabled):not(.is-reveal-pending):not(.is-correct):not(.is-wrong):not(.is-wrong-start) {
    border-color: var(--accent);
    background: var(--accent-soft);
  }
}

.word-quiz-option:disabled {
  cursor: default;
}

.word-quiz-option:active,
.word-quiz-option:focus {
  outline: 0;
}

.word-quiz-option:focus:not(:focus-visible) {
  outline: 0;
}

@media (hover: none) {
  .word-quiz-option:hover {
    border-color: var(--line);
    background: var(--surface-soft);
  }
}

.word-quiz-option.is-selected {
  border-color: var(--brand);
  background: #fff7ec;
}

.word-quiz-option.is-reveal-pending {
  background: var(--surface-soft);
  border-color: var(--line);
  box-shadow: 0 3px 8px rgba(31, 45, 68, 0.08);
  color: var(--ink);
  opacity: 1;
  transform: scale(1);
}

.word-quiz-option.is-correct {
  border-color: #2f9d62;
  background: #eafff1;
  box-shadow: 0 0 0 4px rgba(47, 157, 98, 0.16);
  opacity: 1;
  transform: scale(1);
}

.word-quiz-option.is-wrong-start {
  border-color: #c94a3f;
  background: #fff0ee;
  box-shadow: 0 0 0 4px rgba(201, 74, 63, 0.14);
  color: var(--ink);
  opacity: 1;
  transform: scale(1);
}

.word-quiz-option.is-wrong {
  border-color: #c94a3f;
  background: #fff0ee;
  box-shadow: 0 0 0 4px rgba(201, 74, 63, 0.14);
}

.word-quiz-feedback {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  justify-self: stretch;
  margin-top: -2px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.25;
  animation: quizFeedbackPulse 1050ms ease-out both;
}

.word-quiz-feedback strong {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.word-quiz-feedback span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 650;
}

.word-quiz-feedback.is-correct {
  border-color: rgba(47, 157, 98, 0.34);
  background: #eafff1;
  animation-name: quizFeedbackCorrectPulse;
}

.word-quiz-feedback.is-wrong {
  border-color: rgba(201, 74, 63, 0.34);
  background: #fff0ee;
  animation-name: quizFeedbackWrongPulse;
}

@keyframes quizFeedbackCorrectPulse {
  0% {
    opacity: 0;
    transform: translateY(4px);
    background: #ffffff;
  }

  18% {
    opacity: 1;
    transform: translateY(0);
    background: #d8f9e4;
  }

  100% {
    opacity: 1;
    transform: translateY(0);
    background: #eafff1;
  }
}

@keyframes quizFeedbackWrongPulse {
  0% {
    opacity: 0;
    transform: translateY(4px);
    background: #ffffff;
  }

  18% {
    opacity: 1;
    transform: translateY(0);
    background: #ffdcd8;
  }

  100% {
    opacity: 1;
    transform: translateY(0);
    background: #fff0ee;
  }
}

.word-quiz-loading,
.word-quiz-result {
  display: grid;
  place-items: center;
  min-height: 220px;
  gap: 14px;
  color: var(--muted);
  text-align: center;
}

.skeleton-line {
  display: block;
  width: 100%;
  height: 0.78rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #dce5ee 0%, #f3f7fa 46%, #dce5ee 100%);
  background-size: 220% 100%;
  animation: skeletonShimmer 1.25s ease-in-out infinite;
}

.skeleton-line.is-long {
  width: 82%;
}

.skeleton-line.is-medium {
  width: 62%;
}

.skeleton-line.is-short {
  width: 38%;
}

.skeleton-dot {
  display: inline-block;
  width: 24px;
  height: 22px;
  border-radius: 4px;
  background: linear-gradient(90deg, #dce5ee 0%, #f3f7fa 46%, #dce5ee 100%);
  background-size: 220% 100%;
  animation: skeletonShimmer 1.25s ease-in-out infinite;
}

.skeleton-sound {
  cursor: default;
  pointer-events: none;
  border-color: #cfd8e4;
  background: linear-gradient(90deg, #dce5ee 0%, #f3f7fa 46%, #dce5ee 100%);
  background-size: 220% 100%;
  color: #7c8a9b;
  animation: skeletonShimmer 1.25s ease-in-out infinite;
  box-shadow: none;
}

.skeleton-stack {
  display: grid;
  gap: 7px;
  align-content: center;
  min-height: 32px;
}

.skeleton-word-wrap {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: start;
  column-gap: 8px;
}

.skeleton-row td {
  height: 48px;
}

.skeleton-quiz {
  width: min(660px, 100%);
  justify-self: center;
  align-content: start;
  gap: 22px;
}

.skeleton-quiz-term {
  width: min(260px, 68%);
  height: 2.7rem;
  justify-self: center;
}

.skeleton-quiz-sentence {
  width: min(520px, 86%);
  justify-self: center;
}

.skeleton-quiz-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 22px;
  width: 100%;
}

.skeleton-quiz-options .skeleton-line {
  height: 82px;
  border-radius: 10px;
}

@keyframes skeletonShimmer {
  0% {
    background-position: 120% 0;
  }

  100% {
    background-position: -120% 0;
  }
}

.word-quiz-score {
  color: var(--brand);
  font-size: 1.4rem;
  font-weight: 900;
}

.word-quiz-result strong {
  color: var(--ink);
  font-size: clamp(2rem, 5vw, 3rem);
}

.word-quiz-result button {
  min-height: 40px;
  border: 1px solid var(--accent-ink);
  border-radius: 9px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  padding: 0 16px;
}

.word-quiz-result button:hover {
  background: var(--accent-ink);
}

.word-quiz-misses {
  width: min(100%, 560px);
  display: grid;
  gap: 9px;
  margin: 4px 0 2px;
  text-align: left;
}

.word-quiz-misses h2 {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0;
}

.word-quiz-miss {
  display: grid;
  grid-template-columns: minmax(120px, 0.85fr) minmax(0, 1.45fr);
  gap: 12px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--surface-soft);
  box-shadow: 0 2px 7px rgba(31, 45, 68, 0.06);
}

.word-quiz-miss-term {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  min-width: 0;
}

.word-quiz-miss-term span {
  color: var(--muted);
  font-size: 0.78rem;
}

.word-quiz-miss-lines {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.word-quiz-miss a {
  color: var(--link);
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.word-quiz-miss a:hover {
  text-decoration: underline;
}

.word-quiz-miss-source {
  color: var(--ink) !important;
}

.word-quiz-miss-empty {
  color: var(--muted);
}

.trainer-intro {
  display: grid;
  gap: 6px;
  margin-bottom: 20px;
}

.trainer-kicker,
.trainer-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.trainer-intro h1 {
  margin: 0;
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.18;
}

.auth-view {
  display: grid;
  gap: 16px;
}

.shell.is-trainer-home .auth-view {
  padding: 24px 24px 46px;
}

.shell.is-trainer-home .trainer-card.is-learn-challenge-active .auth-view {
  padding: 0;
}

.auth-view[hidden] {
  display: none !important;
}

.google-signin {
  min-height: 44px;
}

.learn-login-hero {
  display: grid;
  row-gap: 0;
  justify-items: start;
  width: 100%;
  margin: 0;
  padding: 0;
}

.learn-login-heading {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 18px;
  width: 100%;
  margin: 0;
  text-align: center;
}

.learn-page-heading {
  align-self: start;
  padding: 24px 24px 26px;
  border-bottom: 1px solid var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 5px 14px rgba(21, 84, 134, 0.18);
}

.learn-login-heading h1 {
  margin: 0;
  color: #ffffff;
  flex: 0 1 auto;
  width: 100%;
  font-size: 2.65rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

.learn-login-action {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: min(560px, 100%);
  min-height: 270px;
  justify-self: center;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f5f8fb;
  box-shadow: 0 18px 38px rgba(31, 45, 68, 0.16);
}

.learn-login-google-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 4px 14px;
  text-align: left;
}

.learn-login-person-icon {
  grid-row: 1 / span 2;
  width: 46px;
  height: 46px;
  align-self: center;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.learn-login-google-head strong {
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1.2;
}

.learn-login-google-head span {
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.45;
}

.learn-login-action .google-signin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 392px);
  min-height: 72px;
  margin: 0 auto;
  padding: 14px;
  border: 1px solid var(--accent-ink);
  border-radius: 8px;
  background: var(--accent);
}

.learn-privacy-note {
  margin-top: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.48;
}

.learn-privacy-note a {
  color: rgba(22, 32, 51, 0.52);
  font-weight: 400;
  text-decoration: none;
}

.learn-privacy-note a:hover {
  text-decoration: underline;
}

.auth-note,
.vocab-message {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.trainer-userbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.trainer-userbar strong {
  display: block;
  margin-top: 3px;
}

.secondary-button,
.vocab-form button,
.vocab-delete {
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.secondary-button {
  min-height: 34px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--accent-ink);
}

.secondary-button:hover,
.vocab-form button:hover,
.vocab-delete:hover {
  filter: brightness(0.97);
}

.collection-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.8fr);
  gap: 12px;
  align-items: end;
}

.collection-bar label,
.collection-form {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.collection-bar label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.collection-bar select,
.collection-form input,
.learn-profile-form input,
.challenge-form input,
.challenge-form select {
  height: 38px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.95rem;
  padding: 0 10px;
}

.collection-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.learn-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
}

.learn-card.is-challenge-active {
  justify-items: center;
  border: 0;
  background: transparent;
  padding: 0;
}

.learn-card.is-challenge-active > :not(#challengePanel) {
  display: none !important;
}

.learn-summary,
.learn-stats {
  display: none !important;
}

.learn-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.learn-summary div {
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #ffffff;
  padding: 12px;
}

.learn-summary span,
.learn-summary strong {
  display: block;
}

.learn-summary span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.learn-summary strong {
  color: var(--ink);
  font-size: 1.45rem;
}

.learn-profile-form,
.challenge-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.learn-group-create {
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.learn-group-create.is-invite-step {
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: min(430px, calc(100vh - 260px));
  align-content: stretch;
  align-items: stretch;
}

.learn-group-create[hidden] {
  display: none !important;
}

.learn-create-group-button {
  justify-self: end;
  min-height: 48px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 800;
  padding: 0 22px;
}

.learn-create-group-button[hidden] {
  display: none !important;
}

.learn-group-name-field {
  grid-column: 1 / -1;
}

.learn-group-name-field[hidden] {
  display: none !important;
}

.learn-language-builder {
  position: relative;
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
}

.learn-language-builder[hidden] {
  display: none !important;
}

.learn-template-field {
  display: grid;
  gap: 6px;
}

.learn-template-field select {
  min-height: 40px;
  width: 100%;
  border: 1px solid #dfe5ec;
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  padding: 0 10px;
}

.learn-native-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 400;
}

.learn-native-button {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}

.learn-native-button:hover {
  color: var(--ink);
  text-decoration: underline;
}

.learn-language-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.learn-language-options[hidden] {
  display: none !important;
}

.learn-language-options.is-compact {
  position: absolute;
  z-index: 30;
  top: 28px;
  left: 82px;
  width: min(230px, calc(100vw - 48px));
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(165, 177, 193, 0.42);
  border-radius: 7px;
  background: #fbfcfe;
  box-shadow: 0 16px 34px rgba(31, 45, 68, 0.23);
}

.learn-language-option {
  min-height: 96px;
  display: grid;
  place-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 2px 7px rgba(31, 45, 68, 0.08);
}

.learn-language-options.is-compact .learn-language-option {
  min-height: 0;
  place-items: stretch;
  justify-items: start;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  padding: 10px 12px;
}

.learn-language-options.is-compact .learn-language-option span {
  display: none;
}

.learn-language-options.is-compact .learn-language-option strong {
  font-size: 0.95rem;
}

.learn-language-option span {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid #e7ebf0;
  border-radius: 999px;
  background: #f6f7f9;
  font-size: 1.45rem;
  line-height: 1;
}

.learn-language-option strong {
  font-size: 0.95rem;
}

.learn-language-option:hover,
.learn-language-option.is-selected {
  border-color: #cfd6df;
  background: #f4f6f8;
  color: var(--ink);
}

.learn-language-option:hover span {
  background: #edf1f5;
}

.learn-language-option.is-selected {
  border-color: #d5dbe3;
  background: #edf1f5;
}

.learn-language-option.is-selected span {
  border-color: #d8dee6;
  background: #e7edf3;
}

.learn-language-options.is-compact .learn-language-option:hover,
.learn-language-options.is-compact .learn-language-option.is-selected {
  background: #f0f3f7;
  color: var(--ink);
}

.learn-invite-step {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
}

.learn-group-review {
  display: grid;
  gap: 0;
  width: 100%;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0;
}

.learn-group-review-head {
  border-radius: 8px;
  width: 100%;
}

.learn-group-review[hidden] {
  display: none;
}

.learn-invite-step[hidden] {
  display: none;
}

.learn-invite-draft-list {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 150px;
  overflow-y: auto;
  padding: 2px 3px 20px 0;
}

.learn-invite-draft-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #ffffff;
  padding: 8px 10px;
}

.learn-invite-draft-item button {
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.learn-invite-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 10px;
  align-items: end;
}

.learn-invite-add-button {
  width: 40px;
  height: 40px;
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #cfd6df !important;
  border-radius: 999px !important;
  background: #eef1f5 !important;
  color: var(--ink) !important;
  font-size: 1.35rem;
  line-height: 1;
  padding: 0 !important;
}

.learn-invite-add-button:hover {
  background: #e1e7ee !important;
}

.learn-group-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 6px 0;
}

.learn-group-actions button {
  flex: 0 1 184px;
  min-width: 184px;
  min-height: 54px;
  font-weight: 800;
  padding: 0 30px;
  font-size: 1.04rem;
}

.learn-group-actions .learn-group-cancel-button {
  border-color: transparent;
  background: #eef2f6;
  color: var(--ink);
  font-weight: 400;
}

.learn-group-actions .learn-group-cancel-button:hover {
  background: #dde5ee;
  color: var(--ink);
}

.learn-profile-form label,
.challenge-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.learn-profile-form label span,
.challenge-form label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.collection-form button,
.learn-profile-form button,
.challenge-form button,
.quiz-start,
.quiz-form button,
.quiz-feedback button {
  min-height: 38px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  padding: 0 12px;
}

.learn-profile-form .learn-language-option {
  min-height: 96px;
  border: 1px solid #edf0f4;
  background: #ffffff;
  color: var(--ink);
  padding: 0 12px;
}

.learn-profile-form .learn-language-option:hover {
  border-color: #cfd6df;
  background: #f4f6f8;
  color: var(--ink);
}

.learn-profile-form .learn-language-option.is-selected {
  border-color: #d5dbe3;
  background: #edf1f5;
  color: var(--ink);
}

.learn-profile-form .learn-language-option:hover span {
  background: #edf1f5;
}

.learn-profile-form .learn-language-option.is-selected span {
  border-color: #d8dee6;
  background: #e7edf3;
}

.learn-profile-form .learn-native-button {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  padding: 0;
}

.learn-profile-form .learn-native-button:hover {
  background: transparent;
  color: var(--ink);
  text-decoration: underline;
}

.learn-profile-form .learn-language-options.is-compact {
  border-color: rgba(165, 177, 193, 0.42);
  background: #fbfcfe;
  box-shadow: 0 16px 34px rgba(31, 45, 68, 0.23);
}

.learn-profile-form .learn-language-options.is-compact .learn-language-option {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  padding: 10px 12px;
}

.learn-profile-form .learn-language-options.is-compact .learn-language-option:hover,
.learn-profile-form .learn-language-options.is-compact .learn-language-option.is-selected {
  background: #f0f3f7;
  color: var(--ink);
}

.learn-profile-form .learn-invite-draft-item button {
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
  padding: 0 4px;
}

.challenge-opponent {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  justify-self: center;
  margin-top: 2px;
}

.challenge-result {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 150px;
  text-align: center;
}

.challenge-result span {
  color: var(--accent-ink);
  font-size: 1.7rem;
  font-weight: 900;
}

.challenge-result button {
  min-width: min(100%, 220px);
  min-height: 48px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 800;
  padding: 0 22px;
}

.challenge-result button[data-start-next-challenge] {
  min-height: 54px;
  background: var(--accent-ink);
  font-size: 1.04rem;
}

.learn-stats {
  display: grid;
  gap: 8px;
}

.learn-summary,
.learn-stats {
  display: none !important;
}

.learn-stats-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.learn-stats-summary div,
.learn-opponent-row {
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #ffffff;
  padding: 10px;
}

.learn-stats-summary strong,
.learn-stats-summary span {
  display: block;
}

.learn-stats h2 {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.learn-opponent-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.learn-list {
  display: grid;
  gap: 10px;
}

#learnGroups {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#learnGroups .learn-group-head {
  align-items: flex-start;
}

.learn-list-item,
.learn-group {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #ffffff;
  padding: 0;
}

.learn-list-item,
.learn-group-head,
.learn-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.learn-group {
  display: grid;
  position: relative;
  gap: 0;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.learn-list-item {
  padding: 12px;
}

.learn-invite-item > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.learn-invite-item button {
  flex: 0 0 auto;
  min-width: 108px;
  min-height: 44px;
  padding: 0 18px;
  font-size: 0.98rem;
}

.learn-group:focus-visible {
  outline: 3px solid rgba(0, 109, 217, 0.24);
  outline-offset: 2px;
}

.learn-group:has(.learn-group-menu[open]) {
  z-index: 2000;
}

.learn-group-title {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1 1 auto;
  min-width: 0;
}

.learn-group-head {
  min-width: 0;
  border-radius: 8px 8px 0 0;
  background: var(--accent);
  color: #ffffff;
  padding: 10px 12px;
}

.learn-group-language-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 7px rgba(31, 45, 68, 0.18);
  color: var(--accent-ink);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
}

.learn-group-title > div {
  min-width: 0;
  flex: 1 1 auto;
}

.learn-group-title strong,
.learn-group-title span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.learn-group-title strong {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.learn-group-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.08rem;
}

.learn-group-member-count {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.74rem;
  font-weight: 800;
}

.learn-group-title span {
  color: rgba(255, 255, 255, 0.82);
}

.learn-group-menu {
  position: relative;
  flex: 0 0 auto;
  margin-left: auto;
  z-index: 70;
}

.learn-group-menu summary {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
  list-style: none;
}

.learn-group-menu summary::-webkit-details-marker {
  display: none;
}

.learn-group-menu[open] summary {
  border-color: #ffffff;
  color: #ffffff;
}

.learn-group-menu summary:hover {
  border-color: #ffffff;
  color: #ffffff;
}

.learn-group-menu-panel {
  position: absolute;
  z-index: 3000;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  gap: 5px;
  width: min(270px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  background: #fafcff;
  box-shadow: 0 10px 22px rgba(31, 45, 68, 0.18);
  cursor: default;
  padding: 10px;
}

.learn-group-menu-panel button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-weight: 400;
  cursor: pointer;
  padding: 0 14px;
  font-size: 0.95rem;
  text-align: left;
}

.learn-group-menu-panel button:hover {
  background: #f1f5fa;
  color: var(--ink);
}

.learn-group-menu-panel .learn-group-menu-primary {
  margin-bottom: 7px;
  background: #f3f7fb;
  color: var(--ink);
  font-weight: 650;
}

.learn-group-menu-panel .learn-group-menu-primary::after {
  content: "";
  display: block;
  height: 1px;
  margin: 9px -14px -8px;
  background: #e5ebf2;
}

.learn-group-menu-panel .learn-group-menu-primary:hover {
  background: #edf3f9;
  color: var(--ink);
}

.learn-group-menu-panel .learn-group-delete-action {
  margin-top: 7px;
  border-top: 1px solid #d8e0ea;
  border-radius: 0 0 6px 6px;
  background: transparent;
  color: #b3342c;
  font-weight: 400;
}

.learn-group-menu-panel .learn-group-delete-action:hover {
  background: #eadedd;
  color: #8f261f;
}

.learn-dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 36px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(8, 33, 59, 0.32);
}

.learn-dialog::backdrop {
  background: rgba(17, 31, 50, 0.42);
}

.learn-dialog-shell {
  display: grid;
  max-height: min(760px, calc(100vh - 36px));
  overflow: hidden;
  background: var(--surface);
}

.account-data-dialog .learn-dialog-shell {
  width: min(760px, calc(100vw - 22px));
}

.add-vocab-fallback-dialog {
  width: min(520px, calc(100vw - 28px));
}

.account-data-body {
  display: grid;
  gap: 12px;
  max-height: min(58vh, 560px);
  overflow: auto;
}

.account-data-section {
  display: grid;
  gap: 7px;
}

.account-data-section h3 {
  margin: 0;
  font-size: 0.95rem;
}

.account-data-summary {
  display: grid;
  gap: 8px;
  margin: 0;
}

.account-data-summary div,
.account-data-section-list button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
}

.account-data-summary dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.account-data-summary dd {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-data-section-list {
  display: grid;
  gap: 8px;
}

.account-data-section-item {
  display: grid;
  gap: 8px;
}

.account-data-section-list button {
  width: 100%;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.account-data-section-list button:hover {
  background: #ffffff;
}

.account-data-section-list button[aria-expanded="true"] {
  border-color: rgba(255, 148, 24, 0.48);
  background: #ffffff;
}

.account-data-section-list strong {
  color: var(--accent-ink);
}

.account-data-toggle-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.account-data-detail {
  padding-left: 10px;
  border-left: 3px solid rgba(255, 148, 24, 0.42);
}

.account-data-section pre {
  margin: 0;
  padding: 10px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1.42;
  white-space: pre-wrap;
  word-break: break-word;
}

.account-data-actions {
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}

#learnMembersDialog {
  width: min(860px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - 36px));
}

#learnMembersDialog .learn-dialog-shell {
  grid-template-rows: auto minmax(0, 1fr);
  height: min(720px, calc(100vh - 36px));
  max-height: min(720px, calc(100vh - 36px));
}

.learn-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--accent);
  color: #ffffff;
}

.learn-dialog-head span {
  display: block;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  font-weight: 800;
}

.learn-dialog-head h2 {
  margin: 0;
  color: #ffffff;
  font-size: 1.38rem;
  line-height: 1.12;
}

.learn-dialog-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}

.learn-dialog-body {
  display: grid;
  gap: 18px;
  overflow-y: auto;
  padding: 18px 20px 22px;
}

#learnMembersDialog .learn-dialog-body {
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
}

#learnMembersDialog .learn-dialog-section {
  min-height: 0;
}

#learnMembersDialog .learn-dialog-section:last-child {
  grid-template-rows: auto auto;
}

.learn-vocab-dialog .learn-dialog-body {
  grid-template-rows: auto minmax(0, 1fr);
  height: min(620px, calc(100vh - 152px));
  overflow: hidden;
}

.learn-start-dialog {
  width: min(460px, calc(100vw - 28px));
}

.ios-install-dialog {
  width: min(480px, calc(100vw - 28px));
}

.ios-install-dialog-text {
  margin: 0;
  color: var(--ink);
  line-height: 1.4;
}

.ios-install-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
  color: var(--ink);
  line-height: 1.38;
}

.ios-install-steps li:first-child {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.ios-share-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--accent-ink);
}

.ios-share-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.ios-install-dialog-actions {
  display: flex;
  justify-content: flex-end;
}

.ios-install-dialog-actions button {
  min-width: 130px;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.learn-rename-dialog {
  width: min(500px, calc(100vw - 28px));
}

.learn-delete-dialog {
  width: min(460px, calc(100vw - 28px));
}

.learn-delete-dialog-text {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.4;
}

.learn-delete-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.learn-delete-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: #eef2f6;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  padding: 0 16px;
}

.learn-delete-actions button:hover {
  background: #dde5ee;
}

.learn-delete-actions .learn-delete-confirm {
  background: #fff0ee;
  color: #b3342c;
  font-weight: 650;
}

.learn-delete-actions .learn-delete-confirm:hover {
  background: #eadedd;
  color: #8f261f;
}

.learn-rename-form label {
  display: grid;
  gap: 7px;
}

.learn-rename-form label span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.learn-rename-form input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  padding: 0 12px;
}

.learn-rename-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.learn-rename-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: #eef2f6;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  padding: 0 16px;
}

.learn-rename-actions button:hover {
  background: #dde5ee;
}

.learn-rename-actions button[type="submit"] {
  background: var(--accent);
  color: #ffffff;
  font-weight: 650;
}

.learn-rename-actions button[type="submit"]:hover {
  background: var(--accent-ink);
}

.learn-start-dialog .learn-dialog-body {
  gap: 22px;
}

.learn-start-dialog-text {
  display: grid;
  gap: 14px;
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.learn-start-question {
  display: block;
}

.learn-start-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.learn-start-summary span {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.learn-start-summary strong {
  color: var(--ink);
  font-size: 1.2rem;
}

.learn-start-progress {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.learn-start-pie-wrap {
  position: relative;
  display: grid;
  place-items: center;
}

.learn-start-pie {
  width: 156px;
  aspect-ratio: 1;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
}

.learn-start-pie-value {
  position: absolute;
  display: grid;
  place-items: center;
  width: 86px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(28, 112, 173, 0.12);
  color: var(--ink);
  font-size: 1.6rem;
  font-weight: 900;
}

.learn-start-progress-label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.learn-start-dialog-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.learn-start-dialog-actions button {
  flex: 1 1 0;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: #eef2f6;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  padding: 0 16px;
}

.learn-start-dialog-actions button:hover {
  background: #dde5ee;
}

.learn-start-dialog-actions [data-confirm-learn-start] {
  background: var(--accent);
  color: #ffffff;
}

.learn-start-dialog-actions [data-confirm-learn-start]:hover {
  background: var(--accent-ink);
}

.learn-start-dialog.is-unavailable .learn-start-dialog-actions {
  justify-content: center;
}

.learn-vocab-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #eef2f6;
  padding: 4px;
}

.learn-vocab-tabs button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.learn-vocab-tabs button:hover {
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
}

.learn-vocab-tabs button.is-active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(31, 42, 58, 0.08);
}

.learn-dialog-section {
  display: grid;
  gap: 10px;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.learn-dialog-section h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.learn-dialog .learn-members {
  align-content: start;
  grid-auto-rows: max-content;
  max-height: none;
  min-height: 0;
  overflow-y: auto;
  padding: 0;
}

.learn-dialog .learn-member {
  flex: 0 0 auto;
  min-height: 48px;
  align-self: start;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #ffffff;
}

.learn-dialog .learn-member.is-pending {
  border-style: dashed;
  background: rgba(246, 248, 251, 0.78);
  color: rgba(58, 70, 88, 0.72);
}

.learn-dialog .learn-member.is-pending .learn-member-avatar {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(118, 128, 146, 0.24);
  color: rgba(58, 70, 88, 0.58);
}

.learn-dialog .learn-member span:not(.learn-member-avatar) {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.learn-vocab-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.learn-vocab-filter,
.learn-vocab-search input {
  height: 42px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--ink);
}

.learn-vocab-search button,
.learn-vocab-ref-item button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: #eef2f6;
  color: var(--ink);
  cursor: pointer;
  font-weight: 650;
  padding: 0 14px;
}

.learn-vocab-search button:hover,
.learn-vocab-ref-item button:hover {
  background: #dde5ee;
}

.learn-vocab-search-results,
.learn-vocab-existing-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 3px;
}

.learn-vocab-search-results {
  min-height: 0;
}

.learn-vocab-existing-list {
  min-height: 0;
}

.learn-vocab-ref-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface-soft);
  min-height: 42px;
  padding: 7px 8px;
}

.learn-vocab-ref-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px;
  gap: 10px;
  padding: 0 9px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.learn-vocab-recent-head {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
}

.learn-vocab-ref-source,
.learn-vocab-ref-target {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.learn-vocab-ref-target {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.learn-vocab-ref-target-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.learn-vocab-ref-tag {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.learn-vocab-icon-button,
.learn-vocab-ref-status {
  display: inline-grid;
  place-items: center;
  justify-self: end;
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
}

.learn-vocab-ref-status {
  border-radius: 6px;
  color: var(--accent);
  font-weight: 800;
}

.learn-member {
  justify-content: start;
  min-height: 42px;
  padding: 0 12px;
}

.learn-group-preview-members {
  display: grid;
  gap: 6px;
  min-height: 238px;
  padding: 10px 12px 12px;
}

.learn-member-preview {
  min-height: 38px;
  padding: 0;
}

.learn-group.is-empty-vocab {
  cursor: default;
}

.learn-member-preview.is-current-user {
  color: var(--ink);
  font-weight: 800;
}

.learn-member-preview.is-empty {
  color: rgba(106, 116, 132, 0.52);
}

.learn-member-preview.is-empty .learn-member-avatar {
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(118, 128, 146, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.learn-member-preview.is-empty strong {
  color: rgba(106, 116, 132, 0.48);
  font-weight: 600;
}

.learn-member-preview.is-empty em {
  visibility: hidden;
}

.learn-member-preview em {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.learn-rank-trophy {
  display: inline-grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1;
}

.learn-rank-trophy.is-rank-1 {
  background: linear-gradient(135deg, #ffe18a, #d18a12);
  box-shadow: 0 0 0 1px rgba(166, 106, 7, 0.16);
}

.learn-rank-trophy.is-rank-2 {
  background: linear-gradient(135deg, #f1f5f9, #9aa8b7);
  box-shadow: 0 0 0 1px rgba(105, 119, 138, 0.18);
}

.learn-rank-trophy.is-rank-3 {
  background: linear-gradient(135deg, #f3c28f, #a8612d);
  box-shadow: 0 0 0 1px rgba(128, 71, 34, 0.18);
}

.learn-member-avatar {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: 999px;
  background: #ffb347;
  color: #7a3200;
  font-size: 0.78rem;
  font-weight: 900;
  flex: 0 0 auto;
}

.learn-member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.learn-member strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.learn-member em {
  margin-left: auto;
  font-style: normal;
  font-weight: 900;
}

.learn-members {
  display: grid;
  max-height: 210px;
  overflow-y: auto;
  padding: 8px 0;
}

.learn-member-remove {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #f0c5c1;
  border-radius: 999px;
  background: #ffffff;
  color: #b3342c;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
}

.learn-member-remove:hover {
  background: #fff4f2;
}

.learn-list-item span,
.learn-group-head span,
.learn-invites,
.learn-member em {
  color: var(--muted);
  font-size: 0.82rem;
}

.learn-group-head .learn-group-title span {
  color: rgba(255, 255, 255, 0.82);
}

.learn-group-head .learn-group-language-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 7px rgba(31, 45, 68, 0.18);
  color: var(--accent-ink);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-overflow: clip;
  white-space: normal;
}

.learn-group-head .learn-group-title .learn-group-language-icon {
  color: var(--accent-ink);
}

.learn-group-review-head .learn-group-name-text {
  font-size: 1.14rem;
}

.learn-list-item button,
.learn-group-head button,
.learn-invite-form button {
  min-height: 34px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  padding: 0 10px;
}

.learn-group-head .learn-group-menu-panel button {
  min-height: 42px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 400;
}

.learn-group-head .learn-group-menu-panel button:hover {
  background: #f1f5fa;
  color: var(--ink);
}

.learn-group-head .learn-group-menu-panel .learn-group-menu-primary {
  background: #f3f7fb;
  font-weight: 650;
}

.learn-group-head .learn-group-menu-panel .learn-group-menu-primary::after {
  content: "";
  display: block;
  height: 1px;
  margin: 9px -14px -8px;
  background: #e5ebf2;
}

.learn-group-head .learn-group-menu-panel .learn-group-menu-primary:hover {
  background: #edf3f9;
}

.learn-group-head .learn-group-menu-panel .learn-group-delete-action {
  border-top: 1px solid #d8e0ea;
  background: transparent;
  color: #b3342c;
  font-weight: 400;
}

.learn-group-head .learn-group-menu-panel .learn-group-delete-action:hover {
  background: #eadedd;
  color: #8f261f;
}

.learn-invite-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin: 10px 0;
}

.learn-invite-form input {
  min-width: 0;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
}

.learn-members,
.learn-invites {
  display: grid;
  gap: 6px;
}

.trainer-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.trainer-stats div {
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 10px;
}

.trainer-stats strong,
.trainer-stats span {
  display: block;
}

.trainer-stats strong {
  color: var(--ink);
  font-size: 1.2rem;
}

.trainer-stats span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.quiz-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  padding: 14px;
}

#challengePanel {
  width: 100%;
  justify-self: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.learn-challenge-card {
  width: 100%;
  max-width: none;
}

.quiz-empty {
  color: var(--muted);
}

.quiz-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.quiz-form div,
.quiz-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.quiz-form strong {
  font-size: 1.08rem;
}

.quiz-form input {
  height: 38px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.98rem;
  padding: 0 10px;
}

.quiz-feedback {
  display: grid;
  gap: 5px;
}

.quiz-feedback span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.quiz-feedback strong {
  color: var(--ink);
}

.quiz-feedback small {
  color: var(--muted);
}

.quiz-feedback.is-correct {
  border-color: #b7dfc5;
}

.action-col {
  width: 46px;
}

.dict-table col.action-col {
  width: 46px;
}

.row-action {
  width: 46px;
  text-align: center;
  vertical-align: middle;
}

.add-vocab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  color: var(--accent-ink);
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
  vertical-align: middle;
  cursor: pointer;
}

.add-vocab:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.add-vocab:disabled {
  cursor: default;
  opacity: 0.72;
}

.add-vocab.is-saved {
  border-color: var(--line);
  background: #ffffff;
  color: var(--accent-ink);
  font-size: 1rem;
  font-weight: 800;
  opacity: 1;
}

.add-vocab.is-saved:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.add-vocab.is-saved:not(:disabled) {
  cursor: pointer;
}

.add-vocab.is-pending {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.add-vocab.is-error {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.add-vocab-menu {
  position: fixed;
  z-index: 90;
  display: grid;
  gap: 6px;
  width: 260px;
  max-width: calc(100vw - 20px);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(31, 45, 68, 0.22);
  padding: 10px;
}

.add-vocab-menu strong {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.add-vocab-menu button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 400;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  white-space: nowrap;
  padding: 0 10px;
}

.add-vocab-menu button:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.add-vocab-menu button:disabled {
  cursor: default;
}

.add-vocab-menu button.is-added {
  border-color: transparent;
  background: #eef2f6;
  color: var(--muted);
}

.add-vocab-menu button.is-pending {
  opacity: 0.72;
}

.add-vocab-menu-label,
.add-vocab-menu-count {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.add-vocab-menu-count {
  min-width: 26px;
  justify-self: start;
  border-radius: 999px;
  background: #e7edf5;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  padding: 0 8px;
  text-align: center;
}

.add-vocab-menu-check {
  color: var(--accent);
  font-weight: 700;
  text-align: right;
}

.vocab-list {
  display: grid;
  gap: 8px;
}

.vocab-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 10px;
}

.vocab-pair {
  min-width: 0;
}

.vocab-pair strong {
  color: var(--ink);
}

.vocab-pair span {
  color: var(--muted);
}

.vocab-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.vocab-delete {
  min-height: 30px;
  padding: 0 9px;
  background: #ffffff;
  color: var(--danger);
  border-color: var(--danger);
}

.site-footer {
  margin-top: auto;
  padding: 18px 28px 26px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.86rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1;
  grid-row: 1;
  gap: 14px;
}

.site-footer .legal-header-nav {
  justify-content: flex-start;
}

.site-footer .legal-header-nav a {
  border: 0;
  color: inherit;
  padding: 0;
  font-size: inherit;
  font-weight: 600;
}

.footer-language {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  margin-left: 0;
}

.footer-meta {
  flex: 0 0 auto;
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.footer-version {
  opacity: 0.82;
}

.footer-language-select {
  flex: 0 0 auto;
  min-width: 132px;
  height: 32px;
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink);
  font-size: 0.86rem;
  box-shadow: none;
}

.site-footer a,
.legal-page a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 2px;
}

.site-footer a:hover,
.legal-page a:hover {
  color: var(--link);
  text-decoration: underline;
}

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

.brand-link:hover {
  color: #ffffff;
  text-decoration: none;
}

.legal-topbar {
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: center;
}

.legal-header-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.legal-header-nav a {
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 6px;
  color: #ffffff;
  padding: 7px 10px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
}

.legal-header-nav a:hover {
  background: rgba(255, 255, 255, 0.14);
}

.legal-page {
  max-width: 780px;
  padding: 30px 34px 46px;
}

.legal-page h1,
.legal-page h2,
.legal-page p {
  margin-top: 0;
}

.legal-page h1 {
  margin-bottom: 18px;
  font-size: 2rem;
  line-height: 1.1;
}

.legal-page h2 {
  margin-bottom: 7px;
  font-size: 1.05rem;
}

.legal-page section {
  margin-top: 24px;
}

.legal-page p,
.legal-page address {
  color: #354155;
  line-height: 1.55;
}

.legal-page address {
  font-style: normal;
}

.legal-kicker {
  color: var(--accent-ink);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.legal-note {
  color: var(--muted) !important;
  font-size: 0.9rem;
}

.spam-protected {
  font-weight: 700;
}

.nowrap {
  white-space: nowrap;
}

.entry {
  margin-bottom: 18px;
  border: 1px solid #b8c7d8;
  border-radius: 6px;
  overflow: visible;
  box-shadow: var(--shadow-soft);
}

.entry-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 8px 10px;
  background: var(--accent);
  color: #ffffff;
  border-bottom: 1px solid var(--accent-ink);
  font-size: 0.96rem;
  font-weight: 400;
}

.entry-title-table {
  padding-left: 0;
  padding-right: 0;
}

.entry-title-main {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
}

.entry-title-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 46px;
  width: 100%;
  align-items: center;
}

.entry-title-column {
  min-width: 0;
  padding: 0 8px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.92);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
  font-weight: 700;
}

.entry-title-action {
  width: 46px;
}

.entry-title-full,
.entry-title-short {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.9;
}

.entry-title-short {
  display: none;
}

.entry-title-pair,
.entry-title-query strong {
  font-weight: 700;
}

.entry-title-pair-link {
  color: inherit;
  text-decoration: none;
}

.entry-title-pair-link:hover,
.entry-title-pair-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.fallback-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--accent-ink);
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(21, 99, 168, 0.1);
}

.fallback-notice-text {
  min-width: 0;
}

.transitive-notice {
  justify-content: flex-start;
  border-color: #d7dee7;
  background: #f4f6f8;
  color: #2f3c48;
  font-weight: 600;
  box-shadow: none;
}

.entry.is-fallback {
  border-color: #9fbdd8;
}

.entry.is-fallback .entry-title {
  background: var(--accent);
  border-bottom-color: var(--accent-ink);
}

.entry.is-fallback .flag {
  border-color: #c4e0f8;
  color: var(--accent-ink);
}

.entry.is-fallback .dict-table th {
  background: var(--head);
  border-color: #ced9e6;
}

.entry.is-fallback .dict-table td {
  background: var(--row);
}

.entry.is-fallback .dict-table tr:nth-child(even) td {
  background: var(--row-alt);
}

.entry.is-fallback .entry-show-more {
  border-top-color: #c6d2df;
  background: var(--row-alt);
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.flag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 20px;
  margin-right: 6px;
  padding: 1px 5px;
  border: 1px solid #c4e0f8;
  border-radius: 4px;
  background: #ffffff;
  color: var(--accent-ink);
  font-size: 0.76rem;
  font-weight: 800;
  opacity: 0.88;
  white-space: nowrap;
}

.dict-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.98rem;
}

.dict-table th {
  background: var(--head);
  color: #2d3748;
  text-align: left;
  padding: 6px 8px;
  border: 1px solid #ced9e6;
  font-size: 0.85rem;
  font-weight: 700;
}

.dict-table td {
  background: var(--row);
  border: 1px solid var(--line-soft);
  padding: 6px 8px;
  vertical-align: top;
  line-height: 1.28;
}

.dict-table tr:nth-child(even) td {
  background: var(--row-alt);
}

.section-row td {
  background: var(--accent) !important;
  color: rgba(255, 255, 255, 0.86);
  border-color: var(--accent);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  padding: 4px 8px;
}

.section-row-column {
  color: rgba(255, 255, 255, 0.92) !important;
  font-size: 0.86rem !important;
  font-weight: 700 !important;
}

.section-row-action {
  width: 46px;
}

.entry-show-more {
  display: flex;
  justify-content: center;
  margin: 0;
  padding: 7px 8px;
  border-top: 1px solid #c6d2df;
  background: var(--row-alt);
}

.partial-matches-prompt {
  background: transparent;
}

.show-more-button {
  min-height: 30px;
  padding: 0 13px;
  border: 1px solid #b8c7d8;
  border-radius: 5px;
  background: #ffffff;
  color: var(--accent-ink);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.show-more-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.show-more-button:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
}

.sound {
  display: inline-grid;
  place-items: center;
  justify-self: center;
  width: 24px;
  height: 22px;
  border: 1px solid #c1ccda;
  border-radius: 4px;
  background: #edf3f9;
  color: #56667c;
  font-size: 0.68rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.sound:hover,
.sound:focus-visible,
.sound.is-speaking {
  border-color: rgba(28, 112, 173, 0.52);
  background: #ffffff;
  color: var(--accent);
}

.sound:focus-visible {
  outline: 2px solid rgba(28, 112, 173, 0.24);
  outline-offset: 2px;
}

.word-cell {
  width: 50%;
  overflow-wrap: anywhere;
}

.word-wrap {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: start;
  column-gap: 8px;
}

.word-content {
  min-width: 0;
}

.history-suggestion-text {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.results.is-refreshing .entry {
  opacity: 0.72;
  filter: grayscale(0.22) saturate(0.82);
  transition: opacity 140ms ease, filter 140ms ease;
}

.results.is-refreshing .entry-title,
.results.is-refreshing .dict-table th {
  filter: saturate(0.72);
}

.movie-meta {
  margin-top: 4px;
  color: #647386;
  font-size: 0.76rem;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.word-examples {
  display: grid;
  gap: 2px;
  margin-top: 4px;
}

.word-example {
  color: #59677a;
  font-size: 0.78rem;
  line-height: 1.24;
  overflow-wrap: anywhere;
}

.example-word {
  color: inherit;
  border-radius: 3px;
  text-decoration: none;
  text-underline-offset: 2px;
}

.example-word:hover {
  color: var(--link);
  text-decoration: underline;
}

.example-word:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 1px;
}

.example-hit {
  color: inherit;
  font-weight: inherit;
  background: rgba(255, 148, 24, 0.18);
  border-radius: 3px;
  padding: 0 2px;
}

.word-main {
  color: #102033;
  font-weight: 500;
}

.word-link {
  text-decoration: none;
  text-underline-offset: 2px;
}

.word-link:hover {
  color: var(--link);
  text-decoration: underline;
}

.word-link:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
  border-radius: 3px;
}

.word-cell strong {
  color: #0f172a;
  font-weight: 800;
}

.title-variant {
  margin-bottom: 5px;
}

.title-variant:last-child {
  margin-bottom: 0;
}

.meta-col {
  width: 76px;
}

.topic-col {
  width: 140px;
}

.source-col {
  width: 150px;
}

.pos,
.region-tag,
.topic,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin: 0 4px 3px 0;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.76rem;
  line-height: 1;
  white-space: nowrap;
}

.pos {
  color: #0b69b3;
  font-weight: 400;
  border: 0;
  background: transparent;
  padding-left: 1px;
  padding-right: 1px;
}

.topic {
  border: 1px solid #c4cfdc;
  background: var(--tag);
  color: var(--tag-text);
  font-weight: 500;
}

.topic[data-tooltip],
.region-tag[data-tooltip] {
  position: relative;
  cursor: help;
}

.topic[data-tooltip]:hover::after,
.topic[data-tooltip]:focus-visible::after,
.region-tag[data-tooltip]:hover::after,
.region-tag[data-tooltip]:focus-visible::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 40;
  width: max-content;
  max-width: min(320px, 80vw);
  transform: translateX(-50%);
  padding: 7px 9px;
  border-radius: 6px;
  background: rgba(20, 30, 44, 0.96);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  white-space: normal;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
  pointer-events: none;
}

.topic[data-tooltip]:hover::before,
.topic[data-tooltip]:focus-visible::before,
.region-tag[data-tooltip]:hover::before,
.region-tag[data-tooltip]:focus-visible::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 3px);
  z-index: 41;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(20, 30, 44, 0.96);
  pointer-events: none;
}

body.has-global-tag-tooltip .topic[data-tooltip]:hover::after,
body.has-global-tag-tooltip .topic[data-tooltip]:focus-visible::after,
body.has-global-tag-tooltip .region-tag[data-tooltip]:hover::after,
body.has-global-tag-tooltip .region-tag[data-tooltip]:focus-visible::after,
body.has-global-tag-tooltip .topic[data-tooltip]:hover::before,
body.has-global-tag-tooltip .topic[data-tooltip]:focus-visible::before,
body.has-global-tag-tooltip .region-tag[data-tooltip]:hover::before,
body.has-global-tag-tooltip .region-tag[data-tooltip]:focus-visible::before {
  display: none !important;
}

.global-tag-tooltip {
  position: fixed;
  z-index: 10000;
  max-width: min(340px, calc(100vw - 16px));
  padding: 7px 9px;
  border-radius: 6px;
  background: rgba(20, 30, 44, 0.96);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  white-space: normal;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
  opacity: 0;
  transform: translateX(-50%) translateY(-2px);
  pointer-events: none;
  transition: opacity 90ms ease, transform 90ms ease;
}

.global-tag-tooltip.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.global-tag-tooltip[hidden] {
  display: none;
}

.region-tag {
  border: 1px solid rgba(245, 130, 22, 0.42);
  background: #fff3e4;
  color: #9a4d00;
  font-weight: 600;
}

.badge {
  border: 1px solid #c8d1dc;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.72rem;
}

.empty,
.error {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.empty {
  color: var(--ink);
  font-weight: 800;
}

.empty-message {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 500;
}

.empty-message:last-child {
  margin-bottom: 0;
}

.empty-message strong {
  font-weight: 800;
}

.no-results-message {
  margin-top: 4px;
  margin-bottom: 8px;
  display: block;
}

.no-results-message:last-child {
  margin-bottom: 0;
}

.promoted-correction-message {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}

.no-result-suggestion .word-link {
  color: var(--accent-ink);
}

.phonetic-entry {
  margin-top: 0;
}

.phonetic-entry .entry-title {
  display: flex;
  align-items: center;
}

.phonetic-entry .entry-title > :first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.similar-badge {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  min-height: 20px;
  max-width: 100%;
  padding: 1px 7px;
  border: 1px solid #ffd595;
  border-radius: 4px;
  background: var(--brand);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phonetic-table .word-content {
  display: block;
  white-space: nowrap;
}

.phonetic-alternatives {
  display: inline;
  margin-left: 0.55rem;
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
}

.phonetic-alternatives-label {
  font-weight: 600;
}

.phonetic-alternative-link {
  margin-left: 0.22rem;
  color: var(--accent-ink);
  font-weight: 700;
}

.error {
  border-color: #f2b7af;
  background: var(--danger-soft);
  color: var(--danger);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  .shell {
    --topbar-sticky-offset: 112px;
    width: 100%;
    border-left: 0;
    border-right: 0;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) 38px;
    gap: 8px;
    padding: 6px 11px 11px;
  }

  .shell.is-trainer-home .topbar {
    grid-template-columns: minmax(0, 1fr) 38px;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
    max-width: 100%;
    font-size: 2rem;
    line-height: 0.9;
    transform: translateY(-1px);
  }

  .shell.is-trainer-home .brand {
    font-size: 1.75rem;
  }

  .lookup {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: none;
    margin-left: 0;
    justify-self: stretch;
  }

  .trainer-account-wrap {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: center;
  }

  .search {
    width: 100%;
    height: 40px;
    grid-template-columns: minmax(0, 1fr) 42px;
    border-radius: 6px;
  }

  .search.has-voice {
    grid-template-columns: 40px minmax(0, 1fr) 42px;
  }

  .search.has-clear {
    grid-template-columns: minmax(0, 1fr) 32px 42px;
  }

  .search.has-voice.has-clear {
    grid-template-columns: 40px minmax(0, 1fr) 32px 42px;
  }

  .search input {
    font-size: 1rem;
    padding: 0 10px;
  }

  .trainer-icon-link {
    width: 38px;
    height: 38px;
  }

  .pwa-install-banner,
  .install-notice {
    top: 118px;
    grid-template-columns: minmax(0, 1fr) auto 36px;
    gap: 8px;
    padding: 5px 10px;
    font-size: 0.82rem;
  }

  .pwa-install-copy,
  .install-copy {
    display: block;
  }

  .pwa-install-copy strong,
  .pwa-install-copy span,
  .install-copy strong,
  .install-copy span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .pwa-install-copy strong {
    font-size: 1rem;
    font-weight: 400;
  }

  .pwa-install-banner.is-ios-install .pwa-install-copy span,
  .pwa-install-banner.is-ios-install .pwa-install-copy strong {
    white-space: normal;
  }

  .pwa-install-banner.is-ios-install .pwa-install-copy span {
    display: none;
  }

  .pwa-install-banner.is-ios-install {
    top: 0;
    width: 100%;
    padding: calc(5px + env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 5px max(10px, env(safe-area-inset-left));
  }

  .pwa-install-action,
  .install-action {
    min-width: 126px;
    min-height: 36px;
    padding: 0 14px;
  }

  .pwa-install-close,
  .install-close {
    width: 36px;
    height: 36px;
  }

  .legal-header-nav {
    justify-content: flex-start;
  }

  .site-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    padding-left: 14px;
    padding-right: 14px;
  }

  .site-footer nav {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .footer-language {
    grid-column: 3;
    grid-row: 2;
    justify-self: end;
    margin-left: 0;
  }

  .footer-meta {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    margin-right: 0;
  }

  .footer-language-select {
    min-width: 132px;
  }

  select {
    min-width: 0;
    flex: 1;
  }

  .footer-language-select {
    flex: 0 0 auto;
  }

  .controls {
    flex-wrap: wrap;
  }

  .language-switcher {
    grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr);
    gap: 5px;
    padding: 6px 4px;
    top: var(--topbar-sticky-offset);
    overflow: visible;
  }

  .language-group-source {
    grid-column: 1;
  }

  .language-swap {
    grid-column: 2;
    justify-self: center;
    min-width: 52px;
    width: 52px;
    font-size: 1.1rem;
  }

  .language-group-target {
    grid-column: 3;
  }

  .language-switcher button,
  .language-switcher a[data-language-switch] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    max-width: 100%;
    height: 32px;
    padding: 0 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .language-switcher .language-swap {
    min-width: 52px;
    width: 52px;
    height: 32px;
    font-size: 1.1rem;
  }

  .language-group-source button.is-active,
  .language-group-source a[data-language-switch].is-active {
    height: 30px;
    padding-inline: 7px;
    font-size: 0.78rem;
  }

  .language-switcher.is-source-listening .language-group-source button.is-active,
  .language-switcher.is-source-listening .language-group-source a[data-language-switch].is-active {
    animation: sourceLanguageListeningPulse 1.05s ease-in-out infinite;
  }

  .language-group {
    gap: 4px;
    min-height: 32px;
    width: 100%;
  }

  .language-group button.is-active,
  .language-group a[data-language-switch].is-active {
    width: 100%;
    flex: 1 1 auto;
  }

  .language-group button:not(.is-active),
  .language-group a[data-language-switch]:not(.is-active) {
    display: none;
  }

  .suggestions {
    max-width: 100%;
  }

  .suggestion-option {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
  }

  .suggestion-meta {
    justify-self: end;
  }

  .history-suggestion-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .history-suggestion-text .word-link {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
    white-space: nowrap;
  }

  .phonetic-table .word-content,
  .phonetic-alternatives {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .site-footer nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .site-footer nav a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 2px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .language-group button.is-active {
    width: 100%;
    max-width: 100%;
  }

  .mobile-language-popover {
    position: absolute;
    top: calc(100% + 5px);
    left: 50%;
    right: auto;
    z-index: 35;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: min(360px, calc(100vw - 20px));
    max-width: calc(100vw - 20px);
    box-sizing: border-box;
    padding: 8px;
    border: 1px solid #d4b36d;
    border-radius: 7px;
    background: var(--brand-soft);
    box-shadow: 0 8px 18px rgba(31, 45, 68, 0.18);
    justify-content: center;
    transform: translateX(-50%);
  }

  .mobile-language-popover[hidden] {
    display: none;
  }

  .mobile-language-popover button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #d4b36d;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.56);
    color: #253044;
    font-size: 0.84rem;
    font-weight: 800;
  }

  .mobile-language-popover button.is-active {
    background: var(--accent);
    border-color: var(--accent-ink);
    color: #ffffff;
    box-shadow: 0 2px 7px rgba(21, 84, 134, 0.22);
  }

  .mobile-language-popover button:disabled {
    opacity: 0.48;
    cursor: not-allowed;
  }

  .language-group-target {
    justify-content: flex-end;
  }

  .status-row,
  .results {
    padding-left: 10px;
    padding-right: 10px;
  }

  .status-row {
    flex-direction: column;
    gap: 4px;
  }

  .shell:not(.is-home) .status-row {
    display: none;
  }

  .shell:not(.is-home) .results {
    padding-top: 4px;
  }

  .shell:not(.is-home) .entry-title {
    display: none;
  }

  .shell:not(.is-home) .entry.is-fallback .entry-title,
  .shell:not(.is-home) .phonetic-entry .entry-title {
    display: flex;
  }

  .shell.is-home:not(.is-trainer-home) .entry-title {
    display: none;
  }

  .shell:not(.is-home) .dict-table thead {
    display: none;
  }

  .shell:not(.is-home) .entry.is-fallback .dict-table thead,
  .shell:not(.is-home) .phonetic-entry .dict-table thead {
    display: table-header-group;
  }

  .shell:not(.is-home) .entry {
    margin-top: 0;
  }

  .shell.is-home .home-panel {
    padding: 20px 10px 34px;
  }

  .skeleton-quiz-options {
    gap: 10px;
  }

  .shell.is-history-home .home-panel {
    padding: 0 0 34px;
  }

  .shell.is-history-home .home-start-grid {
    width: 100%;
  }

  .shell.is-trainer-home .home-panel {
    padding: 0 0 34px;
  }

  .shell.is-trainer-home.is-learn-challenge-active .home-panel {
    padding: 0 0 34px;
  }

  .shell.is-trainer-home .auth-view {
    padding: 22px 18px 34px;
  }

  .home-start-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
  }

  .shell.is-history-home .pair-topic-overview {
    width: 100%;
    margin-bottom: 14px;
    padding: 12px 10px 0;
  }

  .pair-topic-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  }

  .trainer-card {
    padding: 18px;
  }

  .learn-card {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
  }

  .learn-group-create:not([hidden]) {
    margin: 0 12px 14px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--surface-soft);
    padding: 14px;
  }

  .learn-create-group-button {
    margin: 0 12px 12px auto;
  }

  .learn-group-actions button {
    flex: 1 1 0;
    min-width: 0;
  }

  #learnGroups {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  #learnGroups .learn-group {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  #learnGroups .learn-group-head {
    border-radius: 0;
    padding-left: 16px;
    padding-right: 10px;
  }

  #learnGroups .learn-group-preview-members {
    min-height: 0;
    padding-left: 16px;
    padding-right: 16px;
  }

  #learnGroups .learn-group-menu-panel {
    right: 0;
    width: min(280px, calc(100vw - 32px));
  }

  .home-history-head {
    align-items: flex-start;
    flex-direction: column;
    padding: 24px 18px 20px;
  }

  .home-history-list {
    padding: 0;
  }

  .home-history-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .home-history-pair {
    white-space: normal;
  }

  .word-quiz-card {
    min-height: 520px;
    border-radius: 10px;
  }

  .word-quiz-head {
    padding: 26px 16px 20px;
  }

  .word-quiz-body {
    padding: 18px 14px 84px;
  }

  .word-quiz-question {
    gap: 14px;
  }

  .word-quiz-options {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .word-quiz-option {
    min-height: 58px;
    padding: 12px 14px;
  }

  .word-quiz-term-main {
    gap: 8px;
  }

  .word-quiz-sound {
    width: 34px;
    height: 34px;
  }

  .word-quiz-sound svg {
    width: 17px;
    height: 17px;
  }

  .word-quiz-dots {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .word-quiz-feedback {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 70;
    width: 100%;
    margin: 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px rgba(16, 32, 51, 0.14);
  }

  .word-quiz-miss {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .trainer-userbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .collection-bar,
  .learn-profile-form,
  .challenge-form,
  .quiz-form {
    grid-template-columns: 1fr;
  }

  .collection-form {
    grid-template-columns: 1fr auto;
  }

  .trainer-stats {
    grid-template-columns: 1fr;
  }

  .entry-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .entry-title-main {
    width: 100%;
  }

  .entry-title-full {
    display: none;
  }

  .entry-title-short {
    display: inline;
  }

  .entry.is-fallback .entry-title-full,
  .phonetic-entry .entry-title-full {
    display: inline;
  }

  .entry.is-fallback .entry-title-short,
  .phonetic-entry .entry-title-short {
    display: none;
  }

  .dict-table {
    min-width: 0;
  }

  .entry {
    overflow: visible;
  }
}

@media (max-width: 900px) {
  .shell.is-history-home .home-panel {
    padding-left: 0;
    padding-right: 0;
  }

  .shell.is-history-home .home-start-grid,
  .shell.is-history-home .home-history-card,
  .shell.is-history-home .home-random-card,
  .shell.is-history-home .home-history-list,
  .shell.is-history-home .pair-topic-overview {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .shell.is-trainer-home .home-panel {
    padding-top: 0;
  }

  .shell.is-trainer-home.is-learn-challenge-active .home-panel {
    padding-top: 0;
  }

  .shell.is-trainer-home .trainer-card {
    padding: 0;
  }

  .shell.is-trainer-home .auth-view {
    padding: 22px 16px 30px;
  }

  .learn-login-hero {
    row-gap: 34px;
    padding: 0;
  }

  .learn-login-heading {
    align-items: center;
    flex-direction: column-reverse;
    gap: 8px;
    padding: 22px 16px 24px;
  }

  .learn-login-action {
    min-height: 250px;
    padding: 20px;
  }

  .learn-login-heading h1 {
    font-size: 2rem;
  }

  .learn-login-google-head span,
  .learn-privacy-note {
    font-size: 0.92rem;
  }

  .learn-dialog {
    width: min(100vw - 18px, 760px);
  }

  #learnMembersDialog {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
  }

  #learnMembersDialog .learn-dialog-shell {
    height: calc(100dvh - 12px);
    max-height: calc(100dvh - 12px);
  }

  .learn-dialog-head,
  .learn-dialog-body {
    padding-left: 14px;
    padding-right: 14px;
  }

  #learnMembersDialog .learn-dialog-head {
    align-items: start;
    gap: 10px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  #learnMembersDialog .learn-dialog-head h2 {
    font-size: 1.12rem;
    overflow-wrap: anywhere;
  }

  #learnMembersDialog .learn-dialog-body {
    gap: 12px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  #learnMembersDialog .learn-invite-form {
    grid-template-columns: 1fr;
    margin: 4px 0 0;
  }

  #learnMembersDialog .learn-invite-form input,
  #learnMembersDialog .learn-invite-form button {
    min-height: 42px;
    width: 100%;
  }

  #learnMembersDialog .learn-member {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    grid-template-areas:
      "avatar name action"
      "avatar detail action";
    align-items: center;
    gap: 2px 10px;
    min-height: 56px;
    padding: 8px 10px;
  }

  #learnMembersDialog .learn-member-avatar {
    grid-area: avatar;
  }

  #learnMembersDialog .learn-member strong {
    grid-area: name;
  }

  #learnMembersDialog .learn-member span:not(.learn-member-avatar) {
    grid-area: detail;
  }

  #learnMembersDialog .learn-member em,
  #learnMembersDialog .learn-member-remove {
    grid-area: action;
    justify-self: end;
  }

  .learn-vocab-dialog .learn-dialog-body {
    grid-template-rows: auto minmax(0, 1fr);
    height: min(620px, calc(100vh - 132px));
  }

  .learn-vocab-search {
    grid-template-columns: 1fr;
  }

  .learn-vocab-ref-header,
  .learn-vocab-ref-item {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 30px;
    gap: 8px;
  }

  .status-row,
  .results {
    padding-left: 4px;
    padding-right: 4px;
  }

  .results {
    padding-top: 4px;
    padding-bottom: 26px;
  }

  .entry {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    margin-left: -4px;
    margin-right: -4px;
    margin-bottom: 10px;
  }

  .shell.is-history-home .entry {
    margin-left: 0;
    margin-right: 0;
  }

  .shell.is-history-home .home-start-grid,
  .shell.is-history-home .home-history-card,
  .shell.is-history-home .home-random-card,
  .shell.is-history-home .home-history-list,
  .shell.is-history-home .pair-topic-overview {
    width: 100%;
  }

  .pair-topic-overview {
    margin-bottom: 8px;
    padding: 0;
  }

  .pair-topic-head {
    padding: 7px 8px 5px;
  }

  .pair-topic-grid {
    gap: 0;
  }

  .pair-topic-card {
    min-height: 0;
    padding: 10px 8px;
    border: 0;
    border-bottom: 1px solid var(--line-soft);
    border-radius: 0;
    box-shadow: none;
  }

  .pair-topic-card:first-child {
    border-top: 0;
  }

  .dict-table th {
    padding: 5px 6px;
  }

  .dict-table td {
    padding: 5px;
  }

  .word-wrap {
    grid-template-columns: 24px minmax(0, 1fr);
    column-gap: 4px;
  }

  .sound {
    width: 21px;
    height: 20px;
    font-size: 0.6rem;
  }

  .row-action,
  .action-col {
    display: none;
  }

  body.has-current-user .row-action {
    display: table-cell;
    width: 34px;
  }

  body.has-current-user .action-col {
    display: table-column;
    width: 34px;
  }

  .entry-title-columns {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .entry-title-action {
    display: none;
  }

  body.has-current-user .entry-title-columns {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px;
  }

  body.has-current-user .entry-title-action {
    display: block;
    width: 34px;
  }

  .add-vocab {
    width: 26px;
    height: 26px;
    font-size: 1rem;
  }

  .add-vocab-menu {
    width: min(236px, calc(100vw - 20px));
  }

  .word-examples {
    margin-top: 3px;
  }

  .word-quiz-dots {
    gap: 5px;
  }

  .word-quiz-dot {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
  }

  .word-quiz-dot.is-correct::after,
  .word-quiz-dot.is-wrong::after {
    top: -1px;
  }

  .word-quiz-dot.is-wrong::after {
    top: 0;
    font-size: 1.9rem;
    transform: translate(-50%, -25%);
  }
}

@media (max-width: 760px) {
  #accountDataDialog {
    position: fixed;
    inset: 0;
    width: auto;
    max-width: none;
    height: auto;
    max-height: none;
    margin: 0;
    border-radius: 0;
    box-sizing: border-box;
    box-shadow: none;
  }

  #iosInstallDialog {
    width: min(440px, calc(100vw - 24px));
  }

  #accountDataDialog::backdrop {
    background: var(--surface);
  }

  #accountDataDialog .learn-dialog-shell {
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    height: 100%;
    max-height: none;
  }

  #accountDataDialog .learn-dialog-head {
    align-items: start;
    gap: 10px;
    padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 14px max(14px, env(safe-area-inset-left));
  }

  #accountDataDialog .learn-dialog-head h2 {
    font-size: 1.18rem;
  }

  #accountDataDialog .learn-dialog-body {
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 12px;
    min-height: 0;
    overflow: hidden;
    padding: 14px max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }

  #accountDataDialog .account-data-body {
    max-height: none;
    min-height: 0;
    overflow: auto;
    padding-bottom: 4px;
  }

  #accountDataDialog .account-data-summary div,
  #accountDataDialog .account-data-section-list button {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px;
  }

  #accountDataDialog .account-data-toggle-label {
    grid-column: 1 / -1;
  }

  #accountDataDialog .account-data-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding-top: 10px;
    background: var(--surface);
  }

  #accountDataDialog .account-data-actions button {
    width: 100%;
    min-height: 46px;
  }

  #learnMembersDialog {
    position: fixed;
    inset: 0;
    width: auto;
    max-width: none;
    height: auto;
    max-height: none;
    margin: 0;
    border-radius: 0;
    box-sizing: border-box;
    box-shadow: none;
  }

  #learnMembersDialog .learn-dialog-shell {
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    height: 100%;
    max-height: none;
  }

  #learnMembersDialog .learn-dialog-head {
    align-items: start;
    gap: 10px;
    padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 14px max(14px, env(safe-area-inset-left));
  }

  #learnMembersDialog .learn-dialog-head > div {
    min-width: 0;
  }

  #learnMembersDialog .learn-dialog-head h2 {
    font-size: 1.12rem;
    overflow-wrap: anywhere;
  }

  #learnMembersDialog .learn-dialog-close {
    flex: 0 0 auto;
  }

  #learnMembersDialog .learn-dialog-body {
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 12px;
    min-height: 0;
    overflow: hidden;
    padding: 14px max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }

  #learnMembersDialog .learn-dialog-section {
    min-height: 0;
  }

  #learnMembersDialog .learn-members {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  #learnMembersDialog .learn-invite-form {
    grid-template-columns: 1fr;
    margin: 4px 0 0;
  }

  #learnMembersDialog .learn-invite-form input,
  #learnMembersDialog .learn-invite-form button {
    min-height: 42px;
    width: 100%;
  }

  #learnMembersDialog .learn-invite-form input {
    font-size: 16px;
  }

  #learnMembersDialog .learn-member {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    grid-template-areas:
      "avatar name action"
      "avatar detail action";
    align-items: center;
    gap: 2px 10px;
    min-height: 56px;
    padding: 8px 10px;
  }

  #learnMembersDialog .learn-member-avatar {
    grid-area: avatar;
  }

  #learnMembersDialog .learn-member strong {
    grid-area: name;
    min-width: 0;
  }

  #learnMembersDialog .learn-member span:not(.learn-member-avatar) {
    grid-area: detail;
  }

  #learnMembersDialog .learn-member em,
  #learnMembersDialog .learn-member-remove {
    grid-area: action;
    justify-self: end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-line,
  .skeleton-dot {
    animation: none;
  }
}
