*, *::before, *::after { box-sizing: border-box; }

html {
  font-family: var(--font-sans);
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
/* Dynamic Type: respect the iOS system text size */
@supports (font: -apple-system-body) {
  html { font: -apple-system-body; font-family: var(--font-sans); }
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: var(--text-body);
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--color-primary-strong); }
img, svg { display: block; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--color-primary-strong);
  outline-offset: 2px;
  border-radius: var(--radius-control);
}

.icon {
  width: 22px;
  height: 22px;
  flex: none;
  stroke-width: 2;
}
.icon-sm { width: 18px; height: 18px; }
.icon-lg { width: 28px; height: 28px; }

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: var(--touch);
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius-control);
  font-weight: 600;
  font-size: var(--text-body);
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast);
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--color-primary); color: var(--color-on-primary); }
.btn-secondary { background: var(--color-fill); color: var(--color-primary-strong); }
.btn-danger { background: var(--color-fill); color: var(--color-danger-strong); }
.btn-block { width: 100%; }
.btn-plain {
  background: none;
  border: 0;
  color: var(--color-primary-strong);
  min-height: var(--touch);
  min-width: var(--touch);
  padding: 0 var(--space-1);
  font-weight: 400;
}
