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

html, body { margin: 0; background: var(--bg); color: var(--text); }

/* Dynamic Type: 1rem = the size she picked in iOS Settings (17px by default) */
html { font-size: 106.25%; }
@supports (font: -apple-system-body) {
  html { font: -apple-system-body; }
}

body {
  font-family: var(--font-text);
  font-size: var(--fs-md);
  line-height: 1.45;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* paper grain: printed texture, sits under everything */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: var(--grain);
  opacity: var(--grain-opacity);
}

input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; }

h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 750; letter-spacing: -.02em; line-height: 1.05; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
p { margin: 0; }

button { font: inherit; color: inherit; }

.display { font-family: var(--font-display); font-weight: 800; letter-spacing: -.035em; line-height: .92; }

/* app shell */
#view {
  padding:
    calc(env(safe-area-inset-top) + var(--s-5))
    calc(env(safe-area-inset-right) + var(--s-5))
    calc(env(safe-area-inset-bottom) + var(--tabbar-h) + var(--s-8))
    calc(env(safe-area-inset-left) + var(--s-5));
  max-width: 640px;
  margin: 0 auto;
  display: grid;
  gap: var(--s-6);
  align-content: start;
}
#view[data-view="onboarding"] { padding-bottom: calc(env(safe-area-inset-bottom) + var(--s-6)); }

.page-header { display: grid; gap: var(--s-1); }
.page-header .sub { color: var(--text-2); font-size: var(--fs-sm); }

.muted { color: var(--text-2); }
.small { font-size: var(--fs-sm); }
.center { text-align: center; }
.row { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: var(--s-3); }
.grow { flex: 1; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

:focus-visible { outline: 3px solid var(--ovulation); outline-offset: 2px; border-radius: 4px; }
/* titles the router focuses for VoiceOver (tabindex=-1) never show a ring */
[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
