/* =========================================================
   ハンバーガーメニュー（右からのドロワー）
   下タブバーの代わり。リンクのアイコンはアートワークを丸く切り抜いて使う
   ========================================================= */
/* フッターの主要メニュー（アートワークの丸アイコン） */
:root { --tab-h: 70px; }
.page { padding-bottom: calc(var(--tab-h) + 28px); }
.tabbar { grid-template-columns: repeat(5, 1fr); }
.tabbar__item { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.tabbar__thumb { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; background: var(--bg); display: inline-flex; align-items: center; justify-content: center; color: var(--muted); transition: transform .2s, box-shadow .2s; }
.tabbar__thumb img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; filter: grayscale(.35); }
.tabbar__item.is-active .tabbar__thumb { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary); transform: translateY(-1px); }
.tabbar__item.is-active .tabbar__thumb img { filter: none; }
.tabbar__thumb--menu { background: var(--surface); border: 1px solid var(--line); }
.tabbar__thumb--menu .menu-btn__bars { transform: scale(.8); }
.tabbar__thumb--menu .menu-btn__bars i { background: var(--ink); }
body.menu-open .tabbar__thumb--menu .menu-btn__bars i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.menu-open .tabbar__thumb--menu .menu-btn__bars i:nth-child(2) { opacity: 0; }
body.menu-open .tabbar__thumb--menu .menu-btn__bars i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); width: 18px; }

/* 開くボタン: 画面右上に固定（shell の幅内に収める） */
.menu-btn {
  position: fixed; top: 12px; right: max(14px, calc(50% - 240px + 14px)); z-index: 40;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(255,255,255,.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: transform .2s;
}
.menu-btn:active { transform: scale(.94); }
.menu-btn__bars { display: flex; flex-direction: column; gap: 4px; }
.menu-btn__bars i { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .25s, opacity .2s, width .25s; }
.menu-btn__bars i:nth-child(2) { width: 12px; }
body.menu-open .menu-btn__bars i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.menu-open .menu-btn__bars i:nth-child(2) { opacity: 0; }
body.menu-open .menu-btn__bars i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); width: 18px; }
body.menu-open .menu-btn { z-index: 60; }
.topbar { padding-right: 64px; }
.subhead--float { padding-right: 64px; }

/* ドロワー本体 */
.drawer { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(10,14,20,.42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); opacity: 0; transition: opacity .3s; }
.drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(84%, 380px);
  background: var(--bg); border-radius: 26px 0 0 26px; overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(104%); transition: transform .38s cubic-bezier(.22,1,.36,1);
  box-shadow: -20px 0 50px -30px rgba(10,14,20,.5);
  display: flex; flex-direction: column;
}
.drawer.is-open { pointer-events: auto; }
.drawer.is-open .drawer__scrim { opacity: 1; }
.drawer.is-open .drawer__panel { transform: none; }
body.menu-open { overflow: hidden; }

.drawer__head { position: relative; height: 196px; background: var(--ink); overflow: hidden; flex: none; }
.drawer__banner { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; display: block; }
.drawer__head-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,14,20,.15) 0%, rgba(10,14,20,0) 35%, rgba(10,14,20,.78) 100%); }
.drawer__close { position: absolute; top: 12px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.88); color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.drawer__user { position: absolute; left: 18px; right: 18px; bottom: 16px; display: flex; align-items: center; gap: 12px; color: #fff; }
.drawer__user b { display: block; font-size: 16px; line-height: 1.2; }
.drawer__user .small { color: rgba(255,255,255,.8); }
.drawer__avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.9); flex: none; }
.drawer__avatar--initial { display: inline-flex; align-items: center; justify-content: center; background: var(--primary); color: #fff; font-weight: 700; font-size: 18px; }

.drawer__list { list-style: none; margin: 0; padding: 14px 12px 0; display: flex; flex-direction: column; gap: 6px; }
.drawer__item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px 8px 8px; border-radius: 18px; border: 0;
  background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; font: inherit; transition: transform .12s;
}
.drawer__item:active { transform: scale(.985); }
.drawer__item.is-active { box-shadow: inset 0 0 0 2px var(--primary); }
.drawer__thumb { width: 52px; height: 52px; border-radius: 16px; overflow: hidden; background: var(--bg); display: flex; align-items: center; justify-content: center; color: var(--muted); flex: none; }
.drawer__thumb img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.drawer__text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.drawer__text b { font-size: 15px; }
.drawer__text span { font-size: 11.5px; color: var(--muted); }
.drawer__chev { color: var(--line-strong); transform: rotate(180deg); display: inline-flex; }
.drawer__item.is-active .drawer__chev { color: var(--primary); }

.drawer__foot { margin-top: auto; padding: 14px 12px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.drawer__foot form { margin: 0; }
.drawer__item--logout { background: transparent; }
.drawer__item--logout .drawer__thumb { filter: grayscale(.4); }
.drawer__period { text-align: center; font-size: 11.5px; color: var(--muted); margin-top: 10px; letter-spacing: .06em; }

@media (prefers-reduced-motion: reduce) { .drawer__panel, .drawer__scrim { transition: none; } }
