/**
 * Worship Studio, the pieces added in TINL-1359: the quick panel's door in the top bar, "Plan a service",
 * the ⋯ menus (a service card, the presenter) and the countdown dialog.
 * Loaded after worship.css; same tokens and the same plain "Daylight" rules (docs/design.md).
 * Nothing here touches the wpr-* slide renderer.
 */

/* ---------- Top bar: the one door ---------- */
.wp-top-door { display: flex; align-items: center; min-width: 0; }
.wp-top-door .tbh-door { max-width: 260px; }
/* In the editor the service's name needs the room, and on small screens everything does: the door is its icon. */
body[data-view="editor"] .wp-top-door .tbh-door span, body[data-view="editor"] .wp-top-door .tbh-door kbd { display: none; }
body[data-view="editor"] .wp-top-door .tbh-door { width: 42px; padding: 0; justify-content: center; }
@media (max-width: 900px) {
  .wp-top-door .tbh-door span, .wp-top-door .tbh-door kbd { display: none; }
  .wp-top-door .tbh-door { width: 42px; padding: 0; justify-content: center; }
}
@media (pointer: coarse) { .wp-top-door .tbh-door { min-width: 44px; height: 44px; } }

/* ---------- "AI" tag and menu rows ---------- */
.wp-quick-card b > span { color: inherit; font-size: inherit; }   /* the title's own words (worship.css greys every span in a card) */
.wp-ai-tag { display: inline-block; vertical-align: 2px; margin-inline-start: 4px; padding: 3px 6px; border-radius: 999px; border: 1px solid var(--wp-line-2); color: var(--wp-muted); font: 700 0.6rem/1 Inter, sans-serif; font-style: normal; letter-spacing: 0.06em; }
.wp-menu-list { display: grid; gap: 4px; }
.wp-menu-list button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 6px 12px; border: 0; border-radius: 12px; background: transparent; color: var(--wp-text); font: 550 0.96rem/1.3 Inter, sans-serif; text-align: start; cursor: pointer; transition: background 140ms ease; }
.wp-menu-list button:hover, .wp-menu-list button:focus-visible { background: var(--wp-panel-2); }
.wp-menu-list button > svg { width: 18px; height: 18px; flex: none; color: var(--wp-muted); }
.wp-menu-list button > span:first-of-type { flex: 1; min-width: 0; display: grid; }
.wp-menu-list small { color: var(--wp-muted); font-size: 0.82rem; font-weight: 400; }
.wp-menu-list .danger, .wp-menu-list .danger > svg { color: var(--wp-danger); }
.wp-menu-list .wp-kbd { flex: none; }
.wp-keys { margin: 12px 4px 0; }
/* the service card's ⋯ is always findable (it was a hover-only delete) */
.wp-card-more { opacity: 1; }
.wp-card-more:hover { background: rgba(0, 0, 0, 0.8); }

/* ---------- Plan a service ---------- */
.wp-plan { display: grid; gap: 14px; }
.wp-plan .wp-textarea { min-height: 220px; }
.wp-plan-note { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: var(--wp-muted); font-size: 0.88rem; }
.wp-plan-note svg { width: 15px; height: 15px; flex: none; }
.wp-plan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: min(52vh, 460px); overflow: auto; }
.wp-plan-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 12px; border: 1px solid var(--wp-line); border-radius: 14px; background: var(--wp-panel); cursor: pointer; animation: wp-pop 320ms var(--wp-ease) both; }
.wp-plan-list li:nth-child(2) .wp-plan-row { animation-delay: 40ms; } .wp-plan-list li:nth-child(3) .wp-plan-row { animation-delay: 80ms; }
.wp-plan-list li:nth-child(4) .wp-plan-row { animation-delay: 120ms; } .wp-plan-list li:nth-child(n+5) .wp-plan-row { animation-delay: 160ms; }
.wp-plan-row:hover { border-color: var(--wp-line-2); }
.wp-plan-row input { width: 20px; height: 20px; flex: none; accent-color: var(--brand); }
.wp-plan-row .kind { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--wp-well); border: 1px solid var(--wp-line); }
.wp-plan-row .kind svg { width: 17px; height: 17px; }
.wp-plan-row .tx { flex: 1; min-width: 0; display: grid; }
.wp-plan-row .tx b { font: 650 0.97rem/1.3 Inter, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp-plan-row .tx small { color: var(--wp-muted); font-size: 0.83rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp-plan-row.warn .tx small { color: var(--warning-ink, var(--wp-muted)); }
.wp-plan-row .n { flex: none; color: var(--wp-faint); font-size: 0.8rem; }
.wp-plan-row:has(input:not(:checked)) { opacity: 0.55; }
.wp-plan-err { margin: 0; color: var(--wp-danger); font-size: 0.95rem; }
.wp-plan-wait { display: flex; align-items: center; gap: 6px; color: var(--wp-muted); font-size: 0.92rem; }
.wp-plan-wait span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: wp-plan-dot 1s infinite ease-in-out; }
.wp-plan-wait span:nth-child(2) { animation-delay: 0.15s; } .wp-plan-wait span:nth-child(3) { animation-delay: 0.3s; }
.wp-plan-wait em { font-style: normal; margin-inline-start: 6px; }
@keyframes wp-plan-dot { 0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }

/* ---------- Countdown dialog ---------- */
.wp-count-pick { display: flex; margin: 14px 0; }
.wp-count-pick button { flex: 1; min-height: 44px; }

@media (max-width: 760px) {
  .wp-plan-row .n { display: none; }
  .wp-plan .wp-textarea { min-height: 180px; }
}
@media (prefers-reduced-motion: reduce) { .wp-plan-row, .wp-plan-wait span { animation: none; } }

/* TINL-1435: the presenter's live tools */
.wp-pres-timer { padding: 4px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.1); font-weight: 800; font-variant-numeric: tabular-nums; }
.wp-pres-timer.warn { background: #a16207; color: #fff; }
.wp-pres-timer.over { background: #b91c1c; color: #fff; }
.wp-live-tools section { display: grid; gap: 10px; }
.wp-live-tools .wp-row .wp-input { flex: 1 1 200px; }
.wp-audio-list, .wp-midi-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.wp-audio-list button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 0 10px; border: 1px solid var(--wp-line); border-radius: 10px; background: var(--wp-panel); color: var(--wp-text); font: 500 0.92rem Inter, sans-serif; text-align: start; cursor: pointer; }
.wp-audio-list button[aria-current="true"] { border-color: var(--brand); }
.wp-audio-list svg, .wp-live-tools .wp-seg svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; }
.wp-midi-list li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--wp-line); border-radius: 10px; }
.wp-midi-list li b { flex: 1; }
.wp-grow { flex: 1 1 160px; margin: 0; }
.wp-keys-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; align-items: center; }
.wp-keys-list dt { text-align: end; }
.wp-keys-list dd { margin: 0; color: var(--wp-muted); }
/* TINL-1436: a field across two columns of a three-column row (the Scripture dialog's second Bible) */
.wp-span2 { grid-column: span 2; }
@media (max-width: 760px) { .wp-span2 { grid-column: auto; } }
/* TINL-1440: toasts stand above the phone's tab bar */
.wp-toasts { bottom: calc(16px + var(--tbos-tabbar-h, 0px)); }

/* TINL-1435: the phone remote's QR code in the presenter's dialog (wp-live.js remoteDialog) */
.wp-remote-qr { display: flex; justify-content: center; margin: 12px 0; }
.wp-remote-qr canvas { width: 220px; height: 220px; border-radius: 12px; background: #fff; padding: 8px; }
