/* Only the Speech self-study route is restyled. */
.speech-self-study h2{margin:0;color:#174d3b;font-size:19px}
.speech-self-study p{font-size:13px;line-height:1.5;margin:6px 0}
.self-study-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}
.self-study-time-label{color:#64766b;font-size:12px;white-space:nowrap}
.self-study-clock{font-size:25px;font-weight:900;color:#174d3b;font-variant-numeric:tabular-nums;float:right;margin:8px 0 0 12px}
.self-study-stage{font-size:16px!important;font-weight:900;color:#174d3b}
.self-study-guide{max-width:600px}.self-study-status{font-size:12px;color:#52645a;margin-top:5px}
.self-study-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;position:relative;background:#fff;padding:12px!important;padding-bottom:max(12px,env(safe-area-inset-bottom))!important;border:1px solid #dfe8e3}
.self-study-actions button,.self-study-actions summary,.speech-self-study button{min-height:48px;min-width:48px;padding:12px 15px;font-size:15px}
.self-study-actions [data-action="pause"]{background:#eef5f1;color:#174d3b}
.self-study-actions [data-action="next-stage"],.self-study-actions [data-action="start"],.self-study-actions [data-action="resume"]{flex:1;background:#174d3b;color:#fff}
.speech-self-study [hidden],.self-study-actions [hidden]{display:none!important}
.speech-self-study summary,.self-study-actions summary{cursor:pointer;display:flex;align-items:center;font-weight:800;min-height:48px}
.self-study-options{flex-basis:100%}.self-study-options[open]{display:flex;flex-wrap:wrap;gap:8px}.self-study-options summary{font-size:13px;color:#52645a}
.self-study-storage,.self-study-server{color:#52645a;font-size:12px!important}
.self-study-audio{font-size:13px;color:#174d3b;margin:6px 0;min-height:20px}.self-study-audio:empty{display:none}
.self-study-active #timerCard{display:none!important}
.self-study-route #generateBtn,.self-study-route .self-study-unused{display:none!important}
.self-study-paused #practiceCard,.self-study-summary #practiceCard,.self-study-route:not(.self-study-ready) #practiceCard{display:none!important}
.self-study-route .speech-hero{padding:12px 16px!important;margin-bottom:8px!important}
.self-study-route .speech-hero h1{font-size:21px!important}
.self-study-route .speech-hero p,.self-study-route .speech-hero .eyebrow,.self-study-route .speech-level-chip{display:none!important}
.self-study-route #speechSettings{padding:12px!important}
.self-study-route .speech-self-study{padding:14px!important}
.speech-self-study-entry{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:space-between;padding:10px 14px!important}
.speech-self-study-entry strong{font-size:13px;color:#174d3b}.speech-self-study-entry a{font-size:13px;min-height:44px;display:inline-flex;align-items:center;color:#174d3b;font-weight:800}
@media(max-width:560px){.self-study-actions{gap:6px}.self-study-actions button{font-size:14px}.self-study-options button{font-size:13px}.self-study-clock{font-size:23px}}

.self-study-actions > button{width:auto!important;flex:1 1 0;box-shadow:none!important;margin:0!important}
.self-study-actions [data-action="pause"]{flex:0 1 auto;background:#eef5f1!important;color:#174d3b!important;border:1px solid #dfe8e3!important}
.self-study-options button{width:auto!important;box-shadow:none!important}

/* UI review: reuse the existing MAXIMA palette and controls; homework is untouched. */
.self-study-route .speech-self-study-entry{padding:0 2px!important;margin-bottom:10px;border:0;background:transparent;box-shadow:none;border-radius:0;gap:6px}
.self-study-route .speech-self-study-entry a{min-height:32px;font-size:12px;text-underline-offset:3px}
.self-study-route .speech-self-study-entry strong{font-size:12px;font-weight:700}
.self-study-route .card:not(.speech-self-study-entry){border-color:var(--line,#dfe8e3);box-shadow:none}
.self-study-route .speech-self-study{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 12px;padding:16px!important;border-radius:17px}
.self-study-route .self-study-heading{grid-column:1;align-self:center;flex-wrap:wrap;justify-content:flex-start;gap:5px 12px}
.self-study-route .self-study-heading h2{font-size:16px;line-height:1.4}
.self-study-route .self-study-clock{grid-column:2;grid-row:1;margin:0;float:none;font-size:19px;line-height:1.4;color:var(--green,#174d3b);align-self:center}
.self-study-route .self-study-status{grid-column:1/-1;margin:0;line-height:1.55}
.self-study-route .self-study-stage,.self-study-route .self-study-guide,.self-study-route .self-study-review{grid-column:1/-1;margin:0;line-height:1.55}
.self-study-route .speech-self-study>details{grid-column:1/-1;border-top:1px solid var(--line,#dfe8e3);margin-top:4px}
.self-study-route .speech-self-study>details summary{min-height:36px;font-size:13px;line-height:1.5;color:var(--green,#174d3b);padding:5px 0}
.self-study-route .speech-self-study>details summary::after,.self-study-route .self-study-options summary::after{content:'＋';margin-left:auto;font-size:18px;font-weight:400}
.self-study-route .speech-self-study>details[open] summary::after,.self-study-route .self-study-options[open] summary::after{content:'−'}
.self-study-route .speech-self-study>details p{max-width:62ch;margin:8px 0;line-height:1.7}
.self-study-route .self-study-storage,.self-study-route .self-study-server{grid-column:1/-1;font-size:12px!important;line-height:1.55;margin:0}
.self-study-route .self-study-storage:empty,.self-study-route .self-study-server:empty{display:none}
.self-study-route [data-action=retry-save]{grid-column:1/-1;justify-self:start}
.self-study-ready:not(.self-study-summary) .self-study-stage,.self-study-ready:not(.self-study-summary) .self-study-guide{display:none}
.self-study-route #speechSettings{padding:12px 14px!important;border-radius:14px;margin-bottom:12px}
.self-study-route #speechSettings .controls{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}
.self-study-route #speechSettings label{display:block;margin-bottom:5px;font-size:12px;font-weight:700}
.self-study-route #speechSettings select{min-height:44px;border-radius:10px;padding:9px 10px}
.self-study-route #practiceCard{padding:20px;border-radius:17px;margin-bottom:12px}
.self-study-route .practice-header{align-items:center;margin-bottom:14px}
.self-study-route .practice-header h2{font-size:18px;line-height:1.5}
.self-study-route .practice-header .stats{margin-top:4px;font-size:12px;line-height:1.5;font-variant-numeric:tabular-nums}
.self-study-route .pronunciation-line{text-align:left;padding:22px 20px!important;font-size:clamp(21px,3.2vw,27px)!important;line-height:1.65!important;font-weight:700;border-radius:14px;background:var(--soft,#eef5f1);letter-spacing:0;word-spacing:normal}
.self-study-route .repeat-word{padding:1px 0;margin:0}
.self-study-route .repeat-local-controls{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:14px}
.self-study-route .repeat-local-controls button,.self-study-route .speech-primary-controls button{min-height:52px;font-size:15px;font-weight:800;border-radius:12px;box-shadow:none;padding:12px 10px}
.self-study-route #repeatListenBtn,.self-study-route #playBtn{background:#fff;color:var(--green,#174d3b);border:1px solid #b8cbbb}
.self-study-route #repeatStopBtn{grid-column:1/-1;min-height:48px;font-size:13px;background:#fff;color:var(--green,#174d3b);border:1px solid var(--line,#dfe8e3)}
.self-study-route button:disabled{opacity:.55;box-shadow:none}
.self-study-route .repeat-speaking-status{font-size:12px;font-weight:400;line-height:1.65;margin-top:10px}
.self-study-route .speech-primary-controls{gap:10px;margin-top:14px}
.self-study-route .practice-footer{margin-top:14px;padding-top:12px}
.self-study-route .practice-footer button{min-height:44px;font-size:13px;border-radius:10px}
.self-study-route .self-study-actions{padding:12px 14px!important;gap:10px;border-radius:14px;margin-bottom:0;box-shadow:none}
.self-study-route .self-study-actions>button{min-height:48px;border-radius:11px;font-size:14px}
.self-study-route .self-study-options summary{min-height:36px;padding:4px 0;font-size:12px}
.self-study-route .self-study-options[open]{display:flex;gap:8px}
.self-study-route .self-study-options[open] summary{flex-basis:100%}
.self-study-route button,.self-study-route summary,.self-study-route select{touch-action:manipulation}
@media(min-width:700px){
 .self-study-route .speech-self-study{grid-template-columns:minmax(0,1fr) auto;gap:5px 16px}
 .self-study-route .self-study-storage,.self-study-route .self-study-server{grid-column:1/-1}
}
@media(max-width:560px){
 .self-study-route .speech-self-study{padding:12px 14px!important;margin-bottom:10px;gap:4px 10px}
 .self-study-route .self-study-heading{gap:4px 8px}
 .self-study-route .self-study-heading h2{font-size:15px}
 .self-study-route .self-study-time-label{font-size:11px}
 .self-study-route .self-study-clock{font-size:18px}
 .self-study-route #speechSettings{padding:10px 12px!important;margin-bottom:10px}
 .self-study-route #speechSettings .controls{gap:10px}
 .self-study-route #practiceCard{padding:16px 14px;margin-bottom:10px}
 .self-study-route .practice-header{margin-bottom:12px}
 .self-study-route .practice-header h2{font-size:17px}
 .self-study-route .pronunciation-line{padding:18px 15px!important;font-size:22px!important;line-height:1.6!important}
 .self-study-route .self-study-actions{padding:10px 12px!important;gap:8px}
 .self-study-route .repeat-local-controls{gap:8px}
}
.self-study-route .speech-self-study-entry strong{display:none}
.self-study-route .speech-self-study-entry{justify-content:flex-end}
/* A microphone stop action is only useful while recording. Its state stays owned by existing JS. */
.self-study-route #repeatStopBtn:disabled,.self-study-route #micStopBtn:disabled{display:none}
.self-study-route .speech-primary-controls:has(#micStopBtn:disabled) #micStartBtn:not(.hidden){grid-column:1/-1}

/* Speech mode selection and lesson list: scoped entirely to Speech pages. */
.speech-self-study-entry { border:1px solid #bdd3c7!important; border-radius:14px!important; background:#e9f2ed!important; padding:12px 16px!important; margin-bottom:12px!important }
.speech-self-study-entry strong{display:block!important;color:#174d3b!important;font-size:15px!important}
.speech-self-study-entry a{font-size:13px!important;line-height:1.5;min-height:44px!important;text-decoration:underline;text-underline-offset:3px}
.self-study-route .speech-self-study-entry{justify-content:space-between!important;padding:12px 16px!important;background:#174d3b!important;border-color:#174d3b!important;border-radius:14px!important}
.self-study-route .speech-self-study-entry strong,.self-study-route .speech-self-study-entry a{color:#fff!important}
.self-study-lesson-list{padding:14px!important;margin-bottom:12px}
.self-study-lesson-heading{display:flex;flex-wrap:wrap;gap:5px 12px;align-items:center;justify-content:space-between;margin-bottom:10px}
.self-study-lesson-heading strong{color:#174d3b;font-size:16px}
.self-study-list-note{font-size:12px;color:#6d7d74}
.self-study-lesson-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.self-study-lesson-button{display:flex;flex-direction:column;gap:4px;align-items:flex-start;justify-content:center;text-align:left;padding:12px!important;min-height:60px!important;min-width:0!important;border-radius:11px!important;background:#f4f8f5!important;border:1px solid #d8e6dd!important;color:#174d3b!important;box-shadow:none!important}
.self-study-lesson-button strong{font-size:14px;line-height:1.35}.self-study-lesson-button small{font-size:11px;color:#597468;line-height:1.4}
.self-study-lesson-button.selected{background:#e3f1e9!important;border:2px solid #174d3b!important}
.self-study-lesson-button:focus-visible{outline:2px solid #174d3b;outline-offset:2px}
.self-study-lesson-button:disabled{opacity:.65}
@media(max-width:560px){.self-study-lesson-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.speech-self-study-entry{gap:8px}.speech-self-study-entry strong{font-size:14px!important}}

.self-study-route .self-study-speed-field{grid-column:1/-1}

.self-study-actions [data-action="exit"]{background:#f5f9f6!important;color:#174d3b!important;border:1px solid #bacfc3!important;flex:0 1 auto!important;box-shadow:none!important}
.self-study-actions [data-action="start"].secondary{background:#f5f9f6!important;color:#174d3b!important;border:1px solid #bacfc3!important}


/* 2026-10-11 · New Practice / History. Only the Speech self-study route changes. */
#maximaSpeechPractice .speech-open-self-study {
  display: block; width: max-content; max-width: 100%;
  margin: 0 0 14px auto; padding: 10px 13px;
  border: 1px solid #c7dcce; border-radius: 10px;
  background: #eef7f1; color: #174d3b; font-size: 13px;
  font-weight: 800; text-decoration: none;
}
#maximaSpeechPractice .speech-mode-switch {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px; padding: 0; margin: 0 0 6px;
  border: 0; border-radius: 0; box-shadow: none; background: transparent;
}
#maximaSpeechPractice .speech-mode-switch button.speech-mode-choice {
  display: flex !important; flex-direction: column;
  justify-content: center; align-items: flex-start;
  gap: 5px; text-align: left; width: 100%;
  min-width: 0; min-height: 76px; padding: 13px 15px;
  border-radius: 13px; border: 1px solid;
  box-shadow: none !important;
  text-decoration: none; cursor: pointer;
  transition: background-color .1s ease, border-color .1s ease;
}
#maximaSpeechPractice .speech-mode-switch .speech-mode-new {
  background: #eaf4ee !important; color: #174d3b !important;
  border-color: #b9d3c4 !important;
}
#maximaSpeechPractice .speech-mode-switch .speech-mode-history {
  background: #ecf2fa !important; color: #284d7d !important;
  border-color: #bbcee4 !important;
}
#maximaSpeechPractice .speech-mode-switch .speech-mode-new.is-active {
  background: #174d3b !important; color: #fff !important;
  border-color: #174d3b !important;
}
#maximaSpeechPractice .speech-mode-switch .speech-mode-history.is-active {
  background: #284d7d !important; color: #fff !important;
  border-color: #284d7d !important;
}
#maximaSpeechPractice .speech-mode-switch .speech-mode-title {
  display: block; font-size: 15px; line-height: 1.35;
  font-weight: 850; overflow-wrap: anywhere; word-break: keep-all;
}
#maximaSpeechPractice .speech-mode-switch .speech-mode-detail {
  display: block; font-size: 11px; font-weight: 650;
  line-height: 1.4; color: inherit !important; opacity: .83;
  overflow-wrap: anywhere; word-break: keep-all;
}
#maximaSpeechPractice .speech-mode-switch .is-active .speech-mode-detail {
  color: #fff !important; opacity: .88;
}
#maximaSpeechPractice .speech-mode-switch button:focus-visible,
#maximaSpeechPractice .speech-class-link:focus-visible {
  outline: 3px solid rgba(40,77,125,.35); outline-offset: 2px;
}
#maximaSpeechPractice .speech-class-link {
  display: block; width: max-content; max-width: 100%;
  margin: 0 0 11px auto; padding: 4px 1px;
  color: #64746a; font-size: 12px; font-weight: 650;
  text-decoration: underline; text-underline-offset: 3px;
}
#maximaSpeechPractice .speech-self-study[hidden],
#maximaSpeechPractice .self-study-lesson-list[hidden] { display: none !important; }
#maximaSpeechPractice .self-study-history-empty {
  grid-column: 1 / -1; margin: 0; padding: 12px 6px;
  color: #536a79; font-size: 13px;
}
#maximaSpeechPractice.self-study-view-history .self-study-lesson-button.selected {
  border-color: #284d7d !important; background: #ecf2fa !important;
  color: #284d7d !important;
}
#maximaSpeechPractice.self-study-view-history .self-study-lesson-heading strong {
  color: #284d7d;
}
@media (max-width: 420px) {
  #maximaSpeechPractice .speech-mode-switch { gap: 8px; }
  #maximaSpeechPractice .speech-mode-switch button.speech-mode-choice {
    min-height: 77px; padding: 11px 10px;
  }
  #maximaSpeechPractice .speech-mode-switch .speech-mode-title { font-size: 13px; }
  #maximaSpeechPractice .speech-mode-switch .speech-mode-detail { font-size: 10px; }
}

/* Speech TRY self-help: only inside the Self-Study route. */
.self-study-route .self-study-help{grid-column:1/-1;border-top:1px solid #dce7e0;margin-top:6px;padding-top:2px}
.self-study-route .self-study-help summary{min-height:40px;font-size:14px;font-weight:850}
.self-study-route .self-study-help-intro{font-size:13px!important;line-height:1.65;margin:6px 0!important;color:#354e41}
.self-study-route .self-study-help-actions{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0 4px}
.self-study-route .self-study-help-actions button{width:auto;min-height:44px;padding:9px 13px;font-size:13px;box-shadow:none}
.self-study-route .self-study-sentence-meaning{padding:12px;background:#f3f7f4;border-radius:10px;border:1px solid #dbe6df;color:#234939;line-height:1.65}
.self-study-route .pronunciation-line .word-chip,.self-study-route .pronunciation-line .repeat-word{cursor:pointer;border-radius:4px;text-decoration-line:underline;text-decoration-style:dotted;text-decoration-color:#91a99c;text-underline-offset:3px;touch-action:manipulation}
.self-study-route .pronunciation-line .word-chip:focus-visible,.self-study-route .pronunciation-line .repeat-word:focus-visible{outline:2px solid #174d3b;outline-offset:2px}
.self-study-route .self-study-word-help{margin:12px 0 8px;background:#fff;border:1px solid #bfd7c9;border-radius:14px;padding:14px;box-shadow:0 6px 15px rgba(23,77,59,.07);color:#153f31;line-height:1.6}
.self-study-route .self-study-word-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px}
.self-study-route .self-study-word-title{font-size:22px;letter-spacing:0;overflow-wrap:anywhere}
.self-study-route .self-study-word-close{width:auto;min-height:36px;padding:6px 11px;font-size:12px;background:#f0f5f2!important;color:#174d3b!important;border:1px solid #d9e6de!important;box-shadow:none!important}
.self-study-route .self-study-word-buttons{display:flex;flex-wrap:wrap;gap:8px}
.self-study-route .self-study-word-buttons button,.self-study-route .self-study-word-extra button{flex:1 1 calc(50% - 8px);width:auto;min-height:44px;padding:10px 10px;min-width:calc(50% - 8px);border-radius:10px;font-size:13px;box-shadow:none!important}
.self-study-route .self-study-word-buttons button:nth-child(2n),.self-study-route .self-study-word-extra button{background:#ebf2fb!important;color:#284d7d!important;border:1px solid #bbcee4!important}
.self-study-route .self-study-word-extra{background:#f6f9f7;border-radius:11px;margin-top:10px;padding:10px 12px;color:#254d3b;white-space:normal}
.self-study-route .self-study-word-extra:empty{display:none}
.self-study-route .self-study-word-syllables{font-size:21px;font-weight:800;letter-spacing:.03em;overflow-wrap:anywhere}
.self-study-route .self-study-word-meaning{font-size:15px;font-weight:800;line-height:1.7}
.self-study-route .self-study-word-dictionary{display:inline-flex;align-items:center;min-height:38px;font-size:13px;color:#245580;text-decoration:underline;text-underline-offset:3px}
.self-study-route .self-study-word-muted{font-size:13px;color:#667a71}
.self-study-route .self-study-word-status{min-height:0;font-size:12px;font-weight:700;color:#4a6a59;margin:8px 0 0;line-height:1.6}
.self-study-route .self-study-word-status:empty{display:none}
@media(max-width:420px){.self-study-route .self-study-word-help{padding:12px}.self-study-route .self-study-word-title{font-size:20px}.self-study-route .self-study-word-buttons button{font-size:12px}}

/* Self-study syllable listening without external sound files. */
.self-study-route .self-study-syllable-parts{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
.self-study-route .self-study-word-extra .self-study-syllable-parts button{flex:1 1 70px;min-width:60px!important;min-height:48px;padding:9px 12px;font-size:18px;font-weight:900;background:#fff!important;color:#174d3b!important;border:2px solid #bdd8c7!important;border-radius:11px}
.self-study-route .self-study-word-extra [data-help-action="syllable-sequence"]{min-width:100%;background:#174d3b!important;color:#fff!important;border:1px solid #174d3b!important;min-height:48px}
.self-study-route .self-study-weak-feedback{margin:12px 0 0;padding:14px;background:#fff9ed;border:1px solid #ead6a8;border-radius:13px}
.self-study-route .self-study-weak-feedback[hidden]{display:none!important}
.self-study-route .self-study-weak-title{display:block;margin:0 0 10px;font-size:14px;font-weight:900;color:#77521f}
.self-study-route .self-study-weak-words{display:flex;flex-wrap:wrap;gap:7px}
.self-study-route .self-study-weak-word,.self-study-route .self-study-weak-word-static{display:inline-flex;align-items:center;min-height:38px;width:auto;max-width:100%;padding:8px 12px;background:#fff!important;border:1px solid #e0bc77!important;color:#70501d!important;border-radius:10px;box-shadow:none!important;font-size:14px;font-weight:850;overflow-wrap:anywhere}
.self-study-route .self-study-weak-note{margin:10px 0 0;color:#725e41;font-size:12px;line-height:1.55}
.self-study-route .self-study-weak-title:not(:first-child){margin-top:12px}
.self-study-route .self-study-weak-sentence{margin:5px 0;padding:8px 10px;background:#fff;border-radius:9px;color:#70501d;border:1px solid #ebdab4;font-size:13px;line-height:1.6}
.self-study-route .self-study-review .self-study-weak-words{margin-top:7px}
@media(max-width:420px){.self-study-route .self-study-word-extra .self-study-syllable-parts button{min-width:50px!important;padding:8px 10px;font-size:17px}.self-study-route .self-study-weak-feedback{padding:12px}}

/* Practice issues are step-specific; the final step is a separate report. */
#maximaSpeechPractice.self-study-summary .self-study-help,
#maximaSpeechPractice.self-study-summary .self-study-weak-feedback{display:none!important}
#maximaSpeechPractice .self-study-help[hidden]{display:none!important}
.self-study-route .self-study-review{padding:12px 0 4px}
.self-study-route .self-study-final-title{display:block;font-size:16px;color:#174d3b;margin:0 0 5px;font-weight:900}
.self-study-route .self-study-final-notice{font-size:13px!important;color:#456257;line-height:1.6;margin:4px 0 12px!important}
.self-study-route .self-study-final-label{font-size:13px!important;font-weight:800;color:#79501c;margin:14px 0 8px!important}
.self-study-route .self-study-review .self-study-weak-sentence{border:1px solid #ebdab4;padding:10px 12px;background:#fff9ed;color:#6c4b1d;white-space:normal;overflow-wrap:anywhere}
.self-study-route .self-study-review .self-study-weak-word-static{cursor:default;min-height:34px}
