:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-muted: #eef5f1;
  --ink: #172026;
  --muted: #5d6872;
  --line: #d9e0e3;
  --accent: #0f8b8d;
  --accent-dark: #0b6264;
  --danger: #b42318;
  --warning: #9a6700;
  --success: #16703c;
  --shadow: 0 14px 40px rgba(23, 32, 38, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, #f8fbfb 0%, #edf3f4 48%, #f5f7f8 100%);
}

a {
  color: inherit;
}

.site-body {
  background: #f6f8f7;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0;
}

.brand {
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-link {
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.nav-link:hover,
.nav-link.is-active {
  background: #e7f2ef;
  color: var(--accent-dark);
}

.nav-logout {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--danger);
}

.nav-logout:hover:not(:disabled) {
  border-color: #efc0bb;
  background: #fff4f2;
  color: #8f1d14;
}

.site-main {
  flex: 1;
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 56px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
  border-top: 1px solid rgba(217, 224, 227, 0.82);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero {
  max-width: 760px;
  padding: 54px 0 42px;
}

.hero h1,
.narrow-panel h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1.18;
}

.lead {
  max-width: 680px;
  margin: 18px 0 0;
  color: #253039;
  font-size: 20px;
  line-height: 1.75;
}

.quiet {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--accent-dark);
}

.button-secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent-dark);
}

.button-secondary:hover {
  background: #edf6f4;
}

.danger-button {
  background: var(--danger);
}

.danger-button:hover {
  background: #8f1d14;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.info-card,
.narrow-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.info-card {
  padding: 20px;
}

.info-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.info-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.narrow-panel {
  max-width: 620px;
  margin: 20px auto 0;
  padding: 28px;
}

.public-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.public-form label {
  display: grid;
  gap: 8px;
}

.public-form label span {
  color: #27333b;
  font-weight: 800;
}

.public-form textarea {
  min-height: 120px;
}

.form-message {
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 700;
  line-height: 1.6;
}

.form-message.success {
  border: 1px solid #b7dfc7;
  background: #edf8f1;
  color: var(--success);
}

.form-message.error {
  border: 1px solid #f0b8b2;
  background: #fff0ee;
  color: var(--danger);
}

.form-note {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.admin-body {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
  background: #f4f6f5;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100vh;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.admin-brand {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  text-decoration: none;
}

.admin-nav {
  display: grid;
  gap: 6px;
}

.admin-nav-link,
.admin-logout {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.admin-nav-link:hover,
.admin-nav-link.is-active {
  background: #e7f2ef;
  color: var(--accent-dark);
}

.admin-logout {
  width: 100%;
  margin-top: auto;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--danger);
  cursor: pointer;
}

.admin-logout:hover:not(:disabled) {
  border-color: #efc0bb;
  background: #fff4f2;
  color: #8f1d14;
}

.admin-main {
  min-width: 0;
  padding: 24px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  color: var(--muted);
  font-weight: 800;
}

.admin-panel {
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-panel h1,
.admin-panel h2 {
  margin: 0 0 16px;
}

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

.stat-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.stat-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 800;
}

.stat-card strong {
  font-size: 30px;
}

.admin-form {
  display: grid;
  gap: 14px;
}

.grid-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.admin-form label,
.inline-form {
  display: grid;
  gap: 8px;
}

.admin-form label span {
  color: #27333b;
  font-weight: 800;
}

.wide-field {
  grid-column: 1 / -1;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.admin-filter-form {
  grid-template-columns: minmax(220px, 360px) auto;
  align-items: end;
  margin-top: 18px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: #38434b;
  font-size: 13px;
  white-space: nowrap;
}

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

.admin-inline-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.compact-stat-grid {
  margin-bottom: 16px;
}

.admin-practice-table-wrap {
  max-height: none;
}

.admin-practice-table {
  min-width: 1280px;
}

.admin-practice-student,
.admin-practice-content,
.admin-practice-score,
.admin-practice-audio-cell,
.admin-practice-feedback {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.admin-practice-student strong,
.admin-practice-content strong,
.admin-practice-score strong {
  color: var(--ink);
}

.admin-practice-student span,
.admin-practice-content p,
.admin-practice-score span,
.admin-practice-audio-cell span,
.admin-practice-feedback p,
.admin-practice-feedback small {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.admin-practice-content {
  max-width: 320px;
}

.admin-practice-score {
  min-width: 92px;
  font-variant-numeric: tabular-nums;
}

.admin-practice-audio-cell {
  min-width: 360px;
}

.admin-practice-audio {
  display: block;
  width: 380px;
  max-width: 100%;
}

.admin-wechat-table {
  min-width: 1120px;
}

.wechat-actions {
  display: grid;
  gap: 8px;
  min-width: 280px;
}

.wechat-bind-form {
  grid-template-columns: minmax(160px, 1fr) auto;
}

.masked-identity {
  display: grid;
  gap: 4px;
}

.wechat-applicant {
  display: grid;
  gap: 4px;
  min-width: 170px;
}

.wechat-applicant-name {
  max-width: 190px;
  color: var(--text);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wechat-applicant-meta {
  color: var(--muted);
  font-size: 12px;
}

.wechat-nickname {
  display: inline-block;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.masked-identity code {
  width: max-content;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.masked-identity span {
  color: var(--muted);
  font-size: 12px;
}

.admin-actions {
  margin-top: 18px;
}

.admin-dialog {
  width: min(720px, calc(100vw - 32px));
  padding: 24px;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(20, 28, 34, 0.22);
}

.admin-dialog::backdrop {
  background: rgba(20, 28, 34, 0.38);
}

.admin-dialog h2 {
  margin: 0 0 16px;
}

.dialog-close-form {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.inline-form {
  grid-template-columns: minmax(120px, 1fr) auto;
  align-items: center;
}

.inline-form input {
  min-width: 120px;
  padding: 8px 10px;
}

.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}

.small-button:hover:not(:disabled) {
  background: var(--accent-dark);
  color: #fff;
}

.small-button.outline {
  border: 1px solid var(--accent);
  background: #ffffff;
  color: var(--accent-dark);
}

.small-button.outline:hover:not(:disabled) {
  border-color: #9ed6d7;
  background: #e9f7f7;
  color: var(--accent-dark);
}

.small-button.danger {
  background: var(--danger);
}

.small-button.danger:hover:not(:disabled) {
  background: #8f1d14;
  color: #fff;
}

.text-link {
  color: var(--accent-dark);
  font-weight: 800;
}

.muted-text {
  color: var(--muted);
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef2f3;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status-badge.active,
.status-badge.approved {
  background: #edf8f1;
  color: var(--success);
}

.status-badge.pending {
  background: #fff8dc;
  color: var(--warning);
}

.status-badge.rejected,
.status-badge.disabled,
.status-badge.expired,
.status-badge.revoked {
  background: #fff0ee;
  color: var(--danger);
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.detail-list div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.detail-list dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-weight: 800;
}

.detail-list dd {
  margin: 0;
  font-weight: 800;
}

.wide-detail {
  grid-column: 1 / -1;
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 22px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.18;
}

.status-pill {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--surface-muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1120px);
  justify-content: center;
  gap: 16px;
  align-items: start;
}

.compose-pane,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.compose-pane {
  padding: 22px;
}

.form,
.field {
  display: flex;
  flex-direction: column;
}

.field span,
.field-heading,
h2 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 700;
}

.field-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

#char-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

textarea,
input,
select,
button {
  font: inherit;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px;
  color: var(--ink);
}

textarea {
  resize: vertical;
  height: 180px;
  min-height: 180px;
  line-height: 1.7;
}

.language-hint {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  margin: 12px 0 0;
  padding: 9px 13px;
  border: 0;
  border-radius: 8px;
  background: #e8f7f2;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.auto-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(15, 139, 141, 0.12);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.translation-result,
.result-panel {
  display: grid;
  gap: 10px;
  min-height: 220px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.results-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 16px;
  align-items: stretch;
}

.audio-panel {
  min-height: 220px;
}

.translation-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.translation-result h2 {
  margin: 0;
  font-size: 16px;
}

.translation-result p,
.translation-output {
  margin: 0;
  color: #2e3a42;
  line-height: 1.75;
  white-space: pre-wrap;
}

.translation-result .muted-translation {
  color: var(--muted);
  font-weight: 700;
}

.translation-tag.working {
  border-color: #d8c073;
  background: #fff8dc;
  color: var(--warning);
}

.translation-tag.ready {
  border-color: #b7dfc7;
  background: #edf8f1;
  color: var(--success);
}

.translation-tag.error {
  border-color: #f0b8b2;
  background: #fff0ee;
  color: var(--danger);
}

.actions {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.actions #submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  width: 100%;
  padding: 0 22px;
  background: var(--accent);
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(15, 139, 141, 0.2);
}

.actions #submit-button:hover:not(:disabled) {
  background: var(--accent-dark);
  box-shadow: 0 16px 32px rgba(11, 98, 100, 0.24);
}

.actions #submit-button.is-loading::before {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  border: 2px solid rgba(255, 255, 255, 0.46);
  border-top-color: #fff;
  border-radius: 50%;
  content: "";
  animation: spin 800ms linear infinite;
}

.synth-status-text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.6;
}

.synth-status-text.submitting,
.synth-status-text.processing,
.synth-status-text.translating,
.synth-status-text.synthesizing,
.synth-status-text.generating {
  color: var(--warning);
}

.synth-status-text.success {
  color: var(--success);
}

.synth-status-text.error {
  color: var(--danger);
}

.text-action {
  justify-self: start;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 800;
  box-shadow: none;
}

.text-action:hover:not(:disabled),
.text-action:focus-visible {
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
}

.debug-details {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.debug-details pre {
  max-height: 220px;
  margin: 0;
  overflow: auto;
  color: #33414a;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 12px 18px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 160ms ease, opacity 160ms ease;
}

button:not([class]):hover:not(:disabled) {
  background: var(--accent-dark);
}

button.button-secondary:hover:not(:disabled) {
  background: #edf6f4;
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

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

@keyframes loadingPulse {
  0%,
  100% {
    opacity: 0.48;
  }

  50% {
    opacity: 1;
  }
}

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

.status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 700;
}

.log {
  margin: 0;
  padding: 16px;
  min-height: 140px;
  border-radius: 8px;
  background: #172026;
  color: #eaf2f2;
  overflow: auto;
  line-height: 1.65;
  white-space: pre-wrap;
}

.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.audio-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f6f8f9;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.audio-state.working,
.audio-state.loading {
  border-color: #d8c073;
  background: #fff8dc;
  color: var(--warning);
}

.audio-state.ready {
  border-color: #b7dfc7;
  background: #edf8f1;
  color: var(--success);
}

.audio-state.playing {
  border-color: #9ed6d7;
  background: #e8f7f7;
  color: var(--accent-dark);
}

.audio-state.error {
  border-color: #f0b8b2;
  background: #fff0ee;
  color: var(--danger);
}

.player-shell {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f7faf9 100%);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.player-shell:focus-within,
.player-shell:hover {
  border-color: #b7cdcf;
  box-shadow: 0 12px 26px rgba(23, 32, 38, 0.08);
}

.play-toggle {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  box-shadow: 0 12px 22px rgba(11, 98, 100, 0.22);
  color: #fff;
  transition:
    background 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease,
    transform 160ms ease;
}

.play-toggle:hover:not(:disabled) {
  background: linear-gradient(135deg, #10a1a3 0%, var(--accent-dark) 100%);
  box-shadow: 0 16px 28px rgba(11, 98, 100, 0.28);
  transform: translateY(-1px) scale(1.02);
}

.play-toggle:active:not(:disabled) {
  box-shadow: 0 8px 16px rgba(11, 98, 100, 0.24);
  transform: translateY(0) scale(0.96);
}

.play-toggle:focus-visible {
  outline: 3px solid rgba(15, 139, 141, 0.24);
  outline-offset: 4px;
}

.play-toggle:disabled {
  cursor: not-allowed;
  box-shadow: none;
}

.play-icon {
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 16px solid currentColor;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.14));
  transition: transform 160ms ease;
}

.play-toggle:hover:not(:disabled) .play-icon {
  transform: scale(1.06);
}

.play-toggle.is-playing .play-icon {
  position: relative;
  width: 18px;
  height: 20px;
  margin-left: 0;
  border: 0;
}

.play-toggle.is-playing .play-icon::before,
.play-toggle.is-playing .play-icon::after {
  position: absolute;
  top: 0;
  width: 6px;
  height: 20px;
  border-radius: 2px;
  background: currentColor;
  content: "";
}

.play-toggle.is-playing .play-icon::before {
  left: 1px;
}

.play-toggle.is-playing .play-icon::after {
  right: 1px;
}

.player-main {
  min-width: 0;
  width: 100%;
}

.time-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
}

.audio-progress {
  position: relative;
  display: block;
  width: 100%;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  touch-action: none;
  transition: none;
}

.audio-progress:hover:not(:disabled),
.audio-progress:active:not(:disabled),
.audio-progress:focus-visible {
  background: transparent;
  box-shadow: none;
}

.audio-progress::before {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 6px;
  border-radius: 999px;
  background: #d5dde0;
  content: "";
  transform: translateY(-50%);
  transition: background-color 160ms ease;
}

.progress-fill {
  position: absolute;
  top: 50%;
  left: 0;
  width: 0%;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  transform: translateY(-50%);
  transition: background-color 160ms ease;
}

.progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 16px;
  height: 16px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 7px rgba(23, 32, 38, 0.18);
  transform: translate(-50%, -50%);
  transition: box-shadow 120ms ease, transform 120ms ease;
}

.audio-progress:hover .progress-thumb,
.audio-progress:focus-visible .progress-thumb {
  box-shadow: 0 0 0 3px rgba(15, 139, 141, 0.08), 0 2px 7px rgba(23, 32, 38, 0.18);
  transform: translate(-50%, -50%) scale(1.02);
}

.audio-progress:hover::before,
.audio-progress:focus-visible::before {
  background: #cbd6d8;
}

.audio-progress:hover .progress-fill,
.audio-progress:focus-visible .progress-fill {
  background: var(--accent-dark);
}

.audio-progress:focus-visible {
  outline: 0;
}

.audio-progress:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.audio-meta {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.audio-meta div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.audio-meta span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.audio-meta strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

audio {
  display: none;
}

.vocab-page {
  display: grid;
  gap: 18px;
}

.lookup-page {
  display: grid;
  gap: 18px;
}

.vocab-header,
.vocab-results-header,
.vocab-card-top,
.vocab-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.vocab-header {
  padding-bottom: 4px;
}

.vocab-header .quiet {
  max-width: 680px;
}

.compact-row {
  margin-top: 0;
}

.vocab-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.vocab-side {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 16px;
}

.vocab-generator,
.vocab-results-panel,
.vocab-card,
.vocab-saved-panel,
.lookup-page-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.vocab-generator,
.vocab-results-panel,
.vocab-saved-panel,
.lookup-page-card {
  padding: 18px;
}

.vocab-generator {
  display: grid;
  gap: 16px;
}

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

.vocab-submit {
  width: 100%;
  min-height: 50px;
}

.vocab-submit.is-loading::before {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  border: 2px solid rgba(255, 255, 255, 0.46);
  border-top-color: #fff;
  border-radius: 50%;
  content: "";
  animation: spin 800ms linear infinite;
}

.vocab-status {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.55;
}

.vocab-status.working {
  color: var(--warning);
}

.vocab-status.success {
  color: var(--success);
}

.vocab-status.error {
  color: var(--danger);
}

.vocab-results-panel {
  display: grid;
  gap: 14px;
}

.vocab-saved-panel {
  display: grid;
  gap: 12px;
}

.vocab-list-panel {
  width: 100%;
}

.vocab-saved-header,
.vocab-word-card-top,
.vocab-word-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vocab-saved-header h2 {
  margin: 0;
}

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

.vocab-search-form button {
  min-width: 64px;
  white-space: nowrap;
}

.vocab-word-list {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
  padding-right: 2px;
}

.vocab-word-list-wide {
  max-height: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.vocab-word-card {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid #d8e7e2;
  border-radius: 8px;
  background: #fbfcfc;
}

.vocab-word-title {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.2;
}

.vocab-word-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef7f5;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.vocab-word-meaning,
.vocab-word-source,
.vocab-word-stats,
.vocab-word-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.vocab-word-meaning {
  color: #34424b;
  font-weight: 800;
}

.vocab-word-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.vocab-word-card-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.vocab-word-empty {
  padding: 14px;
  border: 1px dashed #bdc9ce;
  border-radius: 8px;
  background: #fbfcfc;
  text-align: center;
}

.lookup-page-grid {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.lookup-page-form,
.lookup-result-panel,
.lookup-result-body {
  display: grid;
  gap: 14px;
}

.lookup-page-actions,
.lookup-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.lookup-page-actions .button {
  flex: 1 1 150px;
}

.lookup-search-block {
  display: grid;
  gap: 12px;
}

.lookup-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.lookup-search-control {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.lookup-search-control input,
.lookup-search-control textarea {
  height: 50px;
  padding: 0 46px 0 42px;
  border-color: #bddbd7;
  border-radius: 999px;
  background: #fbfdfd;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(15, 139, 141, 0.02);
}

.lookup-search-control textarea {
  height: auto;
  min-height: 132px;
  padding-top: 14px;
  padding-bottom: 14px;
  line-height: 1.5;
  resize: vertical;
}

.lookup-search-control input:focus,
.lookup-search-control textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(15, 139, 141, 0.14);
  outline-offset: 0;
}

.lookup-search-icon {
  position: absolute;
  top: 18px;
  left: 16px;
  width: 14px;
  height: 14px;
  border: 2px solid #78929a;
  border-radius: 999px;
  pointer-events: none;
}

.lookup-search-icon::after {
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: #78929a;
  content: "";
  transform: rotate(45deg);
  transform-origin: center;
}

.lookup-search-clear {
  position: absolute;
  top: 10px;
  right: 9px;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #e4eeed;
  color: #52676e;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.lookup-search-clear:hover,
.lookup-search-clear:focus-visible {
  background: #d6e9e6;
  color: var(--accent-dark);
  outline: 2px solid rgba(15, 139, 141, 0.18);
}

.lookup-search-cancel {
  min-height: 38px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  font-weight: 900;
  cursor: pointer;
}

.lookup-suggestions {
  display: grid;
  gap: 2px;
  max-height: 310px;
  overflow: auto;
  padding: 4px 2px 2px;
}

.lookup-suggestion-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  min-height: 44px;
  padding: 9px 4px;
  border: 0;
  border-bottom: 1px solid rgba(215, 228, 230, 0.72);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.lookup-suggestion-item:hover,
.lookup-suggestion-item:focus-visible {
  border-radius: 8px;
  background: #f2faf8;
  outline: none;
}

.lookup-suggestion-item strong {
  min-width: 0;
  max-width: min(42vw, 180px);
  overflow: hidden;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lookup-suggestion-item span {
  min-width: 0;
  overflow: hidden;
  color: #66767d;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lookup-suggestion-item em {
  color: var(--accent-dark);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.lookup-suggestion-item.is-saved em {
  color: #b38a00;
}

.lookup-suggestion-empty {
  margin: 0;
  padding: 12px 4px 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.lookup-generate-actions .button {
  width: 100%;
  min-height: 46px;
}

.lookup-options {
  border: 1px solid #d8e7e2;
  border-radius: 8px;
  background: #f8fbfa;
}

.lookup-options summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.lookup-options summary::-webkit-details-marker {
  display: none;
}

.lookup-options summary::after {
  color: var(--accent-dark);
  content: "展开";
  font-size: 13px;
  font-weight: 900;
}

.lookup-options[open] summary {
  border-bottom: 1px solid #d8e7e2;
}

.lookup-options[open] summary::after {
  content: "收起";
}

.lookup-options summary strong {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.lookup-options .vocab-control-grid {
  padding: 14px;
}

.lookup-result-header h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.18;
}

.lookup-result-title-block {
  min-width: 0;
}

.lookup-result-title-row {
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.lookup-page-results {
  width: 100%;
}

.lookup-results-controls {
  display: grid;
  gap: 10px;
}

.lookup-tts-panel,
.lookup-tts-body {
  display: grid;
  gap: 14px;
}

.lookup-tts-state.working {
  border-color: rgba(176, 124, 0, 0.24);
  background: #fff7e6;
  color: var(--warning);
}

.lookup-tts-state.success {
  border-color: rgba(19, 124, 85, 0.22);
  background: #edf8f2;
  color: var(--success);
}

.lookup-tts-state.error {
  border-color: rgba(182, 37, 37, 0.18);
  background: #fff0f0;
  color: var(--danger);
}

.lookup-tts-status {
  margin: 0;
  padding: 14px;
  border: 1px solid #d8e7e2;
  border-radius: 8px;
  background: #f8fbfa;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.6;
}

.lookup-tts-status.error {
  border-color: rgba(182, 37, 37, 0.18);
  background: #fff7f7;
  color: var(--danger);
}

.lookup-tts-copy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.lookup-tts-copy {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #d8e7e2;
  border-radius: 8px;
  background: #fbfcfc;
}

.lookup-tts-copy span {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.lookup-tts-text {
  margin: 0;
  overflow-wrap: anywhere;
  color: #26343c;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.6;
}

.lookup-tts-audio {
  display: block;
  width: 100%;
}

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

.vocab-results-header h2 {
  margin: 0;
}

.vocab-empty {
  display: grid;
  gap: 8px;
  min-height: 220px;
  place-content: center;
  padding: 24px;
  border: 1px dashed #bdc9ce;
  border-radius: 8px;
  background: #fbfcfc;
  color: var(--muted);
  text-align: center;
}

.vocab-empty strong {
  color: var(--ink);
  font-size: 18px;
}

.vocab-empty p {
  margin: 0;
  line-height: 1.65;
}

.lookup-cards-loading {
  display: grid;
  justify-items: center;
  gap: 14px;
  min-height: 220px;
  padding: 28px;
  border: 1px dashed #bdc9ce;
  border-radius: 8px;
  background: #fbfcfc;
  color: var(--muted);
  text-align: center;
}

.lookup-cards-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid #d8e7e2;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.lookup-cards-loading-copy {
  display: grid;
  gap: 6px;
  max-width: 360px;
}

.lookup-cards-loading-copy strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.lookup-cards-loading-copy p {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.6;
}

.lookup-cards-loading-bars {
  display: grid;
  gap: 8px;
  width: min(100%, 320px);
}

.lookup-cards-loading-bars span {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #edf6f4, #dcefed, #edf6f4);
  animation: loadingPulse 1.2s ease-in-out infinite;
}

.lookup-cards-loading-bars span:nth-child(2) {
  width: 86%;
  animation-delay: 120ms;
}

.lookup-cards-loading-bars span:nth-child(3) {
  width: 62%;
  animation-delay: 240ms;
}

.vocab-results {
  display: grid;
  gap: 14px;
}

.vocab-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.vocab-card-word {
  display: block;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.15;
}

.vocab-card-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.vocab-pattern-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff4df;
  color: #755000;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.vocab-sentence {
  margin: 0;
  color: #1f2b33;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.45;
}

.vocab-translation {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.65;
}

.vocab-expression-note {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid #d8e7e2;
  border-radius: 8px;
  background: #f4faf7;
}

.vocab-expression-note span {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.vocab-expression-note p {
  margin: 0;
  color: #4a5963;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}

.vocab-audio {
  display: block;
  width: 100%;
}

.vocab-card-actions {
  justify-content: flex-start;
}

.vocab-card-actions .is-saved {
  background: var(--success);
}

.vocab-library-link {
  text-decoration: none;
}

.lookup-token {
  -webkit-appearance: none;
  appearance: none;
  display: inline;
  min-height: 0;
  padding: 0 2px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-align: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(15, 139, 141, 0.34);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  white-space: normal;
  cursor: pointer;
}

.lookup-token:hover,
.lookup-token:focus-visible {
  background: #e7f5f2;
  color: var(--accent-dark);
  outline: 0;
}

html.lookup-modal-open,
body.lookup-modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.lookup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 79;
  background: rgba(23, 32, 38, 0.28);
  touch-action: none;
}

.lookup-popover {
  position: absolute;
  z-index: 80;
  display: grid;
  align-content: start;
  align-items: start;
  gap: 12px;
  width: min(420px, calc(100vw - 24px));
  max-height: min(720px, calc(100vh - 24px));
  overflow: auto;
  padding: 16px;
  border: 1px solid #c9d8dc;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(23, 32, 38, 0.18);
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.lookup-popover.is-centered {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.lookup-header,
.lookup-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lookup-header {
  position: sticky;
  top: -16px;
  z-index: 2;
  align-items: flex-start;
  padding: 16px 0 10px;
  margin-top: -16px;
  border-bottom: 1px solid #edf2f3;
  background: #fff;
}

.lookup-header h2 {
  margin: 2px 0 0;
  font-size: 26px;
  line-height: 1.12;
}

.lookup-title-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.lookup-title-row h2 {
  min-width: 0;
  overflow-wrap: anywhere;
}

.lookup-term-sound {
  display: inline;
  min-height: 0;
  padding: 0 2px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-align: left;
  cursor: pointer;
}

.lookup-term-sound:hover:not(:disabled) {
  background: transparent;
  color: var(--accent-dark);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.lookup-term-sound:focus-visible {
  outline: 3px solid rgba(15, 139, 141, 0.22);
  outline-offset: 2px;
}

.lookup-term-sound.is-speaking {
  color: var(--accent);
}

.lookup-term-sound.is-speaking::after {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 6px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: middle;
  content: "";
}

.lookup-favorite-star {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #f7fbfa;
  color: #b38a00;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease, color 140ms ease;
}

.lookup-favorite-star:hover:not(:disabled),
.lookup-favorite-star:focus-visible {
  border-color: #efd37a;
  background: #fff8dc;
  color: #d79a00;
  outline: 3px solid rgba(242, 182, 0, 0.18);
  outline-offset: 2px;
  transform: translateY(-1px);
}

.lookup-favorite-star.is-saved {
  border-color: #f1cb55;
  background: linear-gradient(180deg, #fff8d8 0%, #fff1a9 100%);
  color: #e2a500;
  box-shadow: inset 0 -1px 0 rgba(187, 122, 0, 0.14), 0 3px 10px rgba(242, 182, 0, 0.16);
}

.lookup-favorite-star:disabled {
  opacity: 0.7;
  cursor: default;
  transform: none;
}

.lookup-star-icon {
  width: 23px;
  height: 23px;
  overflow: visible;
}

.lookup-star-icon path:first-child {
  fill: rgba(255, 255, 255, 0.62);
  stroke: currentColor;
  stroke-width: 2;
}

.lookup-favorite-star.is-saved .lookup-star-icon path:first-child {
  fill: #ffd95a;
  stroke: #c68a00;
  stroke-width: 1.8;
}

.lookup-star-shine {
  fill: none;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 1.8;
}

.lookup-eyebrow {
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.lookup-icon-button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

.lookup-meta-line,
.lookup-chip-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.lookup-meta-line span,
.lookup-meta-sound,
.lookup-chip-row > span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #eef7f5;
  color: var(--accent-dark);
}

.lookup-meta-line {
  align-items: center;
  gap: 6px;
}

.lookup-meta-line span,
.lookup-meta-sound {
  min-height: 22px;
  padding: 1px 7px;
  border: 1px solid #dbe9e8;
  border-radius: 6px;
  background: #f6faf9;
  color: #46636a;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.lookup-meta-sound {
  cursor: pointer;
}

.lookup-meta-sound:hover:not(:disabled) {
  border-color: #b9d9d9;
  background: #edf8f7;
  color: var(--accent-dark);
}

.lookup-meta-sound:focus-visible {
  outline: 3px solid rgba(15, 139, 141, 0.18);
  outline-offset: 2px;
}

.lookup-meta-sound.is-speaking {
  border-color: #9ed6d7;
  background: #e4f6f6;
  color: var(--accent);
}

.lookup-chip-row > span,
.lookup-chip-row > button {
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid #dbe9e8;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.lookup-collocation-chip {
  display: inline-grid !important;
  position: relative;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  padding: 6px 10px !important;
  border: 1px solid #dbe9e8 !important;
  border-radius: 14px !important;
  background: #eef7f5 !important;
  color: var(--accent-dark) !important;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease, color 140ms ease;
}

.lookup-collocation-chip:hover,
.lookup-collocation-chip:focus-visible {
  border-color: #abd7d5 !important;
  background: #e7f5f2 !important;
  color: var(--accent-dark) !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 139, 141, 0.12);
  transform: translateY(-1px);
}

.lookup-collocation-chip.is-speaking {
  border-color: #a7d8d4 !important;
  background: linear-gradient(180deg, #f0faf8 0%, #e4f5f2 100%) !important;
  color: var(--accent-dark) !important;
  box-shadow: 0 0 0 3px rgba(15, 139, 141, 0.1), 0 6px 16px rgba(15, 139, 141, 0.08);
  transform: translateY(-1px);
}

.lookup-collocation-phrase,
.lookup-collocation-meaning {
  position: relative;
  min-width: 0;
  overflow-wrap: anywhere;
}

.lookup-collocation-phrase {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.18;
}

.lookup-collocation-meaning {
  color: #51676e;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.lookup-meaning {
  margin: 0;
  color: #1f2b33;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.6;
}

.lookup-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.lookup-primary,
.lookup-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

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

.lookup-primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

.lookup-primary:disabled {
  opacity: 0.68;
  cursor: not-allowed;
}

.lookup-secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent-dark);
}

.lookup-secondary:hover {
  background: #edf6f4;
}

.lookup-secondary[aria-disabled="true"] {
  color: var(--muted);
  opacity: 0.7;
  pointer-events: none;
}

.lookup-status {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.55;
}

.lookup-status.working {
  color: var(--warning);
}

.lookup-status.success {
  color: var(--success);
}

.lookup-status.error {
  color: var(--danger);
}

.hint {
  margin: 12px 0 0;
  color: var(--muted);
}

.download {
  display: inline-block;
  margin-top: 14px;
  color: var(--accent-dark);
  font-weight: 700;
}

.favorite-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.favorite-actions .download {
  margin-top: 0;
}

.compact-action {
  min-height: 40px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 800;
}

.favorite-status,
.library-message {
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.favorite-status.success,
.library-message.success {
  color: var(--success);
}

.favorite-status.error,
.library-message.error {
  color: var(--danger);
}

.library-page {
  display: grid;
  gap: 18px;
}

.library-header,
.library-toolbar,
.audio-card-header,
.audio-card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.library-header,
.audio-card-header {
  justify-content: space-between;
}

.library-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto max-content;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.library-toolbar input {
  min-width: 0;
}

.library-toolbar > button[type="submit"] {
  min-width: 76px;
  white-space: nowrap;
}

.play-mode-field {
  display: grid;
  grid-template-columns: auto minmax(120px, 150px);
  align-items: center;
  gap: 8px;
  justify-self: end;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.play-mode-field select {
  padding: 10px 12px;
}

.audio-library-list {
  display: grid;
  gap: 14px;
}

.audio-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.audio-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.audio-card.is-playing {
  border-color: #9ed6d7;
  box-shadow: 0 16px 42px rgba(15, 139, 141, 0.12);
}

.audio-card.is-highlighted {
  border-color: var(--accent);
  box-shadow: 0 18px 46px rgba(15, 139, 141, 0.18);
}

.audio-card h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.audio-card-date {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.audio-card-actions {
  position: relative;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.audio-more-menu {
  position: relative;
  display: inline-flex;
}

.audio-more-trigger {
  min-width: 44px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--accent-dark);
  font-size: 19px;
  line-height: 1;
}

.audio-more-trigger:hover:not(:disabled) {
  border-color: #9ed6d7;
  background: #edf6f4;
  color: var(--accent-dark);
}

.audio-more-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: grid;
  min-width: 112px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(23, 32, 38, 0.16);
}

.audio-more-dropdown[hidden] {
  display: none;
}

.audio-menu-item {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.audio-menu-item:hover,
.audio-menu-item:focus-visible {
  background: #edf6f4;
  outline: none;
}

.audio-wave-player {
  --wave-progress: 0%;
  --wave-edge-inset: 12px;
  display: grid;
  grid-template-columns: 44px 46px minmax(0, 1fr) 46px;
  align-items: center;
  gap: 10px;
  min-height: 74px;
  padding: 12px;
  border: 1px solid #d8e6e7;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(245, 249, 249, 0.96)),
    #f5f8f8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.audio-wave-player.is-playing {
  border-color: #b6dddd;
  background:
    linear-gradient(180deg, rgba(251, 255, 255, 0.92), rgba(233, 247, 247, 0.96)),
    #eefafa;
}

.audio-wave-play {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(23, 32, 38, 0.18);
}

.audio-wave-play:hover {
  background: var(--accent-dark);
}

.audio-wave-play:focus-visible,
.audio-waveform:focus-visible {
  outline: 3px solid rgba(15, 139, 141, 0.28);
  outline-offset: 3px;
}

.audio-wave-play span {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
}

.audio-wave-play span::before {
  position: absolute;
  top: 50%;
  left: 54%;
  width: 14px;
  height: 16px;
  border: 0;
  background: currentColor;
  clip-path: polygon(18% 8%, 18% 92%, 88% 50%);
  transform: translate(-50%, -50%);
  content: "";
}

.audio-wave-player.is-playing .audio-wave-play span::before,
.audio-wave-player.is-playing .audio-wave-play span::after {
  top: 2px;
  width: 4px;
  height: 14px;
  border: 0;
  border-radius: 2px;
  background: currentColor;
  clip-path: none;
  transform: none;
  content: "";
}

.audio-wave-player.is-playing .audio-wave-play span::before {
  left: 4px;
}

.audio-wave-player.is-playing .audio-wave-play span::after {
  position: absolute;
  left: 10px;
}

.audio-wave-time {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.audio-waveform {
  position: relative;
  min-width: 0;
  height: 48px;
  border-radius: 999px;
  background: #eaf1f1;
  cursor: pointer;
  overflow: hidden;
}

.audio-waveform-track {
  position: absolute;
  inset: 8px var(--wave-edge-inset);
}

.audio-waveform-bars,
.audio-waveform-fill {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(48, minmax(2px, 1fr));
  align-items: center;
  gap: 3px;
  pointer-events: none;
}

.audio-waveform-fill {
  clip-path: inset(0 calc(100% - var(--wave-progress)) 0 0);
}

.audio-waveform-bars span,
.audio-waveform-fill span {
  height: var(--bar-height);
  min-height: 4px;
  border-radius: 999px;
}

.audio-waveform-bars span {
  background: #b5c8c9;
}

.audio-waveform-fill span {
  background: var(--accent);
}

.audio-waveform-playhead {
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: var(--wave-progress);
  width: 3px;
  border-radius: 999px;
  background: #20323a;
  opacity: 0.9;
  transform: translateX(-50%);
  pointer-events: none;
  transition: opacity 140ms ease;
}

.audio-wave-player:not(.is-playing) .audio-waveform-playhead {
  opacity: 0.72;
}

.audio-wave-player:not(.is-playing):not(.has-wave-progress) .audio-waveform-playhead {
  opacity: 0;
}

.audio-wave-player.is-compact {
  --wave-edge-inset: 10px;
  grid-template-columns: 38px minmax(0, 1fr) 42px;
  min-height: 56px;
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  background: #eef7f7;
  box-shadow: none;
}

.audio-wave-player.is-compact .audio-wave-current {
  display: none;
}

.audio-wave-player.is-compact .audio-wave-play {
  width: 38px;
  height: 38px;
  box-shadow: 0 8px 18px rgba(23, 32, 38, 0.15);
}

.audio-wave-player.is-compact .audio-waveform {
  height: 40px;
}

.audio-wave-player.is-compact .audio-waveform-bars,
.audio-wave-player.is-compact .audio-waveform-fill {
  gap: 2px;
}

.audio-wave-player.is-compact .audio-wave-time {
  font-size: 12px;
}

.audio-text-preview,
.audio-text-full,
.audio-translation-preview,
.audio-translation-full p,
.bilingual-text-block p {
  margin: 0;
  color: #2e3a42;
  line-height: 1.75;
}

.audio-text-preview,
.audio-translation-preview {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.audio-translation-preview {
  padding-left: 12px;
  border-left: 3px solid #b7dfc7;
  color: #354b44;
}

.audio-text-full,
.audio-translation-full {
  display: none;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  white-space: pre-wrap;
}

.audio-translation-full {
  border-left: 3px solid #7dbb94;
}

.audio-translation-label {
  display: block;
  margin-bottom: 8px;
  color: var(--success);
  font-size: 13px;
  font-weight: 800;
}

.audio-card.is-expanded .audio-text-preview {
  display: none;
}

.audio-card.is-expanded .audio-translation-preview {
  display: none;
}

.audio-card.is-expanded .audio-text-full,
.audio-card.is-expanded .audio-translation-full {
  display: block;
}

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

.bilingual-text-block {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.bilingual-text-block h3 {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 14px;
}

.bilingual-text-block p {
  display: block;
  overflow: visible;
  -webkit-box-orient: initial;
  -webkit-line-clamp: unset;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.audio-card.is-expanded .bilingual-text-block p {
  display: block;
}

.audio-card audio {
  display: block;
  width: 100%;
}

audio.native-audio-player {
  display: none;
}

.practice-panel-mount:empty {
  display: none;
}

.practice-panel {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid #cce8e8;
  border-radius: 12px;
  background: #f0fbfb;
}

.practice-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.practice-title-block {
  min-width: 0;
}

.practice-title-block h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 18px;
}

.practice-title-icon {
  position: relative;
  width: 16px;
  height: 22px;
  flex: 0 0 16px;
  border: 2px solid currentColor;
  border-radius: 10px;
}

.practice-title-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 2px;
  height: 6px;
  background: currentColor;
  transform: translateX(-50%);
}

.practice-title-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translateX(-50%);
}

.practice-title-block p,
.practice-muted,
.practice-score-empty p,
.practice-feedback p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.practice-title-block p {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.48;
}

.practice-collapse-button,
.practice-text-toggle {
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  font-weight: 800;
  cursor: pointer;
}

.practice-collapse-button:hover:not(:disabled),
.practice-text-toggle:hover:not(:disabled) {
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
}

.practice-collapse-button {
  min-height: 36px;
  white-space: nowrap;
}

.practice-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 14px;
}

.practice-column {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.practice-section {
  min-width: 0;
  padding: 14px;
  border: 1px solid #d7eeee;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.practice-section h4 {
  margin: 0 0 10px;
  color: #21343a;
  font-size: 15px;
}

.practice-button-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.practice-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.practice-button:hover {
  background: var(--accent-dark);
}

.practice-button.secondary {
  border-color: #b9d9d9;
  background: #fff;
  color: var(--accent-dark);
}

.practice-button.secondary:hover {
  background: #e9f7f7;
}

.practice-button.danger,
.practice-button.danger-soft {
  background: var(--danger);
}

.practice-button.danger-soft {
  border-color: #efc0bb;
  background: #fff4f2;
  color: var(--danger);
}

.practice-button:disabled {
  border-color: #d7e1e2;
  background: #e9eeee;
  color: #829095;
  cursor: not-allowed;
}

.practice-timer {
  min-width: 54px;
  color: var(--danger);
  font-size: 15px;
  font-weight: 900;
}

.practice-recording-audio {
  margin-top: 12px;
  max-width: 100%;
}

.practice-recording-playback {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e0eeee;
  border-radius: 8px;
  background: #fbffff;
}

.practice-recording-playback h4 {
  margin: 0;
  color: #20323a;
  font-size: 14px;
}

.practice-recording-playback audio {
  width: 100%;
}

.practice-recording-playback audio.native-audio-player {
  display: none;
}

.practice-recording-playback .audio-wave-player {
  width: 100%;
}

.practice-recording-playback.is-history {
  padding: 10px;
}

.practice-error {
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid #f0b8b2;
  border-radius: 8px;
  background: #fff4f2;
  color: var(--danger);
  font-weight: 700;
  line-height: 1.6;
}

.practice-text-wrap {
  position: relative;
  min-width: 0;
}

.practice-text-toggle {
  float: right;
  min-height: 30px;
  padding-left: 10px;
}

.practice-reference-text {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #20323a;
  font-size: 15px;
  line-height: 1.85;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.practice-reference-text.is-expanded {
  display: block;
}

.practice-score-section {
  background: #ffffff;
}

.practice-score-empty {
  padding: 12px;
  border: 1px dashed #b9d9d9;
  border-radius: 8px;
  background: #f8ffff;
}

.practice-score-empty strong {
  display: block;
  margin-bottom: 4px;
  color: #28434a;
}

.practice-score-layout {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.practice-overall-score {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 132px;
  border-radius: 10px;
  background: #e4f6f6;
  color: var(--accent-dark);
}

.practice-overall-score strong {
  font-size: 42px;
  line-height: 1;
}

.practice-overall-score span {
  margin-top: 6px;
  font-weight: 900;
}

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

.practice-score-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #d7eeee;
  border-radius: 8px;
  background: #fbffff;
}

.practice-score-metric span {
  color: var(--muted);
  font-weight: 800;
}

.practice-score-metric strong {
  color: #20323a;
  white-space: nowrap;
}

.practice-feedback {
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
  background: #f6fbfb;
}

.practice-feedback summary {
  color: var(--accent-dark);
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.practice-feedback p {
  margin-top: 8px;
}

.practice-feedback h4 {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 15px;
}

.practice-panel {
  gap: 12px;
  padding: 16px 18px;
  border-color: #bfe5e7;
  border-radius: 10px;
  background: #f2fcfc;
  box-shadow: none;
}

.practice-panel-header {
  display: block;
}

.practice-title-block h3 {
  font-size: 17px;
}

.practice-empty-line {
  color: var(--muted);
  font-weight: 800;
}

.practice-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid #d3ecec;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.practice-summary-item {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px 14px;
  border-right: 1px solid #d3ecec;
}

.practice-summary-item:last-child {
  border-right: 0;
}

.practice-summary-item span,
.practice-summary-item small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.practice-summary-item strong {
  color: var(--accent-dark);
  font-size: 18px;
  line-height: 1.2;
}

.practice-live,
.practice-submitting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid #d3ecec;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.practice-live-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #20323a;
}

.practice-waveform {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 170px;
}

.practice-waveform span {
  width: 4px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
  animation: practiceWave 860ms ease-in-out infinite;
}

.practice-waveform span:nth-child(2n) {
  height: 22px;
  animation-delay: 80ms;
}

.practice-waveform span:nth-child(3n) {
  height: 30px;
  animation-delay: 160ms;
}

@keyframes practiceWave {
  0%,
  100% {
    transform: scaleY(0.55);
    opacity: 0.58;
  }

  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

.practice-submitting p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.practice-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #cce8e8;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: practiceSpin 800ms linear infinite;
}

@keyframes practiceSpin {
  to {
    transform: rotate(360deg);
  }
}

.practice-score-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d3ecec;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.practice-score-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.practice-score-card-header h4 {
  margin: 0;
  color: #20323a;
  font-size: 15px;
}

.practice-score-grid {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.practice-total-score {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 96px;
  border-right: 1px solid #d3ecec;
  color: var(--accent-dark);
}

.practice-total-score span,
.practice-total-score small {
  color: var(--muted);
  font-weight: 900;
}

.practice-total-score strong {
  font-size: 44px;
  line-height: 1;
}

.practice-score-card .practice-score-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.practice-score-card .practice-score-metric {
  align-items: center;
  padding: 10px;
  background: #f8ffff;
}

.practice-score-card .practice-score-metric strong {
  color: var(--accent-dark);
  font-size: 20px;
}

.practice-score-card.is-compact {
  gap: 8px;
  padding: 10px 12px;
}

.practice-score-card.is-compact .practice-score-card-header h4 {
  color: #40505a;
  font-size: 14px;
}

.practice-delete-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.practice-delete-button.is-confirming {
  background: var(--danger);
  color: #fff;
}

.practice-compact-score-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.practice-compact-total {
  margin-right: 2px;
  color: var(--accent-dark);
  font-size: 24px;
  line-height: 1;
}

.practice-compact-score-metric {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid #d3ecec;
  border-radius: 999px;
  background: #f8ffff;
  color: #4e5d66;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.practice-compact-feedback {
  min-width: 0;
}

.practice-compact-feedback summary {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.practice-compact-feedback p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

.practice-feedback {
  margin-top: 0;
  padding: 12px;
  border: 1px solid #e0eeee;
  background: #fbffff;
}

.practice-score-card.is-compact .practice-feedback {
  padding: 10px 12px;
}

.practice-score-card.is-compact .practice-feedback summary {
  font-size: 13px;
}

.practice-score-card.is-compact .practice-feedback p {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

.practice-saved-note {
  margin: 0;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.practice-history-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  justify-content: flex-end;
  background: rgba(23, 32, 38, 0.22);
}

.practice-history-drawer {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(460px, 100%);
  height: 100%;
  padding: 22px;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: -18px 0 42px rgba(23, 32, 38, 0.16);
}

.practice-history-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.practice-history-header h3 {
  margin: 0 0 4px;
}

.practice-history-header p,
.practice-history-tip {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.practice-history-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f3f7f7;
  color: #41545c;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.practice-history-close:hover:not(:disabled) {
  background: #e7f2ef;
  color: var(--accent-dark);
}

.practice-history-list {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
}

.practice-history-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #d3ecec;
  border-radius: 8px;
  background: #fbffff;
}

.practice-history-item-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
}

.practice-history-item strong {
  color: var(--accent-dark);
  font-size: 18px;
}

.practice-history-delete {
  justify-self: end;
}

.practice-history-badges,
.practice-history-item time,
.practice-history-item p,
.practice-history-item summary {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.practice-history-item p {
  margin: 0;
}

.practice-history-item details p {
  margin-top: 6px;
  font-weight: 700;
  line-height: 1.6;
}

.empty-state {
  padding: 28px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.hidden {
  display: none;
}

@media (max-width: 900px) {
  .admin-body {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-grid,
  .grid-form,
  .admin-filter-form,
  .detail-list {
    grid-template-columns: 1fr;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .hero h1,
  .narrow-panel h1 {
    font-size: 34px;
  }

  .section-grid {
    grid-template-columns: 1fr;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .vocab-workspace {
    grid-template-columns: 1fr;
  }

  .lookup-page-grid,
  .vocab-word-list-wide {
    grid-template-columns: 1fr;
  }

  .vocab-side {
    position: static;
  }

}

@media (max-width: 640px) {
  .page {
    width: min(100% - 20px, 1080px);
    padding-top: 28px;
  }

  .panel {
    padding: 18px;
  }

  .admin-main,
  .admin-sidebar {
    padding: 16px;
  }

  .admin-nav {
    grid-template-columns: 1fr;
  }

  .admin-panel {
    padding: 16px;
  }

  .site-header,
  .site-main,
  .site-footer {
    width: min(100% - 20px, 1080px);
  }

  .site-main {
    padding-top: 14px;
  }

  .site-footer {
    align-items: center;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 24px;
  }

  .hero {
    padding-top: 34px;
  }

  .hero h1,
  .narrow-panel h1 {
    font-size: 30px;
  }

  .lead {
    font-size: 18px;
  }

  textarea {
    height: 160px;
    min-height: 160px;
  }

  .narrow-panel {
    padding: 20px;
  }

  .status-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar {
    align-items: flex-start;
    padding-bottom: 16px;
  }

  .topbar-actions .nav-link {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 13px;
  }

  .library-header,
  .vocab-header,
  .vocab-results-header,
  .audio-card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .vocab-control-grid {
    grid-template-columns: 1fr;
  }

  .vocab-card-top,
  .vocab-card-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .vocab-card-actions {
    gap: 8px;
  }

  .vocab-card-actions .small-button {
    min-height: 36px;
    padding: 0 12px;
    font-size: 13px;
  }

  .lookup-page-actions,
  .lookup-result-header {
    align-items: stretch;
    flex-direction: column;
  }

  .lookup-page-actions .button {
    width: 100%;
    min-height: 48px;
    flex: 0 0 auto;
  }

  .lookup-search-block {
    gap: 10px;
  }

  .lookup-search-row {
    gap: 8px;
  }

  .lookup-search-control input,
  .lookup-search-control textarea {
    height: 46px;
    padding-left: 38px;
    padding-right: 42px;
    font-size: 16px;
  }

  .lookup-search-control textarea {
    height: auto;
    min-height: 150px;
    padding-top: 13px;
    padding-bottom: 13px;
  }

  .lookup-search-icon {
    left: 14px;
    width: 13px;
    height: 13px;
  }

  .lookup-search-clear {
    right: 8px;
    width: 28px;
    height: 28px;
    min-height: 28px;
  }

  .lookup-search-cancel {
    min-width: 42px;
    font-size: 15px;
  }

  .lookup-suggestions {
    max-height: 360px;
  }

  .lookup-suggestion-item {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 42px;
    padding: 8px 2px;
  }

  .lookup-suggestion-item strong {
    max-width: min(46vw, 170px);
    font-size: 17px;
  }

  .lookup-suggestion-item span {
    font-size: 13px;
  }

  .lookup-suggestion-item em {
    display: none;
  }

  .lookup-options summary {
    display: grid;
    grid-template-columns: 1fr auto auto;
    min-height: 48px;
  }

  .lookup-options summary strong {
    min-width: 0;
    white-space: normal;
    text-align: right;
  }

  .lookup-result-header .button {
    width: 100%;
  }

  .lookup-tts-copy-grid {
    grid-template-columns: 1fr;
  }

  .lookup-tts-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .lookup-tts-actions .small-button {
    width: 100%;
  }

  .vocab-sentence {
    font-size: 19px;
  }

  .lookup-backdrop {
    background: rgba(23, 32, 38, 0.42);
  }

  .lookup-popover {
    position: fixed;
    top: max(18px, env(safe-area-inset-top)) !important;
    right: auto;
    bottom: auto;
    left: 50% !important;
    width: min(360px, calc(100vw - 32px));
    max-height: calc(100vh - 36px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding: 14px;
    border-radius: 12px;
    box-shadow: 0 18px 54px rgba(23, 32, 38, 0.26);
    transform: translateX(-50%);
  }

  .lookup-popover.is-centered {
    transform: translateX(-50%);
  }

  .lookup-header {
    top: -14px;
    padding: 14px 0 9px;
    margin-top: -14px;
  }

  .lookup-header h2 {
    font-size: 23px;
    overflow-wrap: anywhere;
  }

  .lookup-meaning {
    font-size: 16px;
  }

  .lookup-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .lookup-primary,
  .lookup-secondary {
    width: 100%;
    min-height: 42px;
  }

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

  .play-mode-field {
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
    grid-template-columns: auto minmax(120px, 220px);
  }

  .play-mode-field select {
    max-width: none;
  }

  .audio-card-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .audio-more-menu {
    margin-left: auto;
  }

  .audio-wave-player {
    --wave-edge-inset: 10px;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 9px;
    min-height: 68px;
    padding: 10px;
    border-radius: 16px;
  }

  .audio-wave-current {
    display: none;
  }

  .audio-wave-play {
    width: 42px;
    height: 42px;
  }

  .audio-waveform {
    height: 46px;
  }

  .audio-waveform-bars,
  .audio-waveform-fill {
    gap: 2px;
  }

  .bilingual-texts {
    grid-template-columns: 1fr;
  }

  .small-button,
  .practice-button {
    min-height: 44px;
  }

  .vocab-card-actions .small-button {
    box-sizing: border-box;
    height: 36px;
    min-height: 36px;
    padding: 0 12px;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  .practice-panel {
    gap: 14px;
    padding: 14px;
    border-radius: 12px;
  }

  .practice-panel-header,
  .practice-grid,
  .practice-score-layout,
  .practice-score-metrics {
    grid-template-columns: 1fr;
  }

  .practice-panel-header {
    display: grid;
  }

  .practice-button-row {
    align-items: stretch;
  }

  .practice-button-row .practice-button {
    flex: 1 1 150px;
  }

  .practice-overall-score {
    min-height: 110px;
  }

  .practice-score-metric {
    align-items: flex-start;
    flex-direction: column;
  }

  .practice-summary-strip,
  .practice-score-grid,
  .practice-score-card .practice-score-metrics {
    grid-template-columns: 1fr;
  }

  .practice-summary-item {
    border-right: 0;
    border-bottom: 1px solid #d3ecec;
  }

  .practice-summary-item:last-child {
    border-bottom: 0;
  }

  .practice-live,
  .practice-submitting {
    align-items: stretch;
    flex-direction: column;
  }

  .practice-waveform {
    min-width: 0;
  }

  .practice-total-score {
    min-height: 86px;
    border-right: 0;
    border-bottom: 1px solid #d3ecec;
  }

  .practice-history-backdrop {
    align-items: flex-end;
  }

  .practice-history-drawer {
    width: 100%;
    height: min(86vh, 680px);
    padding: 18px;
    border-left: 0;
    border-top: 1px solid var(--line);
    border-radius: 14px 14px 0 0;
  }

  .practice-history-item-top {
    grid-template-columns: 1fr auto;
  }

  .practice-history-badges,
  .practice-history-item time {
    grid-column: 1;
  }

  .practice-history-delete {
    grid-column: 2;
    grid-row: 2 / span 3;
    align-self: start;
  }

  .bilingual-texts {
    grid-template-columns: 1fr;
  }

  .player-shell {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .play-toggle {
    width: 60px;
    height: 60px;
  }

  .audio-meta {
    grid-template-columns: 1fr;
  }
}
