/* Shared phone adaptation; desktop widths and saved study preferences remain independent. */
@media(max-width:700px){
html body .mobile-rail-toggle{display:block!important;width:100%;min-height:44px;text-align:left;padding:10px 14px;background:var(--desktop-raised,#30233d);color:var(--desktop-text,#f5f0f8);border:1px solid #776181;border-radius:10px;font:600 16px/1.4 system-ui;flex:none;grid-column:1/-1}
html[data-study-rail] body .mode-study-layout,html body .mode-study-layout,html.feynman-with-cards body .workspace{display:block!important;grid-template-columns:minmax(0,1fr)!important;width:100%!important;min-width:0!important}
html body #mode-card-rail,html body #feynman-card-rail,html body .workspace>.rail{display:none!important;width:100%!important;max-width:100%!important;max-height:45dvh!important;position:relative!important;top:0!important;overflow:auto!important;grid-column:auto!important;border-bottom:1px solid #776181}
html.phone-rail-open body #mode-card-rail,html.phone-rail-open body #feynman-card-rail,html.phone-rail-open body .workspace>.rail{display:block!important}
html[data-study-rail] body .mode-study-main,html body .mode-study-main,html.feynman-with-cards body #main{width:100%!important;min-width:0!important;grid-column:auto!important}
html body .study-rail-resizer,html body .rail-resizer,html body .splitter{display:none!important}
html body .mode-study-main>.pages{height:auto!important;min-height:calc(100dvh - 50px);overflow:visible!important}
html body .builder-grid,html body .chat-grid{display:block!important;grid-template-columns:minmax(0,1fr)!important;height:auto!important}
html body .sentence-card,html body .choices-card,html body .options-window,html body .options-grid{width:100%!important;min-width:0!important;max-width:100%!important;grid-template-columns:minmax(0,1fr)!important}
html body #practice .controls{display:flex!important;flex-wrap:wrap;position:relative!important;gap:8px;margin-top:12px}
html body #practice .controls>button{flex:1 1 120px;min-width:0!important;font-size:16px!important;min-height:44px;white-space:normal!important;overflow-wrap:normal!important}
html body #mode-shell>header,html body .mode-header,html body .mode-top{flex-wrap:wrap!important;min-width:0!important;height:auto!important;gap:8px}
html body #mode-shell .mode-tools,html body #mode-shell .mode-actions{flex-wrap:wrap!important;min-width:0!important}
html body .workspace.with-rail{display:flex!important;flex-direction:column!important;min-width:0!important}
html body .workspace.with-rail>main{flex:1;min-height:0;width:100%}
html body .mobile-rail-toggle[hidden]{display:none!important}
html body .cv2.cv2-chat-grid{display:block!important;grid-template-columns:minmax(0,1fr)!important}
html body #desktop-navigation .desktop-nav-foot button{font-size:0!important}
html body #desktop-navigation .desktop-nav-foot button:before{content:'⚙';font-size:22px}
}
.mobile-rail-toggle{display:none}
@media(max-width:700px){
html.with-mode-cards[data-study-rail=resizable] body .mode-study-layout,html.feynman-with-cards[data-study-rail=resizable] body .workspace{display:block!important;grid-template-columns:minmax(0,1fr)!important}
html.with-mode-cards body .mode-study-main>.pages #practice{display:flex!important;flex-direction:column;height:auto!important;min-height:0!important}
html.with-mode-cards body .mode-study-main>.pages #practice .builder-grid{height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;flex:none!important}
html body .sentence-card,html body .choices-card{height:auto!important;min-height:220px!important;overflow:visible!important}
html body .sentence-footer{height:auto!important;min-height:44px;flex-wrap:wrap!important}
html body :is(#hablemos-c-navc-control,.navc-control).navc-control.navc-control{font-size:12px!important;padding:0 9px!important;gap:5px!important;min-height:44px!important;height:44px!important}
html body .sentence-header{flex-wrap:wrap!important;gap:8px}
html body .controls{clear:both}
}
@media(max-width:700px){html body #mode-shell>.modebar{height:auto!important;display:flex!important;flex-wrap:wrap!important;gap:8px;padding:10px!important}html body #mode-shell .modebar-right{display:flex!important;flex-wrap:wrap!important;gap:6px;max-width:100%;min-width:0}html body #mode-shell .modebar-right button{font-size:13px!important;min-width:0!important;padding:8px!important}html body #mode-shell .modebar-left{max-width:100%;min-width:0}html body #mode-title{font-size:16px!important}}
@media(max-width:700px){html body #mode-shell{grid-template-rows:auto minmax(0,1fr)!important}html body #mode-shell>.modebar{display:block!important;max-height:none!important;position:relative!important}html body #mode-shell .modebar-left{position:static!important;display:flex!important;width:100%;margin-bottom:8px}html body #mode-shell .modebar-right{position:static!important;width:100%;justify-content:flex-start!important}}
