* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif; }
body { display: flex; background: #0f1220; color: #e8eaf2; }

#stage { flex: 1; position: relative; }
#scene { width: 100%; height: 100%; display: block; }

#panel {
  width: 340px; padding: 16px; display: flex; flex-direction: column; gap: 12px;
  background: #171a2b; border-left: 1px solid #2a2f4a; overflow: hidden;
}
.panel-scroll {
  flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
}
h1 { font-size: 18px; }
.synthetic {
  font-size: 11px; color: #f0b35b; letter-spacing: 0.02em;
  border-left: 3px solid #f0b35b; padding-left: 8px; line-height: 1.4;
}
.hint { font-size: 12px; color: #9aa1c0; line-height: 1.5; }

.ledger {
  border: 1px solid #2a2f4a; border-radius: 10px; padding: 10px;
  background: #0f1220; display: flex; flex-direction: column; gap: 6px;
}
.ledger-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ledger-head strong { font-size: 12px; color: #cdd3ff; }
.ledger pre {
  margin: 0; min-height: 54px; max-height: 130px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-word; font-size: 11px; line-height: 1.45;
  color: #9aa1c0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ledger.paused { border-color: #f0b35b; }
.ledger.paused pre { color: #f0b35b; }

.row { display: flex; gap: 8px; }
button {
  flex: 1; padding: 8px 10px; border: none; border-radius: 8px; cursor: pointer;
  background: #4650ff; color: #fff; font-size: 13px;
}
button:hover { background: #5a63ff; }
button.active { background: #2bb673; }
button.mini { flex: 0 0 auto; padding: 8px 12px; }
input[type="password"] {
  flex: 1; padding: 8px 10px; border-radius: 8px; border: 1px solid #2a2f4a;
  background: #0f1220; color: #e8eaf2; font-size: 12px;
}
select {
  flex: 0 0 auto; padding: 8px 6px; border-radius: 8px; border: 1px solid #2a2f4a;
  background: #0f1220; color: #e8eaf2; font-size: 12px;
}

.status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #9aa1c0; flex-wrap: wrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #555; display: inline-block; margin-left: 8px; }
.dot.on { background: #2bb673; }
.badge { margin-left: auto; padding: 2px 10px; border-radius: 999px; background: #2a2f4a; font-size: 12px; }

#camPreview { width: 100%; border-radius: 10px; background: #000; aspect-ratio: 4/3; object-fit: cover; }
.hidden { display: none; }

#log { display: flex; flex-direction: column; gap: 6px; font-size: 12px; flex: 0 0 auto; min-height: 96px; max-height: 32vh; overflow-y: auto; }
#log p { background: #0f1220; border-radius: 8px; padding: 8px 10px; line-height: 1.4; white-space: pre-wrap; }
#log p .emo { color: #8f9bff; margin-right: 6px; font-weight: 600; }
#log p.thinking { color: #6a7190; }
#log p.user { background: #4650ff; color: #fff; align-self: flex-end; max-width: 85%; }
#log p.user .emo { color: #cdd3ff; }

.chat { display: flex; gap: 8px; }
.chat input {
  flex: 1; padding: 8px 10px; border-radius: 8px; border: 1px solid #2a2f4a;
  background: #0f1220; color: #e8eaf2; font-size: 13px;
}
.chat input:focus { outline: none; border-color: #4650ff; }

.voice { font-size: 11px; color: #6a7190; }

.chat button { flex: 0 0 auto; }
.chat button.recording { background: #e5484d; }

.voice-box {
  border: 1px solid #2a2f4a; border-radius: 10px; padding: 10px;
  background: #12162a; display: flex; flex-direction: column; gap: 8px;
}
.voice-box summary { cursor: pointer; font-size: 12px; color: #cdd3ff; }
.voice-box input[type="file"] { font-size: 11px; color: #9aa1c0; }
.voice-box input[type="text"], .voice-box textarea, .voice-box select {
  width: 100%; padding: 7px 8px; border-radius: 8px; border: 1px solid #2a2f4a;
  background: #0f1220; color: #e8eaf2; font-size: 12px; font-family: inherit;
}
.voice-box textarea { resize: vertical; min-height: 48px; }
