/* M77：スマホ（900px以下）専用。画面下の常設メニュー。PCでは一切表示しない。 */
.m-tabbar { display: none; }
@media (max-width: 900px) {
  .m-tabbar { --tb-bg: #071126; --tb-fg: #dbe7f5; --tb-ac: #ffd24a; --tb-line: #1d3152;
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 930; box-sizing: border-box;
    margin: 0; padding: 4px max(4px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
    background: var(--tb-bg); border-top: 1px solid var(--tb-line); box-shadow: 0 -6px 20px rgba(0, 0, 0, .25);
    font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif; }
  .m-tabbar[data-kind="visual"] { --tb-bg: #0a0a0a; --tb-fg: #f2f2f2; --tb-ac: #c6ff2e; --tb-line: #2a2a2a; }
  .m-tabbar .m-tab { all: unset; box-sizing: border-box; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; min-height: 52px; padding: 0 2px; color: var(--tb-fg); font-size: 14px; font-weight: 600; line-height: 1.2; letter-spacing: 0; text-align: center; text-decoration: none; white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .m-tabbar .m-tab svg { display: block; width: 22px; height: 22px; flex: none; }
  .m-tabbar .m-tab.is-current { color: var(--tb-ac); font-weight: 800; }
  .m-tabbar .m-tab.is-current::before { content: ""; position: absolute; top: -5px; left: 50%; width: 28px; height: 3px; margin-left: -14px; border-radius: 2px; background: var(--tb-ac); }
  .m-tabbar .m-tab:focus-visible { outline: 3px solid var(--tb-ac); outline-offset: -3px; border-radius: 8px; }
  .m-tabbar .m-tab:active { opacity: .7; }
  /* 右下の「☰ メニュー」はバーの「メニュー」に役目を移す（押した時の動きは同じ）。 */
  .m-tabbar-ready .mobile-menu-toggle { display: none !important; }
  /* ページの最後がバーに隠れないよう、バーの高さぶんだけ下を空ける（従来は80px）。 */
  html.m-tabbar-ready body { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  /* エレックはバーの中に入れず、右下でバーの上に浮かせる。 */
  .m-tabbar-ready #denki-ai-launcher { left: auto; right: max(12px, env(safe-area-inset-right)); bottom: calc(72px + env(safe-area-inset-bottom)); width: auto; min-width: 0; padding: 6px 14px 6px 8px; }
  body.mobile-menu-open .m-tabbar, body.modal-open .m-tabbar, body.elec-consult-open .m-tabbar, body.m-lightbox-open .m-tabbar { visibility: hidden; }
}
@media (max-width: 900px) and (orientation: landscape) and (max-height: 480px) {
  /* 横向きのスマホは高さが足りないので、バーを低くする。 */
  .m-tabbar .m-tab { flex-direction: row; gap: 6px; min-height: 44px; }
  html.m-tabbar-ready body { padding-bottom: calc(52px + env(safe-area-inset-bottom)); }
  .m-tabbar-ready #denki-ai-launcher { bottom: calc(60px + env(safe-area-inset-bottom)); }
}
@media print { .m-tabbar { display: none !important; } }
