.pronunciation-practice { background: var(--paper-2); }
.pronunciation-practice .practice-header {
  grid-template-columns: auto minmax(0, 1fr);
  height: 60px;
  gap: 12px;
}
.pronunciation-practice .practice-brand { min-height: 44px; width: fit-content; }
.pronunciation-practice .practice-brand b { display: block; }
.pronunciation-practice .practice-brand:focus-visible { outline: 3px solid var(--acid); outline-offset: 4px; }
.pronunciation-practice .practice-header h1 {
  margin: 0;
  color: var(--acid);
  font-size: clamp(.82rem, 2.65vw, 1rem);
  line-height: 1.35;
  text-align: end;
  overflow-wrap: anywhere;
}
.pronunciation-practice .practice-header h1 span { white-space: nowrap; }

.pronunciation-content {
  --line-inset: 12px;
  width: min(820px, calc(100% - 40px));
  margin: auto;
  padding: 22px 0 32px;
}
.pattern-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px 16px;
  padding-inline: var(--line-inset);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink);
}
.pattern-toolbar:has(#pattern-context[hidden]):has(#pattern-nav[hidden]) { display: none; }
#pattern-context { min-width: 0; }
.pattern-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; font-size: .79rem; }
#pattern-label { font-weight: 800; }
#progress { color: #55656d; }
#pattern-title {
  margin: 5px 0 0;
  font: 700 clamp(1.14rem, 2.2vw, 1.45rem)/1.32 Georgia, "Songti SC", serif;
  overflow-wrap: anywhere;
}
.pronunciation-practice #pattern-nav { flex: none; gap: 5px; margin: 0; }
.pronunciation-practice #pattern-nav button { padding: 6px 9px; font-size: .8rem; white-space: nowrap; }
.pronunciation-practice #pattern-nav .directory-open { background: var(--acid); }
.pronunciation-practice #notice { margin: 12px var(--line-inset); color: #55656d; font-size: .87rem; }
.pronunciation-practice #notice:empty { display: none; }
.pronunciation-practice #privacy { margin: 12px var(--line-inset) 0; color: #55656d; font-size: .78rem; line-height: 1.6; }

.pronunciation-practice .example { padding: 15px var(--line-inset); border-bottom: 1px solid var(--line); }
.pronunciation-practice .example[aria-current="step"] {
  background: color-mix(in srgb, var(--acid) 13%, var(--paper-2));
  box-shadow: inset 3px 0 var(--acid-strong);
}
.pronunciation-practice .example[aria-current="step"] .example-label { color: var(--ink); font-weight: 750; }
.pronunciation-practice .example-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.pronunciation-practice .example-label,
.pronunciation-practice .example-state { font-size: .76rem; color: #55656d; }
.pronunciation-practice [data-state="recording"] .example-state { color: #a53520; font-weight: 700; }
.pronunciation-practice .sentence {
  margin: 0;
  font: 400 clamp(1.23rem, 2.35vw, 1.65rem)/1.3 Georgia, "Songti SC", serif;
  overflow-wrap: anywhere;
}
.pronunciation-practice .sentence-word {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  text-underline-offset: .14em;
}
.pronunciation-practice .sentence-word--low { background: #ffe1d9; color: #9e2622; text-decoration: underline; }
.pronunciation-practice .sentence-word--sound { color: #7a420d; text-decoration: underline 2px #be670f; }
.pronunciation-practice .sentence-word:hover,
.pronunciation-practice .sentence-word[aria-expanded="true"] { text-decoration-thickness: 3px; }
.pronunciation-practice .word-note { margin: 6px 0 0; color: #55656d; font-size: .79rem; line-height: 1.5; }
.pronunciation-practice .word-note:empty { display: none; }
.pronunciation-practice .word-legend {
  margin: 4px 0 0;
  color: #55656d;
  font-size: .77rem;
  line-height: 1.6;
}
.pronunciation-practice .translation { margin: 5px 0 9px; color: #4e626c; font-size: .85rem; line-height: 1.5; }
.pronunciation-practice .actions { display: flex; flex-wrap: wrap; gap: 5px; }
.pronunciation-practice .actions button,
.pronunciation-practice .directory-close {
  min-height: 36px;
  padding: 5px 10px;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: white;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 750;
}
.pronunciation-practice .actions button:enabled:hover,
.pronunciation-practice .directory-close:hover { background: var(--paper); }
.pronunciation-practice .actions .action-record,
.pronunciation-practice .actions .action-confirm { background: var(--acid); }
.pronunciation-practice [data-state="ready"] .actions .action-record { background: white; }
.pronunciation-practice [data-state="recording"] .actions .action-record {
  background: #ad3628;
  border-color: #ad3628;
  color: white;
}
.pronunciation-practice .actions button:disabled { cursor: default; opacity: .55; }
.pronunciation-practice .feedback { margin: 7px 0 0; color: #55656d; font-size: .78rem; line-height: 1.5; }
.pronunciation-practice .feedback:empty { display: none; }
.pronunciation-practice .feedback[data-error] { color: #912e20; }
.pronunciation-practice .example audio { display: block; width: min(100%, 360px); margin-top: 7px; }

.pronunciation-practice .score-panel { margin-top: 7px; font-size: .82rem; }
.pronunciation-practice .score-panel summary {
  width: fit-content;
  min-height: 26px;
  cursor: pointer;
  line-height: 26px;
}
.pronunciation-practice .score-panel summary:hover { text-decoration: underline; }
.pronunciation-practice .score-panel summary strong {
  box-shadow: inset 0 -.42em color-mix(in srgb, var(--sky) 64%, transparent);
}
.pronunciation-practice .scores { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 3px 0 0 14px; }
.pronunciation-practice .scores > div { display: flex; align-items: baseline; gap: 5px; }
.pronunciation-practice .scores dt { color: #55656d; }
.pronunciation-practice .scores dd { margin: 0; font-weight: 700; }
.pronunciation-practice button:focus-visible,
.pronunciation-practice input:focus-visible,
.pronunciation-practice summary:focus-visible { outline: 3px solid #38849b; outline-offset: 3px; }

.pronunciation-practice .recording-library {
  inset: 11vh 0 auto;
  inset-block-start: 11dvh;
  max-height: min(78vh, 600px);
  max-height: min(78dvh, 600px);
  margin-block: 0;
  padding: clamp(12px, 3vw, 20px);
}
.pronunciation-practice .recording-library[open] { display: flex; flex-direction: column; gap: 8px; }
.pronunciation-practice .directory-heading { align-items: center; gap: 12px; }
.pronunciation-practice .directory-heading h2 { font-size: 1.25rem; }
.pronunciation-practice #directory-search {
  width: 100%;
  min-height: 42px;
  padding: 7px 10px;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: white;
}
.pronunciation-practice #directory-status { margin: 0; color: #55656d; font-size: .8rem; }
.pronunciation-practice #directory-list {
  padding: 4px;
  margin: 0 -4px;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.pronunciation-practice .directory-item {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: 3.65em minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 7px;
  padding: 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  text-align: start;
  cursor: pointer;
}
.pronunciation-practice .directory-item:hover { background: var(--sky); }
.pronunciation-practice .directory-item[aria-current] { background: #edf4d7; }
.pronunciation-practice .directory-number, .pronunciation-practice .directory-current { font-size: .76rem; white-space: nowrap; }
.pronunciation-practice .directory-number { font-weight: 800; }
.pronunciation-practice .directory-name { line-height: 1.4; overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .pronunciation-content { --line-inset: 10px; width: calc(100% - 28px); padding-top: 16px; }
  .pattern-toolbar { display: block; padding-bottom: 9px; }
  .pronunciation-practice #pattern-nav { justify-content: start; flex-wrap: wrap; margin-top: 8px; }
  .pronunciation-practice #pattern-nav button { min-height: 40px; }
  .pronunciation-practice .actions button { min-height: 40px; }
  .pronunciation-practice .example { padding-block: 12px; }
}
