:root {
  --primary: #245c7c;
  --primary-2: #12324a;
  --secondary: #c6a45c;
  --accent: #2f8b6b;
  --surface: #f7f4ec;
  --surface-2: #efebe2;
  --panel: #ffffff;
  --ink: #18202d;
  --muted: #657084;
  --line: #ded8cb;
  --danger: #b44545;
  --ok: #227a55;
  --warning: #b7791f;
  --shadow: 0 18px 48px rgba(20, 27, 39, 0.12);
  --shadow-soft: 0 10px 26px rgba(20, 27, 39, 0.08);
  --radius: 8px;
  --hero-image: url("/assets/parish-hero.png");
  color-scheme: light;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

html[data-mode="dark"] {
  --surface: #0f1217;
  --surface-2: #171b22;
  --panel: #151920;
  --ink: #f3f0e8;
  --muted: #a6adbb;
  --line: #2b3039;
  --primary-2: #6ea6d6;
  --shadow: 0 18px 52px rgba(0, 0, 0, 0.32);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.22);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  background: var(--surface);
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,255,.42), transparent 280px),
    var(--surface);
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

html[data-mode="dark"] body {
  background: var(--surface);
}

html[data-mode="dark"] .topbar {
  background: rgba(15, 18, 23, .9);
  border-bottom-color: #2b3039;
}

html[data-mode="dark"] .tabs,
html[data-mode="dark"] .admin-tabs,
html[data-mode="dark"] .chat-suggestions,
html[data-mode="dark"] .chat-form,
html[data-mode="dark"] .chat-guided-footer {
  border-color: #303948;
  background: #171d26;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  min-height: 44px;
  border: 0;
  cursor: pointer;
}

img,
iframe {
  max-width: 100%;
}

.app-shell {
  min-height: 100vh;
}

#conteudo,
.dashboard-main {
  animation: contentIn .2s ease both;
}

@keyframes contentIn {
  from {
    opacity: .72;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 999;
  transform: translateX(-120vw);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 10px 12px;
  box-shadow: var(--shadow-soft);
}

.skip-link:focus {
  transform: translateX(0);
}

.container {
  width: min(1180px, calc(100vw - 40px));
  margin: 0 auto;
}

.section {
  padding: clamp(28px, 5vw, 64px) 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px);
}

.brand,
.sidebar-brand,
.store-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-title,
.sidebar-brand strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.1;
}

.brand-subtitle,
.sidebar-brand small {
  display: block;
  color: var(--muted);
  font-size: .82rem;
}

.brand-mark,
.crest,
.chat-avatar,
.identity-logo {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  font-weight: 800;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 24%, transparent);
}

.brand-mark img,
.crest img,
.chat-avatar img,
.identity-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.identity-logo {
  width: 68px;
  height: 68px;
}

.top-actions,
.row,
.toolbar,
.chip-row,
.row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.row.tight {
  gap: 8px;
}

.btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  color: #fff;
  background: var(--primary);
  padding: 0 16px;
  font-size: .95rem;
  font-weight: 700;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}

.btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.btn.secondary,
.btn.ghost,
.icon-btn {
  color: var(--ink);
  border-color: var(--line);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
}

html[data-mode="dark"] .btn.secondary,
html[data-mode="dark"] .btn.ghost,
html[data-mode="dark"] .icon-btn {
  color: #f7f1e6;
  border-color: #394353;
  background: #202733;
}

.btn.ghost {
  border-color: transparent;
  background: transparent;
}

.btn.green {
  background: var(--accent);
}

.btn.gold {
  color: #1d1710;
  background: var(--secondary);
}

.btn.danger {
  background: var(--danger);
}

.btn.icon,
.icon-btn {
  width: 44px;
  padding: 0;
}

.btn:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: .58;
  transform: none;
  box-shadow: none;
}

.hero {
  position: relative;
  display: grid;
  min-height: min(620px, calc(100vh - 72px));
  align-items: end;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(18, 32, 48, .88), rgba(18, 32, 48, .46), rgba(18, 32, 48, .14)),
    var(--hero-image) center / cover no-repeat;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 28%;
  background: linear-gradient(180deg, transparent, rgba(12, 18, 28, .68));
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 40px));
  margin: 0 auto;
  padding: clamp(64px, 10vw, 112px) 0 42px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(320px, .78fr);
  gap: clamp(28px, 6vw, 68px);
  align-items: end;
}

.hero h1 {
  max-width: 760px;
  margin: 16px 0;
  font-size: clamp(2.45rem, 5.6vw, 5.15rem);
  line-height: 1;
  font-weight: 760;
  letter-spacing: 0;
}

.hero p {
  max-width: 660px;
  margin: 0 0 24px;
  color: rgba(255,255,255,.88);
  font-size: clamp(1.05rem, 1.7vw, 1.22rem);
  line-height: 1.65;
}

.eyebrow,
.overline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 9px;
  border-radius: var(--radius);
  color: color-mix(in srgb, var(--accent) 88%, #fff);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #fff;
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(255,255,255,.12);
}

.quick-panel,
.card,
.event-card,
.module-tile,
.person,
.place-card,
.panel,
.invoice,
.login-panel,
.chat-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: var(--shadow-soft);
}

.quick-panel {
  padding: 20px;
  color: var(--ink);
  backdrop-filter: blur(16px);
}

html[data-mode="dark"] .quick-panel,
html[data-mode="dark"] .card,
html[data-mode="dark"] .event-card,
html[data-mode="dark"] .module-tile,
html[data-mode="dark"] .person,
html[data-mode="dark"] .place-card,
html[data-mode="dark"] .panel,
html[data-mode="dark"] .invoice,
html[data-mode="dark"] .login-panel,
html[data-mode="dark"] .chat-panel {
  border-color: #303948;
  background: #171d26;
}

html[data-mode="dark"] .stat,
html[data-mode="dark"] .metric,
html[data-mode="dark"] .empty,
html[data-mode="dark"] .preview-card,
html[data-mode="dark"] .ai-output,
html[data-mode="dark"] .library-tile,
html[data-mode="dark"] .reading-card,
html[data-mode="dark"] .link-card,
html[data-mode="dark"] .doc-list,
html[data-mode="dark"] .pdf-preview,
html[data-mode="dark"] .filter-bar,
html[data-mode="dark"] .media-card,
html[data-mode="dark"] .event-feed-card,
html[data-mode="dark"] .admin-content-row,
html[data-mode="dark"] .file-upload,
html[data-mode="dark"] .ai-status-card,
html[data-mode="dark"] .usage-row,
html[data-mode="dark"] .person-card,
html[data-mode="dark"] .pastoral-card,
html[data-mode="dark"] .community-details,
html[data-mode="dark"] .install-card,
html[data-mode="dark"] .super-table button,
html[data-mode="dark"] .access-row,
html[data-mode="dark"] .access-user-head,
html[data-mode="dark"] .access-form {
  border-color: #303948;
  background: #111720;
}

html[data-mode="dark"] .mural-card,
html[data-mode="dark"] .artifact-card,
html[data-mode="dark"] .confirm-card,
html[data-mode="dark"] .media-modal,
html[data-mode="dark"] .secretariat-info-card,
html[data-mode="dark"] .public-chat-card,
html[data-mode="dark"] .secretary-panel,
html[data-mode="dark"] .secretary-sidebar,
html[data-mode="dark"] .secretary-chat,
html[data-mode="dark"] .secretary-agenda,
html[data-mode="dark"] .wa-message,
html[data-mode="dark"] .appointment-card {
  border-color: #303948;
  background: #111720;
}

html[data-mode="dark"] .wa-head,
html[data-mode="dark"] .wa-message-form,
html[data-mode="dark"] .chat-guided-footer,
html[data-mode="dark"] .secretariat-hours-form {
  border-color: #303948;
  background: #171d26;
}

html[data-mode="dark"] .wa-chat-log,
html[data-mode="dark"] .secretary-shell {
  background: #0f1217;
}

html[data-mode="dark"] .library-tile.active,
html[data-mode="dark"] .doc-row.active,
html[data-mode="dark"] .super-table button.active {
  border-color: #507ba4;
  background: #1b2b3a;
}

html[data-mode="dark"] .reading-grid,
html[data-mode="dark"] .reading-grid section,
html[data-mode="dark"] .doc-row,
html[data-mode="dark"] .community-event-list div,
html[data-mode="dark"] .community-event-item,
html[data-mode="dark"] .install-steps article {
  border-color: #303948;
  background: #171d26;
}

html[data-mode="dark"] .hero .quick-panel {
  color: #f7f1e6;
  background: rgba(18, 24, 34, .92);
  border-color: rgba(255,255,255,.16);
}

html[data-mode="dark"] .hero .quick-panel p,
html[data-mode="dark"] .hero .quick-panel .muted,
html[data-mode="dark"] .hero .quick-panel span {
  color: #cfd6e2;
}

.quick-panel h2,
.card h2,
.panel h2,
.invoice h2 {
  margin: 0 0 10px;
  font-size: 1.14rem;
  font-weight: 750;
}

.stat-grid,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

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

.stat,
.metric {
  min-height: 88px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 65%, var(--panel));
}

.stat strong,
.metric strong {
  display: block;
  color: var(--ink);
  font-size: clamp(1.35rem, 2.6vw, 1.95rem);
  font-weight: 760;
  line-height: 1.1;
}

.stat span,
.metric span,
.metric small {
  display: block;
  color: var(--muted);
  font-size: .86rem;
}

.backup-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.backup-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 62%, var(--panel));
}

.backup-card h3 {
  margin: 8px 0 8px;
  font-size: 1.2rem;
}

.backup-card p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.55;
}

.search-wrap {
  width: min(680px, 100%);
}

.search-wrap input,
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--panel);
  padding: 12px 13px;
  outline: none;
}

.field textarea {
  min-height: 118px;
  resize: vertical;
}

.search-wrap input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus,
.btn:focus-visible,
.icon-btn:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 2px;
  border-color: var(--accent);
}

.section-title {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(320px, 1.15fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 24px;
}

.section-title h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.03;
  font-weight: 760;
}

.section-title p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}

.card,
.panel,
.invoice,
.login-panel {
  padding: 20px;
}

.parish-card {
  display: grid;
  min-height: 250px;
  align-content: space-between;
  gap: 18px;
  transition: transform .16s ease, box-shadow .16s ease;
}

.parish-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

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

.small {
  font-size: .9rem;
}

.tabs,
.admin-tabs {
  display: flex;
  gap: 6px;
  max-width: 100%;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
}

.tab,
.admin-tab {
  position: relative;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  font-weight: 700;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.tab.active,
.admin-tab.active {
  color: #fff;
  background: var(--primary);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, .76fr);
  gap: 24px;
  align-items: start;
}

.today-aside {
  display: grid;
  gap: 22px;
}

.liturgy-mini,
.secretariat-mini {
  display: grid;
  gap: 18px;
  padding: 24px;
  align-content: start;
}

.liturgy-mini .toolbar {
  gap: 10px;
  flex-wrap: wrap;
}

.liturgy-mini h2,
.secretariat-mini h2 {
  margin: 0;
  line-height: 1.18;
}

.agenda-layout .card > h2,
.agenda-layout .compact-head h2 {
  margin: 0;
}

.compact-head {
  align-items: center;
  margin-bottom: 14px;
}

.event-list,
.module-grid,
.people-grid,
.community-grid,
.billing-list,
.admin-event-list {
  display: grid;
  gap: 14px;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, .65fr);
  gap: 14px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.event-list.compact {
  gap: 10px;
}

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

.people-grid,
.community-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.event-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.event-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 28%, var(--line));
  box-shadow: var(--shadow-soft);
}

.event-time {
  display: grid;
  width: 74px;
  height: 58px;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  font-weight: 760;
  text-align: center;
}

.event-time strong {
  font: inherit;
}

.event-time small {
  display: block;
  margin-top: 1px;
  color: rgba(255,255,255,.82);
  font-size: .66rem;
  font-weight: 760;
  line-height: 1.05;
}

.event-time.range {
  gap: 1px;
  line-height: 1.04;
}

.modern-event-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px;
}

.event-copy {
  min-width: 0;
}

.event-copy small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.42;
}

.event-date-line {
  display: block;
  margin-top: 4px;
  color: var(--primary-2) !important;
  font-weight: 820;
}

.event-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.event-time.mini {
  width: 62px;
  min-height: 46px;
  height: auto;
  font-size: .92rem;
}

.event-thumb,
.admin-event-thumb {
  display: block;
  width: 94px;
  height: 76px;
  border-radius: var(--radius);
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}

.admin-event-thumb {
  width: 74px;
  height: 62px;
}

.badge.subtle {
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-2) 78%, var(--panel));
}

.date-badge {
  color: #fff;
  background: var(--primary-2);
}

.event-card h3,
.module-tile h3,
.person h3,
.place-card h2,
.place-card h3 {
  margin: 0 0 5px;
  font-size: 1.04rem;
  font-weight: 750;
  line-height: 1.28;
}

.event-card p,
.module-tile p,
.person p,
.place-card p {
  margin: 0;
  color: var(--muted);
}

.module-tile {
  min-height: 168px;
  padding: 18px;
  transition: transform .16s ease, box-shadow .16s ease;
}

.module-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.module-icon {
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: var(--accent);
  font-weight: 760;
}

.person-avatar {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  font-weight: 760;
}

.gallery-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 22px;
}

.gallery-item {
  min-height: 180px;
  display: flex;
  align-items: end;
  padding: 16px;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  font-weight: 760;
}

.gallery-item.green {
  background: linear-gradient(135deg, var(--accent), #1f5f4b);
}

.gallery-item.gold {
  background: linear-gradient(135deg, var(--secondary), #815d20);
}

.library-layout {
  display: grid;
  grid-template-columns: minmax(270px, .42fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.library-nav,
.stack-list,
.link-grid,
.access-list {
  display: grid;
  gap: 12px;
}

.library-nav {
  position: sticky;
  top: 96px;
}

.library-tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  width: 100%;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--panel);
  padding: 14px;
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.library-tile strong,
.library-tile small,
.library-tile em {
  display: block;
}

.library-tile small {
  margin-top: 3px;
  color: var(--muted);
  font-size: .86rem;
}

.library-tile em {
  margin-top: 8px;
  color: var(--primary);
  font-size: .78rem;
  font-style: normal;
  font-weight: 750;
}

.library-tile.active {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--line));
  background: color-mix(in srgb, var(--primary) 10%, var(--panel));
}

.library-detail {
  min-width: 0;
}

.reading-card,
.link-card,
.doc-list,
.doc-list,
.pdf-preview,
.person-card,
.pastoral-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.reading-card {
  overflow: hidden;
}

.reading-card.compact {
  padding: 20px;
}

.reading-card.compact h2 {
  margin: 10px 0 8px;
  font-size: 1.35rem;
}

.reading-hero {
  padding: clamp(22px, 4vw, 34px);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(18, 32, 48, .92), rgba(36, 92, 124, .8)),
    var(--hero-image) center / cover no-repeat;
}

.reading-hero h2 {
  max-width: 760px;
  margin: 14px 0 10px;
  font-size: clamp(1.85rem, 4vw, 3rem);
  line-height: 1.05;
}

.reading-hero p {
  max-width: 760px;
  margin: 0;
  color: rgba(255,255,255,.86);
  font-size: 1.05rem;
}

.reading-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.reading-grid section {
  min-height: 132px;
  padding: 18px;
  background: var(--panel);
}

.reading-grid strong {
  display: block;
  margin-bottom: 8px;
}

.reading-grid p {
  margin: 0;
  color: var(--muted);
}

.reading-long small {
  display: block;
  margin-bottom: 10px;
  color: var(--primary-2);
  font-weight: 750;
}

.reading-long p,
.prayer-text {
  max-width: 86ch;
  font-size: 1.04rem;
  line-height: 1.72;
  white-space: pre-wrap;
}

.pdf-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: stretch;
}

.doc-list {
  align-content: start;
  padding: 18px;
}

.doc-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.doc-list-head h2 {
  margin: 6px 0 0;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
}

.doc-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.doc-row,
.link-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: color-mix(in srgb, var(--surface-2) 38%, var(--panel));
  color: var(--ink);
  text-align: left;
}

.doc-row.active {
  border-color: color-mix(in srgb, var(--primary) 36%, var(--line));
  background: color-mix(in srgb, var(--primary) 8%, var(--panel));
}

.doc-row strong,
.doc-row small,
.link-card strong,
.link-card small {
  display: block;
}

.doc-row small,
.link-card small {
  color: var(--muted);
}

.pdf-preview {
  display: grid;
  grid-template-rows: auto minmax(480px, 1fr);
  overflow: hidden;
}

.pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.pdf-toolbar strong,
.pdf-toolbar small {
  display: block;
}

.pdf-toolbar small {
  color: var(--muted);
}

.pdf-preview iframe {
  width: 100%;
  height: 100%;
  min-height: 520px;
  border: 0;
  background: var(--surface-2);
}

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

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.gallery-card {
  display: flex;
  min-height: 320px;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  overflow: hidden;
  border-radius: var(--radius);
  color: #fff;
  background-position: center;
  background-size: cover;
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.gallery-card h2,
.gallery-card p {
  margin: 0;
}

.gallery-card p {
  color: rgba(255,255,255,.84);
}

.media-feed {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
}

.compact-feed {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.event-feed {
  display: grid;
  gap: 18px;
}

.mural-feed {
  display: grid;
  gap: 16px;
}

.mural-grid,
.artifact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  align-items: start;
}

.mural-card,
.artifact-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 14px;
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.mural-card {
  cursor: pointer;
}

.mural-card.text-post {
  align-content: start;
  padding: 18px;
}

.mural-card:hover,
.artifact-card:hover {
  transform: none;
  box-shadow: var(--shadow-soft);
}

.mural-card img,
.artifact-card img,
.mural-placeholder,
.artifact-text-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  object-fit: contain;
  background: color-mix(in srgb, var(--surface-2) 70%, var(--panel));
}

.mural-card img {
  object-fit: cover;
}

.mural-placeholder,
.artifact-text-preview {
  display: grid;
  place-items: center;
  padding: 16px;
  color: var(--muted);
  font-weight: 750;
}

.artifact-card.text-artifact {
  grid-template-columns: 1fr;
  align-items: start;
}

.artifact-document-preview {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 190px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 12%, transparent), transparent),
    color-mix(in srgb, var(--surface-2) 66%, var(--panel));
  padding: 18px;
}

.artifact-card.just-created {
  outline: 3px solid color-mix(in srgb, var(--accent) 44%, transparent);
  outline-offset: 3px;
}

.artifact-missing {
  display: grid;
  min-height: 190px;
  place-items: center;
  border-radius: var(--radius);
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-2) 74%, var(--panel));
  font-weight: 820;
}

.mural-card.homily-post {
  align-content: start;
}

.mural-card.homily-post p {
  line-height: 1.65;
}

.compact-action {
  margin-top: 12px;
  width: fit-content;
}

.artifact-document-preview span {
  width: fit-content;
  border-radius: 999px;
  color: var(--primary-2);
  background: color-mix(in srgb, var(--primary) 12%, var(--panel));
  padding: 7px 11px;
  font-size: .8rem;
  font-weight: 850;
}

.artifact-document-preview p {
  display: -webkit-box;
  margin: 34px 0 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  color: var(--ink);
  line-height: 1.55;
}

.mural-card h3,
.artifact-card h3 {
  margin: 8px 0 4px;
  line-height: 1.22;
}

.mural-card p,
.artifact-card p {
  margin: 0 0 8px;
  color: var(--muted);
}

.mural-card small,
.artifact-card small {
  color: var(--muted);
}

.event-feed-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.event-feed-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 72px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.event-feed-card summary::-webkit-details-marker {
  display: none;
}

.event-feed-card summary strong,
.event-feed-card summary small {
  display: block;
}

.event-feed-card summary small {
  color: var(--muted);
}

.event-feed-card .media-feed {
  border-top: 1px solid var(--line);
  padding: 16px;
}

.media-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.photo-card {
  display: flex;
  min-height: 360px;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  color: #fff;
  background-position: center;
  background-size: cover;
  padding: 20px;
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease;
}

.photo-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.photo-card h2,
.photo-card p,
.video-card h2,
.video-card p {
  margin: 0;
}

.photo-card p {
  color: rgba(255,255,255,.86);
}

.video-card iframe,
.video-card video,
.media-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #10141c;
}

.video-card > div:not(.media-placeholder) {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.media-placeholder {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
}

.gallery-chip {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  color: var(--primary-2);
  background: color-mix(in srgb, var(--primary) 12%, #fff);
  padding: 0 10px;
  font-size: .78rem;
  font-weight: 800;
}

.photo-card .gallery-chip {
  color: #fff;
  background: rgba(255,255,255,.18);
}

.people-section {
  display: grid;
  gap: 16px;
  margin-bottom: 30px;
}

.section-kicker h2 {
  margin: 8px 0 0;
  font-size: clamp(1.65rem, 3vw, 2.4rem);
}

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

.person-card {
  overflow: hidden;
}

.person-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface-2);
}

.person-card > div {
  padding: 16px;
}

.person-card h3,
.pastoral-card h3 {
  margin: 0 0 4px;
  line-height: 1.25;
}

.person-card p,
.pastoral-card p {
  margin: 0;
  color: var(--muted);
}

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

.pastoral-card {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 16px;
}

.pastoral-card img {
  width: 118px;
  height: 118px;
  border-radius: var(--radius);
  object-fit: cover;
}

.responsible-line {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  row-gap: 1px;
  width: 100%;
  margin: 8px 0 10px !important;
  border-radius: 10px;
  color: var(--primary-2) !important;
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  padding: 8px 10px;
  font-size: .9rem;
  font-weight: 700;
}

.responsible-line span {
  display: grid;
  grid-row: span 2;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-size: .82rem;
  font-weight: 850;
}

.responsible-line small {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.responsible-line strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.place-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.place-body {
  padding: 20px 22px 12px;
  flex: 1;
}

.place-card .toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 22px 22px;
  margin-top: auto;
}

.place-card .toolbar .btn,
.place-actions .btn {
  min-width: 132px;
  justify-content: center;
  white-space: nowrap;
}

.place-card .map-toolbar {
  display: grid;
  gap: 0;
  margin: 0 22px 22px;
  padding: 0;
}

.place-card .map-toolbar .btn {
  min-width: 0;
  width: 100%;
  justify-content: center;
  white-space: nowrap;
}

.community-details {
  margin: 0 22px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 48%, var(--panel));
}

.community-details summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 13px;
  cursor: pointer;
  font-weight: 750;
  list-style: none;
}

.community-details summary::-webkit-details-marker {
  display: none;
}

.hamburger {
  position: relative;
  width: 20px;
  height: 14px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.hamburger::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 4px;
  border-top: 2px solid currentColor;
}

.community-event-list {
  display: grid;
  gap: 10px;
  padding: 0 13px 13px;
}

.community-event-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--panel);
}

.community-event-time {
  display: grid;
  min-height: 42px;
  place-items: center;
  border-radius: var(--radius);
  color: #fff !important;
  background: var(--primary);
  font-weight: 800;
}

.community-event-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .9rem;
}

.map-preview {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 12%, transparent), color-mix(in srgb, var(--secondary) 16%, transparent)),
    var(--surface-2);
}

.map-preview.compact {
  min-height: 150px;
}

.map-preview iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  filter: saturate(.9) contrast(.96);
}

.church-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  transform: translate(-50%, -70%);
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 8px;
  background: var(--primary);
  box-shadow: 0 12px 26px rgba(0,0,0,.28);
  rotate: -45deg;
}

.church-pin svg {
  width: 28px;
  height: 28px;
  rotate: 45deg;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-shell {
  min-height: calc(100vh - 72px);
  padding: 28px clamp(18px, 3vw, 40px);
}

.dashboard-frame {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  width: min(1680px, 100%);
  margin: 0 auto;
  align-items: start;
}

.admin-menu {
  position: sticky;
  top: 96px;
  align-self: start;
  min-height: calc(100vh - 120px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #10141c;
  color: #f8f5ee;
  box-shadow: var(--shadow);
}

.admin-menu .crest {
  border: 1px solid rgba(255,255,255,.15);
  box-shadow: none;
}

.admin-menu .sidebar-brand strong {
  color: #fff;
}

.admin-menu .sidebar-brand small {
  color: rgba(255,255,255,.62);
}

.admin-menu nav {
  display: grid;
  gap: 6px;
  margin: 22px 0;
}

.admin-menu .admin-tab {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  color: rgba(255,255,255,.72);
  background: transparent;
  padding: 8px 10px;
  text-align: left;
  white-space: normal;
}

.admin-menu .admin-tab span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 6px;
  background: rgba(255,255,255,.08);
  font-size: .8rem;
  line-height: 1;
}

.admin-menu .admin-tab.active,
.admin-menu .admin-tab:hover {
  color: #10141c;
  background: var(--secondary);
}

.admin-view-site {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-content: start;
  gap: 10px;
  min-height: 44px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius);
  color: #fff;
  background: rgba(255,255,255,.04);
  padding: 0 12px;
  font-weight: 750;
}

.admin-view-site span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 6px;
  background: rgba(255,255,255,.08);
}

.logout-action {
  margin-top: 12px;
  color: #f8f5ee;
  background: rgba(255,255,255,.06);
}

.dashboard-main {
  min-width: 0;
  width: 100%;
}

.dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding: 18px 0;
}

.dashboard-head h1 {
  margin: 8px 0 4px;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1.04;
  font-weight: 760;
}

.dashboard-head p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.dashboard-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.dashboard-user span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  font-size: .75rem;
  font-weight: 760;
}

.dashboard-user img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.span-2 {
  grid-column: 1 / -1;
}

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

.panel-head h2 {
  margin: 0 0 4px;
}

.panel-head p {
  margin: 0;
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.field.full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.btn.full,
.form-grid > button.full {
  grid-column: 1 / -1;
  width: 100%;
  white-space: nowrap;
}

.form-submit {
  width: fit-content;
  min-width: 210px;
  min-height: 48px;
}

.large-textarea {
  min-height: 190px;
  line-height: 1.65;
}

.field label {
  display: block;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  color: var(--muted);
  font-weight: 700;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.file-upload {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 88px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 58%, var(--panel));
  padding: 14px;
  cursor: pointer;
}

.upload-status {
  display: block;
  min-height: 18px;
  margin-top: 6px;
  color: var(--accent) !important;
  font-size: .78rem !important;
  font-weight: 850 !important;
}

.file-upload strong,
.file-upload small {
  display: block;
  min-width: 0;
}

.file-upload small {
  color: var(--muted);
}

.file-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.admin-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.admin-content-row,
.usage-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 42%, var(--panel));
  padding: 12px;
}

.admin-content-row strong,
.admin-content-row small,
.usage-row strong,
.usage-row small {
  display: block;
}

.admin-content-row small,
.usage-row small {
  color: var(--muted);
}

.admin-event-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 95%, transparent);
}

.admin-event-row.inactive {
  opacity: .62;
}

.admin-event-row h3 {
  margin: 8px 0 4px;
  font-size: 1.05rem;
  font-weight: 750;
}

.admin-event-row p,
.admin-event-row small {
  display: block;
  margin: 0;
  color: var(--muted);
}

.row-actions {
  justify-content: flex-end;
}

.status-dot,
.count-pill,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: .78rem;
  font-weight: 750;
}

.badge {
  color: var(--primary-2);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.status-dot.on {
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 12%, transparent);
}

.status-dot.off {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.person-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.person-row .person-avatar {
  margin: 0;
}

.person-row strong,
.person-row small {
  display: block;
}

.person-row small {
  color: var(--muted);
}

.team-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.team-admin-card {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  min-width: 0;
}

.team-admin-card .mini-photo {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  object-fit: cover;
}

.team-admin-info {
  min-width: 0;
}

.team-admin-info strong,
.team-admin-info small {
  display: block;
}

.team-admin-info strong {
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.team-admin-info small {
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.35;
}

.team-admin-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

.team-admin-actions .btn {
  min-width: 108px;
  min-height: 44px;
}

.admin-community-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: stretch;
}

.admin-place-card {
  min-height: 100%;
}

.place-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.identity-preview {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.identity-preview p {
  margin: 4px 0 0;
  color: var(--muted);
}

.appearance-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, .7fr);
  gap: 18px;
}

.image-upload,
.cover-upload {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 92px;
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 65%, var(--panel));
  padding: 14px;
  cursor: pointer;
}

.compact-upload {
  min-height: 78px;
}

.upload-preview {
  display: grid;
  width: 74px;
  height: 74px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.event-preview {
  width: 120px;
  height: 78px;
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.image-upload input,
.cover-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.image-upload strong,
.image-upload small {
  display: block;
}

.image-upload small {
  color: var(--muted);
}

.cover-upload {
  min-height: 170px;
  align-items: end;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(18,32,48,.74), rgba(18,32,48,.24)),
    var(--surface-2);
  background-position: center;
  background-size: cover;
}

.cover-upload span {
  border-radius: var(--radius);
  background: rgba(0,0,0,.42);
  padding: 9px 11px;
  font-weight: 750;
}

.palette-presets {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.palette-presets span {
  color: var(--muted);
  font-weight: 700;
}

.palette-presets button {
  display: inline-flex;
  gap: 4px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 7px;
}

.palette-presets i {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.preview-panel {
  align-self: start;
  position: sticky;
  top: 94px;
}

.preview-phone {
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.preview-hero {
  min-height: 240px;
  display: grid;
  align-content: end;
  gap: 10px;
  padding: 20px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(18,32,48,.74), rgba(18,32,48,.24)),
    var(--hero-image) center / cover no-repeat;
}

.preview-hero h3 {
  margin: 0;
  font-size: 1.45rem;
}

.preview-hero p {
  margin: 0;
  color: rgba(255,255,255,.84);
}

.preview-card {
  display: grid;
  gap: 4px;
  margin: 14px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--panel);
}

.preview-card span {
  color: var(--muted);
}

.invoice-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.invoice-line:last-child {
  border-bottom: 0;
}

.invoice-total {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid var(--ink);
  font-size: 1.24rem;
  font-weight: 760;
}

.ai-output {
  min-height: 200px;
  margin-top: 14px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 48%, var(--panel));
  white-space: pre-wrap;
}

.ai-output p {
  margin: 0 0 14px;
  line-height: 1.68;
}

.ai-loading {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 170px;
  text-align: center;
}

.ai-loading small {
  color: var(--muted);
}

.ai-spinner {
  width: 52px;
  height: 52px;
  border: 4px solid color-mix(in srgb, var(--primary) 15%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.generated-art {
  width: min(100%, 420px);
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.auth-page {
  min-height: calc(100vh - 72px);
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--primary) 10%, transparent), transparent 46%),
    linear-gradient(240deg, color-mix(in srgb, var(--secondary) 12%, transparent), transparent 42%);
}

.login-panel {
  width: min(520px, 100%);
  padding: clamp(24px, 4vw, 34px);
}

.login-panel h1 {
  margin: 0 0 22px;
  font-size: clamp(1.8rem, 4vw, 2.45rem);
  font-weight: 760;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 12, 18, .56);
  backdrop-filter: blur(10px);
}

.install-card {
  width: min(620px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 22px;
}

.install-steps {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.install-steps article {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 50%, var(--panel));
  padding: 14px;
}

.install-steps span {
  color: var(--muted);
}

.confirm-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 18px;
  width: min(560px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 24px;
}

.confirm-card h2,
.confirm-card p {
  margin: 0;
}

.confirm-card h2 {
  margin-top: 6px;
  font-size: 1.55rem;
}

.confirm-card p {
  margin-top: 8px;
  color: var(--muted);
}

.confirm-icon {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  font-weight: 900;
}

.quote-box {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
  padding: 16px;
}

.quote-box span,
.quote-box small {
  color: var(--muted);
  font-weight: 700;
}

.quote-box strong {
  font-size: 2rem;
  line-height: 1.05;
}

.confirm-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.media-modal {
  position: relative;
  overflow: hidden;
  width: min(860px, 100%);
  max-height: min(860px, calc(100vh - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.post-modal {
  display: grid;
  max-height: calc(100vh - 28px);
}

.media-modal .chat-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  background: rgba(16,20,28,.72);
}

.modal-media {
  display: block;
  width: 100%;
  max-height: 55vh;
  object-fit: contain;
  background: #10141c;
}

.modal-body {
  display: grid;
  gap: 10px;
  padding: 22px;
}

.post-modal .modal-body {
  overflow-y: auto;
  max-height: calc(100vh - 32px);
  padding-right: 26px;
  overscroll-behavior: contain;
}

.post-modal .modal-media + .modal-body {
  max-height: calc(100vh - 32px - 42vh);
}

.modal-kicker {
  max-width: calc(100% - 54px);
  width: fit-content;
  white-space: normal;
  line-height: 1.2;
}

.modal-body h2,
.modal-body p {
  margin: 0;
}

.modal-text {
  display: grid;
  gap: 12px;
  color: var(--muted);
  line-height: 1.65;
}

.post-modal .modal-text {
  color: var(--ink);
}

.modal-text p {
  margin: 0;
}

.full {
  width: 100%;
}

.super-frame {
  grid-template-columns: 300px minmax(0, 1fr);
}

.super-table {
  display: grid;
  gap: 10px;
}

.super-table button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--panel);
  padding: 12px 14px;
  text-align: left;
}

.super-table button.active {
  border-color: color-mix(in srgb, var(--primary) 38%, var(--line));
  background: color-mix(in srgb, var(--primary) 8%, var(--panel));
}

.super-table strong,
.super-table small {
  display: block;
}

.super-table small {
  color: var(--muted);
}

.super-table em {
  min-width: 86px;
  border-radius: 999px;
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 12%, transparent);
  padding: 5px 10px;
  text-align: center;
  font-size: .78rem;
  font-style: normal;
  font-weight: 750;
}

.access-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .58fr);
  gap: 18px;
  align-items: start;
}

.access-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 12px;
}

.access-user-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 42%, var(--panel));
  padding: 10px;
}

.access-user-head em {
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 12%, transparent);
  font-size: .76rem;
  font-style: normal;
  font-weight: 800;
}

.access-user-head em.inactive {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.access-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.access-row .person-avatar {
  margin: 0;
}

.access-row strong,
.access-row small {
  display: block;
}

.access-row small {
  color: var(--muted);
}

.access-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.access-form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 42%, var(--panel));
  padding: 14px;
}

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

.ai-status-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 42%, var(--panel));
  padding: 16px;
}

.ai-status-card strong {
  font-size: 1.25rem;
}

.ai-status-card small {
  color: var(--muted);
}

.ai-settings-form {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.usage-list {
  display: grid;
  gap: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chat-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 164px;
  height: 60px;
  padding: 0 18px 0 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #1f634d);
  color: #fff;
  box-shadow: 0 18px 44px color-mix(in srgb, var(--accent) 35%, transparent);
  font-weight: 760;
}

.chat-fab span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.16);
}

.chat-panel {
  position: fixed;
  right: 22px;
  bottom: 96px;
  z-index: 60;
  display: grid;
  grid-template-rows: auto auto minmax(280px, 1fr) auto;
  width: min(480px, calc(100vw - 32px));
  max-height: min(740px, calc(100vh - 122px));
  overflow: hidden;
  overscroll-behavior: contain;
  box-shadow: var(--shadow);
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  color: #fff;
  background: #111722;
}

.chat-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.chat-identity strong,
.chat-identity small {
  display: block;
}

.chat-identity small {
  margin-top: 2px;
  color: rgba(255,255,255,.68);
  font-size: .82rem;
}

.chat-close {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: rgba(255,255,255,.12);
  font-size: 1.25rem;
}

.chat-suggestions {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.chat-suggestions button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface);
  font-size: .84rem;
  font-weight: 700;
}

.chat-action-grid {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.chat-action-grid button {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--panel);
  padding: 8px 10px;
  text-align: left;
  font-weight: 750;
}

.chat-guided-footer {
  border-top: 1px solid var(--line);
  background: var(--panel);
  padding: 10px 14px;
  color: var(--muted);
}

.chat-log {
  display: grid;
  gap: 14px;
  align-content: start;
  min-height: 0;
  padding: 16px;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--surface-2);
}

.message-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

.message-row.user {
  grid-template-columns: minmax(0, 1fr) 34px;
}

.message-row.user .message-avatar {
  grid-column: 2;
  grid-row: 1;
}

.message-row.user > div {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
}

.message-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  font-size: .7rem;
  font-weight: 760;
}

.message-label {
  display: block;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 750;
}

.message {
  max-width: min(360px, 100%);
  padding: 12px 14px;
  border-radius: var(--radius);
  line-height: 1.5;
  white-space: pre-wrap;
  box-shadow: 0 7px 16px rgba(20,27,39,.06);
}

.message.user {
  justify-self: end;
  color: #fff;
  background: var(--primary);
}

.message.bot {
  justify-self: start;
  border: 1px solid var(--line);
  background: var(--panel);
}

.chat-card-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.chat-event-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.chat-event-time {
  display: grid;
  width: 76px;
  height: 44px;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: var(--primary);
  font-weight: 760;
  text-align: center;
}

.chat-event-time strong {
  font: inherit;
  min-width: 0;
}

.chat-event-time small {
  display: block;
  color: rgba(255,255,255,.82);
  font-size: .62rem;
  line-height: 1.05;
}

.chat-event-time.range {
  height: 54px;
  line-height: 1.05;
}

.chat-event-time.label {
  font-size: .72rem;
}

.chat-event-card strong,
.chat-event-card small {
  display: block;
  min-width: 0;
}

.chat-event-card > span {
  min-width: 0;
  overflow: hidden;
}

.chat-event-card strong {
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.chat-event-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .8rem;
}

.chat-event-card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 10px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--accent);
  font-size: .78rem;
  font-weight: 750;
  white-space: nowrap;
  text-align: center;
}

.chat-event-card.has-map a {
  grid-column: 1 / -1;
  width: 100%;
}

.chat-event-card.location-card {
  grid-template-columns: minmax(0, 1fr);
}

.chat-event-card.location-card > span {
  grid-column: 1 / -1;
}

.chat-media-card img {
  width: 70px;
  height: 54px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--surface-2);
}

.chat-map {
  grid-column: 1 / -1;
  overflow: hidden;
  border-radius: var(--radius);
}

.chat-map .map-preview {
  min-height: 120px;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.chat-form input {
  min-width: 0;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
  outline: none;
  background: var(--surface);
}

.chat-form button {
  min-width: 88px;
  min-height: 50px;
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
  font-weight: 760;
}

.public-secretariat {
  display: grid;
  grid-template-columns: minmax(280px, .55fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.secretariat-info-card,
.public-chat-card,
.secretary-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.secretariat-info-card {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.secretariat-info-card h2,
.secretary-panel h2 {
  margin: 0;
  font-size: 1.35rem;
}

.hours-box {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 52%, var(--panel));
  padding: 14px;
}

.hours-box span {
  color: var(--muted);
}

.public-chat-card {
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.wa-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 58%, var(--panel));
  padding: 12px 16px;
}

.wa-head span {
  min-width: 0;
}

.wa-head strong,
.wa-head small {
  display: block;
}

.wa-head small {
  color: var(--muted);
}

.public-wa-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.public-wa-head .chat-avatar {
  display: none;
}

.public-chat-person {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.public-chat-person small {
  display: flex;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}

.public-chat-person small span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.public-chat-person small span:first-child {
  max-width: 44%;
}

.compact-new-chat {
  min-height: 40px;
  padding-inline: 12px;
  white-space: nowrap;
}

.label-tight {
  display: none;
}

.start-chat-form {
  padding: 18px;
}

.wa-chat-log {
  display: grid;
  align-content: start;
  gap: 10px;
  height: min(620px, calc(100vh - 310px));
  min-height: 360px;
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 34%),
    color-mix(in srgb, var(--surface-2) 72%, var(--panel));
  padding: 18px;
}

.wa-message {
  display: grid;
  gap: 4px;
  width: fit-content;
  max-width: min(76%, 560px);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 14px;
  background: var(--panel);
  padding: 9px 11px;
  box-shadow: 0 6px 14px rgba(20,27,39,.06);
}

.wa-message.mine {
  justify-self: end;
  background: color-mix(in srgb, var(--accent) 20%, var(--panel));
}

.wa-message.theirs {
  justify-self: start;
}

.wa-message.system {
  justify-self: center;
  max-width: 82%;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-2) 82%, var(--panel));
  text-align: center;
}

.wa-message p {
  margin: 0;
  white-space: pre-wrap;
}

.wa-message small,
.wa-message time {
  color: var(--muted);
  font-size: .72rem;
}

.wa-message time {
  justify-self: end;
}

.wa-message img {
  max-width: min(320px, 100%);
  border-radius: 10px;
}

.wa-file {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 62%, var(--panel));
  padding: 0 12px;
  font-weight: 750;
}

.wa-message-form {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  padding: 12px;
  min-width: 0;
  overflow: hidden;
}

.wa-composer-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.wa-attachment-preview {
  display: none;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 70%, var(--panel));
  padding: 8px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 750;
  min-width: 0;
  max-width: 100%;
}

.wa-attachment-preview:not(:empty) {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 30px;
}

.wa-attachment-preview img {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  object-fit: cover;
  background: var(--surface);
}

.wa-file-chip {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: var(--accent);
  font-size: .82rem;
  font-weight: 900;
}

.wa-preview-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wa-preview-remove {
  display: grid;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--panel);
  padding: 0;
  font-size: .9rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.wa-message-form input[name="text"] {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 0 15px;
}

.wa-attach,
.wa-message-form button {
  display: grid;
  min-height: 46px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
}

.wa-attach {
  width: 46px;
  min-width: 46px;
  padding: 0;
}

.wa-message-form button {
  min-width: 96px;
  white-space: nowrap;
}

.wa-message-form .wa-preview-remove {
  width: 30px !important;
  min-width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 !important;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--panel) !important;
  font-size: .95rem;
  line-height: 1;
  box-shadow: none;
}

.wa-attach input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.wa-attach .upload-status {
  display: none !important;
}

.wa-attach strong,
.wa-attach small {
  display: none !important;
}

.secretary-shell {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr) 360px;
  gap: 16px;
  height: calc(100vh - 72px);
  min-height: 620px;
  overflow: hidden;
  padding: 18px;
  background: color-mix(in srgb, var(--surface-2) 68%, var(--surface));
}

.secretary-sidebar,
.secretary-chat,
.secretary-agenda {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.secretary-sidebar,
.secretary-agenda {
  display: grid;
  align-content: start;
}

.secretary-agenda {
  overflow: auto;
}

.secretary-brand {
  justify-content: space-between;
}

.secretariat-hours-form {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 12px;
}

.secretariat-hours-form label {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 750;
}

.secretariat-hours-form textarea {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 9px;
  resize: vertical;
}

.conversation-list {
  display: grid;
  gap: 6px;
  max-height: calc(100vh - 320px);
  overflow: auto;
  padding: 10px;
}

.conversation-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  border-radius: var(--radius);
  background: transparent;
  padding: 9px;
  text-align: left;
}

.conversation-item.active,
.conversation-item:hover {
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
}

.conversation-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  font-weight: 800;
}

.conversation-item strong,
.conversation-item small {
  display: block;
}

.conversation-item small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-item em {
  min-width: 24px;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  padding: 3px 7px;
  text-align: center;
  font-size: .75rem;
  font-style: normal;
  font-weight: 800;
}

.secretary-chat {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
}

.secretary-log {
  height: auto;
  min-height: 0;
}

.secretary-chat-head {
  align-items: center;
}

.secretary-chat-head > span:nth-child(2) {
  flex: 1 1 auto;
  min-width: 0;
}

.secretary-chat-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  margin-left: auto;
}

.secretary-chat-actions .btn {
  min-height: 38px;
  padding: 0 12px;
}

.secretary-panel .btn.full {
  white-space: nowrap;
}

.typing-pill {
  margin-left: auto;
  border-radius: 999px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 6px 10px;
  font-size: .78rem;
  font-weight: 750;
}

.secretary-agenda {
  gap: 12px;
  overflow: auto;
  padding: 12px;
}

.secretary-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.appointment-list {
  display: grid;
  gap: 10px;
}

.appointment-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 46%, var(--panel));
  padding: 12px;
}

.appointment-card span,
.appointment-card small {
  color: var(--muted);
}

.mini-photo {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 100;
  display: none;
  max-width: min(560px, calc(100vw - 32px));
  transform: translateX(-50%);
  border-radius: var(--radius);
  color: #fff;
  background: #111722;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

#toast.show {
  display: block;
}

.empty {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}

@media (max-width: 1100px) {
  .dashboard-frame,
  .hero-grid,
  .content-grid,
  .appearance-grid,
  .library-layout,
  .pdf-layout,
  .access-grid,
  .backup-actions,
  .filter-bar,
  .ai-settings-grid,
  .public-secretariat {
    grid-template-columns: 1fr;
  }

  .secretary-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh - 72px);
    overflow: visible;
  }

  .conversation-list {
    max-height: 320px;
  }

  .secretary-chat {
    min-height: 560px;
  }

  .admin-menu,
  .preview-panel,
  .library-nav {
    position: static;
    min-height: auto;
  }

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

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

@media (max-width: 760px) {
  .container,
  .hero-inner {
    width: min(100% - 28px, 1180px);
  }

  .topbar {
    align-items: center;
    flex-direction: row;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 14px;
  }

  .brand {
    flex: 0 0 auto;
    max-width: 210px;
  }

  .brand-title {
    max-width: 145px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand-subtitle {
    display: none;
  }

  .top-actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    margin-left: auto;
  }

  .top-actions .btn {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 11px;
  }

  .hero {
    min-height: 560px;
  }

  .hero h1 {
    font-size: clamp(2.35rem, 13vw, 3.35rem);
  }

  .section-title,
  .dashboard-grid,
  .form-grid,
  .stat-grid,
  .metric-grid,
  .gallery-strip,
  .reading-grid,
  .super-table button,
  .access-row,
  .access-fields,
  .admin-content-row,
  .usage-row {
    grid-template-columns: 1fr;
  }

  .dashboard-shell {
    padding: 14px;
  }

  .dashboard-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .admin-event-row {
    grid-template-columns: 1fr;
  }

  .event-card {
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
    padding: 12px;
  }

  .event-time {
    width: 100%;
    height: 46px;
    min-height: 46px;
    border-radius: 10px;
    font-size: .96rem;
  }

  .event-time.range {
    min-height: 52px;
    height: auto;
  }

  .event-copy .row.tight {
    gap: 6px;
    margin-bottom: 6px;
  }

  .event-copy h3 {
    margin-bottom: 4px;
    line-height: 1.18;
    font-size: 1.06rem;
  }

  .event-copy p,
  .event-copy small {
    line-height: 1.3;
    font-size: .92rem;
  }

  .event-actions {
    display: flex;
    align-self: stretch;
    justify-content: flex-end;
    justify-items: end;
  }

  .event-actions .btn.icon {
    width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
  }

  .event-actions .event-time.mini {
    display: none;
  }

  .post-modal {
    width: calc(100vw - 28px);
    max-height: calc(100dvh - 28px);
  }

  .post-modal .modal-body {
    max-height: calc(100dvh - 28px);
    padding: 20px 18px 22px;
  }

  .post-modal .modal-media + .modal-body {
    max-height: calc(100dvh - 28px - 34vh);
  }

  .modal-kicker {
    max-width: calc(100% - 48px);
    font-size: .72rem;
    letter-spacing: .04em;
  }

  .agenda-special-card {
    order: -1;
  }

  .agenda-special-card .event-list {
    display: grid;
    grid-auto-columns: unset;
    grid-auto-flow: row;
    grid-template-columns: 1fr;
    gap: 10px;
    overflow-x: visible;
    padding-bottom: 0;
    scroll-snap-type: none;
  }

  .agenda-special-card .event-card {
    scroll-snap-align: none;
  }

  .row-actions,
  .admin-event-row .row-actions .btn {
    width: 100%;
  }

  .admin-event-row .row-actions .btn {
    flex: 1;
  }

  .person-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .team-admin-grid {
    grid-template-columns: 1fr;
  }

  .team-admin-actions {
    grid-template-columns: 1fr;
  }

  .pastoral-card {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .artifact-card.text-artifact {
    grid-template-columns: 1fr;
  }

  .pastoral-card img {
    width: 84px;
    height: 84px;
  }

  .pdf-preview {
    grid-template-rows: auto minmax(420px, 1fr);
  }

  .pdf-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .library-tile {
    min-height: 92px;
  }

  .person-row .btn {
    grid-column: 1 / -1;
  }

  .chat-fab {
    min-width: 60px;
    width: 60px;
    height: 60px;
    right: 14px;
    bottom: 14px;
    padding: 0;
  }

  .chat-fab strong {
    display: none;
  }

  .chat-fab span {
    width: 60px;
    height: 60px;
    background: transparent;
  }

  .chat-panel {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: min(82vh, 720px);
    max-height: min(82vh, 720px);
    height: min(82dvh, 720px);
    max-height: min(82dvh, 720px);
    border-radius: 8px 8px 0 0;
    overscroll-behavior: contain;
  }

  .chat-event-card {
    grid-template-columns: 68px minmax(0, 1fr);
    align-items: start;
  }

  .chat-event-card.location-card {
    grid-template-columns: 1fr;
  }

  .chat-event-card a {
    grid-column: 1 / -1;
    justify-content: center;
    width: 100%;
  }

  .chat-event-time {
    width: 68px;
    min-height: 46px;
    height: auto;
    font-size: .9rem;
  }

  .chat-map {
    grid-column: 1 / -1;
  }

  .chat-map .map-preview {
    min-height: 132px;
  }

  .chat-form {
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .secretary-shell {
    padding: 10px;
  }

  .secretary-chat-head {
    flex-wrap: wrap;
  }

  .secretary-chat-actions {
    width: 100%;
    margin-left: 0;
  }

  .secretary-chat-actions .btn {
    flex: 1;
  }

  .secretary-panel .btn.full {
    min-width: 0;
    padding-inline: 10px;
    font-size: .92rem;
  }

  .wa-message {
    max-width: 88%;
  }

  .public-wa-head {
    min-height: 58px;
    padding: 10px 12px;
    gap: 8px;
  }

  .public-wa-head strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .95rem;
  }

  .public-wa-head small {
    overflow: hidden;
    font-size: .82rem;
  }

  .public-chat-person small {
    gap: 6px;
  }

  .compact-new-chat {
    min-height: 38px;
    padding-inline: 10px;
    font-size: .84rem;
  }

  .compact-new-chat .label-wide {
    display: none;
  }

  .compact-new-chat .label-tight {
    display: inline;
  }

  .wa-composer-row {
    grid-template-columns: 42px minmax(0, 1fr) minmax(76px, auto);
    gap: 8px;
  }

  .wa-message-form button {
    min-width: 76px;
    padding: 0 10px;
    white-space: nowrap;
    font-size: .9rem;
  }

  .wa-attach {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
  }

  .wa-attachment-preview {
    min-width: 0;
    grid-template-columns: 38px minmax(0, 1fr) 32px;
    gap: 8px;
    padding: 7px;
  }

  .wa-attachment-preview img,
  .wa-file-chip {
    width: 38px;
    height: 38px;
    border-radius: 8px;
  }

  .wa-message-form .wa-preview-remove {
    min-width: 28px !important;
    width: 28px !important;
    min-height: 28px !important;
    height: 28px !important;
    padding: 0 !important;
  }
}
