*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-dark);
  background: var(--cream);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  background: var(--white);
}

/* Header bar */
.header {
  background: var(--gradient-header);
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header__title {
  color: var(--text-on-green);
  font-size: 1.25rem;
  font-weight: 700;
  flex: 1;
}

.header__back {
  background: none;
  border: none;
  color: var(--text-on-green);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--sp-sm);
  margin-left: calc(-1 * var(--sp-sm));
  margin-right: var(--sp-sm);
  line-height: 1;
}

/* Main content area */
.view {
  padding: var(--sp-md);
  padding-bottom: calc(var(--sp-xl) + env(safe-area-inset-bottom, 0px));
}

/* Typography */
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }

a {
  color: var(--green-primary);
  text-decoration: none;
}

/* Scrollbar minimal */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: var(--radius-full); }

/* Accessibility: focus visible */
:focus-visible {
  outline: 2px solid var(--green-primary);
  outline-offset: 2px;
}

/* Utility: visually hidden */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Prevent layout shift while loading */
.view-container {
  min-height: calc(100dvh - var(--header-height));
}
