/* One layout for lesson explorer and daily introductions. Keep controls in flow. */
.screen.activity-desk .letter-card > .big-letter {
  display:grid!important;place-items:center!important;min-width:0!important;
  min-height:0!important;width:100%!important;height:100%!important;
  padding:8px!important;line-height:1.5!important;overflow:visible!important;
  font-size:clamp(3rem,20dvh,11rem)!important;
}
.screen.activity-desk .big-letter > [data-fit] {display:block;white-space:nowrap;line-height:1.5;max-width:none;flex:none}
.screen.activity-desk .letter-card > .hear {
  position:static!important;grid-column:1!important;grid-row:3!important;
  justify-self:center!important;align-self:center!important;max-width:100%;
  min-height:44px!important;margin:0!important;padding:6px 12px!important;
}
.screen.activity-desk .letter-card > .translit {
  grid-column:1!important;grid-row:2!important;justify-self:center!important;
  max-width:100%!important;margin:0!important;text-align:center;
}
.screen.activity-desk .letter-card:not(.word-card):not(.kural-card) {
  display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr)!important;
  grid-template-rows:minmax(0,1fr) auto auto!important;
  padding:clamp(8px,1.8vmin,24px)!important;gap:6px 12px!important;
  width:100%!important;max-width:none!important;min-width:0!important;overflow:visible!important;
}
.screen.activity-desk .letter-card > .word,
.screen.activity-desk .letter-card > .formula {
  grid-column:2!important;grid-row:1 / 4!important;min-width:0!important;
  width:100%!important;max-width:none!important;height:100%!important;
}
.screen.activity-desk .letter-card > .formula {align-content:center;overflow-wrap:anywhere;font-size:clamp(1rem,2.2vw,2rem)}
.screen.activity-desk .letter-card > .word {padding:8px!important;gap:6px!important}
.screen.activity-desk .letter-card > .word .pic-img {width:min(24dvh,230px)!important;height:min(24dvh,230px)!important;max-width:90%!important;max-height:55%!important;object-fit:contain}
.screen.activity-desk .letter-card > .word .word-ta {font-size:clamp(1.1rem,2.5vw,2.7rem)!important;line-height:1.6!important}
.screen.activity-desk.session .intro-stage {display:flex!important;align-items:stretch!important;min-height:0!important;width:100%!important}
.screen.activity-desk.session .intro-stage > .letter-card {height:100%!important}
.screen.activity-desk .step-actions {position:static!important;flex-wrap:wrap;justify-content:center!important}
.screen.activity-desk .step-actions .btn,.screen.activity-desk .pager .btn {min-height:44px!important}
.screen.activity-desk.learn {display:grid!important;grid-template-rows:minmax(0,1fr) auto!important}
.screen.activity-desk .learn-grid {min-width:0;align-items:stretch}
/* Orientation reminder is optional and remains reachable with zoom/large text. */
.arumpon-rotate-card {position:relative;box-sizing:border-box;max-height:calc(100dvh - 32px);overflow-y:auto;padding:64px 20px 24px}
.arumpon-rotate-close {position:absolute;top:12px;right:12px;display:grid;place-items:center;width:44px;height:44px;border:2px solid #c9b8df;border-radius:50%;background:#fffdf7;color:#48396e;font-size:1.2rem;cursor:pointer}
.arumpon-rotate-close:focus-visible,.arumpon-rotate-continue:focus-visible {outline:3px solid #76549c;outline-offset:3px}
.arumpon-rotate-continue {width:100%;min-height:44px;white-space:normal;line-height:1.6}
.arumpon-rotate-card .rotate-help {font-size:.75rem}
.arumpon-rotate-card {font-family:var(--font)!important}
/* Mobile lessons use the available viewport, including the tracing step. */
@media (max-height:599px), (max-width:600px) {
 body:has(.activity-desk) {height:100dvh;min-height:0!important;overflow:hidden!important}
 body:has(.activity-desk) > .ui-orientation-message {display:none!important}
 #app:has(>.activity-desk) {
   height:100dvh!important;min-height:0!important;max-height:100dvh!important;
   display:grid!important;grid-template-rows:auto minmax(0,1fr)!important;
   overflow:hidden!important;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
 }
 #app:has(>.activity-desk) > .topbar {
   position:static!important;min-height:44px!important;padding:4px 10px!important;
   flex-wrap:nowrap!important;gap:6px!important;
 }
 #app:has(>.activity-desk) > .topbar .brand-mini {width:32px;height:32px}
 #app:has(>.activity-desk) > .topbar .icon-btn {width:36px;height:36px;min-width:36px;min-height:36px}
 #app > .screen.activity-desk {
   box-sizing:border-box;height:calc(100% - 12px)!important;max-height:calc(100% - 12px)!important;
   min-height:0!important;width:calc(100% - 12px)!important;margin:4px auto 8px!important;
   padding:6px!important;gap:5px!important;overflow:hidden!important;border-radius:18px;
 }
 #app > .screen.activity-desk.session {grid-template-rows:auto minmax(0,1fr)!important}
 #app > .screen.activity-desk.session:has(.intro-stage) {grid-template-rows:auto minmax(0,1fr) auto!important}
 .screen.activity-desk.session > .guide {min-height:32px!important;padding:3px 7px!important;grid-template-columns:24px minmax(0,1fr) 32px!important;gap:5px!important}
 .screen.activity-desk .guide-text b {font-size:.7rem!important;line-height:1.5!important}
 .screen.activity-desk .guide-text small {display:none!important}
 .screen.activity-desk .guide-bird > .companion {width:24px!important;height:24px!important}
 .screen.activity-desk .guide-replay {width:32px!important;height:32px!important;min-width:32px!important}
 .screen.activity-desk.session .intro-stage,
 .screen.activity-desk.session .intro-stage > .letter-card,
 .screen.activity-desk .learn-grid > .letter-card {
   min-height:0!important;height:100%!important;max-height:100%!important;
 }
 .screen.activity-desk .letter-card:not(.word-card):not(.kural-card) {padding:5px!important;gap:3px 7px!important}
 .screen.activity-desk .letter-card > .big-letter {font-size:clamp(2rem,18dvh,5rem)!important;padding:2px!important;overflow:hidden!important}
 .screen.activity-desk .letter-card > .hear {min-height:40px!important;padding:3px 9px!important;font-size:.75rem!important}
 .screen.activity-desk .letter-card > .translit {font-size:.65rem!important;line-height:1.3!important}
 .screen.activity-desk .letter-card > .word {padding:4px!important;gap:2px!important;overflow:hidden!important}
 .screen.activity-desk .letter-card > .word .pic-img {width:min(22dvh,110px)!important;height:min(22dvh,110px)!important;max-height:55%!important}
 .screen.activity-desk .letter-card > .word .word-ta {font-size:clamp(.85rem,4dvh,1.25rem)!important;line-height:1.5!important}
 .screen.activity-desk .letter-card > .word small {font-size:.6rem!important;line-height:1.25!important}
 .screen.activity-desk .step-actions .btn,.screen.activity-desk .pager .btn {min-height:40px!important;padding:3px 14px!important;font-size:.85rem!important}
 .screen.activity-desk.learn {grid-template-rows:minmax(0,1fr) 40px!important}
 .screen.activity-desk .learn-grid {height:100%!important;min-height:0!important;gap:6px!important}
 .screen.activity-desk .trace-solo.desk-board,
 .screen.activity-desk .trace-wrap.desk-board {
   height:100%!important;max-height:100%!important;min-height:0!important;
   padding:5px!important;gap:4px!important;overflow:hidden!important;
 }
 .screen.activity-desk .trace-solo.desk-board {
   grid-template-columns:minmax(0,1fr) 100px!important;grid-template-rows:minmax(0,1fr)!important;
 }
 .screen.activity-desk .trace-solo .actions {grid-template-columns:1fr!important;gap:8px!important}
 .screen.activity-desk .desk-board .actions .btn {min-height:40px!important;padding:3px 6px!important;font-size:.72rem!important}
 .screen.activity-desk .trace-host,
 .screen.activity-desk .trace-host.guided-trace-host {
   width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;
   min-height:0!important;min-width:0!important;aspect-ratio:auto!important;
 }
 .screen.activity-desk .guided-trace-host {grid-template-rows:minmax(0,1fr) 36px!important;gap:3px!important}
 .screen.activity-desk .guided-trace-canvas {
   display:block!important;width:100%!important;height:100%!important;
   min-height:0!important;max-height:100%!important;aspect-ratio:auto!important;
 }
 .screen.activity-desk .guided-trace-toolbar {min-height:0!important;height:36px!important;gap:4px!important}
 .screen.activity-desk .guided-trace-status {font-size:.6rem!important;line-height:1.3!important}
 .screen.activity-desk .guided-trace-demo {min-height:36px!important;font-size:.65rem!important;padding:3px 6px!important}
}
@media (max-width:600px) and (orientation:portrait) {
 .screen.activity-desk .learn-grid {grid-template-columns:1fr!important;grid-template-rows:minmax(0,.8fr) minmax(0,1.2fr)!important}
 .screen.activity-desk .learn-grid.single {grid-template-rows:minmax(0,1fr)!important}
 .screen.activity-desk .trace-solo.desk-board {grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr) 44px!important}
 .screen.activity-desk .trace-solo .actions {grid-template-columns:repeat(3,minmax(0,1fr))!important;align-content:stretch!important}
 .screen.activity-desk .trace-solo .actions .btn {font-size:.75rem!important}
}
@media (max-height:599px), (max-width:600px) {
 .screen.activity-desk .trace-host:not(.guided-trace-host) > canvas {
   max-width:100%!important;max-height:100%!important;object-fit:contain;
   width:auto!important;height:auto!important;aspect-ratio:1;align-self:center;justify-self:center;
 }
}
@media (max-height:599px) and (orientation:landscape) {
 #app:has(>.activity-desk) > .topbar {height:44px!important;max-height:44px!important}
 #app:has(>.activity-desk) > .topbar .avatar {width:28px!important;height:28px!important}
 #app:has(>.activity-desk) > .topbar .who {padding:2px 6px!important}
 .screen.activity-desk .trace-wrap.desk-board {
   grid-template-columns:minmax(0,1fr) 90px!important;
   grid-template-rows:auto minmax(0,1fr)!important;
 }
 .screen.activity-desk .trace-wrap.desk-board > .guide {
   grid-column:1 / -1!important;grid-row:1!important;min-height:32px!important;
   padding:2px 6px!important;grid-template-columns:22px minmax(0,1fr) 30px!important;
 }
 .screen.activity-desk .trace-wrap.desk-board > .trace-host {grid-column:1!important;grid-row:2!important}
 .screen.activity-desk .trace-wrap.desk-board > .actions {
   grid-column:2!important;grid-row:2!important;grid-template-columns:1fr!important;align-content:center;gap:6px!important;
 }
}
