/* Read the Word Daily: same family look as Bible Verse Image Creator (calm blue watercolor, Quicksand + Cormorant) */
:root {
  --ink: #2c3550; --ink2: #4b5675; --muted: #6f7894; --blue: #5a6b9c; --blue2: #3f4f80; --soft: #e7ebf5;
  --paper: rgba(255, 252, 246, .86); --line: rgba(90, 107, 156, .22); --cream: #f6f1e7; --ok: #3d8a63; --warn: #b5772a;
  --radius: 14px; --tap: 48px; --tabs: 0px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--cream); font: 500 17px/1.5 "Quicksand", system-ui, sans-serif; padding-bottom: var(--tabs); }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: url(../img/bg-phone.jpg) center bottom / cover no-repeat, var(--cream); }
@media (min-aspect-ratio: 4/5) { body::before { background-image: url(../img/bg-wide.jpg); } }
a { color: var(--blue2); }
h1, h2, .brand { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; color: var(--ink); letter-spacing: .01em; }
h1 { font-size: clamp(1.9rem, 6vw, 2.6rem); margin: .3rem 0 .6rem; line-height: 1.1; }
h2 { font-size: 1.45rem; margin: 1.3rem 0 .6rem; }
h3 { font-size: 1.05rem; margin: .2rem 0 .5rem; color: var(--ink2); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* header (same as the creator) */
header.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .45rem max(.8rem, env(safe-area-inset-left)); background: rgba(250, 247, 240, .88);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .45rem; font-size: clamp(1.3rem, 5.2vw, 1.75rem); text-decoration: none; line-height: 1.1; color: var(--ink); }
.brand img { width: 34px; height: 34px; border-radius: 50%; }
nav.links { display: flex; align-items: center; gap: .25rem; flex-shrink: 0; }
nav.links a:not(.donate) { text-decoration: none; padding: .55rem .7rem; border-radius: 10px; font-weight: 700; font-size: .95rem; color: var(--blue2); }
nav.links a:not(.donate):hover, nav.links a[aria-current="page"] { background: rgba(90, 107, 156, .12); }
a.donate {
  display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: .1rem 1.1rem .2rem; margin-left: .3rem;
  background: #14110d; color: #f3ead8; border: 2px solid #efe4cc; border-radius: 999px; box-shadow: 0 0 0 2px #14110d, 0 2px 8px rgba(0, 0, 0, .25);
  font: 700 1.3rem/1 "Dancing Script", cursive; text-decoration: none; white-space: nowrap; transition: transform .15s, box-shadow .15s;
}
a.donate:hover, a.donate:focus-visible { transform: translateY(-1px); box-shadow: 0 0 0 2px #14110d, 0 0 14px rgba(240, 220, 170, .55); }

/* phones: app-style tab bar at the bottom */
nav.tabs { display: none; }
@media (max-width: 760px) {
  :root { --tabs: calc(62px + env(safe-area-inset-bottom)); }
  nav.links a:not(.donate) { display: none; }
  nav.tabs {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: var(--tabs); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(250, 247, 240, .95); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid var(--line);
  }
  nav.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: .74rem; font-weight: 700; }
  nav.tabs a svg { width: 25px; height: 25px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  nav.tabs a[aria-current="page"] { color: var(--blue2); }
  nav.tabs a[aria-current="page"] svg { stroke-width: 2.3; }
}
@media (max-width: 400px) { a.donate { font-size: 1.15rem; padding: .1rem .85rem .2rem; min-height: 40px; } .brand img { width: 30px; height: 30px; } }

main { max-width: 820px; margin: 0 auto; padding: .8rem max(.9rem, env(safe-area-inset-left)) 2rem; }
main.narrow { max-width: 560px; }
.lead { font-size: 1.1rem; color: var(--ink2); margin: .4rem 0 1rem; }
.hint { color: var(--muted); margin: .2rem 0 .6rem; font-size: .93rem; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: 0 4px 18px rgba(60, 70, 110, .08); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); margin-bottom: 1rem; }
.card > :first-child { margin-top: 0; }
.prose p { margin: .4rem 0 .8rem; }
.credits dt { font-weight: 700; margin-top: .8rem; }
.credits dd { margin: .15rem 0 0; color: var(--ink2); }
.center { text-align: center; margin: 1.4rem 0; }
.msg { background: #fff7e6; border: 1px solid #e8cf98; border-radius: 12px; padding: .75rem 1rem; margin: .6rem 0; }
.msg.ok { background: #eef7f1; border-color: #a9d3ba; }
.msg.err { background: #fdeeee; border-color: #e5b1b1; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 1.2rem 1rem 2rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; }

/* buttons, chips, inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: var(--tap); padding: .5rem 1.15rem;
  border: 1.5px solid var(--blue); border-radius: 999px; background: rgba(255, 255, 255, .7); color: var(--blue2);
  font: 700 1rem "Quicksand", sans-serif; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: #fff; }
.btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); box-shadow: 0 4px 14px rgba(63, 79, 128, .3); }
.btn.primary:hover { background: var(--blue2); }
.btn.ghost { border-color: var(--line); background: rgba(255, 255, 255, .55); font-size: .95rem; }
.btn.small { min-height: 40px; padding: .3rem .9rem; font-size: .92rem; }
.btn.danger { border-color: #c98a8a; color: #9b3d3d; }
.btn.big { width: 100%; font-size: 1.12rem; min-height: 56px; }
.btn:disabled { opacity: .5; cursor: default; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
  min-height: var(--tap); padding: .35rem 1rem; border-radius: 999px; border: 1.5px solid var(--line); text-align: center;
  background: rgba(255, 255, 255, .72); color: var(--ink); font: 700 1rem "Quicksand", sans-serif; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.chip small { display: block; font-weight: 500; font-size: .75rem; color: var(--muted); line-height: 1.2; }
.chip[aria-pressed="true"] { background: var(--blue); color: #fff; border-color: var(--blue); }
.chip[aria-pressed="true"] small { color: #e6eaf6; }
.chips.trans .chip { flex: 1 1 140px; border-radius: 14px; padding: .5rem .8rem; }
label.field { display: block; font-weight: 700; color: var(--ink2); margin: .7rem 0 .3rem; font-size: .95rem; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=time], select {
  width: 100%; min-height: var(--tap); padding: .45rem .8rem; border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  font: 600 1.05rem "Quicksand", sans-serif; color: var(--ink);
}
input:focus, select:focus { outline: 2px solid rgba(90, 107, 156, .45); outline-offset: 1px; border-color: var(--blue); }
input.code { font: 700 1.9rem/1 ui-monospace, monospace; letter-spacing: .45em; text-align: center; padding-left: .45em; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .7rem; }
.check { display: flex; align-items: center; gap: .6rem; min-height: var(--tap); cursor: pointer; font-weight: 700; color: var(--ink2); }
.check input { width: 24px; height: 24px; accent-color: var(--blue); flex-shrink: 0; }
.radio-cards { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .5rem; }
.radio-cards span { min-width: 0; overflow-wrap: anywhere; }
.radio-cards label { display: flex; gap: .55rem; align-items: flex-start; padding: .7rem .8rem; border: 1.5px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.7); cursor: pointer; }
.radio-cards label:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(90, 107, 156, .18); }
.radio-cards input { width: 20px; height: 20px; accent-color: var(--blue); margin-top: .15rem; }
.radio-cards b { display: block; }
.radio-cards small { color: var(--muted); font-size: .82rem; line-height: 1.3; display: block; }

/* home */
.hero { text-align: center; padding: 1.2rem 0 .4rem; }
.hero h1 { font-size: clamp(2.3rem, 9vw, 3.4rem); }
.hero .lead { max-width: 560px; margin: .2rem auto 1.1rem; }
.hero .row { justify-content: center; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; margin-top: 1.2rem; }
.features .card { margin: 0; }
.features h3 { font-family: "Cormorant Garamond", serif; font-size: 1.35rem; color: var(--ink); margin: 0 0 .2rem; }
.features p { margin: 0; color: var(--ink2); font-size: .97rem; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: .5rem; }
.quick a { display: block; padding: .7rem .8rem; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 700; }
.quick a small { display: block; color: var(--muted); font-weight: 500; }
.quick a:hover { border-color: var(--blue); background: #fff; }
.continue { display: flex; align-items: center; gap: .8rem; }
.continue .grow { flex: 1; min-width: 0; }

/* plan builder */
.step { position: relative; }
.step-n { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff; align-items: center; justify-content: center; font-size: .9rem; font-weight: 700; margin-right: .4rem; vertical-align: 2px; font-family: "Quicksand", sans-serif; }
.step h2 { margin: 0 0 .6rem; }
.preset-chips .chip { font-size: .93rem; padding: .3rem .85rem; }
.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .35rem; }
.testament { margin: .9rem 0 .35rem; display: flex; justify-content: space-between; align-items: center; }
.testament h3 { margin: 0; }
.book { display: flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .7); overflow: hidden; }
.book button.tog { flex: 1; text-align: left; min-height: 46px; padding: .35rem .6rem; border: 0; background: none; font: 700 .95rem/1.2 "Quicksand", sans-serif; color: var(--ink); cursor: pointer; }
.book button.tog small { display: block; font-weight: 500; font-size: .74rem; color: var(--muted); }
.book button.rng { border: 0; border-left: 1px solid var(--line); background: none; width: 40px; cursor: pointer; color: var(--blue2); font-size: 1.1rem; }
.book.on { background: var(--blue); border-color: var(--blue); }
.book.on button.tog, .book.on button.rng { color: #fff; }
.book.on button.tog small { color: #e1e6f4; }
.book.part { background: var(--soft); border-color: var(--blue); }
.range-pop { margin: .6rem 0; padding: .8rem; border: 1.5px solid var(--blue); border-radius: 12px; background: #fff; }
.range-pop .two { margin: .3rem 0 .6rem; }
.summary { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-weight: 700; color: var(--ink2); margin-top: .6rem; }
.summary span { white-space: nowrap; }
.days-chips .chip { min-width: 64px; }
.daysbox { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .7rem; margin-top: .4rem; }
.finish { margin: .7rem 0 0; color: var(--ink2); font-weight: 600; }
.sticky-save { position: sticky; bottom: calc(var(--tabs) + .5rem); z-index: 5; display: flex; gap: .5rem; padding: .6rem; margin: 0 -.3rem; border-radius: 16px; background: rgba(250, 247, 240, .92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--line); box-shadow: 0 6px 20px rgba(40, 50, 90, .15); }
.sticky-save .btn { flex: 1; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .5rem; margin: .4rem 0 .8rem; }
.stat { background: rgba(255,255,255,.75); border: 1px solid var(--line); border-radius: 12px; padding: .5rem .7rem; }
.stat b { display: block; font-size: 1.3rem; color: var(--blue2); line-height: 1.2; }
.stat span { font-size: .8rem; color: var(--muted); font-weight: 700; }
table.sched { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.sched th { text-align: left; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: .3rem .4rem; border-bottom: 1px solid var(--line); }
table.sched td { padding: .5rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.sched td.d { white-space: nowrap; font-weight: 700; color: var(--blue2); }
table.sched td.dt { white-space: nowrap; color: var(--muted); font-size: .85rem; }
table.sched td.n { text-align: right; color: var(--muted); white-space: nowrap; font-size: .85rem; }
table.sched td.p { font-weight: 600; }
.bar-mini { display: inline-block; height: 6px; border-radius: 3px; background: rgba(90,107,156,.45); vertical-align: middle; margin-left: .3rem; }
.more { text-align: center; margin-top: .6rem; }

/* reading */
.plan-head { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.plan-head h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); margin: 0; }
.plan-head .sub { color: var(--muted); font-weight: 600; font-size: .92rem; }
.progress { height: 14px; border-radius: 7px; background: rgba(90, 107, 156, .15); overflow: hidden; margin: .5rem 0 .3rem; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, #7d8fc4, var(--blue)); border-radius: 7px; transition: width .4s; }
.pstats { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .3rem .8rem; font-size: .92rem; font-weight: 700; color: var(--ink2); }
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .7rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: .88rem; font-weight: 700; }
.badge.warn { background: #fff4e3; border-color: #ebc78d; color: #8a5a17; }
.badge.ok { background: #eaf6ef; border-color: #a9d3ba; color: #2e6b4b; }
.daynav { display: flex; align-items: center; justify-content: space-between; gap: .4rem; margin: .4rem 0 .6rem; }
.daynav .mid { text-align: center; flex: 1; }
.daynav .mid b { display: block; font-size: 1.15rem; color: var(--ink); }
.daynav .mid span { color: var(--muted); font-size: .9rem; font-weight: 600; }
.daynav .btn { min-width: 48px; padding: .3rem .8rem; }
.today-label { font-family: "Cormorant Garamond", serif; font-size: 1.5rem; font-weight: 600; margin: .1rem 0 .2rem; color: var(--blue2); text-align: center; }
.scripture { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.32rem; line-height: 1.6; font-weight: 500; color: #262d45; }
.scripture h2 { font-size: 1.6rem; margin: 1.2rem 0 .3rem; color: var(--ink); }
.scripture h2:first-child { margin-top: 0; }
.scripture .ptitle { font-style: italic; font-weight: 600; color: var(--ink2); font-size: 1.15rem; margin: 0 0 .4rem; }
.scripture p { margin: 0 0 .6rem; }
.scripture sup { font-family: "Quicksand", sans-serif; font-size: .62em; font-weight: 700; color: var(--blue); margin: 0 .18em 0 .1em; }
.scripture .gap { font-family: "Quicksand", sans-serif; font-size: .78rem; color: var(--muted); }
.textsize { display: inline-flex; gap: .3rem; }
.mark { position: sticky; bottom: calc(var(--tabs) + .5rem); z-index: 5; margin-top: 1rem; }
.btn.done { background: var(--ok); border-color: var(--ok); color: #fff; box-shadow: 0 4px 14px rgba(61, 138, 99, .3); }
.grid-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 5px; }
.grid-days a { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border-radius: 9px; text-decoration: none; font-size: .78rem; font-weight: 700; color: var(--ink2); background: rgba(255,255,255,.8); border: 1px solid var(--line); }
.grid-days a.read { background: var(--blue); color: #fff; border-color: var(--blue); }
.grid-days a.missed { background: #fff1dc; border-color: #e7bf7f; color: #8a5a17; }
.grid-days a.today { outline: 3px solid rgba(90, 107, 156, .55); outline-offset: 1px; }
.grid-days a.cur { box-shadow: inset 0 0 0 2px var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .82rem; color: var(--muted); font-weight: 700; margin-top: .6rem; }
.legend i { display: inline-block; width: 13px; height: 13px; border-radius: 4px; vertical-align: -2px; margin-right: .3rem; border: 1px solid var(--line); background: #fff; }
.legend i.read { background: var(--blue); } .legend i.missed { background: #fff1dc; border-color: #e7bf7f; }
.planlist { display: flex; flex-direction: column; gap: .4rem; }
.planlist .item { display: flex; align-items: center; gap: .6rem; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.7); }
.planlist .item .grow { flex: 1; min-width: 0; }
.planlist .item b { display: block; }
.planlist .item small { color: var(--muted); font-weight: 600; }
.planlist .item.on { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(90,107,156,.2); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabs) + 1rem); z-index: 50; background: var(--ink); color: #fff; padding: .6rem 1.1rem; border-radius: 999px; font-weight: 700; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 92vw; text-align: center; }
.spinner { color: var(--muted); font-weight: 700; padding: 1rem 0; text-align: center; }
@media (min-width: 900px) {
  main.wide { max-width: 1120px; }
  .builder { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
  .builder .preview-col { position: sticky; top: 76px; }
  .builder .preview-col .card { max-height: calc(100vh - 180px); overflow: auto; }
  .sticky-save { bottom: .8rem; }
}
.btn.disabled { opacity: .35; pointer-events: none; }
details.card summary { cursor: pointer; min-height: 32px; }
.msg p:last-child { margin-bottom: 0; }
