:root {
  color-scheme: light;
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, sans-serif;
  color: #202124;
  background: #f5f6f7;
  letter-spacing: 0;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input { font: inherit; letter-spacing: 0; }

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 24px;
  color: white;
  background: #1f2933;
  border-bottom: 3px solid #19a974;
}

h1 { margin: 0; font-size: 20px; font-weight: 700; }
.topbar p { margin: 4px 0 0; color: #cfd8df; font-size: 12px; }
.call-actions { display: flex; gap: 8px; }
button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #c7cdd2;
  border-radius: 6px;
  color: #263238;
  background: #fff;
  cursor: pointer;
}
button:hover:not(:disabled) { border-color: #65737e; background: #f4f6f7; }
button:disabled { opacity: .45; cursor: default; }
button.primary { color: white; border-color: #0b815a; background: #0b815a; }
button.primary:hover:not(:disabled) { background: #086847; }

main { padding: 16px 20px 20px; }
.status-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(115px, 1fr));
  border: 1px solid #d9dde1;
  border-radius: 6px;
  background: white;
  overflow: hidden;
}
.status-item {
  min-height: 58px;
  padding: 10px 14px;
  border-right: 1px solid #e4e7e9;
}
.status-item:last-child { border-right: 0; }
.status-item span { display: block; margin-bottom: 4px; color: #68737d; font-size: 11px; }
.status-item b { font-size: 13px; font-weight: 650; }
[data-state="ok"] { color: #08734f; }
[data-state="busy"] { color: #9a6200; }
[data-state="error"] { color: #b3261e; }
[data-state="idle"] { color: #68737d; }

.workspace {
  display: grid;
  grid-template-columns: minmax(420px, 1.08fr) minmax(420px, .92fr);
  gap: 14px;
  margin-top: 14px;
  height: calc(100vh - 176px);
  min-height: 520px;
}
.conversation-panel, .event-panel {
  display: grid;
  min-height: 0;
  border: 1px solid #d9dde1;
  border-radius: 6px;
  background: white;
  overflow: hidden;
}
.conversation-panel { grid-template-rows: 48px 1fr auto 58px; }
.event-panel { grid-template-rows: 48px 1fr; }
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid #e3e6e8;
  background: #fafbfb;
}
.panel-heading h2 { margin: 0; font-size: 14px; }
.panel-heading span { color: #52616c; font: 12px ui-monospace, monospace; }
.icon-button { width: 30px; min-height: 30px; padding: 0; font-size: 20px; line-height: 1; }

.transcript { overflow-y: auto; padding: 18px; scroll-behavior: smooth; }
.empty-state { padding-top: 90px; text-align: center; color: #8a949c; font-size: 13px; }
.turn { max-width: 86%; margin-bottom: 14px; }
.turn.user { margin-left: auto; }
.turn .role { margin-bottom: 4px; color: #68737d; font-size: 11px; }
.turn.user .role { text-align: right; }
.turn .bubble {
  padding: 10px 12px;
  border: 1px solid #d9dde1;
  border-radius: 6px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f7f8f9;
}
.turn.user .bubble { border-color: #a8d8c6; background: #edf8f4; }
.turn.filler .bubble { color: #65737e; border-style: dashed; background: #fff; }
.partial { padding: 8px 18px; color: #68737d; border-top: 1px solid #edf0f2; font-size: 13px; }
.text-turn { display: grid; grid-template-columns: 1fr 72px; gap: 8px; padding: 10px 12px; border-top: 1px solid #e3e6e8; }
.text-turn input { min-width: 0; padding: 0 11px; border: 1px solid #c7cdd2; border-radius: 5px; outline: none; }
.text-turn input:focus { border-color: #0b815a; box-shadow: 0 0 0 2px #d9f2e9; }

.event-log { overflow-y: auto; font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.event-row { display: grid; grid-template-columns: 76px 1fr; gap: 8px; padding: 7px 12px; border-bottom: 1px solid #edf0f2; }
.event-row:hover { background: #fafbfb; }
.event-time { color: #8a949c; }
.event-body { min-width: 0; overflow-wrap: anywhere; }
.event-name { color: #1d5f8a; font-weight: 700; }
.event-detail { color: #4c5963; }
.event-row.error .event-name { color: #b3261e; }
.event-row.rag .event-name { color: #6b4f9a; }
.event-row.guardrail .event-name { color: #a15c00; }

@media (max-width: 980px) {
  .status-strip { grid-template-columns: repeat(3, 1fr); }
  .status-item:nth-child(3) { border-right: 0; }
  .status-item:nth-child(-n+3) { border-bottom: 1px solid #e4e7e9; }
  .workspace { grid-template-columns: 1fr; height: auto; }
  .conversation-panel, .event-panel { height: 620px; }
}

@media (max-width: 560px) {
  .topbar { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; }
  .topbar h1 { font-size: 16px; }
  .call-actions { width: 100%; }
  .call-actions button { flex: 1; white-space: nowrap; }
  main { padding: 10px; }
  .status-strip { grid-template-columns: repeat(2, 1fr); }
  .status-item { border-bottom: 1px solid #e4e7e9; }
  .workspace { min-height: 0; }
  .conversation-panel, .event-panel { height: 560px; }
}
