:root {
  color-scheme: light;
  --bg: #fffdf9;
  --paper: #ffffff;
  --text: #2a2620;
  --muted: #6f685e;
  --border: #e0e0e0;
  --soft-border: #eee7df;
  --accent: #1a1a1a;
  --red-day: #dd0c0c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

.page-header {
  border-bottom: 1px solid var(--soft-border);
  background: rgba(255, 253, 249, 0.96);
}

.day-nav {
  display: grid;
  gap: 12px;
  width: min(100% - 32px, 840px);
  margin: 0 auto;
  padding: 14px 0;
}

.day-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--paper);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.calendar-link {
  justify-self: start;
}

.calendar-link::before {
  content: "← ";
}

.day-switcher .nav-link:first-child::before {
  content: "← ";
}

.day-switcher .nav-link:last-child::after {
  content: " →";
}

.nav-link:hover {
  border-color: var(--text);
}

.nav-link.is-disabled {
  color: var(--muted);
  opacity: 0.58;
}

.day-page {
  width: min(100% - 32px, 720px);
  margin: 0 auto;
  padding: 36px 0 28px;
}

.day-hero {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--soft-border);
}

.source-kicker,
.old-style,
.annotations,
.warnings,
.page-footer {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.source-kicker {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--text);
  font-family: "PT Serif", Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.18;
}

.old-style {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.red-day h1,
.red-day .annotations {
  color: var(--red-day);
}

.annotations {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  font-size: 15px;
  font-weight: 700;
}

.annotations p,
.warnings p,
.page-footer,
.empty-state p {
  margin: 0;
}

.day-content,
.calendar-summary {
  font-family: "PT Serif", Georgia, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.68;
}

.day-content {
  padding-top: 28px;
}

.day-content p,
.calendar-summary-content p {
  margin: 0 0 1em;
}

.day-content strong,
.calendar-summary-content strong {
  font-weight: 700;
}

.day-content em,
.calendar-summary-content em {
  font-style: italic;
}

.day-content a,
.calendar-summary-content a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.day-content .ln-head {
  margin-bottom: 22px;
}

.day-content .ln-head p {
  margin-bottom: 0.48em;
}

.day-content .ln-notes,
.day-content .notes {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--soft-border);
  color: var(--muted);
  font-size: 17px;
}

.day-content sup {
  font-size: 0.7em;
  line-height: 0;
}

.calendar-summary {
  margin-top: 28px;
  border-top: 1px solid var(--soft-border);
  border-bottom: 1px solid var(--soft-border);
}

.calendar-summary summary {
  min-height: 48px;
  padding: 13px 0;
  color: var(--text);
  cursor: pointer;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 700;
}

.calendar-summary-content {
  padding-bottom: 18px;
  color: var(--muted);
  font-size: 17px;
}

.warnings {
  display: grid;
  gap: 8px;
  margin-top: 24px;
  padding: 14px 16px;
  border-left: 3px solid var(--border);
  background: #fffaf1;
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  margin-top: 28px;
  padding: 22px 0;
  border-top: 1px solid var(--soft-border);
  border-bottom: 1px solid var(--soft-border);
}

.empty-state h2 {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.25;
}

.empty-state p {
  color: var(--muted);
  font-size: 16px;
}

.page-footer {
  margin-top: 30px;
  color: var(--muted);
  font-size: 14px;
}

.page-footer a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 520px) {
  .day-nav,
  .day-page {
    width: min(100% - 24px, 720px);
  }

  .day-nav {
    padding: 12px 0;
  }

  .day-switcher {
    grid-template-columns: 1fr;
  }

  .calendar-link {
    justify-self: stretch;
  }

  .day-page {
    padding-top: 30px;
  }

  h1 {
    font-size: 29px;
  }

  .day-content,
  .calendar-summary {
    font-size: 18px;
    line-height: 1.66;
  }
}

@media print {
  body {
    background: #fff;
  }

  .page-header,
  .calendar-summary,
  .warnings,
  .page-footer {
    display: none;
  }

  .day-page {
    width: 100%;
    padding: 0;
  }

  .day-hero {
    padding-bottom: 14px;
  }

  .day-content {
    padding-top: 18px;
    font-size: 12pt;
    line-height: 1.45;
  }
}
