* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Segoe UI', Tahoma, Arial, sans-serif; background: #10141c; color: #e8ecf4; }
.hidden { display: none !important; }

/* Login */
.login-overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 30%, #1d2635, #0b0e14); z-index: 50; }
.login-card { background: #171d29; border: 1px solid #2a3547; border-radius: 16px; padding: 32px; width: 320px; display: flex; flex-direction: column; gap: 12px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.login-card h1 { font-size: 20px; }
.login-card p { color: #8b96ab; font-size: 13px; }
.login-card select, .login-card input { padding: 10px 12px; border-radius: 8px; border: 1px solid #2a3547; background: #0f141d; color: #e8ecf4; font-size: 15px; }
.login-card button { padding: 11px; border: 0; border-radius: 8px; background: #3b82f6; color: #fff; font-size: 15px; cursor: pointer; }
.login-card button:hover { background: #2563eb; }
.login-error { color: #f87171; font-size: 13px; min-height: 16px; }

/* Layout */
.app { height: 100vh; display: flex; flex-direction: column; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; background: #171d29; border-bottom: 1px solid #2a3547; }
.brand { font-weight: 700; font-size: 15px; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.badge { font-size: 12px; color: #9fb0c8; background: #0f141d; border: 1px solid #2a3547; padding: 4px 10px; border-radius: 20px; }
.badge.me { color: #7dd3fc; }
.toggle { padding: 6px 14px; border-radius: 20px; border: 1px solid #2a3547; background: #0f141d; color: #c6d2e4; cursor: pointer; font-size: 13px; }
.toggle.active { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.main { flex: 1; display: flex; min-height: 0; position: relative; }
.canvas-wrap { flex: 1; min-width: 0; position: relative; }
#office { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }

/* Chat panel */
.chat-panel { width: 340px; max-width: 90vw; background: #171d29; border-right: 1px solid #2a3547; display: flex; flex-direction: column; }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid #2a3547; }
.chat-name { font-weight: 700; font-size: 16px; }
.chat-title { color: #8b96ab; font-size: 12px; }
.close { background: none; border: 0; color: #8b96ab; font-size: 18px; cursor: pointer; }
.chat-activity { padding: 6px 14px; font-size: 12px; color: #86efac; border-bottom: 1px solid #232d3d; }
.chat-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 85%; padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; }
.msg.user { align-self: flex-start; background: #3b82f6; color: #fff; border-bottom-left-radius: 4px; }
.msg.agent { align-self: flex-end; background: #232d3d; border-bottom-right-radius: 4px; }
.msg.typing { color: #8b96ab; font-style: italic; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #2a3547; }
.chat-form input { flex: 1; padding: 10px 12px; border-radius: 20px; border: 1px solid #2a3547; background: #0f141d; color: #e8ecf4; font-size: 14px; }
.chat-form button { padding: 10px 16px; border: 0; border-radius: 20px; background: #3b82f6; color: #fff; cursor: pointer; }
.voice { margin: 0 10px 10px; padding: 8px; border-radius: 20px; border: 1px dashed #2a3547; background: none; color: #5b6880; font-size: 13px; }
.goals-box { border-top: 1px solid #2a3547; padding: 8px 12px; font-size: 13px; }
.goals-box summary { cursor: pointer; color: #fbbf24; padding: 4px 0; }
.goals-box ul { list-style: none; padding: 8px 0; display: flex; flex-direction: column; gap: 6px; }
.goals-box li { background: #0f141d; border: 1px solid #232d3d; border-radius: 8px; padding: 7px 10px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.goals-box li button { background: none; border: 0; color: #f87171; cursor: pointer; font-size: 14px; }
.goal-form { display: flex; gap: 6px; }
.goal-form input { flex: 1; padding: 8px 10px; border-radius: 8px; border: 1px solid #2a3547; background: #0f141d; color: #e8ecf4; font-size: 13px; }
.goal-form button { padding: 8px 12px; border: 0; border-radius: 8px; background: #16a34a; color: #fff; cursor: pointer; }

@media (max-width: 700px) {
  .chat-panel { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; z-index: 10; box-shadow: 0 0 40px rgba(0,0,0,.6); }
}

/* Warm architectural palette */
#canvasWrap, .canvas-wrap, body { background: #f8f6f1; }
.topbar { background:#f1ede5; color:#3f5157; border-bottom:1px solid #d8d0c4; }
.topbar h1 {color:#35585f;}

.scene-labels { position:absolute; inset:0; pointer-events:none; overflow:hidden; }
.person-label {position:absolute;top:0;left:0;pointer-events:auto;cursor:pointer;font-size:11px;font-weight:600;color:#263d43;background:rgba(255,253,247,.9);border:1px solid rgba(100,110,106,.2);border-radius:16px;padding:3px 9px;white-space:nowrap;box-shadow:0 2px 8px #00000012;}
.person-label.selected{border-color:#987c50;background:#fff5dd;}
.speech-label{max-width:240px;white-space:normal;font-weight:400;border-radius:10px;font-size:13px;line-height:1.6;}
.floor-label {position:absolute;top:0;left:0;font-size:10px;letter-spacing:.5px;color:#536268;background:#f9f6edd9;padding:3px 8px;border-radius:4px;white-space:nowrap;}
.scene-status{position:absolute;bottom:12px;right:14px;background:#fffdf4e0;color:#53605d;border-radius:20px;padding:7px 14px;font-size:11px;pointer-events:none;}
.scene-status.quiet{opacity:.65;}
#floorSelect,#qualitySelect{background:#f5f0e7;border:1px solid #cfc6b9;color:#495b60;padding:6px;border-radius:16px;font-family:inherit;}
@media(max-width:700px){.topbar{flex-wrap:wrap;gap:5px}.top-actions{gap:4px;flex-wrap:wrap}.toggle{font-size:11px;padding:5px 8px}.brand{font-size:12px}.person-label{font-size:10px}.floor-label{display:none!important;}}

.person-label{white-space:pre-line;text-align:center;line-height:1.4;font-size:11px;max-width:210px;}

#viewGames{border:0;border-radius:22px;padding:9px 14px;background:#164f48;color:#fff;font:inherit;cursor:pointer;white-space:nowrap}#viewGames:hover{background:#216f64}

#roomSelect{max-width:190px;border:1px solid #b9c7c0;border-radius:20px;padding:8px;background:#e9f0ec;color:#17483f;font:inherit}@media(max-width:600px){#roomSelect{max-width:158px;font-size:12px}}
