:root { color-scheme: light; font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif; color: #4d3141; background: #fff7fa; }
* { box-sizing: border-box; }
body { margin: 0; }
header { max-width: 1400px; margin: auto; padding: 22px 28px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
h1 { font-size: clamp(17px, 2vw, 25px); margin: 4px 0; }
.eyebrow { font-size: 11px; letter-spacing: .22em; color: #ab486e; }
.badge { border: 1px solid #edbdd0; border-radius: 30px; padding: 8px 14px; white-space: nowrap; font-size: 12px; }
main { max-width: 1400px; margin: 0 auto; padding: 0 24px 24px; display: grid; grid-template-columns: 1.15fr 1fr; gap: 22px; height: max(620px, calc(100dvh - 110px)); }
.stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; border-radius: 26px; background: #f9e2ed; box-shadow: 0 12px 40px #95496912; }
canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; outline: none; }
.stage-caption { position: absolute; bottom: 8px; width: 100%; text-align: center; font-size: 13px; color: #fff; text-shadow: 0 1px 5px #503745; pointer-events: none; }
.loading { position: absolute; inset: 0; display: flex; gap: 18px; align-items: center; justify-content: center; flex-direction: column; background: #fff1f6; }
.loading[hidden] { display: none; }
progress { accent-color: #cb497e; width: 65%; }
.chat { background: white; border: 1px solid #f2dce6; border-radius: 26px; padding: 22px; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.toolbar, .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
h2 { font-size: 17px; margin: 0 auto 0 0; }
button { border: 1px solid #e8b7cd; border-radius: 12px; background: #fff5f9; color: #763d57; padding: 9px 12px; font: inherit; font-size: 13px; cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
button:hover:not(:disabled) { background: #ffe3ef; }
button:focus-visible, textarea:focus-visible { outline: 3px solid #db7ba3; outline-offset: 2px; }
#send { background: #bb3d73; color: white; min-width: 70px; }
#send:hover:not(:disabled) { background: #99305e; }
#messages { list-style: none; padding: 12px 0; margin: 10px 0 0; height: 300px; min-height: 180px; flex: 1; overflow-y: auto; overflow-wrap: anywhere; }
.message { border-radius: 16px; padding: 12px 15px; margin: 10px 25px 10px 0; background: #fff0f6; white-space: pre-wrap; line-height: 1.75; font-size: 14px; }
.message.user { margin: 10px 0 10px 25px; background: #eef2ff; }
.message b { display: block; font-size: 11px; color: #936a7e; margin-bottom: 4px; }
#status { min-height: 20px; font-size: 12px; color: #9b5676; margin: 4px 0; }
#error { color: #9e173b; border: 1px solid #f4b0c0; padding: 10px; border-radius: 10px; font-size: 13px; white-space: pre-wrap; }
label { display: block; font-size: 12px; margin: 8px 0; }
textarea { width: 100%; resize: vertical; border: 1px solid #eccbd9; border-radius: 12px; padding: 12px; color: inherit; background: #fffbfd; font: inherit; font-size: 16px; }
.actions { margin-top: 10px; }
.actions small { flex: 1; color: #8e7a85; font-size: 10px; }
.privacy { font-size: 10px; color: #927b87; line-height: 1.7; margin-bottom: 8px; }
details { font-size: 11px; color: #927b87; }
pre { overflow: auto; max-height: 150px; font-size: 11px; }
@media (max-width: 760px) {
  header { padding: 16px; } .badge { display: none; }
  main { grid-template-columns: 1fr; padding: 0 12px 20px; gap: 12px; height: auto; }
  .stage { min-height: 260px; height: 40svh; }
  .chat { padding: 16px; } #messages { height: 230px; flex: auto; }
}
