/* Samvinas — Shared styles (internal codename: Kelvin) */
/* KI brand theme, mobile-first */

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

:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface2: #e8e8e8;
  --accent: #3E76B8;
  --accent-hover: #2d5f99;
  --accent2: #3B4270;
  --success: #83BD8E;
  --warning: #E29F28;
  --danger: #D84220;
  --text: #363C4C;
  --text-dim: #666666;
  --text-light: #999999;
  --border: #d0d0d0;
  --border-light: #eee;
  --radius: 8px;
  --gap: 16px;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Screens ──────────────────────────────────────── */
.screen { display: none; }
.screen.active { display: block; animation: screenFadeIn .15s ease-out; }
@keyframes screenFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
/* Tool container crossfade for participant view */
.tool-transition {
  animation: toolCrossfade .12s ease-out;
}
@keyframes toolCrossfade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Container ────────────────────────────────────── */
.container { max-width: 800px; margin: 0 auto; padding: var(--gap); }

/* ── Auth Screen ──────────────────────────────────── */
.auth-section {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 80vh; text-align: center;
}
.auth-section h1 { font-size: 2rem; margin-bottom: 8px; color: var(--accent2); }
.auth-section p { color: var(--text-dim); margin-bottom: 24px; }
.auth-error { color: var(--danger); margin-top: 16px; font-size: .9rem; }

.google-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  padding: 12px 24px; font-size: 1rem; font-weight: 600; color: var(--text);
  cursor: pointer; transition: box-shadow .15s, border-color .15s;
}
.google-btn:hover { border-color: #999; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.google-btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ── Not Authorized ───────────────────────────────── */
.not-authorized { text-align: center; padding: 48px; }
.not-authorized h2 { margin-bottom: 12px; }
.not-authorized p { color: var(--text-dim); margin-bottom: 24px; }

/* ── Dashboard ────────────────────────────────────── */
.dashboard-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.dashboard-header h1 { font-size: 1.5rem; color: var(--accent2); }
.user-info { display: flex; align-items: center; gap: 12px; }
.user-email { color: var(--text-dim); font-size: .85rem; }

/* ── Cards ────────────────────────────────────────── */
.card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border-light); padding: var(--gap);
  margin-bottom: var(--gap);
}
.card h2, .card h3 { margin-bottom: 12px; font-size: 1.1rem; }

/* ── Forms ────────────────────────────────────────── */
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 4px; }

.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 12px; font-size: 1rem;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text);
  font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(62, 118, 184, .15);
}
.form-textarea { resize: vertical; min-height: 80px; }

/* ── Buttons ──────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; font-size: .95rem; font-weight: 600;
  border: none; border-radius: 6px; cursor: pointer;
  transition: background .15s, transform .1s; font-family: inherit;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-secondary { background: var(--surface2); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: #ddd; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b5351a; }

.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--surface); }

.btn-sm { padding: 6px 14px; font-size: .85rem; }
.btn-full { width: 100%; }

/* ── Event List ───────────────────────────────────── */
.event-list { list-style: none; }
.event-list-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px; border-bottom: 1px solid var(--border-light);
  cursor: pointer; transition: background .1s;
}
.event-list-item:hover { background: var(--bg); }
.event-list-item:last-child { border-bottom: none; }
.event-code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-weight: 700; font-size: .85rem; color: var(--accent);
  background: rgba(62, 118, 184, .08); padding: 2px 8px; border-radius: 4px;
}
.event-name { font-weight: 600; }
.event-meta { font-size: .8rem; color: var(--text-dim); }

/* Past events collapsible section */
.past-events-header { list-style: none; border-top: 1px solid var(--border-light); margin-top: 4px; }
.past-events-btn {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 10px 12px; background: none; border: none;
  cursor: pointer; font-size: .85rem; font-weight: 600;
  color: var(--text-dim);
}
.past-events-btn:hover { color: var(--text); }
.past-events-arrow { font-size: .7rem; width: 12px; }
.past-events-section { list-style: none; }
.past-events-section .event-list { list-style: none; }
.past-events-section .event-list-item { opacity: .7; }
.past-events-section .event-list-item:hover { opacity: 1; }

/* ── Event Session (facilitator managing live event) ─ */
.event-session-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px var(--gap); background: var(--accent2); color: #fff;
  margin: calc(-1 * var(--gap)); margin-bottom: var(--gap);
  padding-top: calc(var(--gap) + 4px);
}
.event-session-header h2 { font-size: 1.1rem; }
.event-session-code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 1.2rem; letter-spacing: 2px;
}

/* ── Flow (tool instance list) ────────────────────── */
.flow-list { list-style: none; margin-bottom: var(--gap); }
.flow-item {
  padding: 10px 12px; border: 1px solid var(--border-light);
  border-radius: 6px; margin-bottom: 6px; background: var(--surface);
  transition: border-color .15s, opacity .15s, box-shadow .15s;
  -webkit-user-drag: none;
}
.flow-item-header {
  display: flex; align-items: center; gap: 10px;
}
.drag-handle {
  cursor: grab; color: var(--text-dim); font-size: 1.2rem;
  user-select: none; touch-action: none; padding: 4px 2px;
  line-height: 1; flex-shrink: 0; transition: color .15s;
  -webkit-user-drag: none;
}
.drag-handle:hover { color: var(--accent); }
.drag-handle:active { cursor: grabbing; color: var(--accent); }
/* Ghost = placeholder left behind in the list */
.sortable-ghost {
  opacity: .25 !important;
  border: 2px dashed var(--accent) !important;
  background: rgba(62, 118, 184, .06) !important;
}
/* Chosen = the original element while being dragged */
.sortable-chosen {
  box-shadow: 0 8px 24px rgba(0,0,0,.18) !important;
  border-color: var(--accent) !important;
  z-index: 10 !important; position: relative;
}
/* Fallback drag clone that follows the cursor */
.sortable-fallback {
  opacity: .92 !important;
  box-shadow: 0 12px 32px rgba(0,0,0,.25) !important;
  border: 2px solid var(--accent) !important;
  border-radius: 8px !important;
  transform: rotate(1.5deg) !important;
  background: var(--surface) !important;
}
.flow-item.active { border-color: var(--accent); background: rgba(62, 118, 184, .04); }
.flow-item-icon { font-size: 1.2rem; }
.flow-item-name { flex: 1; font-weight: 500; cursor: text; border-radius: 4px; padding: 2px 4px; }
.flow-item-name:hover { background: rgba(62, 118, 184, .06); }
.flow-rename-input { flex: 1; padding: 2px 4px; font-size: inherit; font-weight: 500; }
.flow-item.current { border-color: var(--accent); border-width: 2px; }

.flow-item-pipes {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.pipe-label { font-size: .75rem; color: var(--text-dim); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.pipe-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(62, 118, 184, .1); color: var(--accent);
  font-size: .8rem; font-weight: 500; padding: 2px 8px; border-radius: 12px;
}
.pipe-tag-name { cursor: pointer; }
.pipe-tag-name:hover { text-decoration: underline; }
.pipe-filter-badge {
  font-size: .7rem; background: rgba(62, 118, 184, .2);
  padding: 1px 5px; border-radius: 8px; margin-left: 2px;
}
/* Filter rows below source tags */
.flow-section-sublabel {
  font-size: .65rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .6px; color: var(--text-light); margin-top: 8px; margin-bottom: 4px;
}
.pipe-filter-row { margin-bottom: 4px; }
.pipe-filter-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: 1px solid var(--border-light); border-radius: 6px;
  padding: 4px 10px; font-size: .8rem; color: var(--text-dim);
  cursor: pointer; width: 100%; text-align: left;
}
.pipe-filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.pipe-filter-active { border-color: var(--accent); background: rgba(62, 118, 184, .04); }
.pipe-filter-active .pipe-filter-summary { color: var(--accent); font-weight: 500; }
.pipe-filter-summary { flex: 1; }

.pipe-tag-remove {
  background: none; border: none; color: var(--accent); cursor: pointer;
  font-size: 1rem; line-height: 1; padding: 0 2px; opacity: .6;
}
.pipe-tag-remove:hover { opacity: 1; }
.pipe-add-source {
  font-size: .75rem; padding: 2px 6px; border-radius: 12px;
  border: 1px dashed var(--border); background: var(--surface2);
  color: var(--text-dim); cursor: pointer; font-family: inherit;
}


/* ── Join Screen ──────────────────────────────────── */
.join-section {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 80vh; text-align: center;
}
.join-section h1 { font-size: 2rem; margin-bottom: 8px; color: var(--accent2); }
.join-section p { color: var(--text-dim); margin-bottom: 24px; }
.code-input {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 2rem; text-align: center; letter-spacing: 6px;
  text-transform: uppercase; width: 260px; padding: 16px;
  border: 2px solid var(--border); border-radius: var(--radius);
}
.code-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(62, 118, 184, .15);
  outline: none;
}

/* ── Participant Event View ───────────────────────── */
.event-header {
  background: var(--accent2); color: #fff; padding: 12px var(--gap);
  padding-left: 56px; /* clear hamburger button */
}
.event-header-name { font-weight: 700; font-size: 1.1rem; }
.event-header-tool { font-size: .85rem; opacity: .8; }

.tool-container { padding: var(--gap); }

/* ── Brainstorm Tool ──────────────────────────────── */
.brainstorm-input-area {
  display: flex; gap: 8px; margin-bottom: var(--gap);
  position: sticky; top: 0; background: var(--bg);
  padding: var(--gap) 0; z-index: 10;
}
.brainstorm-input-area .form-input { flex: 1; }

/* ── Ranking Tool ──────────────────────────────────── */
.rank-select {
  flex-shrink: 0; width: 44px; height: 32px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text-dim);
  font-size: .9rem; font-weight: 600; text-align: center;
  cursor: pointer; appearance: none; -webkit-appearance: none;
  padding: 0 4px;
}
.rank-select:focus { border-color: var(--accent); outline: none; }
.rank-selected { color: var(--accent); border-color: var(--accent); background: rgba(62, 118, 184, .06); }
.rank-position {
  flex-shrink: 0; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; font-weight: 700;
  background: var(--bg); border-radius: 50%;
}

/* ── Brain Writing Tool ────────────────────────────── */
.bw-counter {
  text-align: center; font-size: .8rem; color: var(--text-dim);
  font-weight: 600; margin-bottom: 8px;
}
.bw-stimulus-card {
  padding: 16px; margin-bottom: 16px;
  background: rgba(62, 118, 184, .06);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.bw-stimulus-label {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--accent); margin-bottom: 6px;
}
.bw-stimulus-body {
  display: flex; align-items: center; gap: 8px;
}
.bw-stimulus-text {
  flex: 1; font-size: 1.1rem; line-height: 1.4; color: var(--text);
  text-align: center;
}
.bw-arrow {
  flex-shrink: 0; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--surface); color: var(--text);
  font-size: 1.4rem; cursor: pointer; line-height: 1;
}
.bw-arrow:hover { border-color: var(--accent); color: var(--accent); }
.bw-arrow-spacer { width: 36px; flex-shrink: 0; }
.bw-input-section {
  display: flex; gap: 8px; margin-bottom: 12px;
}
.bw-input-section .form-input { flex: 1; }
.bw-nav-row {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 8px;
}
.bw-waiting, .bw-complete {
  text-align: center; padding: 24px; color: var(--text-dim);
}
.bw-complete { color: var(--success); }

/* ── Elaboration Tool ─────────────────────────────── */
.elab-stimulus-bar {
  margin-bottom: 12px;
}
.elab-stimulus-card {
  padding: 12px 16px;
  background: rgba(62, 118, 184, .06);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.elab-stimulus-label {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--accent); margin-bottom: 4px;
}
.elab-stimulus-body {
  display: flex; align-items: center; gap: 8px;
}
.elab-stimulus-text {
  flex: 1; font-size: 1rem; line-height: 1.4; color: var(--text);
}
.elab-list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin-bottom: 6px;
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: 6px;
}
.elab-list-item-done { border-left: 3px solid var(--success); }
.elab-list-item-text { flex: 1; min-width: 0; }
.elab-list-item-text > div:first-child { font-size: .95rem; }
.elab-list-preview {
  font-size: .8rem; color: var(--text-dim); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.elab-action-btn { flex-shrink: 0; }
.elab-input-section {
  position: relative;
}
.elab-textarea {
  width: 100%; min-height: 40vh; font-size: 1rem; line-height: 1.5;
  resize: vertical; margin-bottom: 8px;
}

.idea-list { list-style: none; }
.idea-item {
  padding: 12px; margin-bottom: 8px;
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border-light);
  display: flex; align-items: flex-start; gap: 10px;
}
.idea-seq {
  flex-shrink: 0; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; color: var(--text-light);
  background: var(--bg); border-radius: 50%;
}
.idea-content { flex: 1; min-width: 0; }
.idea-text { margin-bottom: 4px; }
/* Facilitator inline edit hint — the body class is set by facilitator.html */
.flow-item-body .idea-text,
.flow-item-body .cl-item-text { cursor: text; border-radius: 4px; padding: 1px 3px; margin: -1px -3px; }
.flow-item-body .idea-text:hover,
.flow-item-body .cl-item-text:hover { background: rgba(62, 118, 184, .06); }
.idea-meta { font-size: .8rem; color: var(--text-dim); }

.idea-count {
  text-align: center; padding: 8px;
  font-size: .85rem; color: var(--text-dim);
}

/* ── Voting Tool ──────────────────────────────────── */
.vote-btn {
  width: 36px; height: 36px; border: 2px solid var(--border);
  border-radius: 50%; background: var(--surface); cursor: pointer;
  font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
  transition: all .15s; color: var(--text-dim); flex-shrink: 0;
}
.vote-btn:hover:not(:disabled) { border-color: var(--warning); color: var(--warning); }
.vote-btn.voted { background: var(--warning); border-color: var(--warning); color: #fff; }
.vote-btn:disabled { opacity: .3; cursor: not-allowed; }

.vote-item.voted { background: rgba(226, 159, 40, .06); border-color: rgba(226, 159, 40, .3); }

.vote-rank {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent2); color: #fff; font-size: .8rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.vote-count-badge {
  background: var(--accent); color: #fff; font-weight: 700;
  padding: 4px 12px; border-radius: 12px; font-size: .9rem; flex-shrink: 0;
}


/* ── Value / Do-ability Tool ──────────────────────── */
.vd-card {
  background: var(--surface); border-radius: var(--radius); padding: 14px 16px;
  margin-bottom: 12px; border: 1px solid var(--border-light);
}
.vd-card-legend {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
  padding: 0; font-size: .95rem; line-height: 1.4;
}
.vd-num {
  width: 28px; height: 28px; border-radius: 50%; background: var(--accent2); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; flex-shrink: 0;
}
.vd-slider-row {
  display: flex; align-items: center; gap: 8px; margin-top: 8px;
}
.vd-slider-label {
  font-size: .8rem; color: var(--text-dim); font-weight: 600;
  width: 75px; text-align: right; flex-shrink: 0;
}
.vd-slider { flex: 1; accent-color: var(--accent); }
.vd-slider-val {
  width: 24px; text-align: center; font-weight: 700; font-size: .95rem; color: var(--accent);
}

.vd-tabs {
  display: flex; gap: 4px; margin-bottom: 12px;
  border-bottom: 2px solid var(--border-light); padding-bottom: 0;
}
.vd-tab {
  background: none; border: none; padding: 8px 16px; font-size: .9rem;
  font-weight: 600; color: var(--text-dim); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  font-family: inherit;
}
.vd-tab:hover { color: var(--text); }
.vd-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.vd-tab-content { display: none; }
.vd-tab-content.active { display: block; }

.vd-table {
  width: 100%; border-collapse: collapse; font-size: .9rem;
}
.vd-table th {
  text-align: left; padding: 8px; border-bottom: 2px solid var(--border);
  font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; color: var(--text-dim);
}
.vd-table td {
  padding: 8px; border-bottom: 1px solid var(--border-light);
}
.vd-table tbody tr:hover { background: var(--bg); }

/* ── Clustering Tool ──────────────────────────────── */
.cl-selection-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 12px;
  background: rgba(62, 118, 184, .08); border-radius: 6px;
  font-size: .9rem; font-weight: 500;
}
.cl-selection-bar span { flex: 1; }

.cl-section-header {
  font-size: .8rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-dim);
  padding: 8px 0 4px; margin-top: 8px;
}

.cl-cluster {
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius); margin-bottom: 10px; overflow: hidden;
}
.cl-cluster-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: rgba(59, 66, 112, .06);
  font-weight: 600; cursor: pointer; list-style: none;
}
.cl-cluster-header::-webkit-details-marker { display: none; }
.cl-cluster-header::before {
  content: '▸'; font-size: .85rem; color: var(--text-dim);
  transition: transform .15s; flex-shrink: 0;
}
details[open] > .cl-cluster-header::before { transform: rotate(90deg); }
.cl-cluster-name { flex: 1; }
.cl-cluster-count {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent2); color: #fff; font-size: .8rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cl-cluster-items { list-style: none; padding: 0; }
.cl-child-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; border-top: 1px solid var(--border-light);
  font-size: .9rem;
}
.cl-remove-btn {
  background: none; border: none; cursor: pointer; color: var(--text-light);
  font-size: .9rem; padding: 2px 6px; border-radius: 4px;
}
.cl-remove-btn:hover { color: var(--danger); background: rgba(216, 66, 32, .08); }

.cl-ungrouped-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 6px;
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: 6px; cursor: pointer; transition: border-color .15s;
}
.cl-ungrouped-item:hover { border-color: var(--accent); }
.cl-ungrouped-item.cl-selected {
  border-color: var(--accent); background: rgba(62, 118, 184, .06);
}
.cl-checkbox { font-size: 1.2rem; flex-shrink: 0; }
.cl-item-text { flex: 1; }
.cl-add-to-group {
  font-size: .75rem; padding: 2px 6px; border-radius: 12px;
  border: 1px dashed var(--border); background: var(--surface2);
  color: var(--text-dim); cursor: pointer; font-family: inherit;
  flex-shrink: 0;
}

/* ── Tagging Tool ─────────────────────────────────── */
.tag-section { margin-bottom: 16px; }
.tag-section-header {
  font-size: .8rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .5px; padding: 8px 0 4px; margin-top: 4px;
  display: flex; align-items: center; gap: 6px;
}
.tag-item {
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: 6px; padding: 10px 12px; margin-bottom: 6px;
}
.tag-item-row {
  display: flex; align-items: center; gap: 12px;
}
.tag-item-row .tag-item-text { margin-bottom: 0; flex: 1; min-width: 0; }
.tag-item-text { font-size: .95rem; }
.tag-select {
  font-size: .8rem; padding: 4px 8px; border-radius: 6px;
  border: 1.5px solid var(--border-light); background: var(--surface);
  cursor: pointer; font-family: inherit; font-weight: 500;
  flex-shrink: 0; max-width: 140px;
  transition: border-color .15s, color .15s;
}
.tag-badge {
  font-size: .75rem; padding: 2px 10px; border-radius: 12px;
  font-weight: 600; display: inline-block;
}
.tag-lane { }
.tag-lane-header {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; font-weight: 600; font-size: .9rem;
  border-bottom: 1px solid var(--border-light);
}
.tag-lane-list { list-style: none; padding: 0; }
.tag-lane-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-bottom: 1px solid var(--border-light);
  font-size: .9rem;
}
.tag-dist { display: flex; gap: 3px; flex-shrink: 0; }
.tag-dist-chip {
  font-size: .7rem; padding: 1px 6px; border-radius: 8px;
  font-weight: 600; min-width: 18px; text-align: center;
}
.text-dim { color: var(--text-dim); }

/* ── Workspace Launcher ───────────────────────────── */
.ws-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius);
}
.ws-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 16px;
}
.ws-modal {
  background: var(--surface); border-radius: var(--radius);
  padding: 24px; max-width: 400px; width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.ws-gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.ws-gallery-card {
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 12px;
}
.ws-breadcrumb {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; background: var(--accent2);
  color: #fff; font-size: .85rem;
}
.ws-breadcrumb a {
  color: #fff; text-decoration: none; font-weight: 600;
}
.ws-breadcrumb a:hover { text-decoration: underline; }

/* ── Breakout Groups ─────────────────────────────── */
.bo-group-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius); cursor: default;
}
.bo-group-number {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; flex-shrink: 0;
}

/* ── Display View ─────────────────────────────────── */
.display-lobby {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; text-align: center; background: var(--accent2); color: #fff;
}
.display-lobby h1 { font-size: 3rem; margin-bottom: 16px; }
.display-lobby .qr-container { margin: 24px 0; }
.display-lobby .join-code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 4rem; letter-spacing: 8px; margin: 16px 0;
}
.display-lobby .participant-count {
  font-size: 1.2rem; opacity: .8; margin-top: 16px;
}

/* ── Utilities Toolbar ────────────────────────────── */
.utilities-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: var(--gap);
}
.utilities-toolbar:empty { display: none; }
.utilities-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.utility-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text-dim);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.utility-toggle:hover { border-color: var(--accent); color: var(--accent); }
.utility-toggle.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.utility-badge {
  background: rgba(255,255,255,.3);
  padding: 0 6px;
  border-radius: 10px;
  font-size: .75rem;
  min-width: 18px;
  text-align: center;
}
.utility-toggle:not(.active) .utility-badge {
  background: var(--accent);
  color: #fff;
}

/* Timer panel (facilitator) */
.timer-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  flex-wrap: wrap;
}
.timer-display {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 1.6rem;
  font-weight: 700;
  min-width: 80px;
  text-align: center;
  color: var(--text);
}
.timer-display.timer-warning { color: #d97706; }
.timer-display.timer-danger { color: #dc2626; }
.timer-display.timer-done { color: #dc2626; animation: timerPulse 1s ease-in-out infinite; }
@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}
.timer-presets {
  display: flex;
  gap: 4px;
}
.timer-preset {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  font-size: .8rem;
  cursor: pointer;
  transition: all .15s;
}
.timer-preset:hover { border-color: var(--accent); color: var(--accent); }
.timer-preset.selected { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Hand raises panel (facilitator) */
.hand-panel {
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 8px;
}
.hand-queue-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: .9rem;
}
.hand-queue-item:last-child { border-bottom: none; }
.hand-queue-pos {
  font-weight: 700;
  color: var(--accent);
  min-width: 24px;
  text-align: center;
}
.hand-queue-name { flex: 1; }
.hand-queue-empty {
  color: var(--text-dim);
  font-size: .85rem;
  padding: 4px 0;
}

/* ── Participant Utility Strip ────────────────────── */
.utility-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px var(--gap);
  background: rgba(62, 118, 184, .04);
  border-bottom: 1px solid var(--border-light);
}
.utility-strip:empty { display: none; }
.utility-strip-timer {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.utility-strip-timer.timer-warning { color: #d97706; }
.utility-strip-timer.timer-danger { color: #dc2626; }
.utility-strip-timer.timer-done { color: #dc2626; animation: timerPulse 1s ease-in-out infinite; }
.utility-strip-spacer { flex: 1; }
.raise-hand-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: none;
  border-radius: 20px;
  background: var(--accent2);
  color: #fff;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.raise-hand-btn:hover { opacity: .9; }
.raise-hand-btn.raised {
  background: #d97706;
}
.raise-hand-btn.called {
  background: #16a34a;
  animation: timerPulse 1s ease-in-out 3;
}
.raise-hand-position {
  font-size: .8rem;
  color: var(--text-dim);
}

/* ── Display page timer ───────────────────────────── */
.display-timer {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 3rem;
  font-weight: 700;
  text-align: center;
  padding: 12px;
  color: var(--text);
}
.display-timer.timer-warning { color: #d97706; }
.display-timer.timer-danger { color: #dc2626; }
.display-timer.timer-done { color: #dc2626; animation: timerPulse 1s ease-in-out infinite; }

/* ── Hamburger Menu ───────────────────────────────── */
.hamburger-menu { position: fixed; top: 0; left: 0; z-index: 100; pointer-events: none; }
.hamburger-menu > * { pointer-events: auto; }
.hamburger-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.3);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.hamburger-overlay.open { opacity: 1; pointer-events: auto; }
.hamburger-btn {
  position: fixed; top: 12px; left: 12px; z-index: 101;
  width: 36px; height: 36px; background: var(--accent2);
  border: none; border-radius: 6px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 8px;
}
.hamburger-btn span {
  display: block; width: 18px; height: 2px; background: #fff;
  transition: transform .2s, opacity .2s;
}
.hamburger-btn.open span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

.hamburger-panel {
  position: fixed; top: 0; left: -280px; width: 280px; height: 100vh;
  background: var(--surface); box-shadow: 2px 0 12px rgba(0,0,0,.15);
  transition: left .25s ease; z-index: 102;
  display: flex; flex-direction: column;
}
.hamburger-panel.open { left: 0; }
.hamburger-tools {
  flex: 1; overflow-y: auto; padding: 60px var(--gap) var(--gap);
}
.hamburger-footer {
  flex-shrink: 0; padding: 8px var(--gap) var(--gap);
  border-top: 1px solid var(--border-light);
}
.hamburger-footer:empty { display: none; }

.hamburger-tool-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 12px; border: none; background: transparent;
  font-size: 1rem; color: var(--text); cursor: pointer;
  border-radius: 6px; text-align: left; font-family: inherit;
}
.hamburger-tool-item:hover { background: var(--bg); }
.hamburger-tool-item.active { background: rgba(62, 118, 184, .08); color: var(--accent); font-weight: 600; }
.hamburger-footer-item { color: var(--text-dim); font-size: .9rem; }
.tool-icon { font-size: 1.2rem; }

/* ── Modal ────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 300; padding: var(--gap);
}
.modal {
  background: var(--surface); border-radius: var(--radius);
  width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--gap); border-bottom: 1px solid var(--border-light);
}
.modal-header h3 { margin: 0; font-size: 1.1rem; }
.modal-close {
  background: none; border: none; font-size: 1.4rem; cursor: pointer;
  color: var(--text-dim); padding: 4px; line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: var(--gap); }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: var(--gap); border-top: 1px solid var(--border-light);
}
.modal-warning {
  background: rgba(216, 66, 32, .08); border: 1px solid rgba(216, 66, 32, .2);
  border-radius: 6px; padding: 12px; margin-bottom: 12px;
  font-size: .9rem; color: var(--danger);
}
.modal-dep-list { margin: 8px 0; padding-left: 20px; }
.modal-dep-list li { margin-bottom: 4px; }

/* ── Icon Buttons (cog, delete) ──────────────────── */
.flow-item-actions {
  display: flex; gap: 4px; align-items: center;
}
.icon-btn {
  background: none; border: none; cursor: pointer;
  font-size: 1rem; padding: 4px; border-radius: 4px;
  color: var(--text-dim); line-height: 1;
}
.icon-btn:hover { background: var(--surface2); color: var(--text); }
.icon-btn-danger:hover { background: rgba(216, 66, 32, .1); color: var(--danger); }
/* ── Flow Add Buttons & Tool Picker ──────────────── */
.flow-add-row {
  display: flex; align-items: center; gap: 8px;
  padding: 2px 0; position: relative;
  list-style: none;
}
.flow-add-btn {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px dashed var(--border); background: var(--surface);
  color: var(--text-light); font-size: 1.1rem; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  line-height: 1; transition: all .15s; flex-shrink: 0;
}
.flow-add-btn:hover {
  border-color: var(--accent); color: var(--accent);
  background: rgba(62, 118, 184, .06);
}
/* ── Flow Empty State ────────────────────────────── */
.flow-empty-state {
  list-style: none;
}
.flow-empty-hint {
  padding: 16px; text-align: center;
  color: var(--text-dim); font-size: .9rem;
  background: var(--bg); border-radius: var(--radius);
  border: 1px dashed var(--border);
}

/* ── Flow Detail Sections ────────────────────────── */
.flow-detail-section {
  padding: 8px 12px 8px 36px;
  border-top: 1px solid var(--border-light);
}
.flow-section-label {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--text-light); margin-bottom: 6px;
}

/* Status icons (collapsed view indicators) */
.flow-status-icons {
  display: flex; gap: 2px; align-items: center; flex-shrink: 0;
}
.flow-status-icon {
  font-size: .85rem; opacity: .5; line-height: 1;
}
.flow-status-clickable { cursor: pointer; }
.flow-status-clickable:hover { opacity: .8; }
.flow-item-hidden { opacity: .6; background: var(--bg); }

/* Controls section inside disclosure */
.flow-item-detail {}
.flow-slider-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0; cursor: pointer;
}
.flow-slider-label {
  font-size: .85rem; color: var(--text); font-weight: 500;
}
.flow-slider {
  display: inline-flex; align-items: center; cursor: pointer;
}
.flow-slider-track {
  position: relative; width: 40px; height: 22px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 11px; transition: background .2s, border-color .2s;
}
.flow-slider-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; background: #fff;
  border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .2s;
}
.flow-slider-on .flow-slider-track {
  background: var(--accent); border-color: var(--accent);
}
.flow-slider-on .flow-slider-thumb {
  transform: translateX(18px);
}
.flow-controls-buttons {
  display: flex; gap: 8px; padding-top: 6px; margin-top: 4px;
}
.flow-controls-buttons .icon-btn {
  font-size: .85rem; padding: 4px 8px;
}

/* ── Tool Prompt ──────────────────────────────────── */
.tool-prompt {
  padding: 10px 14px; margin-bottom: 12px;
  background: rgba(62, 118, 184, .06);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .9rem; color: var(--text); line-height: 1.4;
}
.tool-content { flex: 1; min-height: 0; }

/* Prompt input in facilitator disclosure */
.flow-prompt-input {
  font-size: .85rem;
}

/* ── Tool Picker Modal ───────────────────────────── */
.tool-picker-modal-list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 60vh; overflow-y: auto;
}
.tool-picker-modal-option {
  display: flex; align-items: center; gap: 10px;
  text-align: left; padding: 10px 12px; border: 1px solid var(--border-light);
  border-radius: 6px; background: var(--surface); cursor: pointer;
  transition: border-color .15s;
}
.tool-picker-modal-option:hover { border-color: var(--accent); }
.tool-picker-locked {
  opacity: .5; cursor: not-allowed;
}
.tool-picker-locked:hover { border-color: var(--border-light); }
.tool-picker-modal-icon { font-size: 1.3rem; flex-shrink: 0; width: 28px; text-align: center; }
.tool-picker-modal-info { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tool-picker-modal-name { font-weight: 500; font-size: .9rem; }
.tool-picker-modal-desc { font-size: .75rem; color: var(--text-dim); }
.tool-tier-badge {
  display: inline-block; font-size: .65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  padding: 1px 5px; border-radius: 3px; vertical-align: middle;
  background: rgba(226, 159, 40, .15); color: var(--warning);
}
.tool-picker-help {
  flex-shrink: 0; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-dim);
  font-size: .8rem; font-weight: 700; text-decoration: none;
  cursor: pointer;
}
.tool-picker-help:hover { border-color: var(--accent); color: var(--accent); }
.tool-picker-divider {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--text-light);
  padding: 8px 0 4px;
}

/* ── Admin Sub-tabs ──────────────────────────────── */
.admin-subtabs {
  display: flex; gap: 4px; margin-bottom: var(--gap);
}
.admin-subtab {
  padding: 6px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface);
  cursor: pointer; font-size: .85rem; color: var(--text-dim);
}
.admin-subtab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.admin-subtab-content { display: none; }
.admin-subtab-content.active { display: block; }
.admin-tool-row { padding: 8px 0; }

/* ── Template Picker (new event modal) ───────────── */
.template-picker-list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 200px; overflow-y: auto;
}
.template-picker-option {
  display: flex; flex-direction: column; gap: 2px;
  text-align: left; padding: 8px 12px; border: 1px solid var(--border-light);
  border-radius: 6px; background: var(--surface); cursor: pointer;
  transition: border-color .15s;
}
.template-picker-option:hover { border-color: var(--accent); }
.template-picker-selected {
  border-color: var(--accent); background: rgba(62, 118, 184, .06);
}
.template-picker-name { font-weight: 500; font-size: .9rem; }
.template-picker-desc { font-size: .75rem; color: var(--text-dim); }

.tool-locked-banner {
  text-align: center; padding: 10px; margin-bottom: 12px;
  background: rgba(226, 159, 40, .1); border: 1px solid rgba(226, 159, 40, .3);
  border-radius: 6px; font-size: .9rem; color: var(--warning); font-weight: 500;
}

/* ── Toast ────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
  padding: 10px 20px; border-radius: 6px; font-size: .9rem;
  background: var(--text); color: #fff; opacity: 0;
  transition: opacity .3s, transform .3s; z-index: 200;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }

/* ── Ended Screen ─────────────────────────────────── */
.ended-section {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 80vh; text-align: center;
}
.ended-section h2 { font-size: 1.5rem; margin-bottom: 12px; }
.ended-section p { color: var(--text-dim); }

/* ── Responsive ───────────────────────────────────── */
/* ── Sign Up Tool ────────────────────────── */
.su-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: var(--surface);
}
.su-item.su-signed-up {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
}
.su-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.su-item-text {
  font-weight: 500;
  flex: 1;
}
.su-count {
  background: var(--primary);
  color: white;
  border-radius: 999px;
  min-width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 600;
  flex-shrink: 0;
}
.su-names {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.su-name-tag {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--text);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .85rem;
}

/* ── Word Cloud Tool ─────────────────────── */
.wc-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 14px;
  padding: 24px 16px;
  min-height: 200px;
}
.wc-cloud-large {
  padding: 40px 24px;
  min-height: 400px;
  gap: 12px 20px;
}
.wc-word {
  display: inline-block;
  font-weight: 700;
  line-height: 1.2;
  cursor: default;
  transition: opacity 0.15s;
  padding: 2px 4px;
}
.wc-word:hover {
  opacity: 0.7;
}

/* ── Join Page Nav ───────────────────────── */
.join-nav {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 100;
}
.join-nav-hamburger {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1.3rem;
  padding: 4px 10px;
  cursor: pointer;
  color: var(--text-dim);
}
.join-nav-hamburger:hover {
  background: var(--surface);
}
.join-nav-menu {
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 180px;
  padding: 4px;
}
.join-nav-link {
  display: block;
  padding: 10px 14px;
  color: var(--text);
  text-decoration: none;
  border-radius: 6px;
  font-size: .9rem;
}
.join-nav-link:hover {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}

/* ── Dashboard Tabs ───────────────────────────────── */
.dashboard-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: var(--gap); }
.dashboard-tab { padding: 10px 20px; background: none; border: none; cursor: pointer; font-size: .95rem; font-weight: 500; color: var(--text-dim); border-bottom: 2px solid transparent; margin-bottom: -2px; font-family: inherit; }
.dashboard-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.dashboard-tab:hover { color: var(--text); }
.dashboard-tab-content { display: none; }
.dashboard-tab-content.active { display: block; }

/* ── FAB ─────────────────────────────────────────── */
.fab { position: fixed; bottom: 24px; right: 24px; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: white; border: none; font-size: 28px; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,0.25); z-index: 50; display: flex; align-items: center; justify-content: center; }
.fab:hover { box-shadow: 0 6px 16px rgba(0,0,0,0.35); transform: scale(1.05); }

/* ── Flow Reorder Arrows ─────────────────────────── */
.flow-reorder {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex-shrink: 0;
}
.flow-reorder-btn {
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.55rem;
  padding: 1px 4px;
  color: var(--text-dim);
  line-height: 1;
  border-radius: 3px;
}
.flow-reorder-btn:hover:not(:disabled) {
  background: var(--surface);
  color: var(--text);
}
.flow-reorder-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

/* ── Disclosure Triangle ─────────────────────────── */
.flow-item-toggle { background: none; border: none; cursor: pointer; font-size: 0.8rem; padding: 4px; color: var(--text-dim); width: 24px; flex-shrink: 0; }
.flow-item-body { padding: 8px 12px 12px 36px; }

/* ── Item Count Badge ────────────────────────────── */
.flow-item-count {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface2); color: var(--text-dim);
  font-size: .75rem; font-weight: 600; min-width: 20px; height: 20px;
  padding: 0 6px; border-radius: 10px; margin-left: 6px; vertical-align: middle;
}

/* ── Rich Brainstorm ────────────────────────────── */
.rich-brainstorm-input {
  position: sticky; bottom: 0; z-index: 5;
  background: var(--surface); padding: 12px 0;
  border-top: 1px solid var(--border);
}
.rb-textarea {
  width: 100%; min-height: 72px; max-height: 200px; resize: vertical;
  font-family: inherit; font-size: .95rem; line-height: 1.5;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text);
}
.rb-textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* Slash command palette */
.slash-command-palette {
  position: absolute; bottom: 100%; left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 -4px 16px rgba(0,0,0,.12);
  margin-bottom: 4px; overflow: hidden; z-index: 20;
}
.slash-command-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; cursor: pointer; font-size: .9rem;
}
.slash-command-item:hover, .slash-command-item.selected { background: var(--surface2, #f0f0f0); }
.slash-icon { font-size: 1.1rem; width: 24px; text-align: center; }
.slash-label { font-weight: 600; }
.slash-desc { color: var(--text-dim); font-size: .8rem; }

/* Sketch canvas panel */
.sketch-panel {
  border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; margin-top: 8px; background: #fff;
  transition: all 0.2s ease;
}
.sketch-panel-expanded {
  position: fixed; inset: 16px; z-index: 400;
  margin-top: 0; border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  display: flex; flex-direction: column;
}
.sketch-panel-expanded canvas {
  flex: 1; border-radius: 12px 12px 0 0;
}
.sketch-toolbar {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; flex-wrap: wrap; background: var(--surface);
  border-top: 1px solid var(--border);
}
.sketch-color {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer;
  flex-shrink: 0;
}
.sketch-color.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface); }
.sketch-size-btn {
  width: 32px; height: 32px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; font-size: .75rem; font-weight: 600;
  color: var(--text-dim);
}
.sketch-size-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Pending sketch previews */
.sketch-preview {
  display: flex; gap: 8px; padding: 8px 0; overflow-x: auto;
}
.sketch-preview-thumb {
  position: relative; width: 80px; height: 50px; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
  background: #fff;
}
.sketch-preview-thumb svg { width: 100%; height: 100%; }
.sketch-preview-remove {
  position: absolute; top: -4px; right: -4px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--error, #E53935); color: #fff;
  border: none; cursor: pointer; font-size: .7rem;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}

/* Rendered rich ideas */
.rich-idea-markdown { line-height: 1.6; }
.rich-idea-markdown h1, .rich-idea-markdown h2, .rich-idea-markdown h3 { font-size: 1.05em; margin: 6px 0 4px; }
.rich-idea-markdown p { margin: 4px 0; }
.rich-idea-markdown ul, .rich-idea-markdown ol { margin: 4px 0; padding-left: 20px; }
.rich-idea-markdown code { background: var(--surface2, #f0f0f0); padding: 1px 4px; border-radius: 3px; font-size: .9em; }
.rich-idea-markdown pre { background: var(--surface2, #f0f0f0); padding: 8px 12px; border-radius: 6px; overflow-x: auto; margin: 6px 0; }
.rich-idea-markdown blockquote { border-left: 3px solid var(--accent); padding-left: 12px; color: var(--text-dim); margin: 6px 0; }
.rich-idea-markdown a { color: var(--accent); }

.rich-idea-sketches { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.rich-idea-sketch-wrap { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: #fff; }
.rich-idea-sketch-thumb { display: block; }

/* Rich item indicator (in consuming tools like voting, ranking) */
.rich-item-badge { font-size: .8em; vertical-align: middle; }
.rich-item-more {
  background: none; border: 1px solid var(--accent); color: var(--accent);
  font-size: .75rem; padding: 1px 6px; border-radius: 4px; cursor: pointer;
  margin-left: 4px; vertical-align: middle; font-weight: 600;
}
.rich-item-more:hover { background: var(--accent); color: #fff; }

/* Rich item popup */
.rich-item-popup-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 500; display: flex; align-items: center; justify-content: center;
  padding: 24px; cursor: pointer;
}
.rich-item-popup {
  background: var(--surface, #fff); border-radius: 12px; padding: 24px;
  max-width: 600px; width: 100%; max-height: 85vh; overflow-y: auto;
  cursor: default; box-shadow: 0 8px 32px rgba(0,0,0,.2);
}

/* Fullsize sketch overlay */
.sketch-fullsize-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.85);
  z-index: 500; display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 24px;
}
.sketch-fullsize-inner {
  text-align: center; width: calc(100vw - 48px); max-width: 900px;
}
.sketch-fullsize-inner svg {
  background: #fff; border-radius: 12px;
  width: 100%; height: auto;
}
.sketch-fullsize-close { margin-top: 16px; color: #fff; }

@media (max-width: 600px) {
  .container { padding: 12px; }
  .event-session-header { margin: -12px; margin-bottom: 12px; }
  .brainstorm-input-area { padding: 12px 0; }
  .rich-brainstorm-input { padding: 8px 0; }
}
