:root {
  color-scheme: light;
  --primary: #72c02c;
  --primary-dark: #4f941d;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e2d2;
  --surface: #ffffff;
  --soft: #f5f8f2;
  --accent: #2f6fed;
  --focus: rgba(114, 192, 44, 0.26);
}

* {
  box-sizing: border-box;
}

html {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f7f9f5;
}

body {
  margin: 0;
  min-width: 320px;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

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

.shell {
  width: min(100% - 32px, 1080px);
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
  min-width: 0;
}

.brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.top-menu-link {
  position: absolute;
  left: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 42px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--primary);
  border-radius: 999px;
  color: var(--primary-dark);
  background: #f2faec;
  transform: translateX(-50%);
}

.top-menu-link:hover,
.top-menu-link.is-active {
  color: #fff;
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.top-menu-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex: 0 0 auto;
  margin-left: auto;
  min-width: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--soft);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.nav-link:hover {
  color: #fff;
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.account-nav {
  min-width: 0;
}

.account-link,
.account-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(48vw, 360px);
}

.account-link {
  min-height: 38px;
  padding: 3px 12px 3px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  font-size: 14px;
  font-weight: 700;
}

.account-link:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.account-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.account-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.account-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.account-action:hover {
  border-color: var(--primary-dark);
  color: #fff;
  background: var(--primary-dark);
}

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

.settings-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-height: 34px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
  cursor: pointer;
}

.settings-toggle:hover,
.settings-toggle[aria-expanded="true"] {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary-dark);
}

.settings-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.page {
  padding: 28px 0 64px;
}

.page-minimal {
  padding-top: 10px;
}

.breadcrumbs {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  overflow: hidden;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.breadcrumb-item:first-child {
  flex: 0 0 auto;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  flex: 0 0 auto;
  margin-right: 6px;
  color: #98a2b3;
  font-weight: 600;
}

.breadcrumb-item a,
.breadcrumb-item span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumb-item a {
  color: var(--primary-dark);
}

.breadcrumb-item a:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.article-head {
  max-width: 760px;
  margin-bottom: 28px;
}

.article-mode-switcher {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 100%;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
}

.article-mode-switcher[hidden] {
  display: none;
}

.article-mode-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  max-width: 100%;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: #475467;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
}

.article-mode-button:hover {
  color: var(--primary-dark);
}

.article-mode-button[aria-pressed="true"] {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 6px 14px rgba(114, 192, 44, 0.2);
}

.article-mode-button[aria-pressed="true"]:hover {
  color: #fff;
  background: var(--primary-dark);
}

.article-actions {
  display: grid;
  gap: 10px;
  max-width: 100%;
  margin-top: 18px;
}

.article-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
}

.article-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  max-width: 100%;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #344054;
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(24, 33, 47, 0.06);
}

.article-action-button:hover {
  color: var(--primary-dark);
  border-color: rgba(114, 192, 44, 0.46);
  background: #fbfef8;
}

.article-action-buttons .article-favorite-button,
.article-action-buttons .article-feedback-button,
.article-action-buttons .article-share-button,
.article-action-buttons .article-font-size-button,
.article-action-buttons .article-mode-toggle-button {
  width: 42px;
  padding: 0;
}

.article-mode-toggle-button .article-action-icon,
.article-mode-toggle-button .article-action-icon path {
  fill: currentColor;
  stroke: none;
}

.article-mode-toggle-button[aria-expanded="true"] {
  color: #fff;
  border-color: var(--primary-dark);
  background: var(--primary);
  box-shadow: 0 12px 24px rgba(114, 192, 44, 0.24);
}

.article-mode-toggle-button[aria-expanded="true"]:hover {
  color: #fff;
  background: var(--primary-dark);
}

.article-favorite-button[aria-pressed="true"] {
  color: #fff;
  border-color: var(--primary-dark);
  background: var(--primary);
  box-shadow: 0 12px 24px rgba(114, 192, 44, 0.24);
}

.article-favorite-button[aria-pressed="true"]:hover {
  color: #fff;
  background: var(--primary-dark);
}

.article-action-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.article-action-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.article-action-status,
.article-feedback-status {
  min-height: 1.4em;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.article-action-status[data-tone="success"],
.article-feedback-status[data-tone="success"] {
  color: var(--primary-dark);
}

.article-action-status[data-tone="error"],
.article-feedback-status[data-tone="error"] {
  color: #b42318;
}

.article-actions-login {
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.article-actions-login-copy {
  margin: 0;
  color: #475467;
  font-size: 15px;
  line-height: 1.5;
}

.article-actions-login-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.article-action-login-button {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.article-action-login-button:hover {
  color: #fff;
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.article-action-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  color: var(--primary-dark);
  font-weight: 800;
}

.article-action-link:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.article-feedback-sheet {
  position: fixed;
  z-index: 400;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.article-feedback-sheet[hidden] {
  display: none;
}

.article-feedback-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 32, 51, 0.42);
}

.article-feedback-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  max-height: min(720px, calc(100dvh - 48px));
  overflow-y: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 64px rgba(24, 33, 47, 0.22);
}

.article-feedback-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.article-feedback-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

.article-feedback-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #475467;
  background: #fff;
  cursor: pointer;
}

.article-feedback-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.article-feedback-close:hover {
  color: var(--primary-dark);
  border-color: rgba(114, 192, 44, 0.46);
}

.article-feedback-form {
  display: grid;
  gap: 16px;
}

.article-feedback-reasons {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.article-feedback-comment span {
  display: block;
  margin-bottom: 8px;
  color: #344054;
  font-size: 14px;
  font-weight: 400;
}

.article-feedback-reason-list {
  display: grid;
  gap: 8px;
}

.article-feedback-reason {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #344054;
  background: #fff;
  cursor: pointer;
  font-weight: 650;
}

.article-feedback-reason:hover {
  border-color: rgba(114, 192, 44, 0.46);
  background: #fbfef8;
}

.article-feedback-reason input {
  margin-top: 4px;
  accent-color: var(--primary);
}

.article-feedback-comment textarea {
  display: block;
  width: 100%;
  min-height: 108px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.article-feedback-comment textarea:focus {
  border-color: var(--primary);
  outline: 3px solid var(--focus);
}

.article-feedback-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0;
}

.article-feedback-submit:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.article-feedback-submit:disabled {
  cursor: wait;
  opacity: 0.68;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.article-head h1,
.error-page h1 {
  margin: 0;
  font-size: 48px;
  line-height: 1.08;
  letter-spacing: 0;
}

.reader-settings {
  position: relative;
  flex: 0 0 auto;
}

.settings-panel {
  position: absolute;
  z-index: 110;
  top: calc(100% + 10px);
  right: 0;
  width: 244px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 42px rgba(24, 33, 47, 0.16);
}

.settings-panel[hidden] {
  display: none;
}

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

.settings-menu-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--soft);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
}

.settings-menu-link:hover {
  color: #fff;
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.settings-profile-link {
  gap: 8px;
  min-height: 42px;
  padding: 3px 14px 3px 4px;
}

.settings-group + .settings-group {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.settings-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.settings-lang-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 8px;
}

.settings-lang-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--soft);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.settings-lang-link:hover,
.settings-lang-link.is-active {
  color: #fff;
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.settings-lang-link.is-active {
  background: var(--primary);
  border-color: var(--primary);
}

.reader-size-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}

.reader-size-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--soft);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.reader-reset-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.reader-size-value {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.reader-size-slider-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.reader-size-slider {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  accent-color: var(--primary);
  cursor: pointer;
}

.reader-size-button:hover {
  color: #fff;
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.reader-size-button:disabled,
.reader-size-button:disabled:hover {
  color: var(--muted);
  border-color: var(--line);
  background: var(--soft);
  cursor: not-allowed;
  opacity: 0.55;
}

.has-reader-size-sheet {
  overflow: hidden;
}

.reader-size-sheet {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 0 12px max(12px, env(safe-area-inset-bottom));
}

.reader-size-sheet[hidden] {
  display: none;
}

.reader-size-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 32, 51, 0.36);
}

.reader-size-dialog {
  position: relative;
  width: min(100%, 460px);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: var(--surface);
  box-shadow: 0 -18px 42px rgba(24, 33, 47, 0.18);
  animation: reader-size-sheet-in 160ms ease-out;
}

.reader-size-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.reader-size-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
}

.reader-size-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--soft);
  cursor: pointer;
}

.reader-size-close:hover {
  color: #fff;
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.reader-size-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

@keyframes reader-size-sheet-in {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.primary-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-top: 18px;
  padding: 0 16px;
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
  font-weight: 700;
}

.primary-link:hover {
  background: var(--primary-dark);
}

.secondary-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-top: 18px;
  margin-left: 8px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--soft);
  font-weight: 700;
}

.secondary-link:hover {
  color: #fff;
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.access-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.error-actions {
  justify-content: flex-end;
}

.profile-page {
  max-width: 760px;
}

.profile-panel {
  display: grid;
  gap: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.profile-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.profile-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.profile-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-summary-text {
  min-width: 0;
}

.profile-summary h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.profile-summary p {
  margin: 6px 0 0;
  color: var(--muted);
}

.profile-details {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}

.profile-detail-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.profile-detail-row dt {
  color: var(--muted);
  font-weight: 700;
}

.profile-detail-row dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.profile-actions .primary-link,
.profile-actions .secondary-link {
  margin: 0;
}

.profile-logout-form {
  margin: 0;
}

.profile-logout-button {
  cursor: pointer;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 36px;
  align-items: start;
}

[data-reader-text-root] {
  --reader-font-size: 19px;
  --reader-line-height: 1.65;
}

.article-body {
  min-width: 0;
}

.article-section {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.article-section h2 {
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

.sentence-line {
  margin: 0 0 14px;
  font-size: var(--reader-font-size);
  line-height: var(--reader-line-height);
}

.bilingo-sentence {
  overflow-wrap: anywhere;
}

.sentence-mode-ordinary {
  display: none;
}

[data-article-text-mode="ordinary"] .sentence-mode-highlighted {
  display: none;
}

[data-article-text-mode="ordinary"] .sentence-mode-ordinary {
  display: inline;
}

.sentence-chunk {
  display: inline;
  padding: 1px 5px 2px;
  border-radius: 6px;
  background: rgba(114, 192, 44, 0.14);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.sentence-chunk-1 {
  background: #EAF7E5;
}

.sentence-chunk-2 {
  background: #EAF2FF;
}

.sentence-chunk-3 {
  background: #FFF3D6;
}

.sentence-chunk-4 {
  background: #E6FAFA;
}

.sentence-chunk-5 {
  background: #F1ECFF;
}

.sentence-chunk-6 {
  background: #FFE8F0;
}

.sentence-chunk-7 {
  background: #F3F4D7;
}

.article-body .sentence-word {
  display: inline;
  margin: 0;
  padding: 0 2px;
  border: 0;
  border-radius: 4px;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font-weight: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

.article-body .sentence-word:hover,
.article-body .sentence-word[aria-expanded="true"] {
  color: inherit;
  background: var(--soft);
}

.sentence-word:focus-visible,
.article-mode-button:focus-visible,
.settings-toggle:focus-visible,
.settings-menu-link:focus-visible,
.settings-lang-link:focus-visible,
.nav-link:focus-visible,
.top-menu-link:focus-visible,
.breadcrumb-item a:focus-visible,
.eew-language-menu summary:focus-visible,
.eew-language-menu-link:focus-visible,
.reader-size-button:focus-visible,
.reader-size-close:focus-visible,
.reader-size-slider:focus-visible,
.reader-reset-button:focus-visible,
.translation-alt-button:focus-visible,
.sentence-audio-button:focus-visible,
.sentence-record-button:focus-visible,
.sentence-practice-start:focus-visible,
.sentence-practice-close:focus-visible,
.article-action-button:focus-visible,
.article-action-link:focus-visible,
.article-feedback-close:focus-visible,
.article-feedback-reason:focus-within,
.article-feedback-submit:focus-visible,
.topic-shuffle-button:focus-visible,
.stats-range-tab:focus-visible,
.primary-link:focus-visible,
.profile-logout-button:focus-visible,
.eew-language-card:focus-visible,
.eew-unit-link:focus-visible,
.eew-toggle-button:focus-visible,
.eew-image-arrow:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.sentence-translation {
  display: block;
  margin-top: 6px;
  padding: 10px 12px;
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  background: rgba(255, 255, 255, 0.78);
  color: #344054;
  font-size: max(16px, calc(var(--reader-font-size) - 2px));
  line-height: var(--reader-line-height);
}

.sentence-translation[hidden] {
  display: none;
}

.sentence-translation-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.sentence-audio-group {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.sentence-assessment-group {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.sentence-audio-button {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 6px 14px rgba(114, 192, 44, 0.18);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.sentence-audio-button:hover,
.sentence-audio-button.is-playing {
  background: var(--primary-dark);
}

.sentence-audio-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.sentence-audio-icon {
  display: block;
  width: 0;
  height: 0;
  margin-left: 1px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
}

.sentence-audio-status {
  min-width: 0;
  color: #b42318;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.sentence-record-button {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--primary);
  border-radius: 999px;
  color: var(--primary);
  background: #fff;
  box-shadow: 0 6px 14px rgba(114, 192, 44, 0.14);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.sentence-record-button:hover {
  color: #fff;
  background: var(--primary);
}

.sentence-record-button.is-recording {
  color: #fff;
  border-color: #d92d20;
  background: #d92d20;
  box-shadow: 0 6px 14px rgba(217, 45, 32, 0.18);
}

.sentence-record-button.is-processing,
.sentence-record-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.sentence-record-icon {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
}

.sentence-record-button.is-recording .sentence-record-icon {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: currentColor;
}

.sentence-assessment-status {
  min-width: 0;
  max-width: min(100%, 34rem);
  color: #475467;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.sentence-assessment-status[data-tone="success"] {
  color: #3f7d20;
}

.sentence-assessment-status[data-tone="error"] {
  color: #b42318;
}

.has-sentence-practice {
  overflow: hidden;
}

.sentence-practice-panel {
  position: fixed;
  z-index: 1100;
  inset: 0;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 12px 12px max(12px, env(safe-area-inset-bottom));
}

.sentence-practice-panel[hidden] {
  display: none;
}

.sentence-practice-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(23, 32, 51, 0.42);
  cursor: default;
}

.sentence-practice-dialog {
  position: relative;
  width: min(100%, 460px);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 48px rgba(24, 33, 47, 0.24);
}

.sentence-practice-dialog h2 {
  margin: 0 0 8px;
  color: #1d2939;
  font-size: 1.25rem;
  line-height: 1.25;
}

.sentence-practice-prompt,
.sentence-practice-status {
  margin: 0;
  overflow-wrap: anywhere;
}

.sentence-practice-prompt {
  color: #475467;
  line-height: 1.5;
}

.sentence-practice-status {
  margin-top: 12px;
  color: #475467;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.4;
}

.sentence-practice-status[data-tone="success"] {
  color: #3f7d20;
}

.sentence-practice-status[data-tone="error"] {
  color: #b42318;
}

.sentence-practice-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 18px;
}

.sentence-practice-start,
.sentence-practice-close {
  min-height: 44px;
  border-radius: 999px;
  padding: 0 18px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.sentence-practice-start {
  border: 1px solid #72c02c;
  color: #fff;
  background: #72c02c;
}

.sentence-practice-start:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.sentence-practice-login {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

.sentence-practice-login[hidden] {
  display: none;
}

.sentence-practice-panel[data-status="recording"] .sentence-practice-start {
  border-color: #d92d20;
  background: #d92d20;
}

.sentence-practice-start:disabled {
  cursor: wait;
  opacity: 0.68;
}

.sentence-practice-close {
  border: 1px solid var(--line);
  color: #344054;
  background: #fff;
}

.sentence-practice-close:hover {
  border-color: #72c02c;
  color: var(--primary-dark);
  background: #f2faec;
}

@media (min-width: 640px) {
  .sentence-practice-panel {
    align-items: center;
  }
}

.translation-alt-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  max-width: 100%;
  padding: 0 10px;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  color: #475467;
  background: #f2f4f7;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.translation-alt-button:hover,
.translation-alt-button[aria-expanded="true"] {
  color: #344054;
  border-color: #c7ced7;
  background: #e4e7ec;
}

.translation-alt-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.translation-compare-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.translation-compare-grid.is-comparing {
  grid-template-columns: minmax(0, 1fr);
}

.translation-panel {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.translation-panel-primary {
  color: #344054;
}

.translation-panel-secondary {
  padding: 10px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  color: #667085;
  background: #f8fafc;
}

.article-sidebar {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 18px;
  align-self: start;
}

.related-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(24, 33, 47, 0.06);
}

.related-panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
  letter-spacing: 0;
}

.related-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.related-list li {
  min-width: 0;
}

.related-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 44px;
  padding: 8px;
  border-radius: 8px;
  color: #344054;
  font-size: 14px;
}

.related-card:hover,
.related-card:focus-visible {
  color: var(--ink);
  background: var(--soft);
}

.related-card:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.related-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: var(--primary-dark);
  background: var(--soft);
  font-weight: 700;
}

.related-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.topics-page {
  max-width: 900px;
}

.topics-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.topics-head h1 {
  min-width: 0;
}

.topics-head-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  flex: 0 0 auto;
  max-width: 100%;
}

.topic-favorite-filter,
.topic-all-filter,
.topic-favorite-button,
.topic-favorite-retry,
.topic-favorite-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(114, 192, 44, 0.48);
  border-radius: 999px;
  color: var(--primary-dark);
  background: #f2faec;
  font: inherit;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
}

.topic-favorite-filter:hover,
.topic-all-filter:hover,
.topic-favorite-button:hover,
.topic-favorite-retry:hover,
.topic-favorite-remove:hover {
  color: #fff;
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.topic-favorite-filter,
.topic-favorite-button {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
}

.topic-favorite-button {
  flex: 0 0 38px;
  cursor: pointer;
}

.topic-favorite-filter:focus-visible,
.topic-all-filter:focus-visible,
.topic-favorite-button:focus-visible,
.topic-favorite-retry:focus-visible,
.topic-favorite-remove:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.topic-favorite-filter.is-active,
.topic-favorite-button[aria-pressed="true"],
.topic-favorite-remove[aria-pressed="true"] {
  color: #fff;
  border-color: #72c02c;
  background: #72c02c;
}

.topic-all-filter,
.topic-favorite-button {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface);
}

.topic-favorite-filter.is-active:hover,
.topic-favorite-button[aria-pressed="true"]:hover,
.topic-favorite-remove[aria-pressed="true"]:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.topic-favorite-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.topic-favorite-filter.is-active .topic-favorite-icon,
.topic-favorite-button[aria-pressed="true"] .topic-favorite-icon,
.topic-favorite-remove[aria-pressed="true"] .topic-favorite-icon {
  fill: currentColor;
}

.topic-favorite-button:disabled,
.topic-favorite-remove:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.topic-favorite-button[aria-busy="true"],
.topic-favorite-remove[aria-busy="true"] {
  cursor: wait;
}

.topic-favorite-retry {
  min-height: 36px;
  cursor: pointer;
}

.topic-favorite-retry[hidden],
.topic-grid[hidden],
[data-favorite-topics-empty][hidden] {
  display: none;
}

.topic-detail-head {
  display: grid;
  gap: 16px;
}

.topic-detail-heading-row {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.topic-detail-heading-row h1 {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.topic-favorite-control {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center;
  min-width: 38px;
  gap: 10px;
}

.topic-favorite-status,
.topic-favorite-item-status,
.topic-favorites-status {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.topic-favorite-status[data-tone="success"],
.topic-favorite-item-status[data-tone="success"],
.topic-favorites-status[data-tone="success"] {
  color: var(--primary-dark);
}

.topic-favorite-status[data-tone="error"],
.topic-favorite-item-status[data-tone="error"],
.topic-favorites-status[data-tone="error"] {
  color: #b42318;
}

.topic-favorite-notice {
  display: grid;
  justify-items: start;
  gap: 12px;
  max-width: 640px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.topic-favorite-notice p {
  margin: 0;
  color: #475467;
  line-height: 1.5;
}

.topic-favorite-notice-actions,
.topic-favorite-empty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.topic-favorite-detail-login {
  margin-top: 2px;
}

.topic-controls {
  max-width: 420px;
  margin: -2px 0 18px;
}

.topic-search-input {
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(24, 33, 47, 0.05);
  font: inherit;
}

.topic-search-input::placeholder {
  color: var(--muted);
}

.topic-search-input:focus {
  border-color: var(--primary);
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}

.topic-search-empty {
  margin-bottom: 18px;
}

.topic-shuffle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--soft);
  cursor: pointer;
}

.topic-shuffle-button:hover {
  border-color: #c7ced7;
  background: #e4e7ec;
}

.topic-shuffle-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.topic-card,
.topic-article-link {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 14px 32px rgba(24, 33, 47, 0.06);
}

.topic-card {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 92px;
  padding: 18px;
}

.topic-favorite-card {
  position: relative;
  display: block;
  padding: 0;
}

.topic-favorite-card-link {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 92px;
  padding: 18px 60px 18px 18px;
  border-radius: inherit;
  color: var(--ink);
  text-decoration: none;
}

.topic-favorite-card-link:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.topic-favorite-remove {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  min-height: 38px;
  padding: 0;
  cursor: pointer;
}

.topic-favorite-item-status {
  margin: -8px 58px 12px 18px;
}

.topic-favorite-status:empty,
.topic-favorite-item-status:empty,
.topic-favorites-status:empty {
  display: none;
}

.topic-card[hidden] {
  display: none;
}

.topic-card-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}

.topic-card-subtitle {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.topic-card-title,
.topic-card-subtitle,
.topic-article-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.topic-card:hover,
.topic-article-link:hover {
  border-color: var(--primary);
  box-shadow: 0 18px 38px rgba(24, 33, 47, 0.1);
}

.topic-card:focus-visible,
.topic-article-link:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.topic-article-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.topic-article-link {
  display: block;
  min-height: 52px;
  padding: 14px 16px;
  font-size: 17px;
  font-weight: 700;
}

.empty-state {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.grammar-page {
  max-width: 900px;
}

.grammar-language-grid,
.grammar-lessons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.grammar-language-card,
.grammar-lesson-card {
  display: grid;
  min-height: 104px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 14px 32px rgba(24, 33, 47, 0.06);
}

.grammar-language-card {
  align-items: center;
  justify-items: center;
  font-size: 30px;
  font-weight: 800;
}

.grammar-lesson-card {
  align-content: space-between;
  gap: 16px;
}

.grammar-language-card:hover,
.grammar-lesson-card:hover {
  border-color: var(--primary);
  box-shadow: 0 18px 38px rgba(24, 33, 47, 0.1);
}

.grammar-lesson-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
  font-size: 18px;
  font-weight: 800;
}

.grammar-lesson-count {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.grammar-lessons-page .grammar-lesson-count {
  font-size: clamp(12px, calc(var(--reader-font-size) - 5px), 35px);
}

.grammar-lesson-progress {
  display: grid;
  gap: 8px;
}

.grammar-lesson-progress-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.grammar-lesson-progress-bar {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #eef2f6;
  appearance: none;
  -webkit-appearance: none;
}

.grammar-lesson-progress-bar::-webkit-progress-bar {
  border-radius: 999px;
  background: #eef2f6;
}

.grammar-lesson-progress-bar::-webkit-progress-value {
  border-radius: 999px;
}

.grammar-lesson-progress-bar::-moz-progress-bar {
  border-radius: 999px;
}

.grammar-lesson-progress-item[data-grammar-mode="simple"] .grammar-lesson-progress-bar::-webkit-progress-value {
  background: #f6df8b;
}

.grammar-lesson-progress-item[data-grammar-mode="simple"] .grammar-lesson-progress-bar::-moz-progress-bar {
  background: #f6df8b;
}

.grammar-lesson-progress-item[data-grammar-mode="hard"] .grammar-lesson-progress-bar::-webkit-progress-value {
  background: #f2b8b0;
}

.grammar-lesson-progress-item[data-grammar-mode="hard"] .grammar-lesson-progress-bar::-moz-progress-bar {
  background: #f2b8b0;
}

.stats-page {
  max-width: 1080px;
}

.stats-head {
  margin-bottom: 18px;
}

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

.stats-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 32px rgba(24, 33, 47, 0.06);
}

.stats-card-head {
  display: grid;
  gap: 12px;
}

.stats-card h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.stats-range-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stats-range-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--soft);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
}

.stats-range-tab:hover,
.stats-range-tab.is-active {
  color: #fff;
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.stats-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stats-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #e5ebdf;
  border-radius: 8px;
  background: var(--soft);
}

.stats-row span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

.stats-row strong {
  color: var(--primary-dark);
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.stats-empty {
  margin: 0;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--soft);
  font-weight: 700;
}

.stats-rank {
  color: var(--ink);
}

.stats-row-dash {
  color: var(--muted);
}

.grammar-lesson-progress-value {
  min-width: 34px;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-align: right;
}

.grammar-exercise {
  max-width: 820px;
}

.grammar-prompt,
.grammar-builder {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.grammar-prompt h2,
.grammar-builder h2 {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

.grammar-prompt p {
  margin: 0;
  color: #344054;
  font-size: var(--reader-font-size);
  line-height: var(--reader-line-height);
}

.grammar-builder {
  margin-top: 0;
}

.grammar-builder > .grammar-prompt {
  margin-bottom: 16px;
  padding: 0 0 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.grammar-builder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.grammar-builder-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.grammar-builder-controls,
.grammar-mode-toggle {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.grammar-builder-controls {
  flex: 0 1 auto;
  justify-content: flex-end;
}

.grammar-mode-toggle {
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
}

.grammar-mode-button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.grammar-mode-button.is-active[data-grammar-mode="simple"] {
  color: #5f4b14;
  background: #f6df8b;
}

.grammar-mode-button.is-active[data-grammar-mode="hard"] {
  color: #7a271a;
  background: #f2b8b0;
}

.grammar-autoplay {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.grammar-autoplay input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary-dark);
  cursor: pointer;
}

.grammar-next-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--soft);
  font-size: 14px;
  font-weight: 700;
}

.grammar-next-link[hidden] {
  display: none;
}

.grammar-backspace-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--soft);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  user-select: none;
}

.grammar-backspace-button:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.grammar-backspace-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.grammar-backspace-button:disabled {
  cursor: default;
  opacity: 0.55;
}

.grammar-backspace-button[hidden] {
  display: none;
}

.grammar-progress-summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 180px;
  min-height: 34px;
  overflow: hidden;
  border: 1px solid #b7dca6;
  border-radius: 999px;
  color: var(--ink);
  background: #eef8e8;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.grammar-progress-summary[hidden] {
  display: none;
}

.grammar-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--grammar-progress, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #5da326);
  transition: width 0.2s ease;
}

.grammar-progress-value {
  position: relative;
  z-index: 1;
  padding: 0 12px;
}

.grammar-answer,
.grammar-word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 58px;
  padding: 12px;
  border-radius: 8px;
}

.grammar-answer {
  border: 1px dashed var(--primary);
  background: #fbfdf8;
}

.grammar-hard-answer {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-top: 12px;
}

.grammar-hard-answer[hidden] {
  display: none;
}

.grammar-hard-current {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 50px;
  padding: 10px;
  border: 1px dashed #b7dca6;
  border-radius: 8px;
  background: #fff;
}

.grammar-hard-word-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.grammar-hard-word-button svg {
  position: absolute;
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.grammar-hard-word-label {
  opacity: 0;
}

.grammar-hard-word-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.grammar-word-bank {
  margin-top: 12px;
  border: 1px solid var(--line);
  background: var(--soft);
}

.grammar-word {
  min-height: 38px;
  padding: 0 14px;
  font-size: max(16px, calc(var(--reader-font-size) - 1px));
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}

.grammar-word:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.grammar-hard-word {
  border-color: #b7dca6;
  background: #eef8e8;
}

.grammar-hard-current-word {
  border-style: dashed;
  border-color: var(--primary);
}

.grammar-letter.is-used {
  visibility: hidden;
}

.grammar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.grammar-reset-button {
  min-width: 104px;
  margin-top: 0;
  border: 0;
}

.grammar-result {
  min-height: 28px;
  margin: 12px 0 0;
  font-size: clamp(16px, calc(var(--reader-font-size) - 1px), 40px);
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.grammar-result.is-correct {
  color: var(--primary-dark);
}

.grammar-result.is-wrong {
  color: #b42318;
}

.grammar-result-correct-sentence {
  color: var(--ink);
}

.grammar-result-correct-text {
  color: var(--primary-dark);
}

.grammar-progress-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdf8;
}

.grammar-progress-panel[hidden] {
  display: none;
}

.grammar-progress-panel p {
  margin: 0;
  color: #344054;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.grammar-progress-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.grammar-progress-actions[hidden] {
  display: none;
}

.grammar-progress-actions .primary-link,
.grammar-progress-actions .secondary-link {
  margin-top: 0;
  margin-left: 0;
}

.grammar-language-card:focus-visible,
.grammar-lesson-card:focus-visible,
.grammar-next-link:focus-visible,
.grammar-mode-button:focus-visible,
.grammar-hard-word-button:focus-visible,
.grammar-backspace-button:focus-visible,
.grammar-word:focus-visible,
.grammar-reset-button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.eew-page {
  max-width: 1080px;
}

.eew-unit-page {
  --eew-copy-size: clamp(16px, calc(var(--reader-font-size) - 1px), 40px);
  --eew-copy-line-height: 1.42;
  padding-bottom: 88px;
}

.eew-levels-head,
.grammar-lessons-head {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  justify-content: space-between;
  max-width: none;
}

.eew-levels-head h1,
.grammar-lessons-head h1 {
  margin-bottom: 0;
}

.eew-language-menu {
  position: relative;
  min-width: 190px;
  color: var(--ink);
}

.eew-language-menu summary {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(24, 33, 47, 0.06);
  cursor: pointer;
  list-style: none;
}

.eew-language-menu summary::-webkit-details-marker {
  display: none;
}

.eew-language-menu summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.eew-language-menu[open] summary::after {
  transform: translateY(2px) rotate(225deg);
}

.eew-language-menu-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.eew-language-menu-value {
  font-size: 15px;
  font-weight: 800;
}

.eew-levels-language-menu,
.grammar-language-menu {
  min-width: 0;
}

.eew-levels-language-menu summary,
.grammar-language-menu summary {
  justify-content: center;
  min-width: 58px;
  min-height: 38px;
  padding: 6px 12px;
  text-transform: lowercase;
}

.eew-language-menu-list {
  position: absolute;
  z-index: 5;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 210px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 38px rgba(24, 33, 47, 0.12);
}

.eew-language-menu-link {
  display: block;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.eew-language-menu-link:hover,
.eew-language-menu-link.is-active {
  color: #fff;
  background: var(--primary);
}

.eew-language-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.eew-language-card {
  display: grid;
  align-content: center;
  min-height: 132px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 14px 32px rgba(24, 33, 47, 0.06);
}

.eew-language-card:hover,
.eew-unit-link:hover {
  border-color: var(--primary);
  box-shadow: 0 18px 38px rgba(24, 33, 47, 0.1);
}

.eew-language-name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
}

.eew-language-native {
  margin-top: 8px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}

.eew-level-stack {
  display: grid;
  gap: 14px;
}

.eew-level {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 32px rgba(24, 33, 47, 0.06);
}

.eew-level summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.eew-level summary::-webkit-details-marker {
  display: none;
}

.eew-level summary span + span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.eew-unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  padding: 0 18px 18px;
}

.eew-unit-link {
  display: grid;
  align-content: center;
  gap: 7px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.eew-unit-name {
  font-size: 17px;
  font-weight: 800;
}

.eew-unit-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.eew-unit-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.eew-unit-progress span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.eew-unit-progress strong {
  flex: 0 0 auto;
  color: var(--primary);
  font-weight: 800;
}

.eew-word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}

.eew-unit-actions {
  position: fixed;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 16px;
  z-index: 80;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.eew-start-button {
  min-width: 132px;
  justify-content: center;
  background: #f97316;
  box-shadow: 0 12px 28px rgba(24, 33, 47, 0.18);
  pointer-events: auto;
}

.eew-start-button:hover {
  background: #9a3412;
}

.eew-unit-actions .primary-link {
  margin-top: 0;
  margin-left: 0;
}

.eew-image-choice-page {
  max-width: 1080px;
}

.eew-image-choice-page[data-reader-text-root] {
  --reader-font-size: 19px;
  --reader-line-height: 1.35;
}

.eew-image-choice-form {
  display: grid;
  gap: 22px;
}

.eew-image-choice-head {
  display: grid;
  grid-template-columns: minmax(58px, 1fr) minmax(0, auto) minmax(58px, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.eew-image-choice-head .eew-language-menu {
  grid-column: 3;
  justify-self: end;
}

.eew-image-choice-progress {
  grid-column: 2;
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 0;
  color: #344054;
  font-size: max(14px, calc(var(--reader-font-size) - 5px));
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
}

.eew-image-choice-progress-count {
  color: var(--primary);
}

.eew-image-choice-instruction {
  margin: 8px 0 14px;
  color: #344054;
  font-size: max(16px, calc(var(--reader-font-size) - 1px));
  font-weight: 800;
  line-height: var(--reader-line-height);
  text-align: center;
}

.eew-image-choice-stack {
  display: grid;
  gap: 18px;
}

.eew-image-choice-word {
  display: grid;
  gap: 14px;
  min-width: 0;
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.eew-image-choice-word-legend {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  margin: -1px;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.eew-image-choice-block {
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(24, 33, 47, 0.06);
}

.eew-image-choice-word-block,
.eew-image-choice-prompt-block {
  display: grid;
  justify-items: center;
  text-align: center;
}

.eew-image-choice-word-block {
  gap: 12px;
}

.eew-image-choice-word-name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: calc(var(--reader-font-size) + 5px);
  font-weight: 800;
  line-height: 1.15;
}

.eew-image-choice-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  width: 100%;
  margin-top: 14px;
}

.eew-image-choice-option {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
  width: 100%;
  padding: 10px;
  border: 1px solid #d9e4ef;
  border-radius: 8px;
  color: inherit;
  background: #fbfcff;
  cursor: pointer;
  font: inherit;
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
}

.eew-image-choice-option:hover {
  border-color: var(--primary);
}

.eew-image-choice-option:focus-visible {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus);
}

.eew-image-choice-media {
  display: block;
  overflow: hidden;
  border-radius: 6px;
  background: #eef4e9;
}

.eew-image-choice-media img {
  display: block;
  width: 100%;
  height: auto;
}

.eew-image-choice-label {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #344054;
  font-size: max(13px, calc(var(--reader-font-size) - 6px));
  font-weight: 800;
  line-height: 1.25;
}

.eew-image-choice-translation-block {
  display: grid;
  gap: 12px;
}

.eew-image-choice-translation {
  display: grid;
  justify-items: start;
  gap: 6px;
  margin: 0;
  color: #344054;
  text-align: left;
}

.eew-image-choice-translation-label,
.eew-image-choice-example-label {
  color: var(--muted);
  font-size: max(13px, calc(var(--reader-font-size) - 6px));
  font-weight: 800;
  text-transform: uppercase;
}

.eew-image-choice-translation-word,
.eew-image-choice-definition,
.eew-image-choice-example-text {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: calc(var(--reader-font-size) + 1px);
  font-weight: 400;
  line-height: var(--reader-line-height);
}

.eew-image-choice-example {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin: 0;
  color: #344054;
  text-align: center;
}

.eew-image-choice-definition {
  margin: 0;
  color: #344054;
  text-align: center;
}

.eew-image-choice-word-delimiter {
  width: min(100%, 520px);
  border-top: 1px dotted #c8cdd3;
}

.eew-practice-page {
  max-width: 760px;
}

.eew-practice-close,
.grammar-exercise-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin: 0 0 10px;
  border-radius: 999px;
  color: #667085;
  background: transparent;
}

.eew-practice-close:hover,
.grammar-exercise-close:hover {
  color: #344054;
  background: #eef2f6;
}

.eew-practice-close:focus-visible,
.grammar-exercise-close:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.eew-practice-close svg,
.grammar-exercise-close svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.eew-review-card {
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(24, 33, 47, 0.06);
}

.eew-review-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #344054;
  font-size: 14px;
  font-weight: 800;
}

.eew-review-mode,
.eew-review-timer {
  min-width: 0;
  overflow-wrap: anywhere;
}

.eew-review-timer-track {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #e6edf5;
}

.eew-review-timer-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 160ms linear;
}

.eew-review-status {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.eew-review-question {
  display: grid;
  gap: 18px;
}

.eew-review-question[hidden],
.eew-review-fill[hidden],
.eew-review-image-choice[hidden],
.eew-review-sound-choice[hidden],
.eew-review-ex-def-sound[hidden] {
  display: none;
}

.eew-review-fill {
  display: grid;
  gap: 18px;
}

.eew-review-definition,
.eew-review-example {
  display: grid;
  gap: 8px;
}

.eew-review-definition h2,
.eew-review-example h2 {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eew-review-definition p,
.eew-review-example p {
  margin: 0;
  color: #243143;
  font-size: clamp(18px, calc(var(--reader-font-size) + 3px), 40px);
  line-height: 1.45;
}

.eew-review-blank-input {
  display: inline-block;
  width: min(220px, 100%);
  min-height: 42px;
  margin: 0 4px;
  padding: 4px 10px;
  border: 2px solid var(--primary);
  border-radius: 8px;
  color: #172033;
  background: #fbfff8;
  font: inherit;
  font-size: clamp(16px, calc(var(--reader-font-size) - 1px), 40px);
  font-weight: 800;
  text-align: center;
  vertical-align: baseline;
}

.eew-review-blank-input:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.eew-review-answer-display {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.eew-review-blank-static {
  display: inline-block;
  min-width: 74px;
  margin: 0 4px;
  color: inherit;
  font-weight: inherit;
  text-align: center;
}

.eew-review-letter-panel {
  display: grid;
  gap: 10px;
}

.eew-review-letter-label {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.eew-review-letter-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.eew-review-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #d9e4ef;
  border-radius: 8px;
  color: #172033;
  background: #fbfcff;
  cursor: pointer;
  font-size: clamp(16px, calc(var(--reader-font-size) - 1px), 40px);
  font-weight: 800;
}

.eew-review-letter:hover {
  border-color: var(--primary);
}

.eew-review-letter:disabled {
  cursor: default;
  opacity: 0.42;
}

.eew-review-image-choice {
  display: grid;
  gap: 16px;
}

.eew-review-sound-choice {
  display: grid;
  justify-items: center;
  gap: 16px;
}

.eew-review-ex-def-sound {
  display: grid;
  gap: 18px;
}

.eew-review-audio-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.eew-review-audio-actions > .eew-audio-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  height: 56px;
  min-width: 56px;
  padding: 0 16px;
}

.eew-review-sound-button {
  height: 56px;
  min-width: 56px;
}

.eew-review-sound-button .eew-play-icon {
  border-top-width: 8px;
  border-bottom-width: 8px;
  border-left-width: 12px;
}

.eew-audio-button.eew-review-listen-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  height: 56px;
  min-width: 56px;
  padding: 0 18px;
}

.eew-review-audio-label {
  min-width: 0;
  color: inherit;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.eew-review-answer {
  display: grid;
  justify-items: center;
}

.eew-review-answer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.eew-review-answer-row .eew-review-blank-input {
  flex: 1 1 150px;
  width: auto;
  max-width: 220px;
  min-width: 0;
  margin: 0;
}

.eew-review-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border: 1px solid var(--primary);
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(85, 150, 28, 0.18);
}

.eew-review-submit:hover {
  background: #64ad25;
}

.eew-review-submit:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.eew-review-submit:disabled {
  cursor: default;
  opacity: 0.55;
}

.eew-review-submit[hidden] {
  display: none;
}

.eew-check-icon {
  display: block;
  width: 16px;
  height: 9px;
  border-bottom: 3px solid currentColor;
  border-left: 3px solid currentColor;
  transform: translateY(-1px) rotate(-45deg);
}

.eew-review-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--soft);
  cursor: pointer;
}

.eew-review-reset:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.eew-review-reset svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.eew-review-reset:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.eew-review-reset:disabled {
  cursor: default;
  opacity: 0.55;
}

.eew-review-reset[hidden] {
  display: none;
}

.eew-review-image-frame {
  display: block;
  overflow: hidden;
  width: min(420px, 100%);
  margin: 0 auto;
  border-radius: 8px;
  background: #eef4e9;
}

.eew-review-image-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.eew-review-option-bank {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.eew-review-option {
  min-width: 0;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #d9e4ef;
  border-radius: 8px;
  color: #172033;
  background: #fbfcff;
  cursor: pointer;
  font-size: clamp(16px, calc(var(--reader-font-size) - 2px), 40px);
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.eew-review-option:hover {
  border-color: var(--primary);
}

.eew-review-option:disabled {
  cursor: default;
  opacity: 0.52;
}

.eew-review-result {
  min-height: 24px;
  margin: 0;
  font-size: clamp(16px, calc(var(--reader-font-size) - 1px), 40px);
  font-weight: 800;
  line-height: 1.35;
}

.eew-review-result.is-correct {
  color: #2d7d18;
}

.eew-review-result.is-wrong {
  color: #b42318;
}

.eew-review-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: #344054;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}

.eew-review-progress[hidden] {
  display: none;
}

.eew-review-progress span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.eew-review-progress strong {
  flex: 0 0 auto;
  color: var(--primary);
  font-weight: 800;
}

.eew-review-correct-answer {
  color: #2d7d18;
}

.eew-word-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(24, 33, 47, 0.06);
}

.eew-word-figure {
  position: relative;
  display: grid;
  grid-template-areas: "media";
  margin: 0;
  min-height: 140px;
  overflow: hidden;
  width: 100%;
  background: #eef4e9;
  isolation: isolate;
}

.eew-word-figure.has-carousel {
  touch-action: pan-y;
}

.eew-word-image {
  grid-area: media;
  align-self: center;
  justify-self: stretch;
  display: block;
  width: 100%;
  height: auto;
}

.eew-word-image[hidden] {
  display: none;
}

.eew-image-placeholder {
  grid-area: media;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 140px;
  padding: 18px;
  color: var(--muted);
  background: #eef4e9;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.eew-image-placeholder[hidden] {
  display: none;
}

.eew-image-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(23, 32, 51, 0.16);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 4px 12px rgba(24, 33, 47, 0.14);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transform: translateY(-50%);
}

.eew-image-arrow:hover {
  color: #fff;
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.eew-arrow-icon {
  display: block;
  width: 9px;
  height: 9px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.eew-arrow-icon-prev {
  transform: translateX(2px) rotate(-135deg);
}

.eew-arrow-icon-next {
  transform: translateX(-2px) rotate(45deg);
}

.eew-image-arrow-prev {
  left: 10px;
}

.eew-image-arrow-next {
  right: 10px;
}

.eew-image-arrow[hidden] {
  display: none;
}

.eew-word-body {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 20px;
}

.eew-word-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.eew-word-title h2 {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(34px, calc(var(--reader-font-size) + 16px), 44px);
  line-height: 1.05;
  letter-spacing: 0;
}

.eew-word-title .eew-audio-button {
  position: static;
  align-self: center;
  margin-top: 0;
  margin-bottom: 0;
  transform: none;
}

.eew-transcription,
.eew-display-word {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.eew-transcription {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: clamp(16px, var(--reader-font-size), 20px);
  line-height: 1.35;
}

.eew-display-word {
  color: #344054;
  font-size: var(--eew-copy-size);
  line-height: var(--eew-copy-line-height);
}

.eew-translation {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.eew-translation-box {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid #c9e1d9;
  border-radius: 8px;
  background: #f1faf7;
}

.eew-collapsible {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.eew-collapsible-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.eew-collapsible-text.is-collapsed {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.eew-toggle-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  justify-self: start;
  width: auto;
  min-height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--primary-dark);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.eew-toggle-button::after {
  content: "More";
}

.eew-toggle-button[aria-expanded="true"]::after {
  content: "Less";
}

.eew-toggle-button:hover {
  color: #2c6a0d;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.eew-toggle-icon {
  display: block;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.eew-toggle-button[aria-expanded="true"] .eew-toggle-icon {
  transform: translateY(2px) rotate(225deg);
}

.eew-translation-toggle {
  justify-self: end;
  color: #356b72;
}

.eew-translation-toggle:hover {
  color: #255057;
  background: transparent;
}

.eew-word-section {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.eew-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.eew-section-label {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.eew-section-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid #dde7f0;
  border-radius: 8px;
  background: #fbfcff;
}

.eew-word-section p {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: var(--eew-copy-size);
  line-height: var(--eew-copy-line-height);
}

.eew-source-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid #edf2f6;
}

.eew-section-card > .eew-source-copy:first-child {
  padding-top: 0;
  border-top: 0;
}

.eew-source-label {
  min-width: 0;
  color: #7a8597;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.eew-source-text {
  color: #41516b;
}

.eew-audio-button {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 6px 14px rgba(114, 192, 44, 0.18);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.eew-audio-button:hover,
.eew-audio-button.is-playing {
  background: var(--primary-dark);
}

.eew-audio-button:focus-visible {
  outline: 3px solid rgba(114, 192, 44, 0.28);
  outline-offset: 2px;
}

.eew-primary-audio-button {
  width: 44px;
  height: 44px;
  min-width: 44px;
}

.eew-inline-audio-button {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border: 1px solid #cadfe5;
  color: #356b72;
  background: #eef7f8;
  box-shadow: none;
}

.eew-inline-audio-button:hover,
.eew-inline-audio-button.is-playing {
  color: #fff;
  border-color: #356b72;
  background: #356b72;
}

.eew-play-icon {
  display: block;
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid currentColor;
}

.eew-primary-audio-button .eew-play-icon {
  border-top-width: 7px;
  border-bottom-width: 7px;
  border-left-width: 11px;
}

.eew-inline-audio-button .eew-play-icon {
  margin-left: 1px;
  border-top-width: 4px;
  border-bottom-width: 4px;
  border-left-width: 6px;
}

.error-page {
  max-width: 640px;
  padding-top: 48px;
}

.error-page p {
  color: var(--muted);
}

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

  .article-page-authenticated {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .article-page-authenticated .article-head {
    display: contents;
  }

  .article-page-authenticated .article-head h1 {
    grid-column: 1;
    grid-row: 1;
    max-width: 760px;
    margin-bottom: 28px;
  }

  .article-page-authenticated .article-layout {
    grid-column: 1;
    grid-row: 3;
    min-width: 0;
  }

  .article-page-authenticated .article-actions {
    position: relative;
    z-index: 30;
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    justify-self: end;
    margin-top: 0;
    margin-bottom: 20px;
  }

  .article-page-authenticated .article-action-buttons {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
  }

  .article-page-authenticated .article-mode-switcher {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(280px, calc(100vw - 24px));
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(24, 33, 47, 0.16);
  }

  .article-page-authenticated .article-action-status {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(260px, calc(100vw - 24px));
    text-align: right;
  }

  .article-sidebar {
    position: static;
  }

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

@media (max-width: 560px) {
  .shell {
    width: min(100% - 24px, 1080px);
  }

  .header-inner {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    min-height: 56px;
    padding: 8px 0;
  }

  .brand {
    font-size: 18px;
  }

  .top-menu-link {
    position: absolute;
    left: 50%;
    margin-inline: 0;
    transform: translateX(-50%);
  }

  .nav {
    width: auto;
    gap: 8px;
    justify-content: flex-end;
    order: 0;
  }

  .nav-link {
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
  }

  .account-link,
  .account-actions {
    max-width: 58vw;
  }

  .account-action {
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
  }

  .account-name {
    max-width: 28vw;
  }

  .settings-toggle {
    width: 38px;
    min-height: 32px;
  }

  .settings-panel {
    position: absolute;
    z-index: 1000;
    top: calc(100% + 8px);
    right: 0;
    bottom: auto;
    left: auto;
    width: min(280px, calc(100vw - 24px));
    max-height: calc(100dvh - 72px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
  }

  .article-mode-switcher {
    width: 100%;
    border-radius: 8px;
  }

  .article-mode-button {
    flex: 1 1 132px;
  }

  .article-action-buttons,
  .article-actions-login-links {
    align-items: stretch;
    flex-direction: column;
  }

  .article-action-buttons {
    align-items: center;
    flex-direction: row;
  }

  .article-action-button,
  .article-action-link {
    width: 100%;
  }

  .article-feedback-sheet {
    align-items: end;
    padding: 0;
  }

  .article-feedback-dialog {
    width: 100%;
    max-height: min(92dvh, 720px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 8px 8px 0 0;
  }

  .related-card {
    font-size: 18px;
  }

  [data-reader-text-root] {
    --reader-font-size: 17px;
  }

  .sentence-translation {
    padding: 10px;
  }

  .sentence-translation-toolbar {
    justify-content: flex-start;
  }

  .translation-compare-grid.is-comparing {
    grid-template-columns: minmax(0, 1fr);
  }

  .breadcrumbs {
    margin-bottom: 14px;
    font-size: 13px;
  }

  .article-head h1,
  .error-page h1 {
    font-size: 34px;
  }

  .eew-levels-head,
  .grammar-lessons-head {
    flex-wrap: nowrap;
    align-items: center;
  }

  .eew-language-menu {
    width: 100%;
  }

  .eew-levels-language-menu,
  .grammar-language-menu {
    width: auto;
  }

  .eew-language-menu-list {
    right: auto;
    left: 0;
  }

  .eew-levels-language-menu .eew-language-menu-list,
  .grammar-language-menu .eew-language-menu-list {
    right: 0;
    left: auto;
  }

  .grammar-prompt,
  .grammar-builder {
    padding: 16px;
  }

  .grammar-language-grid,
  .grammar-lessons-grid,
  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topic-favorite-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .eew-language-grid,
  .eew-word-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .eew-unit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 12px 12px;
  }

  .eew-level summary {
    padding: 0 12px;
  }

  .eew-word-body {
    gap: 12px;
    padding: 16px;
  }

  .eew-word-title h2 {
    font-size: clamp(32px, calc(var(--reader-font-size) + 15px), 40px);
  }

  .eew-review-card {
    padding: 16px;
  }

  .eew-review-definition p,
  .eew-review-example p {
    font-size: clamp(18px, calc(var(--reader-font-size) + 2px), 40px);
  }

  .eew-review-blank-input {
    width: min(180px, 100%);
    min-height: 38px;
  }

  .eew-review-letter {
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
  }

  .eew-review-option-bank {
    grid-template-columns: minmax(0, 1fr);
  }

  .eew-image-arrow {
    width: 28px;
    height: 28px;
  }

  .eew-arrow-icon {
    width: 8px;
    height: 8px;
  }

  .eew-image-arrow-prev {
    left: 8px;
  }

  .eew-image-arrow-next {
    right: 8px;
  }

  .eew-primary-audio-button {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }

  .eew-inline-audio-button {
    width: 22px;
    height: 22px;
    min-width: 22px;
  }
}

/* Grammar practice: lesson theory dialog. Lives inside [data-reader-text-root]
   so the article follows the reader font size; stacks under the reader-size
   sheet (1000) so A-/A+ can be used while the theory is open. */
.has-grammar-article {
  overflow: hidden;
}

.grammar-article-sheet {
  position: fixed;
  z-index: 900;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
}

.grammar-article-sheet[hidden] {
  display: none;
}

.grammar-article-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 32, 51, 0.36);
}

.grammar-article-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 760px);
  max-height: 85vh;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 42px rgba(24, 33, 47, 0.18);
}

.grammar-article-head {
  display: flex;
  justify-content: flex-end;
  padding: 10px 10px 0;
}

.grammar-article-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--soft);
  cursor: pointer;
}

.grammar-article-close:hover {
  color: #fff;
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.grammar-article-close:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.grammar-article-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.grammar-article-body {
  min-height: 0;
  overflow-y: auto;
  overflow-wrap: anywhere;
  padding: 0 20px 20px;
  font-size: var(--reader-font-size);
  line-height: var(--reader-line-height);
}

.grammar-article-body h1 {
  margin: 0 0 14px;
  font-size: calc(var(--reader-font-size) + 6px);
  line-height: 1.25;
  letter-spacing: 0;
}

.grammar-article-body h2 {
  margin: 22px 0 10px;
  font-size: calc(var(--reader-font-size) + 3px);
  line-height: 1.3;
  letter-spacing: 0;
}

.grammar-article-body h3 {
  margin: 18px 0 8px;
  font-size: calc(var(--reader-font-size) + 1px);
  line-height: 1.3;
  letter-spacing: 0;
}

.grammar-article-body p,
.grammar-article-body ul,
.grammar-article-body ol {
  margin: 0 0 12px;
}

.grammar-article-body ul,
.grammar-article-body ol {
  padding-left: 1.4em;
}

.grammar-article-body li {
  margin: 0 0 6px;
}

.grammar-article-body strong {
  font-weight: 800;
}

.grammar-article-body em {
  font-style: italic;
}

.grammar-article-error {
  color: var(--muted);
}

.grammar-reader-size-button {
  font-weight: 800;
  letter-spacing: 0.02em;
}

@media (max-width: 640px) {
  /* Full screen: pin the dialog to the fixed sheet instead of sizing it from
     its content, so the article scrolls inside and the page never does. */
  .grammar-article-sheet {
    display: block;
    padding: 0;
  }

  .grammar-article-dialog {
    position: absolute;
    inset: 0;
    width: auto;
    max-height: none;
    border: 0;
    border-radius: 0;
  }
}
