/* ===== MOBILE POLISH (27/10, "mejora la interfaz en móvil") — loaded last, phones and narrow portrait screens only =====
   · the top bar: every neuron still fits, but an icon never grows wider than its tab (they overlapped on narrow
     phones); the keyboard hints (Q / E) and ✎ Edit leave the bar on phones (Edit is on the flower, as its own button)
   · the floating buttons (Tutorial, ⚡ Quick add, ↶ Undo) sit above the phone's home bar, and the home screen keeps
     room under its last row so nothing hides behind them
   · tap targets of at least 40 px, and the bottom rows a little tighter */
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px){
  .fg-bar{gap:.25rem;padding:0 .5rem}
  .fg-bar .fg-step{display:none}
  .fg-tab .px-ic,.fg-tab .nav-ic{max-width:calc(100% - 2px);height:auto;aspect-ratio:1}
  .fg-bar .fg-edit{display:none}
  .fg-home,.fg-gear{width:40px;height:40px}
  /* room under the last row of the home screen for the floating buttons */
  .fg-home-screen{padding-bottom:calc(88px + env(safe-area-inset-bottom)) !important}
  .fg-orbs{gap:.35rem !important}
  .fg-orbs .fg-orb{min-height:40px}
  /* the floating buttons above the home indicator, in one tidy group at the bottom right */
  .qa-fab{bottom:calc(14px + env(safe-area-inset-bottom));right:14px}
  .cg-tut-btn{bottom:calc(18px + env(safe-area-inset-bottom));right:76px;width:44px;height:44px;justify-content:center}
  .undo-fab{bottom:calc(16px + env(safe-area-inset-bottom));left:14px}
}
/* very narrow phones (≤ 360 px): the labels of the flower get a touch smaller */
@media (max-width: 360px){
  .fg-lbl b{font-size:.78rem}
}

/* ===== PHONE SIDEWAYS (02/11, "al doblar la pantalla el calendario no aparece completo") =====
   A phone turned sideways (or a foldable) is wide but short. There:
   · the calendar never grows taller than the screen: its grid ends above the bottom edge and scrolls inside
     (the exact height is set by tools/81-landscape.js; this is the fallback)
   · the side column (mini month + energies) scrolls on its own and is a little narrower
   · the toolbar and the day headers are tighter, so more hours fit
   · the floating buttons become small round icons, so they cover less of the screen */
@media (orientation: landscape) and (max-height: 560px){
  .cal-scroll,.cal-sched,.cal-search{min-height:0 !important;max-height:var(--cal-fit, calc(100dvh - 9.5rem - env(safe-area-inset-bottom))) !important}
  .cal-month{min-height:0 !important;max-height:var(--cal-fit, calc(100dvh - 9.5rem));overflow:auto;grid-template-rows:auto repeat(var(--rows),minmax(64px,1fr)) !important}
  .cal-wrap{gap:.7rem}
  .cal-side{width:210px;gap:.7rem;position:sticky;top:0;max-height:var(--cal-side-fit, calc(100dvh - 4.5rem));overflow-y:auto;overscroll-behavior:contain;padding-bottom:calc(64px + env(safe-area-inset-bottom));scrollbar-width:thin}
  .cal-toolbar{gap:.25rem;margin-bottom:.4rem}
  .cal-toolbar .cal-btn{padding:.3rem .75rem;font-size:.78rem}
  .cal-seg button{padding:.3rem .6rem;font-size:.75rem}
  .cal-head{padding:.2rem 0 .15rem !important}
  .cal-head .num{width:30px !important;height:30px !important;font-size:.95rem !important;border-radius:10px !important}
  .cal-allday{min-height:18px;padding:1px 0 3px}
  /* floating buttons: icons only */
  #qaFab b,#cgTutBtn b,#msFab b,#msFab span:not(.ms-fab-ic){display:none !important}
  #qaFab,#cgTutBtn,#msFab{width:46px !important;height:46px !important;min-height:46px !important;padding:0 !important;justify-content:center !important;border-radius:50% !important}
  #qaFab{right:12px !important;bottom:calc(10px + env(safe-area-inset-bottom)) !important}
  #cgTutBtn{right:66px !important;bottom:calc(10px + env(safe-area-inset-bottom)) !important}
  #undoFab span{display:none !important}
  #undoFab{left:10px !important;bottom:calc(10px + env(safe-area-inset-bottom)) !important;min-width:46px !important;height:46px !important;min-height:46px !important;padding:0 .55rem !important;justify-content:center !important}
  #msFab{left:auto !important;right:120px !important;bottom:calc(10px + env(safe-area-inset-bottom)) !important}
}
