:root {
  color-scheme: light;
  font-family:
    Inter, ui-rounded, "SF Pro Rounded", system-ui, -apple-system, sans-serif;
  color: #1d2b24;
  background: #f4f0e7;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

body {
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  align-items: center;
  background: #1d4a39;
  display: flex;
  justify-content: space-between;
  min-height: 4rem;
  padding: 0.8rem max(1rem, calc((100% - 70rem) / 2));
}

.brand,
.header-link,
.switch-member {
  color: #fff;
  text-decoration: none;
}

.brand {
  font-size: 1.15rem;
  font-weight: 800;
}

.switch-member {
  font-size: 0.9rem;
}

.header-actions {
  align-items: center;
  display: flex;
  gap: 1rem;
}

.header-link {
  font-size: 0.9rem;
  padding: 0.35rem 0;
}

.header-link[aria-current="page"] {
  border-bottom: 0.15rem solid #f0a476;
  font-weight: 800;
}

.page {
  margin: 0 auto;
  max-width: 70rem;
  padding: 2rem 1rem 5rem;
}

.intro {
  max-width: 42rem;
}

.intro h1 {
  font-size: clamp(2rem, 8vw, 3.6rem);
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0.2rem 0 1rem;
}

.eyebrow,
.task-meta {
  color: #547065;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

section {
  margin-top: 2.5rem;
}

h2 {
  font-size: 1.25rem;
}

.section-heading {
  align-items: baseline;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.section-heading a,
.today-link {
  color: #1d4a39;
  font-weight: 800;
}

.task-grid,
.member-grid,
.reward-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

.task-card,
.member-card,
.add-member,
.completed-list {
  background: #fffdf8;
  border: 1px solid #dcd4c5;
  border-radius: 1rem;
  box-shadow: 0 0.2rem 0.8rem rgb(63 48 27 / 8%);
}

.task-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: space-between;
  padding: 1.2rem;
}

.task-card h3,
.task-card p {
  margin-top: 0;
}

.task-card h3 {
  margin-bottom: 0.45rem;
}

.task-title-row {
  align-items: start;
  display: flex;
  gap: 0.8rem;
  justify-content: space-between;
}

.points-chip {
  background: #fff0cc;
  border-radius: 999px;
  color: #744218;
  display: inline-block;
  flex: 0 0 auto;
  font-size: 0.8rem;
  font-weight: 900;
  padding: 0.3rem 0.55rem;
}

.claim-note {
  background: #e4eee7;
  border-radius: 0.5rem;
  color: #1d4a39;
  font-size: 0.9rem;
  font-weight: 800;
  padding: 0.65rem;
}

.task-actions {
  display: grid;
  gap: 0.65rem;
}

.task-card details {
  border-top: 1px solid #e6dfd3;
  padding-top: 0.8rem;
}

.task-card summary {
  cursor: pointer;
  font-weight: 700;
}

.task-card h4 {
  margin-bottom: 0.3rem;
}

.button,
.member-card {
  border: 0;
  cursor: pointer;
  font-weight: 800;
}

.button {
  background: #e36c36;
  border-radius: 999px;
  color: #fff;
  padding: 0.8rem 1.1rem;
  width: 100%;
}

.button:hover,
.button:focus-visible {
  background: #c8501f;
}

.button:disabled,
.member-card:disabled {
  cursor: wait;
  opacity: 0.6;
}

.button.secondary {
  background: #1d4a39;
  width: auto;
}

.button.secondary.outline {
  background: transparent;
  border: 1px solid #1d4a39;
  color: #1d4a39;
  width: 100%;
}

.button.secondary.outline:hover,
.button.secondary.outline:focus-visible {
  background: #dce9df;
}

.button.compact {
  align-self: end;
  padding-inline: 1.4rem;
  width: auto;
}

.member-card {
  align-items: center;
  color: #1d2b24;
  display: flex;
  font-size: 1.1rem;
  gap: 0.8rem;
  padding: 1.2rem;
  text-align: left;
  width: 100%;
}

.member-card:hover,
.member-card:focus-visible {
  outline: 0.2rem solid #e36c36;
}

.member-initial {
  align-items: center;
  background: #dce9df;
  border-radius: 50%;
  display: flex;
  height: 2.8rem;
  justify-content: center;
  width: 2.8rem;
}

.add-member {
  max-width: 38rem;
  padding: 1.2rem;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.inline-form input {
  border: 1px solid #9c9589;
  border-radius: 0.6rem;
  flex: 1 1 14rem;
  padding: 0.75rem;
}

.form-errors {
  color: #9d2d1c;
}

.completed-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.completed-list li {
  align-items: baseline;
  border-bottom: 1px solid #e6dfd3;
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  padding: 0.9rem 1rem;
}

.completed-list li:last-child {
  border: 0;
}

.completed-list small,
.empty-state {
  color: #66736d;
}

.safety-note {
  background: #fff0cc;
  border-radius: 0.5rem;
  padding: 0.7rem;
}

.messages {
  margin-bottom: 1.5rem;
}

.message {
  background: #dce9df;
  border-radius: 0.6rem;
  padding: 0.8rem 1rem;
}

.status-message {
  border-radius: 0.6rem;
  margin: 0 0 1rem;
  padding: 0.8rem 1rem;
}

.status-message.success {
  background: #dce9df;
}

.status-message.error {
  background: #f8d8d2;
  color: #7a2417;
}

.task-card.is-busy {
  opacity: 0.7;
}

.task-card.is-disabled {
  background: #f0ede6;
}

.completion-actions {
  align-items: flex-end;
  display: grid;
  gap: 0.2rem;
  justify-items: end;
}

.text-button {
  background: transparent;
  border: 0;
  color: #1d4a39;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0;
  text-decoration: underline;
}

.text-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.history-controls {
  align-items: end;
  background: #fffdf8;
  border: 1px solid #dcd4c5;
  border-radius: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  padding: 1rem;
}

.view-switcher {
  background: #e9e4d9;
  border-radius: 999px;
  display: flex;
  padding: 0.25rem;
}

.view-switcher a {
  border-radius: 999px;
  color: #34483f;
  font-size: 0.9rem;
  font-weight: 800;
  padding: 0.55rem 0.9rem;
  text-decoration: none;
}

.view-switcher a[aria-current="page"] {
  background: #1d4a39;
  color: #fff;
}

.history-filter-form {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.history-filter-form label {
  color: #547065;
  display: grid;
  font-size: 0.78rem;
  font-weight: 800;
  gap: 0.25rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.history-filter-form input,
.history-filter-form select {
  background: #fff;
  border: 1px solid #9c9589;
  border-radius: 0.55rem;
  color: #1d2b24;
  min-height: 2.6rem;
  padding: 0.55rem 0.7rem;
}

.history-period {
  position: relative;
}

.period-navigation {
  align-items: center;
  display: grid;
  gap: 1rem;
  grid-template-columns: 2.8rem 1fr 2.8rem;
  text-align: center;
}

.period-navigation h2,
.period-navigation p {
  margin: 0;
}

.period-navigation p {
  color: #66736d;
  font-size: 0.9rem;
  margin-top: 0.3rem;
}

.period-arrow {
  align-items: center;
  background: #fffdf8;
  border: 1px solid #dcd4c5;
  border-radius: 50%;
  color: #1d4a39;
  display: flex;
  font-size: 1.25rem;
  height: 2.8rem;
  justify-content: center;
  text-decoration: none;
  width: 2.8rem;
}

.today-link {
  display: block;
  margin: 0.8rem auto 1.4rem;
  text-align: center;
  width: fit-content;
}

.history-list {
  background: #fffdf8;
  border: 1px solid #dcd4c5;
  border-radius: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.history-list li {
  align-items: center;
  border-bottom: 1px solid #e6dfd3;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 2rem 1fr auto;
  padding: 0.75rem;
}

.history-list li:last-child {
  border-bottom: 0;
}

.completion-person {
  align-items: center;
  background: #dce9df;
  border-radius: 50%;
  display: flex;
  font-size: 0.75rem;
  font-weight: 800;
  height: 2rem;
  justify-content: center;
  width: 2rem;
}

.completion-description {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.completion-description strong {
  overflow-wrap: anywhere;
}

.completion-description small,
.history-list time {
  color: #66736d;
}

.weekly-history {
  background: #fffdf8;
  border: 1px solid #dcd4c5;
  border-radius: 1rem;
  overflow: hidden;
}

.week-day-row {
  border-bottom: 1px solid #dcd4c5;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(10rem, 12rem) 1fr;
  margin: 0;
  padding: 1rem;
}

.week-day-row:last-child {
  border-bottom: 0;
}

.week-day-row.is-today {
  background: #e4eee7;
}

.week-day-heading h3 {
  font-size: 1rem;
  margin: 0;
}

.week-day-heading h3 a {
  color: #1d2b24;
  display: grid;
  gap: 0.15rem;
  text-decoration: none;
}

.week-day-heading h3 span {
  color: #547065;
}

.week-day-heading p {
  color: #66736d;
  font-size: 0.8rem;
  margin: 0.3rem 0 0;
}

.week-day-completions .history-list {
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 0.9rem;
}

.week-day-completions .history-list li {
  padding: 0.55rem 0;
}

.week-day-completions .empty-state {
  font-size: 0.9rem;
  margin: 0;
  padding: 0.55rem 0;
}

.calendar-scroll {
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.month-calendar {
  display: grid;
  gap: 0.35rem;
  grid-template-columns: repeat(7, minmax(6.5rem, 1fr));
  min-width: 48rem;
}

.weekday {
  color: #547065;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.4rem;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  background: #fffdf8;
  border: 1px solid #dcd4c5;
  border-radius: 0.6rem;
  min-height: 8.5rem;
  padding: 0.5rem;
}

.calendar-day.outside-month {
  background: #ebe7de;
  opacity: 0.55;
}

.calendar-day.is-today {
  border: 0.15rem solid #e36c36;
}

.calendar-date {
  align-items: center;
  color: #1d2b24;
  display: flex;
  font-size: 0.85rem;
  font-weight: 800;
  height: 1.7rem;
  justify-content: center;
  text-decoration: none;
  width: 1.7rem;
}

.is-today .calendar-date {
  background: #e36c36;
  border-radius: 50%;
  color: #fff;
}

.calendar-day ul {
  display: grid;
  gap: 0.3rem;
  list-style: none;
  margin: 0.45rem 0 0;
  padding: 0;
}

.calendar-day li {
  background: #e4eee7;
  border-radius: 0.35rem;
  font-size: 0.72rem;
  overflow: hidden;
  padding: 0.3rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day li span {
  color: #1d4a39;
  font-weight: 900;
}

.more-completions {
  color: #1d4a39;
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  margin-top: 0.4rem;
}

.reward-card,
.parent-panel,
.weekly-points,
.request-list {
  background: #fffdf8;
  border: 1px solid #dcd4c5;
  border-radius: 1rem;
  box-shadow: 0 0.2rem 0.8rem rgb(63 48 27 / 8%);
}

.reward-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: space-between;
  padding: 1.2rem;
}

.reward-card h3 {
  margin: 0.2rem 0 0.5rem;
}

.reward-value {
  color: #e36c36;
  font-size: 1.35rem;
  font-weight: 900;
  margin: 0;
}

.request-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.request-list li {
  align-items: center;
  border-bottom: 1px solid #e6dfd3;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 1rem;
}

.request-list li:last-child {
  border-bottom: 0;
}

.request-list li > div:first-child {
  display: grid;
  gap: 0.2rem;
}

.request-list small,
.helper-text {
  color: #66736d;
}

.request-actions,
.decision-actions {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.request-actions .pending {
  color: #9a561c;
  font-weight: 800;
}

.weekly-points {
  display: grid;
}

.weekly-points > div {
  align-items: center;
  border-bottom: 1px solid #e6dfd3;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 2rem 1fr auto;
  padding: 0.8rem 1rem;
}

.weekly-points > div:last-child {
  border: 0;
}

.parent-panel {
  padding: 1.2rem;
}

.parent-panel .eyebrow,
.parent-panel h2 {
  margin: 0;
}

.parent-panel code {
  background: #e9e4d9;
  border-radius: 0.3rem;
  padding: 0.15rem 0.3rem;
}

@media (max-width: 34rem) {
  .site-header {
    align-items: flex-start;
  }

  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .page {
    padding-top: 1.4rem;
  }

  .completed-list li {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-controls,
  .history-filter-form {
    align-items: stretch;
    flex-direction: column;
  }

  .view-switcher {
    align-self: flex-start;
  }

  .button.compact {
    width: 100%;
  }

  .week-day-row {
    gap: 0.45rem;
    grid-template-columns: 1fr;
  }

  .week-day-heading h3 a {
    display: flex;
    justify-content: space-between;
  }

  .request-list li {
    align-items: flex-start;
    flex-direction: column;
  }

  .request-actions,
  .decision-actions {
    align-items: flex-start;
    flex-direction: row;
  }
}
