/* Stephen — phase 1. Deliberately plain: structure and readability only.
   Design pass to follow. All colors live in :root so a restyle is one block. */

:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --ink: #2b2118;
  --muted: #7a6c60;
  --line: #e6dfd5;
  --brand: #3b2a1a;
  --accent: #7a1f1f;
  --accent-ink: #ffffff;
  --ok-bg: #eef6ea;
  --ok-line: #bcd9b0;
  --warn-bg: #fff6df;
  --warn-line: #f0d68a;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--accent); }

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: var(--brand); color: #fff;
}
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: .02em; }
.top nav a { color: #fff; opacity: .75; text-decoration: none; margin-left: 18px; }
.top nav a.on { opacity: 1; border-bottom: 2px solid #fff; padding-bottom: 2px; }

main { max-width: 640px; margin: 0 auto; padding: 16px; }

h1 { font-size: 22px; margin: 4px 0 16px; }
h1.date { font-weight: 600; color: var(--muted); font-size: 18px; }
h2 { font-size: 20px; margin: 0; }

.flash {
  background: var(--ok-bg); border: 1px solid var(--ok-line);
  padding: 10px 14px; border-radius: 10px; margin-bottom: 16px;
}
.warning {
  background: var(--warn-bg); border: 1px solid var(--warn-line);
  padding: 8px 12px; border-radius: 8px; margin: 0 0 12px; font-size: 15px;
}

.hour {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; margin-bottom: 16px;
}
.hour.done { border-color: var(--ok-line); }
.hour-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.streak { font-size: 14px; color: var(--muted); white-space: nowrap; }

.refs { font-size: 16px; line-height: 1.55; margin-bottom: 14px; }
.refs b { display: block; margin-bottom: 6px; }

.actions { display: flex; flex-direction: column; gap: 10px; }
.actions form { margin: 0; }
.btn {
  display: block; width: 100%; text-align: center; text-decoration: none;
  padding: 13px 16px; border-radius: 12px; font-size: 17px; font-weight: 600;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.secondary { color: var(--accent); }
.btn.done-label { background: var(--ok-bg); border-color: var(--ok-line); cursor: default; }

.muted { color: var(--muted); }
.small { font-size: 14px; }

/* Settings */
.settings fieldset { border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 12px 16px; margin: 0 0 14px; }
.settings legend { font-weight: 600; padding: 0 6px; }
.settings .row { display: flex; align-items: center; gap: 10px; }
.settings input[type=time], .settings select { font-size: 17px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.settings input[type=checkbox] { width: 22px; height: 22px; }
.settings .btn { margin-top: 6px; }
.settings .row { padding: 4px 0; }
.settings .row.sub { padding-left: 32px; font-size: 15px; color: var(--muted); }
.settings .row.sub input[type=time] { font-size: 15px; padding: 4px 6px; }
.settings .hour-row { border-top: 1px solid var(--line); padding: 6px 0; }
.settings .hour-row:first-of-type { border-top: 0; }
.settings .hour-name { font-weight: 600; }
.settings input[type=radio] { width: 20px; height: 20px; }

/* Pray Online (embedded iBreviary) */
.pray-body { display: flex; flex-direction: column; height: 100vh; height: 100dvh; margin: 0; }
.pray-bar { flex: 0 0 auto; gap: 10px; }
.pray-bar .back { color: #fff; text-decoration: none; font-size: 17px; white-space: nowrap; }
.pray-title { flex: 1; text-align: center; font-weight: 600; font-size: 16px; }
.pray-bar form { margin: 0; }
.pray-complete {
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px;
  padding: 7px 12px; font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.pray-done { font-size: 15px; opacity: .85; white-space: nowrap; }
.pray-frame { flex: 1 1 auto; width: 100%; border: 0; background: #fff; }
.pray-fallback { flex: 0 0 auto; margin: 0; padding: 6px 12px calc(6px + env(safe-area-inset-bottom)); text-align: center; color: var(--muted); }

/* Readings */
.date-nav { display: flex; gap: 8px; margin-bottom: 10px; }
.date-nav .btn { flex: 1; padding: 9px 6px; font-size: 15px; font-weight: 600; }
.date-pick { margin: 0 0 16px; font-size: 15px; color: var(--muted); }
.date-pick input[type=date] { font-size: 15px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin-left: 6px; }
.readings { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px 16px; margin-bottom: 14px; }
.readings > .muted { margin: 10px 0 4px; }
.reading { border-top: 1px solid var(--line); }
.reading:first-of-type { border-top: 0; }
.reading summary {
  list-style: none; cursor: pointer; padding: 14px 28px 14px 0; position: relative;
  font-weight: 600; font-size: 17px; color: var(--accent);
}
.reading summary::-webkit-details-marker { display: none; }
.reading summary::after {
  content: "›"; position: absolute; right: 4px; top: 12px; font-size: 22px; color: var(--muted);
  transition: transform .15s;
}
.reading[open] summary::after { transform: rotate(90deg); }
.reading-body { padding: 0 0 14px; }
.reading-body p { margin: 0 0 10px; line-height: 1.6; }
.readings b { font-weight: 700; }

/* Install tip */
.install-tip {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  background: var(--brand); color: #fff; padding: 12px 40px 12px 14px; border-radius: 12px;
  font-size: 15px; box-shadow: 0 6px 20px rgba(0,0,0,.2);
}
.install-tip button {
  position: absolute; right: 8px; top: 6px; background: none; border: 0; color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer;
}
