:root {
  --ey-bg: #fffaf2;
  --ey-surface: #ffffff;
  --ey-surface-soft: #f5efe3;
  --ey-text: #24302f;
  --ey-muted: #65736f;
  --ey-primary: #2f766d;
  --ey-primary-soft: #d7eee9;
  --ey-sage: #e4f0dd;
  --ey-sky: #e2f1f7;
  --ey-blush: #f8e3dc;
  --ey-amber: #f7e7b9;
  --ey-danger: #b94747;
  --ey-radius: 24px;
  --ey-shadow: 0 18px 48px rgb(42 56 54 / 12%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, var(--ey-primary-soft), transparent 34rem),
    linear-gradient(135deg, var(--ey-bg), #f6f3ec);
  color: var(--ey-text);
  min-height: 100vh;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0;
}

.hero {
  background: rgb(255 255 255 / 82%);
  border: 1px solid rgb(36 48 47 / 8%);
  border-radius: calc(var(--ey-radius) + 12px);
  box-shadow: var(--ey-shadow);
  padding: clamp(28px, 6vw, 72px);
}

.hero.compact h1 {
  font-size: clamp(2rem, 5vw, 4rem);
}

.eyebrow {
  color: var(--ey-primary);
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2.25rem, 6vw, 5rem);
  line-height: 0.96;
  margin: 0;
  max-width: 980px;
}

.hero p:not(.eyebrow) {
  color: var(--ey-muted);
  font-size: 1.18rem;
  line-height: 1.7;
  max-width: 780px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.actions a {
  background: var(--ey-primary);
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
  padding: 14px 22px;
  text-decoration: none;
}

.actions a + a {
  background: var(--ey-surface-soft);
  color: var(--ey-text);
}

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 28px;
}

.photo-section {
  margin-top: 30px;
}

.photo-section h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
  margin: 0 0 16px;
}

.photo-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.photo-card {
  align-items: center;
  background: var(--ey-surface);
  border: 1px solid rgb(36 48 47 / 8%);
  border-radius: var(--ey-radius);
  box-shadow: 0 12px 28px rgb(42 56 54 / 8%);
  display: grid;
  gap: 18px;
  grid-template-columns: 86px 1fr;
  min-height: 136px;
  padding: 18px;
}

.photo-avatar {
  align-items: center;
  aspect-ratio: 1;
  background:
    radial-gradient(circle at 30% 20%, var(--ey-blush), transparent 42%),
    linear-gradient(135deg, var(--ey-primary-soft), var(--ey-sky));
  border: 4px solid #fff;
  border-radius: 24px;
  box-shadow: 0 10px 24px rgb(42 56 54 / 14%);
  color: var(--ey-primary);
  display: grid;
  font-size: 1.45rem;
  font-weight: 800;
  justify-items: center;
}

.photo-card strong {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.photo-card p {
  color: var(--ey-muted);
  margin: 0 0 12px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  background: var(--ey-primary-soft);
  border-radius: 999px;
  color: var(--ey-primary);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 7px 10px;
}

.badge.amber {
  background: var(--ey-amber);
  color: #735311;
}

.badge.red {
  background: var(--ey-blush);
  color: var(--ey-danger);
}

.verification-card {
  background: var(--ey-surface);
  border: 1px solid rgb(36 48 47 / 8%);
  border-radius: calc(var(--ey-radius) + 8px);
  box-shadow: var(--ey-shadow);
  display: grid;
  gap: 18px;
  grid-column: 1 / -1;
  padding: clamp(20px, 4vw, 36px);
}

.card {
  background: var(--ey-surface);
  border: 1px solid rgb(36 48 47 / 8%);
  border-radius: var(--ey-radius);
  box-shadow: 0 12px 28px rgb(42 56 54 / 8%);
  padding: 22px;
}

.action-card {
  align-items: flex-start;
  background: var(--ey-surface);
  border: 2px solid rgb(47 118 109 / 18%);
  border-radius: var(--ey-radius);
  box-shadow: 0 12px 28px rgb(42 56 54 / 8%);
  display: flex;
  flex-direction: column;
  min-height: 190px;
  padding: 26px;
}

.action-card strong {
  font-size: 1.35rem;
  margin-bottom: 12px;
}

.action-card span {
  background: var(--ey-primary-soft);
  border-radius: 999px;
  color: var(--ey-primary);
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 16px;
  padding: 8px 11px;
}

.action-card p {
  color: var(--ey-muted);
  line-height: 1.55;
  margin: auto 0 0;
}

.card span {
  background: var(--ey-sage);
  border-radius: 999px;
  color: var(--ey-primary);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 12px;
  padding: 7px 10px;
}

.card strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.card p {
  color: var(--ey-muted);
  line-height: 1.55;
  margin: 0;
}

.card-action {
  color: var(--ey-primary);
  display: inline-flex;
  font-weight: 800;
  margin-top: 16px;
  text-decoration: none;
}

.metric-card {
  background: var(--ey-surface);
  border-radius: var(--ey-radius);
  box-shadow: 0 12px 28px rgb(42 56 54 / 8%);
  min-height: 150px;
  padding: 24px;
}

.metric-card span {
  color: var(--ey-muted);
  display: block;
  font-weight: 800;
  margin-bottom: 14px;
}

.metric-card strong {
  display: block;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
}

.metric-card p {
  color: var(--ey-muted);
  line-height: 1.45;
}

.metric-card.green {
  background: linear-gradient(135deg, #fff, var(--ey-sage));
}

.metric-card.amber {
  background: linear-gradient(135deg, #fff, var(--ey-amber));
}

.metric-card.red,
.card.red {
  background: linear-gradient(135deg, #fff, var(--ey-blush));
}

.metric-card.blue {
  background: linear-gradient(135deg, #fff, var(--ey-sky));
}

.profile-hero,
.family-welcome,
.sensitive-panel {
  align-items: center;
  background: var(--ey-surface);
  border: 1px solid rgb(36 48 47 / 8%);
  border-radius: calc(var(--ey-radius) + 8px);
  box-shadow: var(--ey-shadow);
  display: grid;
  gap: 24px;
  grid-template-columns: auto 1fr;
  margin-top: 28px;
  padding: clamp(24px, 5vw, 44px);
}

.family-welcome,
.sensitive-panel {
  display: block;
}

.photo-avatar.jumbo {
  border-radius: 32px;
  font-size: 2.4rem;
  width: min(170px, 30vw);
}

.timeline-feed {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.timeline-card {
  background: var(--ey-surface);
  border-left: 8px solid var(--ey-primary-soft);
  border-radius: var(--ey-radius);
  box-shadow: 0 12px 28px rgb(42 56 54 / 8%);
  padding: 22px 24px;
}

.timeline-card time {
  color: var(--ey-muted);
  display: block;
  font-weight: 800;
  margin-bottom: 8px;
}

.timeline-card strong {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.timeline-card.green {
  border-left-color: #7fc2a8;
}

.timeline-card.amber {
  border-left-color: #e0b954;
}

.timeline-card.blue {
  border-left-color: #88bde4;
}

.mobile-bottom-nav {
  background: var(--ey-surface);
  border-radius: 999px;
  bottom: 16px;
  box-shadow: var(--ey-shadow);
  display: flex;
  gap: 4px;
  justify-content: space-around;
  left: 50%;
  max-width: 520px;
  padding: 10px;
  position: sticky;
  transform: translateX(-50%);
  width: min(100%, calc(100vw - 32px));
}

.mobile-bottom-nav a {
  color: var(--ey-muted);
  font-weight: 800;
  padding: 10px 12px;
}

.tab-strip {
  background: rgb(255 255 255 / 86%);
  border: 1px solid rgb(36 48 47 / 8%);
  border-radius: 999px;
  display: flex;
  gap: 8px;
  margin-top: 22px;
  overflow-x: auto;
  padding: 8px;
}

.tab-strip a {
  background: var(--ey-surface-soft);
  border-radius: 999px;
  color: var(--ey-muted);
  flex: 0 0 auto;
  font-weight: 800;
  padding: 10px 14px;
}

.tab-strip a:first-child {
  background: var(--ey-primary);
  color: #fff;
}

.detail-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 22px;
}

.detail-panel {
  background: var(--ey-surface);
  border: 1px solid rgb(36 48 47 / 8%);
  border-radius: var(--ey-radius);
  box-shadow: 0 12px 28px rgb(42 56 54 / 8%);
  padding: 22px;
}

.detail-panel h2 {
  font-size: 1.25rem;
  margin: 0 0 14px;
}

.detail-panel ul {
  color: var(--ey-muted);
  line-height: 1.65;
  margin: 0;
  padding-left: 20px;
}

.quick-action-drawer {
  background: linear-gradient(135deg, var(--ey-primary-soft), #fff);
  border-radius: calc(var(--ey-radius) + 8px);
  box-shadow: var(--ey-shadow);
  display: grid;
  gap: 18px;
  grid-column: 1 / -1;
  grid-template-columns: 120px 1fr;
  margin-top: 22px;
  padding: 24px;
}

.auth-card {
  background: var(--ey-surface);
  border-radius: calc(var(--ey-radius) + 8px);
  box-shadow: var(--ey-shadow);
  margin: 28px auto 0;
  max-width: 620px;
  padding: clamp(26px, 5vw, 48px);
}

.auth-form {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.auth-alt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 18px;
}

.qr-panel {
  align-items: center;
  background: var(--ey-surface-soft);
  border: 2px dashed var(--ey-primary-soft);
  border-radius: var(--ey-radius);
  display: flex;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  justify-content: center;
  margin: 24px auto;
  min-height: 180px;
  padding: 24px;
  text-align: center;
  word-break: break-all;
}

.auth-shell .hero .actions {
  justify-content: center;
}

.auth-form label,
.workflow-form label {
  color: var(--ey-muted);
  display: grid;
  font-weight: 800;
  gap: 8px;
}

.auth-form input,
.workflow-form input,
.workflow-form textarea {
  border: 1px solid rgb(36 48 47 / 14%);
  border-radius: 18px;
  color: var(--ey-text);
  font: inherit;
  padding: 15px 16px;
}

.workflow-form textarea {
  min-height: 130px;
  resize: vertical;
}

.auth-form button,
.workflow-form button {
  background: var(--ey-primary);
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 15px 18px;
}

.auth-note {
  color: var(--ey-muted);
  line-height: 1.6;
}

.workflow-panel {
  background: var(--ey-surface);
  border: 1px solid rgb(36 48 47 / 8%);
  border-radius: calc(var(--ey-radius) + 8px);
  box-shadow: var(--ey-shadow);
  margin-top: 28px;
  padding: clamp(22px, 5vw, 44px);
}

.workflow-form {
  display: grid;
  gap: 20px;
}

.readonly-field {
  background: var(--ey-surface-soft);
  border-radius: 18px;
  padding: 16px;
}

.readonly-field span {
  color: var(--ey-muted);
  display: block;
  font-size: 0.85rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.readonly-field strong {
  color: var(--ey-text);
  display: block;
}

.form-status {
  background: var(--ey-surface-soft);
  border-radius: 16px;
  color: var(--ey-muted);
  font-weight: 800;
  margin: 0;
  padding: 14px 16px;
}

.form-status.success {
  background: var(--ey-sage);
  color: #245f4c;
}

.form-status.error {
  background: var(--ey-blush);
  color: var(--ey-danger);
}

.form-status.loading {
  background: var(--ey-sky);
  color: #2f607d;
}

.workflow-form button[disabled] {
  cursor: wait;
  opacity: 0.65;
}

.screen-toolbar {
  align-items: end;
  background: rgb(255 255 255 / 88%);
  border: 1px solid rgb(36 48 47 / 8%);
  border-radius: var(--ey-radius);
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(220px, 1.4fr) minmax(220px, 1fr);
  margin-top: 28px;
  padding: 18px;
}

.room-toolbar {
  position: sticky;
  top: 12px;
  z-index: 2;
}

.search-field {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.search-field input {
  background: #fff;
  border: 1px solid rgb(36 48 47 / 12%);
  border-radius: 16px;
  font: inherit;
  padding: 14px 16px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-chip,
.quick-log-button {
  background: var(--ey-surface-soft);
  border: 1px solid rgb(36 48 47 / 8%);
  border-radius: 999px;
  color: var(--ey-text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 12px 16px;
}

.filter-chip.active,
.quick-log-button:hover {
  background: var(--ey-primary-soft);
  color: var(--ey-primary);
}

.photo-card.selected {
  border-color: var(--ey-primary);
  box-shadow: 0 0 0 3px rgb(47 118 109 / 18%);
}

.timeline-card.selected {
  border-color: var(--ey-primary);
  box-shadow: 0 0 0 3px rgb(47 118 109 / 18%);
}

.quick-log-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 12px;
}

.family-message-form {
  margin-top: 28px;
}

@media (max-width: 680px) {
  .shell {
    padding: 24px 0;
  }

  .hero {
    padding: 28px;
  }

  .actions a {
    text-align: center;
    width: 100%;
  }

  .profile-hero {
    grid-template-columns: 1fr;
  }

  .photo-avatar.jumbo {
    width: 138px;
  }

  .screen-toolbar {
    grid-template-columns: 1fr;
  }
}
