body {
  font-family: var(--font);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100dvh;
}

/* ── App Shell ── */
#app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--color-bg);
  position: relative;
}

/* ── Top Navbar ── */
#navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  height: var(--nav-h);
  flex-shrink: 0;
}

.navbar {
  display: flex;
  align-items: center;
  padding: 0 var(--sp-4);
  height: 100%;
  gap: var(--sp-3);
}

.navbar-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  flex: 1;
}

.navbar-action {
  color: var(--color-primary);
  font-size: var(--text-sm);
  font-weight: 500;
}

/* ── Page Content ── */
#page-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--bottom-h) + var(--sp-4));
}

.page {
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  min-height: calc(100dvh - var(--nav-h) - var(--bottom-h));
}

/* ── Bottom Navigation ── */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--bottom-h);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  z-index: 100;
}

.bottom-nav {
  display: flex;
  height: 100%;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  gap: 2px;
  position: relative;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

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

.bottom-nav-icon {
  font-size: 20px;
  position: relative;
  line-height: 1;
}

.bottom-nav-label {
  font-size: var(--text-xs);
  font-weight: 500;
}

/* ── Toast Container ── */
#toast-container {
  position: fixed;
  bottom: calc(var(--bottom-h) + var(--sp-3));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - var(--sp-8));
  max-width: 440px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
}

/* ── Modal Overlay ── */
#modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  z-index: 300;
  align-items: flex-end;
  justify-content: center;
}

#modal-overlay.modal-open {
  display: flex;
}
