/* ── App shell ── */
.app {
  max-width: 430px;
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

@media (min-width: 500px) {
  body { display: flex; align-items: center; justify-content: center; }
  .app {
    border-radius: 48px;
    box-shadow: 0 32px 80px rgba(60, 40, 20, .18);
    height: min(844px, 95vh);
  }
}

/* ── Main app wrapper ── */
#main-app {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

/* ── Screens ── */
.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  position: relative;
}
.screen.active { display: flex; }

/* ── Top header (Rocky wordmark + profile) ── */
.top-header {
  padding: 14px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.top-header-spacer { width: 60px; }
.top-wordmark {
  font-family: 'Lora', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--terra);
  letter-spacing: -0.3px;
}
.top-header-right {
  width: 60px;
  display: flex;
  justify-content: flex-end;
}

/* ── Bottom nav ── */
.bottom-nav {
  flex-shrink: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 10px 0 max(20px, env(safe-area-inset-bottom));
  display: flex;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px 0;
  touch-action: manipulation;
}
.nav-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--t4);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke .15s;
}
.nav-label {
  font-size: 10px;
  color: var(--t4);
  font-weight: 400;
  transition: color .15s;
}
.nav-item.active .nav-icon svg { stroke: var(--terra); }
.nav-item.active .nav-label { color: var(--terra); font-weight: 500; }

/* ── Page header ── */
.page-header {
  padding: 18px 24px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-shrink: 0;
}
.page-title {
  font-family: 'Lora', serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--t1);
  line-height: 1.1;
}
.page-sub {
  font-size: 13px;
  color: var(--t3);
  margin-top: 2px;
}

/* ── Shared utilities ── */
.divider { height: 1px; background: var(--border); flex-shrink: 0; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 32px;
  gap: 12px;
  flex: 1;
  text-align: center;
}
.empty-state p { font-size: 14px; color: var(--t3); line-height: 1.6; }
