*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden; /* アプリ内スクロールに統一 */
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ヘッダー */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding-top: var(--safe-top);
  background-color: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 20px;
}

.app-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-primary);
}

/* メインスクロール領域 */
.app-main {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: calc(var(--header-height) + var(--safe-top) + 16px);
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 24px);
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ビュー切り替え */
.view {
  display: none;
}

.view.active {
  display: block;
}

/* ボトムナビゲーション */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background-color: rgba(20, 20, 24, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-subtle);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.nav-item.active {
  color: var(--accent-primary);
}

/* ユーティリティ */
.text-muted { color: var(--text-secondary); font-size: 13px; }
.mb-16 { margin-bottom: 16px; }
.w-100 { width: 100%; }
.required { color: var(--accent-primary); }
