:root {
  --pink: #ee5a82;
  --pink-dark: #d84571;
  --pink-tint: #fdf1ee;
  --pink-tint-2: #fbe4e8;
  --navy: #2b2b36;
  --navy-soft: #4a4a58;
  --bg: #fdfaf8;
  --white: #ffffff;
  --border: #eee0dc;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 16px;
  --max: 1080px;
  --ring-1: #ee5a82;
  --ring-2: #d84571;
  --ring-3: #f4978e;
  --ring-track: #ece9e5;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Set by assets/native-zoom-lock.js only inside the wrapped app — tells
   WebKit's gesture recognizer directly that double-tap-zoom isn't a thing
   here, on top of the viewport meta change that script also makes. */
html.is-native { touch-action: manipulation; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--navy);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }

a { color: inherit; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  max-width: var(--max);
  margin: 0 auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-login {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy-soft);
  text-decoration: none;
  white-space: nowrap;
}

.header-login:hover { color: var(--pink-dark); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand img { width: 40px; height: 40px; border-radius: 22%; }

.brand-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--navy);
  letter-spacing: -0.01em;
}

/* The header-nav can carry three links (Log in / Sign up / Take the Quiz)
   on the marketing pages — on a narrow phone that plus the wordmark
   collides, so the wordmark drops out below the breakpoint where there's
   room for both. */
@media (max-width: 480px) {
  .site-header .brand-name { display: none; }
}

.header-cta {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--navy);
  color: var(--white);
  text-decoration: none;
  white-space: nowrap;
}

.header-cta:hover { background: var(--pink-dark); }

/* Eyebrow */
.eyebrow {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pink-dark);
  background: var(--pink-tint-2);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
  text-decoration: none;
}

a.eyebrow:hover { background: var(--pink-tint); }

/* Hero */
.hero {
  padding: 56px 0 48px;
  text-align: center;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 5.5vw, 3.4rem);
  line-height: 1.12;
  margin: 0 0 20px;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.hero .subhead {
  font-size: 1.1rem;
  color: var(--navy-soft);
  max-width: 620px;
  margin: 0 auto 32px;
}

.hero-bullets {
  list-style: none;
  margin: 0 auto 32px;
  padding: 0;
  max-width: 520px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  text-align: left;
}

@media (min-width: 560px) {
  .hero-bullets { grid-template-columns: 1fr 1fr; }
  .hero-bullet-wide { grid-column: 1 / -1; justify-self: center; }
}

.hero-bullets li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--navy);
}

.hero-bullet-icon {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--pink-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.hero-ctas {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.btn-primary {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 16px 34px;
  border-radius: 999px;
  background: var(--pink);
  color: var(--white);
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(238, 90, 130, 0.28);
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-primary:hover { background: var(--pink-dark); transform: translateY(-1px); }

.btn-secondary-link {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--navy-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-secondary-link:hover { color: var(--pink-dark); }

/* Section shared */
section { padding: 56px 0; }

.section-title {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  text-align: center;
  margin: 0 0 16px;
}

.section-lede {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  font-size: 1.05rem;
  color: var(--navy-soft);
}

/* Why join */
.value-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 40px;
}

@media (min-width: 640px) {
  .value-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 960px) {
  .value-grid:not(.value-grid-3) { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 860px) {
  .value-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
}

.value-grid-3 .value-item { text-align: left; }

.value-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}

a.value-item {
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

a.value-item:hover {
  border-color: var(--pink);
  box-shadow: 0 6px 18px rgba(238, 90, 130, 0.16);
  transform: translateY(-2px);
}

.value-item .value-item-title {
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 4px;
}

.value-item-locked {
  background: #f3f1ef;
}

.value-item-locked .value-icon {
  background: #e4e1de;
  color: #8a8a94;
}

.value-item-locked .value-item-title,
.value-item-locked p {
  color: var(--navy-soft);
}

a.value-item-locked:hover {
  border-color: #c9c4bf;
  box-shadow: none;
}

.value-icon {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--pink-tint);
  color: var(--pink-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.value-icon svg {
  width: 20px;
  height: 20px;
}

.value-icon-neutral {
  background: #f0efec;
  color: var(--navy-soft);
}

.value-item p {
  margin: 0;
  font-size: 0.98rem;
  color: var(--navy);
}

/* Founding member card */
.founding {
  background: var(--white);
  border: 1px solid var(--border);
}

.founding-card {
  max-width: 560px;
  margin: 40px auto 0;
  background: linear-gradient(180deg, var(--pink-tint) 0%, #ffffff 55%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px;
  text-align: center;
}

.founding-limited {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pink-dark);
  background: var(--pink-tint-2);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.price-block { margin-bottom: 6px; }

.price-annual {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6vw, 3rem);
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.price-annual span {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy-soft);
}

.price-strike {
  text-decoration: line-through;
  color: var(--navy-soft);
  opacity: 0.7;
}

.price-annual .price-strike {
  font-family: var(--sans);
  font-size: 1.4rem;
  font-weight: 600;
  margin-right: 8px;
}

.save-badge {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1f7a4d;
  background: #e6f6ec;
  padding: 5px 12px;
  border-radius: 999px;
}

.price-monthly {
  margin-top: 14px;
  font-size: 0.92rem;
  color: var(--navy-soft);
}

.price-monthly a {
  font-weight: 600;
  color: var(--pink-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.founding-bullets {
  list-style: none;
  padding: 0;
  margin: 28px 0 30px;
  text-align: left;
  display: inline-block;
}

.founding-bullets li {
  padding: 8px 0;
  font-size: 0.98rem;
  color: var(--navy);
}

.founding-bullets li::before {
  content: "✓";
  color: var(--pink-dark);
  font-weight: 700;
  margin-right: 10px;
}

/* Footer */
footer {
  padding: 40px 24px 60px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  text-align: center;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 18px;
  font-weight: 600;
  font-size: 0.9rem;
}

.footer-social a { text-decoration: none; color: var(--navy-soft); }
.footer-social a:hover { color: var(--pink-dark); }

.footer-fine {
  font-size: 0.8rem;
  color: #8a8a94;
  max-width: 620px;
  margin: 0 auto 8px;
}

/* Results page — cost comparison chart */
.cost-chart {
  position: relative;
  max-width: 640px;
  margin: 32px auto 0;
  padding: 44px 40px 0;
  overflow: visible;
}

.cost-chart-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink-tint) 0%, var(--pink) 100%);
  overflow: visible;
}

.cost-chart-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}

.cost-chart-marker-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--navy);
  border: 3px solid var(--white);
  box-shadow: 0 2px 8px rgba(43, 43, 54, 0.35);
}

.cost-chart-marker-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--navy);
  background: var(--white);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  margin-bottom: 6px;
  white-space: nowrap;
}

.cost-chart-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy-soft);
}

.cost-caption {
  max-width: 640px;
  margin: 20px auto 0;
  text-align: center;
  font-size: 1rem;
  color: var(--navy);
}

/* Quiz page */
.quiz-header {
  padding: 20px 24px;
}

.quiz-main {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 24px 60px;
  text-align: center;
}

.quiz-main h1 {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin: 8px 0 10px;
}

.quiz-hint {
  color: var(--navy-soft);
  font-size: 0.98rem;
  margin-bottom: 28px;
}

.quiz-embed {
  width: 100%;
  min-height: 480px;
  border: none;
}

.quiz-post-cta {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.quiz-post-cta p {
  font-size: 0.98rem;
  color: var(--navy-soft);
  margin: 0 0 16px;
}

.quiz-back {
  display: inline-block;
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--navy-soft);
  text-decoration: none;
}

.quiz-back:hover { color: var(--pink-dark); }

/* Login form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 340px;
  margin: 0 auto;
}

.login-input {
  font-family: var(--sans);
  font-size: 1rem;
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--navy);
}

.login-input:focus {
  outline: none;
  border-color: var(--pink);
}

textarea.login-input {
  width: 100%;
  border-radius: 16px;
  resize: vertical;
  font-family: var(--sans);
}

/* Dashboard profile grid */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px 20px;
  max-width: 560px;
  margin: 24px auto 0;
}

@media (min-width: 560px) {
  .profile-grid { grid-template-columns: auto 1fr; }
}

.profile-grid dt {
  font-weight: 700;
  color: var(--navy);
  margin-top: 14px;
}

.profile-grid dd {
  margin: 0 0 0 0;
  color: var(--navy-soft);
}

@media (min-width: 560px) {
  .profile-grid dt { margin-top: 0; padding: 10px 0; border-top: 1px solid var(--border); }
  .profile-grid dd { margin: 0; padding: 10px 0; border-top: 1px solid var(--border); }
  .profile-grid dt:first-of-type, .profile-grid dd:first-of-type { border-top: none; }
}

/* PWA install UI */
#pwaInstall { margin-top: 4px; }

/* Native app hero — lighter, more spacious than the scrolling website
   version, since this is the first screen on a phone, not a landing page. */
.hero-native {
  padding-top: 32px;
}

.hero-native .subhead {
  margin-bottom: 44px;
}

.hero-native .hero-ctas {
  margin-top: 4px;
  gap: 18px;
}

.hero-native #appFoundingPrompt {
  margin-top: 32px;
}

.hero-brand-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.7rem;
  color: var(--navy);
  letter-spacing: -0.01em;
  margin: 0 0 4px;
}

.hero-tagline {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--pink-dark);
  letter-spacing: -0.01em;
  margin: 0 0 18px;
}

.pwa-install-btn {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 26px;
  border-radius: 999px;
  background: var(--white);
  color: var(--pink-dark);
  border: 1.5px solid var(--pink);
  cursor: pointer;
}

.pwa-install-btn:hover { background: var(--pink-tint); }

.pwa-ios-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 420px;
  margin: 0 auto;
  padding: 14px 16px;
  background: var(--navy);
  color: var(--white);
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.4;
  box-shadow: 0 10px 30px rgba(43, 43, 54, 0.35);
}

.pwa-ios-icon {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--pink);
  animation: pwaBounce 1.6s ease-in-out infinite;
}

@keyframes pwaBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

.pwa-ios-banner span { flex: 1; }

.pwa-ios-close {
  flex: none;
  order: 1;
  align-self: flex-start;
  margin: -4px -4px 0 0;
  padding: 4px;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}

.pwa-ios-close:hover { opacity: 1; }

/* Check-in form */
.checkin-field { margin-bottom: 18px; }

.checkin-field label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--navy);
  margin-bottom: 6px;
}

.checkin-field input[type="file"] {
  font-family: var(--sans);
  font-size: 0.9rem;
}

select.login-input { appearance: auto; }

.checkin-fieldset {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 16px 4px;
  margin: 24px 0;
}

.checkin-fieldset legend {
  font-weight: 700;
  padding: 0 8px;
  color: var(--navy);
}

/* Symptom log */
.symptom-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.symptom-chip {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--navy-soft);
  cursor: pointer;
}

.symptom-chip.is-selected {
  background: var(--pink-tint-2);
  border-color: var(--pink);
  color: var(--pink-dark);
}

.severity-grid {
  display: flex;
  gap: 8px;
}

.severity-btn {
  flex: 1;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--navy-soft);
  cursor: pointer;
  text-align: center;
}

.severity-btn.is-selected {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.symptom-history-tags {
  font-size: 0.85rem;
  color: var(--pink-dark);
  font-weight: 600;
}

.symptom-history-meta {
  font-size: 0.8rem;
  color: var(--navy-soft);
}

.checkin-photo-preview {
  display: block;
  margin-top: 10px;
  max-width: 180px;
  max-height: 180px;
  border-radius: 12px;
  border: 1px solid var(--border);
  object-fit: cover;
}


.side-by-side {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 20px 0;
}

.side-by-side figure {
  margin: 0;
  text-align: center;
}

.side-by-side img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--border);
  display: block;
}

.side-by-side figcaption {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--navy-soft);
  font-weight: 600;
}

/* Body diagram (injection site picker) */
.body-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 300px;
  margin: 4px auto 0;
}

.body-diagram-svg {
  width: 100%;
  max-width: 260px;
  touch-action: manipulation;
}

.body-diagram-decor {
  fill: var(--pink-tint);
  stroke: var(--border);
  stroke-width: 2;
}

.body-diagram-zone {
  fill: var(--white);
  stroke: var(--pink);
  stroke-width: 2;
  cursor: pointer;
  transition: fill 0.12s ease, stroke 0.12s ease;
}

.body-diagram-zone:hover {
  fill: var(--pink-tint);
}

.body-diagram-zone.is-selected {
  fill: var(--pink);
  stroke: var(--pink-dark);
}

.body-diagram-lastused {
  fill: none;
  stroke: var(--navy);
  stroke-width: 2.5;
  stroke-dasharray: 3 3;
  pointer-events: none;
}

.body-diagram-selected {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--navy-soft);
  margin: 0;
  text-align: center;
}

.body-diagram-selected.has-selection {
  color: var(--pink-dark);
}

/* Dashboard: normalized card styling */
.dashboard-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.dashboard-value-grid {
  margin-top: 20px;
}

.dashboard-value-grid .value-item {
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border);
}

.dashboard-value-grid .value-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.1rem;
}

.dashboard-value-grid .value-icon svg {
  width: 18px;
  height: 18px;
}

/* Tracker landing page */
.tracker-hint {
  font-size: 0.85rem;
  color: var(--navy-soft);
  text-align: center;
  margin: 8px 0 0;
}

.tracker-action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.tracker-action-btn {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--pink-tint);
  color: var(--pink-dark);
  text-decoration: none;
  white-space: nowrap;
}

.tracker-action-btn:hover { background: var(--pink-tint-2); }

.tracker-history {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.dose-history-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.dose-history-item:first-child { border-top: none; }

.dose-history-main {
  margin: 0;
  font-weight: 700;
  color: var(--navy);
  font-size: 0.95rem;
}

.dose-history-meta {
  margin: 2px 0 0;
  color: var(--navy-soft);
  font-size: 0.85rem;
}

.dose-history-date {
  flex: none;
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy-soft);
  white-space: nowrap;
}

/* Dashboard: progress rings card */
.progress-card { margin-top: 32px; }

.progress-card-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  margin: 0 0 18px;
}

.progress-rings-row {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.progress-rings-svg-wrap {
  position: relative;
  width: 150px;
  height: 150px;
  flex: none;
}

.progress-rings-svg { width: 100%; height: 100%; }

.progress-rings-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.progress-rings-center-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--navy);
  margin: 0;
  line-height: 1;
}

.progress-rings-center-label {
  font-size: 0.66rem;
  line-height: 1.2;
  color: var(--navy-soft);
  margin: 4px 0 0;
  max-width: 88px;
}

.progress-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-width: 160px;
}

.progress-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.progress-legend-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.progress-legend-label {
  flex: 1;
  color: var(--navy);
}

.progress-legend-value {
  font-weight: 700;
  color: var(--navy-soft);
}

/* Dashboard: "next update" card */
.update-card {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.update-illustration {
  flex: none;
  width: 72px;
  height: 72px;
}

.update-card p { margin: 0; }
.update-card .value-item-title { margin-bottom: 4px; }

/* Dashboard: fixed bottom tab bar */
body.has-tab-bar { padding-bottom: 76px; }

.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tab-bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px 8px;
  text-decoration: none;
  color: var(--navy-soft);
  font-size: 0.7rem;
  font-weight: 600;
}

.tab-bar-item svg { width: 22px; height: 22px; }

.tab-bar-item.is-active { color: var(--pink-dark); }

/* Tracker: List/Calendar toggle */
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.history-toggle {
  display: inline-flex;
  background: var(--pink-tint);
  border-radius: 999px;
  padding: 3px;
}

.history-toggle-btn {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 999px;
  border: none;
  background: none;
  color: var(--navy-soft);
  cursor: pointer;
}

.history-toggle-btn.is-active {
  background: var(--white);
  color: var(--pink-dark);
  box-shadow: 0 1px 3px rgba(43, 43, 54, 0.12);
}

/* Tracker: calendar view */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.calendar-nav button {
  background: var(--pink-tint);
  border: none;
  color: var(--pink-dark);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 1.1rem;
  cursor: pointer;
}

.calendar-month-label {
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-dayname {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--navy-soft);
  padding-bottom: 4px;
}

.calendar-day {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 10px;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--navy);
  cursor: pointer;
}

.calendar-day:hover { background: var(--pink-tint); }

.calendar-day.is-empty { cursor: default; }
.calendar-day.is-empty:hover { background: none; }

.calendar-day.is-selected {
  background: var(--pink);
  color: var(--white);
  font-weight: 700;
}

.calendar-dot {
  position: absolute;
  bottom: 5px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--pink);
}

.calendar-day.is-selected .calendar-dot { background: var(--white); }

.calendar-detail {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.calendar-detail-photo {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-top: 8px;
  display: block;
}

/* Article pages — deliberately not the app's playful brand styling.
   Editorial, muted, no pink, so health content reads as trustworthy
   rather than as a marketing page. */
.article-header {
  border-bottom: 1px solid #e5e5e5;
  padding: 18px 24px;
}

.article-header-inner {
  max-width: 720px;
  margin: 0 auto;
}

.article-wordmark {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.95rem;
  color: #555;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.article-main {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

.article-kicker {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #767676;
}

.article-title {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  line-height: 1.2;
  color: #1a1a1a;
  margin: 10px 0 14px;
}

.article-byline {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: #767676;
  border-bottom: 1px solid #e5e5e5;
  padding-bottom: 20px;
  margin-bottom: 28px;
}

.article-photo {
  width: 100%;
  border-radius: 4px;
  display: block;
  margin: 28px 0 6px;
}

.article-photo-credit {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: #9a9a9a;
  margin: 0 0 28px;
}

.article-body {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  line-height: 1.7;
  color: #2a2a2a;
}

.article-body p { margin: 0 0 20px; }

.article-body h2 {
  font-family: var(--sans);
  font-size: 1.25rem;
  font-weight: 800;
  color: #1a1a1a;
  margin: 36px 0 14px;
}

.article-body ul {
  margin: 0 0 20px;
  padding-left: 22px;
}

.article-body li { margin-bottom: 10px; }

.article-body a {
  color: #1a1a1a;
  text-decoration: underline;
  text-decoration-color: #ccc;
}

.article-footer {
  border-top: 1px solid #e5e5e5;
  padding: 24px;
  font-family: var(--sans);
  font-size: 0.78rem;
  color: #9a9a9a;
  text-align: center;
}

.article-footer a { color: #767676; }

.learn-index-item {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e5e5e5;
  font-family: var(--sans);
  font-size: 1.05rem;
}

.learn-index-item a {
  color: #1a1a1a;
  text-decoration: none;
  font-weight: 700;
}

.learn-index-item a:hover { text-decoration: underline; }

/* Progress photos (native-only Photos tab) */
.photos-privacy-notice {
  background: var(--pink-tint-2);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: var(--navy);
}

.photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.photos-grid-cell {
  position: relative;
  aspect-ratio: 1;
  border: none;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--pink-tint);
  cursor: pointer;
}

.photos-grid-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photos-grid-date {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 4px 6px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(to top, rgba(43, 43, 54, 0.75), transparent);
  text-align: left;
}

.photos-detail {
  position: fixed;
  inset: 0;
  background: rgba(43, 43, 54, 0.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.photos-detail-inner {
  background: var(--bg);
  border-radius: 16px;
  padding: 20px;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.photos-detail-inner img {
  width: 100%;
  border-radius: 12px;
  display: block;
}

.photos-detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(43, 43, 54, 0.6);
  color: var(--white);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}

/* Flipbook */
.flipbook-frame-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--pink-tint);
  aspect-ratio: 3 / 4;
}

.flipbook-frame-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.flipbook-frame-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 12px;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(to top, rgba(43, 43, 54, 0.75), transparent);
}

.flipbook-scrubber {
  width: 100%;
  margin-top: 14px;
  accent-color: var(--pink);
}

.flipbook-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.flipbook-speed-group {
  display: flex;
  gap: 6px;
}

.flipbook-speed-btn {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--navy-soft);
  cursor: pointer;
}

.flipbook-speed-btn.is-selected {
  background: var(--pink);
  border-color: var(--pink);
  color: var(--white);
}

.flipbook-options-row {
  display: flex;
  gap: 20px;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--navy-soft);
}

.flipbook-options-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.flipbook-range-row {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--navy-soft);
}

.flipbook-range-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.flipbook-range-row select {
  font-family: var(--sans);
  font-size: 0.85rem;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--navy);
}


/* Sign-up consent notice — small but deliberately legible, directly under the
   button it refers to. These notices are only binding if a reasonable person
   would notice them. */
.legal-consent {
  margin: 12px 0 0;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--navy-soft);
  text-align: center;
}
.legal-consent a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
