/* ===== 下部タブバー ===== */
/* Opus追補指示書 2-2 準拠 */

.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.04);
  /* iPhoneホームインジケータ分の余白 */
  padding: var(--space-2) 0 max(var(--space-2), env(safe-area-inset-bottom, 0px));
  z-index: 100;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: transparent;
  border: none;
  padding: var(--space-2) 0;
  color: var(--color-text-muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: color .15s ease, transform .12s ease;
  min-height: 56px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  font-family: inherit;
}

.tab-icon {
  font-size: 22px;
  line-height: 1;
}

.tab-label {
  font-size: 11px;
  line-height: 1;
}

.tab:active { transform: scale(0.92); }

.tab[aria-selected="true"],
.tab.active {
  color: var(--color-brand);
}

/* ────────────────────────────────────────
   タブバー分のパディング調整
──────────────────────────────────────── */

/* 練習画面：controls-areaの下にタブバー分の余白 */
#controls-area {
  padding-bottom: calc(72px + max(0px, env(safe-area-inset-bottom, 0px)));
}

/* 履歴画面：スクロール有効化 + タブバー分の余白 */
body.history-page {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  height: auto !important;
  min-height: 100dvh;
  padding-bottom: calc(72px + max(0px, env(safe-area-inset-bottom, 0px)));
}
