/* ============================================================
   Tabs (Prediger / Kirchen)
   ============================================================ */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
}
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  font-size: var(--text-md);
  font-weight: 600;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
  color: var(--text-light);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.tab-btn svg { flex-shrink: 0; }
.tab-btn .tab-label { white-space: nowrap; }
.tab-btn:hover {
  color: var(--text);
}
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.tab-btn .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 700;
  margin-left: 6px;
  line-height: 1;
}

.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* ============================================================
   Tabs inline search
   ============================================================ */
.tabs-search {
  margin-left: auto;
  flex: 1;
  max-width: 300px;
}
.tabs-search .search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.tabs-search .search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-light);
  pointer-events: none;
}
.tabs-search input {
  width: 100%;
  padding: 6px 32px 6px 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  background: var(--bg-card);
  color: var(--text);
}
.tabs-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}
.tabs-search .search-clear-btn {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  line-height: 0;
}
.tabs-search .search-clear-btn:hover {
  color: var(--text);
}

/* Search toggle button in tab bar — visually consistent with .msg-new-group-btn */
.tabs-search-toggle {
  width: var(--control-md);
  height: var(--control-md);
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.tabs-search-toggle:hover {
  color: var(--text);
  border-color: var(--primary);
  background: var(--bg);
}
.tabs-search-toggle.active {
  color: var(--primary);
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}
[data-theme="dark"] .tabs-search-toggle.active {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
}

/* Add button */
.add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.add-btn .add-btn-icon {
  flex-shrink: 0;
}

/* ============================================================
   Churches Grid + Cards (on Preachers page)
   ============================================================ */
.churches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.church-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
}
.church-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.church-card .picture {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.church-card .picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.church-card .picture .placeholder {
  font-size: 48px;
  color: var(--border);
}

.church-card .info {
  padding: var(--space-4);
}
.church-card .name-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.church-card .church-name {
  font-size: var(--text-md);
  font-weight: 600;
}
.church-card .church-name a {
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition);
}
.church-card .church-name a:hover {
  color: var(--primary);
}
.church-card .denomination {
  font-size: var(--text-sm);
  color: var(--accent);
  font-weight: 500;
}
.church-card .description {
  font-size: var(--text-sm);
  color: var(--text-light);
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* ============================================================
   Church Detail Page
   ============================================================ */

/* Addresses section */
.addresses-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}

.addresses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.address-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
}
.address-card[data-href] {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.address-card[data-href]:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}
.address-card[data-href]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.address-card .address-fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  left: auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  padding: 0;
  line-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.address-card .address-fav-btn svg {
  width: 18px;
  height: 18px;
}
.address-card .address-fav-btn:hover {
  background: rgba(0, 0, 0, 0.7);
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
}
.address-card .address-fav-btn.active {
  color: var(--danger);
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.92);
}
.address-card .address-fav-btn.active:hover {
  background: #fff;
  border-color: #fff;
}
.address-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  padding-right: 40px;
}
.address-card-header .address-name,
.address-card-header .address-label {
  flex: 1;
  min-width: 0;
}
.address-card .address-name {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.address-card .address-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.address-card .address-label .primary-badge {
  display: inline-block;
  font-size: var(--text-xs);
  background: var(--accent);
  color: #fff;
  padding: 1px 6px;
  border-radius: var(--radius);
  margin-left: 6px;
  text-transform: none;
  letter-spacing: 0;
}
.address-card .address-line {
  font-size: var(--text-base);
  color: var(--text);
  line-height: 1.5;
}

/* Service times (view) */
.service-times {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.service-times-title {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.service-time-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  line-height: 1.8;
}
.service-time-day {
  font-weight: 500;
  min-width: 80px;
}
.service-time-clock {
  color: var(--primary);
  font-weight: 600;
}
.service-time-label {
  color: var(--text-light);
  font-size: var(--text-sm);
}

/* Address edit */
.address-edit-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  position: relative;
}
.address-edit-card .address-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.address-edit-card .address-edit-header .btn-remove {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
  transition: color var(--transition);
}
.address-edit-card .address-edit-header .btn-remove:hover {
  color: var(--danger);
}
.address-edit-card .address-edit-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.address-edit-card .address-edit-fields .full-width {
  grid-column: 1 / -1;
}
.address-edit-card input,
.address-edit-card select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  background: var(--bg-card);
  color: var(--text);
}
.address-edit-card input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}
.address-edit-card label.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  cursor: pointer;
}

/* Service times (edit) */
.service-times-edit {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.service-times-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.service-times-edit-header strong {
  font-size: var(--text-sm);
}
.service-time-edit-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.service-time-edit-row select,
.service-time-edit-row input {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  background: var(--bg-card);
  color: var(--text);
}
.service-time-edit-row select {
  min-width: 110px;
}
.service-time-edit-row input[type="time"] {
  width: 100px;
}
.service-time-edit-row input[type="text"] {
  flex: 1;
  min-width: 0;
}
.service-time-edit-row select:focus,
.service-time-edit-row input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}
.btn-remove-st {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.btn-remove-st:hover {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}

/* Preachers mini-cards (on church detail) */
.preachers-mini-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}

.preachers-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.preacher-mini-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.preacher-mini-card .preacher-mini-fav-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  left: auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 0;
  z-index: 2;
  transition: background var(--transition), color var(--transition);
}
.preacher-mini-card .preacher-mini-fav-btn svg {
  width: 18px;
  height: 18px;
}
.preacher-mini-card .preacher-mini-fav-btn:hover {
  background: var(--bg-hover);
  color: var(--danger);
}
.preacher-mini-card .preacher-mini-fav-btn.active {
  background: transparent;
  color: var(--danger);
}
.preacher-mini-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  color: var(--text);
}
.preacher-mini-card .mini-pic {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.preacher-mini-card .mini-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.preacher-mini-card .mini-pic .placeholder {
  font-size: 18px;
  color: var(--border);
}
.preacher-mini-card .mini-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.preacher-mini-card .mini-name {
  font-size: var(--text-base);
  font-weight: 500;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.preacher-mini-card .mini-name span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preacher-mini-card .mini-title {
  font-size: var(--text-xs);
  color: var(--text-light);
}

/* Church detail: fav button without edit button → position right: 16px */
.profile-card .profile-fav-btn:last-child {
  right: 16px;
}

/* ============================================================
   Hero banner variant of profile-card (used on church-detail.html)
   Photo fills the whole card; name + denomination + description
   are overlaid on top with a dark gradient scrim for readability.
   ============================================================ */

.profile-card.profile-card-hero {
  position: relative;
  display: block;
  padding: 0;
  overflow: hidden;
  min-height: 280px;
  background: linear-gradient(135deg, #4a6fa5 0%, #3c5a87 100%);
}

.profile-card.profile-card-hero .profile-picture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: transparent;
  margin: 0;
  padding: 0;
  overflow: hidden;
  flex: none;
}

.profile-card.profile-card-hero .profile-picture img,
.profile-card.profile-card-hero .profile-picture video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-card.profile-card-hero .profile-picture .placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 96px;
  color: rgba(255, 255, 255, 0.5);
}

.profile-hero-scrim {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 70%;
  background: linear-gradient(to top,
    rgba(0, 0, 0, 0.78) 0%,
    rgba(0, 0, 0, 0.45) 45%,
    rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
  z-index: 1;
}

.profile-card.profile-card-hero .profile-info {
  position: relative;
  z-index: 2;
  padding: 100px 28px 22px;
  color: #fff;
}

.profile-card.profile-card-hero .profile-name {
  color: #fff;
  font-size: clamp(var(--text-xl), 5vw, 44px);
  line-height: 1.1;
  margin: 0 0 8px;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.profile-card.profile-card-hero .profile-dienst {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
  margin-bottom: 8px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

.profile-card.profile-card-hero .profile-description {
  color: rgba(255, 255, 255, 0.92);
  font-size: var(--text-base);
  line-height: 1.5;
  max-width: 760px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  margin: 0;
}

/* Logo overlay positioned above the banner (top-left) */
.profile-card.profile-card-hero .profile-logo-overlay {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 3;
  width: 96px;
  height: 96px;
  padding: 8px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-card.profile-card-hero .profile-logo-overlay img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
/* When a logo is shown, push the text down so it doesn't sit under the logo */
.profile-card.profile-card-hero.has-logo { min-height: 340px; }
.profile-card.profile-card-hero.has-logo .profile-info { padding-top: 140px; }
@media (max-width: 640px) {
  .profile-card.profile-card-hero .profile-logo-overlay {
    width: 68px;
    height: 68px;
    top: 14px;
    left: 14px;
    padding: 6px;
    border-radius: var(--radius-lg);
  }
  .profile-card.profile-card-hero.has-logo { min-height: 260px; }
  .profile-card.profile-card-hero.has-logo .profile-info { padding-top: 100px; }
}

/* Action buttons overlaid on the banner need a dark backdrop for readability */
.profile-card.profile-card-hero .btn-icon {
  z-index: 3;
  color: #fff !important;
  background: rgba(0, 0, 0, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  backdrop-filter: blur(4px);
}
.profile-card.profile-card-hero .btn-icon:hover {
  background: rgba(0, 0, 0, 0.7) !important;
  border-color: rgba(255, 255, 255, 0.6) !important;
}

/* Favorite heart anchored top-right of the hero banner. Overrides the
   preacher-detail.css absolute positioning that targets .profile-fav-btn
   globally (top: 16px / right: 56px) so the button sits in the corner of
   the banner card. Active styling is inherited from .btn-icon.active below
   (red heart on light backdrop). */
.profile-card.profile-card-hero .profile-fav-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  left: auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.profile-card.profile-card-hero .profile-fav-btn.active svg {
  fill: currentColor;
}
@media (max-width: 640px) {
  .profile-card.profile-card-hero .profile-fav-btn {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
  }
}

.profile-card.profile-card-hero .btn-icon.active {
  color: var(--danger) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(255, 255, 255, 0.92) !important;
}

@media (max-width: 640px) {
  .profile-card.profile-card-hero { min-height: 220px; }
  .profile-card.profile-card-hero .profile-info { padding: 70px 18px 16px; }
  .profile-card.profile-card-hero .profile-name { font-size: var(--text-xl); }
}

/* Picture/Video upload preview (used in unified church edit modal) */
.picture-preview {
  width: 100%;
  height: 150px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 8px;
  cursor: pointer;
  position: relative;
  background: var(--bg-subtle, #f5f7fa);
}
.picture-preview img,
.picture-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.picture-preview .upload-placeholder {
  color: var(--text-light);
  font-size: var(--text-base);
  text-align: center;
}
.picture-preview input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.picture-preview-logo {
  height: 110px;
  background-color: #f5f7fa;
  background-image:
    linear-gradient(45deg, #e5e9ef 25%, transparent 25%),
    linear-gradient(-45deg, #e5e9ef 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e5e9ef 75%),
    linear-gradient(-45deg, transparent 75%, #e5e9ef 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.picture-preview-logo.has-bg-color {
  background-color: var(--logo-preview-bg, #f5f7fa);
  background-image: none;
}
.picture-preview-logo img {
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}
.form-hint {
  display: block;
  color: var(--text-light);
  font-size: var(--text-sm);
  margin-top: -4px;
}

/* Unified church edit modal — link edit rows (platform + handle) */
.link-edit-row.link-edit-row--unified {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}
.link-edit-row.link-edit-row--unified .link-icon {
  flex-shrink: 0;
}
.link-edit-row.link-edit-row--unified .link-prefix {
  flex-shrink: 0;
  color: var(--text-light);
  font-size: var(--text-sm);
  font-family: monospace;
  background: var(--bg-subtle, #f5f7fa);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
  white-space: nowrap;
}
.link-edit-row.link-edit-row--unified input {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-base);
  background: var(--bg-card);
  color: var(--text);
}
.link-edit-row.link-edit-row--unified .btn-remove {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
}
.link-edit-row.link-edit-row--unified .btn-remove:hover {
  color: var(--danger);
}
.link-add-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.link-add-row .link-add-select {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-size: var(--text-base);
}
@media (max-width: 520px) {
  .link-edit-row.link-edit-row--unified { flex-wrap: wrap; }
  .link-edit-row.link-edit-row--unified .link-prefix { font-size: var(--text-sm); }
}

/* Unified church edit modal — section-jump buttons */
.church-edit-sections {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.church-edit-sections h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 10px;
}
.church-edit-actions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
@media (min-width: 520px) {
  .church-edit-actions-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   Drag & Drop / Sortable
   ============================================================ */
.drag-handle {
  cursor: grab;
  color: var(--text-light);
  font-size: 18px;
  padding: 2px 6px;
  user-select: none;
  flex-shrink: 0;
  line-height: 1;
}
.drag-handle:hover {
  color: var(--text);
}
.drag-handle:active {
  cursor: grabbing;
}

.sortable-ghost {
  opacity: 0.3;
}
.sortable-chosen {
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.sortable-drag {
  opacity: 0.9;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* Preacher sort list */
.preachers-sort-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.preacher-sort-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  transition: box-shadow var(--transition);
}
.preacher-sort-item .mini-pic {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.preacher-sort-item .mini-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.preacher-sort-item .mini-pic .placeholder {
  font-size: 16px;
  color: var(--border);
}
.preacher-sort-item .mini-name {
  font-size: var(--text-base);
  font-weight: 500;
  flex: 1;
  min-width: 0;
}
.preacher-sort-item .btn-remove {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
  transition: color var(--transition);
}
.preacher-sort-item .btn-remove:hover {
  color: var(--danger);
}

/* ============================================================
   Dark mode overrides
   ============================================================ */
[data-theme="dark"] .address-edit-card input,
[data-theme="dark"] .address-edit-card select,
[data-theme="dark"] .service-time-edit-row select,
[data-theme="dark"] .service-time-edit-row input {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  .churches-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }
  .addresses-grid {
    grid-template-columns: 1fr;
  }
  .preachers-mini-grid {
    grid-template-columns: 1fr;
  }
  .address-edit-card .address-edit-fields {
    grid-template-columns: 1fr;
  }
  .service-time-edit-row {
    flex-wrap: wrap;
  }
  .service-time-edit-row input[type="text"] {
    width: 100%;
  }
  /* Tabs collapse to icon-only on phones so the label-bearing tabs plus the
     search/action icons still fit on one row — same behaviour as the notes
     tab strip. */
  .tab-btn .tab-label { display: none; }
}

@media (max-width: 480px) {
  .churches-grid { max-width: none; }
  .church-card .info { padding: var(--space-3); }
  /* Tabs: align-items stretch (override inline-style 'center'), damit der
     tab-btn die volle Container-Hoehe einnimmt und sein border-bottom
     direkt auf der .tabs-border-bottom liegt — sonst schwebt der aktive
     Indikator wegen der hoeheren Action-Icons (36px) ueber der Linie. */
  .tabs {
    flex-wrap: nowrap !important;
    gap: 4px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    align-items: stretch !important;
  }
  .tab-btn {
    padding: 8px 10px;
    font-size: var(--text-sm);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs-search { max-width: none; margin-left: auto; }
  /* Action-Icons (Lupe, Neue Unterhaltung, Neue Gruppe) groesser fuer
     bessere Touch-Targets. Die runde Form bleibt erhalten. */
  .tabs-search-toggle,
  .msg-new-group-btn {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
  }
  .add-btn .add-btn-text { display: none; }
  .add-btn {
    padding: 0;
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    gap: 0;
    font-size: 24px;
    line-height: 1;
  }
  .add-btn::before {
    content: "+";
    display: block;
    line-height: 1;
    font-weight: 500;
  }
}

/* ============================================================
   Checkbox-Zeile in der Kirchen-Bearbeitung ("Netzwerk ausblenden")
   ============================================================
   .form-group input { width: 100% } (style.css) streckt sonst die Checkbox auf
   volle Breite und drückt den Label-Text in die nächste Zeile. Box und Text
   gehören auf eine Zeile, vertikal zentriert. */
.form-group.form-check > label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.form-group.form-check input[type="checkbox"] {
  width: auto;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}
