/* ==========================================================================
   Ministério de Louvor: design system próprio (sem Bootstrap)
   Mobile first: estilos base valem para o celular; @media (min-width) amplia.
   Paleta: #EEF0F2 fundo · #21A179 verde (principal) · #2F4858 ardósia · #E54B4B vermelho
   Temas: claro (padrão) e escuro em <html data-theme="dark">; o script no <head> resolve a preferência
   (claro / escuro / sistema) antes de pintar. Cores só por variável: nada de hex solto nos componentes.
   ========================================================================== */

:root {
  --bg: #eef0f2;
  --surface: #ffffff;
  --surface-2: #f6f7f8;
  --line: #dde1e5;
  --line-strong: #c6ccd2;

  --ink: #0f1417;          /* texto principal: preto */
  --ink-2: #2f4858;        /* ardósia: texto secundário colorido */
  --muted: #5f6f7a;
  --faint: #8c99a3;

  --primary: #21a179;
  --primary-strong: #1a8662;
  --primary-ink: #13704f;  /* verde para texto (contraste AA) */
  --primary-soft: #e2f4ed;

  --info: #2f4858;
  --info-soft: #e3e9ed;
  --violet: #6d4fa3;
  --violet-soft: #eee8f7;

  --danger: #e54b4b;
  --danger-strong: #cc3a3a;
  --danger-ink: #b42f2f;
  --danger-soft: #fde8e8;

  --warning: #e0a526;
  --warning-ink: #8a5a00;
  --warning-soft: #fdf3dc;

  --neutral-soft: #eceef0;

  /* Bordas suaves de cada tom (alertas, chips, botões de escolha) */
  --primary-line: #b5e2d2;
  --primary-soft-hover: #cfeee2;
  --warning-line: #f1d79a;
  --danger-line: #f3b5b5;
  --info-line: #c9d4db;
  --info-ink: #2f4858;     /* ardósia para texto */
  --info-strong: #1f3340;

  --on-primary: #fff;
  --on-warning: #0f1417;
  --chrome: rgba(255, 255, 255, .88);      /* barra superior translúcida */
  --seg-bg: #e4e8eb;
  --seg-active: #ffffff;
  --card-border: rgba(47, 72, 88, .08);
  --scrim: rgba(15, 20, 23, .4);
  --ring: rgba(33, 161, 121, .18);
  --tom-bg: #0f1417;
  --tom-ink: #fff;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%232f4858' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 1px 2px rgba(15, 20, 23, .04), 0 2px 10px rgba(47, 72, 88, .05);
  --shadow-lg: 0 12px 40px rgba(15, 20, 23, .18);

  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --topbar-h: 56px;
  --tabbar-h: 64px;
  --sidebar-w: 264px;
  --gutter: 16px;
  --tap: 44px;             /* alvo de toque mínimo */

  color-scheme: light;
}

/* Tema escuro: ardósia profunda, verde da marca mais claro para texto */
:root[data-theme="dark"] {
  --bg: #0d1316;
  --surface: #151c21;
  --surface-2: #1b242a;
  --line: #263139;
  --line-strong: #34424c;

  --ink: #e7ecef;
  --ink-2: #a9bbc8;
  --muted: #8796a1;
  --faint: #66747e;

  --primary: #21a179;
  --primary-strong: #2bb98c;
  --primary-ink: #55d3a8;
  --primary-soft: #143329;

  --info: #3b5a6e;
  --info-soft: #1b2932;
  --violet: #b9a2e6;
  --violet-soft: #262039;

  --danger: #e54b4b;
  --danger-strong: #f06262;
  --danger-ink: #ff8f8f;
  --danger-soft: #36191b;

  --warning: #e0a526;
  --warning-ink: #f2c560;
  --warning-soft: #33280f;

  --neutral-soft: #222c33;

  --primary-line: #22513f;
  --primary-soft-hover: #1a4234;
  --warning-line: #5a4517;
  --danger-line: #5e2a2c;
  --info-line: #2f4553;
  --info-ink: #a9c3d4;
  --info-strong: #4a6d83;

  --chrome: rgba(21, 28, 33, .85);
  --seg-bg: #11181c;
  --seg-active: #243038;
  --card-border: rgba(255, 255, 255, .06);
  --scrim: rgba(0, 0, 0, .6);
  --ring: rgba(85, 211, 168, .25);
  --tom-bg: #e7ecef;
  --tom-ink: #0d1316;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23a9bbc8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, .55);

  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: 1.5rem; font-weight: 800; }
h2 { font-size: 1.125rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
a { color: var(--primary-ink); text-decoration: none; font-weight: 600; }
a:hover { color: var(--primary-strong); text-decoration: underline; }
small, .small { font-size: .8125rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
pre { margin: 0; font-family: var(--mono); font-size: .8125rem; white-space: pre-wrap; }
ol, ul { margin: 0; }
img { max-width: 100%; }
audio { display: block; width: 100%; height: 40px; margin-top: .5rem; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }

/* ---------- Utilitários ---------- */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.slate { color: var(--ink-2); }
.text-primary { color: var(--primary-ink); }
.text-danger { color: var(--danger-ink); }
.text-warning { color: var(--warning-ink); }
.text-success { color: var(--primary-ink); }
.strong { font-weight: 700; }
.italic { font-style: italic; }
.strike { text-decoration: line-through; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.block { display: block; }
.mono, .tom { font-family: var(--mono); }
.tom { font-weight: 700; color: var(--ink-2); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mt-1 { margin-top: .25rem; } .mt-2 { margin-top: .5rem; } .mt-3 { margin-top: 1rem; } .mt-4 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: .5rem; } .mb-3 { margin-bottom: 1rem; } .mb-4 { margin-bottom: 1.5rem; }
.grow { flex: 1 1 auto; min-width: 0; }
.dimmed { opacity: .55; }

/* Exibição por tamanho de tela */
.md-show { display: none !important; }
@media (min-width: 768px) {
  .md-show { display: revert !important; }
  .md-hide { display: none !important; }
}

/* Layout de fluxo */
.stack > * + * { margin-top: var(--stack, 1rem); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--gap, .5rem); align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.row-between.top { align-items: flex-start; }

.grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) {
  .grid-sm-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .grid { gap: 1.25rem; }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .grid-main-wide { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .grid-side { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .span-all { grid-column: 1 / -1; }
}
.narrow { max-width: 720px; margin-inline: auto; }
.narrower { max-width: 440px; margin-inline: auto; }

/* ==========================================================================
   Estrutura do app: barra superior + barra de abas (celular) / menu lateral (desktop)
   ========================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
  display: flex; align-items: center; gap: .5rem; padding: 0 var(--gutter);
  background: var(--chrome); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); font-weight: 800; font-size: 1.05rem; }
.brand:hover { color: var(--ink); text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--primary); color: var(--on-primary); font-size: 1.15rem;
}
.topbar .spacer { flex: 1; }

.app-main {
  padding: 1.25rem var(--gutter) calc(var(--tabbar-h) + 1.5rem + env(safe-area-inset-bottom));
  max-width: 1200px; margin: 0 auto;
}
.app-main.solo { padding-bottom: 2rem; }

/* Barra de abas inferior (celular) */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
  background: var(--chrome); backdrop-filter: saturate(1.4) blur(12px);
}
.tabbar a, .tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font: inherit; font-size: .6875rem; font-weight: 600;
  background: none; border: 0; cursor: pointer; text-decoration: none;
}
.tabbar i { font-size: 1.4rem; }
.tabbar .active { color: var(--primary-ink); }
.tabbar .active i { background: var(--primary-soft); border-radius: 999px; padding: 2px 14px; }

/* Menu lateral: gaveta no celular, fixo no desktop */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 60; width: min(86vw, 320px);
  background: var(--surface); overflow-y: auto; padding: 1rem .75rem 2rem;
  transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg);
}
.menu-aberto .sidebar { transform: none; }
.scrim {
  position: fixed; inset: 0; z-index: 50; background: var(--scrim);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.menu-aberto .scrim { opacity: 1; pointer-events: auto; }
.menu-aberto { overflow: hidden; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 .5rem 1rem; }

.nav-group + .nav-group { margin-top: 1rem; }
.nav-label {
  padding: 0 .75rem .35rem; font-size: .6875rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--faint);
}
.nav-label.admin { color: var(--danger-ink); }
/* Seletor de ministério no menu */
.nav-troca { display: grid; gap: .3rem; padding: 0 .75rem; }
.nav-troca .nav-label { padding: 0; }
.nav-troca select { width: 100%; }
.nav-link {
  display: flex; align-items: center; gap: .7rem; width: 100%;
  min-height: 42px; padding: .5rem .75rem; border-radius: 10px; border: 0; background: none;
  color: var(--ink); font: inherit; font-weight: 600; text-align: left; cursor: pointer;
}
.nav-link i { font-size: 1.2rem; color: var(--ink-2); }
.nav-link:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav-link.active { background: var(--primary-soft); color: var(--primary-ink); }
.nav-link.active i { color: var(--primary-ink); }

.user-chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 999px;
  background: var(--info); color: #fff; font-weight: 700; font-size: .875rem;
}
.user-chip:hover { color: #fff; text-decoration: none; background: var(--info-strong); }

@media (min-width: 1024px) {
  .tabbar, .menu-btn, .sidebar-close, .scrim { display: none !important; }
  .sidebar {
    transform: none; box-shadow: none; width: var(--sidebar-w);
    top: var(--topbar-h); border-right: 1px solid var(--line); background: transparent;
  }
  .app-shell .app-main { margin-left: var(--sidebar-w); padding: 2rem 2rem 3rem; }
  .app-shell .sidebar-head { display: none; }
  .topbar { padding: 0 1.5rem; }
  .menu-aberto { overflow: auto; }
}
@media (min-width: 1440px) {
  .app-shell .app-main { margin-left: calc(var(--sidebar-w) + max(0px, (100vw - var(--sidebar-w) - 1200px) / 2 - 2rem)); margin-right: auto; }
}

/* ==========================================================================
   Componentes
   ========================================================================== */

/* Cabeçalho de página */
.page-head { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.25rem; }
.page-head .meta { color: var(--ink-2); margin-top: .35rem; }
.page-head .meta i { color: var(--primary-ink); }
.page-head .actions { display: flex; flex-wrap: wrap; gap: .5rem; }
/* Celular: ações do cabeçalho dividem a linha (alvos grandes, fáceis de alcançar com o polegar) */
@media (max-width: 639px) {
  .page-head .actions { width: 100%; }
  .page-head .actions > .btn { flex: 1 1 0; min-height: var(--tap); }
  .page-head > .btn { align-self: stretch; min-height: var(--tap); }
}
.page-intro { color: var(--muted); max-width: 70ch; }
@media (min-width: 640px) {
  .page-head { flex-direction: row; justify-content: space-between; align-items: flex-start; }
  .page-head.center-y { align-items: center; }
  h1 { font-size: 1.75rem; }
}
.back-link { display: inline-flex; align-items: center; gap: .3rem; font-size: .8125rem; margin-bottom: .35rem; color: var(--ink-2); }
.eyebrow { font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: .75rem 0 .25rem; }

/* Cartão */
.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--card-border); overflow: hidden; display: flex; flex-direction: column;
}
a.card { color: inherit; font-weight: inherit; transition: transform .15s, box-shadow .15s; }
a.card:hover { text-decoration: none; border-color: var(--line-strong); }
@media (hover: hover) { a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); } }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .9rem 1rem; border-bottom: 1px solid var(--line);
}
.card-title { display: flex; align-items: center; gap: .5rem; font-size: .9375rem; font-weight: 700; margin: 0; }
.card-title i { color: var(--primary); font-size: 1.15rem; }
.card-head a:not(.btn) { font-size: .8125rem; }
.card-body { padding: 1rem; }
.card-foot { padding: .75rem 1rem; border-top: 1px solid var(--line); background: var(--surface-2); font-size: .8125rem; }
.card.accent-primary { border-top: 4px solid var(--primary); }
.card.accent-warning { border-top: 4px solid var(--warning); }
.card.accent-danger { border-top: 4px solid var(--danger); }
.card.accent-info { border-top: 4px solid var(--info); }
.card.dashed { border: 2px dashed var(--line-strong); box-shadow: none; background: transparent; }
.card.dashed .card-head { border-bottom-style: dashed; }
@media (min-width: 640px) { .card-head, .card-body { padding-inline: 1.25rem; } }

/* Lista */
.list { list-style: none; margin: 0; padding: 0; }
.list-item {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .8rem 1rem; border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 400;
}
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
a.list-item .title, .list-item .title { font-weight: 700; color: var(--ink); }
.list-item.top { align-items: flex-start; }
.list-item.col { flex-direction: column; align-items: stretch; }
.list-item.tone-success { background: var(--primary-soft); }
.list-item.tone-danger { background: var(--danger-soft); color: var(--danger-ink); }
.list-empty { padding: 1rem; color: var(--muted); font-size: .875rem; }
.list-num { counter-reset: n; }
.list-num > .list-item { counter-increment: n; }
.list-num > .list-item::before {
  content: counter(n); flex: 0 0 auto; display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 999px; background: var(--primary-soft);
  color: var(--primary-ink); font-weight: 800; font-size: .75rem;
}
@media (min-width: 640px) { .list-item { padding-inline: 1.25rem; } }

/* Itens de lista dentro de cartões soltos (listas fora de card) */
.list-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 42px; padding: .5rem 1rem; border-radius: 10px; border: 1.5px solid transparent;
  font: inherit; font-weight: 700; font-size: .875rem; line-height: 1.2; white-space: nowrap;
  cursor: pointer; text-decoration: none; transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
  background: var(--surface); color: var(--ink); border-color: var(--line-strong);
}
.btn:hover { text-decoration: none; border-color: var(--ink-2); color: var(--ink); }
.btn i { font-size: 1.1em; }
.btn:disabled, .btn.disabled { opacity: .45; pointer-events: none; }
.btn-sm { min-height: 34px; padding: .3rem .7rem; font-size: .8125rem; border-radius: 8px; }
.btn-xs { min-height: 28px; padding: .1rem .55rem; font-size: .8125rem; border-radius: 7px; }
.btn-icon { padding-inline: 0; width: 42px; }
.btn-sm.btn-icon { width: 34px; }
.btn-xs.btn-icon { width: 28px; }
.btn-block { display: flex; width: 100%; }
.btn-lg { min-height: 52px; padding: .75rem 1.25rem; font-size: 1rem; border-radius: 12px; }

.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: 0 2px 8px rgba(33, 161, 121, .22); }
.btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); color: var(--on-primary); }
.btn-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary-ink); }
.btn-soft:hover { background: var(--primary-soft-hover); border-color: transparent; color: var(--primary-ink); }
.btn-dark { background: var(--info); border-color: var(--info); color: #fff; }
.btn-dark:hover { background: var(--info-strong); border-color: var(--info-strong); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-strong); border-color: var(--danger-strong); color: #fff; }
.btn-danger-outline { color: var(--danger-ink); border-color: var(--danger-line); }
.btn-danger-outline:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger-ink); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; color: var(--ink); }
.btn-ghost.danger { color: var(--danger-ink); }
.btn-ghost.danger:hover { background: var(--danger-soft); }
.btn-link { background: none; border: 0; padding: 0; min-height: 0; color: var(--primary-ink); }
.btn-link:hover { text-decoration: underline; color: var(--primary-strong); }

/* Botões de escolha com tom (disponibilidade, confirmação) */
.btn-choice.tone-success { color: var(--primary-ink); border-color: var(--primary-line); }
.btn-choice.tone-warning { color: var(--warning-ink); border-color: var(--warning-line); }
.btn-choice.tone-danger { color: var(--danger-ink); border-color: var(--danger-line); }
.btn-choice.tone-success:hover, .btn-choice.tone-success.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-choice.tone-warning:hover, .btn-choice.tone-warning.on { background: var(--warning); border-color: var(--warning); color: var(--on-warning); }
.btn-choice.tone-danger:hover, .btn-choice.tone-danger.on { background: var(--danger); border-color: var(--danger); color: #fff; }

.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.btn-group { display: inline-flex; gap: 2px; }
.btn-group form { display: contents; }

/* Selos */
.badge {
  display: inline-flex; align-items: center; gap: .25rem; vertical-align: middle;
  padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; line-height: 1.4;
  background: var(--neutral-soft); color: var(--ink-2); white-space: nowrap;
}
a.badge:hover { text-decoration: none; filter: brightness(.96); }
.badge i { font-size: 1em; }
.badge.lg { font-size: .875rem; padding: .25rem .7rem; }
.tone-primary.badge, .tone-success.badge { background: var(--primary-soft); color: var(--primary-ink); }
.tone-info.badge { background: var(--info-soft); color: var(--info-ink); }
.tone-accent.badge, .tone-danger.badge { background: var(--danger-soft); color: var(--danger-ink); }
.tone-warning.badge { background: var(--warning-soft); color: var(--warning-ink); }
.tone-violet.badge { background: var(--violet-soft); color: var(--violet); }
.tone-neutral.badge { background: var(--neutral-soft); color: var(--ink-2); }
.badge.solid { background: var(--info); color: #fff; }
.badge.solid.tone-primary { background: var(--primary); color: #fff; }
.badge.tom-badge { font-family: var(--mono); background: var(--tom-bg); color: var(--tom-ink); font-size: .875rem; border-radius: 8px; padding: .2rem .55rem; }
.badge.outline { background: transparent; border: 1px solid var(--line-strong); color: var(--ink-2); }

/* Chip de pessoa */
.chip {
  display: inline-flex; align-items: center; gap: .35rem; max-width: 100%;
  padding: .3rem .35rem .3rem .65rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); font-size: .875rem; font-weight: 600; color: var(--ink);
}
.chip.no-x { padding-right: .65rem; }
.chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip form { display: inline-flex; }
.chip .x {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 999px; border: 0;
  background: transparent; color: var(--muted); cursor: pointer; font-size: .85rem;
}
.chip .x:hover { background: var(--danger-soft); color: var(--danger-ink); }
.chip.tone-success { background: var(--primary-soft); border-color: var(--primary-line); }
.chip.tone-danger { background: var(--danger-soft); border-color: var(--danger-line); }
.chip.tone-danger > span { text-decoration: line-through; }
.chip i.st-ok { color: var(--primary); }
.chip i.st-no { color: var(--danger); }
.chip i.st-wait { color: var(--warning); }

/* Alertas */
.alert {
  position: relative; display: flex; gap: .65rem; align-items: flex-start;
  padding: .85rem 1rem; border-radius: var(--radius); margin-bottom: 1rem;
  background: var(--surface); border: 1px solid var(--line); border-left-width: 4px; font-size: .9rem;
}
.alert > i { font-size: 1.2rem; line-height: 1.2; }
.alert .grow { line-height: 1.45; }
.alert a { white-space: nowrap; }
.alert.tone-success, .alert.tone-primary { border-color: var(--primary-line); border-left-color: var(--primary); background: var(--primary-soft); }
.alert.tone-success > i, .alert.tone-primary > i { color: var(--primary-ink); }
.alert.tone-warning { border-color: var(--warning-line); border-left-color: var(--warning); background: var(--warning-soft); }
.alert.tone-warning > i { color: var(--warning-ink); }
.alert.tone-danger { border-color: var(--danger-line); border-left-color: var(--danger); background: var(--danger-soft); }
.alert.tone-danger > i { color: var(--danger-ink); }
.alert.tone-info { border-color: var(--info-line); border-left-color: var(--info); background: var(--info-soft); }
.alert.tone-info > i { color: var(--info-ink); }
.alert.flat { border-radius: 0; border-width: 0 0 1px 0; margin: 0; }
.alert .fechar {
  display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; margin: -.35rem -.4rem -.35rem auto;
  background: none; border: 0; border-radius: 999px; cursor: pointer; color: var(--muted); font-size: 1.1rem;
}
.alert .fechar:hover { background: color-mix(in srgb, currentColor 10%, transparent); }

/* Formulários */
.field { margin-bottom: 1rem; }
.label { display: block; margin-bottom: .35rem; font-size: .8125rem; font-weight: 700; color: var(--ink-2); }
.label .req { color: var(--danger); }
.help { margin-top: .3rem; font-size: .8125rem; color: var(--muted); }
.help ul { padding-left: 1.1rem; }
.error { margin-top: .3rem; font-size: .8125rem; color: var(--danger-ink); font-weight: 600; }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
legend { padding: 0; }

.input, input[type=text], input[type=email], input[type=password], input[type=number], input[type=search],
input[type=date], input[type=datetime-local], input[type=time], input[type=url], input[type=tel], select, textarea {
  display: block; width: 100%; min-height: 44px; padding: .55rem .8rem;
  border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--surface);
  color: var(--ink); font: inherit; font-size: 16px; /* 16px evita zoom no iOS */
  transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none;
}
select {
  padding-right: 2.2rem; cursor: pointer;
  background-image: var(--select-arrow);
  background-repeat: no-repeat; background-position: right .8rem center;
}
select[multiple] { background-image: none; padding-right: .8rem; min-height: 8rem; }
textarea { min-height: 6rem; resize: vertical; line-height: 1.5; }
textarea.mono { font-family: var(--mono); font-size: .875rem; }
input[type=file] { display: block; width: 100%; font: inherit; font-size: .875rem; padding: .5rem 0; }
input[type=file]::file-selector-button {
  margin-right: .75rem; padding: .5rem .9rem; border-radius: 8px; border: 0;
  background: var(--primary-soft); color: var(--primary-ink); font: inherit; font-weight: 700; cursor: pointer;
}
.input:focus, input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring);
}
.input-sm, select.input-sm, input.input-sm { min-height: 36px; padding-block: .3rem; font-size: .875rem; border-radius: 8px; }
@media (min-width: 768px) {
  .input, input, select, textarea { font-size: .9375rem; }
  .input-sm, select.input-sm, input.input-sm { font-size: .8125rem; }
}

input[type=checkbox], input[type=radio] {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto; width: 20px; height: 20px; margin: 0;
  border: 1.5px solid var(--line-strong); border-radius: 6px; background: var(--surface);
  display: inline-grid; place-content: center; cursor: pointer; vertical-align: -4px;
}
input[type=radio] { border-radius: 999px; }
input[type=checkbox]::before {
  content: ""; width: 10px; height: 10px; transform: scale(0); transition: transform .12s;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); background: #fff;
}
input[type=radio]::before { content: ""; width: 8px; height: 8px; border-radius: 999px; transform: scale(0); background: #fff; transition: transform .12s; }
input[type=checkbox]:checked, input[type=radio]:checked { background: var(--primary); border-color: var(--primary); }
input[type=checkbox]:checked::before, input[type=radio]:checked::before { transform: scale(1); }
.check-row { display: flex; align-items: flex-start; gap: .6rem; font-weight: 600; cursor: pointer; }
.check-row label { cursor: pointer; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.check-grid .check-row {
  padding: .6rem .7rem; border: 1.5px solid var(--line); border-radius: 10px; font-size: .875rem; align-items: center;
}
.check-grid .check-row:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
@media (min-width: 768px) { .check-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.form-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.form-actions .btn { flex: 1 1 auto; }
@media (min-width: 640px) { .form-actions .btn { flex: 0 0 auto; } }

/* Campo + botão grudados */
.join { display: flex; align-items: stretch; width: 100%; }
.join > select, .join > input { border-radius: 10px 0 0 10px; min-width: 0; flex: 1 1 auto; }
.join > .btn { border-radius: 0 10px 10px 0; flex: 0 0 auto; }
.join > .addon {
  display: grid; place-items: center; padding: 0 .65rem; border: 1.5px solid var(--line-strong); border-right: 0;
  border-radius: 10px 0 0 10px; background: var(--surface-2); color: var(--ink-2);
}
.join > .addon + input { border-radius: 0 10px 10px 0; }
.join.sm > select, .join.sm > input { min-height: 36px; padding-block: .3rem; font-size: .875rem; border-radius: 8px 0 0 8px; }
.join.sm > .btn { min-height: 36px; border-radius: 0 8px 8px 0; }
@media (min-width: 768px) { .join.sm > select, .join.sm > input { font-size: .8125rem; } }

/* Barra de filtros */
.filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin-bottom: 1rem; }
.filters > .full { grid-column: 1 / -1; }
.filters .btn { width: 100%; }
@media (min-width: 900px) {
  .filters { display: flex; flex-wrap: wrap; align-items: center; }
  .filters > * { flex: 1 1 140px; }
  .filters > .full { flex-basis: 100%; }
  .filters > .search { flex: 3 1 240px; }
  .filters > .btn, .filters > .actions { flex: 0 0 auto; width: auto; }
}
/* Celular: filtros recolhidos atrás de um botão (o JS marca o form com .recolhivel) */
.filters-top { display: flex; gap: .5rem; grid-column: 1 / -1; }
.filters-top > .search { flex: 1 1 auto; min-width: 0; }
.filters .filters-toggle { flex: 0 0 auto; width: auto; gap: .35rem; }
.filters .filters-top > .filters-toggle:only-child { flex: 1 1 auto; justify-content: flex-start; }
.filters-toggle .count {
  display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem; padding: 0 .35rem;
  border-radius: 99px; background: var(--primary); color: var(--on-primary); font-size: .75rem; font-weight: 800;
}
.filters-toggle .ph-caret-down { transition: transform .15s; }
.filters.aberto .filters-toggle .ph-caret-down { transform: rotate(180deg); }
.filters.aberto .filters-toggle { background: var(--primary-soft); border-color: transparent; color: var(--primary-ink); }
@media (max-width: 899px) {
  .filters.recolhivel:not(.aberto) > :not(.filters-top) { display: none; }
  .filters.recolhivel.aberto { padding: .75rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--card-border); box-shadow: var(--shadow); }
}
@media (min-width: 900px) {
  .filters-top { display: contents; }
  .filters-toggle { display: none !important; }
}
.search-box { position: relative; }
.search-box i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box input { padding-left: 2.4rem; }

/* Abas segmentadas */
.segmented {
  display: inline-flex; max-width: 100%; padding: 4px; gap: 4px; background: var(--seg-bg); border-radius: 12px;
  overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented a {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem; flex: 0 0 auto; min-height: 38px;
  padding: .4rem .9rem; border-radius: 9px; color: var(--ink-2); font-size: .875rem; font-weight: 700;
  white-space: nowrap; scroll-snap-align: start;
}
.segmented a:hover { text-decoration: none; color: var(--ink); }
.segmented a.active { background: var(--seg-active); color: var(--primary-ink); box-shadow: var(--shadow); }
/* No celular as abas ocupam a largura toda (dividem o espaço quando cabem; rolam quando não) */
@media (max-width: 639px) {
  .segmented { display: flex; width: 100%; }
  .segmented a { flex: 1 0 auto; }
}

/* Tabela */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th, .table td { padding: .7rem .9rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table thead th {
  font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); background: var(--surface-2); white-space: nowrap;
}
.table tbody tr:last-child > * { border-bottom: 0; }
.table.hover tbody tr:hover { background: var(--surface-2); }
.table .center { text-align: center; } .table .right { text-align: right; }
.table td.top, .table th.top { vertical-align: top; }
.table tr.divider > * { border-top: 2px solid var(--line-strong); }
.table tr.me { background: var(--primary-soft); }
.table tfoot td, .table tfoot th { background: var(--surface-2); font-weight: 700; font-size: .75rem; border-bottom: 0; }
.table-grid th, .table-grid td { border: 1px solid var(--line); }

/* Paginação */
.pager { display: flex; justify-content: center; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 1.25rem; font-size: .875rem; }
.pager .info { color: var(--muted); padding: 0 .5rem; }

/* Estatísticas */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.stat { padding: .85rem 1rem; border-radius: 12px; background: var(--surface-2); }
.stat .k { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat .v { font-size: 1.4rem; font-weight: 800; color: var(--ink); line-height: 1.3; }
.stat .v.tom { color: var(--primary-ink); }
.stat .v small { font-weight: 600; color: var(--muted); }
@media (min-width: 768px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Lista chave/valor */
.kv { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: .6rem 1rem; margin: 0; }
.kv dt { color: var(--muted); font-size: .8125rem; font-weight: 600; }
.kv dd { margin: 0; font-weight: 600; }

/* Cabeçalho de boas-vindas */
.hero {
  position: relative; overflow: hidden; margin-bottom: 1.25rem; padding: 1.25rem;
  border-radius: var(--radius-lg); color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, #1b8d69 55%, var(--info) 130%);
}
.hero h1 { color: #fff; font-size: 1.5rem; }
.hero p { margin: .25rem 0 0; color: rgba(255, 255, 255, .85); }
.hero::after {
  content: "\266B"; position: absolute; right: -10px; bottom: -48px; font-size: 10rem; line-height: 1;
  color: rgba(255, 255, 255, .1); pointer-events: none;
}
.hero .actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; position: relative; z-index: 1; }
.hero .btn { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .35); color: #fff; }
.hero .btn:hover { background: #fff; color: #13704f; }
@media (min-width: 640px) { .hero { padding: 1.75rem 2rem; } .hero h1 { font-size: 1.9rem; } }

/* Linha de evento */
.ev-date {
  flex: 0 0 auto; display: grid; place-items: center; width: 48px; height: 52px; border-radius: 12px;
  background: var(--primary-soft); color: var(--primary-ink); line-height: 1.05; text-align: center;
}
.ev-date b { font-size: 1.15rem; font-weight: 800; }
.ev-date span { font-size: .625rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.ev-date.tone-info { background: var(--info-soft); color: var(--info); }
.ev-date.tone-accent { background: var(--danger-soft); color: var(--danger-ink); }
.ev-date.tone-warning { background: var(--warning-soft); color: var(--warning-ink); }
.ev-date.tone-violet { background: var(--violet-soft); color: var(--violet); }
.ev-date.tone-neutral { background: var(--neutral-soft); color: var(--ink-2); }
.ev-row { display: flex; gap: .85rem; align-items: center; min-width: 0; }
.ev-row .info { min-width: 0; }
.ev-row .sub { color: var(--muted); font-size: .8125rem; }

/* Calendário (grade no desktop) */
.cal-legend { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .75rem; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cal .dow { padding: .55rem; text-align: center; font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cal .cell { min-height: 7.5rem; padding: .4rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.cal .cell:nth-child(7n) { border-right: 0; }
.cal .cell.empty { background: var(--surface-2); }
.cal .cell.hoje { background: var(--primary-soft); }
.cal .dia { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 999px; font-size: .8125rem; font-weight: 700; color: var(--ink-2); }
.cal .hoje .dia { background: var(--primary); color: #fff; }
.cal .add { color: var(--faint); font-size: 1rem; opacity: 0; transition: opacity .15s; }
.cal .cell:hover .add { opacity: 1; }
.cal-evento {
  display: block; margin-top: .25rem; padding: .2rem .4rem; border-radius: 6px; border-left: 3px solid;
  font-size: .75rem; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--primary-soft); border-color: var(--primary); color: var(--ink);
}
.cal-evento:hover { text-decoration: none; filter: brightness(.96); color: var(--ink); }
.cal-evento.tone-info { background: var(--info-soft); border-color: var(--info); }
.cal-evento.tone-accent { background: var(--danger-soft); border-color: var(--danger); }
.cal-evento.tone-warning { background: var(--warning-soft); border-color: var(--warning); }
.cal-evento.tone-violet { background: var(--violet-soft); border-color: var(--violet); }
.cal-evento.tone-neutral { background: var(--neutral-soft); border-color: var(--faint); }

/* Detalhe do evento: escala separada por ministério */
.escala-ministerio + .escala-ministerio { margin-top: 1rem; padding-top: .85rem; border-top: 1px dashed var(--line); }

/* Montagem de escala / grupos: linha por função */
.pos { padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.pos:last-child { border-bottom: 0; }
.pos-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.pos-name { font-weight: 800; }
.stepper { display: inline-flex; align-items: center; gap: .35rem; font-size: .8125rem; color: var(--ink-2); font-weight: 600; }
.stepper form { display: inline-flex; }
.slot { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .55rem; }
.slot:last-child { margin-bottom: 0; }
.slot-label { font-size: .75rem; font-weight: 700; color: var(--muted); }
.slot .join { max-width: 26rem; }
.slot-empty { font-size: .8125rem; color: var(--faint); }
@media (min-width: 640px) {
  .pos { padding-inline: 1.25rem; }
  .slot { flex-direction: row; align-items: center; gap: .75rem; }
  .slot-label { flex: 0 0 7rem; }
}
@media (min-width: 900px) {
  .pos.inline { display: grid; grid-template-columns: 11rem minmax(0, 1fr) 18rem; gap: 1rem; align-items: center; }
  .pos.inline .pos-head { margin: 0; }
}
.mic-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
.mic-tag { display: inline-flex; align-items: center; gap: .3rem; font-weight: 800; color: var(--ink-2); min-width: 4.5rem; }
.mic-form { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: .5rem; padding: 1rem; background: var(--surface-2); }
.mic-form .membro { grid-column: 1 / -1; }
@media (min-width: 640px) {
  .mic-row { padding-inline: 1.25rem; }
  .mic-form { grid-template-columns: 6.5rem 12rem minmax(0, 1fr) auto; padding-inline: 1.25rem; }
  .mic-form .membro { grid-column: auto; }
}

/* Escala do evento */
.escala-item { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.escala-item:last-child { border-bottom: 0; }
.escala-item .who { min-width: 0; }
.escala-item .side { display: flex; align-items: center; gap: .25rem; flex: 0 0 auto; }

/* Responder escala / disponibilidade */
.respond { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; width: 100%; }
.respond input[type=text] { flex: 1 1 100%; }
.respond .btn { flex: 1 1 0; }
@media (min-width: 768px) {
  .respond { width: auto; }
  .respond input[type=text] { flex: 0 1 15rem; }
  .respond .btn { flex: 0 0 auto; }
}

/* Slides */
.slide-card { padding: .75rem; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); height: 100%; }
.slide-card .n { font-size: .75rem; font-weight: 700; color: var(--primary-ink); margin-bottom: .25rem; }
.slide-card .t { font-size: .875rem; white-space: pre-line; }

/* Cifra */
.cifra { white-space: pre-wrap; font-family: var(--mono); font-size: .875rem; line-height: 1.6; overflow-x: auto; }

/* Login */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem var(--gutter); }
.auth-card { width: 100%; max-width: 420px; }
.auth-logo { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 18px; background: var(--primary); font-size: 2rem; color: var(--on-primary); box-shadow: 0 8px 24px rgba(33, 161, 121, .3); }
.auth h1 { text-align: center; font-size: 1.4rem; }
.auth .sub { text-align: center; color: var(--muted); margin-bottom: 1.5rem; }
.auth .foot { text-align: center; margin-top: 1rem; font-size: .875rem; color: var(--muted); }

/* Toque: alvos de pelo menos 40–44px (diretrizes de acessibilidade de iOS/Android) */
@media (pointer: coarse) {
  .btn { min-height: var(--tap); }
  .btn-sm { min-height: 40px; }
  .btn-sm.btn-icon { width: 40px; }
  .btn-xs { min-height: 34px; }
  .btn-xs.btn-icon { width: 34px; }
  .btn-icon { width: var(--tap); }
  .btn-link { min-height: 0; }
  .input-sm, select.input-sm, input.input-sm, .join.sm > select, .join.sm > input, .join.sm > .btn { min-height: 40px; }
  .chip .x { width: 30px; height: 30px; }
  .nav-link { min-height: 46px; }
  a.list-item { min-height: 56px; }
  .pager .btn { min-width: 7rem; }
}

/* Grupo: no desktop a linha vira 3 colunas (função · integrantes · adicionar) */
@media (min-width: 900px) { .pos.inline > .mt-2 { margin-top: 0; } }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary .card-title::after { content: "▾"; color: var(--muted); margin-left: .25rem; font-size: .8rem; }
details[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 1rem; }

/* ==========================================================================
   Cifras: versões, seletor de tom e leitura
   ========================================================================== */
[x-cloak] { display: none !important; }

.cifra-painel { scroll-margin-top: calc(var(--topbar-h) + 4.5rem); }
.cifra-painel.htmx-request .cifra-corpo { opacity: .45; transition: opacity .15s; }
.cifra-num {
  display: inline-grid; place-items: center; flex: 0 0 auto; width: 28px; height: 28px; border-radius: 999px;
  background: var(--primary); color: #fff; font-size: .8125rem; font-weight: 800;
}

.cifra-versoes { display: flex; gap: .35rem; overflow-x: auto; padding: .75rem 1rem 0; scrollbar-width: none; }
.cifra-versoes a {
  padding: .35rem .85rem; border-radius: 999px; background: var(--surface-2); border: 1.5px solid var(--line);
  color: var(--ink-2); font-size: .8125rem; white-space: nowrap;
}
.cifra-versoes a:hover { text-decoration: none; border-color: var(--primary); color: var(--primary-ink); }
.cifra-versoes a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.cifra-versoes a b { font-family: var(--mono); margin-left: .15rem; }
.cifra-versoes a i { color: var(--warning); }
.cifra-versoes a.active i, .cifra-versoes a.active b { color: #fff; }

/* Página da música: todas as versões lado a lado (empilhadas no celular) */
.cifras-lado { scroll-margin-top: calc(var(--topbar-h) + 1rem); }
.cifras-lado-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); align-items: start; margin-top: .75rem; }
@media (min-width: 900px) { .cifras-lado-grid { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); } }
.cifras-lado .cifra-texto { overflow-x: auto; }

.cifra-tom { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.cifra-tom-seletor { display: flex; align-items: center; gap: .4rem; }
.cifra-tom form { display: inline-flex; gap: .25rem; }
.tom-select { width: auto; min-width: 5.25rem; font-family: var(--mono); font-weight: 700; color: var(--primary-ink); text-align: center; }
.cifra-atalhos { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip-tom {
  display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .7rem; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface); font-size: .75rem; font-weight: 600; color: var(--ink-2);
}
.chip-tom b { font-family: var(--mono); color: var(--primary-ink); }
.chip-tom:hover { text-decoration: none; border-color: var(--primary); color: var(--ink); }
.chip-tom.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
@media (min-width: 768px) { .cifra-atalhos { margin-left: auto; } }

.cifra-corpo { padding-inline: .75rem; }
@media (min-width: 640px) { .cifra-corpo { padding-inline: 1.25rem; } }
.cifra-texto { font-family: var(--mono); font-size: var(--cifra-fs, 15px); line-height: 1.35; color: var(--ink); }
.cifra-texto .l { min-height: 1.35em; white-space: pre-wrap; }
.cifra-texto .l.vazia { min-height: .9em; }
.cifra-texto .l.rotulo { color: var(--danger-ink); font-weight: 800; margin-top: .5em; }
.cifra-texto .l.modulacao { margin: .5em 0 .25em; color: var(--ink-2); font-weight: 700; font-family: var(--font); font-size: .875em; }
.cifra-texto .l.modulacao .ac { font-family: var(--mono); color: var(--primary-ink); }
/* Linha com acordes: cada acorde fica em cima da sílaba; a linha quebra só entre palavras. */
.cifra-texto .l.acordes { display: flex; flex-wrap: wrap; align-items: flex-end; margin-top: .3em; white-space: normal; }
.cifra-texto .w { display: inline-flex; align-items: flex-end; }
.cifra-texto .s { display: inline-flex; flex-direction: column; }
.cifra-texto .t { white-space: pre; }
.cifra-texto .ac { min-height: 1.3em; padding-right: .45em; color: var(--primary-ink); font-weight: 800; white-space: nowrap; }
.cifra-texto .ac sup { font-size: .7em; }
.cifra-texto .so-acordes { margin-top: .5em; }
.cifra-texto .so-acordes .t { color: var(--ink-2); }
/* Modo de exibição dos acordes */
.cifra-texto .ac .g, .cifra-texto .ac .r { display: none; }
.modo-graus .cifra-texto .ac .n, .modo-romanos .cifra-texto .ac .n { display: none; }
.modo-graus .cifra-texto .ac .g, .modo-romanos .cifra-texto .ac .r { display: inline; }
.sem-acordes .cifra-texto .ac { display: none; }
.sem-acordes .cifra-texto .l.so-acordes, .sem-acordes .cifra-texto .l.modulacao { display: none; }
.sem-acordes .cifra-texto .l.acordes { margin-top: 0; }
pre.formato { padding: .75rem; border-radius: 10px; background: var(--surface-2); color: var(--ink); font-size: .8125rem; overflow-x: auto; }
.segmented button {
  padding: .35rem .7rem; border: 0; border-radius: 9px; background: none; cursor: pointer;
  color: var(--ink-2); font: inherit; font-size: .8125rem; font-weight: 700; white-space: nowrap;
}
.segmented button.active { background: var(--seg-active); color: var(--primary-ink); box-shadow: var(--shadow); }
.segmented.sm { padding: 3px; gap: 2px; }

.cifra-ferramentas {
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; margin-bottom: .75rem; padding: .4rem .5rem;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
}
.cifra-ferramentas .grupo { display: inline-flex; align-items: center; gap: .15rem; }
.cifra-ferramentas .btn-icon small { font-size: .7rem; margin-left: -2px; }

/* ---------- pedidos de música ---------- */
.scroll-x { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented .count {
  display: inline-grid; place-items: center; min-width: 1.35em; height: 1.35em; padding: 0 .35em; margin-left: .2em;
  border-radius: 99px; background: var(--neutral-soft); color: var(--ink-2); font-size: .75em; font-weight: 700;
}
.segmented a.active .count { background: var(--primary-soft); color: var(--primary-ink); }
.nav-count {
  margin-left: auto; min-width: 1.4rem; padding: 0 .4rem; border-radius: 99px; text-align: center;
  background: var(--warning-soft); color: var(--warning-ink); font-size: .75rem; font-weight: 800; line-height: 1.4rem;
}
.pedido { gap: .5rem; }
.pedido .link-ref { display: inline-flex; align-items: center; gap: .3rem; overflow-wrap: anywhere; }
.pedido-obs { margin: 0; padding: .5rem .75rem; border-left: 3px solid var(--line-strong); color: var(--ink-2); }
.pedido-resposta { padding: .5rem .75rem; border-radius: 10px; background: var(--surface-2); }
.pedido-resposta.tone-success { background: var(--primary-soft); color: var(--primary-ink); }
.pedido-resposta.tone-danger { background: var(--danger-soft); color: var(--danger-ink); }

/* ---------- temas ---------- */
.tag {
  display: inline-flex; align-items: center; gap: .15rem; padding: .2rem .6rem; border-radius: 99px;
  background: var(--primary-soft); color: var(--primary-ink); font-size: .8125rem; font-weight: 600; line-height: 1.4;
}
.tag i { font-size: .9em; opacity: .7; }
a.tag:hover { text-decoration: none; filter: brightness(.96); }
.tag.sm { padding: .05rem .45rem; font-size: .72rem; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.tag.lg { padding: .4rem .85rem; font-size: .9375rem; }
.tag .n { margin-left: .35rem; padding: 0 .4rem; border-radius: 99px; background: var(--surface); font-size: .75em; color: var(--ink-2); }
.tag.vazio { background: var(--surface-2); color: var(--muted); }
.list-item .tags { display: flex; }
.trecho { display: block; margin-top: .25rem; font-size: .8125rem; font-style: italic; color: var(--ink-2); }
.trecho i { color: var(--primary); font-style: normal; }
.sugestoes { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.sugestoes button { border: 1px dashed var(--line-strong); background: var(--surface); color: var(--ink-2); border-radius: 99px; padding: .15rem .6rem; font: inherit; font-size: .8125rem; cursor: pointer; }
.sugestoes button:hover { border-color: var(--primary); color: var(--primary-ink); background: var(--primary-soft); }

/* ---------- base bíblica / estudo ---------- */
.ref { padding: .85rem 1rem; border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: 12px; background: var(--surface); }
.ref + .ref { margin-top: .75rem; }
.ref-head { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; }
.ref-cit { display: inline-flex; align-items: center; gap: .35rem; font-weight: 800; color: var(--ink); }
.ref-cit i { color: var(--primary); }
.ref-acoes { margin-left: auto; display: inline-flex; }
.ref-trecho { margin: .5rem 0 0; font-style: italic; color: var(--ink-2); font-size: .9rem; }
.ref-trecho i { font-style: normal; color: var(--primary); }
.ref-texto { margin: .6rem 0 0; padding: .55rem .8rem; border-radius: 8px; background: var(--surface-2); font-family: Georgia, "Times New Roman", serif; font-size: .95rem; line-height: 1.55; color: var(--ink); }
.ref-coment { margin-top: .6rem; font-size: .9rem; line-height: 1.55; }
.ref-coment p, .estudo p { margin: 0 0 .5rem; }
.ref-coment p:last-child, .estudo p:last-child { margin-bottom: 0; }
.estudo { padding: .75rem 1rem; border-radius: 12px; background: var(--info-soft); line-height: 1.6; }
.estudo-musica .card-title .num {
  display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 99px;
  background: var(--primary); color: #fff; font-size: .8rem;
}
.estudo-musica .card-head { flex-wrap: wrap; }
@media print {
  .topbar, .sidebar, .tabbar, .scrim, .page-head .actions, .back-link { display: none !important; }
  .app-main { padding: 0 !important; margin: 0 !important; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* ---------- evento desmarcado ---------- */
.desmarcado .title, .desmarcado h1, .cal-evento.desmarcado { text-decoration: line-through; text-decoration-color: var(--danger); }
.list-item.desmarcado .ev-date, .cal-evento.desmarcado { opacity: .55; }
.list-item.desmarcado .sub { color: var(--muted); }

/* ---------- o que foi tocado ---------- */
.tocada-item { gap: .5rem; }
.tocada-item.nao-tocada .title { text-decoration: line-through; color: var(--muted); }
.tocada-campos { display: flex; flex-wrap: wrap; gap: .5rem; padding-left: 1.6rem; }
.tocada-campos select { flex: 1 1 10rem; }
.sticky-actions { position: sticky; bottom: calc(var(--tabbar-h, 0px) + .5rem); z-index: 5; padding: .75rem; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.list-item.nao-tocada .title { text-decoration: line-through; color: var(--muted); }
.escala-item.nao-tocada strong { text-decoration: line-through; color: var(--muted); }

/* ---------- participação ---------- */
.part { gap: .6rem; }
.part-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem .75rem; margin: 0; }
.part-grid dt { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.part-grid dd { margin: .1rem 0 0; font-weight: 700; font-size: .9rem; }
.part-grid dd small { display: block; font-weight: 500; color: var(--muted); font-size: .75rem; }
@media (min-width: 900px) { .part-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* ---------- seletor de tema ---------- */
.tema-toggle .ph-sun, :root[data-theme="dark"] .tema-toggle .ph-moon { display: none; }
:root[data-theme="dark"] .tema-toggle .ph-sun { display: inline; }
.tema-opcoes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 0 .75rem .25rem; padding: 4px; border-radius: 12px; background: var(--seg-bg); }
.tema-opcoes button {
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem; min-height: 38px; padding: 0 .4rem;
  border: 0; border-radius: 9px; background: none; color: var(--ink-2); font: inherit; font-size: .8125rem; font-weight: 700; cursor: pointer;
}
.tema-opcoes button[aria-pressed="true"] { background: var(--seg-active); color: var(--primary-ink); box-shadow: var(--shadow); }
.auth-tema { position: fixed; top: max(.75rem, env(safe-area-inset-top)); right: .75rem; z-index: 10; }

/* ---------- repertório do evento: acesso às cifras ---------- */
.rep-cifras { padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.rep-cifras.hoje { background: var(--primary-soft); }
.rep-cifras .btn { gap: .5rem; }
.rep-cifras .btn i { font-size: 1.35rem; }
.rep-cifras-n { margin-left: auto; font-size: .8125rem; font-weight: 600; opacity: .8; }
.rep-linha { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; margin-top: .5rem; }
.rep-cifra { max-width: 100%; }
.rep-cifra i { font-size: 1.15rem; }
.rep-versao { font-weight: 600; opacity: .8; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 640px) { .rep-cifras { padding-inline: 1.25rem; } }

/* ---------- página de cifras do evento: navegação entre músicas ---------- */
.cifra-musicas {
  display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity;
  margin-inline: calc(var(--gutter) * -1); padding: 0 var(--gutter) .1rem;
}
.cifra-musicas::-webkit-scrollbar { display: none; }
.cifra-musicas a {
  display: inline-flex; align-items: center; gap: .45rem; flex: 0 0 auto; max-width: 16rem; min-height: var(--tap);
  padding: .35rem .9rem .35rem .4rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface);
  color: var(--ink); font-size: .875rem; font-weight: 700; scroll-snap-align: start;
}
.cifra-musicas a:hover { text-decoration: none; border-color: var(--primary); }
.cifra-musicas b { font-family: var(--mono); color: var(--primary-ink); }
.cifra-musicas .cifra-num { width: 30px; height: 30px; }
.cifra-proxima { margin-top: .5rem; justify-content: space-between; gap: .75rem; }
.cifra-proxima .truncate { flex: 1 1 auto; text-align: left; }
.cifra-painel, .cifra-proxima { scroll-margin-top: calc(var(--topbar-h) + var(--cifras-topo-h, 4.5rem) + .75rem); }
/* Título da música no painel do evento: legível de relance (estante, pouca luz) */
.cifra-titulo { display: flex; flex-direction: column; line-height: 1.2; }
.card-head .cifra-titulo a.title { font-size: 1.125rem; font-weight: 800; color: var(--ink); }
.cifra-titulo .small { font-weight: 600; }
.cifra-painel .card-head .cifra-num { width: 34px; height: 34px; font-size: .9375rem; }
.cifra-proxima.topo { justify-content: center; }
@media (pointer: coarse) {
  .chip-tom { min-height: 36px; padding-inline: .85rem; font-size: .8125rem; }
  .cifra-versoes a { display: inline-flex; align-items: center; min-height: 38px; }
}

/* Cifra / Só letra: as duas opções sempre visíveis, a escolhida destacada */
.cifra-exibir button { display: inline-flex; align-items: center; gap: .35rem; min-height: 36px; padding-inline: .85rem; font-size: .875rem; }
.cifra-exibir button i { font-size: 1.1rem; }
.cifra-exibir button.active { background: var(--primary); color: var(--on-primary); }
.cifra-exibir button:not(.active):hover { color: var(--ink); background: color-mix(in srgb, var(--seg-active) 60%, transparent); }
@media (max-width: 639px) {
  .cifra-ferramentas .cifra-exibir { flex: 1 1 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .cifra-exibir button { justify-content: center; min-height: 40px; }
}
@media (max-width: 639px) { .segmented button { flex: 1 0 auto; } }
/* Só letra: o tom não muda nada na letra, então o seletor some */
.sem-acordes .cifra-tom { display: none; }

/* Página de cifras do evento: topo fixo com as músicas e as opções de leitura */
.cifras-topo {
  position: sticky; top: var(--topbar-h); z-index: 30; margin: 0 calc(var(--gutter) * -1) 1rem;
  padding: .5rem var(--gutter); background: var(--chrome); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.cifras-topo-linha { display: flex; align-items: center; gap: .4rem; }
.cifras-topo .cifra-musicas { flex: 1 1 auto; min-width: 0; margin: 0; padding: 0; }
.cifras-topo .cifra-musicas a { min-height: 40px; padding-block: .25rem; background: var(--surface); }
.cifras-topo .cifra-musicas .cifra-num { width: 28px; height: 28px; font-size: .8125rem; }
.cifra-musicas a.atual { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.cifra-musicas a.atual .cifra-num { background: var(--on-primary); color: var(--primary-ink); }
.cifra-musicas a.atual b { color: var(--on-primary); }
.cifras-ajustes { gap: .3rem; padding-inline: .6rem; }
.cifras-ajustes .ph-caret-down { font-size: .8em; transition: transform .15s; }
.cifras-ajustes[aria-expanded="true"] .ph-caret-down { transform: rotate(180deg); }
.cifra-ferramentas.embutida { margin: .5rem 0 0; padding: .5rem 0 0; background: none; box-shadow: none; border-radius: 0; border-top: 1px solid var(--line); }
@media (min-width: 1024px) {
  .cifras-topo { margin-inline: 0; top: calc(var(--topbar-h) + .5rem); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--shadow); }
}
.cifras-topo-linha > .btn { flex: 0 0 auto; }

/* Escolha com busca (select[data-busca], ver app.js): campo de texto + lista flutuante */
.combo { position: relative; min-width: 0; }
.combo > input { padding-right: 2.2rem; background-image: var(--select-arrow); background-repeat: no-repeat; background-position: right .8rem center; text-overflow: ellipsis; }
.combo-nativo { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.combo-lista {
  position: fixed; z-index: 200; margin: 0; padding: .3rem; list-style: none; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow-lg);
}
.combo-lista[hidden] { display: none; }
.combo-lista [role=option] { padding: .6rem .7rem; border-radius: 7px; cursor: pointer; font-size: .9375rem; line-height: 1.35; overflow-wrap: anywhere; }
.combo-lista [role=option].vazia { color: var(--muted); font-style: italic; }
.combo-lista [role=option][aria-selected=true] { font-weight: 700; color: var(--primary-ink); }
.combo-lista [role=option].ativa, .combo-lista [role=option]:hover { background: var(--primary-soft); }
.combo-aviso { padding: .55rem .7rem; font-size: .8125rem; color: var(--muted); }
@media (min-width: 768px) { .combo-lista [role=option] { padding: .45rem .65rem; font-size: .875rem; } }

/* Links da música no formulário (vários; um é o principal) */
.links-lista { display: grid; gap: .5rem; margin-bottom: .5rem; }
.link-linha { padding: .6rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.link-linha:has(input[type=radio]:checked) { border-color: var(--primary-line); background: var(--primary-soft); }
.link-linha.com-erro { border-color: var(--danger-line); }
.link-linha[hidden] { display: none; }
.link-campos { display: grid; gap: .4rem; }
.link-acoes { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .45rem; }
.link-acoes .check-row { align-items: center; }
.link-acoes .check-row.danger { color: var(--danger-ink); }
@media (min-width: 768px) { .link-campos { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.links-ref { display: flex; flex-wrap: wrap; gap: .4rem; }
.join > .combo { flex: 1 1 auto; }
.join > .combo > input { border-radius: 10px 0 0 10px; }
.join.sm > .combo > input { min-height: 36px; padding-block: .3rem; font-size: .875rem; border-radius: 8px 0 0 8px; }
