/* AS HUB brand (from as-hub.com) */
:root {
  --ink: #03051E; --deep: #080C2B; --raise: #0E1440; --line-b: #1D2556; --mist: #F7F9FF; --slate: #9DA7C1;
  --cyan: #4FF4EF; --blue: #55A7FF; --purple: #946DFF;
  --grad: linear-gradient(120deg, var(--cyan), var(--blue) 50%, var(--purple));
  --bg: var(--ink); --surface: var(--deep); --surface-2: var(--raise); --line: var(--line-b);
  --text: var(--mist); --muted: var(--slate); --brand: var(--blue); --brand-soft: #55a7ff22;
  --ok: #4FF4EF; --warn: #FFB86B; --bad: #FF6B8B; --radius: 16px;
  --shadow: 0 10px 40px #00000040;
  --display: "Readex Pro", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "IBM Plex Sans Arabic", system-ui, sans-serif; background: radial-gradient(1200px 600px at 85% -10%, #121a55 0%, transparent 60%), var(--bg); background-attachment: fixed; color: var(--text); font-size: 15px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; padding: 40px; }
.err { color: var(--bad); min-height: 1.2em; }
a { color: var(--brand); cursor: pointer; }
code, pre { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }

.btn { border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 9px 16px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; transition: .15s; white-space: nowrap; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--grad); color: var(--ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: wait; }

input, textarea, select { width: 100%; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
label input, label textarea, label select { margin-top: 4px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { background: var(--surface); padding: 36px; border-radius: 20px; width: 100%; max-width: 360px; box-shadow: var(--shadow); display: grid; gap: 14px; text-align: center; }
.login-card h1 { margin: 0; font-size: 20px; }

.logo { font-family: var(--display); font-weight: 600; font-size: 20px; letter-spacing: .5px; direction: ltr; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.logo img { width: 38px; height: 38px; }
.logo span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
h1, h2, h3, h4, .kpi b, .page-head h1 { font-family: var(--display); font-weight: 600; }
.logo small { display: block; width: 100%; font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: 0; direction: rtl; }

/* layout */
.app { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-inline-start: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.sidebar .logo { padding: 0 10px; }
nav { display: grid; gap: 2px; }
nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 500; }
nav a i { font-style: normal; width: 22px; text-align: center; }
nav a:hover { background: var(--surface-2); }
nav a.active { background: var(--brand-soft); color: var(--mist); font-weight: 600; box-shadow: inset -3px 0 0 var(--cyan); }
.badge { margin-inline-start: auto; background: var(--bad); color: #fff; font-size: 11px; border-radius: 99px; padding: 1px 8px; }
.sys { margin-top: auto; font-size: 12px; color: var(--muted); display: grid; gap: 6px; padding: 0 10px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 6px; }
.dot.on { background: var(--ok); } .dot.off { background: var(--bad); }

main { padding: 28px 32px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0 0 4px; font-size: 26px; }
.page-head p { margin: 0; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.kpi b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: 13px; }
.kpi { background: linear-gradient(180deg, #0E1440, #080C2B); }
.kpi.alert { border-color: var(--bad); }
.kpi.alert b { color: var(--bad); }

.office-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.desks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.desk { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; transition: .2s; }
.desk::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--c); opacity: .85; }
.desk.busy { box-shadow: 0 0 0 2px var(--c) inset; }
.desk-top { display: flex; gap: 12px; align-items: center; }
.avatar { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; font-size: 26px; background: color-mix(in srgb, var(--c) 14%, transparent); flex: none; }
.desk h4 { margin: 0; font-size: 17px; }
.desk .role { color: var(--muted); font-size: 13px; }
.state { font-size: 13px; min-height: 38px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }
.state.busy { color: var(--text); }
.typing { display: inline-flex; gap: 3px; padding-top: 7px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--c); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
.desk-foot { display: flex; gap: 8px; align-items: center; }
.desk-foot .stat { margin-inline-end: auto; font-size: 12px; color: var(--muted); }

.feed-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; position: sticky; top: 20px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.feed-wrap h3 { margin: 0 0 12px; font-size: 15px; }
.feed { overflow-y: auto; display: grid; gap: 2px; }
.ev { padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 13px; display: grid; grid-template-columns: 26px 1fr; gap: 6px; }
.ev .t { color: var(--muted); font-size: 11px; }
.ev .txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.ev.alert { background: color-mix(in srgb, var(--bad) 8%, transparent); border-radius: 8px; }
.ev.error .txt { color: var(--bad); }

.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: none; font: inherit; padding: 6px 12px; border-radius: 8px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

.cards { display: grid; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card-head { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h4 { margin: 0; font-size: 16px; flex: 1; min-width: 200px; }
.tag { font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.preview-box { background: var(--surface-2); border-radius: 10px; padding: 14px; white-space: pre-wrap; font-size: 14px; max-height: 360px; overflow: auto; }
.qtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.qtable td { padding: 6px 4px; border-bottom: 1px solid var(--line); }

.pipeline { display: grid; grid-template-columns: repeat(6, minmax(210px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.col { background: var(--surface-2); border-radius: var(--radius); padding: 10px; min-height: 200px; }
.col h5 { margin: 4px 6px 10px; font-size: 14px; display: flex; justify-content: space-between; }
.lead { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; font-size: 13px; }
.lead:hover { border-color: var(--brand); }
.lead b { display: block; font-size: 14px; }
.lead p { margin: 4px 0 0; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.split { display: grid; grid-template-columns: 320px 1fr; gap: 14px; height: calc(100vh - 150px); }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-y: auto; }
.list .item { padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list .item:hover, .list .item.on { background: var(--brand-soft); }
.list .item small { color: var(--muted); display: block; }
.thread { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }

.msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 85%; padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; font-size: 14px; }
.msg.user { align-self: flex-start; background: var(--grad); color: var(--ink); border-end-start-radius: 4px; }
.msg.assistant { align-self: flex-end; background: var(--surface-2); border: 1px solid var(--line); border-end-end-radius: 4px; }
.msg .tools { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.msg.pending { opacity: .7; }

.drawer { position: fixed; inset: 0 auto 0 0; width: min(460px, 100%); background: var(--surface); border-inline-start: 1px solid var(--line); box-shadow: 0 0 40px #0003; display: flex; flex-direction: column; z-index: 20; }
.drawer-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.x { border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--muted); }
.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.composer textarea { resize: none; }

.modal { position: fixed; inset: 0; background: #0006; display: grid; place-items: center; z-index: 30; padding: 16px; }
.modal-card { background: var(--surface); border-radius: 18px; padding: 24px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; }
.modal-card h3 { margin-top: 0; }

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: right; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 500; font-size: 13px; }
.st-queued { color: var(--warn); } .st-running { color: var(--brand); } .st-done { color: var(--ok); } .st-failed { color: var(--bad); }

.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel h3 { margin-top: 0; }
.price-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 6px; margin-bottom: 6px; }
.code { background: var(--surface-2); padding: 12px; border-radius: 10px; direction: ltr; text-align: left; white-space: pre-wrap; word-break: break-all; }

@media (max-width: 1100px) { .office-grid { grid-template-columns: 1fr; } .feed-wrap { position: static; max-height: 420px; } }
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; height: auto; flex-direction: row; align-items: center; padding: 10px 16px; z-index: 10; overflow-x: auto; gap: 12px; }
  .sidebar .logo small, .sys { display: none; }
  nav { display: flex; gap: 4px; }
  nav a { padding: 8px 10px; white-space: nowrap; font-size: 14px; }
  main { padding: 18px 16px; }
  .split { grid-template-columns: 1fr; height: auto; }
  .list { max-height: 260px; }
  .thread { min-height: 400px; }
  .settings { grid-template-columns: 1fr; }
  .price-row { grid-template-columns: 1fr 1fr; }
}

/* ================= Live office floor ================= */
.scene { container-type: inline-size; margin-bottom: 18px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.floor { position: relative; width: 100cqw; height: 52cqw; direction: ltr;
  background:
    repeating-linear-gradient(90deg, #00000008 0 1px, transparent 1px 7cqw),
    linear-gradient(#efe6d8, #e6dac7); }
@media (prefers-color-scheme: dark) { .floor { background: repeating-linear-gradient(90deg, #ffffff08 0 1px, transparent 1px 7cqw), linear-gradient(#2c2838, #24212f); } }
.wall { position: absolute; inset: 0 0 auto 0; height: 3cqw; background: linear-gradient(#d8d2e8, #cfc8e2); border-bottom: .4cqw solid #b9b0d3; }
@media (prefers-color-scheme: dark) { .wall { background: linear-gradient(#3a3550, #34304a); border-color: #4a4566; } }

.room { position: absolute; left: 1cqw; top: 4cqw; width: 31cqw; height: 46cqw; border: .35cqw solid #9ec5fe; border-radius: 1.2cqw;
  background: #e7f1ff99; cursor: pointer; transition: .3s; }
.room:hover { background: #dbe9ffcc; }
.room.live { border-color: #e03131; box-shadow: 0 0 0 .3cqw #e0313133; }
@media (prefers-color-scheme: dark) { .room { background: #1f2a4499; border-color: #3b5bdb; } }
.room-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.room-label { position: absolute; top: .8cqw; right: 1.2cqw; font-size: clamp(9px, 1.3cqw, 15px); font-weight: 600; color: #364fc7; direction: rtl; }
.room-status { position: absolute; bottom: .8cqw; right: 1.2cqw; left: 1.2cqw; font-size: clamp(8px, 1.1cqw, 13px); color: #495057; direction: rtl; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (prefers-color-scheme: dark) { .room-label { color: #91a7ff; } .room-status { color: #adb5bd; } }

.plant { position: absolute; width: 3.4cqw; }
.plant.p1 { right: 1cqw; top: 3.6cqw; } .plant.p2 { right: 1.4cqw; top: 44cqw; }
.board { position: absolute; left: 50cqw; top: .2cqw; width: 20cqw; height: 2.6cqw; background: #fff; border: .25cqw solid #adb5bd; border-radius: .4cqw;
  display: flex; align-items: center; gap: 1cqw; padding: 0 1cqw; font-size: clamp(7px, 1cqw, 12px); direction: rtl; color: #343a40; overflow: hidden; white-space: nowrap; }
.board b { color: var(--blue); direction: ltr; }
.clock { position: absolute; left: 35cqw; top: .3cqw; width: 6cqw; height: 2.4cqw; border-radius: 1.2cqw; background: #212529; color: #63e6be;
  font: 600 clamp(7px, 1.1cqw, 13px) ui-monospace, monospace; display: grid; place-items: center; }
.coffee { position: absolute; right: 2cqw; top: 26cqw; width: 6cqw; text-align: center; font-size: clamp(8px, 1cqw, 12px); }

.station { position: absolute; left: calc(var(--x) * 1cqw); top: calc(var(--y) * 1cqw); width: 14cqw; height: 17cqw; cursor: pointer; }
.chair-wrap { position: absolute; left: 3.5cqw; top: 2.6cqw; width: 7cqw; z-index: 1; }
.chair { width: 100%; display: block; }
.desk-front { position: absolute; left: 0; top: 7.2cqw; width: 14cqw; z-index: 3; }
.dsvg { width: 100%; display: block; overflow: visible; }
.nameplate { position: absolute; top: 14.4cqw; left: 0; right: 0; text-align: center; font-size: clamp(8px, 1.15cqw, 14px); font-weight: 600; direction: rtl; color: var(--text); white-space: nowrap; }
.station:hover .nameplate { color: var(--brand); }

.screen { transition: fill .4s; }
.code { opacity: .15; transition: opacity .4s; }
.station.busy .code { opacity: 1; }
.station.busy .screen { fill: #0f1020; }
.station.busy .code-lines { animation: scroll 2.2s linear infinite; }
@keyframes scroll { from { transform: translateY(0); } to { transform: translateY(-16px); } }
.station.busy .monitor { filter: drop-shadow(0 0 .6cqw color-mix(in srgb, var(--c) 70%, transparent)); }
.hand { transition: transform .1s; }
.station.busy .hand.l { animation: tap .32s infinite alternate; }
.station.busy .hand.r { animation: tap .28s .1s infinite alternate; }
@keyframes tap { from { transform: translateY(0); } to { transform: translateY(-1.6px); } }
.station.empty .hands, .station:not(.busy) .hands { opacity: 0; }
.station.busy .steam, .station.empty .steam { display: none; }
.steam { animation: steam 3s infinite; }
@keyframes steam { 0% { opacity: 0; transform: translateY(2px); } 50% { opacity: .9; } 100% { opacity: 0; transform: translateY(-3px); } }

.person { position: absolute; left: calc(var(--px, 0) * 1cqw); top: calc(var(--py, 0) * 1cqw); width: 6.8cqw; z-index: 2; cursor: pointer;
  transition: left 1.6s ease-in-out, top 1.6s ease-in-out; }
.person .psvg { width: 100%; display: block; }
.person:not(.busy) .psvg { animation: idle 4s ease-in-out infinite; }
.person.busy .psvg { animation: lean .9s ease-in-out infinite alternate; }
@keyframes idle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(1.5%); } }
@keyframes lean { from { transform: translateY(0); } to { transform: translateY(2%); } }
.eyes { animation: blink 5s infinite; transform-origin: 50px 39px; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
.person.meeting { z-index: 4; }
.person.talking .mouth { animation: talk .25s infinite alternate; transform-origin: 50px 47px; }
@keyframes talk { from { transform: scaleY(1); } to { transform: scaleY(2.4); } }

.bubble, .mbubble { position: absolute; bottom: calc(100% + .4cqw); left: 50%; transform: translateX(-50%) scale(.9); opacity: 0; pointer-events: none;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 1cqw; padding: .6cqw .9cqw; width: max-content; max-width: 19cqw;
  font-size: clamp(8px, 1.05cqw, 13px); line-height: 1.45; direction: rtl; box-shadow: 0 4px 14px #0002; transition: .25s; z-index: 6; }
.bubble { bottom: auto; top: -3.2cqw; }
.bubble.show, .mbubble.show { opacity: 1; transform: translateX(-50%) scale(1); }
.bubble b { display: block; color: var(--c); }
.bubble span { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bubble i { display: block; font-style: normal; margin-top: .3cqw; border-top: 1px dashed var(--line); padding-top: .3cqw; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mbubble { border-color: var(--c); max-width: 22cqw; }

@media (max-width: 760px) { .bubble i, .bubble span { display: none; } }

.live-screen { background: #0f1020; color: #d0cde6; font: 13px/1.6 ui-monospace, Menlo, monospace; padding: 12px; margin: 12px 16px 0; border-radius: 10px;
  max-height: 180px; overflow-y: auto; white-space: pre-wrap; direction: auto; }
.live-screen .lbl { color: #63e6be; display: block; margin-bottom: 4px; font-family: inherit; }

/* ================= Meetings ================= */
.meet-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 16px; }
.meet-thread { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; height: calc(100vh - 170px); min-height: 460px; }
.meet-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.meet-head h3 { margin: 0; flex: 1; font-size: 17px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; padding: 3px 9px; border-radius: 99px; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--text); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.chip.speaking { box-shadow: 0 0 0 2px var(--c); }
.meet-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.mm { display: grid; grid-template-columns: 38px 1fr; gap: 10px; align-items: start; }
.mm .av { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: color-mix(in srgb, var(--c) 16%, transparent); }
.mm .who { font-weight: 600; font-size: 13px; }
.mm .who small { color: var(--muted); font-weight: 400; }
.mm .tx { white-space: pre-wrap; line-height: 1.7; overflow-wrap: anywhere; }
.mm.owner .av { background: var(--brand-soft); }
.mm.live .tx::after { content: "▍"; animation: blink 1s infinite; color: var(--c); }
.passes { color: var(--muted); font-size: 12px; text-align: center; }
.meet-side { display: grid; gap: 12px; align-content: start; }
.pick { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; margin-bottom: 6px; color: var(--text); font-size: 14px; }
.pick input { width: auto; }
.summary { white-space: pre-wrap; font-size: 14px; line-height: 1.7; }
@media (max-width: 900px) { .meet-wrap { grid-template-columns: 1fr; } .meet-thread { height: 70vh; } }

/* ================= 3D office ================= */
.has-3d .scene { background: var(--deep); }
.o3d { position: relative; width: 100%; height: 520px; direction: ltr; overflow: hidden; }
.o3d canvas { display: block; }
.o3d-labels { position: absolute !important; top: 0; left: 0; }
.o3d-hint { position: absolute; z-index: 2; bottom: 10px; left: 50%; transform: translateX(-50%); background: #1d1b29b3; color: #fff; font-size: 12px; padding: 5px 12px; border-radius: 99px; pointer-events: none; white-space: nowrap; }
.badge3d { direction: rtl; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; transform: translateY(-50%); pointer-events: auto; }
.b3-card { display: flex; align-items: center; gap: 6px; background: #080C2Bee; border: 1px solid #55a7ff55; color: var(--mist) !important; backdrop-filter: blur(6px); border-radius: 99px; padding: 3px 10px 3px 3px; box-shadow: 0 3px 12px #0002; font-size: 11px; line-height: 1.25; color: #1d1b29; position: relative; white-space: nowrap; }
.b3-card img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.b3-card b { display: block; font-size: 12px; }
.b3-card small { color: var(--slate); }
.b3-dot { position: absolute; top: 2px; right: 2px; width: 8px; height: 8px; border-radius: 50%; background: var(--slate); border: 2px solid var(--deep); }
.badge3d.busy .b3-dot { background: var(--cyan); animation: pulse 1.2s infinite; }
.badge3d.speaking .b3-card { box-shadow: 0 0 0 3px #e03131aa, 0 3px 12px #0002; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px #0ca67844; } }
.b3-bubble { order: -1; max-width: 210px; background: #03051Ef0; border: 1px solid #4ff4ef44; color: #fff; border-radius: 10px; padding: 0; font-size: 11px; line-height: 1.45; opacity: 0; transition: opacity .25s; }
.badge3d.busy .b3-bubble, .badge3d.speaking .b3-bubble { opacity: 1; padding: 6px 9px; }
.b3-bubble b { display: block; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.b3-bubble i { font-style: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 700px) { .b3-card small { display: none; } .b3-bubble { max-width: 130px; } }

/* ================= Video-call meeting ================= */
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.pick img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.call { background: var(--ink); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; color: #fff; display: flex; flex-direction: column; height: calc(100vh - 150px); min-height: 560px; }
.call-top { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: var(--deep); }
.call-top .rec { color: #ff6b6b; font-size: 13px; font-weight: 600; }
.call-top b { flex: 1; }
.call-top .muted { color: #9a97ad; font-variant-numeric: tabular-nums; }
.call-main { flex: 1; display: grid; grid-template-columns: 1fr 340px; min-height: 0; }
.tiles { display: grid; gap: 10px; padding: 12px; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; min-height: 0; }
.tiles.n2 { grid-template-columns: repeat(2, 1fr); }
.tiles.n3, .tiles.n4 { grid-template-columns: repeat(2, 1fr); }
.tile { position: relative; border-radius: 14px; overflow: hidden; background: var(--raise); min-height: 120px; display: grid; place-items: center; outline: 3px solid transparent; transition: outline-color .2s; }
.tile-bg { position: absolute; inset: -20px; background-size: cover; background-position: center; filter: blur(22px) brightness(.45); }
.tile-face { position: relative; width: min(46%, 170px); aspect-ratio: 1; border-radius: 50%; object-fit: cover; box-shadow: 0 6px 30px #0007; transition: transform .2s; }
.tile.speaking { outline-color: var(--c); }
.tile.speaking .tile-face { transform: scale(1.04); box-shadow: 0 0 0 4px var(--c), 0 0 40px color-mix(in srgb, var(--c) 60%, transparent); animation: talkpulse .5s infinite alternate; }
@keyframes talkpulse { to { box-shadow: 0 0 0 7px var(--c), 0 0 50px color-mix(in srgb, var(--c) 70%, transparent); } }
.tile.thinking .tile-name::after { content: " · بيفكّر…"; color: #9a97ad; font-weight: 400; }
.tile-name { position: absolute; bottom: 10px; right: 12px; background: #0009; padding: 4px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.tile-name small { display: block; font-weight: 400; color: #c9c6dc; font-size: 11px; }
.bars { position: absolute; top: 12px; left: 12px; display: flex; gap: 3px; align-items: flex-end; height: 18px; opacity: 0; }
.bars i { width: 4px; background: var(--c); border-radius: 2px; height: 30%; }
.tile.speaking .bars { opacity: 1; }
.tile.speaking .bars i { animation: bar .45s infinite alternate; }
.bars i:nth-child(2) { animation-delay: .15s !important; } .bars i:nth-child(3) { animation-delay: .3s !important; } .bars i:nth-child(4) { animation-delay: .08s !important; }
@keyframes bar { from { height: 20%; } to { height: 100%; } }
.cap { position: absolute; bottom: 52px; left: 10%; right: 10%; text-align: center; font-size: 14px; line-height: 1.6; background: #000a; border-radius: 8px; padding: 4px 10px; opacity: 0; transition: opacity .2s; direction: rtl; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile.speaking .cap:not(:empty) { opacity: 1; }
.call-chat { background: var(--deep); color: var(--text); display: flex; flex-direction: column; min-height: 0; border-inline-start: 1px solid #0003; }
.call-chat .meet-msgs { flex: 1; }
.mm img.av { width: 38px; height: 38px; border-radius: 12px; object-fit: cover; }
.call-bar { display: flex; justify-content: center; gap: 10px; padding: 12px; background: var(--deep); flex-wrap: wrap; }
.cbtn { border: 0; background: var(--raise); color: #fff; font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 99px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.cbtn:hover { background: var(--line); }
.cbtn.on { background: var(--grad); color: var(--ink); }
#micBtn.on { background: #e03131; animation: talkpulse .8s infinite alternate; --c: #e03131; }
.cbtn.danger { background: #c92a2a; }
.cbtn:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 900px) {
  .call { height: auto; }
  .call-main { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr) !important; grid-auto-rows: 170px; }
  .call-chat { height: 360px; }
  .cbtn span { display: none; }
}
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.av-cell { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.av-cell img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; }
.av-cell label { margin: 6px 0 0; color: var(--text); }
@media (max-width: 760px) {
  .sidebar .logo { flex-wrap: nowrap; font-size: 16px; gap: 6px; white-space: nowrap; }
  .sidebar .logo img { width: 28px; height: 28px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
