/* SpaceGram 3.1 package "collab": every selector starts with the package prefix. */

.co-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: var(--radius-md, 12px);
  background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
}
.co-btn:disabled { opacity: .6; cursor: default; }
.co-btn-primary { border-color: transparent; background: var(--accent); color: #fff; }
.co-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex: none;
  border: 0; border-radius: var(--radius-sm, 10px); background: transparent; color: var(--text); cursor: pointer;
}
.co-icon-btn:hover, .co-icon-btn.on { background: var(--hover); }
.co-icon-btn.on { color: var(--accent); }
.co-danger { color: var(--danger) !important; }
.co-note { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.co-input {
  width: 100%; box-sizing: border-box; min-height: 40px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-md, 12px);
  background: var(--input-bg, var(--surface-2)); color: var(--text); font: inherit;
}
.co-error { min-height: 18px; margin: 6px 0; color: var(--danger); font-size: 13px; }
.co-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.co-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.co-range { flex: 1; max-width: 220px; accent-color: var(--accent); }

/* ——— screen draw ——— */
.co-draw-layer { z-index: 4; }
.co-draw-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; touch-action: none; }
.co-draw-canvas.co-draw-active { pointer-events: auto; cursor: crosshair; }
.co-draw-bar {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px;
  max-width: calc(100% - 24px); padding: 6px 8px; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: var(--radius-lg, 18px);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
  pointer-events: auto;
}
@media (min-width: 900px) {
  .co-draw-bar { left: auto; right: 12px; top: 50%; bottom: auto; transform: translateY(-50%); flex-direction: column; flex-wrap: nowrap; max-height: calc(100% - 24px); overflow-y: auto; }
  .co-draw-bar .co-draw-group { flex-direction: column; }
}
.co-draw-group { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; }
.co-draw-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: 0; border-radius: var(--radius-sm, 9px);
  background: transparent; color: var(--text); cursor: pointer;
}
.co-draw-btn.on { background: var(--hover); color: var(--accent); }
.co-draw-color { width: 22px; height: 22px; margin: 5px 3px; padding: 0; border: 2px solid var(--border); border-radius: 50%; cursor: pointer; }
.co-draw-color.on { outline: 2px solid var(--accent); outline-offset: 2px; }
.co-draw-dot { display: block; border-radius: 50%; background: currentColor; }
.co-draw-shape { display: block; width: 14px; height: 11px; border: 2px solid currentColor; box-sizing: border-box; }
.co-draw-shape-ellipse { border-radius: 50%; }
.co-draw-select { max-width: 150px; min-height: 32px; border: 1px solid var(--border); border-radius: var(--radius-sm, 9px); background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; }
.co-draw-text { min-height: 32px; padding: 0 10px; border: 0; border-radius: var(--radius-sm, 9px); background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }

/* ——— soundboard and call-screen prompts ——— */
.co-sb-layer { z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 14px; box-sizing: border-box; }
.co-sb-notice, .co-sb-ask {
  max-width: calc(100% - 24px); box-sizing: border-box; padding: 8px 14px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); font-size: 14px;
}
.co-sb-ask { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; border-radius: var(--radius-lg, 18px); pointer-events: auto; }
.co-sb-ask .co-btn { min-height: 32px; }
.co-sb-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.co-sb-pad {
  min-height: 64px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-md, 14px);
  background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; overflow-wrap: anywhere;
}
.co-sb-pad:active { transform: scale(.97); }

/* ——— watch together ——— */
.co-watch-start { display: flex; flex-direction: column; gap: 8px; }
.co-watch { background: #000; color: #fff; }
.co-watch-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--surface); color: var(--text); }
.co-watch-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.co-watch-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.co-watch-video, .co-watch-yt { width: 100%; height: 100%; max-height: 100%; border: 0; background: #000; }
.co-watch-tap { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.co-watch-status { min-height: 0; padding: 0 12px; text-align: center; font-size: 14px; }
.co-watch-status:not(:empty) { padding: 10px 12px; }

/* ——— whiteboard ——— */
.co-board-new { width: 100%; margin-bottom: 12px; }
.co-board-row { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--border); }
.co-board-row .co-input { flex: 1; margin: 6px 0; }
.co-board-main { flex: 1; min-width: 0; padding: 10px 4px; border: 0; background: transparent; color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.co-board-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.co-board-meta { margin-top: 2px; color: var(--muted); font-size: 12px; }
.co-board-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface); }
.co-board-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.co-board-status { color: var(--muted); font-size: 12px; white-space: nowrap; }
.co-board-wrap { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #fbfbfa; }
.co-board-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.co-board-text { position: absolute; z-index: 2; width: min(260px, 70%); min-height: 32px; padding: 4px 8px; border: 1px solid #0091ff; border-radius: 6px; background: #fff; color: #1c2024; font: 16px system-ui, sans-serif; }
.co-board-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px;
  padding: 6px 8px; border-top: 1px solid var(--border); background: var(--surface);
}
.co-board-colors { display: flex; flex-wrap: wrap; justify-content: center; }
.co-board-T { font-weight: 700; font-size: 16px; }
.co-board-ro { padding: 0 8px; color: var(--muted); font-size: 13px; }
