/* Only phone/tablet practice screens. Library and desktop styles are unchanged. */
html[data-compact-device] body[data-view="practice"]{
  --compact-header:52px;
  --compact-gap:10px;
  min-height:100dvh;
}
html[data-compact-device] body[data-view="practice"] .topbar{height:var(--compact-header);padding-inline:20px}
html[data-compact-device] body[data-view="practice"] .top-meta>span{display:none}
html[data-compact-device] body[data-view="practice"] .workspace{
  height:calc(100dvh - var(--compact-header));
  min-height:0;
  max-width:1200px;
  padding:12px 18px max(10px,env(safe-area-inset-bottom));
}
html[data-compact-device] body[data-view="practice"] .trainer{height:100%;display:flex;flex-direction:column;min-height:0}
html[data-compact-device] body[data-view="practice"] .trainer-top{flex:none;min-height:46px;margin-bottom:var(--compact-gap);gap:12px;align-items:center}
html[data-compact-device] body[data-view="practice"] .practice-heading{display:flex;align-items:center;gap:16px}
html[data-compact-device] body[data-view="practice"] .back-library{margin:0;min-height:36px}
html[data-compact-device] body[data-view="practice"] .practice-title-line h2{font-size:1.2rem}
html[data-compact-device] body[data-view="practice"] #trainerBody{flex:1;min-height:0;display:flex;flex-direction:column;gap:var(--compact-gap)}
html[data-compact-device] body[data-view="practice"] .practice-stage{flex:1;min-height:0;border-radius:16px;box-shadow:none;display:grid;grid-template-columns:1.05fr 1fr;overflow:visible}
html[data-compact-device] body[data-view="practice"] .practice-visual{min-height:0;min-width:0;padding:18px 22px;display:flex;flex-direction:column;border-radius:16px 0 0 16px}
html[data-compact-device] body[data-view="practice"] .case-ident{flex:none;margin:0;min-height:22px}
html[data-compact-device] body[data-view="practice"] .case-progress{display:none}
html[data-compact-device] body[data-view="practice"] .trainer-cube{flex:1;min-height:0;height:auto}
html[data-compact-device] body[data-view="practice"] .cube-figure{width:clamp(180px,27dvh,260px);max-width:calc(100% - 68px)}
html[data-compact-device] body[data-view="practice"] .trainer-cube img{width:100%;height:auto;max-height:min(32dvh,260px);object-fit:contain}
html[data-compact-device] body[data-view="practice"] .favorite-button{right:-40px;top:0;width:36px;height:36px;font-size:1.4rem}
html[data-compact-device] body[data-view="practice"] .setup-box{flex:none;margin:8px 0 0;padding:10px 12px;border-radius:9px}
html[data-compact-device] body[data-view="practice"] .setup-label span:last-child{display:none}
html[data-compact-device] body[data-view="practice"] .setup-box .algorithm-text{font-size:.86rem;line-height:1.5;margin-top:3px}
html[data-compact-device] body[data-view="practice"] .practice-timing{padding:20px 22px;border-radius:0 16px 16px 0;min-width:0;min-height:0}
html[data-compact-device] body[data-view="practice"] :is(.timing-eyebrow,.timer-instruction,.keyboard-tip){display:none}
html[data-compact-device] body[data-view="practice"] .timer-row{gap:12px}
html[data-compact-device] body[data-view="practice"] .timer{font-size:clamp(2.6rem,5.5vw,4rem);line-height:1.1}
html[data-compact-device] body[data-view="practice"] .timer-button{min-height:48px;padding:10px;font-size:.95rem}
html[data-compact-device] body[data-view="practice"] .previous-case-card{margin-top:16px;min-height:76px;grid-template-columns:60px minmax(0,1fr);gap:12px;padding:8px 10px}
html[data-compact-device] body[data-view="practice"] .previous-case-figure{height:58px}
html[data-compact-device] body[data-view="practice"] .previous-case-figure img{width:54px;height:54px}
html[data-compact-device] body[data-view="practice"] .previous-case-info>p:not(.last-solve-time){display:none}
html[data-compact-device] body[data-view="practice"] .practice-navigation{margin-top:12px;gap:8px}
html[data-compact-device] body[data-view="practice"] .practice-navigation button{min-height:42px;padding:9px 5px}
html[data-compact-device] body[data-view="practice"] .practice-timing #currentButton{min-height:28px;margin-top:4px}
html[data-compact-device] body[data-view="practice"] .formula-details{flex:none;margin:0;padding:0 14px;border-radius:10px}
html[data-compact-device] body[data-view="practice"] .formula-details summary{padding:10px 0;font-size:.8rem;min-height:36px}
html[data-compact-device] body[data-view="practice"] .formula-panel{margin:0 0 10px;gap:8px;grid-template-columns:repeat(2,minmax(0,1fr))}
html[data-compact-device] body[data-view="practice"] .formula-panel>div{padding:9px 11px;min-width:0}
html[data-compact-device] body[data-view="practice"] .formula-panel p{font-size:.86rem;line-height:1.5;margin-top:3px;overflow-wrap:anywhere}
html[data-compact-device] body[data-view="practice"] .practice-utilities{flex:none;margin:0;min-height:32px;gap:24px}
html[data-compact-device] body[data-view="practice"] .practice-utilities button{min-height:32px;padding:7px 4px;font-size:.72rem}
html[data-compact-device] body[data-view="practice"] :is(.completion-state,.trainer-empty){flex:1;min-height:0;padding:24px 16px}
@media(max-width:600px){
  html[data-compact-device] body[data-view="practice"]{--compact-header:44px;--compact-gap:8px}
  html[data-compact-device] body[data-view="practice"] .topbar{padding-inline:12px}
  html[data-compact-device] body[data-view="practice"] .brand{font-size:.9rem;gap:7px}
  html[data-compact-device] body[data-view="practice"] .brand-mark{width:22px;height:22px}
  html[data-compact-device] body[data-view="practice"] .theme-toggle{min-height:30px;padding:5px 7px;font-size:.65rem}
  html[data-compact-device] body[data-view="practice"] .workspace{padding:8px 12px max(8px,env(safe-area-inset-bottom))}
  html[data-compact-device] body[data-view="practice"] .trainer-top{min-height:38px;margin-bottom:6px}
  html[data-compact-device] body[data-view="practice"] .practice-heading{display:block}
  html[data-compact-device] body[data-view="practice"] .back-library{font-size:.65rem;min-height:20px;padding:0}
  html[data-compact-device] body[data-view="practice"] .practice-title-line h2{font-size:1.03rem}
  html[data-compact-device] body[data-view="practice"] .practice-stats{gap:12px}
  html[data-compact-device] body[data-view="practice"] .practice-stats strong{font-size:1rem}
  html[data-compact-device] body[data-view="practice"] .practice-stats span{font-size:.6rem}
  html[data-compact-device] body[data-view="practice"] .practice-stage{display:flex;flex-direction:column;border-radius:13px}
  html[data-compact-device] body[data-view="practice"] .practice-visual{flex:1;padding:10px 14px 9px;border-radius:13px 13px 0 0}
  html[data-compact-device] body[data-view="practice"] .case-ident{min-height:18px;font-size:.68rem}
  html[data-compact-device] body[data-view="practice"] .cube-figure{width:clamp(110px,22dvh,190px);max-width:calc(100% - 72px)}
  html[data-compact-device] body[data-view="practice"] .trainer-cube img{max-height:clamp(110px,22dvh,190px);min-height:100px}
  html[data-compact-device] body[data-view="practice"] .favorite-button{width:34px;height:34px;right:-39px;top:0;font-size:1.3rem}
  html[data-compact-device] body[data-view="practice"] .setup-box{padding:7px 10px;margin-top:6px}
  html[data-compact-device] body[data-view="practice"] .setup-label{font-size:.58rem}
  html[data-compact-device] body[data-view="practice"] .setup-box .algorithm-text{font-size:.76rem;line-height:1.45}
  html[data-compact-device] body[data-view="practice"] .practice-timing{flex:none;display:grid;grid-template-columns:132px minmax(0,1fr);grid-template-rows:auto 72px;gap:9px 10px;padding:11px 14px 10px;border-left:0;border-top:1px solid #e8eeea;border-radius:0 0 13px 13px}
  html[data-compact-device] body[data-view="practice"] .timer-row{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:10px}
  html[data-compact-device] body[data-view="practice"] .timer{font-size:2.3rem;text-align:left}
  html[data-compact-device] body[data-view="practice"] .timer-button{min-height:44px;padding:9px 4px;font-size:.86rem}
  html[data-compact-device] body[data-view="practice"] .previous-case-card{grid-column:1;grid-row:2;margin:0;min-height:0;height:72px;display:flex;gap:7px;padding:5px 6px;border-radius:8px}
  html[data-compact-device] body[data-view="practice"] .previous-case-figure{flex:0 0 36px;height:42px;background:none}
  html[data-compact-device] body[data-view="practice"] .previous-case-figure img{width:36px;height:40px}
  html[data-compact-device] body[data-view="practice"] .previous-case-kicker{font-size:.58rem;margin-bottom:2px}
  html[data-compact-device] body[data-view="practice"] .previous-case-info strong{font-size:.65rem;font-weight:600;overflow-wrap:anywhere}
  html[data-compact-device] body[data-view="practice"] .previous-case-info .last-solve-time{font-size:.6rem;margin-top:2px}
  html[data-compact-device] body[data-view="practice"] .practice-navigation{grid-column:2;grid-row:2;align-self:start;margin:0;gap:7px;grid-template-columns:1fr 1.1fr}
  html[data-compact-device] body[data-view="practice"] .practice-navigation button{min-height:44px;padding:10px 3px;font-size:.72rem}
  html[data-compact-device] body[data-view="practice"] .practice-timing #currentButton{grid-column:2;grid-row:2;align-self:end;min-height:24px;padding:3px;margin:0;font-size:.6rem}
  html[data-compact-device] body[data-view="practice"] .formula-details{padding-inline:11px;border-radius:9px}
  html[data-compact-device] body[data-view="practice"] .formula-details summary{padding:7px 0;min-height:30px;font-size:.71rem;gap:7px}
  html[data-compact-device] body[data-view="practice"] .formula-hint{font-size:.58rem}
  html[data-compact-device] body[data-view="practice"] .formula-panel{grid-template-columns:1fr;margin-bottom:8px;gap:5px}
  html[data-compact-device] body[data-view="practice"] .formula-panel>div{padding:6px 8px;display:grid;grid-template-columns:39px minmax(0,1fr);gap:5px;align-items:start}
  html[data-compact-device] body[data-view="practice"] .formula-kicker{font-size:.58rem;line-height:1.7;padding-top:1px;letter-spacing:0}
  html[data-compact-device] body[data-view="practice"] .formula-panel p{font-size:.75rem;line-height:1.45;margin:0}
  html[data-compact-device] body[data-view="practice"] .practice-utilities{min-height:30px;gap:20px}
  html[data-compact-device] body[data-view="practice"] .practice-utilities button{min-height:30px;font-size:.66rem;padding:5px 4px}
}
