:root {
  color-scheme: light;
  --ink: #3d3530;
  --muted: #918882;
  --line: #eee3da;
  --paper: #ffffff;
  --canvas: #fffbf7;
  --cream: #fff0de;
  --peach: #fff6ed;
  --peach-strong: #ffead8;
  --orange: #ff781a;
  --orange-dark: #d95f0d;
  --chalk: #07584c;
  --rose: #a66f6d;
  --blue: #59b4da;
  --shadow: 0 18px 50px rgba(121, 84, 55, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: linear-gradient(180deg, var(--cream) 0 76px, var(--canvas) 76px 100%);
}

button, input { font: inherit; }

.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 32px;
}

.page-header,
.record-heading,
.section-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.page-header {
  align-items: center;
  padding: 30px 32px;
  border: 3px solid #e8a875;
  border-radius: 22px;
  color: #fffdf9;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.025)),
    var(--chalk);
  box-shadow: 0 7px 0 #bf895f, var(--shadow);
}

.eyebrow, .section-kicker, .weekday {
  margin: 0 0 8px;
  color: var(--orange);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff2bc;
  letter-spacing: 0.1em;
}

.eyebrow span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #cfe978;
  box-shadow: 0 0 0 4px rgba(207, 233, 120, 0.14);
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(2rem, 4vw, 3.35rem); letter-spacing: -0.045em; }
h2 { margin-bottom: 0; font-size: 1.45rem; letter-spacing: -0.025em; }
.intro { margin-bottom: 0; color: rgba(255, 255, 255, 0.76); }

.date-nav {
  display: flex;
  align-items: center;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 14px;
  background: #fffaf4;
  box-shadow: 0 8px 28px rgba(26, 55, 45, 0.16);
}

.nav-button, .date-picker input {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  color: var(--ink);
  background: transparent;
}

.nav-button { padding: 0 12px; cursor: pointer; }
.nav-button:hover:not(:disabled) { color: var(--orange-dark); background: var(--peach-strong); }
.nav-button:disabled { color: #b8bdb7; cursor: default; }
.date-picker input { padding: 0 10px; font-weight: 650; cursor: pointer; }

.status-panel {
  margin-top: 48px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--muted);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.status-panel.error { color: #9a433a; background: #fff6f3; border-color: #efcfca; }

.record-heading {
  margin-top: 28px;
  padding: 30px 32px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(135deg, #fffaf5, #fff3e7);
  box-shadow: var(--shadow);
}

.metadata { display: flex; gap: 34px; margin: 0; }
.metadata div { min-width: 136px; }
.metadata dt { margin-bottom: 5px; color: var(--muted); font-size: 0.75rem; }
.metadata dd { margin: 0; font-size: 0.94rem; font-weight: 650; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.summary-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 8px 28px rgba(121, 84, 55, 0.04);
}

.summary-card strong { display: block; font-size: 1.75rem; letter-spacing: -0.04em; }
.summary-card span { color: var(--muted); font-size: 0.82rem; }
.summary-card:nth-child(1) strong,
.summary-card:nth-child(2) strong { color: var(--orange-dark); }
.summary-card:nth-child(3) strong { color: var(--blue); }
.summary-card:nth-child(4) strong { color: var(--rose); }

.members-section {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.section-title-row { padding: 26px 30px 20px; }
.section-kicker { letter-spacing: 0.12em; }
.record-count { margin: 0; color: var(--muted); font-size: 0.82rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 18px 30px; border-top: 1px solid var(--line); text-align: left; }
th { color: var(--muted); background: #fbfaf9; font-size: 0.76rem; font-weight: 650; }
td { font-size: 0.94rem; }
td:first-child { font-weight: 700; }
tbody tr { transition: background-color 150ms ease; }
tbody tr:hover { background: #fffbf7; }
tbody tr.is-checked { background: var(--peach); }
tbody td:nth-child(2), tbody td:nth-child(4) { color: var(--rose); font-weight: 650; }
tbody td:nth-child(3) { color: var(--blue); font-weight: 700; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 650;
}
.badge.done { color: var(--orange-dark); background: var(--peach-strong); }
.badge.pending { color: #958d87; background: #f4f2f0; }
.member-cards { display: none; }

footer { padding: 28px 4px 0; color: var(--muted); font-size: 0.75rem; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 760px) {
  body { background: linear-gradient(180deg, var(--cream) 0 52px, var(--canvas) 52px 100%); }
  .shell { width: min(100% - 24px, 600px); padding-top: 20px; }
  .page-header, .record-heading { align-items: stretch; flex-direction: column; gap: 24px; }
  .page-header { padding: 24px 20px; border-width: 2px; border-radius: 18px; box-shadow: 0 5px 0 #bf895f, var(--shadow); }
  .date-nav { justify-content: space-between; width: 100%; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .metadata { justify-content: space-between; gap: 14px; }
  .metadata div { min-width: 0; }
  .record-heading { padding: 24px; }
  .table-wrap { display: none; }
  .member-cards { display: grid; gap: 12px; padding: 0 14px 14px; }
  .member-card { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fffdfb; }
  .member-card.is-checked { border-color: #f2d6c1; background: var(--peach); }
  .member-card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
  .member-card h3 { margin: 0; font-size: 1rem; }
  .member-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; }
  .member-stats div { min-width: 0; }
  .member-stats dt { color: var(--muted); font-size: 0.68rem; }
  .member-stats dd { margin: 5px 0 0; font-size: 0.88rem; font-weight: 650; }
  .member-stats div:nth-child(1) dd,
  .member-stats div:nth-child(3) dd { color: var(--rose); }
  .member-stats div:nth-child(2) dd { color: var(--blue); }
  .section-title-row { padding: 22px 20px 18px; }
}

@media (max-width: 420px) {
  .nav-button span { display: none; }
  .summary-card { padding: 18px; }
  .summary-card strong { font-size: 1.45rem; }
  .metadata { flex-direction: column; }
  h1 { font-size: 2rem; }
  .intro { font-size: 0.88rem; line-height: 1.6; }
}
