* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  color: var(--text-primary);
  overflow: hidden; /* the #app container owns scrolling per-screen, not the page */
  position: fixed;
  inset: 0;
}

button, input {
  font-family: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

/* [hidden] on its own loses to any ID/class rule that sets display on a
   .screen (like #screen-tap below needing display:flex for its layout).
   !important here guarantees a hidden screen actually stays hidden. */
.screen[hidden] {
  display: none !important;
}

.screen {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: calc(var(--safe-top) + 12px) calc(var(--space-md) + var(--safe-right)) 0 calc(var(--space-md) + var(--safe-left));
  padding-bottom: calc(var(--tab-bar-height) + var(--safe-bottom) + var(--space-lg));
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) 0 var(--space-lg);
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}

.muted-label {
  margin: 0;
  font-size: 15px;
  color: var(--text-muted);
}

.section-label {
  margin: 0 0 var(--space-md);
  font-size: 15px;
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
  padding: var(--space-xl) 0;
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
