/* ── Design Tokens ──────────────────────────────────────────────────────── */
:root {
  --bg: #ffffff;
  --bg2: #f4f4f6;
  --bg3: #ebebef;
  --surface: #ffffff;
  --surface2: #f0f0f4;
  --border: #e0e0e8;
  --border-strong: #bbbbc8;
  --text: #0b0b0f;
  --text-dim: #5a5a70;
  --text-faint: #ababba;
  --accent: #1a1aff;
  --accent-dim: rgba(26, 26, 255, 0.08);
  --red: #e82020;
  --red-dim: rgba(232, 32, 32, 0.07);
  --green: #0a7a3e;
  --green-dim: rgba(10, 122, 62, 0.08);
  --orange: #c45a00;
  --orange-dim: rgba(196, 90, 0, 0.08);

  /* Vote screen */
  --vbg: #ffffff;
  --vbg2: #f4f4f6;
  --vbg3: #ebebef;
  --vsurface: #ffffff;
  --vborder: #e0e0e8;
  --vborder-strong: #bbbbc8;
  --vtext: #0b0b0f;
  --vtext-dim: #5a5a70;
  --vtext-faint: #ababba;
  --vgrid: rgba(0, 0, 0, 0.04);
  --vaccent: #1a1aff;
  --vaccent-dim: rgba(26, 26, 255, 0.08);
  --vaccent-text: #ffffff;
  --vred: #e82020;
  --vred-dim: rgba(232, 32, 32, 0.07);
  --vselected-bg: #1a1aff;
  --vselected-border: #1a1aff;

  /* Grid sizing */
  --hour-height: 68px;
  --stage-width: 155px;
  --time-col: 52px;

  /* Admin */
  --adm-bg: #0d0a1a;
  --adm-acc: #9b5cff;
  --adm-acc-dim: rgba(155, 92, 255, 0.15);
  --adm-border: rgba(155, 92, 255, 0.2);
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html, body {
  background: #fff;
  color: #0b0b0f;
  font-family: 'Barlow', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── App visibility ─────────────────────────────────────────────────────── */
#app-user { display: block; }
#app-admin { display: none; }
body.admin-mode #app-user { display: none; }
body.admin-mode #app-admin { display: block; }

/* ── Loading overlay ────────────────────────────────────────────────────── */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
}
#loading-overlay.show { display: flex; }
.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* ── API error banner ───────────────────────────────────────────────────── */
.api-error {
  background: var(--red-dim);
  border: 1px solid rgba(232, 32, 32, 0.25);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--red);
  margin: 0 16px 16px;
  display: none;
}
.api-error.show { display: block; }

/* ── Sync indicator ─────────────────────────────────────────────────────── */
#sync-indicator {
  position: fixed;
  bottom: calc(64px + env(safe-area-inset-bottom, 0) + 6px);
  right: 10px;
  z-index: 200;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 7px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
#sync-indicator.show { opacity: 1; }

/* ── Header ─────────────────────────────────────────────────────────────── */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #fff;
  backdrop-filter: blur(14px);
  border-bottom: 2px solid #e0e0e8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 56px;
}
.logo {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.5px;
  color: #0b0b0f;
  cursor: pointer;
  user-select: none;
}
.logo span { color: #1a1aff; }
.header-right { display: flex; align-items: center; gap: 10px; }
.header-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #5a5a70;
  letter-spacing: 0.5px;
  text-align: right;
  line-height: 1.4;
}
.header-meta span { display: block; }

#header-session {
  margin-left: 12px;
  font-size: 11px;
  color: var(--text-faint);
  display: none;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
}
#header-session-code {
  letter-spacing: 0.08em;
}
.header-invite-btn {
  padding: 5px 8px;
  font-size: 9px;
  letter-spacing: 0.06em;
}
.admin-trigger {
  background: none;
  border: 1px solid #d0d0e0;
  border-radius: 6px;
  padding: 5px 10px;
  color: #5a5a70;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.admin-trigger:hover { border-color: var(--adm-acc); color: var(--adm-acc); }

/* ── Bottom nav ─────────────────────────────────────────────────────────── */
#nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #fff;
  backdrop-filter: blur(16px);
  border-top: 2px solid #e0e0e8;
  display: flex;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 0 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: #ababba;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color 0.15s;
}
.nav-btn.active { color: #1a1aff; }
.nav-btn svg { width: 20px; height: 20px; }

/* ── Screens ────────────────────────────────────────────────────────────── */
.screen {
  display: none;
  padding-top: 56px;
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0));
  min-height: 100vh;
}
.screen.active { display: block; }

/* ── Festival picker (unified landing column) ──────────────────────────── */
#screen-pick { padding: 0; }
.pick-landing {
  max-width: 640px;
  margin: 0 auto;
  padding: 72px 20px 0;
  box-sizing: border-box;
}
.pick-section {
  margin-bottom: 28px;
}
.pick-section:last-child {
  margin-bottom: 0;
}
.pick-session-wrap {
  display: none;
  padding: 0 0 4px;
  box-sizing: border-box;
}
.pick-browse-inner {
  padding: 0;
}
.pick-browse-card #festivals-grid {
  margin-top: 4px;
  padding-bottom: 4px;
}
#pick-section-browse .api-error {
  margin: 0 0 16px;
}
.pick-landing-spacer {
  height: 80px;
}
.screen-inner-padded {
  padding: 56px 16px 80px;
}
.pick-hero { margin-bottom: 0; }
.onboarding-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 16px;
}
.onboarding-card-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.5px;
  color: var(--text);
  margin-bottom: 6px;
}
.onboarding-card-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 14px;
}
.onboarding-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: 'Barlow', sans-serif;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.onboarding-input:focus { border-color: #1a1aff; }
.pick-session-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.psb-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  color: #1a1aff;
  letter-spacing: 3px;
}
.psb-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.psb-invite {
  margin-top: 8px;
  display: inline-block;
  background: var(--surface2);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 5px 10px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.psb-invite:hover {
  border-color: #1a1aff;
  background: rgba(26, 26, 255, 0.06);
}
.psb-leave {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  color: var(--text-faint);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}
.psb-leave:hover { border-color: var(--red); color: var(--red); }
.pick-hero h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 42px;
  line-height: 0.95;
  letter-spacing: -1px;
  margin-bottom: 12px;
}
.pick-hero h1 em { color: #1a1aff; font-style: normal; }
.pick-hero-lead,
.pick-hero-sub {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
  max-width: none;
}
.pick-hero-lead { margin-bottom: 10px; }
.pick-hero-sub {
  font-size: 13px;
  color: var(--text-faint);
  margin: 0;
}

#previous-groups {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text);
}
.prev-group-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  margin-top: 4px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
}
.prev-group-code {
  font-weight: 600;
  letter-spacing: 0.03em;
}
.prev-group-meta {
  color: var(--text-dim);
  font-size: 11px;
}
.prev-group-name {
  font-weight: 700;
  color: var(--text);
}
.prev-group-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: 8px;
}
.prev-group-action-btn {
  padding: 6px 10px;
  font-size: 10px;
  letter-spacing: 0.06em;
}
.prev-group-remove-btn {
  color: var(--text-dim);
  background: var(--surface);
}
.prev-group-remove-btn:hover {
  color: var(--red);
  border-color: rgba(232, 32, 32, 0.35);
  background: var(--red-dim);
}

.search-wrap { position: relative; margin-bottom: 20px; }
.search-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  width: 16px;
  height: 16px;
  pointer-events: none;
}
#festival-search {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 12px 14px 12px 40px;
  color: var(--text);
  font-size: 15px;
  font-family: 'Barlow', sans-serif;
  outline: none;
  transition: border-color 0.15s;
}
#festival-search:focus { border-color: #1a1aff; }
#festival-search::placeholder { color: var(--text-faint); }
.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 20px;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.chip.active { background: rgba(26, 26, 255, 0.08); border-color: #1a1aff; color: #1a1aff; }
#festivals-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 0 8px;
}
.festival-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  display: flex;
  align-items: stretch;
}
.festival-card:hover { border-color: var(--border-strong); }
.festival-card:active { transform: scale(0.99); }
.festival-card.selected { border-color: #1a1aff; }

/* ── Group screen helpers ────────────────────────────────────────────────── */
.itinerary-section {
  margin-bottom: 16px;
}
#members-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 12px;
}
.section-label-tight {
  margin-bottom: 10px;
}

/* ── Export screen helpers ───────────────────────────────────────────────── */
.export-inner {
  padding: 56px 12px 80px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 56px - 64px - env(safe-area-inset-bottom, 0));
}
.export-options {
  margin-bottom: 8px;
}
#export-day-tabs {
  margin-bottom: 10px;
  border-bottom: 2px solid var(--border-strong);
}
.fc-color-bar { width: 5px; flex-shrink: 0; }
.fc-body { padding: 14px 16px; flex: 1; }
.fc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.fc-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
}
.fc-badge {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
}
.fc-badge.upcoming  { color: #0a7a3e; background: rgba(10, 122, 62, 0.08); }
.fc-badge.active-fest { color: #1a1aff; background: rgba(26, 26, 255, 0.08); }
.fc-badge.past      { color: var(--text-faint); background: var(--bg3); }
.fc-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.fc-meta-item {
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}
.fc-meta-item svg { width: 12px; height: 12px; }
.fc-stages { display: flex; gap: 6px; flex-wrap: wrap; }
.fc-stage-pill {
  font-size: 10px;
  color: var(--text-faint);
  background: var(--bg3);
  border-radius: 4px;
  padding: 2px 7px;
}
.fc-arrow { display: flex; align-items: center; padding-right: 16px; color: var(--text-faint); }
.section-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #5a5a70;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.confirm-bar {
  position: fixed;
  bottom: calc(64px + env(safe-area-inset-bottom, 0));
  left: 0;
  right: 0;
  background: #fff;
  border-top: 2px solid #e0e0e8;
  padding: 12px 16px;
  display: none;
  z-index: 90;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 -4px 24px rgba(26, 26, 255, 0.06);
}
.confirm-bar.show { display: flex; }
.confirm-festival-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 17px;
}
.confirm-meta { font-size: 11px; color: var(--text-dim); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  background: #1a1aff;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 15px 24px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  margin-bottom: 12px;
}
.btn-primary:hover   { opacity: 0.9; }
.btn-primary:active  { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-secondary {
  width: 100%;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 13px 24px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-secondary:hover { border-color: #1a1aff; color: #1a1aff; }
.btn-small {
  background: #1a1aff;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.btn-small:hover { opacity: 0.85; }

/* ── Form fields ────────────────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 15px;
  font-family: 'Barlow', sans-serif;
  outline: none;
  transition: border-color 0.15s;
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: #1a1aff; }
.field input::placeholder,
.field textarea::placeholder { color: var(--text-faint); }
.field select { appearance: none; cursor: pointer; }
.field select option { background: var(--bg2); }

/* ── Share box ──────────────────────────────────────────────────────────── */
.share-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  display: none;
}
.share-box.visible { display: block; }
.share-box h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #1a1aff;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.share-link { display: flex; gap: 8px; align-items: center; }
.share-link input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  outline: none;
}
.copy-btn {
  background: var(--surface2);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--text);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.copy-btn:hover { background: #f4f4f6; }
.copy-btn.copied { color: #1a1aff; }

/* ── Vote screen ────────────────────────────────────────────────────────── */
#screen-vote {
  background: var(--vbg);
  padding-top: 56px;
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0));
}
.vote-topbar {
  background: #fff;
  border-bottom: 2px solid var(--vborder);
  padding: 10px 16px 0;
}
.vote-topbar-row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
  min-width: 0;
}
.vote-fest-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.5px;
  color: var(--vtext);
  line-height: 1;
}
#vote-stage-tools {
  min-height: 20px;
  display: flex;
  justify-content: flex-end;
  margin: 4px 0 6px;
}
.stage-toggle-btn {
  background: transparent;
  border: 1px solid var(--vborder-strong);
  color: var(--vtext-dim);
  border-radius: 999px;
  padding: 4px 10px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  cursor: pointer;
}
.stage-toggle-btn:hover {
  border-color: var(--vaccent);
  color: var(--vaccent);
}
.vote-meta-row { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.vote-meta-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.vote-randomize-btn {
  background: var(--surface2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: border-color 0.15s, color 0.15s, opacity 0.15s;
}
.vote-randomize-btn:hover { border-color: var(--accent); color: var(--accent); }
.vote-randomize-btn:active { transform: scale(0.98); }
.vote-randomize-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.vote-count-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--vaccent);
  padding: 3px 10px;
  border-radius: 5px;
}
.vote-hint { font-size: 11px; color: var(--vtext-dim); }

/* Day tabs */
.day-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -16px;
  padding: 0 16px;
}
.day-tabs::-webkit-scrollbar { display: none; }

/* Keep Setlists (export) day tabs centered */
#export-day-tabs.day-tabs {
  justify-content: center;
  margin: 0;
  padding: 0;
}
#export-day-tabs .day-tab {
  text-align: center;
}
.day-tab {
  flex-shrink: 0;
  padding: 8px 16px 0;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: border-color 0.15s, color 0.15s;
  position: relative;
}
.day-tab-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--vtext-dim);
  margin-bottom: 3px;
}
.day-tab-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--vtext-faint);
  margin-bottom: 6px;
}
.day-tab.active .day-tab-label { color: var(--vaccent); }
.day-tab.active { border-bottom-color: var(--vaccent); }
.day-tab-dot {
  display: none;
  width: 6px;
  height: 6px;
  background: var(--vaccent);
  border-radius: 50%;
  position: absolute;
  top: 10px;
  right: 10px;
}
.day-tab.has-votes .day-tab-dot { display: block; }

/* Grid */
.grid-scroll-outer {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--vbg);
  position: relative;
}
.vote-click-fx {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 999px;
  pointer-events: none;
  background: radial-gradient(circle, rgba(26,26,255,0.55) 0%, rgba(26,26,255,0.1) 60%, rgba(26,26,255,0) 75%);
  box-shadow:
    0 0 0 1px rgba(205,255,60,0.4),
    0 0 16px rgba(26,26,255,0.55),
    0 0 32px rgba(255,71,212,0.3);
  transform: scale(0.5);
  animation: voteStrobe 240ms ease-out forwards;
}
@keyframes voteStrobe {
  0%   { opacity: 0.95; transform: scale(0.45); }
  60%  { opacity: 0.65; transform: scale(1.6); }
  100% { opacity: 0; transform: scale(2.1); }
}
.v-grid-header {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  border-bottom: 2px solid var(--vborder);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.v-grid-header-time {
  width: var(--time-col);
  min-width: var(--time-col);
  flex-shrink: 0;
  background: #fff;
  border-right: 1.5px solid var(--vborder);
}
.v-grid-header-stage {
  min-width: var(--stage-width);
  flex: 1;
  padding: 10px 12px;
  border-right: 1.5px solid var(--vborder);
}
.v-grid-header-stage:last-child { border-right: none; }
.v-stage-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--vtext);
}
.v-stage-count {
  font-size: 10px;
  color: var(--vtext-dim);
  margin-top: 2px;
  font-family: 'JetBrains Mono', monospace;
}
.v-grid-body { display: flex; position: relative; }
.v-time-axis {
  width: var(--time-col);
  min-width: var(--time-col);
  flex-shrink: 0;
  position: sticky;
  left: 0;
  z-index: 5;
  background: #fff;
  border-right: 1.5px solid var(--vborder);
}
.v-time-label {
  height: var(--hour-height);
  display: flex;
  align-items: flex-start;
  padding-top: 7px;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  color: var(--vtext-faint);
  border-bottom: 1px solid var(--vgrid);
}
.v-stage-col {
  min-width: var(--stage-width);
  flex: 1;
  border-right: 1.5px solid var(--vborder);
  position: relative;
  background: var(--vbg2);
}
.v-stage-col:last-child { border-right: none; }
.v-hour-line { height: var(--hour-height); border-bottom: 1px solid var(--vgrid); }
.v-half-line { height: calc(var(--hour-height) / 2); border-bottom: 1px dashed rgba(0, 0, 0, 0.06); }

/* Set cards */
.set-card {
  position: absolute;
  left: 4px;
  right: 4px;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  border: 2px solid #e0e0e8;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s, transform 0.08s;
  overflow: hidden;
  user-select: none;
}
.set-card:active { transform: scale(0.97); }
.set-card.default { background: #fff; border-color: #e0e0e8; }
.set-card.default:hover { border-color: #bbbbc8; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }
.set-card.selected {
  background: var(--vaccent);
  border-color: var(--vaccent);
  box-shadow: 0 2px 10px rgba(26, 26, 255, 0.25);
}
.set-card.selected .set-artist   { color: #fff; }
.set-card.selected .set-time     { color: rgba(255, 255, 255, 0.7); }
.set-card.selected .set-stage-label { color: rgba(255, 255, 255, 0.6); }
.set-card.conflicted { border-color: var(--vred); background: #fff5f5; }
.set-card.conflicted .set-artist { color: var(--vred); }
.set-card.conflicted .conflict-flag { display: block; }
.set-card.selected.conflicted { background: #ffe0e0; border-color: var(--vred); }
.set-card.selected.conflicted .set-artist { color: var(--vred); }
.set-artist {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.15;
  color: var(--vtext);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.set-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--vtext-dim);
  margin-top: 3px;
  white-space: nowrap;
}
.set-stage-label {
  font-size: 9px;
  color: var(--vtext-faint);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.conflict-flag {
  font-size: 9px;
  color: var(--vred);
  font-weight: 700;
  margin-top: 3px;
  display: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.vote-check {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
}
.set-card.selected .vote-check { display: flex; }
.vote-check svg { width: 10px; height: 10px; color: var(--vaccent); }
.vote-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(26, 26, 255, 0.2);
  border-radius: 0 0 8px 0;
  transition: width 0.3s;
}
.set-card.selected .vote-bar { background: rgba(255, 255, 255, 0.3); }

/* Artist info “i” — desktop / fine pointer only (hover-capable devices) */
.set-info-btn {
  position: absolute;
  bottom: 7px;
  right: 8px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: none;
  background: rgba(11, 11, 15, 0.07);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 800;
  font-style: italic;
  line-height: 1;
  color: var(--vtext-dim);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 6;
  transition: background 0.12s, color 0.12s, transform 0.1s;
  pointer-events: auto;
}
@media (hover: hover) and (pointer: fine) {
  .set-card:hover .set-info-btn { display: flex; }
}
@media (hover: none), (pointer: coarse) {
  .set-info-btn { display: none !important; }
}
.set-info-btn:hover {
  background: var(--vaccent);
  color: #fff;
}
.set-card.selected .set-info-btn {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.set-card.selected .set-info-btn:hover {
  background: rgba(255, 255, 255, 0.42);
  color: #fff;
}
.set-card.conflicted .set-info-btn {
  background: rgba(232, 32, 32, 0.1);
  color: var(--vred);
}
.set-card.conflicted .set-info-btn:hover {
  background: var(--vred);
  color: #fff;
}
.set-card.selected.conflicted .set-info-btn {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Artist info pop-out */
.artist-popover {
  position: fixed;
  z-index: 12000;
  width: min(280px, calc(100vw - 24px));
  background: #fff;
  border: 1.5px solid var(--vborder);
  border-radius: 12px;
  padding: 14px 16px 16px;
  box-shadow: 0 10px 36px rgba(11, 11, 15, 0.14), 0 2px 10px rgba(11, 11, 15, 0.08);
  pointer-events: auto;
  opacity: 0;
  transform: scale(0.96) translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  display: none;
}
.artist-popover.show {
  display: block;
  opacity: 1;
  transform: scale(1) translateY(0);
}
.ap-pop-artist {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 17px;
  letter-spacing: -0.3px;
  color: var(--vtext);
  margin: 0 28px 10px 0;
  line-height: 1.1;
}
.ap-pop-line {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--vtext-dim);
}
.ap-pop-genre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--vaccent);
}
.ap-pop-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--vaccent);
  text-decoration: none;
  border: 1px solid var(--vaccent);
  border-radius: 6px;
  padding: 6px 11px;
  transition: background 0.12s, color 0.12s;
}
.ap-pop-link:hover {
  background: var(--vaccent);
  color: #fff;
}
.ap-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--vtext-faint);
  padding: 4px 6px;
}
.ap-close:hover { color: var(--vtext); }

.now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--vred);
  z-index: 4;
  pointer-events: none;
}
.now-dot {
  position: absolute;
  left: -5px;
  top: -4px;
  width: 10px;
  height: 10px;
  background: var(--vred);
  border-radius: 50%;
}

/* Vote action bar */
.vote-action-bar {
  background: #fff;
  border-top: 2px solid var(--vborder);
  padding: 12px 16px;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
}
.vote-submit-btn {
  width: 100%;
  background: var(--vaccent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 15px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.vote-submit-btn:hover   { opacity: 0.9; }
.vote-submit-btn:active  { transform: scale(0.98); }
.vote-submit-btn:disabled { background: #bbbbc8; cursor: not-allowed; opacity: 1; }

/* ── Group screen ───────────────────────────────────────────────────────── */
#screen-group { padding: 72px 16px 80px; }
.ranking-header { margin-bottom: 10px; }
.ranking-header h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 22px;
  line-height: 0.95;
  margin-bottom: 2px;
}
.member-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text-dim);
}
.member-dot { width: 6px; height: 6px; background: var(--green); border-radius: 50%; }
.itinerary-section { margin-bottom: 24px; }
.itinerary-section .section-label { margin-bottom: 12px; }
.itinerary-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  overflow: hidden;
}
.itinerary-item.winner { border-color: var(--accent); background: var(--accent-dim); }
.itinerary-rank {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: var(--text-faint);
  min-width: 32px;
  line-height: 1;
  margin-top: 2px;
}
.itinerary-item.winner .itinerary-rank { color: var(--accent); }
.itinerary-info { flex: 1; min-width: 0; }
.itinerary-artist {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  line-height: 1.2;
}
.itinerary-item.winner .itinerary-artist { color: #1a1aff; }
.itinerary-meta { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.itinerary-voters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  align-items: center;
}
.itinerary-voters--dots {
  gap: 6px;
}
.itinerary-voter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 7px 14px;
  min-height: 28px;
  box-sizing: border-box;
  border-radius: 999px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #ffffff;
  border: 2px solid var(--pill-ring, #1a1aff);
  box-shadow:
    0 1px 2px rgba(11, 11, 15, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
.itinerary-item.winner .itinerary-voter-pill {
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 1px 3px rgba(26, 26, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.98);
}
.itinerary-voter-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--dot-fill, #1a1aff);
  box-shadow:
    0 0 0 2px #ffffff,
    0 0 0 3px var(--dot-fill, #1a1aff),
    0 1px 2px rgba(11, 11, 15, 0.12);
}
.vote-count-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--text);
  white-space: nowrap;
  margin-top: 2px;
  flex-shrink: 0;
}
.itinerary-item.winner .vote-count-tag {
  background: #1a1aff;
  color: #fff;
  border-color: #1a1aff;
  font-weight: 700;
}
.winner-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #1a1aff;
  border-radius: 10px 0 0 10px;
}
.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.member-color-swatch {
  width: 5px;
  height: 32px;
  border-radius: 3px;
  flex-shrink: 0;
}
.member-row:last-child { border-bottom: none; }
.member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.member-name { font-size: 14px; color: var(--text); flex: 1; }
.member-votes { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-dim); }
.member-status {
  font-size: 10px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}
.member-status.voted   { color: #1a1aff; background: rgba(26, 26, 255, 0.08); }
.member-status.pending { color: var(--text-faint); background: var(--bg3); }

/* ── Export screen ──────────────────────────────────────────────────────── */
#screen-export { padding: 0 0 80px; }
.export-header {
  margin-bottom: 10px;
  flex-shrink: 0;
}
.export-header h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 22px;
  line-height: 0.95;
  margin-bottom: 2px;
  color: #0b0b0f;
}
.export-header p { font-size: 11px; color: var(--text-dim); }
.wallpaper-preview-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex: 1;
  min-height: 0;
  margin: 0 0 16px;
  padding: 0 4px;
}
.wallpaper-frame {
  width: min(calc(100vw - 16px), 360px);
  max-width: 100%;
  aspect-ratio: 9 / 16;
  background: #f4f4f6;
  border-radius: 12px;
  border: 6px solid #bbbbc8;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(26, 26, 255, 0.12);
  flex-shrink: 0;
}
#wallpaper-canvas { width: 100%; height: 100%; display: block; object-fit: contain; }
.export-options { display: flex; gap: 8px; margin-bottom: 8px; flex-shrink: 0; }
#export-day-tabs { flex-shrink: 0; }
.opt-btn {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 6px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}
.opt-btn.active { border-color: #1a1aff; color: #1a1aff; background: rgba(26, 26, 255, 0.08); }
.empty-state { text-align: center; padding: 60px 24px; }
.empty-state h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.empty-state p { font-size: 13px; color: var(--text-faint); }

/* ── Admin panel ────────────────────────────────────────────────────────── */
#app-admin { min-height: 100vh; background: var(--adm-bg); font-family: 'Barlow', sans-serif; }
.admin-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: rgba(13, 10, 26, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--adm-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 56px;
}
.admin-logo {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.5px;
  color: var(--text);
}
.admin-logo span { color: var(--adm-acc); }
.admin-badge {
  background: var(--adm-acc-dim);
  border: 1px solid var(--adm-border);
  color: var(--adm-acc);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 4px;
}
.admin-exit-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 12px;
  color: var(--text-dim);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
}
.admin-exit-btn:hover { border-color: var(--accent); color: var(--accent); }
.admin-body { padding: 72px 20px 40px; max-width: 900px; margin: 0 auto; }
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.stat-card {
  background: rgba(155, 92, 255, 0.06);
  border: 1px solid var(--adm-border);
  border-radius: 12px;
  padding: 16px;
}
.stat-val {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 36px;
  color: var(--adm-acc);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 11px;
  color: var(--text-dim);
  font-family: 'Barlow Condensed', sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.admin-tabs { display: flex; border-bottom: 1px solid var(--adm-border); margin-bottom: 28px; }
.admin-tab {
  padding: 12px 20px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.admin-tab.active { color: var(--adm-acc); border-bottom-color: var(--adm-acc); }
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.admin-festival-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.afc-color { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.afc-info { flex: 1; min-width: 0; }
.afc-name { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 17px; }
.afc-meta { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.afc-actions { display: flex; gap: 8px; }
.icon-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 12px;
  transition: all 0.15s;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.icon-btn:hover { border-color: var(--adm-acc); color: var(--adm-acc); }
.icon-btn.danger:hover { border-color: var(--red); color: var(--red); }
.admin-card {
  background: rgba(155, 92, 255, 0.04);
  border: 1px solid var(--adm-border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 24px;
}
.admin-card h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  color: var(--adm-acc);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.csv-editor {
  width: 100%;
  min-height: 220px;
  background: #0a0814;
  border: 1px solid var(--adm-border);
  border-radius: 8px;
  padding: 14px;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.7;
  outline: none;
  resize: vertical;
  transition: border-color 0.15s;
}
.csv-editor:focus { border-color: var(--adm-acc); }
.csv-line-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 6px;
}
.admin-table-wrap {
  border: 1px solid var(--adm-border);
  border-radius: 10px;
  overflow: hidden;
  overflow-x: auto;
  margin-bottom: 16px;
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.admin-table th {
  background: rgba(155, 92, 255, 0.08);
  padding: 10px 14px;
  text-align: left;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--adm-acc);
  text-transform: uppercase;
  border-bottom: 1px solid var(--adm-border);
  white-space: nowrap;
}
.admin-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(155, 92, 255, 0.04); }
.btn-admin {
  background: var(--adm-acc);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.btn-admin:hover { opacity: 0.85; }
.btn-admin-outline {
  background: transparent;
  color: var(--adm-acc);
  border: 1px solid var(--adm-border);
  border-radius: 8px;
  padding: 11px 18px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-admin-outline:hover { background: var(--adm-acc-dim); }
.admin-btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.status-chip {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 4px;
  flex-shrink: 0;
}
.status-chip.published { color: var(--green); background: var(--green-dim); }

/* Admin login modal */
#admin-login-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: var(--adm-bg);
  border: 1px solid var(--adm-border);
  border-radius: 16px;
  padding: 28px 24px;
  width: 100%;
  max-width: 340px;
}
.login-card h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 26px;
  margin-bottom: 6px;
}
.login-card h2 span { color: var(--adm-acc); }
.login-card p { font-size: 13px; color: var(--text-dim); margin-bottom: 20px; }
.login-error {
  background: var(--red-dim);
  border: 1px solid rgba(255, 63, 63, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--red);
  margin-bottom: 14px;
  display: none;
}
.login-hint { font-size: 11px; color: var(--text-faint); text-align: center; margin-top: 10px; }

/* ── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 2px; }

/* ── Animations ─────────────────────────────────────────────────────────── */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.live-dot { animation: pulse 2s infinite; background: #1a1aff; }

/* ── Utility ────────────────────────────────────────────────────────────── */
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }

/* ── Responsive — very small phones (≤360px) ───────────────────────────── */
@media (max-width: 360px) {
  #screen-pick { padding-left: 12px; padding-right: 12px; }
  .pick-hero h1 { font-size: 34px; }
  .onboarding-card { padding: 14px 12px; }
  .psb-code { font-size: 18px; letter-spacing: 2px; }
  .header-meta { display: none; }
  .nav-btn { font-size: 9px; }
  .vote-fest-name { font-size: 17px; }
  .itinerary-artist { font-size: 15px; }
  .ranking-header h2 { font-size: 17px; }
  .export-header h2 { font-size: 17px; }
  :root { --stage-width: 120px; --time-col: 44px; --hour-height: 60px; }
}

/* ── Responsive — small phones (≤480px) ────────────────────────────────── */
@media (max-width: 480px) {
  .pick-landing { padding: 68px 16px 0; }
  .pick-section { margin-bottom: 22px; }
  .pick-hero h1 { font-size: 38px; line-height: 0.92; }
  .pick-hero p { font-size: 13px; }
  .fc-name { font-size: 17px; }
  .fc-meta-item { font-size: 11px; }
  .fc-stages { display: none; }
  .fc-body { padding: 12px 14px; }
  .confirm-festival-name { font-size: 15px; }
  .confirm-meta { font-size: 10px; }
  .vote-fest-name { font-size: 18px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .vote-hint { display: none; }
  .day-tab { padding: 6px 12px 0; }
  .day-tab-label { font-size: 10px; letter-spacing: 1px; }
  .day-tab-date { font-size: 9px; }
  :root { --stage-width: 130px; --time-col: 46px; --hour-height: 62px; }
  .set-artist { font-size: 12px; }
  .set-time { font-size: 8px; }
  .set-card { padding: 6px 8px; }
  #screen-group { padding-left: 12px; padding-right: 12px; }
  .ranking-header h2 { font-size: 18px; }
  .itinerary-artist { font-size: 16px; }
  .itinerary-rank { font-size: 22px; min-width: 26px; }
  .itinerary-item { padding: 11px 12px; gap: 8px; }
  .vote-count-tag { font-size: 10px; padding: 3px 6px; }
  .member-name { font-size: 13px; }
  .share-box { padding: 12px; }
  #screen-export { padding-left: 4px; padding-right: 4px; }
  .export-header h2 { font-size: 18px; }
  .wallpaper-frame { width: min(calc(100vw - 8px), 420px); border-width: 6px; }
  .opt-btn { font-size: 10px; padding: 6px 4px; }
  .export-options { gap: 6px; }
  .form-row { grid-template-columns: 1fr; }
}

/* ── Responsive — medium phones (481px–640px) ──────────────────────────── */
@media (min-width: 481px) and (max-width: 640px) {
  .pick-hero h1 { font-size: 48px; }
  :root { --stage-width: 145px; }
  .wallpaper-frame { width: min(calc(100vw - 16px), 500px); border-width: 7px; }
  .fc-stages { display: none; }
}

/* ── Responsive — tablets and up (≥641px) ──────────────────────────────── */
@media (min-width: 641px) {
  #screen-pick { padding-left: 24px; padding-right: 24px; }
  .pick-landing {
    max-width: 680px;
    padding-left: 24px;
    padding-right: 24px;
  }
  .pick-hero h1 { font-size: 56px; }
  #festivals-grid { gap: 14px; }
  .festival-card { border-radius: 16px; }
  #screen-group { padding-left: 24px; padding-right: 24px; max-width: 680px; margin-left: auto; margin-right: auto; }
  #screen-export { padding-left: 16px; padding-right: 16px; max-width: none; }
  .wallpaper-frame { width: min(calc(100vw - 24px), 640px); border-width: 8px; }
  :root { --stage-width: 170px; --hour-height: 72px; }
  .itinerary-artist { font-size: 19px; }
  .export-header h2 { font-size: 22px; }
}

/* ── Responsive — large tablets / desktop (≥900px) ─────────────────────── */
@media (min-width: 900px) {
  #screen-pick { padding-left: 40px; padding-right: 40px; }
  .pick-landing { max-width: 720px; }
  #festivals-grid { display: flex; flex-direction: column; gap: 16px; }
  #screen-group { max-width: 720px; }
  .ranking-header h2 { font-size: 22px; }
  #screen-export { max-width: none; padding-left: 24px; padding-right: 24px; }
  .wallpaper-frame { width: min(calc(100vw - 32px), 760px); border-width: 10px; }
  :root { --stage-width: 185px; --hour-height: 76px; }
}

/* ── Touch / no-hover devices ───────────────────────────────────────────── */
@media (hover: none) {
  .festival-card:hover { border-color: var(--border); }
  .festival-card.selected:hover { border-color: #1a1aff; }
  .btn-primary:hover { opacity: 1; }
  .btn-small:hover { opacity: 1; }
  .chip:hover { background: var(--surface); border-color: var(--border); color: var(--text-dim); }
  .chip.active:hover { background: rgba(26, 26, 255, 0.08); border-color: #1a1aff; color: #1a1aff; }
}

/* ── Safe area / notch support ──────────────────────────────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #nav { padding-bottom: env(safe-area-inset-bottom); }
  .confirm-bar { bottom: calc(64px + env(safe-area-inset-bottom)); }
  .vote-action-bar { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}
