/* ══════════════════════════════════════════════════════════════
   Interior Motives — Dashboard Styles
   ══════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Industry';
  src: url('fonts/industry-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap; /* text paints in fallback, swaps when loaded */
}
@font-face {
  font-family: 'Industry';
  src: url('fonts/industry-demi.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Swiss system — white ground, hairline rules, one blue accent
     (matches ../interior-motives-db-audit) */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f6fa;
  --surface-3: #e9edf4;
  --border: #dbe2ec;
  --line-strong: #b9c4d6;
  --line-soft: #e9edf4;
  --text: #08203c;            /* logo navy */
  --text-muted: #8b98ad;
  --ink-dim: #46536b;
  --accent: #0268d8;          /* logo core blue */
  --accent-dim: #015ace;      /* logo deep blue */
  --accent-2: #0279e3;        /* logo light blue */
  --accent-bright: #03a7ee;   /* logo cyan highlight */
  --patron: #f59e0b;
  --free: #0268d8;
  --green: #16a34a;
  --danger: #dc2626;
  --youtube: #dc2626;
  --patreon: #f96854;
  --radius: 2px;
  --radius-sm: 2px;
  --shadow: 0 1px 2px rgba(8,32,60,.04);
  --shadow-float: 0 18px 50px -20px rgba(8,32,60,.25), 0 4px 12px -6px rgba(8,32,60,.08);
  --font: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --font-display: "Industry", "IBM Plex Mono", ui-monospace, monospace;
  --transition: 180ms cubic-bezier(.22,1,.36,1);
}

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

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  /* Keep iOS from inflating text in landscape */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

button, input, select, a, label, .chip, tr[data-id], .k-card, .m-card {
  /* Kill the 300ms tap delay / double-tap zoom on interactive elements */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ────────────────────────────────────────────────────────── */
/* 5. KANBAN BOARD                                            */
/* ────────────────────────────────────────────────────────── */
.kanban-wrapper {
  flex-grow: 1;
  padding: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.kanban-board {
  display: flex;
  gap: 20px;
  height: 100%;
  overflow-x: auto;
  align-items: flex-start;
  padding-bottom: 20px; /* shadow room */
}

.kanban-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex: 1;
  min-width: 250px;
  display: flex;
  flex-direction: column;
  max-height: 100%;
}

.kanban-col .col-header {
  padding: 16px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-2);
  border-radius: var(--radius) var(--radius) 0 0;
}

.kanban-col .col-count {
  background: var(--border);
  padding: 2px 8px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.kanban-col .col-cards {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-grow: 1;
}

.k-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.k-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.k-card-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--surface-2);
  flex-shrink: 0;
}

.k-card-thumb-init {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-muted);
}

.k-card-info {
  flex-grow: 1;
  min-width: 0;
}

.k-card-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.k-card-loc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.k-card-meta {
  display: flex;
  gap: 8px;
  font-size: 0.75rem;
  align-items: center;
}

.k-card-pill {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: var(--radius);
  color: var(--text);
  border: 1px solid var(--border);
}

/* ────────────────────────────────────────────────────────── */
/* 2. AUTH OVERLAY                                            */
/* ────────────────────────────────────────────────────────── */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-card label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: -8px;
}

.auth-card input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.auth-card input:focus {
  outline: none;
  border-color: var(--accent);
  background: #ffffff;
}

.auth-card .btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 8px;
  transition: transform 0.1s ease, filter 0.2s ease;
}

.auth-card .btn-primary:active {
  transform: scale(0.98);
}

.auth-card .btn-primary:hover {
  filter: brightness(1.1);
}

.login-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
  padding: 10px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  text-align: center;
}

/* ── HEADER ──────────────────────────────────────────────── */
#app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Wrap at every width: when the toolbar's natural width no longer fits
     beside the lockup (a 1440/1512pt laptop at 100% zoom), it drops to its own
     full-width row instead of squeezing the chips into a jammed two-line block. */
  flex-wrap: wrap;
  column-gap: 20px;
  row-gap: 12px;
  padding: 13px 24px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 12px;
}

.header-left h1 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge {
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.header-right {
  display: flex;
  align-items: center;
  /* flex-basis auto + no grow: hugs its content on one line when it fits,
     sits flush left on its own row when the header wraps. */
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px 12px;
}

/* ── FILTER CHIPS ────────────────────────────────────────── */
.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.view-toggle {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
}

.view-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 5px 12px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-btn:hover {
  color: var(--text);
}

.view-btn.active {
  background: var(--accent-dim);
  color: #fff;
  box-shadow: 0 2px 8px rgba(2, 104, 216, 0.25);
}

.chip {
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.chip:hover { background: var(--surface-2); color: var(--text); }

.chip.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: #fff;
}

.chip-count { font-size: 0.7rem; opacity: 0.7; }

/* ── SEARCH BAR ──────────────────────────────────────────── */
.search-bar {
  position: sticky;
  /* Set from the real header height by app.js; 60px is the single-row value. */
  top: var(--header-h, 60px);
  z-index: 45;
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.search-bar-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 10px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-bar-inner:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(2, 104, 216, 0.14);
}

.search-icon { color: var(--text-muted); flex-shrink: 0; }

.search-bar-inner input {
  flex: 1;
  border: none;
  outline: none;
  background: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
}

.search-bar-inner input::placeholder { color: var(--text-muted); }

.search-hints {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 200px;
  overflow-y: auto;
  display: none;
  z-index: 10;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.search-hints.show { display: block; }

.search-hint-item {
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.search-hint-item:hover { background: var(--surface-3); color: var(--text); }
.search-hint-item:last-child { border-bottom: none; }

.search-hint-item em {
  font-style: normal;
  color: var(--accent);
  font-weight: 600;
}

/* ── REFRESH BUTTON ──────────────────────────────────────── */
.btn-refresh {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-refresh:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--accent);
}

.btn-refresh.spinning svg { animation: spin 0.6s linear infinite; }

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

/* ── LOADING / EMPTY ─────────────────────────────────────── */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60vh;
  gap: 16px;
  color: var(--text-muted);
}

.loader {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40vh;
  color: var(--text-muted);
  font-size: 1rem;
}

/* ── TABLE ───────────────────────────────────────────────── */
.table-wrapper { padding: 14px clamp(12px, 1.6vw, 24px) 32px; }

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }

thead { position: sticky; top: 0; z-index: 5; }

thead th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}

tbody tr { cursor: pointer; transition: background var(--transition); }
tbody tr:hover { background: var(--surface-2); }
tbody tr.row-aired { opacity: 0.55; }
tbody tr.row-aired:hover { opacity: 0.85; }
tbody tr:not(:last-child) td { border-bottom: 1px solid var(--border); }

td {
  padding: 10px 12px;
  vertical-align: middle;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-aired { width: 40px; text-align: center; }
.col-thumb { width: 48px; }
.col-age { width: 44px; text-align: center; }
.col-score { width: 58px; }
.col-platform { width: 85px; }
.col-state { width: 50px; }
.col-country { width: 54px; }
/* Ceilings on the free-text columns. Measured at 1512pt / 100% zoom the 14
   columns sum to ~1564px against a 1454px scrollport, so the table sat at
   max-content and scrolled sideways — the "crowded" feel. Capped they total
   ~1360px, which fits a 1440pt laptop with room to spare. Every capped cell
   truncates with an ellipsis and carries a title tooltip with the full text. */
.col-name,      td.col-name      { max-width: 165px; }
.col-location,  td.col-location  { max-width: 150px; }
.col-sexuality, td.col-sexuality { max-width: 115px; }
.col-gender,    td.col-gender    { max-width: 95px; }
.col-hint,      td.col-hint      { max-width: 175px; }
.col-social,    td.col-social    { max-width: 130px; }
.col-date,      td.col-date      { max-width: 105px; }

/* ── AIRED CHECKBOX ──────────────────────────────────────── */
.aired-check { width: 18px; height: 18px; accent-color: var(--green); cursor: pointer; }

/* ── SCORE INPUT ─────────────────────────────────────────── */
.score-input {
  width: 44px;
  padding: 3px 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  text-align: center;
  outline: none;
  transition: border-color var(--transition);
}

.score-input:focus { border-color: var(--accent); }
.score-input::-webkit-inner-spin-button { display: none; }

/* ── PLATFORM SELECT ─────────────────────────────────────── */
.platform-select {
  padding: 3px 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.78rem;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.platform-select:focus { border-color: var(--accent); }

/* ── BADGES ──────────────────────────────────────────────── */
.platform-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.platform-badge.youtube {
  background: rgba(255, 0, 0, 0.12);
  color: var(--youtube);
  border: 1px solid rgba(255, 0, 0, 0.25);
}

.platform-badge.patreon {
  background: rgba(249, 104, 84, 0.12);
  color: var(--patreon);
  border: 1px solid rgba(249, 104, 84, 0.25);
}

.row-thumb {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--surface-3);
  border: 1px solid var(--border);
}

.row-thumb-init {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.source-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.source-badge.patron { background: rgba(245, 158, 11, 0.15); color: var(--patron); border: 1px solid rgba(245, 158, 11, 0.3); }
.source-badge.free { background: rgba(34, 211, 238, 0.12); color: var(--free); border: 1px solid rgba(34, 211, 238, 0.25); }

.country-flag {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.age-cell {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
}

/* ── DRAG AND DROP ───────────────────────────────────────── */
.kanban-col.drag-over {
  background: var(--surface-2);
  border: 1px dashed var(--accent);
}
.k-card.dragging {
  opacity: 0.5;
}

/* ── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  position: relative;
  width: min(720px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.25s ease;
  transition: width 0.3s ease, max-height 0.3s ease;
}

.modal.modal-fullscreen {
  width: min(1400px, 96vw) !important;
  max-height: 94vh !important;
}

@keyframes slideUp {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: sticky;
  top: 12px;
  float: right;
  margin: 12px 12px 0 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  z-index: 5;
  transition: all var(--transition);
}

.modal-close:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.modal-body { padding: 24px 28px 28px; }

/* ── PROFILE ─────────────────────────────────────────────── */
.profile-header { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }

/* Navigation arrows */
.nav-arrow {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.nav-arrow:hover:not(.disabled) {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: #fff;
}

.nav-arrow.disabled {
  opacity: 0.2;
  cursor: default;
  pointer-events: none;
}

.nav-position {
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.6;
  font-family: var(--font-display);
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-3);
  border: 2px solid var(--accent-dim);
  flex-shrink: 0;
}

.profile-avatar-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-dim), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.profile-info h2 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; margin-bottom: 4px; }

.profile-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.82rem; color: var(--text-muted); }
.profile-meta span { display: flex; align-items: center; gap: 4px; }

.editorial-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.editorial-bar label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.editorial-bar .score-input { width: 56px; }
.editorial-bar .platform-select { padding: 5px 10px; }
.editorial-bar .aired-check { width: 20px; height: 20px; }

.profile-section { margin-bottom: 20px; }

.profile-section-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.profile-field { display: flex; gap: 12px; padding: 8px 0; }
.profile-field dt { min-width: 100px; color: var(--text-muted); font-size: 0.82rem; font-weight: 500; }
.profile-field dd { color: var(--text); font-size: 0.9rem; word-break: break-word; }

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.photo-gallery img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  background: var(--surface-3);
}

.photo-gallery img:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 20px rgba(2, 104, 216, 0.2);
  border-color: var(--accent);
}

.written-response {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
  margin-top: 6px;
  font-style: italic;
}

/* ── LIGHTBOX ────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: fadeIn 0.15s ease;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
  cursor: default;
}

.lb-close {
  position: fixed;
  top: 3vh;
  right: 3vw;
  z-index: 202;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.lb-close:hover { background: rgba(255, 255, 255, 0.22); border-color: rgba(255, 255, 255, 0.5); }

.lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 201;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.lb-nav:hover { background: rgba(255, 255, 255, 0.22); border-color: rgba(255, 255, 255, 0.5); }
.lb-prev { left: 3vw; }
.lb-next { right: 3vw; }

.lb-caption {
  position: fixed;
  bottom: 4vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 201;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: default;
}
.lb-counter { font-variant-numeric: tabular-nums; color: #fff; font-weight: 600; }
.lb-label { opacity: 0.75; }

/* ── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: var(--radius); }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

.row-new { animation: rowPulse 1s ease; }
@keyframes rowPulse { 0% { background: rgba(2, 104, 216, 0.12); } 100% { background: transparent; } }

/* ── STAR COUNT (table column) ───────────────────────────── */
.col-stars { width: 60px; text-align: center; }

.star-count {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #facc15;
}

.star-count.dim { color: var(--text-muted); font-weight: 400; }

.star-counter {
  font-size: 0.82rem;
  color: #facc15;
  font-weight: 600;
}

.sub-id {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.7;
  cursor: help;
}

.sub-id-code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.78rem;
  background: var(--surface-3);
  padding: 2px 8px;
  border-radius: var(--radius);
  color: var(--accent);
  user-select: all;
}

/* ── MODAL VIEW TABS ─────────────────────────────────────── */
.modal-view-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 18px;
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 3px;
  border: 1px solid var(--border);
}

.view-tab {
  flex: 1;
  padding: 8px 16px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.view-tab:hover { color: var(--text); background: var(--surface-3); }

.view-tab.active {
  background: var(--accent-dim);
  color: #fff;
  box-shadow: 0 2px 8px rgba(2, 104, 216, 0.25);
}

.tab-count {
  font-size: 0.7rem;
  opacity: 0.8;
  margin-left: 2px;
}

/* ── PHOTOS VIEW ─────────────────────────────────────────── */
.photos-view-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.photos-view-count {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

/* Large grid — genuinely big tiles for the Photos view */
.large-grid {
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 16px;
}

.review-photo-card.large {
  border-width: 3px;
}

.review-photo-card.large img {
  aspect-ratio: 4/3;
  min-height: 280px;
}

.review-photo-card.large .star-btn {
  width: 48px;
  height: 48px;
  font-size: 1.8rem;
  top: 12px;
  right: 12px;
}

.review-photo-card.large .photo-label {
  padding: 8px 14px;
  font-size: 0.8rem;
}

/* ── PHOTO REVIEW GRID ───────────────────────────────────── */
.section-subtitle {
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  margin-left: 8px;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.review-photo-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--border);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: var(--surface-3);
}

.review-photo-card:hover {
  border-color: var(--accent-dim);
}

.review-photo-card.starred {
  border-color: #facc15;
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.15);
}

.review-photo-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.review-photo-card:hover img {
  transform: scale(1.03);
}

/* Star button overlay */
.star-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 2;
  line-height: 1;
}

.star-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  color: #facc15;
  transform: scale(1.15);
}

.star-btn.active {
  background: rgba(250, 204, 21, 0.2);
  color: #facc15;
  text-shadow: 0 0 8px rgba(250, 204, 21, 0.6);
}

.star-btn.active:hover {
  background: rgba(250, 204, 21, 0.3);
}

/* Section label on each photo */
.photo-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 3px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: rgba(255,255,255,0.7);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── db-audit brand lockup (door + uppercase wordmark) ─────── */
.lockup { display: flex; align-items: center; gap: .55rem; }
.door {
  position: relative; width: 26px; height: 32px; border-radius: var(--radius); flex: 0 0 auto;
  background: var(--accent); box-shadow: 0 0 0 1px rgba(255,255,255,.25) inset;
  transform: perspective(120px) rotateY(-14deg); transition: transform .3s var(--transition);
}
.lockup:hover .door { transform: perspective(120px) rotateY(-4deg); }
.door::after { content: ""; position: absolute; right: 4px; top: 5px; bottom: 5px; width: 2px; background: #9fd4fa; opacity: .9; }
.header-left h1 {
  text-transform: uppercase; letter-spacing: .12em;
  /* solid ink wordmark reads cleaner than gradient in the Swiss system */
  background: none; -webkit-text-fill-color: currentColor; color: var(--text);
}

/* progressive-render sentinel (invisible marker) */
.vsentinel { height: 0; padding: 0; margin: 0; border: 0; visibility: hidden; }
.vsentinel td { padding: 0; border: 0; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE SYSTEM
   Phone ≤ 700px · Tablet 701–1024px · touch refinements
   ══════════════════════════════════════════════════════════════ */

/* ── MOBILE CARD LIST (phone replacement for the table) ────── */
.card-wrapper {
  padding: 10px 12px calc(28px + env(safe-area-inset-bottom));
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
}

.card-list { display: flex; flex-direction: column; gap: 10px; }

.m-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 4px 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.m-card:active { background: var(--surface-2); }
.m-card.row-aired { opacity: 0.55; }

.m-card-thumb {
  grid-row: 1 / span 2;
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.m-card-thumb-init {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--text-muted);
}

.m-card-main { min-width: 0; }

.m-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.m-card-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m-card-date { color: var(--text-muted); font-size: 0.72rem; flex-shrink: 0; }

.m-card-loc {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m-card-badges {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.m-card-hint {
  grid-column: 1 / -1;
  margin-top: 6px;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--ink-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.m-card-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}

.m-card-actions label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  min-height: 40px;
}

.m-card-actions .aired-check { width: 22px; height: 22px; }
.m-card-actions .score-input { width: 64px; min-height: 40px; font-size: 16px; }
.m-card-actions .m-card-photos { margin-left: auto; font-size: 0.8rem; color: var(--text-muted); }

/* ── TABLET (≤ 1024px) ─────────────────────────────────────── */
/* Desktop mid-widths need no breakpoint any more: #app-header wraps natively,
   so the toolbar takes its own full-width row the moment it stops fitting. */

@media (max-width: 1024px) {
  /* Two-row header: lockup left + view/refresh controls right, then the
     filter chips on their own full-width row. header-right dissolves so its
     children participate in the header's own flex flow. */
  #app-header { flex-wrap: wrap; padding: 12px 16px; gap: 10px; row-gap: 10px; }
  .header-right { display: contents; }
  .header-left { order: 1; margin-right: auto; }
  .header-left h1 { white-space: nowrap; }
  /* .blind-toggle is a .chip, so without an explicit order it defaults to 0
     and jumps ahead of the lockup once header-right dissolves. */
  .blind-toggle { order: 2; }
  .view-toggle { order: 3; }
  .btn-refresh { order: 4; }
  .filter-chips { order: 5; width: 100%; }
  .search-bar { padding: 10px 16px; }
  .table-wrapper { padding: 12px 10px 24px; }
  .table-scroll { -webkit-overflow-scrolling: touch; }
  /* Progressive disclosure: drop the lowest-value column; it's in the modal */
  .col-social, td.col-social { display: none; }
  .kanban-wrapper { padding: 16px; }
  .kanban-board { scroll-snap-type: x proximity; }
  .kanban-col { min-width: 280px; scroll-snap-align: start; }
}

@media (max-width: 900px) {
  .col-sexuality, td.col-sexuality,
  .col-gender, td.col-gender { display: none; }
  .modal { width: min(720px, 96vw); }
}

/* ── PHONE (≤ 700px) ───────────────────────────────────────── */
@media (max-width: 700px) {
  /* Header: static (don't burn viewport height), two-row layout with a
     horizontally swipeable chip rail. header-right dissolves so its children
     participate in the header's own flex flow. */
  /* Row structure (orders) inherited from the tablet block above */
  #app-header {
    position: static;
    gap: 8px;
    row-gap: 10px;
    padding: 10px 12px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .header-left { gap: 8px; }
  .btn-refresh { width: 40px; height: 40px; }
  .view-btn { padding: 8px 12px; }
  .filter-chips {
    width: 100vw;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -12px -10px;
    padding: 0 max(12px, env(safe-area-inset-left)) 10px;
  }
  .filter-chips::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; min-height: 38px; padding: 6px 16px; white-space: nowrap; }
  .header-left h1 { font-size: 0.95rem; }
  .door { width: 18px; height: 24px; }
  .badge { padding: 3px 8px; }

  /* Search pins to the top on scroll; 16px input so iOS doesn't zoom on focus */
  .search-bar {
    top: 0;
    padding: 8px 12px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .search-bar-inner { padding: 8px 14px; }
  .search-bar-inner input { font-size: 16px; }

  /* Auth */
  .auth-overlay { padding: 16px; }
  .auth-card { padding: 28px 22px; box-shadow: none; }
  .auth-card input { font-size: 16px; }

  /* Modal becomes a full-screen sheet */
  .modal-overlay { align-items: stretch; justify-content: stretch; }
  .modal,
  .modal.modal-fullscreen {
    width: 100vw !important;
    max-height: none !important;
    height: 100dvh;
    border: none;
    border-radius: 0;
  }
  .modal-body {
    padding: 14px 14px calc(24px + env(safe-area-inset-bottom));
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }
  .modal-close { width: 40px; height: 40px; top: calc(10px + env(safe-area-inset-top)); }

  /* Profile header: arrows flank a compact avatar + info row */
  .profile-header {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
  }
  .profile-avatar, .profile-avatar-placeholder { width: 52px; height: 52px; font-size: 1.2rem; }
  .profile-info { min-width: 0; }
  .profile-info h2 { font-size: 1.05rem; }
  .profile-meta { gap: 6px 10px; font-size: 0.76rem; }
  /* ID and full date live in the Details section — omit from the tight header */
  .profile-meta .sub-id, .profile-meta .meta-date { display: none; }
  .nav-arrow { width: 42px; height: 42px; font-size: 1.4rem; }

  /* Pin the Profile/Photos tabs while scrolling; stay under the ✕ button */
  .modal-view-tabs { position: sticky; top: -14px; z-index: 4; }
  .view-tab { min-height: 42px; }
  .platform-select { font-size: 16px; min-height: 40px; }

  .editorial-bar { flex-wrap: wrap; gap: 12px 16px; padding: 12px; }
  .editorial-bar .score-input { min-height: 40px; font-size: 16px; }
  .editorial-bar #btn-export-zip {
    flex-basis: 100%;
    margin-left: 0 !important;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    font-family: var(--font);
    cursor: pointer;
  }

  .profile-field { flex-direction: column; gap: 2px; padding: 6px 0; }
  .profile-field dt { min-width: 0; }

  /* Photo grids: two-up small tiles, full-width large tiles */
  .review-grid { grid-template-columns: repeat(2, 1fr); }
  .large-grid { grid-template-columns: 1fr !important; gap: 12px; }
  .review-photo-card.large img { min-height: 0; }
  .star-btn { width: 44px; height: 44px; font-size: 1.4rem; }
  .photo-gallery { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }

  /* Kanban: page-width snapping columns that scroll internally */
  .kanban-wrapper { padding: 12px; }
  .kanban-board { gap: 12px; scroll-snap-type: x mandatory; padding-bottom: 12px; }
  .kanban-col {
    min-width: min(86vw, 340px);
    scroll-snap-align: center;
    max-height: none;
  }
  .kanban-col .col-cards { max-height: calc(100dvh - 250px); }
  .k-card { padding: 14px; gap: 12px; }

  /* Lightbox: bigger targets, safe-area aware, controls at screen edges */
  .lb-close {
    width: 48px;
    height: 48px;
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
  }
  .lb-nav { width: 44px; height: 44px; font-size: 1.6rem; }
  .lb-prev { left: max(6px, env(safe-area-inset-left)); }
  .lb-next { right: max(6px, env(safe-area-inset-right)); }
  .lb-caption {
    bottom: max(16px, env(safe-area-inset-bottom));
    max-width: 88vw;
    flex-wrap: wrap;
    justify-content: center;
  }
  .lightbox img { max-width: 100vw; max-height: 100dvh; border-radius: 0; }
}

/* ── TOUCH REFINEMENTS (any touch-first device, incl. tablets) ── */
@media (pointer: coarse) {
  .chip, .view-btn { min-height: 40px; }
  .btn-refresh { width: 42px; height: 42px; }
  .aired-check { width: 22px; height: 22px; }
  .modal-close { width: 42px; height: 42px; }
  .star-btn { width: 44px; height: 44px; font-size: 1.4rem; }
  .search-hint-item { padding: 12px 14px; }
  .score-input, .platform-select { min-height: 38px; }
}

/* No hover on touch: disable hover-only motion so cards don't stick mid-state */
@media (hover: none) {
  .k-card:hover { transform: none; box-shadow: none; border-color: var(--border); }
  .review-photo-card:hover img, .photo-gallery img:hover { transform: none; }
  tbody tr.row-aired:hover { opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── GALLERY VIEW — big room thumbnails, demographics on click-through ── */
.gallery-wrapper { padding: 16px clamp(12px, 2vw, 24px) 48px; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.g-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-2);
  aspect-ratio: 4 / 3;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.g-card:hover { border-color: var(--accent); box-shadow: var(--shadow-float); transform: translateY(-2px); }
.g-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.g-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-card-init {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 700; color: var(--text-muted);
}
.g-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(transparent, rgba(8, 32, 60, 0.72));
  color: #fff;
}
.g-name { font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-flag { font-size: 0.85rem; flex: 0 0 auto; }
.g-badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 6px; }
.g-badge {
  font-size: 0.6rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 7px; border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92); color: var(--text); border: 1px solid var(--line-strong);
}
.g-badge.g-aired { background: var(--accent); color: #fff; border-color: var(--accent-dim); }
.region-chips { border-left: 1px solid var(--border); padding-left: 12px; margin-left: 4px; }
@media (max-width: 700px) {
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .region-chips { border-left: 0; padding-left: 0; margin-left: 0; }
}

/* ── VIBE TAG PILLS (profile modal) ───────────────────────── */
.tag-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag-pill {
  font-family: var(--font);
  font-size: 0.68rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 9px; border-radius: var(--radius);
  background: var(--surface-2); color: var(--ink-dim); border: 1px solid var(--border);
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.tag-pill:hover { border-color: var(--accent); color: var(--text); }
.tag-pill.manual { background: rgba(2, 104, 216, 0.08); border-color: rgba(2, 104, 216, 0.35); color: var(--accent-dim); }
.tag-x { font-size: 0.85rem; line-height: 1; opacity: 0.6; padding: 0 1px; }
.tag-x:hover { opacity: 1; color: var(--danger); }
.tag-none { color: var(--text-muted); font-size: 0.8rem; font-style: italic; }
.tag-add-row { display: flex; gap: 8px; align-items: center; }
.tag-add-input {
  flex: 1; max-width: 340px; font: inherit; font-size: 0.8rem; color: var(--text);
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 10px;
}
.tag-add-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(2,104,216,.14); }

/* ── T&C status badge ─────────────────────────────────────── */
.tc-badge { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: var(--radius); border: 1px solid var(--border); }
.tc-badge.tc-signed, .tc-badge.tc-granted { color: var(--green); border-color: rgba(22,163,74,.4); background: rgba(22,163,74,.08); }
.tc-badge.tc-pending { color: var(--patron); border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.08); }
.tc-badge.tc-declined { color: var(--danger); border-color: rgba(220,38,38,.4); background: rgba(220,38,38,.08); }

/* ── Brand mark: square logo masked to a perfect circle ───── */
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 50%;          /* circular mask over the square image */
  object-fit: cover;
  display: block;
  flex: 0 0 auto;
  box-shadow: 0 0 0 1px var(--border);
  transition: transform .3s var(--transition);
}
.lockup:hover .brand-mark { transform: scale(1.06); }

/* ── Password show/hide toggle ────────────────────────────── */
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { flex: 1; padding-right: 44px; width: 100%; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  background: transparent; border: none; border-radius: var(--radius);
  color: var(--text-muted); cursor: pointer;
  transition: color var(--transition), background var(--transition);
}
.pw-toggle:hover { color: var(--text); background: var(--surface-2); }
.pw-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ── BLIND MODE — rooms + vibe tags only, no submitter identity ── */
.blind-toggle.active { background: var(--accent); border-color: var(--accent-dim); color: #fff; }
/* generic PII marker (profile modal: location, details, hint, export) */
body.blind .pii { display: none !important; }
/* table: hide identity columns, keep room/thumb + editorial + tags */
body.blind .col-name, body.blind .col-age, body.blind .col-location,
body.blind .col-sexuality, body.blind .col-gender, body.blind .col-hint,
body.blind .col-social, body.blind .col-date { display: none; }
/* kanban + mobile cards: hide name/age and location line */
body.blind .k-card-name, body.blind .k-card-loc { display: none; }
/* gallery: hide caption name + region flag (pure room photos) */
body.blind .g-name, body.blind .g-flag, body.blind .g-tags { display: none; }
/* a small marker so it's obvious blind mode is on */
body.blind #app-header::after {
  content: "BLIND MODE"; position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.12em; color: #fff;
  background: var(--accent); padding: 2px 10px; border-radius: 0 0 var(--radius) var(--radius);
  z-index: 60; pointer-events: none;
}

/* gallery caption vibe tags */
.g-caption-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.g-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.g-tag {
  font-size: 0.58rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 6px; border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.18); color: #fff; border: 1px solid rgba(255, 255, 255, 0.28);
}

/* ── BLIND MODE: room-photo strips (2 angles, ~2x the user-pic size) ── */
.row-thumbstrip { display: flex; gap: 4px; }
.row-thumbstrip img { width: 96px; height: 72px; object-fit: cover; border-radius: var(--radius); background: var(--surface-2); }
body.blind .col-thumb { min-width: 200px; }   /* room for the two room photos */

.k-card-thumbstrip { display: flex; gap: 5px; flex: 0 0 auto; }
.k-card-thumbstrip img { flex: 1 1 0; width: 100%; aspect-ratio: 4/3; min-width: 96px; object-fit: cover; border-radius: var(--radius); background: var(--surface-2); }
body.blind .k-card { flex-direction: column; align-items: stretch; }

/* IM logo standing in for the avatar in blind mode */
.brand-avatar { object-fit: contain !important; background: #fff; padding: 4px; }

/* mobile card: hide identity in blind */
body.blind .m-card-name, body.blind .m-card-loc, body.blind .m-card-hint { display: none; }

/* ── GALLERY in-card hover carousel ───────────────────────── */
.g-imgs { position: absolute; inset: 0; }
.g-imgs img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .2s ease; }
.g-imgs img.active { opacity: 1; }
.g-card-init { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2rem; background: var(--surface-2); }
.g-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 30px; height: 44px; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; line-height: 1; color: #fff; cursor: pointer;
  background: rgba(8,32,60,.42); border: none;
  opacity: 0; transition: opacity .15s ease, background .15s ease;
}
.g-prev { left: 0; border-radius: 0 var(--radius) var(--radius) 0; }
.g-next { right: 0; border-radius: var(--radius) 0 0 var(--radius); }
.g-nav:hover { background: rgba(8,32,60,.7); }
.g-card:hover .g-nav, .g-card:focus-within .g-nav { opacity: 1; }
.g-count {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  font-size: .6rem; font-weight: 600; color: #fff; background: rgba(8,32,60,.55);
  padding: 2px 7px; border-radius: var(--radius); opacity: 0; transition: opacity .15s ease;
  font-variant-numeric: tabular-nums;
}
.g-card:hover .g-count { opacity: 1; }

/* ── Structured tag facets (profile modal) ────────────────── */
.tag-facet { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.tag-facet-label {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em; color: var(--text-muted);
  min-width: 62px; text-transform: uppercase;
}
.tag-pill.obj { flex-direction: column; align-items: flex-start; gap: 1px; }
.tag-pill.obj .tag-attrs { font-size: 0.58rem; font-weight: 400; letter-spacing: 0.02em; opacity: 0.7; text-transform: none; }
.tag-pill.color::before { content: "●"; margin-right: 5px; opacity: 0.55; }

/* wordmark stays one line at every width */
.header-left h1 { white-space: nowrap; }

/* ── Stacked search filter pills ──────────────────────────── */
.search-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.search-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.8rem; font-weight: 500; padding: 5px 6px 5px 11px;
  border-radius: var(--radius);
  background: rgba(2, 104, 216, 0.10); color: var(--accent-dim);
  border: 1px solid rgba(2, 104, 216, 0.35);
}
.pill-x {
  background: none; border: none; cursor: pointer; color: inherit;
  font-size: 0.8rem; line-height: 1; padding: 2px 4px; border-radius: var(--radius);
  opacity: 0.6; transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.pill-x:hover { opacity: 1; color: var(--danger); background: rgba(220, 38, 38, 0.1); }

/* ── Search: ＋ add-filter button + bigger touch targets ───── */
.search-add {
  flex: 0 0 auto; width: 34px; height: 34px; margin-left: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; line-height: 1; color: var(--text-muted);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.search-add:hover { color: var(--accent); border-color: var(--accent); }
@media (pointer: coarse) {
  /* comfortable thumb targets on phones */
  .search-add { width: 44px; height: 44px; font-size: 1.5rem; }
  .pill-x { padding: 8px 10px; font-size: 1rem; }
  .search-pill { padding: 6px 4px 6px 12px; font-size: 0.85rem; }
}

/* hint question shown above the answer */
.hint-q { font-size: 0.82rem; font-weight: 600; color: var(--accent-dim); margin-bottom: 6px; }

/* ── Sortable table headers ───────────────────────────────── */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--accent); }
th.sortable.sorted { color: var(--accent); }
.sort-arrow { font-size: 0.65rem; opacity: 0.8; margin-left: 2px; }
