/* PeakFour v1.0.17 — single stable Voice Analysis studio frame.
   All backend requests, recorder IDs and OpenPronounce report internals are reused.
   The genuine score overview moves into #pf117-score; idle/processing states use
   a clearly labeled neutral placeholder, not a synthetic pronunciation score. */
:root[data-pf-theme] #page-pronunciation.pf75-voice-analysis-page{
  --pf117-width:700px;
  --pf117-radius:24px;
  --pf117-gutter:clamp(16px,3vw,28px);
}
#page-pronunciation .work-column{width:100%!important;max-width:var(--pf117-width)!important;margin-inline:auto!important;padding:0 12px 24px!important;box-sizing:border-box}
#page-pronunciation.pf115-result-mode .work-column{max-width:var(--pf117-width)!important;padding:0 12px 24px!important}
/* The same heading is visible in all states; reduce the oversized introduction. */
#page-pronunciation.pf115-result-mode > .pf75-va-heading{display:flex!important}
#page-pronunciation .pf75-va-heading{
  max-width:var(--pf117-width);width:calc(100% - 24px);margin:0 auto 14px!important;
  padding:14px clamp(16px,2vw,24px)!important;display:flex;align-items:center;justify-content:space-between;
  gap:14px;min-height:0!important;box-sizing:border-box;border-radius:var(--pf117-radius)!important
}
#page-pronunciation .pf75-va-heading h1{font-size:clamp(27px,3.7vw,39px)!important;margin:5px 0!important;line-height:1.12!important}
#page-pronunciation .pf75-va-heading .pf-sw-kicker{letter-spacing:.13em!important;font-size:10px!important}
#page-pronunciation .pf75-va-heading p{font-size:12px!important;line-height:1.5!important;max-width:490px;margin:3px 0!important}
#page-pronunciation .pa76-prompt-card{display:none!important}
/* The stable result/placeholder header shares one physical DOM slot. */
:root[data-pf-theme] #page-pronunciation #pf117-score{
  width:100%;max-width:var(--pf117-width);margin:0 0 14px;padding:var(--pf117-gutter);
  min-height:139px;border-radius:var(--pf117-radius);border:1px solid var(--pa-line);
  box-sizing:border-box;background:var(--pa-panel);color:var(--pa-text);box-shadow:none;
}
#page-pronunciation .pf117-score-placeholder{display:flex;align-items:center;gap:16px;justify-content:space-between;min-height:92px}
#page-pronunciation .pf117-score-head{display:flex;flex-direction:column;align-items:flex-start;gap:5px;min-width:0;flex:1}
#page-pronunciation .pf117-score-eyebrow{font-size:10px;font-weight:750;letter-spacing:.12em;color:var(--pa-subtle)}
#page-pronunciation .pf117-score-head>strong{font-size:clamp(17px,2.5vw,22px);line-height:1.3;color:var(--pa-text)}
#page-pronunciation .pf117-score-head p{font-size:11px;line-height:1.4;margin:0;color:var(--pa-muted)}
#page-pronunciation .pf117-word-list{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}
#page-pronunciation .pf117-neutral-word{display:flex;flex-direction:column;align-items:flex-start;gap:1px;
  min-width:0;padding:5px 8px;border-radius:9px;border:1px solid var(--pa-line);background:var(--pa-raised);color:var(--pa-text)}
#page-pronunciation .pf117-neutral-word strong{font-size:12px;line-height:1.3;font-weight:700}
#page-pronunciation .pf117-neutral-word small{font-size:9px;font-weight:400;color:var(--pa-muted)}
#page-pronunciation .pf117-score-empty{flex:0 0 92px;width:92px;height:92px;display:flex;flex-direction:column;
  justify-content:center;align-items:center;gap:1px;border:6px solid var(--pa-ring-track);border-radius:50%;box-sizing:border-box}
#page-pronunciation .pf117-score-empty strong{font-size:30px;line-height:1;font-weight:800;color:var(--pa-text)}
#page-pronunciation .pf117-score-empty span{font-size:8px;font-weight:700;letter-spacing:.045em;color:var(--pa-muted);text-align:center}
/* The real score/word elements come directly from OpenPronounce's rendered report. */
#page-pronunciation #pf117-score>.pfux-overview{display:flex!important;flex-direction:row-reverse!important;align-items:center!important;
  gap:18px!important;justify-content:space-between!important;padding:0!important;background:transparent!important;border:0!important;
  border-radius:0!important;min-height:92px;color:var(--pa-text)!important;box-shadow:none!important}
#page-pronunciation #pf117-score>.pfux-overview .pfux-ring{flex:0 0 92px;width:92px;height:92px;
  background:radial-gradient(circle at center,var(--pa-panel) 0 64%,transparent 66%),
    conic-gradient(var(--color) calc(var(--value)*1%),var(--pa-ring-track) 0)!important}
#page-pronunciation #pf117-score>.pfux-overview .pfux-ring strong{font-size:27px!important;line-height:1!important}
#page-pronunciation #pf117-score>.pfux-overview .pfux-ring small{font-size:8px!important}
#page-pronunciation #pf117-score>.pfux-overview .pfux-summary{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}
#page-pronunciation #pf117-score>.pfux-overview .pfux-summary h3{font-size:clamp(17px,2.5vw,22px)!important;line-height:1.25!important;margin:0!important}
#page-pronunciation #pf117-score>.pfux-overview .pfux-summary .pfux-eyebrow{font-size:10px;letter-spacing:.12em}
#page-pronunciation #pf117-score>.pfux-overview .pfux-summary p,#page-pronunciation #pf117-score .pfux-color-legend{display:none!important}
#page-pronunciation #pf117-score>.pfux-overview .pfux-chips{display:flex;flex-wrap:wrap;gap:6px;margin:3px 0 0}
#page-pronunciation #pf117-score>.pfux-overview .pfux-word{font-size:12px!important;min-height:34px;padding:5px 8px;
  border-radius:9px;background:var(--pa-raised)!important;border:1px solid var(--pa-line)!important;color:var(--pa-text)!important}
/* Both phases use the exact same main-card metrics. */
:root[data-pf-theme] #page-pronunciation #practice,
:root[data-pf-theme] #page-pronunciation #result.pf96-unified-active .pfux-report.pfux-compact,
:root[data-pf-theme] #page-pronunciation #loading,
:root[data-pf-theme] #page-pronunciation #error{
  width:100%!important;max-width:var(--pf117-width)!important;min-height:390px;
  margin:0!important;padding:var(--pf117-gutter)!important;border-radius:var(--pf117-radius)!important;
  border:1px solid var(--pa-line)!important;background:var(--pa-panel)!important;box-sizing:border-box!important;
  color:var(--pa-text)!important;box-shadow:none!important
}
#page-pronunciation #practice>.panel-topline{display:none}
#page-pronunciation #practice .practice-heading{margin:0 0 12px;padding:0!important}
#page-pronunciation #practice .practice-heading h2{font-size:clamp(19px,2.8vw,23px)!important;margin:0!important}
#page-pronunciation #practice .practice-heading p{font-size:12px!important;margin:5px 0!important}
#page-pronunciation #practice .decorative-spark{display:none}
#page-pronunciation #practice .sentence-card{background:transparent!important;border:0!important;box-shadow:none!important;
  padding:0!important;margin:0 0 12px!important}
#page-pronunciation #practice .sentence-card-header{margin:0 0 8px}
#page-pronunciation #practice #expected-text{
  display:block;width:100%;min-height:86px;max-height:190px;resize:vertical;
  padding:13px 15px!important;border:1px solid var(--pa-line)!important;border-radius:13px!important;
  font:800 clamp(25px,4vw,37px)/1.35 Inter,system-ui,sans-serif!important;
  letter-spacing:-.035em!important;background:var(--pa-surface)!important;color:var(--pa-text)!important;
  box-sizing:border-box!important
}
#page-pronunciation .pf117-examples{margin:7px 0 12px;border-bottom:1px solid var(--pa-line);padding:0 0 9px}
#page-pronunciation .pf117-examples summary{width:max-content;cursor:pointer;font:650 12px Inter,system-ui,sans-serif;color:var(--pa-accent);padding:3px 0}
#page-pronunciation .pf117-examples .examples-wrap{margin-top:8px}
#page-pronunciation .pf117-examples .examples-title{display:none}
#page-pronunciation .pf117-examples #examples{gap:7px}
#page-pronunciation #practice .action-row{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:9px!important;margin:14px 0 0!important}
#page-pronunciation #practice .action-row .soft-action{min-width:0;min-height:55px;padding:8px!important;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;
  font:700 12px Inter,system-ui,sans-serif;border-radius:13px!important;white-space:normal;text-align:center}
#page-pronunciation #practice .action-row .soft-action svg{width:20px;height:20px;color:var(--pa-accent)}
#page-pronunciation #practice .action-row .soft-action:disabled{opacity:.48;cursor:not-allowed}
#page-pronunciation #practice .record-panel{margin:10px 0 0!important;padding:0!important;border:0!important;
  background:transparent!important;box-shadow:none!important}
#page-pronunciation #practice .record-panel-top{display:none}
#page-pronunciation #practice .record-stage{display:flex!important;flex-direction:column!important;align-items:center!important;
  justify-content:center!important;gap:7px!important;padding:12px 0 8px!important}
#page-pronunciation #practice .mic-halo{display:grid;place-items:center;margin:0!important;padding:0!important;box-shadow:none!important}
#page-pronunciation #practice .mic-halo-middle{display:grid;place-items:center;margin:0!important;padding:0!important}
#page-pronunciation #practice #record-btn{width:90px!important;height:90px!important;background:#2563eb!important;
  box-shadow:none!important;border:1px solid rgba(255,255,255,.1)!important}
#page-pronunciation #practice #record-btn.is-recording{background:#d55360!important}
#page-pronunciation #practice .record-copy{text-align:center!important;max-width:100%;padding:0!important}
#page-pronunciation #practice .record-copy strong{font-size:13px!important;font-weight:700}
#page-pronunciation #practice .record-copy p{font-size:12px!important;line-height:1.5!important;margin:2px 0!important}
#page-pronunciation #practice .record-settings{justify-content:center;margin:8px 0 0!important;padding:0!important;gap:8px}
#page-pronunciation #practice .record-mode-hint{text-align:center;font-size:10px!important;margin:4px 0 0!important}
#page-pronunciation #practice .audio-review{border-top:1px solid var(--pa-line);margin-top:12px;padding-top:12px}
#page-pronunciation #practice .audio-review-controls audio{max-width:100%;min-width:0}
/* Result and input stay aligned by sharing the same 700 px stage card. */
#page-pronunciation.pf115-result-mode #practice{display:none!important}
#page-pronunciation #result.pf96-unified-active{max-width:var(--pf117-width)!important;margin:0!important}
#page-pronunciation #result.pf96-unified-active .pfux-compact-focus{
  border-top:0!important;margin:0!important;padding:0 0 12px!important;gap:11px
}
#page-pronunciation #result.pf96-unified-active .pfux-compact .pfux-compact-phrase{font-size:clamp(25px,4vw,37px)!important}
#page-pronunciation #result.pf96-unified-active .pfux-compact .pfux-compact-actions{gap:9px;margin-top:5px}
#page-pronunciation #result.pf96-unified-active .pfux-compact .pfux-compact-action{min-height:55px!important;border-radius:13px}
#page-pronunciation #result.pf96-unified-active .pfux-compact .pfux-compact-mic-zone{margin:8px 0 0;padding:12px 0 0;gap:7px}
#page-pronunciation #result.pf96-unified-active .pfux-compact .pfux-compact-mic{width:90px;height:90px;box-shadow:none}
/* Processing/error occupy the same content area as the other two phases. */
#page-pronunciation[data-practice-stage="loading"] #practice,
#page-pronunciation[data-practice-stage="error"] #practice{display:none!important}
#page-pronunciation #loading .loading-header,#page-pronunciation #error{align-content:center}
#page-pronunciation #loading .loading-header{margin:30px 0 20px}
@media(max-width:540px){
 #page-pronunciation .work-column,#page-pronunciation.pf115-result-mode .work-column{padding:0 8px 14px!important}
 #page-pronunciation .pf75-va-heading{width:calc(100% - 16px);margin-bottom:10px!important;padding:13px 14px!important;flex-wrap:wrap}
 #page-pronunciation .pf75-va-heading h1{font-size:27px!important}
 #page-pronunciation #pf117-score{min-height:125px}
 #page-pronunciation #pf117-score>.pfux-overview{gap:11px!important}
 #page-pronunciation #pf117-score>.pfux-overview .pfux-ring{width:76px;height:76px;flex-basis:76px}
 #page-pronunciation #pf117-score>.pfux-overview .pfux-ring strong{font-size:22px!important}
 #page-pronunciation .pf117-score-empty{width:76px;height:76px;flex-basis:76px}
 #page-pronunciation .pf117-score-head>strong{font-size:16px}
 #page-pronunciation .pf117-neutral-word small{font-size:8px}
 #page-pronunciation #practice .action-row{gap:6px!important}
 #page-pronunciation #practice .action-row .soft-action{min-height:60px;padding:7px 3px!important;font-size:10.5px}
 #page-pronunciation #practice #record-btn{width:82px!important;height:82px!important}
 #page-pronunciation #result.pf96-unified-active .pfux-compact .pfux-compact-mic{width:82px;height:82px}
}
@media(prefers-reduced-motion:reduce){#page-pronunciation #practice .record-button{transition:none!important}}

/* Balanced vertical rhythm: keep both stages within similar heights. */
#page-pronunciation #practice .practice-heading p{display:none}
#page-pronunciation #practice .sentence-card-header{margin-bottom:5px}
#page-pronunciation #practice #expected-text{height:88px!important;min-height:88px!important;max-height:180px!important}
#page-pronunciation #practice .record-stage{gap:3px!important;padding:6px 0 3px!important}
#page-pronunciation #practice .mic-halo,#page-pronunciation #practice .mic-halo-middle{
 width:94px!important;height:94px!important;min-width:0!important;min-height:0!important;
 border:0!important;box-shadow:none!important;background:transparent!important
}
#page-pronunciation #practice .mic-halo::before,#page-pronunciation #practice .mic-halo::after,
#page-pronunciation #practice .mic-halo-middle::before,#page-pronunciation #practice .mic-halo-middle::after{display:none!important}
#page-pronunciation #practice .pf117-record-options{margin-top:8px;padding:0;text-align:center}
#page-pronunciation #practice .pf117-record-options>summary{display:inline-block;font-size:11px;font-weight:650;
 color:var(--pa-muted);cursor:pointer;padding:5px 8px;border-radius:8px}
#page-pronunciation #practice .pf117-record-options[open]>summary{color:var(--pa-accent)}
#page-pronunciation #practice .pf117-record-options .record-settings{display:flex;justify-content:center;align-items:center;margin:7px 0 0!important}
#page-pronunciation #practice .pf117-record-options .record-mode-hint{margin:5px 0 0!important}
#page-pronunciation #practice .record-copy strong{font-size:12px!important}
#page-pronunciation #practice .record-copy p{font-size:11px!important}
