:root {
  --ink: #1b1f27;
  --muted: #5b6270;
  --line: #d6dae2;
  --bg: #f4f5f8;
  --panel: #fff;
  --accent: #1f4fd8;
  --accent-ink: #fff;
  --red: #b3261e;
  --amber: #b26a00;
  --green: #1e7a3c;
  --navy: #0f1a2c;
  --gold: #d4a34b;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 18px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
.top { background: var(--navy); color: #fff; padding: 20px 24px; }
.top h1 { margin: 0 0 4px; font-size: 28px; }
.top p { margin: 0; color: #c9cdd6; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.panel h2 { margin: 0 0 12px; font-size: 22px; }
.muted { color: var(--muted); font-size: 16px; }
.lbl { display: block; margin: 14px 0 6px; font-weight: 600; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { position: relative; display: block; }
.tile input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.tile span { display: block; text-align: center; padding: 22px 12px; font-size: 24px; font-weight: 700; border: 3px solid var(--line); border-radius: 12px; background: #fff; }
.tile input:checked + span { border-color: var(--accent); background: #eef2ff; color: var(--accent); }
.tile input:focus-visible + span { outline: 3px solid #8aa4f0; outline-offset: 2px; }

.dropzone { display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; padding: 28px 16px; border: 3px dashed var(--line); border-radius: 12px; cursor: pointer; background: #fafbfd; }
.dropzone.over { border-color: var(--accent); background: #eef2ff; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone:focus-within { outline: 3px solid #8aa4f0; }
textarea { width: 100%; font: 17px/1.4 ui-monospace, Menlo, Consolas, monospace; padding: 12px; border: 2px solid var(--line); border-radius: 10px; resize: vertical; }

button { font: inherit; cursor: pointer; }
button.big { display: block; width: 100%; margin-top: 16px; padding: 18px; font-size: 22px; font-weight: 700; border-radius: 12px; border: 0; }
button.primary { background: var(--accent); color: var(--accent-ink); }
button.primary:disabled { opacity: .55; cursor: progress; }
button.primary.amber { background: var(--amber); }
button.small { padding: 6px 10px; font-size: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
button.small:hover { background: #eef2ff; }
button.link { background: none; border: 0; color: var(--accent); text-decoration: underline; padding: 0; font-size: inherit; }
#status { margin-top: 10px; min-height: 1.4em; }
#status.error { color: var(--red); font-weight: 600; }

.banner { padding: 12px 14px; border-radius: 10px; margin-bottom: 12px; background: #fff4d6; border: 1px solid #e8c766; }
.banner.error { background: #fde7e5; border-color: #e5a5a0; }
.controls { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.controls label { font-weight: 600; display: flex; align-items: center; gap: 8px; }
select, input[type=text] { font: inherit; padding: 8px 10px; border: 2px solid var(--line); border-radius: 8px; background: #fff; }
.summary { position: sticky; top: 0; z-index: 5; padding: 10px 12px; margin-bottom: 12px; border-radius: 10px; background: #eef7f0; border: 1px solid #b5d9be; font-weight: 600; }
.summary.warn { background: #fff4d6; border-color: #e8c766; }
.summary.bad { background: #fde7e5; border-color: #e5a5a0; }

.song-head { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 20px 0 10px; padding-bottom: 8px; border-bottom: 2px solid var(--line); }
.song-head input { flex: 1 1 200px; min-width: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.card { position: relative; border: 2px solid var(--line); border-radius: 10px; background: #fff; padding: 8px; }
.card.has-red { border-color: var(--red); }
.card.has-yellow { border-color: #e0a100; }
.slide { position: relative; width: 100%; aspect-ratio: 16 / 9; container-type: inline-size; overflow: hidden; display: flex; align-items: center; justify-content: center; text-align: center; border: 1px solid #c5c9d3; }
.slide.light { background: #fff; color: #000; }
.slide.dark { background: #111; color: #fff; }
.slide .lines { width: 91.2%; font-size: 8.333cqw; line-height: 1.2; }
.slide .lines div + div { margin-top: .2em; }
.slide .lines[contenteditable="true"], .slide .lines.editing { outline: 2px solid var(--accent); white-space: pre-wrap; }
.chip { position: absolute; top: 4px; left: 4px; background: rgba(60,66,80,.85); color: #fff; font: 600 12px/1 system-ui; padding: 4px 6px; border-radius: 5px; z-index: 2; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.badge { font-size: 13px; padding: 3px 8px; border-radius: 99px; border: 0; color: #fff; text-align: left; }
.badge.red { background: var(--red); }
.badge.yellow { background: var(--amber); }
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.card textarea { font-size: 15px; }
.card select { font-size: 14px; padding: 4px; }

/* sermon preview cards */
.slide.sermon { background: var(--navy); color: #fff; font-family: Calibri, Carlito, Arial, sans-serif; flex-direction: column; justify-content: center; padding: 4cqw; }
.slide.sermon .gold { color: var(--gold); font-family: Cambria, Georgia, serif; }
.slide.sermon .dot { width: 2.7cqw; height: 2.7cqw; border-radius: 50%; background: var(--gold); margin: 0 auto 2cqw; }
.slide.sermon .t-title { font-size: 5.63cqw; letter-spacing: .12em; text-transform: uppercase; }
.slide.sermon .t-sub { font-size: 2.92cqw; margin-top: 2cqw; }
.slide.sermon .t-section { font-size: 5cqw; font-weight: 700; }
.slide.sermon .t-point { display: flex; gap: 3cqw; align-items: center; width: 100%; text-align: left; }
.slide.sermon .num { flex: none; width: 9cqw; height: 9cqw; border-radius: 50%; background: var(--gold); color: var(--navy); display: grid; place-items: center; font: 700 3.96cqw Cambria, Georgia, serif; }
.slide.sermon .t-head { font-size: 4.58cqw; font-weight: 700; }
.slide.sermon .t-body { font-size: 3.75cqw; text-align: left; width: 100%; margin-top: 2cqw; }
.slide.sermon .scrip { width: 100%; text-align: left; align-self: stretch; }
.slide.sermon .scrip .t-head { font-size: 3.75cqw; }
.slide.sermon .scrip .ref { font-style: italic; font-size: 2.5cqw; color: #c9cdd6; margin-bottom: 1.6cqw; }
.slide.sermon .scrip .verse { font-style: italic; font-size: 4.58cqw; line-height: 1.25; }
.slide.sermon .scrip .verse b { color: var(--gold); }
.slide.sermon .missing { color: var(--gold); font-style: italic; }
.slide.sermon .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 3cqw; width: 100%; text-align: left; font-size: 3.33cqw; }
.slide.sermon .cols h4 { margin: 0 0 1cqw; color: var(--gold); font-family: Cambria, Georgia, serif; font-size: 3.54cqw; }
.slide.sermon .cols ul { margin: 0; padding-left: 4cqw; }
.slide.sermon .cols li::marker, .slide.sermon .t-body .b { color: var(--gold); }
.slide.sermon .t-quote { font: italic 4.58cqw Cambria, Georgia, serif; }
.slide.sermon .t-text { font-size: 3.75cqw; text-align: left; width: 100%; }
.slide.sermon.attribution { font-size: 2.2cqw; color: #c9cdd6; }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #222; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 20; }
@media (max-width: 600px) { .tiles { grid-template-columns: 1fr; } .grid { grid-template-columns: 1fr; } }

input.guessed { background: #fff3a8; border-color: #d4a000; }
.hint { font-size: 14px; font-weight: 600; color: #7a5a00; }
.slide.sermon .t-label { font-size: 2.5cqw; margin-bottom: 2cqw; }
.card .slide + .slide { margin-top: 6px; }
.slide.sermon .scrip .verse .attr { font-size: 2.5cqw; color: #c9cdd6; }
