/* 클라우드 브라우저(static/js/sandbox_browser.js) — 홈·대화 오른쪽 칸의 원격 크롬 창(탭·주소창째 영상). 색은 있는 토큰만 쓴다(다크 모드). */

.summet-workspace-preview__browser {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.summet-workspace-preview__browser[hidden] {
  display: none;
}

.sbx {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 10px;
  padding: 12px 12px 10px;
  background: var(--surface-color);
}

/* 크롬 창 — 각진 테두리 한 줄. 크기가 곧 원격 창의 크기다(ResizeObserver → browser:resize). */
.sbx-frame {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  outline: none;
}

.sbx-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: default;
}

/* 글자 받기 — 보이지 않지만 포커스를 받아 한글 조합(IME)이 된다. 화면 밖으로 빼면 일부 브라우저가 조합 창을 엉뚱한 데 띄운다. */
.sbx-keys {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  resize: none;
  pointer-events: none;
}

.sbx-status {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  background: var(--bg-color);
  color: var(--text-muted);
  text-align: center;
  font-size: 14px;
}

.sbx-status[hidden] {
  display: none;
}

.sbx-status-text {
  margin: 0;
  max-width: 320px;
  line-height: 1.6;
}

.sbx-reopen {
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--surface-color);
  color: var(--text-color);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.sbx-reopen[hidden] {
  display: none;
}

/* 아래 알약 — 지금 이 창을 사람이 직접 다루고 있다는 표시. 숨겨도 자리는 둔다(창 크기가 바뀌면 원격 창도 다시 맞춘다). */
.sbx-control {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 14px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sbx-control::before {
  content: '';
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
}

.sbx-control[hidden] {
  display: inline-flex;
  visibility: hidden;
}

/* 에이전트가 쥐었을 때 — 파란 점이 숨 쉬고, 오른쪽에 [직접 조작하기]. */
.sbx-control--agent {
  padding-right: 4px;
}

.sbx-control--agent::before {
  background: #0082ff;
  animation: sbx-breathe 1.4s ease-in-out infinite;
}

@keyframes sbx-breathe {
  50% { opacity: 0.35; }
}

.sbx-take-control {
  height: 22px;
  margin-left: 2px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: var(--text-color);
  color: var(--bg-color);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.sbx-take-control[hidden] {
  display: none;
}

/* 에이전트의 커서 — 원격 화면은 커서를 그리지 않는다. 누를 곳으로 미끄러져 가고, 누르면 번진다. */
.sbx-pointer {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  width: 22px;
  height: 22px;
  margin: -2px 0 0 -4px; /* 화살 끝이 그 점에 오게 */
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.sbx-pointer[hidden] {
  display: none;
}

.sbx-pointer::after {
  content: '';
  position: absolute;
  left: -5px;
  top: -7px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 130, 255, 0.35);
  opacity: 0;
  transform: scale(0.4);
}

.sbx-pointer--click::after {
  animation: sbx-click 0.45s ease-out;
}

@keyframes sbx-click {
  from { opacity: 1; transform: scale(0.4); }
  to { opacity: 0; transform: scale(2); }
}
