:root {
  --bg: #f6f3eb;
  --ink: #18211d;
  --muted: #66746b;
  --line: #e1ddd0;
  --surface: #fffdf8;
  --soft: #edf5e8;
  --brand: #287a64;
  --brand-dark: #123f38;
  --accent: #d68b45;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
  cursor: pointer;
}

.family-app {
  width: min(720px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: #fbfaf5;
  box-shadow: 0 0 0 1px var(--line);
}

.app-top {
  position: sticky;
  z-index: 8;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 16px;
  background: rgba(251, 250, 245, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
}

.brand span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
}

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--brand);
  font-weight: 850;
}

.pill-nav {
  position: sticky;
  z-index: 7;
  top: 72px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 245, 0.92);
  backdrop-filter: blur(14px);
}

.pill-nav button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 750;
}

.pill-nav .is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

main {
  padding: 16px 16px 90px;
}

.current-label,
.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page {
  display: none;
}

.page.is-active {
  display: grid;
  gap: 16px;
}

h1,
h2,
p {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.35rem, 9vw, 4.4rem);
  line-height: 1.02;
}

h2 {
  font-size: 1.45rem;
}

p {
  color: var(--muted);
  line-height: 1.58;
}

.soft-hero,
.app-card,
.care-card,
.report-card,
.routine-board,
.school-kit,
.op-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 16px 44px rgba(40, 70, 58, 0.08);
}

.soft-hero {
  display: grid;
  overflow: hidden;
  background: var(--brand-dark);
  color: #fff;
}

.soft-hero > div,
.app-card,
.routine-board,
.school-kit {
  padding: 24px;
}

.soft-hero p,
.soft-hero .eyebrow,
.crisis-card p,
.crisis-card .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

.soft-hero img {
  width: 100%;
  min-height: 240px;
  object-fit: cover;
}

.compact {
  min-height: 280px;
}

.hero-actions,
.quick-actions,
.daily-grid,
.split-page,
.operation-stack {
  display: grid;
  gap: 12px;
}

.hero-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 20px;
}

.hero-actions button,
.panic-button,
.quick-actions button,
.school-kit button,
.report-card button {
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  background: var(--brand);
  color: #fff;
  font-weight: 850;
}

.hero-actions button:last-child {
  background: #fff;
  color: var(--brand-dark);
}

.daily-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.care-card,
.op-card {
  padding: 18px;
}

.care-card span,
.op-card span {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.highlight {
  background: var(--soft);
}

.crisis-card {
  background: linear-gradient(135deg, #164a40, #2b8068);
  color: #fff;
}

.panic-button {
  width: 100%;
  margin-top: 22px;
  background: #f1c26a;
  color: #173629;
}

.quick-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.quick-actions button,
.school-kit button {
  background: var(--soft);
  color: var(--brand-dark);
}

.timeline {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.timeline strong {
  color: var(--brand);
}

.timeline span {
  color: var(--muted);
}

.routine-board {
  display: grid;
  gap: 20px;
  background: #eef6e9;
}

.routine-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.routine-steps span {
  display: grid;
  place-items: center;
  min-height: 78px;
  border-radius: 18px;
  background: var(--surface);
  color: var(--brand-dark);
  font-weight: 850;
}

.split-page {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.75fr);
}

.report-card {
  padding: 24px;
}

.report-card ul {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.5;
}

.school-kit {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 340px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #17201c;
  color: #fff;
  opacity: 0;
  transform: translateY(12px);
  transition: 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 640px) {
  .menu-button {
    display: inline-grid;
    place-items: center;
  }

  .pill-nav {
    display: none;
  }

  .nav-open .pill-nav {
    position: fixed;
    inset: 72px 0 auto;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 16px;
  }

  .daily-grid,
  .quick-actions,
  .routine-steps,
  .split-page,
  .hero-actions {
    grid-template-columns: 1fr;
  }
}
