:root {
  color-scheme: dark;
  --bg: #080d1a;
  --sidebar: #0b1021;
  --surface: #111827;
  --surface-alt: #171f2f;
  --surface-soft: #1b2440;
  --text: #f8fbff;
  --muted: #94a3b8;
  --line: #28344f;
  --accent: #6574ff;
  --accent-strong: #20c8ee;
  --accent-glow: rgba(32, 200, 238, 0.28);
  --success: #16d99a;
  --warn: #ffd11a;
  --danger: #ff646d;
  --shadow: 0 22px 46px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at top right, rgba(32, 200, 238, 0.12), transparent 34rem),
    linear-gradient(145deg, #080d1a 0%, #0b1021 52%, #061d28 100%);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  color: var(--text);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  display: block;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  padding: 3px;
  border-radius: 10px;
  background: #eef2f8;
  box-shadow: 0 0 24px var(--accent-glow);
  object-fit: contain;
}

.auth-card .brand-mark {
  width: 64px;
  height: 64px;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.brand span,
.eyebrow,
.metric small,
.record-meta,
.form-note {
  color: var(--muted);
  font-size: 0.86rem;
}

.sidebar .brand span,
.sidebar .eyebrow,
.sidebar .plan-card p {
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  border-color: #4d5fff;
  background: rgba(101, 116, 255, 0.18);
  color: #ffffff;
}

.icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
}

.plan-card {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(17, 24, 39, 0.72);
}

.plan-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.1rem;
}

.plan-card p {
  margin: 8px 0 0;
  line-height: 1.45;
}

.main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.topbar h1,
.portal-hero h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  letter-spacing: 0;
  color: #6d7cff;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.org-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1021;
  color: var(--text);
  padding: 10px 12px;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(101, 116, 255, 0.18);
  outline: 0;
}

textarea {
  resize: vertical;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric,
.panel,
.form-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
}

.metric:nth-child(1) strong,
.metric:nth-child(3) strong {
  color: var(--success);
}

.metric:nth-child(2) strong,
.metric:nth-child(4) strong {
  color: var(--accent-strong);
}

.metric span,
.metric small,
.metric strong {
  display: block;
}

.metric strong {
  margin: 6px 0;
  font-size: 2rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}

.panel,
.form-panel {
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

h2 {
  margin: 0;
  font-size: 1.08rem;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.form-panel {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: #d7dfed;
  font-weight: 650;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.4;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.primary,
.ghost {
  border-radius: 8px;
  min-height: 42px;
  padding: 0 14px;
}

.primary {
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-weight: 750;
  box-shadow: 0 10px 28px var(--accent-glow);
}

.primary:hover {
  filter: brightness(1.08);
}

.ghost {
  border: 1px solid var(--line);
  background: #141b2b;
  color: var(--text);
}

.record-list,
.stack,
.activity-list {
  display: grid;
  gap: 10px;
}

.activity-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-list li,
.empty-state,
.content-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
  padding: 12px;
}

.record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-alt);
}

.record-title {
  display: inline-block;
  margin-bottom: 4px;
  margin-right: 8px;
}

.record-meta {
  margin: 0;
  line-height: 1.45;
}

.record-action {
  min-width: 86px;
  color: var(--danger);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  vertical-align: middle;
}

.pill.success {
  border-color: rgba(22, 217, 154, 0.38);
  background: rgba(22, 217, 154, 0.12);
  color: var(--success);
}

.pill.info {
  border-color: rgba(32, 200, 238, 0.35);
  background: rgba(32, 200, 238, 0.12);
  color: #9ee9ff;
}

.pill.warning {
  border-color: rgba(255, 209, 26, 0.38);
  background: rgba(255, 209, 26, 0.12);
  color: var(--warn);
}

.pill.muted {
  color: var(--muted);
}

.search {
  max-width: 260px;
}

.form-note {
  min-height: 1.2em;
  margin: 0;
}

.form-note.warn {
  color: var(--warn);
}

.portal-preview {
  display: grid;
  gap: 18px;
}

.portal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.portal-hero {
  min-height: 260px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(8, 13, 26, 0.94), rgba(20, 28, 52, 0.62)),
    url("https://images.unsplash.com/photo-1438032005730-c779502df39b?auto=format&fit=crop&w=1600&q=80");
  background-size: cover;
  background-position: center;
  color: #ffffff;
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  gap: 12px;
}

.portal-hero p {
  max-width: 620px;
  line-height: 1.55;
  margin: 0;
}

.portal-hero .eyebrow {
  color: #9ee9ff;
}

.portal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    padding: 16px;
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .plan-card {
    margin-top: 0;
  }

  .metrics-grid,
  .dashboard-grid,
  .workbench,
  .portal-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .main {
    padding: 18px;
  }

  .topbar,
  .panel-heading,
  .record {
    align-items: stretch;
    flex-direction: column;
  }

  .nav {
    grid-template-columns: 1fr 1fr;
  }

  .org-switcher {
    align-items: stretch;
    flex-direction: column;
  }

  .search {
    max-width: none;
  }

  .portal-hero {
    padding: 24px;
  }
}

/* --- v0.2: idioma, sesión y pantalla de acceso --------------------------- */
[hidden] {
  display: none !important;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.org-switcher select {
  width: auto;
  min-width: 150px;
}

.form-note.error {
  color: var(--danger);
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.auth-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 0;
  font-size: 1.5rem;
  color: #6d7cff;
}

.auth-card .org-switcher {
  justify-content: flex-end;
}

.auth-card form {
  display: grid;
  gap: 14px;
}

.link-button {
  border: 0;
  background: none;
  color: var(--accent-strong);
  padding: 0;
  text-align: left;
}

.link-button:hover {
  text-decoration: underline;
}

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
}

@media (max-width: 620px) {
  .topbar-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .org-switcher select {
    width: 100%;
  }
}

/* --- v0.3: plataforma, cuenta y novedades -------------------------------- */
.app-version {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-admin {
  border-color: rgba(255, 209, 26, 0.25);
}

.nav-admin .icon {
  color: var(--warn);
}

.announcement {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  border: 1px solid rgba(32, 200, 238, 0.35);
  border-radius: 8px;
  padding: 16px;
  background: rgba(32, 200, 238, 0.08);
}

.announcement strong {
  display: block;
  margin: 8px 0 4px;
}

.announcement p {
  margin: 0;
  color: #d7dfed;
  line-height: 1.5;
  white-space: pre-line;
}

#platform {
  gap: 18px;
}

#platform.active {
  display: grid;
}

#platform .metrics-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.data-table td select {
  width: auto;
  padding: 6px 8px;
}

.data-table .ghost {
  min-height: 34px;
  padding: 0 10px;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.form-note.success {
  color: var(--success);
  user-select: all;
}

select:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

@media (max-width: 980px) {
  #platform .metrics-grid {
    grid-template-columns: 1fr;
  }
}

/* --- v0.4: Fase 1 --------------------------------------------------------- */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.record-actions .ghost {
  min-height: 36px;
  padding: 0 12px;
}

.record-actions .danger {
  color: var(--danger);
}

.form-panel.editing {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(101, 116, 255, 0.18);
}

.dashboard-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.detail-panel {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.detail-panel h3 {
  margin: 0;
  font-size: 1rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  align-items: start;
}

.check-list {
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.check-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.check-list input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.label-text {
  color: #d7dfed;
  font-weight: 650;
}

.report-line,
.muted-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.segmented {
  display: flex;
  gap: 6px;
}

.segmented .ghost {
  min-height: 34px;
}

.segmented .ghost.active {
  border-color: var(--accent);
  background: rgba(101, 116, 255, 0.18);
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.calendar-head .ghost {
  min-height: 34px;
  min-width: 40px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.cal-weekday {
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
  text-transform: uppercase;
}

.cal-day {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px;
  background: var(--surface-alt);
  font-size: 0.78rem;
  overflow: hidden;
}

.cal-day.other {
  opacity: 0.35;
}

.cal-day.today {
  border-color: var(--accent-strong);
}

.cal-day .num {
  display: block;
  color: var(--muted);
  margin-bottom: 2px;
}

.cal-event {
  display: block;
  margin-top: 2px;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(101, 116, 255, 0.25);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.locked-panel {
  display: grid;
  justify-items: start;
  gap: 8px;
  margin-bottom: 18px;
  border-color: rgba(255, 209, 26, 0.35);
}

.locked-panel p {
  margin: 0;
  color: #d7dfed;
}

.lock-icon {
  font-size: 1.6rem;
}

.nav-item.locked span:last-child::after {
  content: " 🔒";
  font-size: 0.8em;
}

.inline-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.inline-form .primary {
  white-space: nowrap;
}

.button-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.portal-url {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent-strong);
  word-break: break-all;
}

#events .workbench + .detail-panel,
#events .detail-panel + .workbench,
#events > .workbench + .workbench {
  margin-top: 18px;
}

@media (max-width: 620px) {
  .field-row,
  .inline-form {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .record-actions {
    justify-content: stretch;
  }

  .cal-day {
    min-height: 54px;
    font-size: 0.68rem;
  }
}

button.cal-event {
  width: 100%;
  border: 0;
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

button.cal-event:hover {
  background: rgba(101, 116, 255, 0.45);
}

input[type="color"] {
  height: 44px;
  padding: 4px;
  cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 6px;
}

/* --- v0.5: Fase 1B -------------------------------------------------------- */
.workbench.readonly {
  grid-template-columns: 1fr;
}

.inline-select {
  width: auto;
  min-height: 36px;
  padding: 6px 8px;
}

.warn-banner {
  border-color: rgba(255, 209, 26, 0.4);
  background: rgba(255, 209, 26, 0.08);
  align-items: center;
}

.warn-banner p {
  margin: 4px 0 0;
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-row label {
  flex: 1;
}

#logoPreview {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: #fff;
}

input[type="file"] {
  padding: 8px;
}

.audit-table td {
  vertical-align: top;
}

.audit-changes {
  white-space: normal !important;
  min-width: 220px;
  color: var(--muted);
  font-size: 0.85rem;
}

#permMatrix select {
  width: auto;
  min-width: 110px;
  padding: 6px 8px;
}

/* --- v0.6: Finanças ------------------------------------------------------- */
#finance {
  --series-income: #3987e5;
  --series-expense: #d95926;
}

#finance.active,
#financeBody,
.fin-tab {
  display: grid;
  gap: 18px;
}

#financeBody[hidden],
.fin-tab[hidden] {
  display: none;
}

.tabs-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tabs-row .segmented {
  flex-wrap: wrap;
}

.year-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.year-picker select {
  width: auto;
}

#finance .metrics-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0;
}

.group-cell {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.budget-input {
  width: 140px;
  padding: 6px 8px;
}

.report-grid .panel-heading.spaced {
  margin-top: 18px;
}

.chart-box {
  position: relative;
}

.chart-box svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
  color: #d7dfed;
  font-size: 0.9rem;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
}

.chart-legend .swatch {
  margin-right: 0;
}

.swatch-income { background: var(--series-income); }
.swatch-expense { background: var(--series-expense); }

.chart-box .bar-income { fill: var(--series-income); }
.chart-box .bar-expense { fill: var(--series-expense); }

.chart-box .grid-line {
  stroke: rgba(148, 163, 184, 0.16);
  stroke-width: 1;
}

.chart-box .axis-line {
  stroke: rgba(148, 163, 184, 0.45);
  stroke-width: 1;
}

.chart-box .axis-label {
  fill: var(--muted);
  font-size: 11px;
}

.chart-box .hit {
  fill: transparent;
  cursor: default;
}

.chart-box .hit.active {
  fill: rgba(148, 163, 184, 0.08);
}

.chart-tip {
  position: absolute;
  top: 34px;
  transform: translateX(-50%);
  min-width: 170px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1021;
  box-shadow: var(--shadow);
  font-size: 0.85rem;
  pointer-events: none;
  display: grid;
  gap: 4px;
  color: var(--text);
}

.table-toggle {
  margin-top: 12px;
}

.table-toggle summary {
  cursor: pointer;
  color: var(--accent-strong);
}

.export-actions {
  margin-top: 12px;
}

@media (max-width: 980px) {
  #finance .metrics-grid {
    grid-template-columns: 1fr;
  }
}

#finance .metric strong {
  color: var(--text);
}

#finance .metric strong.negative {
  color: var(--danger);
}

#finance.active,
#financeBody,
.fin-tab {
  grid-template-columns: minmax(0, 1fr);
}

/* --- v0.7: Ensino, Kids e Patrimônio -------------------------------------- */
.module-view.active,
.module-body,
.tab-panel {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr);
}

.module-body[hidden],
.tab-panel[hidden] {
  display: none;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-row:empty {
  display: none;
}

.inline-form.wrap {
  flex-wrap: wrap;
}

.inline-form.wrap > * {
  flex: 1 1 160px;
}

.inline-form.wrap .primary,
.inline-form.wrap .code-input {
  flex: 0 0 auto;
}

.code-input {
  max-width: 120px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 800;
  text-align: center;
}

#assets .metrics-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0;
}

@media (max-width: 980px) {
  #assets .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  #assets .metrics-grid {
    grid-template-columns: 1fr;
  }

  .code-input {
    max-width: none;
  }
}

/* --- v0.8: Orações -------------------------------------------------------- */
.file-button {
  cursor: pointer;
  font-weight: 600;
}

.file-button:focus-within {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

#prayers .row-actions select {
  width: auto;
}

.prayer-reader .panel-heading {
  align-items: flex-start;
}

.reader-actions {
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.reader-actions .button-link {
  text-decoration: none;
}

.reader-media {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.reader-media:empty {
  display: none;
}

.video-frame {
  width: 100%;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 10px;
  background: #000;
}

.pdf-frame {
  width: 100%;
  height: 70vh;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.reader-image {
  max-width: 100%;
  border-radius: 10px;
}

.audio-player {
  width: 100%;
  max-width: 600px;
}

.prayer-text {
  max-width: 72ch;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  line-height: 1.75;
}

.prayer-text h3 {
  margin: 26px 0 8px;
  font-family: inherit;
  font-size: 1.25rem;
  color: var(--accent-strong);
}

.prayer-text h4 {
  margin: 18px 0 6px;
  font-size: 1.05rem;
}

.prayer-text p {
  margin: 0 0 12px;
  white-space: pre-line;
}

/* Modo apresentação: tela cheia, texto grande e legível de longe */
.present-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #05070f;
  color: #f8fbff;
}

.present-overlay[hidden] {
  display: none;
}

body.presenting {
  overflow: hidden;
}

.present-top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  color: #94a3b8;
  font-size: 0.95rem;
}

.present-top #presentSection {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.present-slide {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 20px;
  padding: 2vh 7vw;
  text-align: center;
  cursor: pointer;
  user-select: none;
  overflow: auto;
}

.present-slide h1 {
  margin: 0;
  font-size: clamp(2rem, 5.5vw, 4.4rem);
  line-height: 1.15;
}

.present-slide .present-sub {
  margin: 0;
  color: #20c8ee;
  font-size: clamp(1.1rem, 2.4vw, 1.8rem);
}

.present-slide h2 {
  margin: 0;
  color: #20c8ee;
  font-size: clamp(1.1rem, 2.4vw, 1.9rem);
}

.present-slide p {
  max-width: 1200px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.4rem, 3.4vw, 3rem);
  line-height: 1.4;
  white-space: pre-line;
}

.present-slide p.long {
  font-size: clamp(1.2rem, 2.6vw, 2.3rem);
}

.present-nav {
  display: flex;
  justify-content: space-between;
  padding: 12px 20px 18px;
}

.present-btn {
  min-width: 48px;
  min-height: 48px;
  border: 1px solid #28344f;
  border-radius: 999px;
  background: #111827;
  color: #f8fbff;
  font-size: 1.5rem;
  line-height: 1;
}

.present-btn:hover {
  border-color: #20c8ee;
}

/* --- Usuário logado ----------------------------------------------------- */
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
}

.user-chip-text {
  display: grid;
  line-height: 1.15;
}

.user-chip-text strong {
  font-size: 0.9rem;
}

.user-chip-text small {
  color: var(--muted);
  font-size: 0.75rem;
}

/* --- Upgrade de plano ---------------------------------------------------- */
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-strong);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.upgrade-mini {
  margin-top: 12px;
  width: 100%;
}

.portal-give-note {
  margin-top: 12px;
}

.plan-cell {
  display: grid;
  gap: 6px;
  justify-items: start;
}

.upgrade-dialog {
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.upgrade-dialog::backdrop {
  background: rgba(3, 6, 15, 0.7);
}

.upgrade-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.upgrade-head h2 {
  margin: 0 0 6px;
}

.upgrade-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.upgrade-plan {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-alt);
}

.upgrade-plan.current {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.upgrade-plan h3,
.upgrade-plan p {
  margin: 0;
}

.upgrade-plan p {
  color: var(--muted);
  line-height: 1.45;
}

.upgrade-price {
  font-size: 1.25rem;
}

.upgrade-plan > button,
.upgrade-plan > .pill {
  margin-top: auto;
}

.upgrade-plan > button {
  width: 100%;
  min-height: 46px;
  line-height: 1.2;
}

@media (max-width: 720px) {
  .user-chip-text small {
    display: none;
  }
}

/* --- Recuperação de senha ----------------------------------------------- */
.auth-card .form-note.error,
.auth-card .form-note.success {
  white-space: normal;
  overflow: visible;
  line-height: 1.4;
}

.auth-card .muted-text {
  margin: -4px 0 4px;
  line-height: 1.45;
}

.auth-card .link-button + .link-button {
  margin-top: -6px;
}

/* --- Teste grátis ---------------------------------------------------------- */
.pill.danger {
  border-color: rgba(255, 100, 109, 0.4);
  background: rgba(255, 100, 109, 0.12);
  color: var(--danger);
}

.trial-banner {
  align-items: center;
  padding: 12px 16px;
}

.trial-banner p {
  margin: 0;
  font-weight: 600;
}

.trial-badge {
  align-self: flex-start;
}

.blocked-card {
  width: min(980px, calc(100vw - 32px));
  max-width: none;
}

.blocked-card h1 {
  margin-bottom: 4px;
}

.blocked-export {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.blocked-export h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.blocked-export .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

#blockedLogout {
  justify-self: start;
  margin-top: 8px;
}

/* Link de pagamento da cobrança automática (Asaas) dentro do aviso do plano */
.form-note .pay-link {
  display: inline-block;
  margin-left: 0.5rem;
  min-height: 0;
  line-height: 1.4;
  padding: 0.45rem 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}
