/* Styles for: sermon notes, My schedule, worship song lists, children's check-in, serving balance,
   change history, two-step sign-in, password reset and the language switcher. Colours come from the theme. */

.d-none { display: none !important; }
.mb-0 { margin-bottom: 0 !important; }
.pt-16 { padding-top: 16px !important; }
.mx-16 { margin-left: 16px !important; margin-right: 16px !important; }
.full-row, .ws-add .full { grid-column: 1 / -1; }
.stack { display: grid; gap: 14px; align-content: start; min-width: 0; }

/* ---------- language switcher (public pages) ---------- */
.lang-switch { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; font-size: 14px; }
.lang-switch a { color: var(--accent); text-decoration: none; }
.lang-switch strong { color: var(--ink); font-weight: 650; }
.lang-switch span { color: var(--faint); }

/* ---------- sermon notes: phone page ---------- */
.sn-wrap { max-width: 720px; }
.sn-head { padding: 24px 24px 6px; }
.sn-kicker { font-family: var(--font-label); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 0 0 6px; }
.sn-title { font-size: 28px; line-height: 1.15; letter-spacing: -.02em; margin: 0; }
.sn-meta { color: var(--muted); margin: 8px 0 0; font-size: 15px; }
.sn-scripture { display: inline-flex; align-items: center; gap: 6px; margin: 10px 0 0; padding: 6px 12px; border-radius: 99px; background: var(--brand-blush); color: var(--accent); font-weight: 650; font-size: 14.5px; }
.sn-how { margin: 14px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); font-size: 14px; }
.sn-body { padding: 4px 24px 18px; font-size: 17px; line-height: 2.05; }
.sn-h2 { font-size: 20px; line-height: 1.3; margin: 26px 0 6px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.sn-body > .sn-h2:first-child { border-top: 0; padding-top: 0; margin-top: 12px; }
.sn-h3 { font-size: 17px; margin: 18px 0 4px; }
.sn-p { margin: 6px 0; }
.sn-ul, .sn-ol { margin: 4px 0 8px; padding-left: 22px; }
.sn-ul li, .sn-ol li { margin: 2px 0; }
.sn-quote { margin: 12px 0; padding: 10px 16px; border-left: 4px solid var(--accent); background: var(--surface-2); border-radius: 0 12px 12px 0; font-style: italic; line-height: 1.6; color: var(--ink-2); }
.sn-hr { border: 0; border-top: 1px dashed var(--line-3); margin: 22px 0; }
.sn-bw { display: inline-flex; flex-direction: column; align-items: center; vertical-align: baseline; max-width: 100%; }
.sn-body input.sn-blank { display: inline-block; width: var(--w, 10ch) !important; height: auto !important; min-height: 0 !important; box-shadow: none !important; margin: 0 2px; vertical-align: baseline; }
.sn-body input.sn-blank { width: var(--w, 10ch); min-width: 4ch; max-width: 100%; font: inherit; font-weight: 650; color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); border: 0; border-bottom: 2px solid color-mix(in srgb, var(--accent) 55%, var(--line)); border-radius: 6px 6px 0 0; padding: 0 6px; line-height: 1.5; text-align: center; }
.sn-body input.sn-blank:focus { box-shadow: none !important; }
.sn-body input.sn-blank:focus { outline: none; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-bottom-color: var(--accent); }
.sn-ans { font-size: 12.5px; line-height: 1.2; color: var(--green); font-weight: 700; text-align: center; }
.sn-q, .sn-notes { margin: 16px 0; line-height: 1.5; }
.sn-q label, .sn-notes label { display: block; font-weight: 700; margin-bottom: 6px; }
.sn-q textarea, .sn-notes textarea { width: 100%; font: inherit; font-size: 16px; line-height: 1.55; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: repeating-linear-gradient(transparent 0 calc(1.55em - 1px), var(--line-2) calc(1.55em - 1px) 1.55em) var(--surface); background-attachment: local; background-position: 0 10px; resize: vertical; min-height: 60px; }
.sn-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 24px 18px; border-top: 1px solid var(--line-2); }
.sn-saved { flex: 1 1 auto; color: var(--green); font-size: 13.5px; font-weight: 650; }
.sn-actions { margin-top: 18px; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); padding: 18px; }
.sn-actions h2 { display: flex; align-items: center; gap: 8px; font-size: 17px; margin: 0 0 12px; }
.sn-act-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sn-act-grid .btn { justify-content: flex-start; text-align: left; height: auto; padding: 12px 14px; white-space: normal; align-items: flex-start; gap: 10px; }
.sn-act-grid .btn > span { display: flex; flex-direction: column; gap: 2px; font-weight: 650; }
.sn-act-grid .btn small { font-weight: 400; font-size: 12.5px; opacity: .8; }
.sn-fine { margin: 12px 2px 0; font-size: 13px; color: var(--muted); }
@media (max-width: 560px) {
  .sn-head { padding: 20px 18px 4px; }
  .sn-body { padding: 4px 18px 16px; font-size: 16.5px; }
  .sn-foot { padding: 12px 18px 16px; }
  .sn-title { font-size: 24px; }
  .sn-act-grid { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  @page { margin: 14mm; }
  body.sermon-page { background: #fff !important; }
  .no-print, .v-brand, .lang-switch { display: none !important; }
  .sn-wrap { max-width: none; padding: 0; min-height: 0; }
  .sn-card { box-shadow: none !important; border-radius: 0; }
  .sn-card .v-band { display: none; }
  .sn-head, .sn-body { padding-left: 0; padding-right: 0; }
  .sn-body { font-size: 12.5pt; line-height: 1.9; }
  .sn-body input.sn-blank { background: none !important; border-bottom: 1px solid #555; color: #1a3a7a; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sn-q textarea, .sn-notes textarea { border: 1px solid #bbb; background: none; overflow: visible; resize: none; }
  .sn-scripture { background: none; padding: 0; }
  .sn-h2 { break-after: avoid; }
  .sn-q, .sn-notes { break-inside: avoid; }
}

/* ---------- sermon notes: organizer editor ---------- */
.sn-editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.sn-editor textarea.sn-src { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14.5px; line-height: 1.6; min-height: 420px; }
.sn-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.sn-tools .btn { padding: 6px 10px; font-size: 13px; }
.sn-help { font-size: 13.5px; color: var(--ink-2); }
.sn-help code { font-size: 12.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.sn-help dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 10px; margin: 0; }
.sn-help dt { white-space: nowrap; }
.sn-share { display: grid; gap: 8px; }
.sn-share code { display: block; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 12.5px; overflow-wrap: anywhere; color: var(--accent); }
.sn-row-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 13px; }
@media (max-width: 900px) { .sn-editor { grid-template-columns: minmax(0, 1fr); } }

/* ---------- My schedule (volunteer page) ---------- */
.my-list { display: grid; gap: 10px; margin-top: 6px; }
.my-item { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.my-item .cel-date { flex: none; }
.my-item .grow { min-width: 0; flex: 1 1 auto; }
.my-item strong { display: block; }
.my-item small { color: var(--muted); display: block; }
.my-item .btn { flex: none; }
.my-away { display: grid; gap: 8px; }
.my-away-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.my-away-row .grow { flex: 1 1 auto; min-width: 0; }
.my-away-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.my-away-form .full { grid-column: 1 / -1; }
.my-section { padding: 18px 22px; border-top: 1px solid var(--line-2); }
.my-section h2 { display: flex; align-items: center; gap: 8px; font-size: 17px; margin: 0 0 10px; }
@media (max-width: 520px) { .my-item { flex-wrap: wrap; } .my-item .btn { margin-left: auto; } .my-away-form { grid-template-columns: minmax(0, 1fr); } .my-section { padding: 16px; } }

/* away dates on the person page */
.away-list { display: grid; gap: 6px; }
.away-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.away-row .grow { flex: 1 1 auto; min-width: 0; }

/* ---------- worship song lists ---------- */
.ws-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.ws-dates { display: grid; gap: 6px; }
.ws-date { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); color: inherit; text-decoration: none; background: var(--surface); }
.ws-date.on { border-color: var(--accent); background: var(--brand-blush); }
.ws-date small { display: block; color: var(--muted); }
.ws-date .grow { min-width: 0; flex: 1 1 auto; }
.ws-songs { display: grid; gap: 8px; }
.ws-song { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ws-song .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-blush); color: var(--accent); font-weight: 700; font-size: 13px; flex: none; }
.ws-song .grow { min-width: 0; flex: 1 1 auto; }
.ws-song .key { font-weight: 700; font-size: 12.5px; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); }
.ws-add { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; gap: 8px; align-items: end; }
@media (max-width: 900px) { .ws-layout { grid-template-columns: minmax(0, 1fr); } .ws-dates { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
@media (max-width: 560px) { .ws-add { grid-template-columns: minmax(0, 1fr) 80px; } .ws-add .btn { grid-column: 1 / -1; } .ws-song { flex-wrap: wrap; } .ws-song .acts { flex: 1 1 100%; justify-content: flex-end; display: flex; gap: 6px; } }
.lyrics-pre { white-space: pre-wrap; font-family: inherit; line-height: 1.55; margin: 6px 0 0; }

/* ---------- children's check-in ---------- */
.ci-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.ci-bar .field { margin: 0; flex: 1 1 180px; }
.ci-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.ci-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.ci-row.in { border-color: var(--green); background: color-mix(in srgb, var(--green) 6%, var(--surface)); }
.ci-row.out { opacity: .7; }
.ci-row .grow { min-width: 0; flex: 1 1 auto; }
.ci-row strong { display: block; }
.ci-row small { color: var(--muted); display: block; }
.ci-code { font-family: ui-monospace, Menlo, monospace; font-size: 22px; font-weight: 800; letter-spacing: .12em; padding: 4px 10px; border-radius: 10px; background: var(--surface); border: 2px dashed var(--green); color: var(--green); }
.ci-allergy { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--red); background: var(--red-bg); padding: 2px 8px; border-radius: 99px; margin-top: 3px; }
.ci-out-form { display: flex; gap: 6px; align-items: center; }
.ci-out-form input { width: 90px; text-align: center; letter-spacing: .1em; font-weight: 700; }
@media (max-width: 560px) { .ci-row { flex-wrap: wrap; } .ci-row .ci-act { flex: 1 1 100%; display: flex; justify-content: flex-end; gap: 8px; } }

/* ---------- serving balance ---------- */
.bal-table td.num, .bal-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bal-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; min-width: 60px; }
.bal-bar span { display: block; height: 100%; width: var(--w); background: var(--accent); border-radius: 99px; }
.bal-tag { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.bal-tag.heavy { background: var(--amber-bg); color: var(--amber); }
.bal-tag.rest { background: var(--blue-bg); color: var(--blue); }

/* ---------- change history ---------- */
.audit-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 4px 14px; padding: 10px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.audit-row:first-child { border-top: 0; }
.audit-row time { color: var(--muted); font-size: 13px; }
.audit-row .what { overflow-wrap: anywhere; }
.audit-row .who { font-weight: 650; }
@media (max-width: 560px) { .audit-row { grid-template-columns: minmax(0, 1fr); } }

/* ---------- two-step sign-in ---------- */
/* Two-step setup: QR code beside the steps (stacked on phones). White behind the code in every theme so cameras can read it. */
.totp-setup { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: start; }
.totp-qr { padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; line-height: 0; }
.totp-qr svg { display: block; width: 184px; height: 184px; }
.totp-setup > div:last-child { min-width: 0; }
@media (max-width: 640px) { .totp-setup { grid-template-columns: 1fr; gap: 14px; } .totp-qr { justify-self: center; } }
.totp-key { font-family: ui-monospace, Menlo, monospace; font-size: 17px; letter-spacing: .08em; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); overflow-wrap: anywhere; user-select: all; }
.totp-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; font-family: ui-monospace, Menlo, monospace; font-size: 15px; }
.totp-codes span { padding: 6px 10px; border-radius: 8px; background: var(--surface-2); text-align: center; }
.code-input { font-size: 22px !important; letter-spacing: .3em; text-align: center; font-family: ui-monospace, Menlo, monospace; }

/* ---- phones: compact balance cards, swipeable worship date strip ---- */
@media (max-width: 640px) {
  .table.bal-table tr { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 8px; row-gap: 4px; padding: 10px 12px; }
  .table.bal-table td { width: auto !important; font-size: 15px; }
  .table.bal-table td:first-child { grid-column: 1 / 4; }
  .table.bal-table td:nth-child(2) { grid-column: 4; text-align: right !important; }
  .table.bal-table td:nth-child(3) { grid-column: 1 / -1; }
  .table.bal-table td[data-label]:not([data-label=""])::before { font-size: 10px; letter-spacing: .04em; }
  .table.bal-table td:first-child::before { display: none !important; }
}
@media (max-width: 900px) {
  .ws-dates { grid-template-columns: none !important; grid-auto-flow: column; grid-auto-columns: minmax(196px, 60%); overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  .ws-date { scroll-snap-align: start; }
}

/* Telugu / Hindi: letter-spacing breaks joined letters in these scripts */
html:lang(te) body *, html:lang(hi) body * { letter-spacing: normal !important; }
.ci-row { min-width: 0; }
.bal-tag { white-space: nowrap; display: inline-block; }
@media (max-width: 640px) {
  .table.bal-table tr { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .table.bal-table td:first-child { grid-column: 1 / 3 !important; }
  .table.bal-table td:nth-child(2) { grid-column: 3 !important; }
  .table.bal-table td:nth-child(6) { grid-column: 1 / -1; order: 9; display: flex !important; gap: 6px; align-items: baseline; }
  .table.bal-table td:nth-child(6)::before { display: inline !important; }
  .table.bal-table td { order: 1; }
  .table.bal-table td:nth-child(7) { order: 2; }
  .seg-tabs { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
  .seg-tabs a { white-space: nowrap; }
}
.my-section .v-actions .btn { white-space: normal; height: auto; min-height: 44px; text-align: center; }
.bk-row { flex-wrap: wrap; }
.text-break { overflow-wrap: anywhere; }
@media (max-width: 480px) { .bk-row > .btn { margin-left: auto; } .bk-row > .grow { flex: 1 1 calc(100% - 60px); } }
.ci-allergy { max-width: 100%; white-space: normal !important; overflow-wrap: anywhere; }

/* ---- public welcome page, sermon notes list ---- */
.pub-wrap { max-width: 640px; }
.pub-hero { text-align: center; padding: 18px 8px 6px; }
.pub-hero img, .pub-hero svg { margin: 0 auto 10px; display: block; }
.pub-hero h1 { margin: 0 0 6px; font-size: clamp(26px, 6vw, 34px); line-height: 1.1; text-wrap: balance; }
.pub-hero p { margin: 0 auto; max-width: 46ch; color: var(--muted); font-size: 16px; }
.pub-addr { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 14px; color: var(--muted); text-decoration: none; }
.pub-addr:hover { color: var(--accent); }
.pub-latest { display: flex; align-items: center; gap: 14px; margin: 18px 0 12px; padding: 16px 18px; border-radius: 20px; text-decoration: none; color: #fff;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 62%, #000)); box-shadow: 0 10px 26px -12px color-mix(in srgb, var(--accent) 70%, transparent); }
.pub-latest-ic { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 255, 255, .18); }
.pub-latest-txt { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.pub-latest-txt small { font-size: 12.5px; opacity: .85; font-weight: 600; }
.pub-latest-txt strong { font-size: 18px; line-height: 1.25; }
.pub-latest-txt em { font-style: normal; font-size: 13.5px; opacity: .9; overflow-wrap: anywhere; }
.pub-go { flex: none; display: inline-flex; align-items: center; gap: 2px; font-weight: 700; font-size: 14px; background: rgba(255, 255, 255, .18); padding: 8px 10px 8px 14px; border-radius: 99px; }
.pub-tiles { display: grid; gap: 10px; margin: 12px 0; }
.pub-tile { display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 64px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.pub-tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.pub-tile > span:nth-child(2) { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.pub-tile strong { font-size: 16px; }
.pub-tile small { color: var(--muted); font-size: 13.5px; line-height: 1.35; }
.pub-chev { flex: none; color: var(--faint); }
.pub-a2hs { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 13px; color: var(--muted); margin: 14px 0 0; text-align: center; }
.pub-a2hs[hidden] { display: none; }
.pub-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 18px; margin: 18px 0 8px; font-size: 14px; }
.song-rights { margin: 18px auto 0; max-width: 40rem; text-align: center; font-size: 13px; line-height: 1.5; color: var(--muted); }
.pub-list-head { padding: 6px 2px 4px; }
.pub-list-head h1 { display: flex; align-items: center; gap: 10px; margin: 6px 0 6px; font-size: clamp(24px, 5.5vw, 30px); }
.pub-list-head p { margin: 0 0 14px; color: var(--muted); }
.pub-search { display: flex; gap: 8px; margin-bottom: 14px; }
.songs-search { position: relative; }
.song-suggest, .suggest-box { position: absolute; top: calc(100% + 4px); left: 0; right: 56px; z-index: 30; margin: 0; padding: 6px; list-style: none; max-height: min(60vh, 420px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, .14); }
.suggest-box { position: fixed; right: auto; z-index: 1000; max-width: calc(100vw - 16px); }
.song-suggest [role="option"], .suggest-box [role="option"] { display: grid; gap: 1px; padding: 9px 12px; border-radius: 10px; cursor: pointer; text-align: left; }
.song-suggest [role="option"]:hover, .song-suggest [aria-selected="true"], .suggest-box [role="option"]:hover, .suggest-box [aria-selected="true"] { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.song-suggest .ss-title, .suggest-box .ss-title { font-weight: 700; font-size: 15px; color: var(--ink); }
.song-suggest .ss-sub, .suggest-box .ss-sub { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-suggest .ss-hit { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-flash { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; transition: outline-color .4s; }
.song-suggest mark, .suggest-box mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.pub-search input[type=search] { flex: 1 1 auto; min-width: 0; height: 46px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; }
.pub-search input[type=search]:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
.pub-search .btn { flex: none; height: 46px; padding: 0 16px; }
.pub-sermons { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pub-sermon { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; display: grid; gap: 10px; }
.pub-sermon-main { display: flex; gap: 12px; align-items: flex-start; color: inherit; text-decoration: none; min-width: 0; }
.pub-sermon-main .cel-date { flex: none; }
.pub-sermon-txt { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.pub-sermon-txt strong { font-size: 16.5px; line-height: 1.3; }
.pub-sermon-txt small { color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; }
.pub-sermon-ref { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pub-sermon-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pub-sermon-acts .btn { min-height: 40px; }
.pub-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 16px 0; }
.sn-more { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; }
.sn-more a { display: inline-flex; align-items: center; gap: 5px; }
.pub-link-url code { font-size: 12.5px; overflow-wrap: anywhere; word-break: break-all; color: var(--muted); }
.pub-link-url.off code { text-decoration: line-through; opacity: .6; }
.pub-link-row .switch { margin: 0; }
@media (min-width: 560px) { .pub-sermon { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } }
.pub-latest, .pub-latest:hover { color: #fff; }
.pub-latest-txt small, .pub-latest-txt em, .pub-latest-txt strong { color: #fff !important; }
.pub-latest-txt small { opacity: .88; }
@media (max-width: 480px) { .pub-go { padding: 8px; } .pub-go-l { display: none; } .pub-latest { padding: 14px; gap: 12px; } .pub-latest-ic { width: 40px; height: 40px; } }

/* Birthday picker (helpers.php birthday_input): month, day and an optional year; wraps in narrow cells. */
.bday { display: flex; flex-wrap: wrap; gap: 6px; }
.bday .bd-m { flex: 2 1 118px; min-width: 0; }   /* the select, or its styled box from combo.js (same class) */
.bday .bd-d { flex: 1 1 66px; min-width: 0; }
.bday input[data-bd=y] { flex: 1 1 140px; min-width: 0; width: auto; }   /* drops to its own line on narrow phones so "Year (optional)" fits */
.bday + .age-pill { margin-top: 6px; }
@media (min-width: 421px) { .grid-4 > .bday-field { grid-column: span 2; } }
.grid-reg > .field.bday-field { grid-column: span 6; }

/* "Download ▾" menu on lists (Report::button): Excel or PDF of what the list shows. */
.dl-menu { position: relative; display: inline-block; }
.dl-menu > summary { list-style: none; cursor: pointer; }
.dl-menu > summary::-webkit-details-marker { display: none; }
.dl-menu > summary .chev { margin-left: 2px; transition: transform .15s; }
.dl-menu[open] > summary .chev { transform: rotate(180deg); }
.dl-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 180px; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); display: grid; gap: 2px; }
.dl-pop a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--ink); text-decoration: none !important; font-family: var(--font-ui); font-size: 14.5px; }
.dl-pop a:hover { background: var(--surface-2); }

/* Worship page: one compact toolbar on both Song lists + Library tabs */
.worship-toolbar { gap: 10px; }
.worship-actions { display: inline-flex; align-items: center; gap: 8px; }
.worship-actions .btn.btn-ghost:not(.dl-menu > summary) { padding-inline: 11px; }
.worship-head .seg-tabs { flex: 0 0 auto; }
@media (max-width: 760px) {
  .worship-toolbar { width: 100%; justify-content: space-between; }
  .worship-actions { margin-left: auto; }
}

/* Layout guards against overlapping: grid and flex children may shrink below their content, so a long
   name, email or select can't push a column over its neighbour; page headers and hero toolbars wrap. */
.d-grid > *, .grid-gap > *, .cols-aside-main > *, .set-card, .card { min-width: 0; }
select, .cb { max-width: 100%; }
.page-head { flex-wrap: wrap; }
@media (min-width: 761px) { .page-head > div:first-child { flex: 1 1 240px; } }   /* row layout only: in the stacked phone header a 240px basis became a 240px-tall gap */
.page-head > .toolbar { flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
.prof-hero > .grow { flex: 1 1 220px !important; min-width: 0; }   /* .grow is flex: 1 (basis 0) !important: the name column would shrink to a sliver */
.flex.wrap > .grow, .flex.wrap > .cb.grow { flex: 1 1 200px !important; min-width: 0; }   /* in wrapping rows, wrap before a field gets squeezed */
.prof-hero > .toolbar { flex: 0 1 auto; flex-wrap: wrap; min-width: 0; }
.prof-hero h1 { overflow-wrap: break-word; word-break: normal; }
.fam-row-wrap { min-width: 0; }
.fam-row-wrap > .fam-row { flex: 1 1 auto; min-width: 0; }
.fam-row-wrap > .fam-row > span:last-child { min-width: 0; overflow-wrap: anywhere; }
#details-check form > select, #details-check form > .cb { flex: 1 1 180px; min-width: 0; }
@media (max-width: 760px) {
    /* People list as cards on phones: long names and emails wrap inside the card */
    .who .person-link strong { white-space: normal; overflow-wrap: anywhere; }
    .table-wrap td { overflow-wrap: anywhere; min-width: 0; }
}
.tone-field { min-width: 0; }
.tone-field > span { max-width: 100%; overflow-wrap: anywhere; text-align: center; }
.tone-field input[type=color] { min-width: 0; }
@media (max-width: 760px) {
    .table-wrap td a, .table a[href^="mailto:"] { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
}

/* Carol night shared page (carol-night) */
.share-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
@media (max-width: 420px) { .share-acts { grid-template-columns: 1fr; } }
.share-h { font-size: 17px; font-weight: 750; margin: 26px 0 10px; }
.share-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 16px; }
.share-list li { display: grid; grid-template-columns: 70px 24px minmax(0, 1fr); gap: 10px; align-items: start; padding: 12px 14px; }
.share-list li + li { border-top: 1px solid var(--line-2); }
.share-list .sl-time { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); white-space: nowrap; }
.share-list .sl-ic { text-align: center; }
.share-list .sl-main { min-width: 0; display: grid; gap: 2px; overflow-wrap: anywhere; }
.share-list small { color: var(--muted); font-size: 13px; }
.share-list .sl-songs { color: var(--ink-2); }
.share-songs { display: grid; gap: 8px; }
.share-song { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.share-song summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; font-weight: 650; list-style: none; }
.share-song summary::-webkit-details-marker { display: none; }
.share-song summary small { color: var(--muted); font-weight: 500; }
.share-song[open] summary { border-bottom: 1px solid var(--line-2); }
.share-words { padding: 12px 16px 16px; font-size: 16px; line-height: 1.6; }
@media print {
    .carol-share .share-song { break-inside: avoid; }
    .carol-share details.share-song > .share-words { display: block !important; }
}

/* Announce dialog on the carol night page */
.ann-groups { display: grid; gap: 8px; }
.ann-group { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; margin: 0; }
.ann-group input { margin-top: 3px; flex: none; }
.ann-group > span { min-width: 0; flex: 1; }
.ann-group small { display: block; color: var(--muted); font-weight: 400; }
.ann-group .n { flex: none; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ann-group:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.share-link-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.share-link-row input { flex: 1 1 220px; min-width: 0; font-size: 13px; }
.ann-sent { font-size: 13px; color: var(--muted); }

/* Change an event's time (schedule) */
.icon-btn.icon-btn-xs { width: 24px; height: 24px; min-width: 24px; border-radius: 7px; margin-left: 4px; vertical-align: middle; }
.ev-time { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.tm-check { margin-top: 12px; }
.tm-warn { padding: 10px 12px; border-radius: 12px; background: var(--amber-bg); color: var(--ink); font-size: 13.5px; border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent); }
.tm-warn b:first-child { color: var(--amber); }
.tm-warn ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.tm-ok { padding: 9px 12px; border-radius: 12px; background: var(--green-bg); color: var(--green); font-size: 13.5px; font-weight: 600; }
.btn.btn-warn { background: var(--amber); border-color: var(--amber); }

/* Announce an event */
.ann-h { font-size: 17px; font-weight: 750; margin: 22px 0 12px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.tpl-card { display: flex; flex-direction: column; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); overflow: hidden; cursor: pointer; text-align: left; color: var(--ink); transition: transform .15s ease, box-shadow .15s ease; font: inherit; }
.tpl-card:hover, .tpl-card:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow); outline: none; }
.tpl-card.is-off { opacity: .55; }
.tpl-art { position: relative; display: grid; place-items: center; align-content: center; gap: 6px; height: 112px; color: #fff; text-align: center; padding: 10px; overflow: hidden; }
.tpl-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.tpl-ic { position: relative; font-size: 30px; line-height: 1; }
.tpl-k { position: relative; font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; opacity: .9; }
.tpl-body { display: grid; gap: 2px; padding: 11px 13px 13px; }
.tpl-body small { color: var(--muted); }
.ann-dot { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; font-size: 17px; flex: none; vertical-align: middle; }
.ann-dot.lg { width: 40px; height: 40px; font-size: 20px; margin-right: 6px; }

.ann-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.ann-fields { display: grid; gap: 14px; min-width: 0; }
.ann-sec h3 { display: flex; align-items: center; gap: 8px; font-size: 15.5px; margin-bottom: 12px; }
.ann-prev { position: sticky; top: 76px; min-width: 0; }
.ann-prev-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.seg.seg-sm label span { padding: 5px 10px; font-size: 12.5px; }
.ann-frame { width: 100%; height: calc(100vh - 140px); min-height: 520px; border: 1px solid var(--line); border-radius: 16px; background: #fff; display: block; margin: 0 auto; transition: width .2s ease; }
.ann-frame.is-phone { width: 390px; max-width: 100%; }
.ann-bar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; padding: 12px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); box-shadow: var(--shadow); }
.w-icon input { width: 90px; font-size: 20px; text-align: center; }
@media (max-width: 1100px) {
    .ann-grid { grid-template-columns: minmax(0, 1fr); }
    .ann-prev { position: static; }
    .ann-frame { height: 560px; }
}

.theme-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.theme-pick label { display: grid; gap: 4px; justify-items: center; cursor: pointer; margin: 0; }
.theme-pick input { position: absolute; opacity: 0; pointer-events: none; }
.theme-pick span { width: 100%; height: 38px; border-radius: 10px; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.theme-pick small { font-size: 11.5px; color: var(--muted); text-align: center; line-height: 1.2; }
.theme-pick input:checked + span { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.theme-pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.img-slot { display: grid; gap: 8px; min-width: 0; }
.img-drop { position: relative; display: grid; place-items: center; min-height: 150px; border: 2px dashed var(--line); border-radius: 16px; background: var(--surface-2); cursor: pointer; overflow: hidden; text-align: center; transition: border-color .15s ease, background .15s ease; }
.img-drop:hover, .img-drop:focus-visible, .img-slot.is-drag .img-drop { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); outline: none; }
.slot-wide .img-drop { aspect-ratio: 2 / 1; min-height: 0; }
.img-empty { display: grid; gap: 6px; justify-items: center; padding: 16px; color: var(--muted); }
.img-empty b { color: var(--ink); font-size: 14px; }
.img-empty small { font-size: 12px; max-width: 260px; }
.img-prev { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.img-slot.has-img .img-empty { visibility: hidden; }
.img-busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.8); font-weight: 700; color: var(--ink); }
.img-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.img-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.img-row .img-drop { aspect-ratio: 3 / 4; min-height: 0; }
.img-row .img-empty small { display: none; }
@media (max-width: 560px) { .img-row { grid-template-columns: 1fr 1fr; } }
.ann-speaker { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.slot-round { width: 130px; flex: none; }
.slot-round .img-drop { aspect-ratio: 1; min-height: 0; border-radius: 50%; }
.slot-round .img-empty small, .slot-round .img-empty .btn { display: none; }
.slot-round .img-acts { justify-content: center; }
.ann-sec { padding: 18px 20px; }
@media (max-width: 760px) { .ann-sec { padding: 14px; } }
.ann-bar .btn { flex: 0 0 auto; width: auto; }
.img-err { color: var(--red, #c0392b); font-size: 12.5px; min-height: 0; } .img-err:empty { display: none; }
@media (max-width: 900px) { .ann-bar { bottom: calc(66px + env(safe-area-inset-bottom)); padding: 10px; } .ann-bar .btn-lg { padding: 10px 16px; font-size: 15px; } }

/* Carol times: every minute editable */
.prog-min { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.prog-at { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent); min-width: 58px; text-align: right; }
.min-form { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: 12.5px; color: var(--muted); }
.min-in { width: 58px; padding: 3px 6px; height: 28px; font-size: 13px; text-align: right; border-radius: 8px; }
.min-in.is-own { border-color: var(--accent); font-weight: 700; color: var(--ink); }
.min-in::placeholder { color: var(--muted); opacity: .9; }
.prog-sq { color: var(--amber); font-size: 12px; }
.prog-total { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.prog-total small { color: var(--muted); }
.prog-total.is-short small { color: var(--amber); }
.nudge { display: inline-flex; gap: 4px; }
.btn.btn-xs { padding: 3px 9px; font-size: 12.5px; min-height: 0; height: 28px; }
.prog-drive { margin-top: 8px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.part-mins { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.part-mins label { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); margin: 0; }
.fit-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 14px; margin: 0 0 12px; font-size: 14px; border: 1px solid var(--line); background: var(--surface); }
.fit-bar.is-over { background: var(--amber-bg); border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
.fit-bar.is-ok { background: var(--green-bg); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
@media (max-width: 560px) { .prog-at { min-width: 0; } .min-in { width: 50px; } }
.min-form input.min-in { width: 64px !important; min-width: 0; flex: none; }
.prog-drive .min-form input.min-in { width: 64px !important; }

/* "Match my device" theme card */
.theme-card .tc-in.tc-split { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; }
.tc-split .tc-half { display: block; }
.tc-split .tc-half .tc-hero { height: 46px; }
.tc-split .tc-body { grid-column: 1 / -1; }
@media (max-width: 640px) {
    .prog .prog-row { flex-wrap: wrap; }
    .prog .prog-row > .grow { flex: 1 1 calc(100% - 40px) !important; min-width: 0; }
    .prog .prog-row > .prog-min { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
}

/* Carol homes: who we're visiting */
.who-seg { flex-wrap: wrap; }
form:has(.who-seg) .who-family, form:has(.who-seg) .who-person, form:has(.who-seg) .who-guest, form:has(.who-seg) .who-friend, form:has(.who-seg) .who-outreach { display: none; }
form:has(.who-seg input[value=family]:checked) .who-family,
form:has(.who-seg input[value=member]:checked) .who-person,
form:has(.who-seg input[value=guest]:checked) .who-guest,
form:has(.who-seg input[value=friend]:checked) .who-friend { display: block; }
form:has(.who-seg input[value=friend]:checked) .who-outreach,
form:has(.who-seg input[value=place]:checked) .who-outreach { display: flex; }
form:has(.who-seg input[value=place]:checked) .who-family ~ .span-2,
form:has(.who-seg input[value=friend]:checked) .who-family ~ .span-2 { grid-column: 1 / -1; }
.kind-tag { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 650; vertical-align: 2px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.kind-tag.k-friend { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.kind-tag.k-guest { background: var(--blue-bg, #eef4ff); color: var(--blue, #2563eb); border-color: transparent; }
.pick-name { margin-top: 6px; max-width: 260px; }
.audit-row { position: relative; } .audit-row .audit-x { position: absolute; right: 0; top: 6px; margin: 0; opacity: .55; } .audit-row:hover .audit-x, .audit-row .audit-x:focus-within { opacity: 1; } .audit-row .what { padding-right: 30px; }

/* Coming up: announced events on the Schedule and the welcome page */
.soon-strip { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; margin: 0 0 16px; }
.soon-h { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.soon-item { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c); color: var(--ink); text-decoration: none; min-width: 0; flex: 0 1 260px; box-shadow: var(--shadow-sm, none); }
.soon-item:hover { border-color: var(--c); }
.soon-item b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soon-item small { color: var(--muted); font-size: 12.5px; }
.soon-ic { font-size: 22px; line-height: 1; }
.pub-soon { margin: 18px 0 6px; display: grid; gap: 10px; }
.pub-soon h2 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 4px; }
.pub-soon-item { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 18px; color: #fff; text-decoration: none; background: var(--c); background-image: linear-gradient(135deg, var(--c), var(--c2)); box-shadow: var(--shadow); }
.pub-soon-item small { display: block; opacity: .9; font-size: 13px; }
.pub-soon-item strong { display: block; font-size: 16px; }
.pub-soon-item > svg { margin-left: auto; flex: none; }
.pub-soon-ic { font-size: 26px; line-height: 1; }
.pub-soon-item small, .pub-soon-item strong { color: #fff !important; } .pub-soon-item small { opacity: .88; }

/* Team ticks: a team and its sub-teams stay together (columns, not a row-by-row grid) */
.team-checks { display: block; columns: 2; column-gap: 16px; max-height: none; overflow: visible; }
.team-checks .team-group { break-inside: avoid; display: grid; gap: 4px; padding: 2px 0; }
@media (max-width: 640px) { .team-checks { columns: 1; } }
svg.i-s { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.soon-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.soon-strip .soon-h { grid-column: 1 / -1; }
.soon-item { flex: none; }
.soon-item small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Add / Edit a home: the same plan rows as the home card */
.plan-edit { border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin: 6px 0 14px; background: var(--surface); }
.plan-h { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 0 0 10px; }
.plan-edit .time-box { margin-bottom: 10px; }
.plan-edit .prog-row .grow > select, .plan-edit .prog-row .grow > input, .plan-edit .prog-row .grow > .cb, .plan-edit .prog-row .grow > .seg { display: block; margin-top: 6px; max-width: 520px; width: 100%; }
.plan-edit .prog-row .grow > .seg { display: inline-flex; width: auto; }
.plan-edit .prog-meal-row.is-none .prog-min { visibility: hidden; }
.plan-edit .prog-meal-row.is-none .meal-note { display: none; }
.plan-edit .prog-row.is-squeezed .prog-at::after { content: " ↓"; color: var(--amber); }
.plan-visit { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--muted); font-weight: 500; }
.plan-edit .prog-drive { margin-top: 10px; }

/* Home card: unsaved minutes */
.card-save { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--amber-bg); border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent); position: sticky; bottom: 8px; z-index: 3; }
.card-save[hidden] { display: none; }
.card-save > span { margin-right: auto; font-size: 13px; font-weight: 600; color: var(--ink); }
.min-in.is-changed { border-color: var(--amber) !important; background: color-mix(in srgb, var(--amber) 10%, var(--surface)); }
@media (max-width: 900px) { .card-save { bottom: calc(70px + env(safe-area-inset-bottom)); } }
.plan-edit input.min-in { width: 64px !important; min-width: 0; flex: none; display: inline-block; }
.plan-edit .plan-fields { display: block; }
.plan-edit .plan-fields > b, .plan-edit .prog-row .grow > b { display: block; }
.plan-visit { white-space: nowrap; }
.plan-edit .prog-drive { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.plan-visit input.min-in { width: 76px !important; }

/* ---- Order of service (same row style as the carol plan, compact) */
.svc-pick { display: grid; gap: 10px; }
.svc-ev { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.svc-cols { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
.svc-list .svc-row { align-items: flex-start; gap: 10px; padding: 12px 14px; }
.svc-row .prog-ic { font-size: 20px; line-height: 34px; width: 26px; text-align: center; flex: none; }
.svc-row .plan-fields { display: grid; gap: 6px; }
.svc-row .plan-fields input, .svc-row .plan-fields .cb, .svc-row .plan-fields select { max-width: none; width: 100%; margin: 0; }
.svc-top { display: flex; align-items: center; gap: 10px; }
.svc-top .svc-title { flex: 1; min-width: 0; font-weight: 650; }
.svc-who { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.svc-parts { display: grid; gap: 6px; }
.svc-parts:empty { display: none; }
.svc-part { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px; align-items: center; padding-left: 12px; border-left: 2px solid var(--line); }
.svc-row input, .svc-row select, .svc-row .cb-btn { min-height: 34px; padding-top: 6px; padding-bottom: 6px; font-size: 14px; }
.svc-row .btn-link { justify-self: start; }
.svc-row .prog-min { padding-top: 2px; }
.svc-row .prog-at { min-width: 64px; text-align: right; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.svc-row .min-in { width: 64px; }
.svc-move { display: inline-flex; gap: 2px; padding-top: 4px; }
.svc-row.is-off .plan-fields > :not(.svc-top), .svc-row.is-off .svc-move [data-move] { display: none; }
.svc-row.is-off .svc-title { color: var(--muted); text-decoration: line-through; }
.svc-row.is-off { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.svc-songs { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
@media (max-width: 900px) { .svc-cols { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
    .svc-who { grid-template-columns: 1fr; }
    .svc-part { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
    .svc-part > input[name$="[label]"] { grid-column: 1 / 3; grid-row: 1; }
    .svc-part > [data-part-del] { grid-column: 3; grid-row: 1; }
    .svc-part > .cb, .svc-part > select { grid-column: 1; grid-row: 2; }
    .svc-part > input[name$="[who_name]"] { grid-column: 2 / 4; grid-row: 2; }
    .svc-move { flex-direction: row; }
}
@media print {
    .svc-row input, .svc-row select, .svc-row .cb-btn { border: 0 !important; background: none !important; padding: 0 !important; min-height: 0; }
    .svc-row [data-part-add], .svc-row [data-part-del], .svc-move, .svc-row .switch, .svc-row.is-off { display: none !important; }
    .svc-cols { grid-template-columns: 1fr; }
}
.ev-svc { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; font-size: 12.5px; font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; }
.ev-svc:hover { text-decoration: underline; }

/* Schedule: roles in panels by kind (Service leadership, Worship team, Communion & offering, Media, Hospitality) */
.roles.role-panels { grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 12px; padding: 12px; align-items: start; border-top: 1px solid var(--line-2); background: color-mix(in srgb, var(--bg, #f6f4ef) 55%, transparent); }
.role-group { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; min-width: 0; }
.role-group-h { margin: 0; padding: 10px 14px; font-size: 14.5px; font-weight: 750; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line-2); }
.role-group-h small { font-weight: 600; font-size: 12px; color: var(--muted); background: var(--line-2); border-radius: 99px; padding: 1px 8px; }
.role-group .role { grid-template-columns: minmax(130px, 180px) minmax(0, 1fr) auto; padding: 8px 12px; gap: 10px; }
.role-group .role:first-of-type { border-top: 0; }
.role-group .role-name { font-size: 13.5px; }
.role-group .role-name small { color: var(--accent); font-weight: 650; }
.role-group .chip { min-height: 0; }
.roles.role-panels > .role-new-row { grid-column: 1 / -1; border-top: 0; padding: 2px 0 0; background: none; }
@media (max-width: 760px) {
  .roles.role-panels { padding: 8px; gap: 8px; }
  .role-group .role { grid-template-columns: minmax(0, 1fr) auto; }
  .role-group .role .chips { grid-column: 1 / -1; grid-row: 2; }
}
.svc-link { align-items: center; margin-bottom: 12px; }
.svc-link-form { display: grid; gap: 8px; justify-items: end; margin: 0; }
.svc-setup { list-style: none; margin: 0; padding: 4px 16px 14px; display: grid; gap: 10px; font-size: 14px; }
.svc-setup li { display: flex; align-items: center; gap: 10px; }
@media (max-width: 640px) { .svc-link { flex-wrap: wrap; } .svc-link-form { justify-items: start; } }
.role-group .role-add { font-size: 0; gap: 0; padding: 6px 8px; }
.role-group .role-add svg { margin: 0; }
.role-group .chips { gap: 6px; }
.role-group .role { grid-template-columns: minmax(120px, 165px) minmax(0, 1fr) auto; }
/* Panels flow like a newspaper (no empty gaps under short panels); name and time on one line */
.roles.role-panels { display: block; columns: 2 440px; column-gap: 12px; }
.roles.role-panels > .role-group { break-inside: avoid; display: block; width: 100%; margin: 0 0 12px; }
.roles.role-panels > .role-new-row { column-span: all; display: block; margin: 0; }
.role-group .role { grid-template-columns: minmax(0, 220px) minmax(0, 1fr) auto; align-items: center; min-height: 52px; }
.role-group .role-name { align-items: center; }
.role-group .role-name > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex: 1; min-width: 0; }
.role-group .role-name > div small { display: inline; order: 2; white-space: nowrap; font-size: 12px; }
.role-group .chips { align-items: center; }
@media (max-width: 760px) { .roles.role-panels { columns: 1; } .role-group .role { grid-template-columns: minmax(0, 1fr) auto; } }
/* Panels: two balanced columns (filled by a small script); role tools appear on hover so spots sit side by side */
.roles.role-panels.is-balanced { columns: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.role-col { display: grid; gap: 12px; min-width: 0; }
.role-col > .role-group { margin: 0; }
.roles.role-panels.is-balanced > .role-new-row { grid-column: 1 / -1; }
@media (hover: hover) and (min-width: 761px) {
  .role-group .role { grid-template-columns: minmax(0, 210px) minmax(0, 1fr); position: relative; }
  .role-group .role-tools { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); opacity: 0; transition: opacity .15s; background: var(--surface); border-radius: 10px; box-shadow: 0 0 0 6px var(--surface); }
  .role-group .role:hover .role-tools, .role-group .role:focus-within .role-tools { opacity: 1; }
}
/* Panel "+ Add" and small role buttons (always visible, quiet until hovered) */
.role-group-h { justify-content: space-between; }
.role-group-h > span { display: inline-flex; align-items: center; gap: 8px; }
.grp-add { display: inline-flex; align-items: center; gap: 4px; border: 1px dashed var(--line); background: none; color: var(--accent); border-radius: 99px; padding: 3px 10px; font-size: 12.5px; font-weight: 650; cursor: pointer; }
.grp-add:hover { border-style: solid; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.role-group .role-tools { position: static !important; transform: none !important; opacity: 1 !important; box-shadow: none !important; background: none !important; gap: 2px; }
.role-group .role-tools .icon-btn { opacity: .5; transition: opacity .15s; }
.role-group .role:hover .role-tools .icon-btn, .role-group .role-tools .icon-btn:focus-visible { opacity: 1; }
.role-group .role-add { opacity: .5 !important; }
.role-group .role:hover .role-add { opacity: 1 !important; }
@media (hover: none) { .role-group .role-tools .icon-btn, .role-group .role-add { opacity: .85 !important; } }
@media (hover: hover) and (min-width: 761px) { .role-group .role { grid-template-columns: minmax(0, 200px) minmax(0, 1fr) auto; } }
.role-group .role-del:hover { color: var(--red, #c0392b); }
.role-danger.is-focus { outline: 2px solid color-mix(in srgb, var(--red, #c0392b) 45%, transparent); outline-offset: 2px; border-radius: 12px; }
.role-group .role-name > div { flex-wrap: wrap; row-gap: 2px; }
.role-group .role-name > div small { margin-left: auto; }
.role-group-h { gap: 6px; }
.role-group-h > span { margin-right: auto; }
.grp-del { display: inline-grid; place-items: center; width: 26px; height: 26px; border: 1px solid transparent; background: none; color: var(--muted); border-radius: 8px; cursor: pointer; opacity: .6; }
.grp-del:hover { opacity: 1; color: var(--red, #c0392b); border-color: var(--line); }
@media (hover: none) { .grp-del { opacity: .9; } }
/* Consistent: the time always sits under the role name */
.role-group .role-name > div { display: block; }
.role-group .role-name > div small { display: block; margin: 2px 0 0; }

/* ==========================================================================
   Unified Song Library (songs, song & admin Song Library)
   ========================================================================== */
/* Same content width as the admin schedule (.page = 1180px) — no narrow “lyric site” column */
.v-wrap.songs-wrap,
.v-wrap.song-detail-wrap,
.songs-wrap,
.song-detail-wrap {
  max-width: 1180px;
  width: 100%;
  padding: 26px 20px 80px;
  min-height: 100vh;
}
.songs-topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.song-cat-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.song-cat-tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 11px; font: 600 14px/1.1 var(--font-ui, var(--font)); color: var(--ink-2); text-decoration: none !important; transition: background .15s, color .15s; }
.song-cat-tab b { font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.song-cat-tab:hover { background: var(--surface-2); }
.song-cat-tab.on { background: color-mix(in srgb, var(--accent) 13%, var(--surface)); color: var(--accent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 38%, transparent); }
.song-cat-tab.on b { background: var(--surface); color: var(--accent); }

.song-filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 12px; }
.song-pills, .song-subfilters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.song-subfilters { flex: 1 1 auto; }
.song-pills + .song-subfilters { padding-left: 10px; border-left: 1px solid var(--line); }
.song-subfilters .song-clear-link { margin-left: auto; }
.song-pill { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 13px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 600; text-decoration: none !important; transition: border-color .15s, background .15s; }
.song-pill small { color: var(--muted); font-weight: 500; }
.song-pill:hover { border-color: var(--accent); }
.song-pill.on, .song-pill:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); }
.song-filter-select, .cb.song-filter-select { width: auto !important; max-width: 260px; min-width: 0; }
.cb.song-filter-select .cb-btn { height: 34px; min-height: 34px; padding: 0 12px 0 12px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--surface); }
.cb.song-filter-select .cb-pop { border-radius: 14px; }
.song-clear-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 4px 8px; }
.song-clear-link:hover { color: var(--accent); }
.songs-count { font-size: 13px; margin: 0 2px 10px; }

.lib-lang + .lib-lang { margin-top: 28px; }
.lib-lang-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 2px; }
.lib-lang-head h2 { margin: 0; font-size: clamp(22px, 4vw, 28px); line-height: 1.15; }
.lib-lang-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.lib-lang-head > b { font-size: 13px; font-weight: 800; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-radius: 99px; padding: 4px 10px; }
.lib-letters { position: sticky; top: 0; z-index: 4; display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0 4px; padding: 8px 0; background: color-mix(in srgb, var(--bg) 90%, transparent); }
.lib-letters a { min-width: 34px; height: 34px; padding: 0 7px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 800; font-size: 15px; text-decoration: none !important; }
.lib-letters a:hover { border-color: var(--accent); color: var(--accent); }
.lib-letters a.is-empty { opacity: .28; pointer-events: none; }
/* One continuous grid per language: letters flow on without leaving empty columns; the letter sits on its first card. */
.lib-flow { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 10px; margin-top: 8px; }
.lib-letter, .lib-grid { display: contents; }
.lib-letter[hidden], .lib-grid .song-card-item[hidden] { display: none; }
.lib-grid { list-style: none; margin: 0; padding: 0; }
.lib-grid .song-card-item { list-style: none; display: flex; background: none; border: 0; border-radius: 0; scroll-margin-top: 64px; }
.lib-grid .song-card-item:hover { transform: none; }
.lib-initial { display: none; }
.is-first .lib-initial { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); font-size: 12.5px; font-weight: 800; line-height: 1; }
.lib-song { position: relative; flex: 1; display: grid; gap: 3px; align-content: start; min-height: 74px; padding: 14px 40px 13px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: inherit; text-decoration: none !important; }
.lib-song:hover { border-color: var(--accent); }
.lib-title { font-size: 18px; font-weight: 750; line-height: 1.35; }
.lib-sub { font-size: 14.5px; font-weight: 650; line-height: 1.35; color: var(--ink-2); }
.lib-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.lib-hit { font-style: italic; }
@media (max-width: 640px) {
    .song-filter-bar { display: grid; grid-template-columns: minmax(0, 1fr); }
    .song-pills { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -2px; padding: 0 2px; }
    .song-pills::-webkit-scrollbar { display: none; }
    .song-pills .song-pill { flex: none; }
    .song-pills + .song-subfilters { padding-left: 0; border-left: 0; }
    .song-subfilters { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: row dense; gap: 6px; }
    .song-subfilters .song-pill { justify-content: center; height: auto; min-height: 34px; align-self: stretch; }
    .song-subfilters .song-filter-select { width: 100% !important; max-width: none; }
    .song-subfilters .song-filter-select:not(.song-key-select) { grid-column: 1 / -1; }
    .song-subfilters .song-clear-link { grid-column: 1 / -1; justify-self: end; margin-left: 0; }
}

.song-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.song-card-item { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; transition: border-color .15s, transform .15s; }
.song-card-item:hover { border-color: var(--accent); transform: translateY(-1px); }
.song-card-link { display: flex; align-items: flex-start; gap: 13px; padding: 14px 16px; color: inherit; text-decoration: none !important; min-width: 0; }
.song-cat-ic { flex: none; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 20px; background: var(--surface-2); }
.song-card-main { flex: 1 1 auto; min-width: 0; display: grid; gap: 5px; }
.song-card-titles { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.song-card-titles strong { font-size: 16.5px; line-height: 1.28; }
.song-native-sub { font-size: 15px; color: var(--ink-2); font-weight: 500; }
.song-card-meta, .song-card-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; }
.song-badge-lang { padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); font-weight: 600; font-size: 12px; }
.song-badge-key { padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 11%, var(--surface)); color: var(--accent); font-weight: 700; font-size: 12px; }
.song-badge-chords { padding: 2px 9px; border-radius: 99px; background: color-mix(in srgb, #10b981 14%, var(--surface)); color: color-mix(in srgb, #059669 85%, var(--ink)); font-weight: 700; font-size: 12px; }
.song-badge-lbl { padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); font-size: 11.5px; font-weight: 600; }
.song-occ-tag { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: color-mix(in srgb, var(--accent) 9%, var(--surface)); color: var(--ink-2); text-decoration: none !important; border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }
a.song-occ-tag:hover { border-color: var(--accent); color: var(--accent); }
.song-verse-tag { display: inline-flex; align-items: center; gap: 3px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); text-decoration: none !important; border: 1px solid var(--line); }
a.song-verse-tag:hover { border-color: var(--accent); color: var(--accent); }
.song-snippet { font-size: 13px; color: var(--muted); font-style: italic; overflow-wrap: anywhere; }

/* Song Detail Page (song) */
.song-sheet-card { overflow: hidden; width: 100%; }
.song-hero { padding: 22px 28px 18px; border-bottom: 1px solid var(--line); }
.song-hero-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.song-cat-pill, .song-lang-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 700; text-decoration: none !important; }
.song-cat-pill { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); }
.song-lang-pill { background: var(--surface-2); color: var(--ink-2); }
.song-main-title { margin: 0; font-size: clamp(24px, 5.2vw, 32px); line-height: 1.18; }
.song-native-heading { margin: 6px 0 0; font-size: clamp(17px, 3.6vw, 21px); color: var(--ink-2); font-weight: 600; }
.song-specs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; font-size: 14px; color: var(--muted); }
.song-specs > span { display: inline-flex; align-items: center; gap: 5px; }
.song-specs b { color: var(--ink); }
.song-connections { display: grid; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.song-conn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.song-conn-lbl { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.song-conn-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.song-team-note { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; color: var(--ink-2); }

.song-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 20px 0; background: transparent; border-bottom: 1px solid var(--line); }
.song-view-tabs { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.song-view-tab { border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 10px 2px; border-radius: 0; font: 650 15px/1.1 var(--font-ui, var(--font)); color: var(--muted); cursor: pointer; }
.song-view-tab:hover { color: var(--ink); background: transparent; }
.song-view-tab.on { background: transparent; color: var(--ink); border-bottom-color: var(--accent); box-shadow: none; }
.song-single-view-lbl { font-weight: 700; font-size: 14px; color: var(--ink-2); }
.song-empty-pane { margin: 8px 0 0; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); color: var(--ink-2); font-size: 15px; line-height: 1.45; }
.song-book-name { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.song-book-name + .song-conn-lbl { margin-left: 8px; }
.song-catalog-meta { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); font-weight: 600; letter-spacing: .01em; }
.song-font-tools { display: flex; gap: 4px; margin-left: auto; }
.song-font-tools .icon-btn { font-weight: 700; font-size: 12.5px; width: auto; padding: 0 9px; }

.song-body { --song-fs: 18px; padding: 24px 28px 28px; max-width: none; }
.song-body .lyrics { font-size: var(--song-fs); line-height: 1.55; gap: 14px; }
.song-read-note { margin: 0 0 14px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); font-size: 14px; line-height: 1.45; }
.song-body .ly-block { margin: 0; padding: 0 0 8px; border: 0; background: transparent; }
.song-body .ly-label { display: block; margin: 0 0 6px; padding: 0; border: 0; border-radius: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; line-height: 1.2; }
.song-body .ly-lines { display: grid; }
.song-body .ly-lines > .ly-line { padding: 3px 0; border: 0; line-height: 1.7; }
.song-body .ly-hook { color: var(--accent); font-weight: 750; }

/* Script & English: 2–3 original lines, then English — church theme colors only (no amber “lyric site” look) */
.song-body .lbl-stack { display: grid; gap: 0; }
.song-body .lbl-chunk { display: grid; gap: 10px; padding: 16px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.song-body .lbl-chunk:last-child { border-bottom: 0; }
.song-body .lbl-nat-block, .song-body .lbl-en-block { display: grid; gap: 6px; }
.song-body .lbl-en-block { padding-top: 2px; }
.song-body .lbl-nat { font-size: var(--song-fs); font-weight: 700; color: var(--ink); line-height: 1.6; }
.song-body .lbl-en { font-size: calc(var(--song-fs) * 0.94); font-weight: 600; color: var(--ink-2); line-height: 1.5; padding: 0; border: 0; }
.song-body .lbl-nat .ly-line, .song-body .lbl-en .ly-line { padding: 0; border: 0; font-weight: inherit; }
/* Legacy single-pair markup (older saved HTML / examples) */
.song-body .lbl-pair { display: grid; gap: 2px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.song-body .lbl-pair:last-child { border-bottom: 0; }

/* Aligned Chord Sheet & Transpose Bar */
.chord-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; margin-bottom: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.chord-transpose-grp { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ch-ctrl-lbl { font-size: 13px; font-weight: 700; color: var(--muted); margin-right: 2px; }
.ch-step-pill { display: inline-grid; place-items: center; min-width: 58px; padding: 4px 9px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ch-key-pick, .cb.ch-key-pick { width: auto !important; min-width: 72px; }
.cb.ch-key-pick .cb-btn { height: 32px; min-height: 32px; padding: 0 10px; border-radius: 8px; font-size: 13px; font-weight: 700; }
.chord-controls .btn.is-on { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }

.song-body .ch-lines { display: grid; gap: 2px; min-width: 0; }
.song-body .ly-block, .song-body .lyrics, .song-body .chord-sheet { min-width: 0; }
.song-body .ch-line { display: flex; flex-wrap: nowrap; align-items: flex-end; gap: 2px; min-width: 0; max-width: 100%; overflow-x: auto; padding: 10px 2px 8px; border-top: 1px solid color-mix(in srgb, var(--line) 78%, transparent); line-height: 1.15; scrollbar-width: thin; }
.song-body .ch-lines > .ch-line:first-child { border-top: 0; padding-top: 2px; }
.song-body .ch-line.ch-plain { display: block; overflow: visible; white-space: normal; line-height: 1.55; }
.song-body .ch-line.ch-inst { align-items: center; gap: 6px; }
.song-body .ch-seg { display: inline-flex; flex-direction: column; align-items: flex-start; flex: 0 0 auto; vertical-align: bottom; }
.song-body .ch-tag { display: inline-block; font: 800 12.5px/1.15 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); padding: 2px 6px; border-radius: 6px; margin: 0 0 4px; cursor: pointer; user-select: none; transition: transform .1s, background .15s; }
.ch-tag:hover, .ch-tag.is-hl { background: var(--accent); color: #fff; transform: translateY(-1px); }
.ch-empty { display: inline-block; height: 18px; line-height: 1; font-size: 12px; }
.song-body .ch-word { white-space: pre; font-size: var(--song-fs); line-height: 1.35; }
.ch-bar { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

/* Interactive 2-Octave SVG Piano Chord Diagrams */
.piano-drawer { margin-bottom: 18px; padding: 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.piano-drawer-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 10px; font-size: 14px; }
.piano-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 10px; }
.piano-card { display: grid; gap: 6px; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: inherit; text-align: left; font: inherit; cursor: pointer; transition: border-color .15s, transform .12s, box-shadow .15s; }
.piano-card:hover, .piano-card.is-hl { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.piano-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.piano-card-head strong { font: 800 15px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--accent); }
.piano-card-head small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.piano-svg { width: 100%; height: auto; display: block; border-radius: 4px; }
.piano-svg .pk-w { fill: #ffffff; stroke: #cbd5e1; stroke-width: 1; }
.piano-svg .pk-b { fill: #1e293b; stroke: #0f172a; stroke-width: 0.8; }
.piano-svg .pk-w.on { fill: color-mix(in srgb, var(--accent) 26%, #ffffff); stroke: var(--accent); stroke-width: 1.2; }
.piano-svg .pk-w.on.root { fill: color-mix(in srgb, var(--accent) 44%, #ffffff); }
.piano-svg .pk-b.on { fill: var(--accent); stroke: #0f172a; }
.piano-svg .pk-dot { fill: var(--accent); }
.piano-svg .pk-dot-b { fill: #ffffff; }

/* Playable piano (mouse / touch / laptop keys / phone keyboard) */
.review-tip { flex-wrap: nowrap !important; align-items: center; text-decoration: none; color: inherit; }
.review-tip:hover { border-color: var(--accent); }
.songbook-tip { flex-wrap: nowrap !important; align-items: center; text-decoration: none; color: inherit; }
.songbook-tip .grow { min-width: 0; }
.songbook-tip:hover { border-color: var(--accent); }
.piano-play { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.piano-play-head { display: grid; gap: 2px; margin-bottom: 10px; font-size: 14px; }
.piano-play-head small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.piano-play-keys { --whites: 15; --ww: calc(100% / var(--whites)); position: relative; height: 150px; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.pp-key { position: absolute; top: 0; padding: 0; font: inherit; cursor: pointer; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; -webkit-tap-highlight-color: transparent; }
.pp-w { left: calc(var(--i) * var(--ww)); width: var(--ww); height: 100%; background: #fff; border: 1px solid #cbd5e1; border-radius: 0 0 7px 7px; color: #475569; padding-bottom: 8px; z-index: 1; }
.pp-b { left: calc(var(--i) * var(--ww) - var(--ww) * .3); width: calc(var(--ww) * .6); height: 60%; background: #1e293b; border: 1px solid #0f172a; border-radius: 0 0 5px 5px; color: #e2e8f0; padding-bottom: 6px; z-index: 2; }
.pp-key kbd { font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; background: none; border: 0; padding: 0; opacity: .85; }
.pp-note { font-size: 10.5px; font-weight: 700; opacity: .55; }
.pp-w.is-down, .pp-w:active { background: color-mix(in srgb, var(--accent) 30%, #fff); border-color: var(--accent); }
.pp-b.is-down, .pp-b:active { background: var(--accent); }
.piano-type { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.piano-type input { flex: 1; min-width: 0; padding: 8px 12px; border-radius: 10px; }
@media (max-width: 560px) { .piano-play-keys { height: 120px; } .pp-note { display: none; } .pp-key kbd { font-size: 9.5px; } }
@media (pointer: fine) { .piano-type { display: none; } }

.song-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--surface-2); }

/* What you type, next to what singers see */
.lyric-example { display: grid; gap: 12px; }
.lyric-example-card { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.lyric-example-card h3 { margin: 0; font-size: 14.5px; }
.lyric-example-card .cols { display: grid; gap: 10px; }
@media (min-width: 760px) { .lyric-example-card .cols { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); align-items: start; } }
.lyric-typed { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; }
.lyric-example .seen { padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.lyric-example .song-body { padding: 0; --song-fs: 15.5px; }
.lyric-example .col-lbl { display: block; margin-bottom: 6px; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

/* Song Add/Edit & Upload Dialog helpers */
.song-occ-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.song-occ-pick { margin: 0; cursor: pointer; }
.song-occ-pick input { display: none; }
.song-occ-pick span { display: inline-block; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--ink-2); transition: all .12s; }
.song-occ-pick input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, var(--surface)); color: var(--accent); }
.ch-quick-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.ch-ins-btn { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 7px; padding: 3px 8px; font: 700 12px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; cursor: pointer; }
.ch-ins-btn:hover { border-color: var(--accent); color: var(--accent); }
.mono-chords { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important; font-size: 13.5px !important; }
.su-templates { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.su-guide { display: grid; gap: 12px; margin-bottom: 16px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 8%, var(--surface)), var(--surface-2)); }
.su-guide-copy strong { display: block; font-size: 15px; margin-bottom: 4px; }
.su-guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 8px; }
.su-dl { display: flex; align-items: flex-start; gap: 10px; padding: 10px 11px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: inherit; text-decoration: none !important; transition: border-color .15s, transform .12s; }
.su-dl:hover { border-color: var(--accent); transform: translateY(-1px); }
.su-dl-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); }
.su-dl b { display: block; font-size: 13px; line-height: 1.25; }
.su-dl small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.su-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 5px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.su-step { border: 0; background: transparent; border-radius: 10px; padding: 9px 14px; font: 650 13.5px/1.1 var(--font-ui, var(--font)); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.su-step:hover { color: var(--ink); background: var(--surface-2); }
.su-step.on { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 35%, transparent); }
.p-14 { padding: 14px; }
.pt-18 { padding-top: 18px; }

@media (max-width: 560px) {
    .song-hero, .song-body, .song-foot { padding-left: 16px; padding-right: 16px; }
    .song-toolbar { padding: 10px 14px; }
    .piano-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
    .song-sheet-card { box-shadow: none !important; border: 0 !important; }
    .piano-card, .ly-block { break-inside: avoid; }
}
