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

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #1a1a2e;
  color: #e2e8f0;
  height: 100vh;
  overflow: hidden;
}

/* ════════════════════════════════════════════════
   GATE SCREEN
════════════════════════════════════════════════ */

#gate {
  position: fixed;
  inset: 0;
  background: #1a1a2e;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.gate-card {
  background: #13132a;
  border: 1px solid #2a2a50;
  border-radius: 14px;
  padding: 2rem 2.2rem 2.2rem;
  width: 100%;
  max-width: 430px;
  box-shadow: 0 24px 64px rgba(0,0,0,.7), 0 0 0 1px rgba(232,63,63,.12);
}

.gate-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: #F28C7D;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.gate-title {
  font-size: 1.55rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 0.2rem;
  letter-spacing: -0.02em;
}

.gate-sub {
  font-size: 0.88rem;
  color: #E83F3F;
  font-weight: 500;
  min-height: 1.2em;
  margin-bottom: 1.4rem;
}

/* Form fields */
.field-group {
  margin-bottom: 1.1rem;
}

.field-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #7c83a3;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.4rem;
}

.field-group input[type="text"],
.field-group input[type="email"],
.field-group input[type="password"],
.field-group input[type="url"] {
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: #0e0e22;
  border: 1px solid #2a2a50;
  border-radius: 7px;
  color: #e2e8f0;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  font-family: inherit;
}
.field-group input:focus {
  border-color: #E83F3F;
  box-shadow: 0 0 0 3px rgba(232,63,63,.15);
}
.field-group input::placeholder { color: #3d3d6b; }

.field-hint {
  font-size: 0.73rem;
  color: #3d3d6b;
  margin-top: 0.3rem;
}

.req      { color: #f87171; margin-left: 1px; }
.optional { font-weight: 400; color: #3d3d6b; text-transform: none; letter-spacing: 0; }

/* Role selector */
.role-options {
  display: flex;
  gap: 0.6rem;
}

.role-opt {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: #0e0e22;
  border: 1px solid #2a2a50;
  border-radius: 7px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
  color: #64748b;
  font-size: 0.88rem;
  user-select: none;
}
.role-opt input { display: none; }
.role-opt.active {
  border-color: #E83F3F;
  background: #2a1818;
  color: #e2e8f0;
}
.role-icon { font-size: 1rem; }

/* Gate error */
.gate-error {
  color: #f87171;
  font-size: 0.83rem;
  min-height: 1.2em;
  margin-bottom: 0.6rem;
  padding: 0.45rem 0.75rem;
  background: rgba(248,113,113,.08);
  border-radius: 6px;
  display: none;
}
.gate-error.visible { display: block; }

/* Primary button */
.btn-primary {
  width: 100%;
  padding: 0.78rem 1rem;
  background: #E83F3F;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.btn-primary:hover:not(:disabled) { background: #c92e2e; }
.btn-primary:active:not(:disabled) { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-danger {
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.78rem 1rem;
  background: transparent;
  color: #f87171;
  border: 2px solid #f87171;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.1s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.btn-danger:hover:not(:disabled) { background: #f87171; color: #fff; }
.btn-danger:active:not(:disabled) { transform: scale(0.98); }
.btn-danger:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-arrow { font-size: 1.1rem; }

/* ════════════════════════════════════════════════
   APP LAYOUT
════════════════════════════════════════════════ */

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ── Toolbar ─────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  height: 52px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
  z-index: 50;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

.company-logo {
  height: 26px;
  max-width: 120px;
  object-fit: contain;
  flex-shrink: 0;
  background: #ffffff;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

.toolbar-logo { font-size: 1.1rem; flex-shrink: 0; }

.board-topic {
  font-size: 0.92rem;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.toolbar-center {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.note-count-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: #888888;
  white-space: nowrap;
  padding: 0.25rem 0.6rem;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 0.2rem 0.4rem;
}

.zoom-btn {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 700;
  color: #555555;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.zoom-btn:hover { background: #e9eaec; color: #1a1a1a; }
.zoom-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.zoom-level {
  font-size: 0.75rem;
  font-weight: 600;
  color: #555555;
  min-width: 36px;
  text-align: center;
  user-select: none;
}

.color-picker {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 0.3rem 0.6rem;
}

.cp-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--c);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  outline: none;
}
.cp-btn:hover  { transform: scale(1.2); }
.cp-btn.active { border-color: #1a1a1a; transform: scale(1.15); }

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-tool {
  padding: 0.38rem 0.75rem;
  background: #f3f4f6;
  color: #555555;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  white-space: nowrap;
  font-family: inherit;
}
.btn-tool:hover { background: #e9eaec; color: #1a1a1a; }

.btn-add {
  padding: 0.38rem 0.9rem;
  background: #E83F3F;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s;
  font-family: inherit;
}
.btn-add:hover { background: #c92e2e; }

.user-chip {
  padding: 0.3rem 0.65rem;
  background: #fff1f0;
  border: 1px solid #fecaca;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #E83F3F;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-leave {
  padding: 0.35rem 0.65rem;
  background: transparent;
  color: #888888;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
  font-family: inherit;
}
.btn-leave:hover { color: #E83F3F; border-color: #E83F3F; }

/* ── Board & infinite canvas ─────────────────── */
.board {
  flex: 1;
  position: relative;
  overflow: hidden;
  background-color: #f0ece8;
  background-image: radial-gradient(circle, #d9d4cf 1px, transparent 1px);
  background-size: 26px 26px;
  cursor: grab;
}
.board.panning { cursor: grabbing; }

.canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  transform-origin: 0 0;
  /* transform: translate(panX, panY) set by JS */
}

/* ════════════════════════════════════════════════
   NOTE CARDS
════════════════════════════════════════════════ */

.note {
  position: absolute;
  width: 230px;
  border-radius: 5px;
  box-shadow: 3px 5px 18px rgba(0,0,0,.18), 0 1px 3px rgba(0,0,0,.12);
  display: flex;
  flex-direction: column;
  user-select: none;
  transition: box-shadow 0.15s;
}
.note:hover   { box-shadow: 4px 7px 24px rgba(0,0,0,.26); }
.note.dragging {
  box-shadow: 8px 12px 32px rgba(0,0,0,.32);
  opacity: 0.93;
}

/* Colour themes */
.note[data-color="yellow"] { background: #fef9c3; }
.note[data-color="pink"]   { background: #ffe4e6; }
.note[data-color="blue"]   { background: #dbeafe; }
.note[data-color="green"]  { background: #dcfce7; }
.note[data-color="mint"]   { background: #ccfbf1; }

/* Note header strip (slightly darker) */
.note[data-color="yellow"] .note-header { background: #fde047; }
.note[data-color="pink"]   .note-header { background: #fda4af; }
.note[data-color="blue"]   .note-header { background: #93c5fd; }
.note[data-color="green"]  .note-header { background: #86efac; }
.note[data-color="mint"]   .note-header { background: #5eead4; }

.note-header {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.4rem;
  border-radius: 5px 5px 0 0;
  border-bottom: 1px solid rgba(0,0,0,.12);
}

.note-drag-handle {
  cursor: grab;
  font-size: 1rem;
  color: rgba(0,0,0,.4);
  flex-shrink: 0;
  line-height: 1;
  padding: 0 2px;
}
.note-drag-handle:active { cursor: grabbing; }

.note-author {
  flex: 1;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(0,0,0,.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-controls {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

/* Vote button */
.btn-vote {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 1px 6px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.2);
  background: rgba(255,255,255,.45);
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(0,0,0,.55);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: inherit;
  line-height: 1.4;
}
.btn-vote:hover:not(:disabled):not(.vote-own) {
  background: #E83F3F;
  color: #fff;
  border-color: #E83F3F;
}
.btn-vote.voted {
  background: #E83F3F;
  color: #fff;
  border-color: #E83F3F;
}
.btn-vote.voted:hover {
  background: #c92e2e;
}
.btn-vote.vote-own {
  opacity: 0.35;
  cursor: not-allowed;
}
.vote-count { min-width: 10px; text-align: center; }

/* Delete button */
.btn-delete {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: rgba(0,0,0,.35);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.15s, color 0.15s;
  padding: 0;
  font-family: inherit;
}
.btn-delete:hover {
  background: rgba(232,63,63,.15);
  color: #E83F3F;
}

/* Note textarea */
.note-body {
  flex: 1;
  min-height: 110px;
  padding: 0.6rem 0.7rem;
  border: none;
  background: transparent;
  resize: none;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #1e1b4b;
  outline: none;
  border-radius: 0 0 5px 5px;
}
.note-body::placeholder { color: rgba(0,0,0,.3); }
.note-body[readonly]    { cursor: default; }

/* ════════════════════════════════════════════════
   MODALS
════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  backdrop-filter: blur(2px);
}

.modal {
  background: #13132a;
  border: 1px solid #2a2a50;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  box-shadow: 0 24px 64px rgba(0,0,0,.8);
  width: 100%;
}

.modal-wide { max-width: 760px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid #1e1e40;
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e2e8f0;
}

.modal-x {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 1.3rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.modal-x:hover { background: #1e1e40; color: #e2e8f0; }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.2rem;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.85rem 1.2rem;
  border-top: 1px solid #1e1e40;
  flex-shrink: 0;
}

.btn-copy {
  padding: 0.45rem 1rem;
  background: #1a1a3a;
  color: #F28C7D;
  border: 1px solid #2a2a50;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  font-family: inherit;
}
.btn-copy:hover    { background: #E83F3F; color: #fff; border-color: #E83F3F; }
.btn-copy.copied   { background: #16a34a; color: #fff; border-color: #16a34a; }

.btn-secondary {
  padding: 0.45rem 1rem;
  background: transparent;
  color: #64748b;
  border: 1px solid #2a2a50;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
  font-family: inherit;
}
.btn-secondary:hover { color: #e2e8f0; border-color: #64748b; }

.export-topic {
  font-size: 0.88rem;
  color: #F28C7D;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

/* ── Data tables (participants & export) ─────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #475569;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #1e1e40;
  white-space: nowrap;
}

.data-table td {
  padding: 0.55rem 0.6rem;
  color: #cbd5e1;
  border-bottom: 1px solid #1a1a35;
  vertical-align: top;
}

.data-table tbody tr:hover td { background: #16162e; }

.data-table .num { text-align: right; }
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; color: #F28C7D; font-weight: 600; }

/* Submission time column in export */
.export-time {
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: #94a3b8;
  white-space: nowrap;
}

/* Vote badge in export */
.vote-badge {
  display: inline-block;
  padding: 1px 8px;
  background: #E83F3F;
  color: #fff;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
}

/* Scrollbar styling for modal body */
.modal-body::-webkit-scrollbar        { width: 6px; }
.modal-body::-webkit-scrollbar-track  { background: transparent; }
.modal-body::-webkit-scrollbar-thumb  { background: #2a2a50; border-radius: 3px; }

/* ════════════════════════════════════════════════
   EMBED MODAL
════════════════════════════════════════════════ */

.modal-embed { max-width: 560px; }

.embed-options {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 1.1rem;
}

.embed-option-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.embed-option-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #7c83a3;
  width: 48px;
  flex-shrink: 0;
}

.embed-option-btns {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.embed-opt-btn {
  padding: 0.3rem 0.75rem;
  background: #0e0e22;
  color: #94a3b8;
  border: 1px solid #2a2a50;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: inherit;
}
.embed-opt-btn:hover  { background: #1a1a3a; color: #e2e8f0; }
.embed-opt-btn.active { background: #E83F3F; color: #fff; border-color: #E83F3F; }

.embed-code {
  background: #0e0e22;
  border: 1px solid #2a2a50;
  border-radius: 8px;
  padding: 1rem 1.1rem;
  font-family: 'Consolas', 'Fira Code', monospace;
  font-size: 0.82rem;
  line-height: 1.65;
  color: #a5b4fc;
  white-space: pre;
  overflow-x: auto;
  user-select: all;
}

/* ════════════════════════════════════════════════
   TEXT TOOL — toolbar button & size toggle
════════════════════════════════════════════════ */

.btn-text-tool {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.65rem;
  background: #f3f4f6;
  color: #555555;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  font-family: inherit;
  white-space: nowrap;
}
.btn-text-tool:hover  { background: #e9eaec; color: #1a1a1a; }
.btn-text-tool.active {
  background: #E83F3F;
  color: #fff;
  border-color: #E83F3F;
}

.text-size-toggle {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 0.2rem 0.35rem;
}

.tsz-btn {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 11px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #555;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.tsz-btn:hover  { background: #e9eaec; color: #1a1a1a; }
.tsz-btn.active { background: #E83F3F; color: #fff; }

/* ════════════════════════════════════════════════
   CANVAS LABEL ELEMENTS (host text tool)
════════════════════════════════════════════════ */

/* Board cursor in text mode */
.board.text-mode { cursor: crosshair; }

.label-el {
  position: absolute;
  user-select: none;
  /* Expand to content width so text flows naturally; Enter still line-breaks */
  width: max-content;
  min-width: 200px;
  max-width: 600px;
  /* locked by default — mouse events pass through so pan still works */
  pointer-events: none;
}

/* Enable interaction only when host has text mode active */
.board.text-mode .label-el {
  pointer-events: auto;
  cursor: grab;
}
.board.text-mode .label-el:active { cursor: grabbing; }
.board.text-mode .label-el.dragging { cursor: grabbing; }

.label-text {
  font-family: 'Caveat', cursive;
  font-size: inherit;
  font-weight: 700;
  line-height: 1.15;
  white-space: pre-wrap;
  word-break: break-word;
  outline: none;
  display: block;
  width: 100%;
  padding: 0 3px;
}

/* Text cursor while editing */
.board.text-mode .label-text[contenteditable="true"] { cursor: text; }

/* Colour variants — darker shades for legibility on the canvas */
.label-el[data-color="yellow"] .label-text { color: #a16207; }
.label-el[data-color="pink"]   .label-text { color: #be185d; }
.label-el[data-color="blue"]   .label-text { color: #1d4ed8; }
.label-el[data-color="green"]  .label-text { color: #15803d; }
.label-el[data-color="mint"]   .label-text { color: #0f766e; }

/* Resize handle — thin dashed strip below text, shown on hover */
.label-resize-handle {
  height: 6px;
  width: 48px;
  margin: 3px auto 0;
  border-top: 2px dashed rgba(0,0,0,.25);
  cursor: ns-resize;
  opacity: 0;
  transition: opacity 0.15s;
}
.label-el:hover .label-resize-handle { opacity: 1; }

/* Delete button — top-right corner, shown on hover */
.label-delete {
  position: absolute;
  top: -9px;
  right: -9px;
  width: 20px;
  height: 20px;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: inherit;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}
.label-delete:hover { background: #b91c1c; }
.label-el:hover .label-delete { opacity: 1; }

/* ════════════════════════════════════════════════
   WELCOME TOOLTIP  (participants only)
════════════════════════════════════════════════ */

.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none; /* overlay itself is click-through */
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1.5rem;
}

.welcome-card {
  pointer-events: auto;
  background: #13132a;
  border: 1px solid #2a2a50;
  border-radius: 14px;
  padding: 1.5rem 1.8rem 1.6rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,.7), 0 0 0 1px rgba(232,63,63,.12);
  animation: welcomeSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

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

.welcome-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.welcome-icon { font-size: 1.4rem; }

.welcome-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.01em;
}

.welcome-sub {
  font-size: 0.83rem;
  color: #F28C7D;
  font-weight: 500;
  margin-bottom: 0.9rem;
}

.welcome-tips {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1.2rem;
}

.welcome-tips li {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.4;
}

.tip-icon {
  font-size: 0.95rem;
  flex-shrink: 0;
}

.welcome-tips strong { color: #e2e8f0; font-weight: 700; }

.btn-welcome-dismiss {
  width: 100%;
  padding: 0.65rem 1rem;
  background: #E83F3F;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-family: inherit;
}
.btn-welcome-dismiss:hover  { background: #c92e2e; }
.btn-welcome-dismiss:active { transform: scale(0.98); }

/* ════════════════════════════════════════════════
   DRAW TOOL — toolbar button & line-width toggle
════════════════════════════════════════════════ */

.btn-draw-tool {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.65rem;
  background: #f3f4f6;
  color: #555555;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  font-family: inherit;
  white-space: nowrap;
}
.btn-draw-tool:hover  { background: #e9eaec; color: #1a1a1a; }
.btn-draw-tool.active {
  background: #E83F3F;
  color: #fff;
  border-color: #E83F3F;
}

.line-width-toggle {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 0.2rem 0.35rem;
}

/* Three dot buttons — size of the ● scales to represent stroke width */
.lw-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 13px;
  color: #555;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
  line-height: 1;
  padding: 0;
}
.lw-btn:hover  { background: #e9eaec; color: #1a1a1a; }
.lw-btn.active { background: #E83F3F; color: #fff; }

.lw-btn[data-width="2"] { font-size: 0.45rem; }
.lw-btn[data-width="4"] { font-size: 0.75rem; }
.lw-btn[data-width="8"] { font-size: 1.15rem; }

/* ════════════════════════════════════════════════
   DRAW MODE CURSORS
════════════════════════════════════════════════ */

.board.draw-mode            { cursor: crosshair; }
.board.draw-mode.near-stroke { cursor: pointer; }   /* hover over a stroke = click to delete */

/* ════════════════════════════════════════════════
   MODERATION — setup toggle switch
════════════════════════════════════════════════ */

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.toggle-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.toggle-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a1a1a;
}

.toggle-hint {
  font-size: 0.78rem;
  color: #6b7280;
  line-height: 1.35;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-track::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  top: 3px;
  left: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-track {
  background: #E83F3F;
}

.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(20px);
}

/* ════════════════════════════════════════════════
   MODERATION — queue badge on toolbar button
════════════════════════════════════════════════ */

.queue-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  margin-left: 5px;
  background: #E83F3F;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 999px;
  line-height: 1;
}

/* ════════════════════════════════════════════════
   MODERATION — pending label on participant's own note
════════════════════════════════════════════════ */

.note-pending-label {
  display: block;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  border-top: 1px solid #fde68a;
  border-radius: 0 0 6px 6px;
  padding: 0.25rem 0.5rem;
  margin-top: 0.25rem;
  letter-spacing: 0.01em;
}

/* ════════════════════════════════════════════════
   MODERATION QUEUE MODAL
════════════════════════════════════════════════ */

.modal-queue {
  width: min(820px, 96vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

/* The body grows and clips; children manage their own scroll */
.modal-queue .modal-body {
  flex: 1;
  overflow: hidden;
  padding: 0;
}

.queue-modal-empty {
  text-align: center;
  color: #6b7280;
  padding: 2.5rem 1rem;
  font-size: 0.9rem;
}

/* Two-column layout */
.queue-layout {
  display: flex;
  height: 100%;
  min-height: 360px;
}

/* ── Left: scrollable note list ── */
.queue-list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 260px;
  flex-shrink: 0;
  overflow-y: auto;
  border-right: 1px solid #e5e7eb;
  background: #f9fafb;
}

.queue-list-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #f0f1f3;
  cursor: pointer;
  transition: background 0.12s;
}
.queue-list-item:hover   { background: #f0f1f3; }
.queue-list-item.active  {
  background: #fff0f0;
  border-left: 3px solid #E83F3F;
  padding-left: calc(0.75rem - 3px);
}

.qli-author {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qli-preview {
  font-size: 0.75rem;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qli-preview em { font-style: italic; color: #9ca3af; }

.qli-age {
  font-size: 0.68rem;
  color: #9ca3af;
}

/* ── Right: note detail pane ── */
.queue-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.queue-note-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.75rem 1rem 0.6rem;
  border-bottom: 1px solid #1e1e40;
  background: #1a1a38;
  flex-shrink: 0;
}

.queue-note-author {
  font-size: 0.9rem;
  font-weight: 700;
  color: #e2e8f0;
}

.queue-note-company {
  font-size: 0.8rem;
  color: #94a3b8;
}

.queue-note-text {
  flex: 1;
  padding: 1rem;
  font-size: 0.92rem;
  color: #f0f0f0;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-y: auto;
}

/* ── Footer buttons ── */
.btn-queue-reject,
.btn-queue-skip,
.btn-queue-approve {
  padding: 0.5rem 1.1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-queue-reject {
  background: #fee2e2;
  color: #b91c1c;
}
.btn-queue-reject:hover { background: #fecaca; }

.btn-queue-skip {
  background: #f3f4f6;
  color: #374151;
  margin-left: auto;
}
.btn-queue-skip:hover { background: #e5e7eb; }

.btn-queue-approve {
  background: #E83F3F;
  color: #fff;
}
.btn-queue-approve:hover { background: #c93232; }
