/* PeakFour IPA Academy V67: isolated presentation, keeps phoneme-study.js source/TTS contract. */
:root{--pfi-bg:#f7faff;--pfi-surface:#fff;--pfi-card:#fff;--pfi-soft:#f2f5ff;--pfi-border:#dae5f6;--pfi-ink:#17233e;--pfi-muted:#60738f;--pfi-accent:#4f46e5;--pfi-alt:#1d4ed8;--pfi-shadow:0 20px 56px rgba(35,60,109,.07)}
:root[data-pf-theme="dark"]{--pfi-bg:#0b0f19;--pfi-surface:#101827;--pfi-card:#1e293b;--pfi-soft:#26334d;--pfi-border:rgba(255,255,255,.095);--pfi-ink:#f8fafc;--pfi-muted:#bac8de;--pfi-accent:#a78bfa;--pfi-alt:#93c5fd;--pfi-shadow:0 20px 56px rgba(0,0,0,.24)}
body.pf-ipa-modal-open{overflow:hidden}
#page-listening.learning-phoneme-mode .peak-ipa-rail,#page-listening.learning-phoneme-mode .pf18-ipa-actions{display:none!important}
#page-listening.learning-phoneme-mode .listening-main{width:100%;max-width:100%;min-width:0}
#page-listening.learning-phoneme-mode #phoneme-study:not(.hidden){background:var(--pfi-bg)!important;border:1px solid var(--pfi-border)!important;border-radius:24px!important;box-shadow:none!important;color:var(--pfi-ink)!important;padding:clamp(17px,2.8vw,35px)!important;overflow:visible}
:root[data-pf-theme="dark"] #page-listening.learning-phoneme-mode #phoneme-study:not(.hidden){background:var(--pfi-bg)!important;border-color:var(--pfi-border)!important}
#page-listening.learning-phoneme-mode #phoneme-study .pf-ipa-hero{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:12px;margin:0 0 34px;border:1px solid var(--pfi-border);border-radius:22px;padding:clamp(24px,4vw,56px) clamp(16px,3vw,32px);background:radial-gradient(ellipse 70% 65% at 50% 0%,rgba(99,102,241,.13),transparent 86%),var(--pfi-surface);box-shadow:var(--pfi-shadow)}
#phoneme-study .pf-ipa-eyebrow{font-size:10px;font-weight:800;letter-spacing:.13em;color:var(--pfi-accent);text-transform:uppercase;border-radius:9px;padding:8px 12px;background:rgba(100,92,252,.095)}
#phoneme-study .pf-ipa-hero h2{font-family:Inter,'Be Vietnam Pro',system-ui,sans-serif;font-size:clamp(26px,3.75vw,53px);letter-spacing:-.045em;line-height:1.21;font-weight:850;color:var(--pfi-ink)!important;margin:0!important;max-width:1100px}
#phoneme-study .pf-ipa-hero h2 span{background:linear-gradient(95deg,#6366f1,#8b5cf6,#16a5ec);background-clip:text;-webkit-background-clip:text;color:transparent;-webkit-text-fill-color:transparent}
#phoneme-study .pf-ipa-hero>p{color:var(--pfi-muted)!important;line-height:1.7;margin:0;max-width:750px;font-size:clamp(12px,1.12vw,15px)}
#phoneme-study .pf-ipa-hero>p strong{color:var(--pfi-ink)}
#phoneme-study .pf-ipa-hero-bottom{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;margin-top:8px}
#phoneme-study .phoneme-counter{font-size:12px;font-weight:750;color:var(--pfi-alt)!important;border:1px solid var(--pfi-border);background:var(--pfi-soft);padding:12px 16px;border-radius:12px}
#phoneme-study .pf-ipa-hero-cta{font-family:inherit;border:1px solid rgba(99,102,241,.42);border-radius:12px;padding:12px 20px;font-size:12px;font-weight:800;background:linear-gradient(110deg,#4f46e5,#7c3aed);color:#fff;box-shadow:0 8px 25px rgba(85,70,227,.2);cursor:pointer;transition:transform .2s,box-shadow .2s}
#phoneme-study .pf-ipa-hero-cta:hover{transform:translateY(-2px);box-shadow:0 10px 27px rgba(85,70,227,.36)}#phoneme-study .pf-ipa-hero-cta:active{transform:scale(.97)}
#phoneme-study .pf-ipa-hero .pf-ipa-accent-disclaimer{font-size:11px!important;max-width:800px;color:var(--pfi-muted)!important;opacity:.87}
#page-listening.learning-phoneme-mode #phoneme-study .phoneme-learn-grid{display:block!important;margin:0;min-width:0}
#page-listening.learning-phoneme-mode #phoneme-study .phoneme-learn-list{display:block!important;max-height:none!important;overflow:visible!important;background:transparent!important;border:0!important;width:100%;padding:0!important;box-shadow:none!important}
#phoneme-study .pf-ipa-group{margin:0 0 35px}
#phoneme-study .pf-ipa-group-head{display:flex;align-items:center;gap:14px;margin:0 0 17px;padding:0 2px 11px;border-bottom:1px solid var(--pfi-border)}
#phoneme-study .pf-ipa-group-head h3{font-size:clamp(15px,1.45vw,19px);margin:0;color:var(--pfi-ink)!important;white-space:normal;letter-spacing:-.015em}
#phoneme-study .pf-ipa-group-head h3 span{color:var(--pfi-muted);font-weight:600;font-size:.75em;letter-spacing:.05em}
#phoneme-study .pf-ipa-group-count{margin-left:auto;flex:none;color:var(--pfi-muted);font-size:11px;border:1px solid var(--pfi-border);border-radius:99px;padding:5px 10px}
#phoneme-study .pf-ipa-tile-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:clamp(9px,1.1vw,16px)}
#phoneme-study .pf-ipa-tile{min-width:0;min-height:122px;position:relative;background:var(--pfi-card);border:1px solid var(--pfi-border);border-radius:24px;box-shadow:0 4px 18px rgba(15,23,42,.025);isolation:isolate;transition:transform .22s,border-color .22s,background .22s,box-shadow .22s;overflow:hidden}
#phoneme-study .pf-ipa-tile:hover,#phoneme-study .pf-ipa-tile:focus-within{border-color:rgba(99,102,241,.6);background:var(--pfi-soft);transform:translateY(-3px);box-shadow:0 11px 23px rgba(78,87,230,.12)}
#phoneme-study .pf-ipa-tile:active{transform:scale(.985)}
#phoneme-study .pf-ipa-tile.is-complete::after{content:'✓';position:absolute;bottom:7px;right:10px;color:#059669;font-weight:900;font-size:12px}
#phoneme-study .pf-ipa-tile-play{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%;min-height:122px;padding:20px 9px 14px;color:var(--pfi-ink);background:transparent;border:0;cursor:pointer;gap:7px}
#phoneme-study .pf-ipa-symbol{font-family:'Charis SIL','Doulos SIL','Lucida Sans Unicode','Segoe UI Symbol',system-ui,sans-serif;font-size:clamp(25px,2.45vw,34px);line-height:1.1;color:var(--pfi-ink);font-weight:750;letter-spacing:-.02em;white-space:nowrap}
#phoneme-study .pf-ipa-example{font-size:11px;line-height:1.4;letter-spacing:.085em;text-transform:uppercase;font-weight:800;color:var(--pfi-muted);overflow-wrap:anywhere;text-align:center}
#phoneme-study .pf-ipa-tile-play small{font-size:8px;font-weight:600;letter-spacing:.07em;color:var(--pfi-muted);opacity:.66}
#phoneme-study .pf-ipa-hard{position:absolute;top:7px;right:7px;z-index:1;color:#fda4af;background:rgba(244,63,94,.16);border:1px solid rgba(244,63,94,.23);border-radius:9px;padding:3px 6px;font-size:9px;font-weight:800;pointer-events:none}
:root:not([data-pf-theme="dark"]) #phoneme-study .pf-ipa-hard{color:#b91c1c}
#phoneme-study .pf-ipa-detail-open{position:absolute;left:9px;top:9px;width:25px;height:25px;min-width:25px;display:grid;place-items:center;border:1px solid var(--pfi-border);border-radius:9px;color:var(--pfi-muted);background:var(--pfi-surface);cursor:pointer;font-size:16px;opacity:.68}
#phoneme-study .pf-ipa-tile:hover .pf-ipa-detail-open,#phoneme-study .pf-ipa-detail-open:focus-visible{opacity:1;border-color:var(--pfi-accent);color:var(--pfi-accent)}
#phoneme-study .pf-ipa-board-status{font-size:12px;line-height:1.7;color:var(--pfi-muted)!important;min-height:25px;margin:4px 0 0;text-align:center}
#phoneme-study .pf-ipa-modal[hidden]{display:none!important}
#phoneme-study .pf-ipa-modal{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;padding:clamp(9px,2.3vw,25px);background:rgba(0,0,0,.2)}
#phoneme-study .pf-ipa-backdrop{position:absolute;inset:0;background:rgba(4,9,23,.79);backdrop-filter:blur(8px)}
#phoneme-study .pf-ipa-dialog-inner{position:relative;z-index:2;width:min(1140px,100%);max-height:min(94vh,94dvh);border:1px solid var(--pfi-border);border-radius:25px;display:flex;flex-direction:column;min-height:0;overflow:hidden;background:var(--pfi-surface);box-shadow:0 35px 120px rgba(0,0,0,.42);color:var(--pfi-ink)}
#phoneme-study .pf-ipa-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:13px;padding:20px clamp(16px,2.4vw,30px);border-bottom:1px solid var(--pfi-border)}
#phoneme-study .pf-ipa-dialog-head h2{font-size:clamp(19px,2vw,27px);color:var(--pfi-ink)!important;margin:9px 0 0}
#phoneme-study .pf-ipa-close{border:1px solid var(--pfi-border);background:var(--pfi-soft);color:var(--pfi-ink);border-radius:12px;font-size:26px;width:39px;height:39px;cursor:pointer;flex:none}
#phoneme-study .pf-ipa-dialog-scroll{overflow:auto;flex:1;min-height:0;padding:clamp(15px,2.4vw,29px);scrollbar-width:thin}
#phoneme-study .pf-ipa-dialog-columns{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);gap:clamp(18px,3vw,34px);min-width:0}
#phoneme-study .pf-ipa-detail-primary{background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important}
#phoneme-study .pf-ipa-kicker{color:var(--pfi-accent);font-size:10px;font-weight:850;letter-spacing:.12em}
#phoneme-study .phoneme-primary{align-items:center;gap:15px;margin:15px 0 19px;padding:18px;border-radius:17px;background:var(--pfi-soft);border:1px solid var(--pfi-border)}
#phoneme-study .phoneme-primary>strong{font-family:'Charis SIL','Lucida Sans Unicode',sans-serif;font-size:clamp(33px,4vw,50px)!important;line-height:1.1;color:var(--pfi-accent)!important;white-space:nowrap;min-width:0;background:transparent;padding:0}
#phoneme-study .phoneme-primary h3{font-size:17px!important;color:var(--pfi-ink)!important;margin:0 0 7px}
#phoneme-study .phoneme-primary p{font-size:13px;line-height:1.65;color:var(--pfi-muted)!important;margin:0}
#phoneme-study .phoneme-accent-note{border:1px solid rgba(245,158,11,.3);background:rgba(245,158,11,.1);color:var(--pfi-ink);font-size:12px;margin:0 0 17px}
#phoneme-study .pf-ipa-lesson-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:18px}
#phoneme-study .pf-ipa-lesson-head h3,#phoneme-study .pf-ipa-detail-side h3{font-size:14px;color:var(--pfi-ink)!important;font-weight:800;margin:0}
#phoneme-study #pf-ipa-choose-accent{background:var(--pfi-soft);border:1px solid var(--pfi-border);color:var(--pfi-accent);font-size:11px;font-weight:750;border-radius:10px;padding:8px 11px;cursor:pointer}
#phoneme-study .phoneme-levels{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:11px 0 13px}
#phoneme-study .phoneme-level{font-size:11px;padding:9px 6px;border:1px solid var(--pfi-border);border-radius:10px;background:var(--pfi-soft);color:var(--pfi-muted)}
#phoneme-study .phoneme-level.is-current{background:linear-gradient(100deg,#4f46e5,#7c3aed);border-color:transparent;color:#fff}
#phoneme-study .phoneme-practice-content{background:var(--pfi-soft)!important;border:1px solid var(--pfi-border)!important;border-radius:15px;padding:15px;min-height:0;margin:0!important}
#phoneme-study .phoneme-practice-content h3{font-size:14px!important;color:var(--pfi-ink)!important}
#phoneme-study .phoneme-practice-content p,#phoneme-study .phoneme-practice-content span{font-size:12px;line-height:1.65;color:var(--pfi-muted)!important}
#phoneme-study .phoneme-study-example{gap:10px;flex-wrap:wrap;padding:12px 0;border-bottom:1px solid var(--pfi-border)}
#phoneme-study .phoneme-study-example strong{min-width:55px;color:var(--pfi-ink);font-size:16px}
#phoneme-study .pf-ipa-video{margin-top:26px}
#phoneme-study .pf-ipa-video-top{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-bottom:9px}
#phoneme-study .pf-ipa-video-top>span:last-child{color:var(--pfi-muted);font-size:10px}
#phoneme-study .pf-ipa-video-frame{width:100%;aspect-ratio:16/9;background:#050815;border-radius:15px;overflow:hidden;border:1px solid var(--pfi-border)}
#phoneme-study .pf-ipa-video-frame iframe{width:100%;height:100%;border:0;display:block}
#phoneme-study .pf-ipa-load-video{width:100%;height:100%;display:flex;justify-content:center;align-items:center;position:relative;background:#060b19;border:0;cursor:pointer;color:#fff;overflow:hidden;padding:0}
#phoneme-study .pf-ipa-load-video img{width:100%;height:100%;object-fit:cover;filter:brightness(.53)}
#phoneme-study .pf-ipa-load-video span{position:absolute;z-index:1;border:1px solid #ffffff80;backdrop-filter:blur(6px);background:rgba(48,46,134,.8);border-radius:14px;padding:11px 15px;color:#fff;font-size:12px;font-weight:800;text-align:center}
#phoneme-study #pf-ipa-video-note{font-size:11px;line-height:1.55;color:var(--pfi-muted)!important;margin-top:8px}
#phoneme-study #pf-ipa-video-note a{color:var(--pfi-alt);font-weight:700}
#phoneme-study .pf-ipa-detail-side{min-width:0;display:flex;flex-direction:column;gap:12px}
#phoneme-study .pf-ipa-words{display:flex;flex-direction:column;gap:9px}
#phoneme-study .pf-ipa-word-row{display:flex;align-items:center;justify-content:space-between;min-width:0;gap:10px;background:var(--pfi-soft);border:1px solid var(--pfi-border);border-radius:15px;padding:13px 15px}
#phoneme-study .pf-ipa-word-row>div:first-child{min-width:0;display:flex;flex-direction:column;gap:3px}
#phoneme-study .pf-ipa-word-row strong{font-size:14px;color:var(--pfi-ink)}
#phoneme-study .pf-ipa-word-row small{font-size:11px;color:var(--pfi-muted)}
#phoneme-study .pf-ipa-word-actions{display:flex;gap:7px;flex:none;align-items:center}
#phoneme-study .pf-ipa-icon-button,#phoneme-study .pf-ipa-mic{width:37px;height:37px;display:grid;place-items:center;border-radius:11px;flex:none;cursor:pointer;border:1px solid var(--pfi-border);background:var(--pfi-card);color:var(--pfi-alt);font-size:17px}
#phoneme-study .pf-ipa-mic{background:linear-gradient(120deg,#4f46e5,#7c3aed);color:#fff;border-color:transparent}
#phoneme-study .pf-ipa-icon-button:hover{border-color:var(--pfi-accent)}
#phoneme-study .pf-ipa-pairs-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:18px}
#phoneme-study .pf-ipa-pairs-head span{color:var(--pfi-muted);letter-spacing:.07em;font-size:9px}
#phoneme-study .pf-ipa-pair-row{display:flex;align-items:stretch;justify-content:space-around;gap:9px;border:1px solid var(--pfi-border);border-radius:17px;padding:14px;background:var(--pfi-soft)}
#phoneme-study .pf-ipa-pair-row>div{display:flex;flex:1;align-items:center;justify-content:space-between;gap:8px;min-width:0}
#phoneme-study .pf-ipa-pair-row strong{font-size:14px;color:var(--pfi-ink);overflow-wrap:anywhere}
#phoneme-study .pf-ipa-vs{font-size:10px;align-self:center;border:1px solid var(--pfi-border);border-radius:8px;padding:5px;color:var(--pfi-muted)}
#phoneme-study .pf-ipa-no-pair,#phoneme-study .pf-ipa-assess-note{font-size:12px;line-height:1.65;color:var(--pfi-muted)!important;background:var(--pfi-soft);border:1px solid var(--pfi-border);border-radius:13px;padding:12px;margin:0}
#phoneme-study .pf-ipa-assess-note{margin-top:10px}
#phoneme-study .pf-ipa-dialog-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px clamp(15px,2.3vw,29px);border-top:1px solid var(--pfi-border);background:var(--pfi-surface)}
#phoneme-study #phoneme-study-status{font-size:11px;color:var(--pfi-muted)!important;margin:0;max-width:260px;line-height:1.6}
#phoneme-study .pf-ipa-dialog-footer .phoneme-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;margin:0}
#phoneme-study .pf-ipa-dialog-footer .phoneme-actions button{border:1px solid var(--pfi-border);border-radius:10px;padding:11px 13px;font-size:11px;min-height:38px;font-weight:750;cursor:pointer;background:var(--pfi-soft);color:var(--pfi-ink)}
#phoneme-study .pf-ipa-dialog-footer .phoneme-actions button.primary-button{background:var(--pfi-card);color:var(--pfi-alt)}
#phoneme-study .pf-ipa-dialog-footer .phoneme-actions button.pf-ipa-complete{background:linear-gradient(110deg,#4f46e5,#7c3aed);color:white;border-color:transparent;box-shadow:0 8px 15px rgba(79,70,229,.18)}
#phoneme-study button:focus-visible{outline:3px solid #f59e0b!important;outline-offset:2px}
#phoneme-study button:disabled{opacity:.52;cursor:wait}
@media(max-width:1250px){#phoneme-study .pf-ipa-tile-grid{grid-template-columns:repeat(6,minmax(0,1fr))}}
@media(max-width:900px){#phoneme-study .pf-ipa-tile-grid{grid-template-columns:repeat(4,minmax(0,1fr))}#phoneme-study .pf-ipa-dialog-columns{grid-template-columns:1fr}}
@media(max-width:560px){#page-listening.learning-phoneme-mode #phoneme-study:not(.hidden){padding:12px!important}#phoneme-study .pf-ipa-tile-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}#phoneme-study .pf-ipa-tile,#phoneme-study .pf-ipa-tile-play{min-height:112px}#phoneme-study .pf-ipa-hero{padding:23px 14px!important}#phoneme-study .pf-ipa-modal{padding:5px}#phoneme-study .pf-ipa-dialog-inner{max-height:98dvh;border-radius:17px}#phoneme-study .pf-ipa-dialog-head{padding:13px}#phoneme-study .pf-ipa-dialog-scroll{padding:14px}#phoneme-study .pf-ipa-dialog-footer{display:block}#phoneme-study .pf-ipa-dialog-footer .phoneme-actions{margin-top:10px;justify-content:stretch}#phoneme-study .pf-ipa-dialog-footer .phoneme-actions button{flex:1 1 auto}#phoneme-study .phoneme-levels{grid-template-columns:1fr}#phoneme-study .phoneme-primary{align-items:flex-start;flex-wrap:wrap}#phoneme-study .phoneme-primary>strong{font-size:33px!important}}
@media(prefers-reduced-motion:reduce){#phoneme-study .pf-ipa-tile,#phoneme-study .pf-ipa-hero-cta{transition:none!important;transform:none!important}}

/* V68 restoration: independent, fully visible phoneme sound controls. */
#phoneme-study .pf-ipa-tile-sound{position:absolute;bottom:7px;left:8px;z-index:2;width:34px;height:32px;min-width:34px;display:grid;place-items:center;border-radius:10px;border:1px solid rgba(99,102,241,.32);background:var(--pfi-soft);color:var(--pfi-accent);cursor:pointer;transition:transform .16s,box-shadow .16s,border-color .16s}
#phoneme-study .pf-ipa-tile-sound:hover,#phoneme-study .pf-ipa-tile-sound:focus-visible{transform:scale(1.07);border-color:var(--pfi-accent);box-shadow:0 0 0 3px rgba(99,102,241,.13)}
#phoneme-study .pf-ipa-tile-sound.is-playing,#phoneme-study .pf-ipa-tile-play.is-playing{color:var(--pfi-accent);background:rgba(99,102,241,.18)!important;box-shadow:inset 0 0 0 1px rgba(99,102,241,.45)}
#phoneme-study .pf-ipa-play-phoneme{border:1px solid rgba(99,102,241,.4);background:linear-gradient(110deg,#4338ca,#2563eb);color:#fff;min-height:44px;padding:10px 15px;border-radius:11px;font-weight:850;font-size:12px;cursor:pointer;white-space:nowrap;transition:transform .16s,box-shadow .16s}
#phoneme-study .pf-ipa-play-phoneme:hover,#phoneme-study .pf-ipa-play-phoneme:focus-visible{box-shadow:0 6px 23px rgba(79,70,229,.26);transform:translateY(-1px)}
#phoneme-study .pf-ipa-play-phoneme.is-playing{box-shadow:0 0 0 3px rgba(129,140,248,.27)}
#phoneme-study .pf-ipa-play-phoneme:active{transform:scale(.97)}
#phoneme-study .pf-ipa-dialog-footer .phoneme-actions{gap:8px}
@media(max-width:560px){#phoneme-study .pf-ipa-play-phoneme{white-space:normal;flex:1 1 100%!important;text-align:center}#phoneme-study .pf-ipa-tile-play{padding-bottom:24px!important}}
@media(prefers-reduced-motion:reduce){#phoneme-study .pf-ipa-tile-sound,#phoneme-study .pf-ipa-play-phoneme{transition:none!important}}
