:root {
  --ink: #16313a;
  --ink-soft: #5e7680;
  --sand: #f6efe6;
  --card: rgba(255, 251, 246, 0.84);
  --line: rgba(22, 49, 58, 0.12);
  --teal: #1b7f79;
  --coral: #e97b63;
  --gold: #ebb85c;
  --shadow: 0 22px 60px rgba(29, 52, 59, 0.12);
}

html {
  font-size: 16px;
  position: relative;
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(233, 123, 99, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(27, 127, 121, 0.16), transparent 28%),
    linear-gradient(180deg, #fffaf4 0%, #f4ecdf 100%);
}

h1, h2, h3, .navbar-brand {
  font-family: "Fraunces", serif;
}

a {
  color: var(--teal);
  text-decoration: none;
}

a:hover {
  color: #125c58;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.22rem rgba(27, 127, 121, 0.18);
  border-color: rgba(27, 127, 121, 0.45);
}

.app-nav {
  background: rgba(255, 250, 244, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.navbar-brand {
  color: var(--ink);
  font-size: 1.55rem;
}

.nav-link,
.nav-link.btn.btn-link {
  color: var(--ink);
  font-weight: 600;
}

.nav-link:hover,
.nav-link.btn.btn-link:hover {
  color: var(--coral);
}

.next-up-link {
  color: #fff9f3;
  text-decoration: underline;
  text-decoration-color: rgba(255, 249, 243, 0.45);
}

.next-up-link:hover {
  color: #fff9f3;
}

.app-shell {
  padding-bottom: 4rem;
}

.hero-panel,
.surface-card,
.stat-card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  padding: 2rem;
  border-radius: 28px;
  margin-bottom: 1.5rem;
}

.home-hero-panel {
  grid-template-columns: 1fr;
}

.hero-panel h1 {
  font-size: clamp(2.2rem, 4vw, 4.4rem);
  line-height: 1.02;
  margin-bottom: 1rem;
}

.hero-copy,
.page-header p,
.member-card p,
.chore-row p,
.list-row p,
.history-row p,
.next-up-card p {
  color: var(--ink-soft);
}

.hero-actions,
.form-actions,
.list-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.list-action-stack {
  display: grid;
  gap: 0.45rem;
  justify-items: center;
}

.btn.btn-remove-item {
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  padding: 0;
  line-height: 1;
  font-size: 0.8rem;
}

.next-up-card,
.surface-card,
.stat-card {
  border-radius: 24px;
}

.next-up-card {
  padding: 1.5rem;
  background: linear-gradient(180deg, rgba(27, 127, 121, 0.96), rgba(18, 92, 88, 0.94));
  color: #fff9f3;
}

.next-up-card p,
.mini-label {
  color: rgba(255, 249, 243, 0.8);
}

.family-photo-card {
  position: relative;
  min-height: 20rem;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.64);
  box-shadow: inset 0 0 0 1px rgba(22, 49, 58, 0.08);
  display: block;
  width: 100%;
  padding: 0;
  cursor: zoom-in;
}

.family-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: rgba(255, 250, 244, 0.7);
  opacity: 1;
  transition: opacity 0.85s ease;
}

.family-photo-next {
  opacity: 0;
}

.family-photo-card.is-swapping .family-photo-current {
  opacity: 0;
}

.family-photo-card.is-swapping .family-photo-next {
  opacity: 1;
}

.photo-lightbox-open {
  overflow: hidden;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.photo-lightbox[hidden] {
  display: none;
}

.photo-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(11, 25, 30, 0.76);
}

.photo-lightbox-dialog {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 72rem);
  max-height: 88vh;
  border-radius: 20px;
  background: rgba(255, 250, 244, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 30px 90px rgba(4, 13, 16, 0.42);
  overflow: hidden;
}

.photo-lightbox-image {
  display: block;
  width: auto;
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
}

.photo-lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(22, 49, 58, 0.18);
  border-radius: 50%;
  background: rgba(255, 250, 244, 0.88);
  color: var(--ink);
  font-weight: 800;
  line-height: 1;
}

.photo-lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 3rem;
  height: 3rem;
  border: 1px solid rgba(22, 49, 58, 0.18);
  border-radius: 50%;
  background: rgba(255, 250, 244, 0.84);
  color: var(--ink);
  font-size: 2.4rem;
  line-height: 1;
  transform: translateY(-50%);
}

.photo-lightbox-prev {
  left: 0.85rem;
}

.photo-lightbox-next {
  right: 0.85rem;
}

.photo-lightbox-close:hover,
.photo-lightbox-nav:hover {
  background: rgba(255, 250, 244, 0.98);
}

.mini-label,
.eyebrow,
.stat-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  font-weight: 700;
}

.eyebrow {
  color: var(--coral);
  margin-bottom: 0.5rem;
}

.stats-grid,
.dashboard-grid {
  display: grid;
  gap: 1rem;
}

.stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1rem;
}

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

.stat-card {
  padding: 1.25rem 1.5rem;
}

.stat-card strong {
  display: block;
  font-size: 2.2rem;
  margin-top: 0.35rem;
}

.stat-card .stat-text {
  font-family: "Manrope", sans-serif;
  font-size: 1.2rem;
  line-height: 1.25;
}

.stat-link {
  color: var(--ink-soft);
  text-decoration: none;
}

.stat-link:hover {
  color: var(--teal);
}

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

.admin-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.surface-card {
  padding: 1.5rem;
}

.spring-board {
  position: relative;
  overflow: hidden;
}

.spring-board::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.42), transparent 34%);
  pointer-events: none;
}

.spring-board-family {
  background: linear-gradient(180deg, rgba(255, 247, 250, 0.95), rgba(255, 241, 245, 0.9));
  border-color: rgba(230, 174, 194, 0.35);
}

.spring-board-chores {
  background: linear-gradient(180deg, rgba(255, 251, 237, 0.96), rgba(255, 246, 222, 0.92));
  border-color: rgba(234, 198, 116, 0.32);
}

.spring-board-calendar {
  background: linear-gradient(180deg, rgba(242, 253, 244, 0.96), rgba(233, 247, 236, 0.92));
  border-color: rgba(142, 201, 154, 0.35);
}

.spring-board-groceries {
  background: linear-gradient(180deg, rgba(242, 250, 255, 0.96), rgba(234, 245, 252, 0.92));
  border-color: rgba(156, 197, 224, 0.35);
}

.section-heading,
.page-header,
.list-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.page-header {
  margin-bottom: 1rem;
}

.page-header h1,
.section-heading h2 {
  margin: 0;
}

.member-list,
.chore-list,
.stack-list {
  display: grid;
  gap: 0.9rem;
}

.member-card,
.chore-row,
.list-row {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.55);
}

.member-card {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.member-card-link {
  color: inherit;
}

.list-row .member-card-link {
  flex: 1;
  min-width: 0;
}

.member-card-link:hover {
  color: inherit;
  transform: translateY(-1px);
}

.member-card-large {
  border: none;
  background: transparent;
  padding: 0;
}

.member-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 700;
}

.member-avatar.sunset { background: linear-gradient(135deg, #e97b63, #f4aa73); }
.member-avatar.ocean { background: linear-gradient(135deg, #1b7f79, #5eb9b2); }
.member-avatar.meadow { background: linear-gradient(135deg, #6aa55c, #b4d87d); }
.member-avatar.berry { background: linear-gradient(135deg, #935f9b, #d28ac3); }

.chore-row,
.list-row,
.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.history-row {
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.55);
}

.chore-memory {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
}

.memory-alert {
  color: #b47d22;
  font-weight: 800;
}

.event-row,
.grocery-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.55);
}

.event-row-full {
  justify-content: space-between;
}

.event-details {
  flex: 1;
}

.event-details p:last-child,
.grocery-row p {
  margin-bottom: 0;
}

.date-badge {
  width: 4.5rem;
  min-width: 4.5rem;
  padding: 0.7rem 0.6rem;
  border-radius: 18px;
  color: #fff9f3;
  text-align: center;
  display: grid;
  gap: 0.15rem;
}

.date-badge span {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.date-badge strong {
  font-size: 1.7rem;
  line-height: 1;
}

.date-badge.sunset { background: linear-gradient(135deg, #e97b63, #f4aa73); }
.date-badge.ocean { background: linear-gradient(135deg, #1b7f79, #5eb9b2); }
.date-badge.meadow { background: linear-gradient(135deg, #6aa55c, #b4d87d); }
.date-badge.berry { background: linear-gradient(135deg, #935f9b, #d28ac3); }

.is-complete {
  opacity: 0.72;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(27, 127, 121, 0.12);
  color: var(--teal);
  font-weight: 700;
}

.status-pill-muted {
  background: rgba(94, 118, 128, 0.14);
  color: var(--ink-soft);
}

.form-card {
  max-width: 42rem;
}

.profile-panel {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.profile-panel-winner {
  border-color: rgba(235, 184, 92, 0.62);
  background: linear-gradient(180deg, rgba(255, 251, 238, 0.94), rgba(255, 246, 221, 0.88));
}

.profile-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 0;
}

.winner-banner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border: 1px solid rgba(235, 184, 92, 0.58);
  border-radius: 18px;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.52);
}

.winner-banner strong,
.winner-banner span:last-child {
  display: block;
}

.winner-banner span:last-child {
  color: var(--ink-soft);
}

.winner-crown,
.score-crown {
  color: #b47d22;
  line-height: 1;
}

.winner-crown {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: rgba(235, 184, 92, 0.22);
  font-size: 1.45rem;
}

.stat-card-points strong {
  color: #b47d22;
}

.home-winner-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  border-color: rgba(235, 184, 92, 0.55);
  background: linear-gradient(180deg, rgba(255, 251, 238, 0.94), rgba(255, 246, 221, 0.88));
}

.home-winner-main {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.home-winner-main h2 {
  margin: 0;
}

.home-winner-main h2 span {
  color: #b47d22;
  font-family: "Manrope", sans-serif;
  font-size: 1rem;
  font-weight: 800;
  margin-left: 0.4rem;
}

.home-winner-main p:last-child {
  margin-bottom: 0;
  color: var(--ink-soft);
}

.home-winner-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.weekly-score-card {
  margin-bottom: 1rem;
}

.monthly-workout-card {
  margin-bottom: 1rem;
}

.scoreboard-list {
  display: grid;
  gap: 0.65rem;
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.48);
}

.score-row:hover {
  color: inherit;
  transform: translateY(-1px);
}

.score-row.is-winner {
  border-color: rgba(235, 184, 92, 0.58);
  background: rgba(255, 246, 221, 0.72);
}

.score-member {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 1.2rem;
  background: rgba(255, 255, 255, 0.35);
}

.empty-state h3 {
  margin-bottom: 0.35rem;
}

.empty-state p,
.form-hint {
  color: var(--ink-soft);
}

.form-control,
.form-select {
  border-radius: 14px;
  border-color: var(--line);
  padding: 0.85rem 1rem;
}

textarea.form-control {
  min-height: 7rem;
}

.btn {
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  font-weight: 700;
}

.btn-primary {
  background-color: var(--coral);
  border-color: var(--coral);
}

.btn-primary:hover {
  background-color: #d8664d;
  border-color: #d8664d;
}

.btn-outline-light {
  border-color: rgba(255, 249, 243, 0.65);
  color: #fff9f3;
}

.btn-outline-light:hover {
  background: rgba(255, 249, 243, 0.12);
  color: #fff9f3;
}

.footer {
  padding: 1.5rem 0 2.5rem;
  color: var(--ink-soft);
}

@media (max-width: 991.98px) {
  .hero-panel,
  .dashboard-grid,
  .admin-panel-grid,
  .stats-grid,
  .profile-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .hero-panel {
    padding: 1.4rem;
  }

  .photo-lightbox {
    padding: 1rem;
  }

  .photo-lightbox-nav {
    width: 2.6rem;
    height: 2.6rem;
    font-size: 2rem;
  }

  .section-heading,
  .page-header,
  .list-row,
  .chore-row,
  .history-row,
  .event-row,
  .grocery-row,
  .home-winner-card,
  .home-winner-main {
    flex-direction: column;
    align-items: flex-start;
  }

  .event-row-full {
    justify-content: flex-start;
  }
}

/* ?? Meal planner grid ?? */
.meal-grid {
    display: grid;
    grid-template-rows: auto;
    overflow-x: auto;
}

.meal-grid-header,
.meal-grid-row {
    display: grid;
    grid-template-columns: 90px repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 4px;
}

.meal-day-header {
    text-align: center;
    padding: 6px 4px;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
}

    .meal-day-header.is-today {
        color: #185FA5;
        border-bottom-color: #185FA5;
    }

    .meal-day-header .day-name {
        display: block;
        text-transform: uppercase;
        font-size: 11px;
        color: #888;
    }

    .meal-day-header .day-date {
        display: block;
        font-size: 13px;
    }

.meal-slot-label {
    font-size: 12px;
    font-weight: 500;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 8px 4px 0 0;
    align-self: start;
}

.meal-cell {
    min-height: 72px;
    border: 0.5px solid #e0ddd6;
    border-radius: 8px;
    padding: 6px;
    background: #fff;
    font-size: 13px;
}

    .meal-cell.has-meal {
        background: #f0f7f4;
        border-color: #9FE1CB;
    }

.meal-cell-content strong {
    display: block;
    font-size: 13px;
    margin-bottom: 2px;
}

.meal-cook {
    display: block;
    font-size: 11px;
    color: #0F6E56;
    margin-bottom: 4px;
}

.meal-cell-actions {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.btn-meal-add {
    width: 100%;
    height: 100%;
    min-height: 60px;
    background: none;
    border: 1.5px dashed #ccc;
    border-radius: 6px;
    color: #aaa;
    font-size: 12px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

    .btn-meal-add:hover {
        border-color: #888;
        color: #555;
    }

.btn-meal-edit,
.btn-meal-clear {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    border: 0.5px solid #ccc;
    background: none;
    cursor: pointer;
    color: #555;
}

.btn-meal-clear {
    color: #c0392b;
    border-color: #f5c6c6;
}

.btn-meal-edit:hover {
    background: #f5f5f5;
}

.btn-meal-clear:hover {
    background: #fff5f5;
}

/* Week nav */
.week-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.week-label {
    font-size: 15px;
    font-weight: 500;
}
/* ?? Calendar timeline ?? */
.calendar-timeline {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calendar-day-group {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    padding: 8px 0;
    border-top: 0.5px solid #e0ddd6;
}

    .calendar-day-group.is-today .calendar-day-label {
        color: #185FA5;
    }

.calendar-day-label {
    text-align: right;
    padding-top: 4px;
    font-size: 13px;
}

    .calendar-day-label .day-name {
        display: block;
        text-transform: uppercase;
        font-size: 11px;
        color: #888;
    }

    .calendar-day-label .day-date {
        display: block;
        font-weight: 500;
    }

.today-badge {
    display: inline-block;
    font-size: 10px;
    background: #185FA5;
    color: white;
    border-radius: 4px;
    padding: 1px 5px;
    margin-top: 3px;
}

.calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.event-card {
    position: relative;
    border: 0.5px solid #e0ddd6;
    border-radius: var(--border-radius-md, 8px);
    padding: 8px 12px;
    background: #fff;
    border-left: 3px solid #ccc;
}

.event-card-local {
    border-left-color: #1D9E75;
}

.event-card-google {
    border-left-color: #378ADD;
}

.event-card-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.event-time {
    color: #000;
    font-size: 13px;
}

.event-location {
    color: #888;
    font-size: 13px;
}

.event-members {
    font-size: 12px;
    background: #E1F5EE;
    color: #0F6E56;
    border-radius: 4px;
    padding: 1px 7px;
    font-weight: 500;
}

.event-card-actions {
    margin-top: 6px;
    display: flex;
    gap: 8px;
}

.btn-ev-action {
    font-size: 12px;
    padding: 2px 10px;
    border: 0.5px solid #ccc;
    border-radius: 4px;
    background: none;
    cursor: pointer;
    color: #555;
    text-decoration: none;
}

.btn-ev-delete {
    color: #c0392b;
    border-color: #f5c6c6;
}

.btn-ev-action:hover {
    background: #f5f5f5;
}

.btn-ev-delete:hover {
    background: #fff5f5;
}

.event-source-badge {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 10px;
    color: #888;
    background: #f5f5f5;
    border-radius: 4px;
    padding: 1px 6px;
}

.event-source-google {
    background: #E6F1FB;
    color: #185FA5;
}
/* ?? Calendar filter bar ?? */
.cal-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cal-filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 6px;
    border: 0.5px solid #e0ddd6;
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    transition: border-color 0.15s, background 0.15s;
}

    .cal-filter-btn:hover {
        border-color: #aaa;
        background: #f9f9f9;
    }

    .cal-filter-btn.active {
        border-color: #1D9E75;
        background: #E1F5EE;
        color: #0F6E56;
        font-weight: 500;
    }

.cal-filter-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
}

.cal-avatar-all {
    background: #e0ddd6;
    color: #555;
    font-size: 10px;
}

/* ?? Event avatars ?? */
.event-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 500;
    flex-shrink: 0;
}
