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

/* ── Design tokens ─────────────────────────────────────────────────────────── */
/* ── Palette from MusWM rootColors.css ───────────────────────────────────── */
:root {
  /* Source palette */
  --clr-ink:         #111111;
  --clr-bg:          #ffffff;
  --clr-border:      #d1d5db;
  --clr-lilac-50:    #f5f3ff;
  --clr-lilac-100:   #ede9fe;
  --clr-lilac-200:   #ddd6fe;
  --clr-lilac-400:   #a78bfa;
  --clr-soft-pink:   #fbcfe8;
  --clr-sky:         #bfdbfe;
  --clr-red:         #ef4444;
  --clr-green:       #22c55e;
  --clr-blue:        #2563eb;
  --clr-neon-pink:   #ff00cc;
  --clr-neon-green:  #39ff14;
  --card-badge-bg:   #f9fafb;
  --card-badge-border:#e5e7eb;
  --card-info-bg:    #ffffff;
  --card-info-border:#d1d5db;
  --radius-card:     .75rem;
  --shadow-soft:     0 1px 4px rgba(0,0,0,.08);
  --transition-fast: 0.2s ease-in-out;

  /* App tokens mapped from palette */
  --bg:          var(--clr-lilac-50);
  --bg2:         #ffffff;
  --surface:     var(--clr-lilac-100);
  --surface2:    var(--clr-lilac-200);
  --surface3:    var(--clr-lilac-400);
  --border:      rgba(167,139,250,0.18);
  --border2:     rgba(167,139,250,0.32);
  --border3:     rgba(167,139,250,0.55);
  --text:        var(--clr-ink);
  --text-soft:   rgba(17,17,17,0.62);
  --text-faint:  rgba(17,17,17,0.38);

  /* Category accent palette — drawn from source palette */
  --warning:     #f59e0b;
  --caution:     #fb923c;
  --notif:       var(--clr-blue);
  --feedback:    var(--clr-green);
  --achievement: #fbbf24;
  --error:       var(--clr-red);
  --ambient:     var(--clr-lilac-400);
  --transition:  var(--clr-sky);
  --brand:       var(--clr-soft-pink);
  --haptic:      var(--clr-neon-green);

  --radius:    var(--radius-card);
  --radius-sm: 9px;
  --radius-xs: 6px;
  --shadow:    var(--shadow-soft);
  --shadow-sm: 0 4px 16px rgba(0,0,0,0.08);
}

html { scroll-behavior: smooth; }

body {
  background: linear-gradient(135deg, var(--clr-soft-pink) 0%, var(--clr-sky) 100%) !important;
  color: var(--clr-ink);
  font-family: 'Instrument Sans', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Ambient background ────────────────────────────────────────────────────── */
.ambient-bg {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
}
.orb-1 { width: 600px; height: 600px; background: var(--clr-soft-pink); top: -200px; left: -100px; }
.orb-2 { width: 500px; height: 500px; background: var(--clr-lilac-200); bottom: -150px; right: -100px; }
.orb-3 { width: 400px; height: 400px; background: var(--clr-sky); top: 40%; left: 40%; }
#waveCanvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0.06;
}

/* ── App shell ─────────────────────────────────────────────────────────────── */
.app {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  min-height: 100vh;
}

/* ── Header ────────────────────────────────────────────────────────────────── */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid rgba(167,139,250,0.2);
  background: linear-gradient(90deg, var(--clr-lilac-200), var(--clr-soft-pink));
  backdrop-filter: blur(16px);
  position: sticky; top: 0; z-index: 50;
  gap: 20px;
}
.header-brand { display: flex; align-items: center; gap: 12px; }
.brand-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--clr-lilac-200), var(--clr-sky));
  border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  color: var(--clr-blue);
}
.brand-name {
  font-weight: 700; font-size: 15px; letter-spacing: -0.01em;
  color: var(--clr-blue);
}
.brand-sub {
  font-size: 11px; color: var(--text-faint);
  letter-spacing: 0.03em;
}
.header-session {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-soft);
  font-family: 'DM Mono', monospace;
}
.session-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-faint);
  transition: background 0.3s;
}
.session-dot.active { background: var(--clr-green); box-shadow: 0 0 8px rgba(34,197,94,0.5); animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:0.5} }

.header-actions { display: flex; gap: 8px; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.btn-ghost:hover { border-color: var(--border3); color: var(--text); background: rgba(255,255,255,0.04); }
.btn-ghost:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ── Main / Views ──────────────────────────────────────────────────────────── */
.app-main { flex: 1; }
.view { display: none; }
.view.active { display: block; }

/* ── VIEW A — Setup ────────────────────────────────────────────────────────── */
.setup-layout {
  display: grid;
  grid-template-columns: 1fr minmax(0, 420px);
  grid-template-rows: auto;
  gap: 24px 40px;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 28px 40px;
}
.setup-category-bar {
  grid-column: 1 / -1;
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(167,139,250,0.2);
  border-radius: var(--radius);
  padding: 20px 24px;
  backdrop-filter: blur(10px);
}

.setup-eyebrow {
  display: inline-block;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--notif);
  margin-bottom: 20px;
  padding: 4px 12px;
  border: 1px solid rgba(96,165,250,0.2);
  border-radius: 999px;
  background: rgba(96,165,250,0.06);
}
.setup-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(40px, 5vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}
.setup-title em { font-style: italic; color: var(--notif); }
.setup-desc {
  font-size: 17px;
  color: var(--text-soft);
  max-width: 480px;
  line-height: 1.75;
  margin-bottom: 36px;
}
.setup-roles {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.role-chip {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border2);
  background: var(--surface);
}
.role-sd    { border-color: rgba(96,165,250,0.35); color: var(--notif); background: rgba(96,165,250,0.06); }
.role-pm    { border-color: rgba(167,139,250,0.35); color: var(--ambient); background: rgba(167,139,250,0.06); }
.role-brand { border-color: rgba(244,114,182,0.35); color: var(--brand); background: rgba(244,114,182,0.06); }
.role-eng   { border-color: rgba(52,211,153,0.35); color: var(--feedback); background: rgba(52,211,153,0.06); }
.role-arrow { color: var(--text-faint); font-size: 14px; }

/* Setup form card */
.setup-form-card {
  background: rgba(255,255,255,0.88);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 4px 24px rgba(167,139,250,0.15);
  backdrop-filter: blur(10px);
  min-width: 0;
  overflow: visible;
  width: 100%;
}
.sfc-title {
  font-weight: 700; font-size: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(167,139,250,0.2);
}
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.form-field {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  background: rgba(255,255,255,0.95);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-field:focus {
  border-color: rgba(96,165,250,0.5);
  box-shadow: 0 0 0 3px rgba(96,165,250,0.1);
}
.form-field::placeholder { color: var(--text-faint); }

/* Category grid */
.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cat-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: rgba(255,255,255,0.95);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
  user-select: none;
  text-align: center;
  min-width: 0;
}
.cat-option span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.cat-option:hover { border-color: var(--border2); color: var(--text); background: var(--surface2); }
.cat-option.selected { border-color: currentColor; background: rgba(255,255,255,0.04); }
.cat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Participants */
.participants-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.participant-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.participant-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  font-size: 12px;
  color: var(--text-soft);
}
.chip-remove {
  cursor: pointer; color: var(--text-faint);
  background: none; border: none; font-size: 14px; line-height: 1;
  padding: 0; transition: color 0.15s;
}
.chip-remove:hover { color: var(--error); }
.add-participant-btn {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px dashed var(--border2);
  background: none;
  color: var(--text-faint);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.add-participant-btn:hover { border-color: var(--border3); color: var(--text-soft); }

.btn-start {
  width: 100%;
  padding: 13px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, var(--clr-sky) 0%, var(--clr-soft-pink) 100%);
  color: var(--clr-ink);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity 0.2s, transform 0.2s;
  font-family: inherit;
  box-shadow: 0 4px 24px rgba(167,139,250,0.35);
}
.btn-start:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-start:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Categories legend */
.categories-legend {
  max-width: 1200px; margin: 0 auto;
  padding: 0 32px 64px;
}
.legend-title {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 16px;
  font-family: 'DM Mono', monospace;
}
.legend-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.legend-card {
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s;
}
.legend-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.legend-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.legend-icon { font-size: 16px; }
.legend-name { font-size: 13px; font-weight: 600; }
.legend-desc { font-size: 11px; color: var(--text-faint); line-height: 1.5; }

/* ── VIEW B — Session ──────────────────────────────────────────────────────── */
.session-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  height: calc(100vh - 65px);
  overflow: hidden;
}
.session-left {
  display: flex; flex-direction: column;
  border-right: 1px solid rgba(167,139,250,0.25);
  overflow: hidden;
}
.session-topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid rgba(167,139,250,0.2);
  background: linear-gradient(90deg, var(--clr-lilac-100), rgba(255,255,255,0.7));
  flex-shrink: 0;
  flex-wrap: wrap;
}
.session-meta { display: flex; align-items: center; gap: 10px; flex: 1; }
.session-category-badge {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}
.session-product-name { font-size: 13px; color: var(--text-soft); font-style: italic; }
.session-progress { display: flex; flex-direction: column; gap: 4px; min-width: 160px; }
.progress-label { font-size: 11px; color: var(--text-faint); font-family: 'DM Mono', monospace; }
.progress-bar {
  height: 3px; border-radius: 999px;
  background: var(--surface3);
  overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--clr-sky), var(--clr-lilac-400));
  transition: width 0.4s ease;
}

/* Question area */
.question-area {
  flex: 1;
  overflow-y: auto;
  padding: 40px 48px;
  scroll-behavior: smooth;
}
.question-area::-webkit-scrollbar { width: 6px; }
.question-area::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 999px; }

/* Individual question blocks */
.q-block {
  margin-bottom: 40px;
  animation: fadeSlideIn 0.3s ease;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.q-meta {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.q-number {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.1em;
}
.q-participant {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--text-soft);
  border: 1px solid var(--border);
}
.q-text {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(20px, 2.5vw, 28px);
  line-height: 1.3;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.q-subtext {
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 20px;
  line-height: 1.6;
}

/* Answer types */
.answer-choices {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.choice-btn {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border2);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  display: flex; align-items: center; gap: 8px;
}
.choice-btn:hover { border-color: var(--border3); background: var(--surface2); transform: translateY(-1px); }
.choice-btn.selected { border-color: currentColor; background: rgba(255,255,255,0.06); }
.choice-emoji { font-size: 18px; }

.answer-slider-wrap { display: flex; flex-direction: column; gap: 10px; }
.answer-slider {
  -webkit-appearance: none;
  width: 100%; height: 6px;
  border-radius: 999px;
  background: var(--surface3);
  outline: none;
}
.answer-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--notif);
  cursor: pointer;
  box-shadow: 0 0 12px rgba(96,165,250,0.5);
}
.slider-labels {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-faint);
  font-family: 'DM Mono', monospace;
}
.slider-value {
  text-align: center;
  font-family: 'DM Serif Display', serif;
  font-size: 28px;
  color: var(--notif);
}

.answer-text-wrap { display: flex; gap: 8px; }
.answer-textarea {
  width: 100%;
  min-height: 90px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border2);
  background: rgba(255,255,255,0.95);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.answer-textarea:focus { border-color: rgba(96,165,250,0.4); }
.answer-textarea::placeholder { color: var(--text-faint); }

.multi-choice { display: flex; flex-wrap: wrap; gap: 8px; }
.multi-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  user-select: none;
}
.multi-chip:hover { border-color: var(--border2); color: var(--text); }
.multi-chip.selected { border-color: currentColor; color: var(--text); background: rgba(255,255,255,0.05); }

/* Question nav */
.question-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 48px;
  border-top: 1px solid var(--border);
  background: linear-gradient(90deg, var(--clr-lilac-100), rgba(255,255,255,0.7));
  flex-shrink: 0;
}
.btn-next {
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, var(--clr-sky) 0%, var(--clr-soft-pink) 100%);
  color: var(--clr-ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s, transform 0.2s;
}
.btn-next:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-next:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

/* ── Right panel: Brief ────────────────────────────────────────────────────── */
.session-right {
  background: rgba(255,255,255,0.95);
  overflow-y: auto;
}
.session-right::-webkit-scrollbar { width: 6px; }
.session-right::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 999px; }

.brief-panel { padding: 24px; display: flex; flex-direction: column; gap: 16px; min-height: 100%; }

.brief-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(167,139,250,0.2);
}
.brief-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-soft);
}
.brief-status {
  font-family: 'DM Mono', monospace;
  font-size: 10px; color: var(--text-faint);
}

.brief-empty {
  font-size: 13px; color: var(--text-faint);
  font-style: italic; text-align: center;
  padding: 32px 16px;
  border: 1px dashed var(--clr-lilac-200);
  border-radius: var(--radius-sm);
}

.brief-answer-item {
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  animation: fadeSlideIn 0.25s ease;
}
.bai-label {
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 4px;
  font-family: 'DM Mono', monospace;
}
.bai-value { font-size: 13px; color: var(--text); line-height: 1.5; }
.bai-value.technical {
  font-family: 'DM Mono', monospace; font-size: 12px;
  color: var(--notif);
}

.brief-actions { padding-top: 8px; }
.btn-generate {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, var(--clr-green) 0%, var(--clr-sky) 100%);
  color: var(--clr-ink);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 4px 20px rgba(34,197,94,0.25);
}
.btn-generate:hover { opacity: 0.9; transform: translateY(-1px); }

/* Generated brief */
.generated-brief { display: flex; flex-direction: column; gap: 14px; }
.gb-section {
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.gb-label {
  padding: 8px 14px;
  background: var(--clr-lilac-100);
  border-bottom: 1px solid rgba(167,139,250,0.2);
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-faint); font-family: 'DM Mono', monospace;
}
.gb-content {
  padding: 16px 14px;
  font-size: 13px; line-height: 1.75; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
  max-height: 200px; overflow-y: auto;
}
.gb-content::-webkit-scrollbar { width: 4px; }
.gb-content::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 999px; }
.gb-mono {
  font-family: 'DM Mono', monospace; font-size: 12px;
  color: var(--feedback);
}
.gb-copy-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.btn-copy-brief, .btn-copy-suno {
  padding: 9px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border2);
  background: rgba(255,255,255,0.8);
  color: var(--text-soft);
  font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: all 0.15s;
}
.btn-copy-brief:hover { border-color: var(--notif); color: var(--notif); background: rgba(96,165,250,0.06); }
.btn-copy-suno:hover { border-color: var(--feedback); color: var(--feedback); background: rgba(52,211,153,0.06); }

/* Generating spinner */
.brief-generating {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 32px;
}
.gen-spinner {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 3px solid var(--surface3);
  border-top-color: var(--clr-blue);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gen-label {
  font-size: 13px; color: var(--text-faint);
  font-style: italic; text-align: center;
}

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(167,139,250,0.25);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: rgba(255,255,255,0.96);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 32px;
  width: min(440px, 92vw);
  box-shadow: 0 24px 64px rgba(167,139,250,0.25);
  animation: modalIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes modalIn { from { opacity:0; transform: scale(0.92); } to { opacity:1; transform: scale(1); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.modal-title { font-weight: 700; font-size: 16px; }
.modal-close {
  background: none; border: none; color: var(--text-faint);
  font-size: 22px; cursor: pointer; line-height: 1;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--text); }
.modal-desc { font-size: 13px; color: var(--text-soft); margin-bottom: 16px; line-height: 1.6; }
.modal-field-row { display: flex; gap: 8px; margin-bottom: 16px; }
.btn-icon {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  background: rgba(255,255,255,0.95);
  color: var(--text-soft);
  cursor: pointer;
  display: flex; align-items: center;
  transition: all 0.15s;
}
.btn-icon:hover { border-color: var(--border3); color: var(--text); }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .setup-layout { grid-template-columns: 1fr; padding: 32px 20px; }
  .setup-form-card { position: static; }
  .session-layout { grid-template-columns: 1fr; height: auto; }
  .session-right { border-top: 1px solid var(--border); max-height: 50vh; }
  .legend-grid { grid-template-columns: repeat(2, 1fr); }
  .category-grid { grid-template-columns: 1fr; }
}

/* ── Per-participant tabs ─────────────────────────────────────────────────── */
.gb-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.gb-tab {
  padding: 5px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border2);
  background: rgba(255,255,255,0.7);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-soft);
  transition: all 0.15s;
  font-family: inherit;
}
.gb-tab:hover { border-color: var(--border3); color: var(--text); }
.gb-tab.active {
  background: var(--clr-lilac-100);
  border-color: var(--clr-lilac-400);
  color: var(--clr-ink);
}

/* Participant progress in session topbar */
.participant-progress {
  display: flex;
  gap: 4px;
  align-items: center;
}
.p-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border2);
  transition: background 0.2s;
}
.p-dot.done { background: var(--clr-green); }
.p-dot.active { background: var(--clr-lilac-400); box-shadow: 0 0 6px rgba(167,139,250,0.6); }

/* ── Form select ────────────────────────────────────────────────────────────── */
.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a78bfa' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}
.form-select:focus {
  border-color: rgba(167,139,250,0.5);
  box-shadow: 0 0 0 3px rgba(167,139,250,0.1);
}
.form-select option { background: #fff; color: #111; }

.category-hint, .urgency-hint {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 6px;
  min-height: 16px;
  line-height: 1.5;
  font-family: 'DM Mono', monospace;
  transition: opacity 0.2s;
}


/* ── Participant input row ───────────────────────────────────────────────────── */
.participant-input-row {
  display: flex;
  gap: 8px;
}
.participant-input-row .form-field {
  flex: 1;
}
.btn-add-participant {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--border2);
  background: rgba(255,255,255,0.9);
  color: var(--clr-lilac-400);
  font-size: 20px; font-weight: 300;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.btn-add-participant:hover {
  border-color: var(--clr-lilac-400);
  background: var(--clr-lilac-100);
  color: var(--clr-ink);
}
.participant-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  min-height: 0;
}
.ptag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 12px;
  border-radius: 999px;
  background: var(--clr-lilac-100);
  border: 1px solid var(--border2);
  font-size: 12px;
  color: var(--text);
  font-family: 'DM Mono', monospace;
}
.ptag-remove {
  background: none; border: none;
  color: var(--text-faint);
  font-size: 14px; line-height: 1;
  cursor: pointer; padding: 0;
  transition: color 0.15s;
}
.ptag-remove:hover { color: var(--clr-red); }

/* ── End Session button ─────────────────────────────────────────────────────── */
.btn-end-session {
  border-color: rgba(239,68,68,0.25);
  color: rgba(239,68,68,0.75);
}
.btn-end-session:hover {
  border-color: rgba(239,68,68,0.6);
  color: #ef4444;
  background: rgba(239,68,68,0.06);
}

/* ── Session participant label ───────────────────────────────────────────────── */
.session-participant-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(167,139,250,0.1);
  border: 1px solid var(--border2);
  font-family: 'Instrument Sans', sans-serif;
  white-space: nowrap;
}
