/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:            #09090f;
  --surface:       #111118;
  --surface2:      #16161f;
  --card:          #1a1a26;
  --card-hover:    #1e1e2d;
  --border:        rgba(255,255,255,0.07);
  --border-hover:  rgba(255,255,255,0.14);

  --primary:       #7c3aed;
  --primary-h:     #8b5cf6;
  --primary-glow:  rgba(124,58,237,0.28);
  --accent:        #a78bfa;

  --text:          #e2e8f0;
  --text-sub:      #94a3b8;
  --text-muted:    #5d6979;

  --success:       #22c55e;
  --warning:       #f59e0b;
  --error:         #ef4444;

  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     18px;
  --shadow:        0 4px 24px rgba(0,0,0,0.45);
  --shadow-lg:     0 12px 48px rgba(0,0,0,0.65);
  --transition:    0.15s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9,9,15,0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.header-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.brand-logo {
  height: 38px;
  width: auto;
  max-width: 100%;
  display: block;
  flex-shrink: 0;
}

.brand-desc {
font-size: 12px;
color: #616d7e;
max-width: 280px;
line-height: 1.4;
}

.header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Header kebab dropdown ───────────────────────────────────────────────── */
.kebab-menu { position: relative; }

.btn-kebab {
  padding: 8px 10px;
  line-height: 1;
}
.btn-kebab svg { display: block; }

.kebab-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 110;
}
.kebab-menu.kebab-open .kebab-dropdown { display: block; }

.kebab-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-sub);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.kebab-item:hover {
  background: var(--surface2);
  color: var(--text);
}
.kebab-item[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}
.kebab-item[disabled]:hover {
  background: transparent;
  color: var(--text-sub);
}
.kebab-item svg { flex-shrink: 0; opacity: 0.85; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13.5px; font-weight: 500;
  cursor: pointer; border: none; outline: none;
  transition: all var(--transition); white-space: nowrap;
  text-decoration: none; line-height: 1;
}
.btn:active { transform: scale(0.96); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #6d28d9 100%);
  color: #fff; box-shadow: 0 2px 14px var(--primary-glow);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-h) 0%, var(--primary) 100%);
  box-shadow: 0 4px 22px var(--primary-glow); transform: translateY(-1px);
}

.btn-ghost {
  background: transparent; color: var(--text-sub); border: 1px solid var(--border); padding: 9px;
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); border-color: var(--border-hover); }

.btn-sync {
  background: rgba(124,58,237,0.08); color: var(--accent);
  border: 1px solid rgba(124,58,237,0.18); font-size: 11px; padding: 5px 10px;
}
.btn-sync:hover { background: rgba(124,58,237,0.18); }

.btn-sm { padding: 6px 11px; font-size: 12px; }

/* ── "Event cancelled (?)" suspicion badge — orange, non-destructive ─────── */
.badge-cancelled,
.badge-cancelled-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 7px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--warning);
  background: rgba(245,158,11,0.10);
  border: 1px solid rgba(245,158,11,0.32);
  cursor: help;
  white-space: nowrap;
}
.badge-cancelled svg { stroke-width: 2.2; }
.badge-cancelled-inline {
  margin-left: 6px;
  /* Inherit badge sizing on bulk results status column */
}

/* Medium-suspicion chip on event cards — softer than cancelled, but visible */
.badge-suspicion-medium {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: rgb(177 77 0 / 90%);
  background: rgb(177 77 0 / 8%);
  border: 1px solid rgb(177 77 0 / 35%);
  cursor: help;
  white-space: nowrap;
}

/* Bulk results — Suspicion column */
.bulk-row-suspicion { white-space: nowrap; }
.bulk-suspicion-none { color: var(--text-muted); font-size: 11px; }
.bulk-suspicion {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  cursor: help;
}
.bulk-suspicion-score {
  display: inline-block;
  padding: 0 4px;
  font-family: 'SF Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  background: rgba(0,0,0,0.18);
  border-radius: 3px;
  letter-spacing: 0;
}
.bulk-suspicion-medium    { color: rgb(177 77 0 / 90%); background: rgb(177 77 0 / 10%); border: 1px solid rgb(177 77 0 / 35%); }
.bulk-suspicion-high      { color: rgb(177 77 0 / 95%); background: rgb(177 77 0 / 18%); border: 1px solid rgb(177 77 0 / 60%); }
.bulk-suspicion-critical  { color: var(--error); background: rgba(239,68,68,0.10); border: 1px solid rgba(239,68,68,0.40); }

/* Edit Facebook Event ID pencil — sits next to the existing FB-link icon */
.btn-fb-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  padding: 0;
  transition: color var(--transition), background var(--transition);
}
.btn-fb-edit:hover {
  color: var(--accent);
  background: rgba(124,58,237,0.12);
}

/* ── History Log ──────────────────────────────────────────────────────────── */
/* Button sits at the right end of the stats bar */
.btn-history-log {
  margin-left: auto;
  align-self: center;
  background: rgba(99, 102, 241, 0.10);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.32);
  font-size: 12px;
  padding: 9px 20px;
  position: absolute;
  top: 34px;
  left: 574px;
  z-index: 999;
}
.btn-history-log:hover {
  background: rgba(99,102,241,0.20);
  border-color: rgba(99,102,241,0.52);
  color: #c7d2fe;
  transform: none;
}
@media (max-width: 640px) {
  .btn-history-log { margin-left: 0; }
}

/* Header subcount */
.hl-count {
  font-family: 'SF Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 10px;
  letter-spacing: 0.3px;
}

/* Search + export row */
.hl-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.hl-search { flex: 1; }
.hl-export-btn { flex-shrink: 0; }

/* Filter chips */
.hl-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 14px;
}
.hl-chip {
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.hl-chip:hover {
  border-color: var(--border-hover);
  color: var(--text-sub);
}
.hl-chip-active {
  background: rgba(124,58,237,0.18);
  color: var(--accent);
  border-color: rgba(124,58,237,0.45);
}
.hl-chip-sep {
  color: var(--border-hover);
  font-size: 12px;
  margin: 0 3px;
}

/* Entry list */
.hl-list-wrap {
  max-height: 480px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
}
.hl-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.hl-loading {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.hl-loading-error { color: var(--error); }
.hl-empty {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
}

.hl-entry {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.hl-entry:last-child { border-bottom: none; }
.hl-entry:hover { background: var(--surface2); }

.hl-entry-icon {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.hl-status-success .hl-entry-icon { background: rgba(34,197,94,0.16);  color: var(--success); }
.hl-status-warning .hl-entry-icon { background: rgba(245,158,11,0.16); color: var(--warning); }
.hl-status-error   .hl-entry-icon { background: rgba(239,68,68,0.16);  color: var(--error);   }
.hl-status-info    .hl-entry-icon { background: rgba(148,163,184,0.16); color: var(--text-muted); }

.hl-entry-body { min-width: 0; }
.hl-entry-row1 {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-bottom: 3px;
  font-size: 12px;
}
.hl-action {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
  color: var(--text);
  font-weight: 600;
}
.hl-source-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.hl-source-manual       { color: var(--text-sub);  }
.hl-source-auto_extract { color: var(--accent); border-color: rgba(124,58,237,0.32); background: rgba(124,58,237,0.10); }
.hl-source-bulk         { color: #a5b4fc;        border-color: rgba(99,102,241,0.32);  background: rgba(99,102,241,0.10); }
.hl-source-export       { color: var(--success); border-color: rgba(34,197,94,0.28);   background: rgba(34,197,94,0.10); }
.hl-source-system       { color: var(--text-muted); }

.hl-event-name {
  font-size: 12px;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}
.hl-fbid {
  font-family: 'SF Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
  background: var(--surface2);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--border);
}

.hl-entry-row2 { font-size: 11.5px; color: var(--text-muted); line-height: 1.45; }
.hl-msg { word-break: break-word; }

.hl-entry-time {
  font-family: 'SF Mono', monospace;
  font-size: 10.5px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 8px;
  white-space: nowrap;
  margin-top: 4px;
}

/* ── Bulk Import CSV ──────────────────────────────────────────────────────── */
/* Wider modal variant for the results table */
.modal.modal-wide { max-width: 920px; }

.bulk-sample-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed rgba(167,139,250,0.4);
}
.bulk-sample-link:hover { color: #c4b5fd; border-bottom-color: var(--accent); }

.auto-process-option-hint {
  margin-left: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-style: italic;
}

.bulk-preflight {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.bulk-preflight-row {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 13px;
  color: var(--text-sub);
}
.bulk-stat            { display: inline-flex; align-items: baseline; gap: 5px; }
.bulk-stat span       { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.bulk-stat-ok span    { color: var(--success); }
.bulk-stat-warn span  { color: var(--warning); }
.bulk-stat-skip span  { color: var(--text-muted); }

.bulk-preflight-cols,
.bulk-preflight-samples {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.bulk-preflight-cols code,
.bulk-preflight-samples code {
  font-family: 'SF Mono', monospace;
  font-size: 10.5px;
  background: var(--card);
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--border);
  color: var(--accent);
}
.bulk-col-count {
  font-family: 'SF Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 2px;
}
.bulk-preflight-label {
  font-weight: 600;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-size: 10px;
  flex-shrink: 0;
}
.bulk-preflight-samples ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.bulk-preflight-samples li code {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.bulk-invalid-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 11.5px;
}
.bulk-invalid-item {
  display: grid;
  grid-template-columns: 60px 130px 1fr;
  gap: 10px;
  padding: 4px 8px;
  background: rgba(245,158,11,0.06);
  border-radius: 4px;
  align-items: baseline;
}
.bulk-invalid-row    { font-family: 'SF Mono', monospace; color: var(--warning); font-weight: 700; }
.bulk-invalid-reason { color: var(--text-sub); }
.bulk-invalid-url    { color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: 'SF Mono', monospace; }
.bulk-invalid-more   { color: var(--text-muted); padding: 4px 8px; font-style: italic; }

/* Progress + results */
.bulk-progress {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
}
.bulk-progress-bar {
  height: 6px;
  background: var(--card);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 14px;
}
.bulk-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  width: 0;
  transition: width 0.25s ease;
}

.bulk-stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.bulk-stat-tile {
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
}
.bulk-stat-num {
  font-size: 22px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums; line-height: 1;
}
.bulk-stat-num-ok    { color: var(--success); }
.bulk-stat-num-warn  { color: var(--warning); }
.bulk-stat-num-fail  { color: var(--error); }
.bulk-stat-num-skip  { color: var(--text-muted); }
.bulk-stat-lbl {
  font-size: 9.5px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-top: 4px;
}

.bulk-results-wrap {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
}
.bulk-results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}
.bulk-results-table thead th {
  position: sticky; top: 0;
  background: var(--surface2);
  padding: 7px 10px;
  text-align: left;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  z-index: 1;
}
.bulk-results-table tbody td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-sub);
}
.bulk-results-table tbody tr:last-child td { border-bottom: none; }

.bulk-row-num    { color: var(--text-muted); font-family: 'SF Mono', monospace; width: 36px; }
.bulk-row-url    { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-row-url a  { color: var(--accent); text-decoration: none; }
.bulk-row-url a:hover { text-decoration: underline; }
.bulk-row-fbid   { font-family: 'SF Mono', monospace; color: var(--text-muted); white-space: nowrap; }
.bulk-row-name   { color: var(--text); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-row-msg    { font-size: 10.5px; color: var(--text-muted); }

.bulk-status-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.bulk-status-success { background: rgba(34,197,94,0.14);  color: var(--success); }
.bulk-status-warn    { background: rgba(245,158,11,0.14); color: var(--warning); }
.bulk-status-failed  { background: rgba(239,68,68,0.14);  color: var(--error);   }
.bulk-status-skip    { background: rgba(148,163,184,0.14); color: var(--text-muted); }

.bulk-completion {
  margin-top: 14px;
  padding: 11px 14px;
  background: rgba(34,197,94,0.06);
  border: 1px solid rgba(34,197,94,0.22);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--text-sub);
}
.bulk-download-link {
  color: var(--success);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dashed rgba(34,197,94,0.4);
  margin-left: auto;
}
.bulk-download-link:hover { color: #4ade80; border-bottom-color: var(--success); }

@media (max-width: 740px) {
  .bulk-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Generic disabled state for any button variant — used by the Export Data
   button when there are no events with visuals to include. */
.btn:disabled {
  opacity: 0.36;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}
.btn:disabled:hover { transform: none !important; }

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

/* Small icon-only danger button (card delete) */
.btn-icon-danger {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: rgba(239,68,68,0.07);
  border: 1px solid rgba(239,68,68,0.16);
  color: var(--error);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.btn-icon-danger:hover { background: rgba(239,68,68,0.18); }
.btn-icon-danger:active { transform: scale(0.93); }

/* Small icon button — replace host image (per-row action in hosts lists) */
.btn-host-image {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: rgba(124,58,237,0.08);
  border: 1px solid rgba(124,58,237,0.22);
  color: var(--accent);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.btn-host-image:hover  { background: rgba(124,58,237,0.18); border-color: rgba(124,58,237,0.38); }
.btn-host-image:active { transform: scale(0.93); }

/* Use-as-Logo button — amber-tinted to distinguish from the purple replace-image button */
.btn-use-as-logo {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.25);
  color: var(--warning);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.btn-use-as-logo:hover:not(:disabled)  { background: rgba(245,158,11,0.18); border-color: rgba(245,158,11,0.45); }
.btn-use-as-logo:active:not(:disabled) { transform: scale(0.93); }
.btn-use-as-logo:disabled {
  opacity: 0.32;
  cursor: not-allowed;
  pointer-events: none;
}

.upload-filename-mini {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Main Layout ─────────────────────────────────────────────────────────── */
.main { padding: 28px 24px 60px; }
.container { max-width: 1300px; margin: 0 auto; }

/* ── Stats Bar ───────────────────────────────────────────────────────────── */
.stats-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }

.stat {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 8px;
  display: flex; flex-direction: column; gap: 2px; min-width: 60px;
}

.stat-value {
  font-size: 26px; font-weight: 700; color: var(--text);
  line-height: 1; font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.6px;
}

/* ── Events Grid ─────────────────────────────────────────────────────────── */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
}

/* ── Event Card ──────────────────────────────────────────────────────────── */
.event-card {
  background: var(--card);
  /* 2px from the start so adding/removing a status class never shifts layout */
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.event-card::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(124,58,237,0.04) 0%, transparent 55%);
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.event-card:hover { border-color: rgba(124,58,237,0.26); transform: translateY(0px); box-shadow: var(--shadow); }
.event-card:hover::after { opacity: 1; }

/* ── Card status borders — color-coded health at a glance ─────────────────
   Priority is encoded in JS (`_eventCardStatusClass`): cancelled wins over
   partial wins over complete. The :hover variants slightly bump opacity so
   the status color stays consistent (no purple flash on hover). The chained
   selectors `.event-card.event-card-X` give specificity (0,2,0) which ties
   `.event-card:hover` (0,2,0); source order (these come AFTER) wins.
   On hover, `.event-card.event-card-X:hover` is (0,3,0) — beats it cleanly. */

/* Subtle legend below the stats bar — explains the card border colors */
.card-legend {
  position: absolute;
  top: 130px;
  right: 95px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: -12px 0 22px;
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.card-legend-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-size: 9.5px;
  color: var(--text-muted);
}
.card-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: help;
}
.card-legend-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 3px;
  border: 1.5px solid;
}
.card-legend-dot.legend-cancelled { border-color: rgb(177 77 0 / 70%);  background: rgb(177 77 0 / 25%); }
.card-legend-dot.legend-partial   { border-color: rgb(177 157 0 / 50%); background: rgb(177 157 0 / 18%); }
.card-legend-dot.legend-complete  { border-color: rgba(124, 58, 237, 0.45); background: rgba(124, 58, 237, 0.18); }

/* Cancelled-suspected (orange) — highest priority */
.event-card.event-card-cancelled        {border-color: rgb(112 78 38);}
.event-card.event-card-cancelled:hover  { border-color: rgb(189, 125, 14);}

/* Partial — exactly one of flyer/logo downloaded (yellow) */
.event-card.event-card-partial          { border-color: rgb(177 157 0 / 50%); }
.event-card.event-card-partial:hover    { border-color: rgb(177 157 0 / 75%); }

/* Medium suspicion — softer orange than the cancelled (high+critical) border.
   Sits between cancelled and partial; orange family, lower opacity. */
.event-card.event-card-suspicion-medium       { border-color: rgb(177 77 0 / 35%); }
.event-card.event-card-suspicion-medium:hover { border-color: rgb(177 77 0 / 55%); }

/* Hidden by filter — keeps the DOM intact so selection state survives across
   filter changes. !important wins over the base `display: flex` on .event-card. */
.event-card.event-card-hidden { display: none !important; }

/* ── Dashboard header (stats + controls grouped as one admin panel) ──────── */
.dashboard-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-bottom: 16px;
}
/* Override the standalone stats-bar bottom margin — header gap takes over */
.dashboard-header .stats-bar { margin-bottom: 0; flex: 0 1 auto; }

.dashboard-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-left: auto;          /* push to the right of stats on wide screens */
}

/* ── Segmented filter control — single rounded container, internal segments ─ */
.card-filters.segmented-control {
  display: inline-flex;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 3px;
  gap: 0;                      /* segments are flush */
}

/* Override the prior chip styling when inside a segmented-control container */
.segmented-control .card-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.segmented-control .card-filter-chip:hover {
  color: var(--text-sub);
}
.segmented-control .card-filter-chip.chip-active {
  background: rgba(124, 58, 237, 0.20);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.card-filter-count {
  display: inline-block;
  min-width: 18px;
  padding: 1px 6px;
  font-family: 'SF Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 8px;
  text-align: center;
  letter-spacing: 0;
}
.segmented-control .chip-active .card-filter-count {
  background: rgba(255, 255, 255, 0.12);
  color: var(--accent);
}

/* Optional separator inside the segmented control — drop a <span class="seg-divider">
   between two groups of chips to mark the boundary (e.g. status filters vs view modes). */
.segmented-control .seg-divider {
  display: inline-block;
  width: 1px;
  align-self: stretch;
  margin: 4px 4px;
  background: var(--border);
}

/* ── Sort control — single segmented-control matching .card-filters ──────── */
.card-sort.segmented-control {
  display: inline-flex;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 3px;
  gap: 0;
}

.card-sort-prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 8px 0 9px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  user-select: none;
}

.card-sort .card-sort-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.card-sort .card-sort-chip:hover { color: var(--text-sub); }
.card-sort .card-sort-chip.chip-active {
  background: rgba(124, 58, 237, 0.20);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.card-sort .card-sort-dir {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.card-sort .card-sort-dir:hover {
  color: var(--accent);
  background: rgba(124, 58, 237, 0.12);
}
.card-sort .card-sort-dir svg { display: block; }

@media (max-width: 640px) {
  .card-sort.segmented-control { width: 100%; overflow-x: auto; }
}

/* Select-all visible — sits at the right edge of the controls row */
.card-select-all-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.card-select-all-label input[type="checkbox"] {
  width: 14px; height: 14px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Responsive: when the header has to wrap, give each piece breathing room and
   let the segmented control hold its line. */
@media (max-width: 920px) {
  .dashboard-header   { gap: 14px; }
  .dashboard-controls { margin-left: 0; width: 100%; }
}
@media (max-width: 640px) {
  .card-filters.segmented-control { width: 100%; overflow-x: auto; }
  .card-select-all-label          { margin-left: auto; }
}

/* ── Bulk-action toolbar (visible when selection is non-empty) ───────────── */
.bulk-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: rgba(124, 58, 237, 0.10);
  border: 1px solid rgba(124, 58, 237, 0.32);
  border-radius: var(--radius-sm);

  /* Sticky-stack under the page header so bulk actions remain reachable
     while scrolling. `--header-h` is set from JS based on the live header
     height (fallback covers initial paint before the script runs). */
  position: sticky;
  top: var(--header-h, 70px);
  z-index: 90;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  /* Keep the panel readable once it overlays cards behind it. */
  background-color: rgba(33, 22, 64, 0.86);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
}
.bulk-toolbar.bulk-toolbar-stuck {
  /* Subtle visual change once the toolbar has actually crossed the sticky
     threshold (added by the scroll observer). */
  border-color: rgba(124, 58, 237, 0.55);
}
.bulk-toolbar-count {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
}
.bulk-toolbar-count #bulkToolbarCount {
  font-family: 'SF Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-right: 2px;
}
.bulk-toolbar-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
}
.btn-bulk-refresh {
  background: rgba(124, 58, 237, 0.12);
  color: var(--accent);
  border: 1px solid rgba(124, 58, 237, 0.32);
}
.btn-bulk-refresh:hover {
  background: rgba(124, 58, 237, 0.22);
  border-color: rgba(124, 58, 237, 0.55);
  transform: translateY(-1px);
}
button.btn.btn-bulk-ready.btn-sm {
    background: rgb(31 50 41);
    color: rgb(33 197 94);
    border: 1px solid rgba(33, 197, 94, 0.32);
}
button.btn.btn-bulk-ready.btn-sm:hover {
    background: rgb(37, 60, 50);
    border: 1px solid rgba(35, 211, 100, 0.32);
    transform: translateY(-1px);
}
button.btn.btn-bulk-not-ready.btn-sm {
    background: rgb(31 27 46);
    color: rgb(171 171 171);
    border: 1px solid rgb(148 148 148 / 32%);
}
button.btn.btn-bulk-not-ready.btn-sm:hover {
    background: rgb(44, 38, 65);
    border: 1px solid rgba(164, 164, 164, 0.32);
    transform: translateY(-1px);
}
.btn-bulk-tag {
  background: rgba(245, 158, 11, 0.10);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.32);
}
.btn-bulk-tag:hover {
  background: rgba(245, 158, 11, 0.20);
  border-color: rgba(245, 158, 11, 0.55);
  transform: translateY(-1px);
}
.btn-bulk-delete {
  background: rgba(239, 68, 68, 0.10);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.32);
}
.btn-bulk-delete:hover {
  background: rgba(239, 68, 68, 0.20);
  border-color: rgba(239, 68, 68, 0.55);
  transform: translateY(-1px);
}

/* ── AutoExtract Update modal ─────────────────────────────────────────────── */
.aex-progress-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 10px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* Inline status — sits next to the spinner. The previous standalone .aex-status
   block style is preserved for callers that don't use the progress bar wrapper. */
.aex-progress-bar .aex-status {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
}

.aex-status {
  font-family: 'SF Mono', monospace;
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  letter-spacing: 0.2px;
}

/* Spinner — purple ring rotating while the bulk job is running. */
.aex-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid rgba(124, 58, 237, 0.18);
  border-top-color: var(--accent);
  /* Hidden by default; the JS toggles `aex-spinner-active` while in flight. */
  visibility: hidden;
}
.aex-spinner-active {
  visibility: visible;
  animation: aex-spin 0.8s linear infinite;
}
@keyframes aex-spin {
  to { transform: rotate(360deg); }
}

.aex-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin: 0 0 12px 0;
  font-style: italic;
}

.aex-rows {
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.aex-rows:empty { display: none; }

.aex-row {
  display: grid;
  grid-template-columns: 90px 1fr 1.2fr;
  gap: 10px;
  align-items: center;
  padding: 7px 12px;
  font-size: 11.5px;
  border-bottom: 1px solid var(--border);
}
.aex-row:last-child { border-bottom: none; }
.aex-row-status {
  font-family: 'SF Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  text-align: center;
}
.aex-row-completed    .aex-row-status { color: var(--success); background: rgba(34,197,94,0.12); }
.aex-row-needs_review .aex-row-status { color: var(--warning); background: rgba(245,158,11,0.14); }
.aex-row-failed       .aex-row-status { color: var(--error);   background: rgba(239,68,68,0.14); }
.aex-row-skipped      .aex-row-status { color: var(--text-muted); background: rgba(255,255,255,0.04); }
.aex-row-name {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aex-row-changed {
  font-family: 'SF Mono', monospace;
  font-size: 10.5px;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aex-row-changed-none { color: var(--text-muted); font-style: italic; }

.aex-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 6px;
}
.aex-summary-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.aex-summary-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.aex-summary-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .aex-summary-grid { grid-template-columns: repeat(3, 1fr); }
  .aex-row          { grid-template-columns: 70px 1fr; }
  .aex-row-changed  { grid-column: 1 / -1; padding-left: 80px; }
}

/* ── Per-card selection slot ─────────────────────────────────────────────── */
.card-select-slot {
  display: inline-flex;
  align-items: flex-start;
  flex-shrink: 0;
  margin-top: 2px;
  margin-right: 4px;
  opacity: 0;
  transition: opacity 0.15s;
  cursor: pointer;
}
.event-card:hover .card-select-slot,
.event-card.card-selected .card-select-slot { opacity: 1; }
.card-select-checkbox {
  width: 15px; height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
  margin: 0;
  position: absolute;
  left: 10px;
  top: 20px;
}
@media (pointer: coarse) {
  /* Touch devices — always show the checkbox so admins can multi-select */
  .card-select-slot { opacity: 1; }
}

.event-card.card-selected {
  box-shadow: 0 0 0 3px rgb(134, 70, 244), var(--shadow);
}
.event-card.card-selected::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(124, 58, 237, 0.04);
  pointer-events: none;
}
.event-card.card-selected:hover {
  box-shadow: 0 0 0 3px rgb(134, 70, 244), var(--shadow);
}

/* ── Manually-tagged cancelled cards ──────────────────────────────────────
   Distinct from the auto-suspected orange-bordered card. Dark, muted,
   "this event has been dismissed by the admin" rather than "needs attention". */
.event-card.event-card-manually-cancelled {
  border-color: rgb(38 38 47);
  background: #09090f;
}
.event-card.event-card-manually-cancelled:hover {
  border-color: rgb(58 58 70);
}

/* (Removed: an old position:absolute override that conflicted with the
   in-flow `.card-select-slot` placement inside .card-header.) */

/* Strikethrough title — only for manually-cancelled cards (the JS adds the
   title-cancelled class only when manually_tagged_cancelled is true) */
.card-title.title-cancelled {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  color: var(--text-muted);
}

/* "Event Cancelled" replacement block — sits where .card-visuals would go
   on a manually-tagged card */
.card-cancelled-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 36px 18px;
  background: #be363717;
  border: 1px dashed #be363647;
  border-radius: var(--radius-sm);
  color: #be3636;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.card-cancelled-block svg {
  color: #be3636;
  flex-shrink: 0;
}

/* "Cancelled" badge (admin-confirmed) — distinct from "Cancelled (?)" */
.badge-tagged-cancelled {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #be3636;
  background: rgb(177 77 0 / 16%);
  border: 1px solid #be36367c;
  cursor: help;
  white-space: nowrap;
}

/* ── Mobile responsive adjustments ──────────────────────────────────────── */
@media (max-width: 720px) {
  .dashboard-header { gap: 10px; }
  .dashboard-controls {
    margin-left: 0;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .card-filters.segmented-control {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .card-select-all-label {
    align-self: flex-start;
  }
}

/* Complete — both flyer and logo downloaded.
   Uses the design-system primary-purple at low opacity so "complete" reads
   as the brand-default state — discreet, not something to draw attention. */
.event-card.event-card-complete         { border-color: var(--primary-glow); }
.event-card.event-card-complete:hover   { border-color: rgba(124, 58, 237, 1); }

.card-top-bar {
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px 4px 0 0;
  opacity: 0; transition: opacity 0.2s;
}
.event-card:hover .card-top-bar { opacity: 1; }

/* ── Card Header ─────────────────────────────────────────────────────────── */
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-meta { flex: 1; min-width: 0; }

/* Wrap title + pencil in a row */
.card-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 5px;
}

.card-title {
  flex: 1;
  min-width: 0;
  font-size: 14.5px; font-weight: 600; color: var(--text); line-height: 1.3; word-break: break-all; height: 38px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}

/* Pencil edit button — visible on card hover */
.btn-edit-name {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 5px;
  background: transparent;
  border: none;
  color: rgb(136 148 165);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity var(--transition), background var(--transition), color var(--transition);
  margin-top: 1px;
}
.event-card:hover .btn-edit-name { opacity: 1; }
.btn-edit-name:hover { background: var(--surface2); color: var(--text-sub); }

/* Inline edit input */
.card-title-input {
  flex: 1;
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--primary-h);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Save / Cancel row under the input */
.card-title-actions {
  display: flex;
  gap: 6px;
  margin-top: 7px;
}

.card-sub {
  display: flex; align-items: center; gap: 6px;
  margin-top: 5px; flex-wrap: wrap;
}

.card-fbid {
  font-size: 10.5px;
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', monospace;
  color: rgb(167 139 250);
  background: var(--surface2);
  padding: 2px 7px; border-radius: 4px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.btn-fb-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border-radius: 4px;
  color: rgb(136 148 165);
  text-decoration: none;
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}
.btn-fb-link:hover { color: rgb(167 139 250); background: rgba(124,58,237,0.12); }

.card-sub-sep { font-size: 11px; color: var(--border-hover); }

.card-updated { font-size: 11px; color: var(--text-muted); }

/* Date pill in card-sub — compact, with optional warning icon for review */
.card-date {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-sub);
  cursor: help;
  white-space: nowrap;
}
.card-date-warn {
  color: var(--warning);
  flex-shrink: 0;
}

.card-location {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-sub);
  white-space: nowrap;
  cursor: help;
}
.card-location svg { flex-shrink: 0; opacity: 0.75; }
.card-location.loc-conf-low    { color: var(--text-muted); font-style: italic; }
.card-location.loc-conf-low svg { opacity: 0.5; }
.card-location.loc-conf-medium svg { opacity: 0.85; }
.card-location.loc-conf-high   { color: var(--text); }
.card-location.loc-conf-high svg { color: var(--accent); opacity: 1; }

/* ── Classification badges (event_type + dance_style) ───────────────────── */
.badge-event-type,
.badge-dance-style {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  margin-right: 4px;
  border-radius: 9px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  cursor: help;
}
.badge-event-type {
  color: var(--accent);
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.32);
}
.badge-dance-style {
  color: #5eead4;
  background: rgba(20, 184, 166, 0.10);
  border: 1px solid rgba(20, 184, 166, 0.30);
}
.badge-dance-more {
  display: inline-block;
  padding: 0 4px;
  font-size: 8.5px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 4px;
  letter-spacing: 0;
}
/* Confidence dimming — `manual` reads at full strength like high. */
.tag-conf-medium { opacity: 0.85; }
.tag-conf-low    { opacity: 0.65; font-style: italic; }
.tag-conf-none   { opacity: 0.45; font-style: italic; }

.btn-card-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--text-sub);
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.btn-card-info:hover { color: rgb(167 139 250); background: rgba(124,58,237,0.12); }
.btn-card-info-empty { opacity: 0.5; }
.btn-card-info-empty:hover { opacity: 1; }

/* ── Card Visuals: side-by-side grid ─────────────────────────────────────── */
.card-visuals {
  display: grid;
  grid-template-columns: 3fr 2fr;   /* flyer wider, logo narrower */
  gap: 10px;
  align-items: start;               /* each block is only as tall as its content */
}

/* ── Visual Block ────────────────────────────────────────────────────────── */
.visual-block {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.visual-block-header {
  display: flex; align-items: center; gap: 5px;
  color: var(--text-muted);
}

.visual-block-label {
  font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.4px;
  color: rgb(136 148 165);
}

/* ── Preview Box ─────────────────────────────────────────────────────────── */
.visual-preview-box {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface2);
  border: 1px solid var(--border);
  transition: border-color var(--transition);
  /* Ensure the box always has dimensions via aspect-ratio */
}

/* Facebook Event Cover: ~1.91:1 — we use 16:9 for clean CSS support */
.flyer-ratio { aspect-ratio: 16 / 9; }

/* Organizer logo: fixed compact box — reliable height, never collapses */
.logo-ratio  { max-width: 130px; max-height: 130px; aspect-ratio: 1; }

/* ── Shared image styles ─────────────────────────────────────────────────── */
.visual-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;          /* flyer default: fills 16:9 frame */
  display: block;
  transition: transform 0.35s ease;
}

/* Flyer only: subtle zoom on hover */
.flyer-ratio:hover .visual-img { transform: scale(1.04); }

/* Logo: show the actual uploaded image without cropping or distortion */
.logo-ratio .visual-img {
  object-fit: cover;        /* no crop — full image always visible */
  transform: none !important; /* no zoom — logos are identity-critical */
}

/* ── Placeholder (no upload yet) ─────────────────────────────────────────── */
.preview-empty  { background: var(--surface2); }
.preview-failed { background: rgba(239,68,68,0.04); border-color: rgba(239,68,68,0.14); }

.visual-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 5px;
}

.ph-icon { opacity: 0.28; color: var(--text-sub); }

.visual-placeholder span {
  font-size: 9.5px; font-weight: 500;
  color: var(--text-muted); letter-spacing: 0.2px;
}

/* ── Error Fallback (image loaded but file 404'd) ────────────────────────── */
.visual-error-fallback {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 5px;
  background: rgba(239,68,68,0.05);
  color: rgba(239,68,68,0.7);
}

.visual-error-fallback span {
  font-size: 9.5px; font-weight: 500;
}

.visual-preview-box.img-error { border-color: rgba(239,68,68,0.22); }

/* ── Overlay buttons (↻ replace + 🗑 remove) — revealed on image hover ────── */
.btn-overlay-replace,
.btn-overlay-remove {
  position: absolute; top: 7px;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 2;
  opacity: 0;
  transition: opacity 0.18s, background 0.15s;
}

.btn-overlay-replace { right: 7px;  background: rgba(0,0,0,0.52); }
.btn-overlay-remove  { right: 40px; background: rgba(180,20,20,0.52); }

.visual-preview-box:hover .btn-overlay-replace,
.visual-preview-box:hover .btn-overlay-remove { opacity: 1; }

.btn-overlay-replace:hover { background: rgba(0,0,0,0.75); }
.btn-overlay-remove:hover  { background: rgba(220,30,30,0.78); }

/* ── Placeholder Pill Buttons (Add / Retry inside placeholder box) ───────── */
.btn-ph-action {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 6px 8px; border-radius: 20px;
  font-family: inherit; font-size: 11px; font-weight: 500;
  cursor: pointer; border: none; outline: none;
  transition: all 0.15s ease;
  margin-top: -4px;
}
.btn-ph-add {
  background: rgba(124,58,237,0.14);
  color: var(--accent);
  border: 1px solid rgba(124,58,237,0.3);
}
.btn-ph-add:hover { background: rgba(124,58,237,0.26); }
.btn-ph-retry {
  background: rgba(239,68,68,0.1);
  color: var(--error);
  border: 1px solid rgba(239,68,68,0.22);
}
.btn-ph-retry:hover { background: rgba(239,68,68,0.2); }

/* ── Card Footer ─────────────────────────────────────────────────────────── */
.card-footer {
  /*display: flex;*/
  display: none;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.footer-sync { display: flex; align-items: center; gap: 8px; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.badge-pending { background: rgba(245,158,11,0.1);  color: var(--warning); border: 1px solid rgba(245,158,11,0.2); }
.badge-synced  { background: rgba(34,197,94,0.1);   color: var(--success); border: 1px solid rgba(34,197,94,0.2); }
.badge-error   { background: rgba(239,68,68,0.1);   color: var(--error);   border: 1px solid rgba(239,68,68,0.2); }

/* ── Empty State ─────────────────────────────────────────────────────────── */
.empty-state {
  display: none; flex-direction: column; align-items: center;
  text-align: center; padding: 80px 24px; gap: 12px;
}
.empty-state.visible { display: flex; }
.empty-illustration   { margin-bottom: 8px; }
.empty-state h2       { font-size: 20px; font-weight: 600; }
.empty-state p        { font-size: 14px; color: var(--text-muted); max-width: 300px; margin-bottom: 8px; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  z-index: 1000; display: none;
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 500px; max-height: 92vh;
  overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: modalIn 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
.modal.modal-sm { max-width: 380px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 17px; font-weight: 600; }

.modal-close {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); flex-shrink: 0;
}
.modal-close:hover { background: var(--card); color: var(--text); border-color: var(--border-hover); }

.modal-body { padding: 24px; }

/* ── Confirm modal ───────────────────────────────────────────────────────── */
.confirm-body {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 14px; padding: 8px 0 20px;
}

.confirm-icon-wrap {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2);
  color: var(--warning);
  display: flex; align-items: center; justify-content: center;
}

.confirm-body p {
  font-size: 14px; color: var(--text-sub);
  line-height: 1.55; max-width: 280px;
}

/* ── Upload context box ───────────────────────────────────────────────────── */
.upload-context {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 20px;
  display: flex; flex-direction: column; gap: 4px;
}

.upload-context-name {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.upload-context-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.upload-context-id {
  font-size: 11px; font-family: 'SF Mono','Fira Code',monospace;
  color: rgb(167 139 250); background: var(--surface);
  padding: 2px 7px; border-radius: 4px; border: 1px solid var(--border);
}

.upload-context-file { font-size: 11px; color:  var(--text-muted); }
.upload-context-file code {
  font-family: 'SF Mono','Fira Code',monospace;
  color: var(--accent); background: rgba(124,58,237,0.1);
  padding: 1px 6px; border-radius: 3px;
}

/* ── Form ────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

.form-group label {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12.5px; font-weight: 500;
  color: var(--text-sub); margin-bottom: 8px;
}

.label-hint { font-size: 11px; color: var(--text-muted); font-weight: 400; }

.form-input {
  width: 100%; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px; color: var(--text); font-family: inherit; font-size: 14px;
  outline: none; transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus { border-color: var(--primary-h); box-shadow: 0 0 0 3px var(--primary-glow); }
.form-input::placeholder { color: var(--text-muted); }

.event-id-preview { min-height: 28px; margin-top: 8px; }

/* Auto-detected event name status row (under #eventName input) */
.event-name-preview {
  min-height: 18px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.name-detect {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 500;
  line-height: 1.4;
}
.name-detect.detecting { color: var(--text-muted); }
.name-detect.success   { color: var(--success);    }
.name-detect.failed    { color: var(--warning);    }

.btn-name-apply {
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 5px;
  background: rgba(124,58,237,0.14);
  color: var(--accent);
  border: 1px solid rgba(124,58,237,0.3);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-name-apply:hover { background: rgba(124,58,237,0.26); }

/* ── Detected image candidates grid ──────────────────────────────────────── */
.candidates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.candidate-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  padding: 0;
  display: block;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  outline: none;
}
.candidate-thumb:hover  { border-color: var(--primary-h); transform: translateY(-1px); }
.candidate-thumb:active { transform: scale(0.98); }
.candidate-thumb.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.candidate-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* Per-confidence corner accent */
.candidate-thumb.conf-high::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 16px 16px 0 0;
  border-color: var(--success) transparent transparent transparent;
  z-index: 1;
}
.candidate-thumb.conf-medium::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 16px 16px 0 0;
  border-color: var(--warning) transparent transparent transparent;
  z-index: 1;
  opacity: 0.6;
}

/* Bottom label */
.candidate-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.45) 60%, transparent 100%);
  color: white;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding: 18px 6px 5px;
  text-align: center;
  text-transform: uppercase;
  pointer-events: none;
}

/* Checkmark — visible only when selected */
.candidate-check {
  position: absolute;
  top: 6px; right: 6px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: none;
  align-items: center; justify-content: center;
  z-index: 2;
  box-shadow: 0 0 0 2px var(--surface);
}
.candidate-thumb.selected .candidate-check { display: flex; }

/* Divider between candidates and the upload area */
.candidates-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 -4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  text-transform: uppercase;
}
.candidates-divider::before,
.candidates-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Badge shown in the upload-filename row when a candidate was auto-attached */
.auto-detected-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(34,197,94,0.12);
  color: var(--success);
  border: 1px solid rgba(34,197,94,0.28);
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.auto-detected-badge.auto-detected-warn {
  background: rgba(245,158,11,0.12);
  color: var(--warning);
  border-color: rgba(245,158,11,0.28);
}

/* "Try AutoExtract" button — appears in the visual upload modal above Upload Image */
.btn-auto-extract {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(124,58,237,0.14) 0%, rgba(167,139,250,0.18) 100%);
  color: var(--accent);
  border: 1px solid rgba(124,58,237,0.35);
  transition: all var(--transition);
  outline: none;
}
.btn-auto-extract:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(124,58,237,0.24) 0%, rgba(167,139,250,0.28) 100%);
  border-color: rgba(124,58,237,0.55);
  color: #c4b5fd;
  transform: translateY(-1px);
}
.btn-auto-extract:active:not(:disabled) { transform: scale(0.98); }
.btn-auto-extract:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* Status row under the auto-extract button (reuses .name-detect color states) */
.auto-extract-status {
  margin-top: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 16px;
}
.auto-extract-status:empty { margin-top: 0; }

/* ── Hosts review (Add Entry modal) ──────────────────────────────────────── */
.hosts-review-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.host-review-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.host-review-item:hover { border-color: var(--border-hover); background: var(--card-hover); }
.host-review-item:has(input:checked) {
  border-color: rgba(124,58,237,0.45);
  background: rgba(124,58,237,0.06);
}

.host-review-item input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  width: 15px; height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Host avatar — image overlays placeholder; onerror hides image to reveal it */
.host-review-avatar-wrap {
  position: relative;
  width: 32px; height: 32px;
  flex-shrink: 0;
}
.host-review-avatar-placeholder {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: rgba(124,58,237,0.14);
  border: 1px solid rgba(124,58,237,0.28);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase;
}
.host-review-avatar {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--card);
  border: 1px solid var(--border);
}

.host-review-info { flex: 1; min-width: 0; }
.host-review-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 3px;
}
.host-review-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  word-break: break-word;
}
.host-review-url {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  word-break: break-all;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.host-review-url:hover { color: var(--accent); }

.badge-host-type {
  display: inline-flex; align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  background: var(--surface);
  color: var(--text-sub);
  border: 1px solid var(--border);
}

.host-confidence-badge {
  display: inline-flex; align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.host-confidence-badge.conf-high   { background: rgba(34,197,94,0.12);  color: var(--success); border: 1px solid rgba(34,197,94,0.25); }
.host-confidence-badge.conf-medium { background: rgba(245,158,11,0.12); color: var(--warning); border: 1px solid rgba(245,158,11,0.25); }
.host-confidence-badge.conf-low    { background: rgba(148,163,184,0.12); color: var(--text-muted); border: 1px solid var(--border); }

/* ── Auto Process URL ─────────────────────────────────────────────────────── */
/* Note: the header button now uses .btn-primary directly — the dedicated
   .btn-auto-process class was removed when "URL AutoExtracts" was promoted
   to the primary action. */

.auto-process-intro {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 16px;
}

.auto-process-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 4px;
  font-size: 13px;
  color: var(--text-sub);
  cursor: pointer;
  user-select: none;
}
.auto-process-option input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}
.auto-process-option em { color: var(--warning); font-style: normal; font-weight: 500; }

.auto-process-result {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
}

.auto-process-status [class^="auto-process-status-"] {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 12px;
}
.auto-process-status-icon { font-size: 17px; line-height: 1; }
.auto-process-status-label { font-weight: 700; letter-spacing: 0.2px; }
.auto-process-meta {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-muted);
  font-family: 'SF Mono', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auto-process-status-success {
  background: rgba(34,197,94,0.10);
  border: 1px solid rgba(34,197,94,0.30);
  color: var(--success);
}
.auto-process-status-warn {
  background: rgba(245,158,11,0.10);
  border: 1px solid rgba(245,158,11,0.30);
  color: var(--warning);
}
.auto-process-status-failed {
  background: rgba(239,68,68,0.10);
  border: 1px solid rgba(239,68,68,0.30);
  color: var(--error);
}
.auto-process-status-running {
  display: inline-block;
  font-size: 12.5px;
  color: var(--text-sub);
  margin-bottom: 8px;
}

.auto-process-log {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.auto-process-step {
  display: grid;
  grid-template-columns: 16px 130px 1fr;
  gap: 9px;
  padding: 5px 8px;
  font-size: 11.5px;
  border-radius: 5px;
  align-items: baseline;
}
.auto-process-step-icon {
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  color: var(--text-muted);
}
.auto-process-step-name {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 10.5px;
  color: var(--text-sub);
  letter-spacing: 0.2px;
}
.auto-process-step-msg {
  color: var(--text-muted);
  line-height: 1.45;
}
.auto-process-step.step-ok    .auto-process-step-icon { color: var(--success); }
.auto-process-step.step-warn  .auto-process-step-icon { color: var(--warning); }
.auto-process-step.step-error .auto-process-step-icon { color: var(--error);   }
.auto-process-step.step-skip  .auto-process-step-icon { color: var(--text-muted); opacity: 0.5; }
.auto-process-step.step-error   { background: rgba(239,68,68,0.06); }
.auto-process-step.step-warn,
.auto-process-step.step-warning { background: rgba(245,158,11,0.06); }
/* Spec-literal status aliases */
.auto-process-step.step-success .auto-process-step-icon { color: var(--success); }
.auto-process-step.step-skipped .auto-process-step-icon { color: var(--text-muted); opacity: 0.5; }
.auto-process-step.step-warning .auto-process-step-icon { color: var(--warning); }

/* Badge shown next to the LOGO label when auto-assigned from a single host */
.auto-host-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0px;
  padding: 2px 6px;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.1px;
  text-transform: uppercase;
  color: #8794a5;
  background: rgb(255 255 255 / 6%);
  border: none;
  border-radius: 4px;
  line-height: 1.4;
}

/* DEV-ONLY: extraction debug panel — hidden unless wgv_dev flag is set */
.hosts-debug-panel {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(245,158,11,0.06);
  border: 1px dashed rgba(245,158,11,0.35);
  border-radius: var(--radius-sm);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 10.5px;
}
.hosts-debug-title {
  font-weight: 700;
  color: var(--warning);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
  font-size: 9.5px;
}
.hosts-debug-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  color: var(--text-sub);
}
.hosts-debug-grid > div {
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.hosts-debug-key {
  display: inline-block;
  min-width: 140px;
  color: var(--text-muted);
}

/* ── Hosts pill on event cards ───────────────────────────────────────────── */
.btn-hosts {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 500;
  color: rgb(136 148 165);
  background: #241c3c;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}
.btn-hosts:hover {
  color: var(--accent);
  background: rgba(124, 58, 237, 0.26);
  border-color: rgba(124,58,237,0.28);
}

/* ── Edit Hosts modal ────────────────────────────────────────────────────── */
.hosts-edit-context {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 18px;
  display: flex; flex-direction: column; gap: 4px;
}

.hosts-edit-list {
  display: flex; flex-direction: column;
  gap: 7px;
}

.hosts-edit-empty {
  padding: 16px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.host-edit-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
}

/* Wrap holds placeholder underneath; image overlays it. When the image fails
   to load (FB CDN 403, lookaside HTML, etc.), onerror hides the <img> and the
   placeholder shows through — same pattern as the review list. */
.host-edit-avatar-wrap {
  position: relative;
  width: 34px; height: 34px;
  flex-shrink: 0;
}
.host-edit-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--card);
  border: 1px solid var(--border);
}
.host-edit-avatar-img {
  position: absolute;
  inset: 0;
}
.host-edit-avatar-placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: var(--accent);
  background: rgba(124,58,237,0.14);
  border-color: rgba(124,58,237,0.28);
  text-transform: uppercase;
}

.host-edit-info { flex: 1; min-width: 0; }
.host-edit-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 2px;
}
.host-edit-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  word-break: break-word;
}
.host-edit-url {
  display: block;
  font-size: 10.5px;
  color: var(--text-muted);
  text-decoration: none;
  word-break: break-all;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.host-edit-url:hover { color: var(--accent); }

.hosts-add-form {
  margin-top: 22px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Accordion variant — collapsed by default, expands to show fields */
.hosts-add-form-accordion {
  padding: 0;          /* padding lives on summary + body so click targets feel right */
  overflow: hidden;
}

.hosts-add-form-summary {
  list-style: none;     /* Firefox */
  cursor: pointer;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-sub);
  user-select: none;
  transition: color var(--transition), background var(--transition);
}
.hosts-add-form-summary::-webkit-details-marker { display: none; }   /* Safari/Chrome */
.hosts-add-form-summary::marker                   { content: ''; }   /* spec */

.hosts-add-form-summary:hover { color: var(--text); background: var(--card-hover); }

.hosts-add-form-chevron {
  transition: transform var(--transition);
  flex-shrink: 0;
  color: var(--text-muted);
}
.hosts-add-form-accordion[open] .hosts-add-form-chevron {
  transform: rotate(90deg);
  color: var(--accent);
}
.hosts-add-form-accordion[open] .hosts-add-form-summary {
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.hosts-add-form-body {
  padding: 16px;
}

.hosts-add-form-title {
  font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-sub);
  margin-bottom: 14px;
}

.form-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

#newHostType.form-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

@media (max-width: 480px) {
  .form-group-row { grid-template-columns: 1fr; }
}

.event-id-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 500;
  font-family: 'SF Mono','Fira Code',monospace;
}
.event-id-tag.found     { background: rgba(34,197,94,0.1);  color: var(--success); border: 1px solid rgba(34,197,94,0.2); }
.event-id-tag.not-found { background: rgba(239,68,68,0.1);  color: var(--error);   border: 1px solid rgba(239,68,68,0.2); }

/* Type Selector */
.type-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type-option { cursor: pointer; }
.type-option input[type="radio"] { display: none; }

.type-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 12px; border-radius: var(--radius-sm);
  background: var(--surface2); border: 2px solid var(--border);
  transition: all var(--transition);
  font-size: 13px; font-weight: 500; color: var(--text-muted); user-select: none; width: 200px;
}
.type-icon { color: var(--text-muted); transition: color var(--transition); }
.type-option input:checked + .type-card {
  border-color: var(--primary-h); background: rgba(124,58,237,0.1);
  color: var(--accent); box-shadow: 0 0 0 3px var(--primary-glow); width: 200px;
}
.type-option input:checked + .type-card .type-icon { color: var(--accent); }

/* Upload Area */
.upload-area {
  background: var(--surface2); border: 2px dashed var(--border);
  border-radius: var(--radius); padding: 28px; text-align: center;
  cursor: pointer; transition: all 0.2s;
  min-height: 130px; display: flex; align-items: center; justify-content: center;
}
.upload-area:hover         { border-color: var(--primary-h); background: rgba(124,58,237,0.05); }
.upload-area.dragover      { border-color: var(--primary); background: rgba(124,58,237,0.1); box-shadow: 0 0 0 4px var(--primary-glow); }
.upload-area:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.upload-content { display: flex; flex-direction: column; align-items: center; gap: 8px; }

.upload-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: rgba(124,58,237,0.14); color: var(--accent);
  display: flex; align-items: center; justify-content: center; margin-bottom: 2px;
}

.upload-area p   { font-size: 13.5px; font-weight: 500; color: var(--text-sub); }
.upload-filename { margin-top: 7px; font-size: 11.5px; color: var(--text-muted); font-family: 'SF Mono','Fira Code',monospace; }

.upload-preview {
  max-width: 100%; max-height: 180px;
  border-radius: var(--radius-sm); object-fit: cover;
}

.form-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  padding-top: 16px; border-top: 1px solid var(--border); margin-top: 4px;
}

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--card); border: 1px solid var(--border-hover);
  border-radius: var(--radius); padding: 12px 18px;
  font-size: 13.5px; font-weight: 500; color: var(--text);
  box-shadow: var(--shadow-lg); z-index: 9999;
  transform: translateY(70px); opacity: 0;
  transition: all 0.28s cubic-bezier(0.34,1.56,0.64,1);
  max-width: 300px; pointer-events: none;
}
.toast.show    { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--error); }
.toast.info    { border-left: 3px solid var(--accent); }

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .header-inner   { display: -webkit-inline-box; flex-direction: column; align-items: flex-start; gap: 12px; }
  .header-actions { width: 50%; justify-content: flex-end; padding-right: 16px; }
  .brand-desc     { display: none; }
  .brand-logo     { height: 30px; }
  .events-grid    { grid-template-columns: 1fr; }
  .stats-bar      { gap: 8px; width: 100%; }
  .stat           { padding: 12px 16px; flex: 1; min-width: 70px; }
  .stat-value     { font-size: 22px; }
  .toast          { left: 16px; right: 16px; bottom: 16px; max-width: unset; }
  .card-legend    { position: inherit; justify-content: center; display: flex; align-items: center; margin: 0px 0 12px; flex-wrap: wrap; }

  .dashboard-controls {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .card-filters.segmented-control {
    flex: 0 0 100%;
    width: 100%;
  }

  .card-sort.segmented-control {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    overflow-x: auto;
  }

  .card-select-all-label {
    align-self: center;
    margin-left: 0;
    white-space: nowrap;
  }

  .bulk-toolbar {
    flex-wrap: nowrap;
    gap: 8px;
    padding: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .bulk-toolbar-count {
    flex: 0 0 auto;
    font-size: 10px;
    white-space: nowrap;
  }

  .bulk-toolbar-count #bulkToolbarCount {
    font-size: 18px;
  }

  .bulk-toolbar-actions {
    flex: 0 0 auto;
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-left: 0;
  }

  .bulk-toolbar-actions .btn.btn-sm {
    justify-content: center;
    gap: 0;
    padding: 12px;
  }

  .bulk-toolbar-actions .btn svg {
    flex: 0 0 auto;
  }

  .bulk-toolbar-actions .bulk-btn-label {
    display: none;
  }

  .bulk-toolbar-actions .btn-ghost.btn-sm {
    padding: 12px 8px;
  }

  .bulk-toolbar-actions .btn-ghost::after {
    content: "Clear";
  }

  /* Stack visuals vertically on mobile */
  .card-visuals { grid-template-columns: 1fr; }

  /* Flyer: drop aspect-ratio, use fixed height when stacked */
  .flyer-ratio {
    aspect-ratio: auto !important;
    height: 200px;
  }

  /* Logo keeps its 80px height — no change needed on mobile */
}
span.badge-ready {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #21c55e;
  background: rgb(0 177 50 / 16%);
  border: 1px solid #36be827c;
  cursor: help;
  white-space: nowrap;
}

/* ── Event Details: full Facebook description ──────────────────────────────
   The backend can now extract long descriptions. Keep the full text editable
   and readable in the details modal instead of visually truncating it. */
#eventDetailsOverlay .modal {
  max-width: 760px;
}

#eventDetailsOverlay .modal-body {
  overflow: visible;
}

#evDescription.form-input,
textarea#evDescription {
  min-height: 360px;
  max-height: none;
  height: auto;
  resize: vertical;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.55;
}


/* style_v70_ux_search_list_bulk_merge.css */

.wgv-v70-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  padding: 10px 0;
}

.wgv-v70-search {
  flex: 1;
  min-width: 240px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.wgv-v70-search:focus {
  border-color: var(--primary-h);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.wgv-v70-search::placeholder {
  color: var(--text-muted);
}

.wgv-v70-view-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  width: 42px;
  min-width: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-sub);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.wgv-v70-view-toggle svg {
  display: block;
  width: 16px;
  height: 16px;
}

.wgv-v70-view-toggle:hover {
  color: var(--accent);
  border-color: rgba(124,58,237,0.45);
  background: rgba(124,58,237,0.12);
}

/* List view keeps existing cards but compresses them into rows. */
body.wgv-list-view .events-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body.wgv-list-view .event-card,
.event-card.wgv-list-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}

body.wgv-list-view .event-card .card-header,
.event-card.wgv-list-card .card-header {
  min-width: 0;
}

body.wgv-list-view .event-card .card-visuals,
.event-card.wgv-list-card .card-visuals {
  grid-template-columns: 120px 90px;
  justify-content: end;
  gap: 8px;
}

body.wgv-list-view .event-card .visual-block-header,
.event-card.wgv-list-card .visual-block-header {
  display: none;
}

body.wgv-list-view .event-card .flyer-ratio,
.event-card.wgv-list-card .flyer-ratio {
  width: 120px;
  max-height: 76px;
}

body.wgv-list-view .event-card .logo-ratio,
.event-card.wgv-list-card .logo-ratio {
  width: 76px;
  min-height: 76px;
  max-height: 130px;
}

body.wgv-list-view .event-card .card-title,
.event-card.wgv-list-card .card-title {
  height: auto;
  -webkit-line-clamp: 1;
}

.wgv-v70-url-textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.45;
}

body.wgv-list-view .event-card .card-select-checkbox{
  left: 8px;
  top: 15px;
}

body.wgv-list-view .card-cancelled-block {
    display: none;
}

@media (max-width: 760px) {
  .wgv-v70-toolbar {
    flex-direction: row;
    align-items: normal;
  }

  body.wgv-list-view .event-card,
  .event-card.wgv-list-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 8px 6px;
  }

  body.wgv-list-view .event-card .card-visuals,
  .event-card.wgv-list-card .card-visuals {
    justify-content: start;
  }

  .event-card.wgv-list-card .card-fbid {
    display:none;
  }

  .event-card.wgv-list-card span.card-updated {
    display: none;
  }

  body.wgv-list-view .event-card .card-visuals {
    display: flex;
    transform: scale(0.45);
    position: absolute;
    top: -18px;
    right: -52px;
    gap: 10px;
  }

  body.wgv-list-view .event-card .card-select-checkbox {
    left: 4px;
    top: 11px;
  }

  body.wgv-list-view .event-card input.card-select-checkbox {
    width: 12px;
    height: 12px;
  }

  body.wgv-list-view .event-card .card-title {
    flex: 1;
    max-width: 260px;
  }
}
