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

:root {
  /* App palette — iOS system colors (light) */
  --bg: #f2f2f7;           /* systemGroupedBackground */
  --card: #ffffff;          /* secondarySystemGroupedBackground */
  --text: #1d1d1f;          /* label */
  --muted: #6b6b70;         /* secondaryLabel */
  --faint: #8e8e93;         /* tertiaryLabel */
  --separator: rgba(60, 60, 67, 0.18);
  --hairline: rgba(0, 0, 0, 0.06);
  --accent: #2cad5a;        /* mealGPT brand green */
  --accent-press: #24964c;
  --header-bg: rgba(249, 249, 249, 0.82);
  --max: 760px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;          /* systemGroupedBackground (dark) */
    --card: #1c1c1e;        /* secondarySystemGroupedBackground (dark) */
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --faint: #8e8e93;
    --separator: rgba(84, 84, 88, 0.6);
    --hairline: rgba(255, 255, 255, 0.08);
    --header-bg: rgba(28, 28, 30, 0.78);
  }
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro",
    system-ui, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;          /* iOS body */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(44, 173, 90, 0.25); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { color: var(--text); font-weight: 600; }

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 20px;
}

.logo { display: flex; align-items: center; gap: 10px; color: var(--text); }
.logo:hover { text-decoration: none; }

.app-icon {
  width: 30px;
  height: 30px;
  border-radius: 22%;       /* iOS superellipse-ish */
  box-shadow: 0 0 0 0.5px var(--hairline);
}

.logo-name { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }

.nav { display: flex; gap: 22px; font-size: 16px; font-weight: 400; }
.nav a { color: var(--accent); }
.nav a:not(.active) { color: var(--muted); }
.nav a:hover { text-decoration: none; opacity: 0.7; }
.nav a.active { color: var(--accent); font-weight: 600; }

/* ---- Page ---- */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 36px 20px 48px;
}

.page-title {
  font-size: 34px;          /* iOS large title */
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.1;
  color: var(--text);
}

.effective-date {
  margin-top: 8px;
  font-size: 15px;
  color: var(--faint);
}

/* Grouped content card — iOS inset grouped list feel */
.card {
  margin-top: 22px;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 8px 22px 24px;
}

.card h2 {
  margin-top: 26px;
  margin-bottom: 4px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--text);
}

.card p { margin-top: 12px; color: var(--text); }
.card ul { margin: 12px 0; padding-left: 22px; }
.card li { margin-bottom: 7px; color: var(--text); }
.card li::marker { color: var(--accent); }

/* ---- Table ---- */
table {
  width: 100%;
  margin: 18px 0 6px;
  font-size: 15px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--separator);
  border-radius: 12px;
  overflow: hidden;
}

thead th {
  text-align: left;
  padding: 11px 13px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--bg);
}

td {
  padding: 11px 13px;
  border-top: 1px solid var(--separator);
  vertical-align: top;
  color: var(--muted);
}

td strong { color: var(--text); }

/* ---- Footer ---- */
.site-footer { margin-top: 40px; border-top: 1px solid var(--hairline); }

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 13px;
  color: var(--faint);
  text-align: center;
}

.logo-sm { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; }
.logo-sm:hover { text-decoration: none; }
.logo-sm .app-icon { width: 22px; height: 22px; }

.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--faint); }
.footer-links a:hover { color: var(--text); text-decoration: none; }

@media (min-width: 640px) {
  .footer-inner { flex-direction: row; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
