/* ─── Base Reset & Typography ────────────────────────────────────────────── */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  overflow: hidden; /* Views handle their own scroll */
  transition: background var(--t-base) var(--ease),
              color var(--t-base) var(--ease);
}

h1, h2, h3, h4 {
  font-family: var(--font-mono);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }

p, span, label {
  font-family: var(--font-body);
}

code, pre, .mono {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

a {
  color: var(--accent);
  text-decoration: none;
}

button, input, textarea, select {
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
}

input[type="text"],
input[type="password"],
input[type="url"],
textarea {
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  padding: var(--sp-3) var(--sp-4);
  width: 100%;
  transition: border-color var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease);
}

input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

input::placeholder, textarea::placeholder {
  color: var(--text-dim);
}

/* Scrollable areas */
.scroll-y {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* App root */
#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  max-width: var(--max-w);
  margin: 0 auto;
}

/* Safe area support (iOS notch) */
#app {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
