:root {
  --bg: #141925; --glass: rgba(22, 27, 39, .78); --line: rgba(255,255,255,.09);
  --text: #eef0f5; --muted: #9aa3b5; --accent: #e0a458; --accent2: #f3c27d;
  --ok: #4ade80; --busy: #fbbf24; --talk: #60a5fa; --danger: #ef5b5b;
  --font: 'Hind Siliguri', 'Inter', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--font); }
button, input, textarea, select { font-family: inherit; font-size: 15px; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--accent2); }
code { background: rgba(255,255,255,.08); padding: 1px 6px; border-radius: 5px; font-size: 13px; }
#scene { position: fixed; inset: 0; }
#scene canvas { display: block; }
.labels { position: absolute; inset: 0; pointer-events: none; }

.glass { background: var(--glass); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0,0,0,.35); }

/* loading */
#loading { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; background: var(--bg); transition: opacity .6s; }
#loading.done { opacity: 0; pointer-events: none; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(255,255,255,.1); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* top bar */
.topbar { position: fixed; top: 14px; left: 14px; right: 14px; z-index: 10; height: 64px; border-radius: 18px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 14px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand b { display: block; font: 700 17px Inter, var(--font); white-space: nowrap; }
.logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font: 800 15px Inter; color: #1b1406; background: linear-gradient(135deg, var(--accent2), var(--accent)); }
.chip { display: inline-block; margin-top: 2px; font-size: 12px; padding: 1px 9px; border-radius: 99px; background: rgba(224,164,88,.16); color: var(--accent2); cursor: pointer; }
.chip.live { background: rgba(74,222,128,.14); color: var(--ok); }
.team { display: flex; gap: 6px; }
.team button { position: relative; width: 44px; height: 44px; border-radius: 50%; padding: 0; overflow: hidden; border: 2px solid transparent; background: rgba(255,255,255,.06); transition: transform .15s, border-color .15s; }
.team button img { width: 100%; height: 100%; object-fit: cover; object-position: top; transform: scale(1.5); transform-origin: top center; }
.team button:hover { transform: translateY(-2px); }
.team button.on { border-color: var(--c); }
.team button::after { content: ''; position: absolute; right: 2px; bottom: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); border: 2px solid #1a1f2c; }
.team button[data-status="thinking"]::after { background: var(--busy); }
.team button[data-status="speaking"]::after { background: var(--talk); }
.actions { display: flex; gap: 8px; align-items: center; }
.icon { width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.06); font-size: 18px; transition: background .15s; }
.icon:hover { background: rgba(255,255,255,.12); }
.primary { height: 42px; padding: 0 18px; border-radius: 12px; font-weight: 700; color: #1b1406; background: linear-gradient(135deg, var(--accent2), var(--accent)); box-shadow: 0 4px 18px rgba(224,164,88,.35); transition: transform .15s; }
.primary:hover { transform: translateY(-1px); }
.primary.end { background: var(--danger); color: #fff; box-shadow: none; }
.ghost { height: 38px; padding: 0 14px; border-radius: 10px; background: rgba(255,255,255,.07); border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.ghost:hover { background: rgba(255,255,255,.12); }
.danger { justify-self: start; height: 42px; padding: 0 16px; border-radius: 12px; background: rgba(239,91,91,.15); color: #ff9b9b; font-weight: 600; }
.link { color: var(--muted); font-size: 13px; text-decoration: underline; }
.muted { color: var(--muted); font-size: 13px; }

/* 3D name tags + speech bubbles */
.tag { pointer-events: auto; cursor: pointer; display: flex; align-items: center; gap: 7px; padding: 5px 11px 5px 9px; border-radius: 99px; background: rgba(18,22,32,.82); border: 1px solid rgba(255,255,255,.1); white-space: nowrap; font-size: 13px; transform: translateY(-4px); box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.tag b { font: 700 13px Inter; }
.tag small { color: var(--muted); font-size: 11px; }
.tag .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(74,222,128,.2); }
.tag[data-status="thinking"] .dot { background: var(--busy); box-shadow: 0 0 0 3px rgba(251,191,36,.25); animation: pulse 1s infinite; }
.tag[data-status="speaking"] { border-color: var(--c); }
.tag[data-status="speaking"] .dot { background: var(--talk); box-shadow: 0 0 0 3px rgba(96,165,250,.3); animation: pulse .6s infinite; }
@keyframes pulse { 50% { transform: scale(1.4); } }
.bubble { max-width: 300px; padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: #fff; color: #1d2230; font-size: 14px; line-height: 1.45; box-shadow: 0 8px 24px rgba(0,0,0,.35); opacity: 0; transform: translateY(8px) scale(.96); transition: .25s; pointer-events: none; }
.bubble.show { opacity: 1; transform: translateY(-30px) scale(1); }

/* employee panel */
.panel { position: fixed; top: 92px; right: 14px; bottom: 14px; width: 410px; max-width: calc(100vw - 28px); z-index: 9; border-radius: 20px; display: flex; flex-direction: column; padding: 18px; transform: translateX(calc(100% + 30px)); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.panel.open { transform: none; }
.close { position: absolute; top: 10px; right: 12px; width: 32px; height: 32px; border-radius: 10px; font-size: 22px; color: var(--muted); }
.close:hover { background: rgba(255,255,255,.08); color: var(--text); }
.phead { display: flex; gap: 14px; align-items: center; padding-right: 30px; }
.avatar { width: 74px; height: 74px; border-radius: 20px; overflow: hidden; background: var(--c, #333); flex: none; box-shadow: 0 0 0 3px rgba(255,255,255,.08); }
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: top; transform: scale(1.45); transform-origin: top center; }
.phead h2 { margin: 0; font: 800 22px Inter, var(--font); }
.phead p { margin: 0 0 4px; color: var(--muted); }
.status { font-size: 13px; color: var(--ok); }
.status.thinking { color: var(--busy); } .status.speaking { color: var(--talk); }
.tabs { display: flex; gap: 6px; margin: 16px 0 12px; background: rgba(255,255,255,.05); padding: 4px; border-radius: 12px; }
.tabs button { flex: 1; height: 36px; border-radius: 9px; color: var(--muted); font-weight: 600; }
.tabs button.on { background: rgba(255,255,255,.1); color: var(--text); }
.tab { display: none; flex: 1; min-height: 0; flex-direction: column; }
.tab.on { display: flex; }
#tab-train { overflow-y: auto; padding-right: 4px; }
.log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 4px 10px 0; }
.msg { max-width: 88%; padding: 9px 13px; border-radius: 14px; line-height: 1.55; font-size: 15px; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: linear-gradient(135deg, #3b4a66, #34405a); border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: rgba(255,255,255,.07); border-bottom-left-radius: 4px; }
.msg.err { align-self: center; background: rgba(239,91,91,.12); color: #ffb4b4; font-size: 13px; }
.msg .speak { margin-left: 6px; opacity: .55; font-size: 13px; }
.msg .speak:hover { opacity: 1; }
.typing span { display: inline-block; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }
.empty { margin: auto; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.6; padding: 20px; }
.empty b { color: var(--text); }
.compose { display: flex; gap: 8px; align-items: flex-end; background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 14px; padding: 6px; }
.compose textarea { flex: 1; resize: none; border: 0; outline: 0; background: none; padding: 8px 4px; max-height: 140px; line-height: 1.45; }
.mic, .send { width: 38px; height: 38px; border-radius: 10px; flex: none; font-size: 17px; background: rgba(255,255,255,.08); }
.send { background: var(--accent); color: #1b1406; font-weight: 800; }
.mic.rec { background: var(--danger); animation: pulse 1s infinite; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.row.small { font-size: 13px; color: var(--muted); }
.row label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.lbl { display: block; font-weight: 700; margin: 6px 0 6px; }
.lbl span { font-weight: 400; color: var(--muted); font-size: 13px; }
#trainInstr { width: 100%; resize: vertical; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.05); padding: 10px 12px; line-height: 1.5; outline: none; }
#trainInstr:focus, .compose:focus-within { border-color: rgba(224,164,88,.5); }
.lessons { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lessons li { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.05); font-size: 14px; line-height: 1.45; }
.lessons li::before { content: '✓'; color: var(--ok); font-weight: 800; }
.lessons li span { flex: 1; }
.lessons li button { color: var(--muted); font-size: 16px; line-height: 1; }
.lessons li button:hover { color: var(--danger); }
.tip { margin-top: auto; font-size: 13px; color: var(--muted); background: rgba(224,164,88,.08); border: 1px dashed rgba(224,164,88,.3); padding: 10px 12px; border-radius: 12px; line-height: 1.5; }

/* meeting HUD */
.hud { position: fixed; left: 14px; right: 14px; bottom: 14px; z-index: 9; display: none; pointer-events: none; }
.hud.on { display: block; }
.hud > * { pointer-events: auto; }
.transcript { position: absolute; left: 0; bottom: 104px; width: 380px; max-height: 42vh; overflow-y: auto; border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.transcript:empty { display: none; }
.tline { display: flex; gap: 8px; line-height: 1.45; }
.tline img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; object-position: top; flex: none; background: var(--c); }
.tline .me { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #1b1406; font-weight: 800; font-size: 12px; flex: none; }
.tline b { font-family: Inter; font-size: 12px; color: var(--c, var(--accent2)); display: block; }
.mbar { height: 90px; border-radius: 22px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 18px; }
.mcenter { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bigmic { width: 58px; height: 58px; border-radius: 50%; font-size: 24px; background: linear-gradient(135deg, var(--accent2), var(--accent)); box-shadow: 0 0 0 6px rgba(224,164,88,.15); transition: .2s; }
.bigmic.listening { background: var(--danger); box-shadow: 0 0 0 10px rgba(239,91,91,.2); animation: pulse 1.2s infinite; }
.bigmic.thinking { background: var(--busy); animation: spin 2s linear infinite; }
.bigmic.speaking { background: var(--talk); box-shadow: 0 0 0 8px rgba(96,165,250,.2); }
.mstate { font-size: 13px; color: var(--muted); min-height: 18px; max-width: 360px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mright { display: flex; gap: 12px; align-items: center; justify-content: flex-end; }
.mtext { display: flex; background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.mtext input { width: 210px; border: 0; outline: 0; background: none; padding: 0 12px; height: 40px; }
.mtext button { width: 40px; background: var(--accent); color: #1b1406; font-weight: 800; }
.switch { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.switch input { display: none; }
.switch span { width: 36px; height: 20px; border-radius: 99px; background: rgba(255,255,255,.15); position: relative; transition: .2s; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { left: 18px; }

/* modals */
.modal { position: fixed; inset: 0; z-index: 30; display: none; place-items: center; background: rgba(8,10,16,.55); padding: 20px; }
.modal.open { display: grid; }
.sheet { position: relative; width: 640px; max-width: 100%; max-height: 88vh; overflow-y: auto; border-radius: 22px; padding: 24px 26px; }
.sheet h2 { margin: 0 0 14px; font: 800 22px Inter, var(--font); }
.sheet h3 { margin: 22px 0 8px; font-size: 17px; }
.sheet label { display: block; font-size: 14px; color: var(--muted); margin: 10px 0; }
.sheet label small { color: var(--muted); }
.sheet input:not([type=checkbox]):not([type=file]), .sheet select, .sheet textarea { display: block; width: 100%; margin-top: 5px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--text); outline: none; }
.sheet select option { background: #1d2230; }
.sheet input:focus, .sheet select:focus, .sheet textarea:focus { border-color: rgba(224,164,88,.6); }
.sheet .inline { display: flex; align-items: center; gap: 8px; color: var(--text); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.help { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 6px 0; }
.help.warn { color: #fcd34d; }
.prov { display: none; padding: 4px 14px 6px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--line); margin-top: 8px; }
.prov.on { display: block; }
.voices { display: grid; gap: 8px; }
.voices .v { display: grid; grid-template-columns: 34px 110px 1fr 40px; align-items: center; gap: 10px; }
.voices .v img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--c); }
.voices .v select { margin: 0 !important; }
.voices .v button { height: 36px; border-radius: 10px; background: rgba(255,255,255,.08); }
.file { cursor: pointer; color: var(--text) !important; margin: 0 !important; font-size: 15px !important; }
#infoBody h1, #infoBody h2 { font: 800 22px Inter, var(--font); margin: 0 0 12px; }
#infoBody h3 { margin: 16px 0 6px; }
#infoBody p, #infoBody li { line-height: 1.65; color: #d6dae4; }
#infoBody .steps { display: grid; gap: 10px; margin: 14px 0; }
#infoBody .step { display: flex; gap: 12px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.05); }
#infoBody .step b.n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #1b1406; }
#infoBody .faces { display: flex; gap: 8px; margin: 6px 0 4px; }
#infoBody .faces img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--c); box-shadow: 0 0 0 2px rgba(255,255,255,.1); }

#toast { position: fixed; left: 50%; top: 92px; transform: translateX(-50%); z-index: 40; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
#toast div { padding: 10px 16px; border-radius: 12px; background: rgba(20,24,34,.95); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0,0,0,.4); font-size: 14px; animation: tin .3s; max-width: 90vw; }
#toast div.err { border-color: rgba(239,91,91,.5); color: #ffb4b4; }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }

@media (max-width: 980px) {
  .team { display: none; }
  .transcript { width: auto; right: 0; max-height: 30vh; }
  .mbar { grid-template-columns: auto 1fr; height: auto; padding: 12px; gap: 10px; }
  .mright { grid-column: 1 / -1; justify-content: space-between; }
  .mtext input { width: 150px; }
  .primary { padding: 0 12px; }
}

/* drag a .glb onto the office */
body.dropping #scene::after { content: '.glb ফাইল এখানে ছাড়ুন'; position: absolute; inset: 16px; border: 3px dashed var(--accent, #e0a458); border-radius: 18px; display: grid; place-items: center; font-size: 26px; color: #fff; background: rgba(0,0,0,.35); pointer-events: none; z-index: 5; }
