:root {
  --bg: #f7f0e8;
  --surface: #ede4d8;
  --card: #ffffff;
  --border: #d8c9b5;
  --gold: #7a5218;
  --gold-light: #a0722a;
  --gold-dim: #c49240;
  --rose: #a83840;
  --sage: #2e6e46;
  --text: #1a100a;
  --text-muted: #4a3020;
  --text-dim: #7a6050;
  --bride-color: #a83840;
  --groom-color: #1e5a9a;
  --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  min-height: 100vh;
}

/* Header */
/* ── Brand header (scrolls away) ────────────────────────────────────── */
.brand-header {
  background: linear-gradient(135deg, #fff8f0 0%, #fdf3ea 100%);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand-text {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.brand-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.3px;
}
.brand-header > .brand-text > span {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* Logout button — lives in brand-header */
.logout-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(122,82,24,0.08);
  border: 1px solid rgba(122,82,24,0.25);
  border-radius: 30px;
  padding: 7px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--gold);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.logout-btn:hover {
  background: rgba(168,56,64,0.08);
  border-color: var(--rose);
  color: var(--rose);
}
.logout-role { font-weight: 600; }
.logout-sep  { opacity: 0.4; }
.logout-action { opacity: 0.75; font-size: 11px; }

/* ── Sticky controls bar ─────────────────────────────────────────────── */
.controls-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(26,18,8,0.06);
  backdrop-filter: blur(10px);
}

.controls-inner {
  padding: 10px 24px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.controls-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.reset-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.reset-btn:hover { background: var(--gold); border-color: var(--gold); color: #fff; }

/* Count-filter pills (replace both stat-pill + filter buttons) */
.count-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 6px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.count-pill:hover { border-color: var(--gold-dim); color: var(--gold); }
.count-pill.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff8ef;
}
.count-pill.active .dot { opacity: 0.9; }
.pill-num {
  font-size: 11px;
  opacity: 0.75;
}
.count-pill.active .pill-num { opacity: 0.85; }

.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot.bride { background: var(--bride-color); }
.dot.groom { background: var(--groom-color); }

.download-manager-btn {
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.download-manager-btn:hover { background: var(--gold-light); }

/* Controls — kept for any legacy usage */
.controls {
  display: none;
}

.search-box { position: relative; flex: 1; min-width: 220px; }

.search-box input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 36px 10px 40px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 400;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input::placeholder { color: var(--text-dim); }
.search-box input:focus { border-color: var(--gold-dim); }

.search-box::before {
  content: '⌕';
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 18px;
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.search-clear:hover { background: var(--rose); color: #fff; border-color: var(--rose); }
.search-clear.visible { display: flex; }

.filter-group { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover { border-color: var(--gold-dim); color: var(--gold); }
.filter-btn.active { background: var(--gold); border-color: var(--gold); color: #fff; }

select.filter-btn {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234a3020' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

select.filter-btn option { background: var(--card); color: var(--text); }

/* Grid */
.grid-container {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(680px, 1fr));
  gap: 20px;
}

/* Profile Card */
.profile-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  height: 340px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.profile-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 36px rgba(26,16,10,0.12);
  border-color: var(--gold-dim);
}

.profile-card.bride { border-left: 3px solid var(--bride-color); }
.profile-card.groom { border-left: 3px solid var(--groom-color); }

/* Card Images */
.card-images {
  width: 46%;
  flex-shrink: 0;
  position: relative;
  background: #ede4d8;
  overflow: hidden;
}

.image-slider { width: 100%; height: 100%; position: relative; }

.image-slide {
  position: absolute;
  inset: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  opacity: 0;
  transform: scale(1.02);
}

.image-slide.active { opacity: 1; transform: scale(1); }

.image-slide img { width: 100%; height: 100%; object-fit: contain; display: block; background: var(--surface); }

.image-slide .img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ede4d8, #e0d0bc);
  font-family: 'Cormorant Garamond', serif;
  font-size: 64px;
  color: var(--gold-dim);
}

.img-nav {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}

.img-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(26,16,10,0.25);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  border: none;
}

.img-dot.active { background: var(--gold); transform: scale(1.3); }

.img-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(26,16,10,0.12);
  border-radius: 50%;
  width: 30px; height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  font-size: 16px;
  z-index: 10;
  transition: background 0.2s;
}

.img-arrow:hover { background: rgba(255,255,255,0.97); }
.img-arrow.prev { left: 8px; }
.img-arrow.next { right: 8px; }

.img-count-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(26,16,10,0.1);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

/* Card Details */
.card-details { width: 54%; display: flex; flex-direction: column; overflow: hidden; }

.card-header { padding: 14px 16px 10px; border-bottom: 1px solid var(--border); flex-shrink: 0; }

.name-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.profile-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 21px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: 0.2px;
}

.uid-row {
  display: flex;
  align-items: center;
  margin-top: 4px;
}

.uid-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-family: 'DM Sans', sans-serif;
}
.uid-copy-btn:hover { background: #ede4d3; border-color: var(--gold); }
.uid-copy-btn.uid-copy-ok { border-color: #4caf50; }
.uid-copy-btn.uid-copy-ok .uid-copy-icon { color: #4caf50; }

.uid-text {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 1px;
  font-weight: 600;
  white-space: nowrap;
}

.uid-copy-icon {
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.6;
  line-height: 1;
}

.tag-row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }

.tag { font-size: 11px; font-weight: 500; padding: 3px 10px; border-radius: 20px; border: 1px solid; }

.tag.bride  { background: rgba(168,56,64,0.08); border-color: rgba(168,56,64,0.3); color: var(--bride-color); }
.tag.groom  { background: rgba(30,90,154,0.08); border-color: rgba(30,90,154,0.3); color: var(--groom-color); }
.tag.neutral{ background: rgba(122,82,24,0.08); border-color: rgba(122,82,24,0.3); color: var(--gold); }
.tag.green  { background: rgba(46,110,70,0.08); border-color: rgba(46,110,70,0.3); color: var(--sage); }

.card-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 10px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.card-scroll::-webkit-scrollbar { width: 4px; }
.card-scroll::-webkit-scrollbar-track { background: transparent; }
.card-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.detail-section { margin-bottom: 12px; }

.section-label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 5px;
  font-weight: 600;
}

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; }
.detail-item { display: flex; flex-direction: column; gap: 1px; }

.detail-key { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 500; }
.detail-val { font-size: 12.5px; color: var(--text); font-weight: 400; line-height: 1.4; }

.divider { height: 1px; background: var(--border); margin: 8px 0; }

/* Card Footer */
.card-footer {
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

/* WhatsApp share button — on profile cards */
.wa-share-btn {
  flex: 1;
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  border: 1px solid #86efac;
  border-radius: 8px;
  padding: 7px 12px;
  color: #15803d;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.wa-share-btn:hover { background: linear-gradient(135deg, #bbf7d0, #86efac); border-color: #4ade80; }

/* Full Details button */
.contact-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.contact-btn:hover { border-color: var(--gold); color: var(--gold); }

/* Horoscope button — used only inside Full Details modal */
.horoscope-btn {
  background: linear-gradient(135deg, #fdf3e3, #f0e4c8);
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  padding: 7px 14px;
  color: var(--gold);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-decoration: none;
  white-space: nowrap;
  width: 100%;
}
.horoscope-btn:hover { background: linear-gradient(135deg, #f0e4c8, #e4d0a8); border-color: var(--gold); }

/* Loading */
.loading-state { padding: 80px 32px; text-align: center; color: var(--text-muted); }

.spinner {
  width: 38px; height: 38px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

.empty-state { padding: 80px 32px; text-align: center; color: var(--text-muted); grid-column: 1/-1; }
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,16,10,0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s;
}
.modal-overlay.open .modal { transform: translateY(0); }

/* Close button — floats top-right over the banner */
.modal-close-abs {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 10;
  background: rgba(255,255,255,0.8);
  border: 1px solid var(--border);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
}
.modal-close-abs:hover { border-color: var(--rose); color: var(--rose); background: #fff; }

/* Prev / Next profile navigation buttons */
.modal-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.9);
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.modal-nav-btn:hover { border-color: var(--gold); color: var(--gold); background: #fff; }
.modal-nav-prev { left: max(12px, calc(50% - 960px/2 - 56px)); }
.modal-nav-next { right: max(12px, calc(50% - 960px/2 - 56px)); }

@media (max-width: 1080px) {
  .modal-nav-btn {
    top: auto;
    bottom: 14px;
    transform: none;
    width: 36px; height: 36px;
    font-size: 18px;
  }
  .modal-nav-prev { left: 12px; }
  .modal-nav-next { right: 12px; }
}

/* On the bottom-sheet layout, the overlay above the modal is tiny —
   move nav buttons into that gap at the top instead */
@media (max-width: 700px) {
  .modal-nav-btn {
    top: 8px;
    bottom: auto;
  }
}

/* Scrollable body */
.modal-body {
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ── Outer layout wrapper ────────────────────────────────────── */
.md-layout {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* ── Top banner: name + UID ──────────────────────────────────── */
.md-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 56px 14px 20px; /* right padding leaves room for close btn */
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.md-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.md-banner-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 700;
  color: #fff8ef;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.md-banner-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.15);
  color: #fff8ef;
}
.md-banner-tag.bride,
.md-banner-tag.groom {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.4);
  color: #fff8ef;
}

.md-banner-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.md-banner-reg {
  font-size: 11px;
  color: rgba(255,248,239,0.85);
  letter-spacing: 0.3px;
}

/* UID copy pill needs light styling against the gold banner */
.md-banner-right .uid-copy-btn {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.4);
}
.md-banner-right .uid-copy-btn:hover { background: rgba(255,255,255,0.28); border-color: #fff; }
.md-banner-right .uid-text { color: #fff8ef; }
.md-banner-right .uid-copy-icon { color: rgba(255,248,239,0.8); }

/* ── Main row: photos left + details right ───────────────────── */
.md-main {
  display: flex;
  flex: 1;
  align-items: flex-start;
  min-height: 0;
}

/* Left column — photos stacked vertically */
.md-left {
  flex: 0 0 40%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 14px 16px 16px;
  position: sticky;
  top: 0;
  align-self: flex-start;
}

/* Drag handle between photo column and details column */
.md-resize-handle {
  width: 10px;
  margin: 0 -5px;
  flex-shrink: 0;
  cursor: col-resize;
  position: relative;
  align-self: stretch;
  z-index: 5;
  pointer-events: auto;
  background: transparent;
  transition: background 0.15s;
}
.md-resize-handle::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--border);
  transform: translateX(-50%);
}
.md-resize-handle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 3px;
  height: 32px;
  border-radius: 3px;
  background: var(--text-dim);
  opacity: 0.4;
  z-index: 1;
}
.md-resize-handle:hover::after { background: var(--gold); }
.md-resize-handle:hover::before,
body.md-resizing .md-resize-handle::before { background: var(--gold); opacity: 1; }
body.md-resizing .md-resize-handle::after { background: var(--gold); }

body.md-resizing { cursor: col-resize; user-select: none; }

.md-photo {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: zoom-in;
  display: block;
}

.md-photo-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, #ede4d8, #e0d0bc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 40px;
  color: var(--gold-dim);
}

/* Right column — details + horoscope button at bottom */
.md-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Two-column detail grid */
.md-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
}

.md-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.md-row:nth-child(even) { border-right: none; }
.md-row:last-child,
.md-row:nth-last-child(2):nth-child(odd) { border-bottom: none; }

.md-key {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  font-weight: 600;
  word-break: break-word;
}

.md-val {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

/* Horoscope button row — below the details grid */
.md-horo-row {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.md-horo-btn { width: 100%; text-align: center; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 700px) {
  .modal { max-width: 100%; border-radius: 16px 16px 0 0; max-height: 95vh; }
  .modal-overlay { padding: 0; align-items: flex-end; }

  .md-main { flex-direction: column; }

  .md-resize-handle { display: none; }

  .md-left {
    width: 100% !important;
    flex-direction: row;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    gap: 10px;
  }
  .md-photo, .md-photo-placeholder {
    width: calc(50% - 5px);
    aspect-ratio: 3/4;
  }

  .md-grid { grid-template-columns: 1fr; }
  .md-row { border-right: none; }
  .md-row:nth-last-child(2):nth-child(odd) { border-bottom: 1px solid var(--border); }
  .md-row:last-child { border-bottom: none; }
}
.results-bar {
  padding: 10px 24px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.results-bar .count { color: var(--gold); font-weight: 600; }

/* Responsive */
@media (max-width: 768px) {
  .brand-header { padding: 12px 16px 10px; }
  .brand-header h1 { font-size: 22px; }
  .brand-header span { display: none; }
  .controls-inner { padding: 8px 12px; gap: 6px; }
  .controls-actions { margin-left: 0; }
  .count-pill { padding: 5px 10px; font-size: 11px; }
  .download-manager-btn { font-size: 12px; padding: 7px 12px; }

  .controls { padding: 12px 16px; gap: 8px; }
  .search-box { min-width: 100%; width: 100%; }
  .filter-group { width: 100%; }
  .filter-btn { padding: 7px 10px; font-size: 12px; flex: 1; text-align: center; }
  select.filter-btn { flex: 1; min-width: 130px; }

  .results-bar { padding: 8px 16px; }

  .grid-container { grid-template-columns: 1fr; padding: 12px 16px; gap: 14px; }

  .profile-card { flex-direction: column; height: auto; }
  .card-images { width: 100%; height: 160px; flex-shrink: 0; }
  .card-details { width: 100%; }
  .card-scroll { max-height: 200px; }
  .card-header { padding: 10px 12px 8px; }
  .profile-name { font-size: 17px; }
  .card-footer { padding: 6px 12px; }
  .horoscope-btn, .contact-btn, .wa-share-btn { font-size: 11px; padding: 6px 10px; }

}

@media (max-width: 400px) {
  .stat-pill { display: none; }
}

/* ── Image loading spinner ───────────────────────────────────────────── */
.image-slide.img-loading {
  background: var(--surface);
}
.image-slide.img-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 2px solid var(--border);
  border-top-color: var(--gold-dim);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 5;
}

/* ── Contact hidden notice for guests ────────────────────────────────── */
.contact-hidden-notice {
  font-size: 11px;
  color: var(--text-dim);
  padding: 8px 10px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px dashed var(--border);
  text-align: center;
  margin-top: 4px;
  letter-spacing: 0.3px;
}

/* ── Lightbox ────────────────────────────────────────────────────────── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 6, 3, 0.96);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lightbox-overlay.open { opacity: 1; pointer-events: all; }

.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7);
  user-select: none;
  transition: opacity 0.2s;
  display: block;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  color: #fff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 10000;
}
.lightbox-close:hover { background: rgba(255,255,255,0.28); }

.lightbox-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 10000;
}
.lightbox-arrow:hover { background: rgba(255,255,255,0.24); }
.lightbox-arrow.prev { left: 18px; }
.lightbox-arrow.next { right: 18px; }

.lightbox-caption {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.45);
  font-size: 12px;
  letter-spacing: 1.5px;
  z-index: 10000;
  font-family: 'DM Sans', sans-serif;
}

/* Mobile lightbox */
@media (max-width: 768px) {
  .brand-header { padding: 10px 14px; }
  .brand-header h1 { font-size: 20px; }
  .brand-header > .brand-text > span { display: none; }
  .logout-btn { padding: 6px 12px; font-size: 11px; }
  .logout-action { display: none; }

  .lightbox-img { max-width: 100vw; max-height: 82vh; border-radius: 0; }
  .lightbox-close { top: 10px; right: 10px; width: 36px; height: 36px; font-size: 15px; }
  .lightbox-arrow { top: auto; bottom: 54px; transform: none; width: 44px; height: 44px; font-size: 22px; }
  .lightbox-arrow.prev { left: 14px; }
  .lightbox-arrow.next { right: 14px; }
  .lightbox-caption { bottom: 14px; }
}

/* ── Horoscope lightbox ───────────────────────────────────────────────── */
.horo-lightbox { align-items: center; justify-content: center; }

.horo-lightbox-inner {
  display: flex;
  flex-direction: column;
  width: 90vw;
  height: 90vh;
  background: #1a1208;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.8);
}

.horo-lightbox-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  gap: 10px;
  flex-shrink: 0;
}

.horo-lightbox-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  letter-spacing: 0.3px;
  flex: 1;
}

.horo-frame {
  flex: 1;
  width: 100%;
  border: none;
  background: #fff;
}

.horo-lightbox-footer {
  padding: 8px 16px;
  background: rgba(0,0,0,0.3);
  flex-shrink: 0;
  text-align: center;
}

@media (max-width: 768px) {
  .horo-lightbox-inner { width: 100vw; height: 100dvh; border-radius: 0; }
}

/* ── Login (email + OTP) ─────────────────────────────────────────────── */
body.locked { overflow: hidden; }

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #fff8f0 0%, #f7f0e8 55%, #ede4d8 100%);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px 30px;
  box-shadow: 0 10px 40px rgba(122, 82, 24, 0.12);
}
.login-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px;
  font-weight: 600;
  color: var(--gold);
  text-align: center;
  line-height: 1.1;
}
.login-sub {
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
  margin: 6px 0 26px;
}
.login-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.login-input {
  width: 100%;
  padding: 12px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--text);
  background: #fffdfa;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login-input:focus {
  border-color: var(--gold-light);
  box-shadow: 0 0 0 3px rgba(160, 114, 42, 0.18);
}
.login-otp {
  text-align: center;
  font-size: 26px;
  letter-spacing: 12px;
  font-weight: 500;
  padding: 12px 8px 12px 20px;
}
.login-hint {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 18px;
  text-align: center;
}
.login-hint strong { color: var(--text); word-break: break-all; }
.login-msg { min-height: 20px; font-size: 13px; margin: 8px 0 10px; }
.login-msg.error { color: var(--rose); }
.login-msg.info  { color: var(--sage); }
.login-btn {
  width: 100%;
  padding: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: var(--gold);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}
.login-btn:hover:not(:disabled) { background: var(--gold-light); }
.login-btn:disabled { opacity: 0.6; cursor: default; }
.login-btn:focus-visible,
.login-link:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; }
.login-links {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}
.login-link {
  background: none;
  border: none;
  padding: 4px 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  color: var(--gold);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.login-link:disabled { color: var(--text-dim); cursor: default; text-decoration: none; }

@media (max-width: 480px) {
  .login-card { padding: 28px 20px 24px; }
  .login-otp { font-size: 22px; letter-spacing: 8px; }
}

.login-register {
  margin-top: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  background: var(--surface);
  border-radius: 8px;
}
.login-register a {
  color: var(--gold);
  font-weight: 500;
  text-underline-offset: 3px;
}
.login-register a:hover { color: var(--gold-light); }

/* ── Admin: bottom bar + Interests / Payments ───────────────────────── */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 500;
  display: flex; background: var(--card); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 16px rgba(122, 82, 24, 0.08);
}
.nav-tab {
  flex: 1; min-height: 56px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; background: none; border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 12px; color: var(--text-dim);
}
.nav-tab span { font-size: 20px; line-height: 1; }
.nav-tab.active { color: var(--gold); font-weight: 600; box-shadow: inset 0 3px 0 var(--gold); }
body.has-nav { padding-bottom: 76px; }

.admin-view { max-width: 640px; margin: 0 auto; padding: 16px 14px 24px; }
.a-title { font-family: 'Cormorant Garamond', serif; font-size: 28px; color: var(--gold); margin: 4px 0 14px; }
.a-h3 { font-size: 14px; font-weight: 600; color: var(--text-muted); margin: 20px 0 8px; }
.a-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.a-row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.a-date { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.a-sub { font-size: 13px; color: var(--text-muted); margin: 4px 0 10px; }
.a-sub a { color: var(--gold); }
.a-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.a-actions .filter-btn, .a-btn { min-height: 44px; }
.a-btn { padding: 0 14px; font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--gold);
  background: transparent; border: 1px solid var(--gold); border-radius: 10px; cursor: pointer; }
.a-btn.a-primary { background: var(--gold); color: #fff; }
.a-btn:disabled { opacity: 0.6; }
.a-empty { text-align: center; color: var(--text-dim); padding: 24px 0; font-size: 14px; }
.st-New { font-weight: 600; } .st-Matched { color: var(--sage); } .st-Declined, .st-Closed { color: var(--text-dim); }

.a-danger-btn { color: var(--rose); border-color: var(--rose); min-height: 44px; }

/* ── Bold names ───────────────────────────────────────────────────── */
.profile-name, .md-banner-name { font-weight: 700; }

/* ── Card details block (shown on phones) ─────────────────────────── */
.card-static { display: none; }
.cs-row { font-size: 12.5px; line-height: 1.35; color: var(--text); margin-top: 5px; }
.cs-row span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); }

@media (max-width: 700px) {
  /* square card: photo left, details right */
  .profile-card { flex-direction: row !important; height: auto !important; aspect-ratio: 1 / 1; }
  .card-images { width: 46% !important; height: 100% !important; }
  .card-details { min-width: 0; overflow: hidden; display: flex; flex-direction: column; padding: 10px 10px 8px; }
  .card-scroll { display: none !important; }
  .card-static { display: block; flex: 1; overflow: hidden; }
  .tag-row { display: none; }
  .card-footer { padding: 6px 0 0 !important; flex-direction: column; gap: 6px; }
  .card-footer .contact-btn, .card-footer .wa-share-btn { width: 100%; min-height: 36px; font-size: 12px; padding: 0 6px; }

  /* full-details popup: arrows mid-screen, bordered pop-up */
  .modal { border: 2px solid var(--gold); box-shadow: 0 0 0 4px rgba(160,114,42,.25), 0 -8px 30px rgba(0,0,0,.35); }
  .modal-nav-btn { top: 50% !important; bottom: auto !important; transform: translateY(-50%) !important; z-index: 1200;
    background: rgba(255,255,255,.95); box-shadow: 0 2px 8px rgba(0,0,0,.3); }
  .modal-nav-prev { left: 4px !important; }
  .modal-nav-next { right: 4px !important; }
}

/* ── Settings, edit panel ─────────────────────────────────────────── */
.set-row { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; border-bottom: 1px solid var(--border); }
.set-row input { width: 20px; height: 20px; accent-color: var(--gold); }
.edit-panel { position: fixed; inset: 0; z-index: 3000; background: rgba(26,16,10,.55); display: flex; align-items: flex-end; justify-content: center; }
.ed-box { background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; display: flex; flex-direction: column;
  border-radius: 18px 18px 0 0; border: 2px solid var(--gold); }
.ed-head, .ed-foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ed-foot { border: 0; border-top: 1px solid var(--border); padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)); }
.ed-foot .a-btn { width: 100%; }
.ed-body { overflow-y: auto; padding: 4px 14px; }
.ed-sec summary { font-weight: 600; color: var(--gold); padding: 12px 0; cursor: pointer; }
.ed-f { display: block; margin-bottom: 10px; font-size: 12px; color: var(--text-muted); }
.ed-f input { display: block; width: 100%; margin-top: 3px; min-height: 42px; padding: 0 10px; font: 15px 'DM Sans', sans-serif;
  border: 1px solid var(--border); border-radius: 8px; background: #fffdfa; color: var(--text); }

/* ── Login: saved-email suggestions ───────────────────────────────── */
.login-field { position: relative; }
.email-suggest { display: none; position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 5;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  box-shadow: 0 8px 24px rgba(122, 82, 24, 0.18); }
.es-row { display: flex; align-items: center; border-bottom: 1px solid var(--border); }
.es-row:last-child { border-bottom: 0; }
.es-pick { flex: 1; min-width: 0; min-height: 46px; padding: 0 14px; text-align: left; background: none; border: 0;
  font: 14px 'DM Sans', sans-serif; color: var(--text); cursor: pointer; overflow: hidden; text-overflow: ellipsis; }
.es-x { width: 46px; min-height: 46px; background: none; border: 0; color: var(--text-dim); font-size: 13px; cursor: pointer; }
.es-pick:hover, .es-pick:focus-visible { background: var(--surface); }

/* ── Status image preview ─────────────────────────────────────────── */
.status-preview { position: fixed; inset: 0; z-index: 3500; background: rgba(26,16,10,.8); display: flex; align-items: center; justify-content: center; padding: 12px; }
.sp-box { display: flex; flex-direction: column; align-items: center; gap: 12px; max-height: 100%; }
.sp-box img { max-height: 72vh; max-width: 100%; border-radius: 12px; border: 2px solid var(--gold); background: #fff; }
.sp-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.sp-actions .a-btn { display: inline-flex; align-items: center; background: var(--card); text-decoration: none; }
.sp-actions .a-primary { background: var(--gold); }

/* ── Settings: single-line rows that open on tap ──────────────────── */
.set-acc { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; }
.set-acc summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 14px; cursor: pointer; }
.set-acc summary::-webkit-details-marker { display: none; }
.set-acc summary::after { content: '›'; margin-left: auto; font-size: 20px; color: var(--text-dim); transition: transform .2s; }
.set-acc[open] summary::after { transform: rotate(90deg); }
.sa-t { font-weight: 600; white-space: nowrap; }
.sa-d { flex: 1; min-width: 0; font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-n { font-size: 12px; color: var(--gold); white-space: nowrap; }
.sa-body { padding: 0 14px 14px; border-top: 1px solid var(--border); }
.sp-note { max-width: 320px; text-align: center; font-size: 13px; color: #fff; background: rgba(163,45,45,.85); border-radius: 8px; padding: 8px 12px; }
@media (max-width: 480px) { .sa-d { display: none; } }

/* ── Logout button: always a clear pill ───────────────────────────── */
.logout-btn { display: inline-flex !important; align-items: center; gap: 6px; flex-shrink: 0; white-space: nowrap;
  min-height: 40px; padding: 0 14px !important; margin-left: auto; }
@media (max-width: 700px) {
  .logout-role, .logout-sep { display: none !important; }
  .logout-action { display: inline !important; opacity: 1 !important; font-size: 12px !important; font-weight: 600; }
  .logout-action::before { content: '⎋ '; }
}

/* ── Status preview: photo tabs ───────────────────────────────────── */
.sp-tabs { display: flex; gap: 8px; }
.sp-tabs .a-btn { background: var(--card); }
.sp-tabs .a-primary { background: var(--gold); }

/* ── Phone cards: 3 sections — static line / photo + chosen details / buttons ── */
.card-top { display: none; }
@media (max-width: 700px) {
  .profile-card { display: grid !important; grid-template-columns: 42% 1fr; grid-template-rows: auto 1fr auto;
    aspect-ratio: auto !important; height: auto !important; }
  .card-top { display: block; grid-column: 1 / -1; grid-row: 1; padding: 10px 12px 8px; border-bottom: 1px solid var(--border); }
  .ct-name { font-size: 16px; font-weight: 700; color: var(--text); }
  .ct-name span { font-weight: 500; color: var(--text-muted); font-size: 14px; margin-left: 4px; }
  .ct-meta { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
  .card-images { grid-column: 1; grid-row: 2; width: 100% !important; height: auto !important; min-height: 230px; }
  .card-details { display: contents !important; }
  .card-header, .tag-row, .card-scroll { display: none !important; }
  .card-static { display: block !important; grid-column: 2; grid-row: 2; padding: 8px 12px; overflow: hidden; }
  .card-footer { grid-column: 1 / -1; grid-row: 3; display: flex !important; flex-direction: row !important;
    gap: 8px; padding: 8px 12px 12px !important; border-top: 1px solid var(--border); }
  .card-footer > * { flex: 1; min-height: 44px; }
}

/* ── Full Details: sections, two columns ──────────────────────────── */
.md-sec { margin-bottom: 14px; }
.md-sec-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold);
  padding: 6px 0; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.md-sec .md-grid { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 0 16px !important; }
.md-sec .md-row.wide { grid-column: 1 / -1; }
.md-sec .md-row { min-width: 0; overflow-wrap: anywhere; }

/* ── Settings: two columns ────────────────────────────────────────── */
.set-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }
.set-grid .set-row { font-size: 13px; line-height: 1.3; padding: 6px 0; min-width: 0; }

/* ── Full Details: aligned, collapsible sections ──────────────────── */
.md-sec { margin-bottom: 8px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--card); }
.md-sec > summary.md-sec-title { list-style: none; display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; padding: 10px 12px; margin: 0; border: 0; background: rgba(160,114,42,.08); }
.md-sec > summary.md-sec-title::-webkit-details-marker { display: none; }
.md-sec > summary.md-sec-title::after { content: '›'; font-size: 18px; transition: transform .2s; }
.md-sec[open] > summary.md-sec-title::after { transform: rotate(90deg); }
.md-sec .md-grid { padding: 4px 12px 8px; gap: 0 20px !important; }
.md-sec .md-row { border: 0 !important; border-bottom: 1px solid var(--border) !important; padding: 8px 0 !important; margin: 0 !important; }

/* ── Edit panel: one section at a time, blue headings ─────────────── */
.ed-sec { border-left: 3px solid #2f6f9f; padding-left: 10px; margin: 8px 0; }
.ed-sec summary { color: #2f6f9f !important; font-size: 14px; }
.ed-box { border-color: #2f6f9f !important; }

/* ── Admin buttons at the top of the popup ────────────────────────── */

/* ── Photo picker before the Status image ─────────────────────────── */
.sp-title { color: #fff; font-size: 15px; text-align: center; }
.sp-pick { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; background: var(--card);
  border: 2px solid var(--border); border-radius: 12px; cursor: pointer; font: 13px 'DM Sans', sans-serif; color: var(--text); }
.sp-pick img { width: 130px; height: 170px; object-fit: cover; border-radius: 8px; }
.sp-pick:hover, .sp-pick:focus-visible { border-color: var(--gold); }

/* ── Compare tab ──────────────────────────────────────────────────── */
.admin-view.wide { max-width: 900px; }
.cmp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cmp-col { min-width: 0; }
.cmp-h { font-weight: 700; padding: 6px 0; margin-bottom: 6px; border-bottom: 3px solid var(--border); }
.cmp-h.bride { border-color: var(--bride-color); } .cmp-h.groom { border-color: var(--groom-color); }
.cmp-col .filter-btn { width: 100%; margin-bottom: 6px; min-height: 40px; font-size: 13px; }
.cmp-list { max-height: 44vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.cmp-item { display: block; width: 100%; text-align: left; padding: 9px 10px; border: 0; border-bottom: 1px solid var(--border);
  background: none; font: 13px 'DM Sans', sans-serif; color: var(--text); cursor: pointer; }
.cmp-item small { display: block; color: var(--text-muted); font-size: 11.5px; margin-top: 2px; }
.cmp-item.sel { background: rgba(160,114,42,.16); box-shadow: inset 3px 0 0 var(--gold); }
#cmp-result { margin-top: 14px; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.cmp-table th, .cmp-table td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.cmp-table th:first-child { width: 28%; color: var(--text-muted); font-weight: 500; }
.cmp-table th small { display: block; font-weight: 400; color: var(--text-muted); }
.cmp-table tr.warn td { background: rgba(163,45,45,.12); }
.cmp-notes { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.cmp-notes span { padding: 4px 10px; border-radius: 999px; background: rgba(160,114,42,.15); font-size: 12px; }
.cmp-notes span.bad { background: rgba(163,45,45,.2); color: var(--rose); font-weight: 600; }
.nav-tab span { font-size: 18px; }

/* ── Login: register link ─────────────────────────────────────────── */
.login-foot { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border); text-align: center; font-size: 13px; color: var(--text-muted); }
.login-foot a { color: var(--gold); font-weight: 600; }

/* ── Settings groups ──────────────────────────────────────────────── */
.set-group { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 8px; font-size: 13px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.set-group small { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-muted); font-size: 12px; }
.set-group.admin { color: var(--rose); }

/* ── Compare: filters, photos ─────────────────────────────────────── */
.cmp-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 6px; }
.cmp-filters .filter-btn { margin-bottom: 0; min-width: 0; padding-left: 8px; padding-right: 4px; text-overflow: ellipsis; }
.cmp-photo { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; background: var(--surface); }
.cmp-photo.none { display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--text-dim); }
.cmp-photos td { padding-top: 10px; }
.cmp-fields-btn { margin-left: auto; }

/* ── Bottom bar: clear "you are here" highlight ───────────────────── */
.nav-tab { transition: background .15s, color .15s; }
.nav-tab:not(.active) { color: var(--text-dim); }
.nav-tab.active { background: rgba(160, 114, 42, 0.18); color: var(--gold); font-weight: 700; box-shadow: inset 0 4px 0 var(--gold); }
.nav-tab.active span { transform: scale(1.18); }

/* ── Quick actions on the horoscope row ───────────────────────────── */
.md-actions-row { display: flex; gap: 8px; align-items: stretch; }
.md-actions-row .md-horo-btn { flex: 1; }
.qa-wrap { flex-shrink: 0; }
.qa-btn { min-height: 44px; white-space: nowrap; }
.qa-menu { z-index: 4000; min-width: 190px; background: var(--card); border: 1px solid var(--gold); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); overflow: hidden; }
.qa-menu button { display: block; width: 100%; text-align: left; padding: 12px 14px; min-height: 46px; background: none; border: 0;
  border-bottom: 1px solid var(--border); font: 14px 'DM Sans', sans-serif; color: var(--text); cursor: pointer; }
.qa-menu button:last-child { border-bottom: 0; }
.qa-menu button.danger { color: var(--rose); }
.qa-menu button:hover, .qa-menu button:focus-visible { background: var(--surface); }

/* ── Full-screen photos: visible side arrows ──────────────────────── */
.lightbox-arrow { position: absolute !important; top: 50%; transform: translateY(-50%); z-index: 5; width: 46px; height: 46px;
  align-items: center; justify-content: center; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 30px;
  border: 1px solid rgba(255,255,255,.4); }
.lightbox-arrow.prev { left: 8px; right: auto; } .lightbox-arrow.next { right: 8px; left: auto; }

/* ── Compare: shorter lists, dropdown arrow no longer over the text ── */
.cmp-list { max-height: 22vh !important; }
.cmp-filters .filter-btn, .cmp-search { font-size: 12.5px; }
.cmp-filters .filter-btn { padding: 0 30px 0 8px !important; text-overflow: ellipsis; }

/* ── Members: tabs, my profile, payment badge ─────────────────────── */
.nav-tab[hidden] { display: none !important; }
.mp-photos { display: flex; gap: 8px; margin: 10px 0; }
.mp-photos img { width: calc(50% - 4px); aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; background: var(--surface); }
.pay-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pay-badge.ok { background: rgba(60,120,70,.15); color: var(--sage); }
.pay-badge.wait { background: rgba(163,45,45,.15); color: var(--rose); }

/* Quick actions menu sits inside the pop-up (not fixed to the screen) */
.qa-wrap { position: relative; }
.qa-menu { position: absolute !important; right: 0; left: auto !important; }
