/* Phone view (Chris 2026-10-01): STEM Keys starts hidden on phones and, when opened,
   sits as a strip along the bottom instead of covering the problems. */
@media (max-width: 640px) {
  :is(#stemkeys-am, .am-window) {
    top: auto !important; bottom: 0 !important; left: 0 !important; right: 0 !important;
    width: 100% !important; max-width: 100% !important; max-height: 24vh !important;
    border-radius: 14px 14px 0 0 !important; transform: none !important;
  }
  :is(#stemkeys-am, .am-window) .am-body, :is(#stemkeys-am, .am-window) > div:last-child { overflow-y: auto; }
  header.bar { flex-wrap: wrap; gap: .5rem; }
  header.bar .tools { flex-wrap: wrap; gap: .4rem; margin-left: 0 !important; }
  body { padding-bottom: 26vh; }
  :is(#stemkeys-am, .am-window) .am-header { padding: 4px 10px !important; }
  :is(#stemkeys-am, .am-window) button { padding: 4px 8px !important; font-size: 13px !important; min-height: 0 !important; }
  :is(#stemkeys-am, .am-window) .am-subtitle { display: none; }
}
