:root {
  --bg: #f6f6f4;
  --panel: #ffffff;
  --line: #e4e4e0;
  --text: #1d1d1b;
  --muted: #6b6b66;
  --accent: #2f6fde;
  --danger: #c4372f;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; height: 100vh; display: flex; background: var(--bg); }

.screen { flex: 1; min-width: 0; position: relative; background: #111; }
.screen iframe { width: 100%; height: 100%; border: 0; display: block; }
/* 화면 우상단은 Chrome 창 버튼 자리라 피해서 우하단에 둔다 */
.open-panel { position: absolute; right: 16px; bottom: 16px; border-radius: 999px; padding: 8px 16px; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.open-panel.busy { background: #fff; color: var(--accent); }
body.panel-closed .panel { display: none; }

.panel { width: 380px; display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line); }
.panel header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.panel header .icon { margin-left: auto; }
.sessionbar { display: flex; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.sessionbar select { font: inherit; font-size: 13px; padding: 3px 6px; }
.sessionbar #session { flex: 1; min-width: 0; }
.status { font-size: 12px; color: var(--muted); }
.status.busy { color: var(--accent); }

.log { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 14px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.5; }
.msg { padding: 8px 11px; border-radius: 10px; white-space: pre-wrap; word-break: break-word; max-width: 92%; }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; }
.msg.user::after { content: attr(data-label); display: block; font-size: 11px; opacity: .7; text-align: right; }
.msg.agent { align-self: flex-start; background: #f0f0ec; }
.tool { font: 12px/1.4 ui-monospace, Menlo, monospace; color: var(--muted); word-break: break-all; }
.thinking { font-size: 12px; color: var(--muted); }
.thinking summary { cursor: pointer; }
.thinking p { margin: 4px 0 0; white-space: pre-wrap; }
.sys { align-self: center; font-size: 12px; color: var(--muted); }
.error { color: var(--danger); }

.composer { border-top: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.composer textarea { font: inherit; font-size: 14px; resize: none; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; }
button { font: inherit; font-size: 13px; padding: 6px 14px; border-radius: 7px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button.secondary { background: #fff; color: var(--danger); border-color: var(--danger); }
button.plain { background: #fff; color: var(--accent); }
button.icon { background: none; border: 0; color: var(--muted); padding: 2px 6px; font-size: 15px; }
button.icon:hover { color: var(--text); }

/* 로그인 */
body.login-page { align-items: center; justify-content: center; }
.login { display: flex; flex-direction: column; gap: 10px; width: 280px; padding: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.login p { margin: 0; font-size: 13px; color: var(--muted); }
.login input[type=password] { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
