:root {
  --bg: #ffffff;
  --side: #f6f7f9;
  --ink: #14171c;
  --ink-soft: #667085;
  --line: #e4e7ec;
  --hover: #eceef2;
  --accent: #2f5bd8;
  --accent-ink: #ffffff;
  --accent-soft: #e8eefc;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1116;
    --side: #14171d;
    --ink: #e8eaef;
    --ink-soft: #98a1b2;
    --line: #252a33;
    --hover: #1d222b;
    --accent: #8eaeff;
    --accent-ink: #0f1116;
    --accent-soft: #1b2540;
  }
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 0.2em; }
a:hover { text-decoration-color: currentColor; }

button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

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

.eyebrow {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- layout: a menu beside one reading ---------- */

.app { display: grid; grid-template-columns: 1fr; min-height: 100vh; }

.side {
  background: var(--side);
  border-bottom: 1px solid var(--line);
  padding: 20px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-date h1 {
  margin: 2px 0 0;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.leap-line { margin: 6px 0 0; font-size: 0.82rem; color: var(--ink-soft); }

/* ---------- the reading menu ---------- */

.reading-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.menu-item {
  display: flex;
  align-items: center;
  border-radius: var(--radius);
  border: 1px solid transparent;
}

.menu-item:hover { background: var(--hover); }
.menu-item.current { background: var(--bg); border-color: var(--line); box-shadow: 0 1px 2px rgb(0 0 0 / 0.05); }

.menu-select {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 9px 4px 9px 12px;
  background: none;
  border: 0;
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
}

.menu-kind { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); }
.menu-ref { font-size: 0.95rem; font-weight: 550; overflow-wrap: anywhere; }
.menu-item.current .menu-ref { color: var(--accent); }
.menu-item.done:not(.current) .menu-ref { color: var(--ink-soft); }

.menu-check { display: flex; padding: 10px 12px 10px 6px; cursor: pointer; }

.menu-check input {
  appearance: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1.5px solid var(--ink-soft);
  border-radius: 50%;
  display: grid;
  place-content: center;
  cursor: pointer;
}

.menu-check input::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--accent-ink);
  border-bottom: 2px solid var(--accent-ink);
  transform: translateY(-1px) rotate(-45deg) scale(0);
}

.menu-check input:checked { background: var(--accent); border-color: var(--accent); }
.menu-check input:checked::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
.menu-check input:disabled { opacity: 0.4; cursor: default; }

/* ---------- the day menu ---------- */

.day-menu { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.icon-button, .text-button, .date-pick input {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
}

.icon-button { width: 34px; font-size: 1.15rem; line-height: 1; padding: 0 0 2px; }
.text-button { padding: 0 12px; font-size: 0.85rem; font-weight: 550; }
.icon-button:hover, .text-button:hover, .date-pick input:hover { background: var(--hover); }

.date-pick { flex: 1; min-width: 130px; display: flex; }
.date-pick input { width: 100%; padding: 0 8px; font-size: 0.85rem; }

/* ---------- the reading ---------- */

.main { min-width: 0; }

.page { max-width: 42rem; margin: 0 auto; padding: 28px 20px 40px; }

.page-head { margin-bottom: 22px; }

.page-head h1,
.page-head h2 {
  margin: 4px 0 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.net-tag { font-size: 0.8rem; font-weight: 500; letter-spacing: 0; color: var(--ink-soft); white-space: nowrap; }

.page-body { font-size: 1.14rem; line-height: 1.75; overflow-wrap: break-word; }
.page-body p { margin: 0; }

.prose { margin-top: 0.9em !important; }
.prose.first, .prose.continues { margin-top: 0 !important; }
.line + .prose.continues { margin-top: 0.9em !important; }

/* Poetry: a wrapped line hangs, so it still reads as one line. */
.line { padding-left: 2.6em; text-indent: -1.3em; }
.prose + .line, .stanza { margin-top: 0.7em !important; }

.superscription { color: var(--ink-soft); font-style: italic; margin-bottom: 0.7em !important; }

.acrostic {
  margin: 1.4em 0 0.3em !important;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.chapter-head {
  margin: 2.2em 0 0.7em;
  padding-top: 1.4em;
  border-top: 1px solid var(--line);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.chapter-head:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.v {
  font-size: 0.62em;
  font-weight: 650;
  color: var(--accent);
  vertical-align: 0.55em;
  line-height: 0;
  margin-right: 0.35em;
  user-select: none;
}

/* The NET sets Old Testament quotations in bold. */
.page-body b { font-weight: 600; }

.status { color: var(--ink-soft); }
.status button {
  margin-left: 10px;
  height: 30px;
  padding: 0 12px;
  font-size: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
}

/* ---------- about page ---------- */

.side-links { margin: 0; padding: 0 8px; font-size: 0.85rem; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 6px 16px; }

.about { font-size: 1.06rem; line-height: 1.7; }
.back { margin: 0 0 28px; font-size: 0.9rem; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 6px 20px; }
.back a { text-decoration: none; }
.back a:hover { color: var(--ink); }
.page-head .lede { margin: 14px 0 0; font-size: 1.2rem; line-height: 1.6; color: var(--ink-soft); }
.about section { margin-top: 40px; }
.about h2 { margin: 0 0 10px; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.015em; }
.about section p { margin: 0 0 14px; }
.about ul, .about ol { margin: 0 0 14px; padding-left: 1.3em; }
.about li { margin-bottom: 8px; }
.about li::marker { color: var(--ink-soft); }
.about cite { font-style: italic; }
.about .terms { margin: 0 0 14px; display: grid; gap: 10px; }
.about .terms > div { padding: 14px 16px; background: var(--side); border: 1px solid var(--line); border-radius: var(--radius); }
.about .terms dt { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); }
.about .terms dd { margin: 4px 0 0; }
.about .colophon { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); }

/* ---------- the full plan ---------- */

.page.overview { max-width: 64rem; }

.month-nav {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 -8px;
  padding: 10px 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.month-nav a {
  padding: 5px 11px;
  font-size: 0.85rem;
  font-weight: 550;
  text-decoration: none;
  color: var(--ink-soft);
  border-radius: 8px;
}

.month-nav a:hover { background: var(--hover); color: var(--ink); }

.overview-key { margin: 16px 0 0; font-size: 0.82rem; color: var(--ink-soft); }
.key-dot, .day-reading.read::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 0.08em;
}

.month { margin-top: 36px; scroll-margin-top: 60px; }
.month h2 { margin: 0 0 8px; font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; }

.day-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 16px;
  padding: 10px 10px;
  border-top: 1px solid var(--line);
  border-radius: 0;
  text-decoration: none;
  font-size: 0.95rem;
  scroll-margin-top: 60px;
}

a.day-row:hover { background: var(--hover); }
.day-row.today { background: var(--accent-soft); border-radius: var(--radius); border-top-color: transparent; }
.day-row.today + .day-row { border-top-color: transparent; }

.day-date { grid-column: 1 / -1; font-weight: 650; }
.day-month { color: var(--ink-soft); font-weight: 500; }
.today-tag {
  margin-left: 10px;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.day-reading { min-width: 0; overflow-wrap: anywhere; }
.day-reading.read { color: var(--ink-soft); }
.cell-kind { display: none; }
.day-head { display: none; }

@media (min-width: 760px) {
  .day-row { grid-template-columns: 5.5rem repeat(4, minmax(0, 1fr)); padding: 8px 10px; }
  .day-date { grid-column: auto; }
  .day-month { display: none; }
  .day-row.today .day-month { display: none; }
  .day-head {
    display: grid;
    border-top: 0;
    padding-bottom: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-soft);
  }
  .day-head .day-date { font-weight: 600; }
}

/* ---------- actions and credit ---------- */

.page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.button {
  height: 42px;
  padding: 0 18px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
}

.button:hover { background: var(--hover); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button.primary:hover { filter: brightness(1.08); }
.button.is-read { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.button:disabled { opacity: 0.45; cursor: default; }

.colophon { margin-top: 28px; font-size: 0.78rem; color: var(--ink-soft); display: grid; gap: 6px; }
.colophon p { margin: 0; }

.page-status { padding: 40px 20px; color: var(--ink-soft); }

/* ---------- wide: the menu becomes a sidebar that stays put ---------- */

@media (min-width: 900px) {
  .app { grid-template-columns: 300px minmax(0, 1fr); }

  .side {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-bottom: 0;
    border-right: 1px solid var(--line);
    padding: 32px 18px 24px;
    gap: 24px;
  }

  .side-date { padding: 0 8px; }
  .reading-menu { grid-template-columns: 1fr; gap: 4px; }
  .day-menu { margin-top: auto; padding: 0 2px; }
  .side-links { order: 5; }
  .page { padding: 56px 40px 72px; }
}

@media print {
  .side, .page-actions, #storage-line { display: none; }
  .app { display: block; }
}
