/* UX hierarchy: global navigation, learning controls, and contextual actions. */
.sr-only{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip-path:inset(50%);
  white-space:nowrap!important;
  border:0!important
}

.app-nav{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:4px;
  margin:0 0 20px;
  padding:0 0 2px;
  border-bottom:1px solid var(--line)
}

.app-nav a,.app-nav button{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:6px;
  min-height:46px;
  background:transparent;
  border:0;
  border-radius:0;
  border-bottom:2px solid transparent;
  text-decoration:none;
  color:var(--muted);
  font-size:14px;
  font-weight:650;
  padding:8px 5px;
  white-space:normal;
  overflow-wrap:anywhere;
  text-align:center
}

.app-nav a[aria-current]{
  color:var(--accent);
  border-bottom-color:var(--accent)
}

.app-nav button:hover,.app-nav a:hover{
  color:var(--accent);
  background:var(--soft)
}

.app-nav [hidden]{
  display:none!important
}

.app-nav .review-count{
  font-size:11px;
  min-width:20px;
  text-align:center
}

.app-nav button:focus-visible,.app-nav a:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:2px
}

#studyPanel{
  scroll-margin-top:12px
}

.study-mode{
  margin-bottom:16px
}

.scope-label{
  font-size:12px;
  font-weight:650;
  color:var(--muted);
  margin-bottom:6px
}

.playback-panel .transport{
  margin-bottom:14px
}

.playback-panel .transport button{
  min-height:44px;
  font-size:12px;
  white-space:normal;
  overflow-wrap:anywhere
}

.playback-fold summary{
  min-height:46px
}

.playback-fold #playbackSummary{
  font-size:11px;
  max-width:72%
}

.dictation-inline{
  margin-top:16px
}

.dictation-head{
  margin-bottom:7px
}

.input-meta{
  display:flex;
  justify-content:flex-end;
  margin-top:5px;
  color:var(--muted);
  font-size:11px;
  font-variant-numeric:tabular-nums
}

#typed{
  min-height:100px
}

#stop.is-secondary{
  background:var(--soft);
  color:var(--accent);
  border:1px solid var(--line)
}

#stop.is-secondary:hover{
  border-color:var(--accent)
}

.question-panel[data-stage="ready"] #check{
  background:transparent;
  border-color:var(--line);
  color:var(--text)
}

.question-panel[data-stage="ready"] #check:hover{
  background:var(--soft)
}

.question-panel[data-stage="writing"] #check{
  background:var(--solid);
  color:#fff;
  border-color:var(--solid)
}

#result:focus{
  outline:none
}

.question-panel[data-stage="checked"] #result{
  margin-top:8px
}

.attempt-summary{
  margin-top:8px
}

.navigation{
  display:flex;
  gap:8px;
  align-items:stretch
}

.nav-secondary,.nav-main{
  display:flex;
  gap:8px;
  min-width:0
}

.nav-secondary{
  flex:2
}

.nav-main{
  flex:1
}

.navigation button{
  flex:1;
  min-width:0;
  min-height:44px;
  padding:8px 5px;
  font-size:12px;
  white-space:normal;
  overflow-wrap:anywhere;
  gap:5px
}

.navigation .button-label{
  position:static;
  width:auto;
  height:auto;
  overflow:visible;
  clip-path:none;
  white-space:normal
}

.navigation .ui-icon{
  flex:none;
  width:16px;
  height:16px
}

.navigation button#next{
  flex-direction:row-reverse
}

.question-panel[data-stage="checked"] .navigation{
  flex-wrap:wrap
}

.question-panel[data-stage="checked"] .nav-secondary{
  flex:1 1 100%;
  justify-content:flex-start
}

.question-panel[data-stage="checked"] .nav-secondary button{
  flex:0 1 auto;
  min-width:88px;
  min-height:44px;
  padding-inline:12px
}

.question-panel[data-stage="checked"] .nav-main{
  flex:1 1 100%
}

.question-panel[data-stage="checked"] #next:not(:disabled),.question-panel[data-stage="checked"] #reviewNext,.question-panel[data-stage="checked"][data-can-next="false"] #redoAttempt{
  background:var(--solid);
  border-color:var(--solid);
  color:white;
  font-weight:650
}

.question-panel[data-stage="checked"] #next:disabled{
  opacity:.45
}

.question-panel[data-reviewing="true"] .nav-secondary{
  display:none
}

.question-panel[data-reviewing="true"] .nav-main{
  flex:1
}

.question-panel[data-reviewing="true"] .review-session{
  padding:4px 0 10px
}

.review-session #reviewExit{
  min-height:44px;
  min-width:44px
}

.question-panel[data-stage="checked"] .utility{
  margin-top:2px
}

.utility button{
  min-height:44px
}

.plus-reset{
  min-height:44px
}

@media(max-width:760px){
  .app-nav{
    margin:0 0 12px
  }
  .app-nav a,.app-nav button{
    font-size:13px
  }
  .study-mode{
    margin-bottom:12px
  }
  .playback-fold #playbackSummary{
    max-width:65%
  }
  .navigation button{
    font-size:11px
  }
  .navigation .button-label{
    position:static;
    width:auto;
    height:auto;
    clip-path:none;
    overflow:visible
  }
  .question-panel[data-stage="checked"] .nav-secondary button{
    min-width:76px
  }
  .question-panel[data-stage="checked"] .nav-main button{
    font-size:13px
  }
}

@media(max-width:360px){
  .app-nav a,.app-nav button{
    font-size:12px
  }
  .navigation{
    gap:5px
  }
  .nav-secondary,.nav-main{
    gap:5px
  }
  .navigation button{
    padding-inline:3px;
    flex-wrap:wrap
  }
  .navigation .ui-icon{
    width:14px;
    height:14px
  }
  .playback-fold #playbackSummary{
    max-width:62%
  }
}

/* Resume-first navigation: one compact progress panel, settings are secondary. */
main{
  max-width:820px
}

.workspace{
  grid-template-columns:minmax(0,1fr);
  gap:16px
}

.primary-column{
  display:grid;
  gap:12px
}

.resume-panel{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:10px;
  padding:16px 20px
}

.resume-panel .overall{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:5px 10px;
  align-items:center
}

.resume-panel .overall-stat{
  margin:0;
  gap:8px;
  font-size:12px
}

.resume-panel #overallProgress{
  grid-column:1/-1;
  margin:2px 0 0
}

.resume-panel .day-block{
  border-top:1px solid var(--line);
  padding-top:12px;
  margin-top:12px;
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1.25fr);
  align-items:center;
  gap:4px 10px
}

.resume-panel .day-label{
  margin:0;
  font-size:13px
}

.resume-panel #day{
  font-size:15px;
  font-weight:650;
  min-height:44px
}

.resume-panel .day-stat{
  grid-column:1/-1;
  margin-top:3px
}

.resume-panel #progress{
  grid-column:1/-1;
  margin:2px 0 0
}

.resume-panel .grid-panel{
  margin-top:10px
}

.resume-panel #grid{
  grid-template-columns:repeat(auto-fit,minmax(44px,1fr));
  max-height:190px;
  padding:3px 2px
}

.resume-panel #grid button{
  min-height:44px
}

.resume-panel #grid .active{
  border-color:var(--accent);
  box-shadow:inset 0 0 0 1px var(--accent)
}

#nextStudyDay[hidden],#studyNavigator[hidden]{
  display:none!important
}

#nextStudyDay{
  width:100%;
  margin-top:10px;
  color:var(--accent);
  background:var(--soft);
  border-color:var(--line)
}

.settings-fold summary{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:44px;
  font-weight:650;
  cursor:pointer;
  list-style:none
}

.settings-fold summary::-webkit-details-marker{
  display:none
}

.settings-fold summary .ui-icon:last-child{
  margin-left:auto
}

.settings-fold[open] summary .ui-icon:last-child{
  transform:rotate(180deg)
}

.settings-content{
  padding-top:10px
}

@media(max-width:760px){
  .workspace{
    grid-template-columns:minmax(0,1fr)
  }
  .resume-panel{
    padding:12px
  }
  .resume-panel .overall-stat{
    font-size:11px
  }
  .resume-panel #day{
    font-size:14px
  }
  .resume-panel #grid{
    grid-template-columns:repeat(auto-fit,minmax(44px,1fr))
  }
}

@media(max-width:360px){
  .resume-panel .day-block{
    grid-template-columns:1fr
  }
  .resume-panel #day{
    grid-column:1/-1
  }
  .resume-panel .overall{
    grid-template-columns:1fr
  }
  .resume-panel .overall-stat{
    justify-content:space-between
  }
}

/* Compact navigation: keep study controls above the fold. */
.resume-panel.compact-nav{
  padding:8px 12px
}

.compact-nav .compact-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  align-items:center;
  gap:8px
}

.compact-nav #day{
  width:100%;
  min-width:0;
  min-height:44px;
  margin:0;
  font-size:14px
}

.compact-nav #sentenceListToggle{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-width:0;
  min-height:44px;
  padding:6px 8px;
  font-size:12px;
  font-weight:600;
  color:var(--muted);
  background:transparent;
  border:1px solid var(--line);
  white-space:normal;
  text-align:center;
  line-height:1.3
}

.compact-nav #sentenceListToggle .ui-icon{
  flex:none;
  width:16px;
  height:16px
}

.compact-nav #sentenceListToggle .disclosure{
  width:13px;
  height:13px;
  margin-left:auto
}

.compact-nav #sentenceListToggle[aria-expanded="true"]{
  color:var(--accent);
  border-color:var(--accent);
  background:var(--soft)
}

.compact-nav #sentenceListToggle[aria-expanded="true"] .disclosure{
  transform:rotate(180deg)
}

.compact-nav #sentenceList[hidden]{
  display:none!important
}

.compact-nav #sentenceList{
  border-top:1px solid var(--line);
  margin-top:8px;
  padding-top:10px
}

.compact-nav .day-stat{
  margin:0
}

.compact-nav #progress{
  width:100%;
  margin:4px 0 0
}

.compact-nav .grid-panel{
  margin-top:8px
}

.compact-nav #grid{
  grid-template-columns:repeat(auto-fill,minmax(44px,1fr));
  max-height:190px
}

.compact-nav .overall{
  border-top:1px solid var(--line);
  margin-top:10px;
  padding-top:10px;
  grid-template-columns:minmax(0,1fr) auto
}

.compact-nav .overall-stat{
  justify-content:flex-end
}

.compact-nav #nextStudyDay{
  margin-top:8px
}

.primary-column{
  gap:10px
}

@media(max-width:360px){
  .compact-nav #sentenceListToggle{
    font-size:11px;
    gap:4px;
    padding-inline:5px
  }
  .compact-nav #sentenceListToggle .disclosure{
    display:none
  }
  .compact-nav .overall{
    grid-template-columns:minmax(0,1fr) auto
  }
  .compact-nav .overall-stat{
    justify-content:flex-end
  }
}

/* One study-plan setting belongs with day navigation, not a separate panel. */
.compact-nav .goal-card{
  margin:12px 0 0;
  padding:12px 0 0;
  border:0;
  border-top:1px solid var(--line);
  border-radius:0;
  background:transparent
}

.compact-nav .plan-goal-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap
}

.compact-nav .goal-card .goal-label{
  margin:0;
  min-width:0;
  flex:1 1 110px;
  overflow-wrap:anywhere
}

.compact-nav .goal-control{
  flex:0 1 auto;
  justify-content:flex-end;
  gap:8px
}

.compact-nav .goal-control #goal{
  width:70px;
  max-width:none;
  flex:0 0 70px;
  font-size:16px
}

.compact-nav .goal-card #goalSummary{
  margin:6px 0 0
}

.compact-nav .goal-unit{
  max-width:120px
}

.workspace{
  grid-template-columns:minmax(0,1fr)
}

/* Balanced layout: shared card insets, predictable sentence grid and aligned metadata. */
main{
  --card-inset:20px;
  --section-gap:12px;
  --control-gap:8px;
  --section-label:12px
}

header{
  padding-block:16px;
  margin-bottom:8px
}

.app-nav{
  margin-bottom:12px;
  gap:0;
  padding-bottom:0
}

.primary-column{
  gap:var(--section-gap)
}

.resume-panel.compact-nav,.question-panel{
  padding-inline:var(--card-inset);
  border-radius:10px
}

.resume-panel.compact-nav{
  padding-block:8px
}

.compact-nav .compact-row{
  gap:var(--control-gap)
}

.compact-nav #day,.compact-nav #sentenceListToggle{
  font-size:13px;
  font-weight:650;
  min-height:44px;
  padding-left:12px
}

.compact-nav #sentenceListToggle{
  justify-content:flex-start;
  text-align:left;
  padding-right:12px;
  gap:8px
}

.compact-nav #sentenceList{
  margin-top:12px;
  padding-top:12px
}

.compact-nav .day-stat,.compact-nav .overall{
  color:var(--muted);
  font-size:var(--section-label);
  font-weight:600;
  line-height:1.5
}

.compact-nav .day-stat small{
  font-size:inherit;
  min-width:0;
  overflow-wrap:anywhere
}

.compact-nav .day-stat small:last-child{
  text-align:right
}

.compact-nav #progress,.compact-nav #overallProgress{
  height:5px;
  margin:6px 0 0
}

.compact-nav .grid-panel{
  margin-top:10px
}

.compact-nav #grid{
  grid-template-columns:repeat(10,minmax(0,1fr));
  gap:6px;
  padding:2px;
  max-height:198px;
  scrollbar-gutter:stable
}

.compact-nav #grid button{
  min-height:44px;
  padding:4px 2px;
  font-size:12px;
  border-radius:6px
}

.compact-nav .overall{
  margin-top:12px;
  padding-top:12px;
  gap:0 8px;
  grid-template-columns:minmax(0,1fr) auto
}

.compact-nav .overall-title,.compact-nav .overall-stat,.compact-nav .overall-stat>span:last-child{
  font-size:var(--section-label);
  font-weight:600;
  line-height:1.5
}

.compact-nav .overall-stat{
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:4px 8px
}

.compact-nav .goal-card{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:3px 12px;
  align-items:center;
  margin:12px 0 4px;
  padding:12px 0 0
}

.compact-nav .plan-goal-row{
  display:contents
}

.compact-nav .goal-card .goal-label{
  grid-column:1;
  grid-row:1;
  font-size:13px;
  font-weight:650;
  align-self:end;
  margin:0;
  line-height:1.5
}

.compact-nav .goal-card #goalSummary{
  grid-column:1;
  grid-row:2;
  align-self:start;
  margin:0;
  font-size:12px;
  line-height:1.5
}

.compact-nav .goal-control{
  grid-column:2;
  grid-row:1/3;
  justify-content:flex-end;
  gap:6px;
  min-width:0
}

.compact-nav .goal-control #goal{
  width:60px;
  flex:0 0 60px;
  min-height:44px;
  font-size:16px
}

.compact-nav .goal-unit{
  max-width:90px;
  font-size:12px;
  line-height:1.4
}

.question-panel{
  padding-block:20px
}

@media(max-width:760px){
  main{
    --card-inset:14px;
    --section-gap:10px
  }
  header{
    padding-block:12px;
    margin-bottom:6px
  }
  .app-nav{
    margin-bottom:10px
  }
  .question-panel{
    padding-block:14px
  }
}

@media(max-width:620px){
  .compact-nav #grid{
    grid-template-columns:repeat(5,minmax(0,1fr))
  }
}

@media(max-width:360px){
  main{
    --card-inset:12px;
    --section-label:11px
  }
  .compact-nav #day,.compact-nav #sentenceListToggle{
    font-size:12px;
    padding-left:8px
  }
  .compact-nav #sentenceListToggle{
    gap:5px;
    padding-right:8px
  }
  .compact-nav .goal-card{
    gap:3px 8px
  }
  .compact-nav .goal-control #goal{
    width:52px;
    flex-basis:52px
  }
  .compact-nav .goal-unit{
    max-width:65px;
    font-size:11px
  }
  .compact-nav .goal-card #goalSummary{
    font-size:11px
  }
  .compact-nav #grid{
    gap:5px;
    scrollbar-gutter:auto
  }
}

/* Component semantics: navigation, mutually exclusive choices, actions and switches. */
[hidden]{
  display:none!important
}

.app-nav [aria-current="page"]{
  color:var(--accent);
  border-bottom-color:var(--accent)
}

.app-page.plus-dialog{
  width:100%;
  max-height:none;
  overflow:visible;
  margin:0;
  padding:var(--card-inset,20px);
  border-radius:10px
}

.app-page .plus-head{
  margin-bottom:16px
}

.app-page .plus-head button{
  font-size:12px;
  min-height:44px;
  border:1px solid var(--line);
  padding:8px 12px
}

.app-page .plus-item button,.app-page .plus-tabs button{
  min-height:44px
}

.app-page .plus-head h2:focus{
  outline:none
}

.app-page .plus-tabs{
  margin-block:12px
}

.app-page .plus-tabs button{
  font-size:12px
}

.scope-options{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:4px;
  padding:4px;
  background:var(--soft);
  border-radius:8px;
  border:1px solid var(--line)
}

.scope-options button,.scope-options button.primary{
  min-height:44px;
  min-width:0;
  background:transparent;
  color:var(--muted);
  border:1px solid transparent;
  border-radius:6px;
  padding:6px;
  white-space:normal;
  overflow-wrap:anywhere;
  font-size:13px;
  font-weight:650
}

.scope-options button[aria-pressed=true]{
  background:var(--panel);
  color:var(--accent);
  border-color:var(--accent)
}

.scope-options button:disabled{
  opacity:.45
}

.playback-panel .day-order{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:8px
}

.playback-panel .settings label{
  min-width:0;
  overflow-wrap:anywhere;
  line-height:1.4
}

.playback-panel .settings select{
  min-height:44px
}

.playback-panel .day-loop{
  min-height:52px
}

.playback-panel .switch-control{
  min-width:42px
}

.navigation .button-label{
  overflow-wrap:normal
}

.navigation .nav-secondary,.navigation .nav-main{
  min-width:0
}

.question-panel[data-stage="ready"] #check:disabled{
  opacity:.48;
  cursor:not-allowed
}

.review-session #reviewExit{
  padding:8px 12px;
  font-size:12px
}

.app-page .plus-action{
  min-height:44px
}

.plus-dialog .plus-reset{
  color:var(--grade-error)
}

@media(max-width:480px){
  .app-page .plus-tabs button{
    font-size:11px
  }
  .scope-options button{
    font-size:12px
  }
  .navigation .button-label{
    overflow-wrap:anywhere
  }
  .playback-panel .settings{
    grid-template-columns:repeat(3,minmax(0,1fr))
  }
  .app-page .plus-summary{
    gap:6px
  }
}

/* Appearance preference: system, light or dark. */
:root[data-theme="light"]{
  color-scheme:light;
  --bg:#fafafa;
  --panel:#fff;
  --text:#202127;
  --muted:#666a73;
  --line:#dedfe3;
  --soft:#f0f1f4;
  --accent:#514bd0;
  --solid:#514bd0;
  --success:#16734a;
  --success-bg:#e7f4eb;
  --header:#fff;
  --grade-error:#a82b36
}

:root[data-theme="dark"]{
  color-scheme:dark;
  --bg:#15161a;
  --panel:#1b1c21;
  --text:#ededf0;
  --muted:#a3a5b0;
  --line:#35363e;
  --soft:#25262e;
  --accent:#aaa7ff;
  --solid:#625ce0;
  --success:#83d5a7;
  --success-bg:#23392e;
  --header:#15161a;
  --grade-error:#ff9ba5
}

#themeToggle{
  width:44px;
  min-width:44px;
  min-height:44px;
  padding:0;
  flex:none;
  background:transparent;
  color:var(--muted)
}

#themeToggle:hover{
  color:var(--accent);
  background:var(--soft)
}

#themeToggle svg{
  width:19px;
  height:19px
}

@media(max-width:480px){
  header{
    grid-template-columns:minmax(0,1fr) auto
  }
  .header-actions{
    gap:4px
  }
  .header-help{
    gap:3px
  }
  .header-help button,#themeToggle{
    width:36px;
    min-width:36px;
    min-height:44px
  }
  .header-actions .language{
    width:104px
  }
}

@media(max-width:360px){
  header{
    grid-template-columns:1fr;
    gap:8px
  }
  .brand{
    grid-column:1;
    grid-row:1
  }
  .header-actions{
    grid-column:1;
    grid-row:2;
    justify-content:space-between;
    width:100%
  }
  .header-actions .language{
    width:132px
  }
}

/* Show the initialized study layout together, rather than painting empty controls first. */
html[data-wfd-booting] main{
  visibility:hidden
}

.pwa-tools{
  display:grid;
  justify-items:center;
  grid-template-columns:minmax(0,1fr);
  gap:6px;
  min-block-size:calc(3 * 1.7em + 42px)
}

.pwa-state{
  min-block-size:3em;
  max-inline-size:100%;
  justify-content:center;
  text-align:center;
  overflow-wrap:anywhere
}

.pwa-tools button{
  max-inline-size:100%
}

.question-head #status{
  min-block-size:2.8em
}

/* Shared UX refinement: one hierarchy, contextual settings, no redundant labels. */
main { --section-label:13px; --control-gap:8px; }
.study-mode button { min-height:44px; font-size:14px; line-height:1.35; }
.memorize-heading { min-height:32px; gap:8px; margin-bottom:8px; }
.memorize-heading h2,.dictation-head h2 { font-size:13px; line-height:1.5; }
#typingCount { margin-left:auto; color:var(--accent); font-size:13px; font-weight:650; }
#typingProgress { width:100%; height:4px; margin:0 0 10px; display:block; }
.question-panel[data-study-mode="typing"] #typingArea { margin-top:12px; }
#typingInput,#typed,.plus-dialog textarea { font-size:16px; line-height:1.6; min-height:96px; padding:12px; }
#typingInput { margin:0; }
#typingInput:focus,#typed:focus,.plus-dialog textarea:focus { outline:2px solid var(--accent); outline-offset:1px; }
#typingInput[aria-invalid="true"] { border-color:var(--grade-error); }
.typing-meta { min-height:20px; margin-top:6px; font-size:12px; }
#typingLength { margin-left:auto; }
#translationArea #translationToggle { min-height:44px; padding:6px 0; background:transparent; border:0; color:var(--muted); font-size:13px; }
#translationArea #korean { margin-top:0; font-size:14px; line-height:1.65; }
.question-panel[data-study-mode="typing"] #translationArea { margin-top:2px; }
#typingSettings { border-top:1px solid var(--line); padding-top:12px; margin-top:12px; }
#typingSettings label { display:grid; grid-template-columns:minmax(0,1fr) minmax(100px,36%); gap:12px; align-items:center; font-size:13px; font-weight:600; }
#typingSettings select { min-height:44px; font-size:16px; }
/* Detailed instructions belong to the guide; contextual state stays in the fold. */
#dayOrderHelp,#dayLoopHelp { position:absolute!important; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.app-page .plus-head { margin-bottom:16px; }
.app-page .plus-head h2,.help-head h2 { font-size:20px; line-height:1.4; }
.app-page .plus-stat { padding:12px; background:var(--soft); border:0; border-radius:8px; }
.app-page .plus-stat strong { color:var(--text); font-variant-numeric:tabular-nums; line-height:1.3; font-size:24px; }
.app-page .plus-stat small,.plus-note,.plus-item small { font-size:13px; line-height:1.55; }
.app-page .plus-tabs button { font-size:13px; line-height:1.4; }
.empty-state { padding:24px 12px; margin:0; color:var(--muted); font-size:14px; line-height:1.6; text-align:center; }
.plus-item { padding:14px 0; gap:12px; }
.plus-item strong { font-size:15px; }
.plus-item button { font-size:13px; }
.plus-reset { border:0; width:auto; margin:16px auto 0; padding:10px 14px; }
.exam-rules { background:var(--soft); border-radius:8px; padding:16px; font-size:15px; line-height:1.65; }
.exam-rules p { margin:0; }
.exam-rule-list { margin:0; padding-left:20px; display:grid; gap:8px; }
.exam-status { background:var(--soft); border:0; font-variant-numeric:tabular-nums; }
.exam-score { font-size:32px; line-height:1.35; font-variant-numeric:tabular-nums; color:var(--text); }
.exam-answer { padding:16px; }
.help-body p,.help-steps p { font-size:14px; line-height:1.7; }
.help-steps strong { font-size:15px; }
button:focus-visible,summary:focus-visible,select:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
@media(max-width:480px){
  .study-mode button,.app-page .plus-tabs button { font-size:12px; }
  .app-page .plus-stat { padding:9px; }
  .app-page .plus-stat strong { font-size:20px; }
  .app-page .plus-stat small { font-size:12px; }
  .exam-answer { padding:12px; }
}

/* Final agreed information hierarchy. */
.study-mode { grid-template-columns:repeat(2,minmax(0,1fr)); }
.typing-toggle { display:flex; align-items:center; gap:8px; min-height:44px; font-size:13px; font-weight:600; cursor:pointer; margin-left:auto; }
.typing-toggle .switch-control { flex:none; }
#typingCount { margin-left:0; white-space:nowrap; }
#typingLength { margin-left:0; }
.typing-meta { flex-wrap:wrap; }
#typingProgress[hidden] { display:none; }
#translationArea { margin-top:6px; }
#translationArea #translationToggle { text-align:left; }
.plan-summary { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 0; border-bottom:1px solid var(--line); margin-bottom:14px; }
.plan-summary>div { display:grid; gap:4px; min-width:0; }
.plan-summary-title { color:var(--muted); font-size:12px; }
#goalSummary { font-size:14px; line-height:1.5; }
#planChange { flex:none; color:var(--accent); background:transparent; border:0; font-weight:650; min-height:44px; padding:8px; font-size:13px; }
.plan-dialog { width:min(540px,calc(100% - 24px)); }
#planForm { display:grid; gap:16px; }
.plan-current { display:grid; gap:6px; border-bottom:1px solid var(--line); padding-bottom:16px; }
.plan-current>span { font-size:13px; color:var(--muted); }
.plan-current strong { font-size:18px; }
#planForm h3 { margin:0; font-size:15px; }
.plan-presets { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.plan-presets button { min-height:44px; padding:8px 4px; font-size:13px; overflow-wrap:anywhere; }
.plan-presets button[aria-pressed=true] { color:var(--accent); border-color:var(--accent); background:var(--soft); }
.plan-custom { display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:13px; }
.plan-custom label { margin-right:auto; }
.plan-custom input { width:82px; min-height:44px; text-align:center; font-size:16px; }
.plan-preview { padding:12px; border-radius:8px; background:var(--soft); font-size:13px; }
.plan-preview>div { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.plan-preview strong { color:var(--accent); font-size:16px; }
.plan-preview p { margin:8px 0 0; color:var(--muted); font-size:12px; }
.plan-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.plan-actions button { min-height:44px; }
#planError { color:var(--grade-error); font-size:13px; margin:0; }
@media(max-width:360px){.plan-presets { grid-template-columns:repeat(2,minmax(0,1fr)); }}
.typing-toggle input { position:absolute; inset:0; opacity:0; width:100%; height:100%; margin:0; padding:0; min-height:0; cursor:pointer; z-index:1; }
.typing-toggle input:checked+.switch-track { background:var(--solid); border-color:var(--solid); }
.typing-toggle input:checked+.switch-track::after { transform:translateX(16px); background:white; }
.typing-toggle input:focus-visible+.switch-track { outline:2px solid var(--accent); outline-offset:3px; }
#planApply:not(:disabled) { background:var(--solid); border-color:var(--solid); color:#fff; }
#planApply:disabled { opacity:.55; cursor:not-allowed; }

/* Compact plan: one header row, one always-visible progress bar. */
.resume-panel.compact-nav { padding-block:4px 12px; }
.compact-nav .compact-row { grid-template-columns:minmax(0,1fr) minmax(0,auto); gap:8px; }
.compact-nav #day { background-color:transparent; border:1px solid transparent; width:100%; padding-left:0; padding-right:24px; background-position:right 5px center; font-weight:650; }
.compact-nav #sentenceListToggle { border:1px solid transparent; color:var(--accent); background:transparent; padding:6px 0 6px 8px; justify-content:flex-end; gap:6px; font-weight:600; }
.compact-nav #sentenceListToggle[aria-expanded="true"] { background:transparent; border-color:transparent; }
.compact-nav #sentenceListToggle .disclosure { margin-left:0; }
.compact-nav #sentenceListToggle:hover { background:var(--soft); }
.compact-nav #progress { margin:0; height:4px; }
.compact-nav #sentenceList { border-top:0; padding-top:0; margin-top:8px; }
.compact-nav .plan-summary { padding:0; margin:0 0 6px; gap:8px; border-bottom:1px solid var(--line); min-height:44px; }
.compact-nav #goalSummary { font-size:13px; font-weight:600; min-width:0; overflow-wrap:anywhere; color:var(--muted); }
.compact-nav #planChange { padding:6px 0 6px 8px; font-size:12px; max-width:44%; white-space:normal; }
.compact-nav .grid-panel { margin-top:6px; }
.compact-nav .overall { margin-top:8px; padding-top:8px; }
.compact-nav #overallProgress { height:4px; }
.study-mode { padding:2px; margin-bottom:12px; border-color:transparent; }
.study-mode button { min-height:44px; }

/* Agreed compact UI: only meaningful labels, shared native switches. */
.compact-nav .compact-row{grid-template-columns:minmax(0,1fr) auto;}
.compact-nav #day{width:auto;max-width:100%;justify-self:start;min-width:0;}
.session-progress{display:flex;justify-content:space-between;align-items:baseline;gap:6px 12px;flex-wrap:wrap;margin:0 0 6px;font-size:12px;color:var(--muted);line-height:1.5;}
#progressText{font-weight:600;color:var(--text);text-align:end;flex:1 1 auto;}
.plan-grid-label{font-size:13px;font-weight:600;margin:6px 0 8px;color:var(--muted);}
.compact-nav .overall{align-items:baseline;grid-template-columns:minmax(0,1fr) auto;}
.compact-nav #overallText{margin:0;font-weight:600;color:var(--text);text-align:end;max-width:100%;overflow-wrap:anywhere;}
.compact-nav .overall-title{min-width:0;overflow-wrap:anywhere;}
#number{font-size:clamp(18px,3.8vw,24px);letter-spacing:-.35px;line-height:1.35;overflow-wrap:anywhere;}

.question-head{grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);}
.question-head #status:empty{display:none;}
.question-head #status{min-block-size:0;}
.memorize-heading{justify-content:flex-end;gap:4px 18px;margin:0 0 5px;min-height:0;}
.memorize-heading .typing-toggle{margin-left:0;gap:6px;min-height:44px;font-size:13px;font-weight:500;}
.typing-meta{display:flex;align-items:center;gap:8px;margin-top:6px;}
#typingFeedback:empty{display:none;}
.typing-meter{flex:1 1 75px;min-width:0;}
#typingProgress{margin:0;height:4px;}
#typingProgress[hidden]{display:none!important;}
#typingCount{margin-left:auto;white-space:nowrap;}
#translationArea:has(#korean[hidden]){display:none;}
#translationArea #korean{margin-top:0;}
@media(max-width:480px){.compact-nav .overall{grid-template-columns:1fr;gap:4px}.compact-nav #overallText{text-align:start}.compact-nav #overallProgress{grid-column:1/-1}.memorize-heading{gap:2px 12px;}}

#goalDuration { line-height:1.4; }
.plan-preview>div { display:grid; gap:6px; }
.plan-preview strong { font-size:24px; }
.plan-record-note { margin:0; font-size:12px; color:var(--muted); }
.compact-nav .plan-summary { padding:6px 0; }

.plan-duration-note { color:var(--muted); font-size:12px; margin:4px 0 0; }

/* Study layout rhythm: a shared inset and 4/8px spacing scale.
   Keep 44px interactive targets; compact the surrounding whitespace instead. */
main { --card-inset:24px; --section-gap:16px; --control-gap:8px; }
@media(max-width:760px){ main { --card-inset:16px; --section-gap:12px; } }
@media(max-width:360px){ main { --card-inset:12px; --section-gap:8px; } }
.resume-panel.compact-nav { padding:8px var(--card-inset) 12px; }
.compact-nav .compact-row { align-items:center; margin-bottom:4px; }
.compact-nav #day { width:auto; min-width:88px; max-width:100%; padding:8px 28px 8px 12px; border:1px solid var(--line); background-color:var(--panel); background-position:right 8px center; }
.compact-nav #sentenceListToggle { padding:8px 0 8px 8px; }
.session-progress { gap:4px 8px; margin:8px 0 6px; }
.compact-nav #progress { margin:0; }
.question-panel { padding:var(--card-inset); }
#studyPanel .study-mode { margin:0 0 12px; padding:3px; gap:4px; }
#studyPanel .study-mode button { font-size:14px; }
#studyPanel .question-head { grid-template-columns:auto minmax(0,1fr); align-items:center; gap:12px; min-height:40px; margin:0 0 8px; }
#number { font-size:28px; font-weight:750; letter-spacing:-1px; line-height:1.2; white-space:nowrap; }
#studyPanel #meta { display:block; font-size:12px; line-height:1.5; }
#studyPanel #status { font-size:12px; line-height:1.5; margin-top:2px; }
#studyPanel .audio-box { margin:0; padding:8px 0; gap:12px; }
#studyPanel .playback-fold { margin:0; }
#studyPanel .playback-fold summary { min-height:44px; padding:4px 0; flex-wrap:nowrap; gap:8px; }
#studyPanel .playback-title { flex:0 1 auto; }
#studyPanel #playbackSummary { flex:0 1 auto; max-width:65%; }
#studyPanel .fold-chevron { flex:none; }
#studyPanel:is([data-study-mode="memorize"],[data-study-mode="typing"]) .answer { margin:8px 0 0; }
#studyPanel:is([data-study-mode="memorize"],[data-study-mode="typing"]) #answer { padding:0 0 16px; }
#studyPanel .memorize-heading { justify-content:flex-end; align-items:center; gap:4px 16px; margin:0 0 8px; }
#studyPanel .memorize-heading .typing-toggle { min-height:44px; gap:8px; }
#studyPanel:is([data-study-mode="memorize"],[data-study-mode="typing"]) #english { font-size:clamp(20px,3vw,25px); line-height:1.5; }
#studyPanel #translationArea { margin-top:8px; }
#studyPanel .navigation { margin:12px 0 0; padding:12px 0 0; gap:8px; }
#studyPanel .navigation button { min-height:44px; }
#studyPanel:is([data-study-mode="memorize"],[data-study-mode="typing"]):not([data-reviewing="true"]) .navigation { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
#studyPanel:is([data-study-mode="memorize"],[data-study-mode="typing"]):not([data-reviewing="true"]) .navigation :is(.nav-secondary,.nav-main) { display:contents; }
@media(max-width:360px){
  #number { font-size:24px; }
  #studyPanel .study-mode button { font-size:13px; }
  #studyPanel .playback-fold summary { gap:4px; flex-wrap:wrap; }
  #studyPanel #playbackSummary { max-width:60%; }
  #studyPanel .memorize-heading { gap:4px 12px; }
}
.compact-nav #grid { scrollbar-gutter:auto; }
.compact-nav .overall { grid-template-columns:minmax(0,1fr) minmax(0,1.6fr); gap:6px 8px; }
.compact-nav #overallText { text-align:end; }
.compact-nav #overallProgress { grid-column:1/-1; }

/* Final study content polish: matched section labels, fine audio waveform, integrated input count. */
#studyPanel .memorize-heading { justify-content:flex-start; column-gap:16px; row-gap:0; }
#studyPanel .memorize-heading h2 { flex:1 1 auto; min-width:0; color:var(--muted); font-size:13px; line-height:1.5; }
#studyPanel .memorize-heading .typing-toggle { flex:none; }
#studyPanel .wave { height:28px; gap:1px; }
#studyPanel .wave i { position:relative; background:transparent; border-radius:0; }
#studyPanel .wave i::before { content:""; position:absolute; inset-block:0; left:50%; transform:translateX(-50%); width:min(100%,3px); border-radius:2px; background:var(--line); }
#studyPanel .wave .wave-fill i::before { background:var(--accent); }
#studyPanel .wave .wave-fill i { background:transparent; }
#dictationArea .dictation-head h2 { color:var(--muted); font-size:13px; line-height:1.5; }
#dictationArea .dictation-field { border:1px solid var(--line); border-radius:6px; background:var(--bg); }
#dictationArea .dictation-field:focus-within { outline:2px solid var(--accent); outline-offset:2px; }
#dictationArea #typed { border:0; border-radius:6px 6px 0 0; background:transparent; outline:none; min-height:96px; padding:12px; }
#dictationArea .input-meta { margin:0; padding:0 12px 8px; min-height:24px; align-items:center; }
#dictationArea .practice-actions { margin-top:12px; }
@media(max-width:480px){
  #studyPanel .memorize-heading { column-gap:10px; }
  #studyPanel .wave { gap:0.6px; }
  #studyPanel .wave i::before { width:min(100%,2px); }
}

/* Shared practice, review and simulation components. */
#reviewDialog .plus-head { margin:0; padding:0; border:0; }
#reviewTitle { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
#reviewDialog .plus-summary { margin:0 0 12px; }
#reviewBody .plus-item { padding:12px 0; }
#reviewBody .plus-list { margin-top:8px; }
#reviewBody details summary, .exam-answer summary { cursor:pointer; list-style:none; }
#reviewBody details summary::-webkit-details-marker,.exam-answer summary::-webkit-details-marker { display:none; }
#reviewBody details summary::after,.exam-answer summary::after { content:''; display:inline-block; width:7px;height:7px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg);margin:0 4px 3px 8px; flex:none; }
#reviewBody details[open]>summary::after,.exam-answer[open]>summary::after { transform:rotate(225deg);margin-bottom:0; }
#reviewBody details:not(.weak-entry):not(.record-manage)>summary { font-size:13px; color:var(--muted); min-height:32px; display:flex; align-items:center; }
.weak-entry { border-bottom:1px solid var(--line); }
.weak-entry>summary { min-height:56px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 0; }
.weak-entry strong { font-size:15px; }
.weak-entry small { display:block;color:var(--muted);font-size:13px;line-height:1.5; }
.weak-details { background:var(--soft);border-radius:8px;padding:4px 12px 12px;margin:0 0 12px; }
.history-attempt { background:var(--soft);padding:10px 12px;border-radius:6px;margin:6px 0;overflow-wrap:anywhere; }
.history-attempt p { margin:4px 0 0;color:var(--text);font-size:14px;line-height:1.5; }
.record-manage { border-top:1px solid var(--line);margin-top:12px; }
.record-manage>summary { min-height:44px;display:flex;align-items:center;justify-content:space-between;font-weight:600;color:var(--muted);font-size:13px; }
.record-actions { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px; }
.record-actions button,.exam-again { min-height:44px; padding:8px 12px; }
.exam-again { width:100%;margin-top:8px; }
.review-notice { padding:10px 12px;border-radius:8px;background:var(--soft);font-size:13px;color:var(--text);margin:0 0 12px; }
#studyPanel[data-reviewing="true"] .utility { grid-template-columns:1fr; }
#studyPanel[data-reviewing="true"] #mark { display:none!important; }
#check:not(:disabled) { background:var(--solid);color:white;border-color:var(--solid); }
#check:disabled { opacity:.5;cursor:not-allowed; }
#examBody .dictation-field { border:1px solid var(--line);border-radius:6px;background:var(--bg);margin-top:12px; }
#examBody .dictation-field:focus-within { outline:2px solid var(--accent);outline-offset:2px; }
#examBody .dictation-field textarea { display:block;border:0;outline:none;background:transparent;min-height:96px;padding:12px; }
#examBody .input-meta { margin:0;padding:0 12px 8px;min-height:24px;text-align:right;display:flex;justify-content:flex-end;font-size:12px;color:var(--muted); }
#result .grade-progress,.shared-grade .grade-progress { width:100%;height:4px;display:block;margin:0 0 12px;accent-color:var(--accent); }
#result .grade-legend,.shared-grade .grade-legend { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin:0 0 12px;align-items:stretch; }
.grade-metric { display:flex;flex-direction:column;gap:2px;align-items:center;justify-content:center;text-align:center;background:var(--bg);border-radius:6px;padding:8px 4px;overflow-wrap:anywhere; }
.grade-metric strong { font-size:19px;font-variant-numeric:tabular-nums; }
.grade-metric small { font-size:11px;color:var(--muted);line-height:1.4;text-decoration:none;font-weight:500; }
#result .grade-metric,.shared-grade .grade-metric { text-decoration:none; }
#result .grade-wrong,.shared-grade .grade-wrong { color:var(--grade-error);text-decoration:underline solid;text-underline-offset:3px;font-weight:650; }
#result .grade-metric.grade-wrong,.shared-grade .grade-metric.grade-wrong { text-decoration:none; }
#result .grade-percent,.shared-grade .grade-percent { color:var(--accent);font-size:20px;font-weight:700; }
.shared-grade { margin-top:12px;line-height:1.65; }
.shared-grade .grade-top { display:flex;justify-content:space-between;gap:8px;margin-bottom:10px; }
.shared-grade .grade-score { font-size:22px;font-weight:750; }
.shared-grade .grade-label,.shared-grade .grade-note { color:var(--muted);font-size:12px; }
.shared-grade .grade-correct,.shared-grade .grade-perfect { color:var(--success); }
.shared-grade .grade-missing,.shared-grade .grade-extra { color:var(--grade-error); }
.shared-grade .grade-words .grade-missing { text-decoration:underline dotted;text-underline-offset:3px; }
.shared-grade .grade-words { line-height:2;font-size:16px;overflow-wrap:anywhere; }
.shared-grade .grade-note { margin-top:8px; }
.exam-answer>summary { display:flex;align-items:center;justify-content:space-between;min-height:28px;font-weight:650; }
.exam-answer:not([open]) { padding-block:8px; }
@media(max-width:360px){ .grade-metric small { font-size:10px; } .grade-metric strong { font-size:16px; } }

.weak-history-row { display:flex; justify-content:space-between; align-items:center; min-height:40px; gap:8px; padding:6px 0; border-bottom:1px solid var(--line); font-size:14px; }
.weak-history-row small { color:var(--muted); font-variant-numeric:tabular-nums; }
#studyPanel[data-study-mode="dictation"] .memorize-heading { margin-top:8px; }

/* Task-first review and practice flow. */
.flow-progress{display:block;width:100%;height:4px;accent-color:var(--accent);margin:0 0 12px;}
#studyPanel .review-session{display:grid;grid-template-columns:1fr auto;align-items:center;gap:8px 12px;margin:0 0 12px;}
#studyPanel .review-session[hidden]{display:none!important;}
#reviewMeter{grid-column:1/-1;margin:0;}
#reviewBody .plus-item{padding:10px 0;align-items:start;}
.flow-sentence-head{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;}
.flow-sentence-head small{font-variant-numeric:tabular-nums;}
#reviewBody .flow-more,.flow-secondary{width:100%;min-height:44px;margin:8px 0 0;font-size:13px;}
#reviewBody .weak-entry>summary{min-height:52px;gap:8px;padding:8px 0;}
#reviewBody .weak-entry>summary>div{flex:1;min-width:0;}
#reviewBody .weak-total{text-align:end;flex:none;}
#reviewBody .weak-details{padding:0 12px 8px;margin-bottom:8px;}
#reviewBody .weak-details .plus-item:last-child{border-bottom:0;}
#reviewBody .weak-details .plus-item button{min-height:44px;}
#reviewBody .weak-history-row{min-height:32px;}
#reviewBody .record-manage{margin-top:12px;}
.exam-intro-copy{font-size:14px;line-height:1.6;margin:0 0 16px;color:var(--muted);}
.exam-facts .plus-stat strong{font-size:24px;}
.exam-result-hero{margin:0 0 12px;}
.exam-result-hero>small{font-size:13px;color:var(--muted);}
.exam-result-hero>.exam-score{margin:4px 0;}
.exam-result-hero>.plus-note{margin:0 0 12px;}
.app-page .exam-result-stats{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;}
.exam-result-stats .plus-stat strong{font-size:20px;}
.exam-result-stats .plus-stat small{overflow-wrap:anywhere;}
.exam-result-actions{display:grid;gap:8px;}
.exam-result-actions button{margin:0;min-height:44px;}
.flow-section-title{font-size:14px;margin:20px 0 8px;font-weight:650;}
.exam-detail-list .exam-answer{padding:0 12px;margin:0 0 8px;}
.exam-detail-list .exam-answer>summary{min-height:44px;justify-content:flex-start;gap:12px;}
.exam-detail-list .exam-answer>summary span{margin-left:auto;font-variant-numeric:tabular-nums;}
.flow-perfect{color:var(--success);}
.flow-score{color:var(--muted);}
.flow-answer{padding:10px 0;border-top:1px solid var(--line);overflow-wrap:anywhere;}
.flow-answer>small{color:var(--muted);font-size:12px;}
.flow-answer>p{margin:4px 0 0;font-size:15px;line-height:1.6;}
.exam-detail-list .shared-grade{margin:0 0 12px;}
.flow-errors{display:grid;gap:10px;}
.flow-error-row{display:grid;gap:4px;}
.flow-error-label{font-size:12px;color:var(--muted);font-weight:600;}
.flow-error-words{display:flex;flex-wrap:wrap;gap:6px;}
.flow-error-token{display:inline-flex;flex-wrap:wrap;align-items:baseline;gap:4px;max-width:100%;padding:4px 8px;background:var(--bg);border:1px solid var(--line);border-radius:6px;font-size:14px;line-height:1.5;overflow-wrap:anywhere;}
.flow-error-token>*{max-width:100%;overflow-wrap:anywhere;}
.flow-arrow{color:var(--muted);}
#result .flow-error-token :is(.grade-wrong,.grade-missing),.shared-grade .flow-error-token :is(.grade-wrong,.grade-missing){color:var(--text);text-decoration:none;}
#result .flow-error-token .word-audio{min-height:28px;padding:0;}
#result .grade-top{align-items:center;margin-bottom:10px;}
#result .grade-note{margin-top:12px;}
#studyPanel[data-stage="checked"] .dictation-field textarea{min-height:48px;height:auto;resize:none;}
#studyPanel[data-stage="checked"] .dictation-field .input-meta{display:none;}
#studyPanel[data-stage="checked"] #reveal{display:none!important;}
#studyPanel[data-stage="checked"][data-reviewing="true"] .utility{display:none;}
#studyPanel[data-reviewing="true"] #attemptSummary[hidden]{display:none!important;}
@media(max-width:480px){.app-page .exam-result-stats{grid-template-columns:repeat(2,minmax(0,1fr));}.exam-facts .plus-stat strong{font-size:20px;}}

#reviewBody>.plus-tabs{margin:0 0 12px;}
#reviewBody .weak-context{font-size:13px;color:var(--text);line-height:1.5;overflow-wrap:anywhere;}
#reviewBody .weak-details .plus-item>div{min-width:0;}
#studyPanel[data-stage="checked"] .dictation-head,#studyPanel[data-stage="checked"] .dictation-field{display:none;}
#studyPanel[data-stage="checked"] #result{margin-top:0;}
#studyPanel[data-stage="checked"] .utility:has(#reveal[hidden]){display:flex;justify-content:flex-end;}
#studyPanel[data-stage="checked"][data-reviewing="true"] .utility{display:none;}
#studyPanel[data-stage="checked"] .utility #mark{flex:none;width:auto;min-height:44px;}
#result .flow-answer{margin:0 0 8px;border-top:0;padding:0 0 10px;border-bottom:1px solid var(--line);}
#result .flow-answer p{font-size:14px;line-height:1.6;}
#result .flow-error-words .flow-error-token{min-height:36px;}
#result .grade-note{font-size:11px;}

/* Review actions follow the answer state; preserve a common navigation grid. */
#reviewMeter[hidden]{display:none!important;}
#studyPanel[data-reviewing="true"]:not([data-stage="checked"]) .utility{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0;}
#studyPanel[data-reviewing="true"]:not([data-stage="checked"]) .utility button{min-height:44px;border:1px solid var(--line);border-radius:6px;font-size:13px;}
#studyPanel[data-reviewing="true"]:not([data-stage="checked"]) .navigation{display:none;}
#studyPanel[data-reviewing="true"][data-stage="checked"] .nav-main{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));}
#studyPanel:not([data-reviewing="true"])[data-stage="checked"] .navigation{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;}
#studyPanel:not([data-reviewing="true"])[data-stage="checked"] .navigation :is(.nav-secondary,.nav-main){display:contents;}
#studyPanel:not([data-reviewing="true"])[data-stage="checked"] .navigation button{min-width:0;padding-inline:5px;}
#studyPanel:not([data-reviewing="true"])[data-stage="checked"] #redoAttempt{grid-column:1/-1;grid-row:1;}
#studyPanel:not([data-reviewing="true"])[data-stage="checked"] :is(#prev,#shuffle,#next){grid-row:2;}
#examDialog[data-phase="landing"] .plus-head{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;margin:0;padding:0;border:0;}
#reviewBody .record-storage-note{margin:8px 0 0;font-size:12px;}

/* Review actions and read-only analysis: one separator per boundary. */
#reviewBody .plus-list > .flow-sentence {border-bottom:0;}
#reviewBody .plus-list > .flow-sentence + .flow-sentence {border-top:1px solid var(--line);}
#reviewBody .weak-column-head {display:flex;justify-content:space-between;gap:8px;padding:4px 0 8px;color:var(--muted);font-size:12px;}
#reviewBody .read-only-words .weak-history-row {min-height:40px;border-bottom:0;border-top:1px solid var(--line);}
#reviewBody .read-only-history {border-bottom:0;}
#reviewBody .read-only-history + .read-only-history {border-top:1px solid var(--line);}
#reviewBody details.read-only-history > summary {min-height:48px;display:flex;gap:10px;font-size:14px;color:var(--text);}
#reviewBody .history-score {margin-inline-start:auto;color:var(--muted);font-size:13px;font-variant-numeric:tabular-nums;}
#reviewBody .history-score.flow-perfect,#reviewBody .history-attempt-score.flow-perfect {color:var(--success);}
#reviewBody .read-only-history[open] .history-score {visibility:hidden;}
#reviewBody .history-attempts {padding-bottom:10px;}
#reviewBody .history-attempt-meta {display:flex;align-items:baseline;justify-content:space-between;gap:8px;flex-wrap:wrap;}
#reviewBody .history-attempt-meta strong {font-size:13px;font-variant-numeric:tabular-nums;}
#reviewBody .history-attempt p {margin-top:6px;}
#studyPanel[data-reviewing="true"]:not([data-stage="checked"]) #dictationArea .utility {display:flex;justify-content:space-between;gap:8px;margin:4px 0 0;}
#studyPanel[data-reviewing="true"]:not([data-stage="checked"]) #dictationArea .utility button {border-color:transparent;min-height:44px;width:auto;padding:0 8px;}
#studyPanel[data-reviewing="true"]:not([data-stage="checked"]) #dictationArea .practice-actions {margin-top:4px;}
#studyPanel[data-reviewing="true"]:not([data-stage="checked"]) .answer:has(>#answer.hidden) {display:none;}
