/* ---------- tokens ---------- */
:root {
  --paper: #EFEFEA; --surface: #F8F8F4; --ink: #26201C; --muted: #6B665E;
  --line: #DBDAD3; --claret: #8C2F2A; --claret-soft: #EBD9D2; --brass: #A97C36;
  --on-claret: #F8F8F4;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", system-ui, -apple-system, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #181310; --surface: #221B16; --ink: #EFE6D8; --muted: #A99B8B;
    --line: #342B24; --claret: #D6675B; --claret-soft: #3A241F; --brass: #D3A24E;
    --on-claret: #181310;
  }
}
:root[data-theme="dark"] {
  --paper: #181310; --surface: #221B16; --ink: #EFE6D8; --muted: #A99B8B;
  --line: #342B24; --claret: #D6675B; --claret-soft: #3A241F; --brass: #D3A24E;
  --on-claret: #181310;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0 auto; padding: 14px 22px 40px; max-width: 34rem; overflow-x: hidden;
  background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--claret); }
h1, h2, h3, h4 { font-family: var(--serif); font-optical-sizing: auto; text-wrap: balance; letter-spacing: -.015em; }
:focus-visible { outline: 2px solid var(--claret); outline-offset: 2px; border-radius: 4px; }
.hide { display: none !important; }
.tabular { font-variant-numeric: tabular-nums; }

/* recurring editorial furniture */
.dateline { font-family: var(--sans); font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.ref { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--brass); font-size: .96rem; }
.kicker { font-size: .66rem; letter-spacing: .24em; text-transform: uppercase; color: var(--brass); font-weight: 700; }
.brassline { height: 2px; background: var(--brass); opacity: .5; margin: 16px 0 14px; border: 0; }

/* ---------- shared controls ---------- */
button, .btn {
  font-family: var(--sans); font-size: .92rem; font-weight: 600; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 12px 18px; min-height: 44px; cursor: pointer;
}
button:hover, .btn:hover { border-color: var(--brass); }
button:disabled { opacity: .45; cursor: default; }
.btn-claret, .recbtn {
  background: var(--claret); color: var(--on-claret); border: 0; border-radius: 999px; font-weight: 700;
  font-family: var(--sans); font-size: .92rem; min-height: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px 22px; text-decoration: none; letter-spacing: .02em;
}
.btn-claret .rd, .recbtn .rd { width: 9px; height: 9px; border-radius: 50%; background: var(--on-claret); }
.quiet { background: none; border: 0; color: var(--muted); font-weight: 600; font-size: .84rem; text-decoration: underline; padding: 12px 8px; }
.quiet:hover { color: var(--claret); border: 0; }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 44px; }
.toggle {
  flex: none; font-size: .82rem; font-weight: 600; padding: 9px 14px; min-height: 40px;
  display: inline-flex; gap: 7px; align-items: center;
}
.backlink { font-size: .8rem; color: var(--muted); text-decoration: none; font-weight: 600; }
.backlink:hover { color: var(--claret); }

/* ---------- record screen ---------- */
.rec-wrap { text-align: center; display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: min(78vh, 620px); }
.invite {
  font-family: var(--serif); font-weight: 400; font-size: clamp(1.5rem, 6vw, 2rem); line-height: 1.18;
  margin: 14px auto 0; max-width: 15ch;
}
.invite em { font-style: italic; color: var(--claret); }
.now { display: inline-flex; align-items: center; gap: 8px; color: var(--claret);
  font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; font-weight: 700; margin-top: 10px; }
.now .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--claret); animation: pulse 1.6s ease-in-out infinite; }
#timer {
  font-family: var(--serif); font-weight: 500; font-size: clamp(3.4rem, 17vw, 4.6rem); line-height: 1;
  letter-spacing: -.02em; margin: 16px 0 2px; font-variant-numeric: tabular-nums;
}
#wave { width: 100%; max-width: 340px; height: 60px; display: block; margin: 20px auto 6px; }
#wave rect { fill: var(--brass); }
#wave rect.hot { fill: var(--claret); }
#big {
  width: 116px; height: 116px; border-radius: 50%; background: var(--claret); border: 0;
  box-shadow: 0 0 0 6px var(--claret-soft); margin: 26px auto 16px; padding: 0;
  display: grid; place-items: center; color: var(--on-claret);
  font-family: var(--sans); font-size: .82rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
}
#big:hover { border: 0; }
#big .glyph { width: 26px; height: 26px; border-radius: 50%; background: var(--on-claret); display: block; margin: 0 auto 7px; }
#big.stopping .glyph { border-radius: 6px; }
#hint { font-size: .78rem; color: var(--muted); max-width: 24ch; margin: 0 auto; line-height: 1.45; }
#status { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: .96rem; min-height: 1.5em; margin: 18px auto 0; max-width: 30ch; }
#status a { font-style: normal; font-family: var(--sans); font-weight: 600; }
#fileRow { margin-top: 44px; }
.banner {
  text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--claret);
  border-left-width: 3px; border-radius: 12px; padding: 15px 16px; margin: 16px 0 4px;
}
.banner .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
#recoveryText { font-family: var(--serif); font-size: .96rem; line-height: 1.45; }
.saved { margin-top: 22px; }
.saved-title { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; line-height: 1.25; }
.saved-line { margin: 6px 0 0; font-size: .95rem; line-height: 1.45; }
.saved .row .quiet { padding-left: 4px; padding-right: 4px; }
.saved-note { margin: 8px 0 0; color: var(--claret); font-size: .86rem; }
.saved-note:empty { display: none; }

/* ---------- library ---------- */
.masthead .name { font-family: var(--serif); font-weight: 600; font-size: clamp(1.9rem, 8vw, 2.4rem); line-height: 1.05; margin: 8px 0 3px; }
.masthead .place { color: var(--muted); font-size: .84rem; }
.lead { display: block; text-decoration: none; color: inherit; padding-bottom: 4px; flex: 1; }
.lead .lt { font-family: var(--serif); font-weight: 600; font-size: clamp(1.45rem, 6.5vw, 1.7rem); line-height: 1.12; margin: 6px 0 5px; letter-spacing: -.01em; }
.lead .dur { font-size: .78rem; color: var(--muted); font-weight: 600; margin-top: 9px; display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.lead .tri { color: var(--claret); font-size: .7rem; }
.entries { margin-top: 14px; display: flex; flex-direction: column; }
.entry { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 14px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.entry h4 { font-weight: 500; font-size: 1.08rem; margin: 0 0 2px; line-height: 1.18; letter-spacing: 0; }
.entry .er { font-size: .78rem; color: var(--muted); font-style: italic; font-family: var(--serif); }
.entry .em { font-size: .68rem; letter-spacing: .08em; color: var(--muted); font-weight: 700; white-space: nowrap; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.entry:hover h4 { color: var(--claret); }
.empty { font-family: var(--serif); font-style: italic; color: var(--muted); padding: 26px 0; }
.libfoot { margin-top: 30px; display: flex; justify-content: center; }

/* ---------- player ---------- */
.pt { font-family: var(--serif); font-weight: 600; font-size: clamp(1.6rem, 7vw, 2rem); line-height: 1.1; margin: 14px 0 6px; }
.player { margin: 26px 0 20px; }
.track { position: relative; height: 40px; cursor: pointer; }
.track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
  height: 4px; background: var(--line); border-radius: 3px; }
.track .fill { position: absolute; left: 0; top: 50%; transform: translateY(-50%); height: 4px; width: 0%;
  background: var(--claret); border-radius: 3px; }
.track .head { position: absolute; left: 0%; top: 50%; width: 14px; height: 14px; border-radius: 50%;
  background: var(--brass); transform: translate(-50%, -50%); box-shadow: 0 0 0 4px var(--paper); }
.times { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); font-weight: 600;
  font-variant-numeric: tabular-nums; margin-top: 2px; }
.transport { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 18px 0 20px; }
.skip { font-size: .72rem; font-weight: 700; color: var(--muted); background: none; border: 0; padding: 12px; min-width: 56px; }
.skip:hover { color: var(--claret); border: 0; }
#playBtn { width: 64px; height: 64px; border-radius: 50%; background: var(--claret); border: 0; display: grid; place-items: center; padding: 0; }
#playBtn:hover { border: 0; }
#playBtn .tri { width: 0; height: 0; border-left: 18px solid var(--on-claret); border-top: 11px solid transparent; border-bottom: 11px solid transparent; margin-left: 4px; }
#playBtn.playing .tri { width: 18px; height: 20px; border: 0; margin: 0; background:
  linear-gradient(to right, var(--on-claret) 0 6px, transparent 6px 12px, var(--on-claret) 12px 18px); }
.speeds { display: flex; justify-content: center; gap: 8px; margin-bottom: 22px; }
.speeds button { font-size: .74rem; font-weight: 600; color: var(--muted); padding: 7px 13px; min-height: 38px; background: none; }
.speeds button.on { color: var(--claret); border-color: var(--claret); }
.notes { font-family: var(--serif); font-size: 1rem; line-height: 1.55; color: var(--ink);
  border-top: 1px solid var(--line); padding-top: 16px; margin: 0; white-space: pre-wrap; }
.playfoot { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
#editor { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-top: 18px; }
label { display: block; margin: 12px 0 5px; font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
label:first-child { margin-top: 0; }
input, textarea {
  font-family: var(--sans); font-size: 1rem; width: 100%; padding: 11px 12px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
}
#saved { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: .9rem; }

/* ---------- delete (two-step, in page) ---------- */
.rowdel { background: none; border: 0; color: var(--muted); font-size: 1.05rem; line-height: 1;
  padding: 8px 4px; min-height: 40px; min-width: 40px; }
.rowdel:hover { color: var(--claret); border: 0; }
.confirm { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: .84rem; color: var(--muted); padding: 6px 0 12px; }
.confirm span { flex: 1 1 100%; }
.confirm button { font-size: .78rem; padding: 8px 14px; min-height: 38px; background: none; }
.confirm .yes { color: var(--claret); border-color: var(--claret); font-weight: 700; }
.danger-zone { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 12px; }
.lead-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.entry-main { flex: 1; display: block; text-decoration: none; color: inherit; }
.entry .rowdel { align-self: center; flex: none; }
.lead-top .rowdel { align-self: flex-start; flex: none; margin-top: -4px; }

/* ---------- pipeline status ---------- */
.converting { font-family: var(--serif); font-style: italic; font-size: .9rem; line-height: 1.4; color: var(--brass);
  margin-top: 6px; }
.converting:empty { display: none; }

/* ---------- share switch (admin only) ---------- */
.entry-wrap { display: flex; flex-direction: column; align-items: flex-end; }
.entry-wrap > .entry, .entry-wrap > .lead-top, .entry-wrap > .confirm { width: 100%; }
.switch { display: flex; align-items: center; gap: 9px; background: none; border: 0;
  padding: 2px 0 12px; min-height: 44px; font-size: .72rem; letter-spacing: .04em;
  font-weight: 700; color: var(--muted); text-transform: uppercase; }
.switch:hover { border: 0; }
.switch .knob { flex: none; width: 46px; height: 27px; border-radius: 999px; background: var(--line);
  position: relative; transition: background .15s; }
.switch .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px;
  border-radius: 50%; background: var(--paper); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
.switch.on .knob { background: var(--claret); }
.switch.on .knob::after { left: 22px; }
.switch.on .lbl { color: var(--claret); }

.notplayable { font-family: var(--serif); font-size: .98rem; line-height: 1.5; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--brass);
  border-radius: 12px; padding: 14px 16px; margin: 16px 0; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) {
  .now .dot { animation: none; }
  * { transition: none !important; }
}

/* ---------- account notice + settings ---------- */
.topbar .row { display: flex; align-items: center; gap: 14px; }
.notice { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: .92rem;
  text-align: center; margin: 12px auto 0; max-width: 32ch; }
.settings-section { background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; margin-top: 18px; }
.settings-section h2 { font-weight: 600; font-size: 1.2rem; margin: 0 0 4px; }
.settings-section .why { color: var(--muted); font-size: .84rem; margin: 0 0 6px; }
.settings-section .playfoot { margin-top: 16px; align-items: center; }
.result { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: .9rem; }
.result.bad { color: var(--claret); }

/* ---------- signup + setup ---------- */
.settings-section h2 + .why { margin-top: 0; }
.settings-section .why + h2, .settings-section input + h2, .settings-section .slugfield + .why + h2 { margin-top: 22px; }
.why.bad, .formerr { color: var(--claret); }
.formerr { font-family: var(--serif); font-style: italic; font-size: .96rem; margin: 14px 0 0; }
/* two plans side by side, each with its two ways to pay: one radio group */
.tiers { border: 0; padding: 0; margin: 16px 0 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tiers legend { padding: 0; margin-bottom: 5px; font-size: .68rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; }
.tier { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.tier.picked { border-color: var(--claret); }
.tier-name { font-size: 1.25rem; font-weight: 600; margin: 6px 0 0; }
.tier-lead { color: var(--muted); font-size: .82rem; margin: 0; line-height: 1.45; }
.pays { display: flex; flex-direction: column; gap: 8px; }
.pay { margin: 0; display: flex; flex-direction: column; gap: 1px; cursor: pointer; text-transform: none;
  letter-spacing: 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; }
.pay input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pay.on { border-color: var(--claret); box-shadow: inset 0 0 0 1px var(--claret); }
.pay:focus-within { outline: 2px solid var(--claret); outline-offset: 2px; }
.pay-price { font-size: .92rem; font-weight: 700; }
.pay-note { font-size: .72rem; color: var(--brass); font-weight: 700; }
.tier-list { list-style: none; padding: 0; margin: 2px 0 0; display: grid; gap: 6px; }
.tier-list li { position: relative; padding-left: 18px; font-size: .82rem; line-height: 1.45; color: var(--ink); }
.tier-list li::before { content: ""; position: absolute; left: 2px; top: .52em; width: 6px; height: 6px;
  border-radius: 50%; background: var(--brass); }
@media (max-width: 460px) { .tiers { grid-template-columns: 1fr; gap: 20px; } }
.slugfield { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.slughost { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.slugfield input { flex: 1 1 10rem; }
.billing-line { font-family: var(--serif); font-size: 1rem; margin: 2px 0 0; }
.settings-section > input[type=hidden]:first-child + h2 { margin-top: 0; }

/* ---------- podcast settings ---------- */
.copyrow { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.copyrow input { flex: 1; min-width: 0; font-size: .86rem; }
.artrow { display: flex; gap: 16px; align-items: flex-start; margin-top: 8px; }
.artrow img { flex: none; width: 120px; height: 120px; border-radius: 10px; border: 1px solid var(--line); object-fit: cover; background: var(--paper); }
.artrow .playfoot { margin-top: 8px; }
.artpick { display: inline-flex; align-items: center; margin: 0; text-transform: none; letter-spacing: 0; color: var(--ink);
  font-size: .92rem; cursor: pointer; }
.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.playfoot:has(#artFile:focus-visible) .artpick { outline: 2px solid var(--claret); outline-offset: 2px; }
@media (max-width: 420px) { .artrow { flex-direction: column; } }

/* ---------- welcome + card link (library) ---------- */
.welcome-title { font-family: var(--serif); font-weight: 600; font-size: 1.25rem; }
#welcome p { margin: 4px 0 0; color: var(--muted); }
.cardlink { text-align: center; margin: 18px 0 0; font-size: .9rem; font-weight: 600; }
.topbar .row a { white-space: nowrap; }
@media (max-width: 420px) { .topbar > .kicker { display: none; } .topbar:has(> .kicker) { justify-content: flex-end; } }

/* ---------- send to your people ---------- */
.sendrow { margin-top: 10px; }
.sendnote { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: .9rem; }
.sendbox { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 10px; }
.sendbox .sendrow { margin-top: 0; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.notes:empty { display: none; }

/* ---------- listens (admin only) ---------- */
.weekline { margin: 6px 0 0; font-family: var(--serif); font-size: .98rem; color: var(--ink); }
.weekline:empty { display: none; }
.trialline { margin: 2px 0 0; font-size: .86rem; color: var(--muted); }
.heard { font-size: .78rem; color: var(--muted); font-weight: 600; margin-top: 4px; }
.months { list-style: none; padding: 0; margin: 6px 0 0; }
.months li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums; }
.months li:first-child { border-top: 0; }
.months .n { font-weight: 700; }

/* ---------- the sermon in writing (Plus, the pastor's screen) ---------- */
.ttext { font-family: var(--serif); font-size: .98rem; line-height: 1.6; white-space: pre-wrap;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px;
  margin-top: 14px; max-height: 26rem; overflow: auto; }
#transcriptBox .playfoot { align-items: center; }
#tDownload { text-decoration: none; }

/* ---------- first-Sunday checklist (library) ---------- */
.checklist { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--brass);
  border-radius: 14px; padding: 14px 16px 6px; margin: 0 0 18px; }
.cl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.checklist h2 { font-size: 1.2rem; font-weight: 600; margin: 0; }
.cl-count { font-size: .78rem; color: var(--muted); font-weight: 700; white-space: nowrap; }
.cl-items { list-style: none; padding: 0; margin: 10px 0 2px; }
.cl-items li { display: flex; align-items: flex-start; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.cl-items li:first-child { border-top: 0; }
.cl-box { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); margin-top: 1px; position: relative; }
.cl-items li.done .cl-box { background: var(--claret); border-color: var(--claret); }
.cl-items li.done .cl-box::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px;
  border: solid var(--on-claret); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.cl-text { flex: 1; font-size: .98rem; line-height: 1.4; }
.cl-items li.done .cl-text { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.cl-text a { font-weight: 600; }
.cl-note { display: block; font-size: .82rem; color: var(--muted); margin-top: 2px; }
.cl-tick { flex: none; font-size: .8rem; padding: 6px 14px; min-height: 36px; }
.checklist .quiet { padding: 10px 0; }
