:root {
  --bg: #070a0f;
  --bg-alt: #0b1017;
  --panel: #0e141d;
  --panel-2: #121a25;
  --line: #1d2734;
  --line-soft: #16202c;
  --text: #e9eff7;
  --muted: #8695a8;
  --muted-2: #64748b;
  --green: #2ecc71;
  --green-dim: #16653c;
  --red: #f05b5b;
  --red-dim: #6b2020;
  --gold: #e0b64a;
  --blue: #58a6ff;
  --purple: #a78bfa;
  --radius: 14px;
  --radius-sm: 9px;
  --mono: 'IBM Plex Mono',ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --sans: 'Heebo','Assistant','Segoe UI',Arial,sans-serif;
}

* { box-sizing: border-box; }

html { scrollbar-gutter: stable; overflow-anchor: auto; }
html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(46, 204, 113, 0.09), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(88, 166, 255, 0.07), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 8px; line-height: 1.25; font-weight: 650; }
h1 { font-size: 26px; letter-spacing: -0.02em; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono, .pill, .metric b, .kpi, td { font-variant-numeric: tabular-nums; }
code, .mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.green { color: var(--green); }
.red { color: var(--red); }
.gold { color: var(--gold); }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }

.shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  grid-template-rows: 62px minmax(0, 1fr);
  grid-template-areas: "top top" "side view";
  min-height: 100vh;
}

.topbar {
  grid-area: top;
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 12, 17, 0.86);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand .logo { color: var(--green); display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; background: #0d1510; }
.brand strong { display: block; font-size: 14px; letter-spacing: 0.16em; }
.brand em { display: block; font-style: normal; font-size: 11px; color: var(--muted); letter-spacing: 0.02em; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid rgba(46, 204, 113, 0.3);
  background: rgba(46, 204, 113, 0.09);
  color: #a8ecc4; font-size: 11px; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.pill.pill-quiet { border-color: var(--line); background: var(--panel); color: var(--muted); }
.pill.pill-off { border-color: var(--line); background: #141b25; color: var(--muted); }
.pill.pill-off::before { background: var(--muted-2); }
.pill.pill-warn { border-color: rgba(224, 182, 74, .35); background: rgba(224, 182, 74, .1); color: #f0d28a; }
.pill.pill-sim { border-color: rgba(88, 166, 255, .32); background: rgba(88, 166, 255, .1); color: #a9d1ff; }

.sidebar {
  grid-area: side;
  padding: 16px 12px 14px;
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 14px;
  position: sticky; top: 62px; height: calc(100vh - 62px);
  overflow-y: auto; overflow-x: hidden;
  background: linear-gradient(180deg, rgba(12, 18, 25, .7), rgba(8, 12, 17, .2));
}
#nav { display: flex; flex-direction: column; gap: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 10px;
  border: 1px solid transparent; background: none; color: var(--muted);
  font-family: inherit; font-size: 14px; text-align: right; cursor: pointer;
  width: 100%; transition: background .15s, color .15s, border-color .15s;
}
.nav-item span.ic { width: 20px; text-align: center; opacity: .9; flex-shrink: 0; font-size: 16px; }
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: linear-gradient(90deg, rgba(46,204,113,.14), rgba(46,204,113,.02)); color: var(--text); border-color: rgba(46,204,113,.22); font-weight: 600; }
.nav-item.active span.ic { color: var(--green); }
.nav-sep { height: 1px; background: var(--line-soft); margin: 8px 4px; }
.sidebar-foot { border-top: 1px solid var(--line); padding-top: 12px; margin-top: auto; }
.mini-stat { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); padding: 2px 4px; }
.mini-stat b { color: var(--text); font-family: var(--mono); }
.foot-note { margin-top: 10px; font-size: 10px; color: var(--muted-2); line-height: 1.5; padding: 0 4px; }

.view { grid-area: view; padding: 26px 26px 60px; outline: none; max-width: 1460px; width: 100%; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .eyebrow { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--green); margin-bottom: 4px; }
.page-head p { color: var(--muted); font-size: 13px; max-width: 720px; margin: 2px 0 0; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.grid { display: grid; gap: 14px; min-width: 0; width: 100%; }
.grid.cols-1 { grid-template-columns: minmax(0, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

@media (max-width: 1280px) {
  .grid.cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .grid.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
  .grid.cols-2 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid.cols-5, .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
}

.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

.card {
  background: linear-gradient(180deg, rgba(18, 26, 37, .92), rgba(12, 18, 25, .94));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 17px;
  position: relative;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  box-sizing: border-box;
}
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; max-width: 100%; }
.card-sub { color: var(--muted); font-size: 11px; word-break: break-word; }

.kpi { display: flex; flex-direction: column; gap: 6px; min-width: 0; overflow: hidden; }
.kpi .label { font-size: 11px; color: var(--muted); letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .value { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .delta { font-size: 11px; display: flex; align-items: center; gap: 6px; }
.kpi .spark { height: 32px; width: 100%; }

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); font-weight: 600; }
tbody tr:hover { background: rgba(255,255,255,.018); }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: left; font-family: var(--mono); direction: ltr; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; padding: 2px 7px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--muted);
  white-space: nowrap;
}
.tag.live { border-color: rgba(46,204,113,.4); background: rgba(46,204,113,.12); color: #8fe8b3; }
.tag.dry { border-color: rgba(88,166,255,.35); background: rgba(88,166,255,.1); color: #a9d1ff; }
.tag.opt { border-color: rgba(224,182,74,.35); background: rgba(224,182,74,.1); color: #f0d28a; }
.tag.paused { border-color: var(--line); color: var(--muted-2); }
.tag.green { color: #9becc0; border-color: rgba(46,204,113,.3); background: rgba(46,204,113,.08); }

.btn {
  font-family: inherit; font-size: 12.5px; font-weight: 550;
  padding: 8px 14px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  transition: transform .06s, background .15s, border-color .15s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { background: #16202c; border-color: #2a3a4c; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, #2ecc71, #1c9d55); border-color: #1f9c56; color: #04170c; font-weight: 700; }
.btn-primary:hover { background: linear-gradient(180deg, #3ddb80, #22ab5c); border-color: #27b463; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 11.5px; border-radius: 7px; }
.btn-danger { border-color: rgba(240,91,91,.35); color: #ffb0b0; background: rgba(240,91,91,.08); }
.btn-danger:hover { background: rgba(240,91,91,.16); }
.btn-link { background: none; border: none; color: var(--blue); padding: 0; font-size: 12px; cursor: pointer; font-family: inherit; }

label.field { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: var(--muted); }
input[type="text"], input[type="password"], input[type="number"], input[type="url"], select, textarea {
  font-family: inherit; font-size: 13px; color: var(--text);
  background: #0a1017; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: rgba(46,204,113,.5); box-shadow: 0 0 0 3px rgba(46,204,113,.1); }
textarea { resize: vertical; min-height: 72px; line-height: 1.5; }
input[type="range"] { width: 100%; accent-color: var(--green); }
.check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text); cursor: pointer; }
.check input { accent-color: var(--green); width: 15px; height: 15px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }

.agent {
  display: flex; gap: 10px; padding: 10px; border-radius: 10px;
  border: 1px solid var(--line-soft); background: rgba(10, 16, 23, .55);
}
.agent .av {
  flex: 0 0 34px; width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center; font-size: 15px;
  background: #0c1a14; border: 1px solid rgba(46,204,113,.22); color: var(--green);
}
.agent.busy .av { background: #1a1608; border-color: rgba(224,182,74,.3); color: var(--gold); }
.agent .who { display: flex; align-items: baseline; gap: 6px; }
.agent .who b { font-size: 12.5px; }
.agent .who span { font-size: 10.5px; color: var(--muted); }
.agent .task { font-size: 11.5px; color: var(--muted); margin-top: 2px; min-height: 17px; }
.agent .task.on { color: var(--gold); }
.bar { height: 3px; border-radius: 2px; background: #1a2431; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--green-dim), var(--green)); transition: width .4s; }
.bar.warn > i { background: linear-gradient(90deg, #6b5a1f, var(--gold)); }

.feed { display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow-y: auto; }
.feed-item { display: flex; gap: 9px; padding: 7px 4px; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.feed-item:last-child { border-bottom: none; }
.feed-item .when { font-family: var(--mono); font-size: 10px; color: var(--muted-2); white-space: nowrap; padding-top: 2px; direction: ltr; }
.feed-item .who { font-size: 10.5px; color: var(--muted); }
.feed-item.ok .dot { background: var(--green); }
.feed-item.warn .dot { background: var(--gold); }
.feed-item.bad .dot { background: var(--red); }
.feed-item .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--muted-2); margin-top: 7px; flex: 0 0 auto; }

.desk-card { display: flex; flex-direction: column; gap: 10px; }
.desk-card .metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.metric { background: #0a1017; border: 1px solid var(--line-soft); border-radius: 8px; padding: 7px 9px; }
.metric span { display: block; font-size: 10px; color: var(--muted-2); }
.metric b { font-family: var(--mono); font-size: 12.5px; font-weight: 600; }
.desk-card canvas { width: 100%; height: 62px; display: block; }
.gauge { display: flex; align-items: center; gap: 14px; }
.gauge .ring { --v: 50; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  background: conic-gradient(var(--green) calc(var(--v) * 1%), #17222e 0); position: relative; }
.gauge .ring::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--panel); }
.gauge .ring b { position: relative; z-index: 1; font-family: var(--mono); font-size: 18px; }

.chat { display: flex; flex-direction: column; gap: 12px; max-height: 58vh; overflow-y: auto; padding: 4px 2px 8px; }
.msg { display: flex; gap: 10px; }
.msg .bubble { padding: 10px 13px; border-radius: 12px; font-size: 13px; line-height: 1.6; max-width: 88%; white-space: pre-wrap; }
.msg.ai .bubble { background: #101a24; border: 1px solid var(--line); border-top-right-radius: 4px; }
.msg.me { flex-direction: row-reverse; }
.msg.me .bubble { background: rgba(46,204,113,.12); border: 1px solid rgba(46,204,113,.26); border-top-left-radius: 4px; }
.msg .bubble h4 { margin: 8px 0 4px; }
.msg .bubble ul { margin: 6px 0; padding-inline-start: 18px; }
.msg .bubble li { margin: 2px 0; }
.msg .bubble code { background: #080d13; padding: 1px 4px; border-radius: 4px; }
.msg .meta { font-size: 10px; color: var(--muted-2); margin-top: 4px; }
.chat-input { display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 12px; }
.chat-input textarea { min-height: 44px; max-height: 140px; }

pre.code {
  background: #060a0f; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; overflow: auto; max-height: 460px; direction: ltr; text-align: left;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.6; color: #c8d6e5; margin: 0;
}
pre.code .kw { color: #c792ea; } pre.code .st { color: #9becc0; } pre.code .cm { color: #5a6b80; }

/* Toasts live at the top-center with the highest z-index so no floating button/panel can ever cover them */
.toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 2147483000; display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(460px, 94vw); pointer-events: none; }
.toasts .toast { pointer-events: auto; width: 100%; }
.toast { padding: 10px 13px; border-radius: 10px; background: #101a24; border: 1px solid var(--line); font-size: 12.5px; box-shadow: 0 12px 30px rgba(0,0,0,.45); animation: slide .2s ease; }
.toast.ok { border-color: rgba(46,204,113,.35); }
.toast.bad { border-color: rgba(240,91,91,.4); }
@keyframes slide { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.modal-backdrop { position: fixed; inset: 0; background: rgba(3, 6, 10, .72); z-index: 80; display: grid; place-items: center; padding: 20px; backdrop-filter: blur(3px); }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; width: min(880px, 94vw); max-width: 94vw; max-height: 86vh; overflow-y: auto; overflow-x: hidden; padding: 18px 20px 20px; box-shadow: 0 30px 80px rgba(0,0,0,.6); word-break: break-word; }
.modal .modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }

.empty { text-align: center; padding: 26px 14px; color: var(--muted); font-size: 12.5px; border: 1px dashed var(--line); border-radius: 10px; }
.notice { display: flex; gap: 9px; padding: 10px 12px; border-radius: 10px; font-size: 12px; line-height: 1.55;
  background: rgba(224, 182, 74, .07); border: 1px solid rgba(224, 182, 74, .22); color: #e8d9b0; }
.notice.blue { background: rgba(88,166,255,.06); border-color: rgba(88,166,255,.22); color: #c3dcf8; }
.notice.bad { background: rgba(240,91,91,.07); border-color: rgba(240,91,91,.25); color: #ffc3c3; }
.notice .ic { flex: 0 0 auto; opacity: .9; }

.rank { font-family: var(--mono); font-size: 10px; color: var(--muted-2); width: 16px; display: inline-block; }
.list-clean { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.list-clean li { display: flex; gap: 8px; font-size: 12px; align-items: baseline; }
.list-clean li .bul { color: var(--green); flex: 0 0 auto; }
.steps { counter-reset: s; display: flex; flex-direction: column; gap: 12px; }
.step { display: flex; gap: 12px; counter-increment: s; }
.step::before { content: counter(s); flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(46,204,113,.12); border: 1px solid rgba(46,204,113,.3); color: var(--green); font-size: 11px; font-family: var(--mono); }
.step .body { flex: 1; min-width: 0; }
.step .body b { display: block; font-size: 13px; margin-bottom: 2px; }
.step .body p { color: var(--muted); font-size: 12px; margin: 0 0 6px; }
.cmd { position: relative; background: #060a0f; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; direction: ltr; text-align: left;
  font-family: var(--mono); font-size: 11.5px; overflow-x: auto; white-space: pre; color: #cfe0f0; }
.cmd + .cmd { margin-top: 6px; }
.copy-btn { position: absolute; top: 5px; left: 6px; font-size: 9.5px; padding: 2px 6px; border-radius: 5px; background: #16202c; color: var(--muted); border: 1px solid var(--line); cursor: pointer; font-family: inherit; }

details.acc { border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px; background: rgba(10,16,23,.5); }
details.acc + details.acc { margin-top: 8px; }
details.acc summary { cursor: pointer; font-size: 12.5px; font-weight: 550; }
details.acc[open] summary { margin-bottom: 8px; }
details.acc p, details.acc li { font-size: 12px; color: var(--muted); }

.seg { display: inline-flex; background: #0a1017; border: 1px solid var(--line); border-radius: 8px; padding: 2px; gap: 2px; }
.seg button { font-family: inherit; font-size: 11.5px; border: none; background: none; color: var(--muted); padding: 5px 11px; border-radius: 6px; cursor: pointer; }
.seg button.on { background: #1a2532; color: var(--text); }

@media (max-width: 1080px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* ============================================================
   Agent speech / thinking bubbles & animations (new)
   ============================================================ */

.agent-bubble-wrap {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.bubble {
  position: relative;
  display: inline-block;
  max-width: 210px;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  animation: bubbleIn 220ms cubic-bezier(0.16,1,0.3,1);
  border: 1px solid rgba(255,255,255,0.06);
}

.bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid;
}

.bubble.speak {
  background: var(--panel-2);
  color: #e2e8f0;
  border-color: rgba(88,166,255,0.35);
}
.bubble.speak::after { border-top-color: rgba(88,166,255,0.35); }

.bubble.think {
  background: rgba(167,139,250,0.12);
  color: var(--purple);
  border-color: rgba(167,139,250,0.4);
}
.bubble.think::after { border-top-color: rgba(167,139,250,0.4); }

.bubble.status {
  background: rgba(46,204,113,0.12);
  color: var(--green);
  border-color: rgba(46,204,113,0.35);
}
.bubble.status::after { border-top-color: rgba(46,204,113,0.35); }

.typing-dots {
  display: inline-flex;
  gap: 4px;
}
.typing-dots span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
  animation: typing 1.4s infinite ease-in-out both;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bubbleIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes typing {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 1; }
}

.agent-active .av {
  animation: agentPulse 3.2s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(46,204,113,0.45);
}

@keyframes agentPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46,204,113,0.45); }
  50%      { box-shadow: 0 0 0 6px rgba(46,204,113,0.08); }
}

/* Live price pill */
.live-price {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  font-family: var(--mono);
}
.live-price .up { color: var(--green); }
.live-price .down { color: var(--red); }
.live-price .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: blink 1.2s infinite;
}
.live-price .dot.off { background: var(--muted-2); animation: none; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.35} }

/* ============================================================
   Paper trading portfolio (new)
   ============================================================ */

.portfolio-wrap { display: grid; gap: 14px; }

.portfolio-header {
  display: flex; flex-wrap: wrap; gap: 14px;
  align-items: flex-end; justify-content: space-between;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
}

.portfolio-kpi { flex: 1; min-width: 150px; display: grid; gap: 4px; }
.portfolio-kpi .lab { font-size: 11px; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.05em; }
.portfolio-kpi .val { font-size: 21px; font-family: var(--mono); font-weight: 700; }
.portfolio-kpi .chg { font-size: 12px; }

.portfolio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .portfolio-grid { grid-template-columns: 1fr; } }

.card.positions-card, .card.trades-card {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}

.positions-head, .trades-head {
  background: var(--panel); border-bottom: 1px solid var(--line);
  padding: 10px 14px; display: flex; justify-content: space-between; align-items: center;
}
.positions-head h3, .trades-head h3 { font-size: 14px; margin: 0; }

.position-row {
  display: grid;
  grid-template-columns: 120px 110px 110px 110px 110px 1fr;
  gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px; align-items: center;
}
.position-row:last-child { border-bottom: none; }
.position-row .sym { font-family: var(--mono); font-weight: 600; }
.position-row .qty { color: var(--muted); }
.position-row .entry { color: var(--muted-2); }
.position-row .mark { font-weight: 600; }
.position-row .pnl { font-family: var(--mono); font-weight: 700; white-space: nowrap; }
.position-row .pnl.up { color: var(--green); }
.position-row .pnl.down { color: var(--red); }

.trade-row {
  display: grid;
  grid-template-columns: 130px 110px 110px 110px 120px 1fr;
  gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--line-soft);
  font-size: 12px; align-items: center;
}
.trade-row:last-child { border-bottom: none; }
.trade-row .side { font-family: var(--mono); font-weight: 700; font-size: 11px; }
.trade-row .side.buy { color: var(--green); }
.trade-row .side.sell { color: var(--red); }
.trade-row .fee { color: var(--muted-2); font-size: 11px; }

.empty-portfolio {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 20px; color: var(--muted); text-align: center;
}
.empty-portfolio .ic { font-size: 40px; margin-bottom: 10px; opacity: 0.5; }

/* Small table header helper */
.thead-row {
  display: grid;
  grid-template-columns: 120px 110px 110px 110px 110px 1fr;
  gap: 8px; padding: 8px 14px; font-size: 10.5px; color: var(--muted-2);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
  border-bottom: 1px solid var(--line);
}

/* ============================================================
   ×’×¨×¤×™× ×•××™× ×“×™×§×˜×•×¨×™× (charts)
   ============================================================ */

.chart-wrap { display: flex; flex-direction: column; gap: 14px; }

.chart-panel { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }

.chart-panel-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--line-soft);
  background: var(--panel);
}
.chart-panel-head h3 { font-size: 13px; margin: 0; color: var(--text); }
.chart-live-price { display: flex; align-items: center; gap: 6px; font-size: 12px; font-family: var(--mono); color: var(--green); font-weight: 600; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: blink 1.2s infinite; }

.chart-canvas-wrap { padding: 10px 14px; min-height: 170px; overflow: auto; }

.chart-meta {
  display: flex; gap: 14px; padding: 8px 14px; font-size: 12px; color: var(--muted);
  border-top: 1px solid var(--line-soft); background: var(--panel);
}

.chart-canvas { min-width: 600px; }

.profit-strip {
  display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: stretch;
  margin-top: 14px; padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: linear-gradient(90deg, rgba(46,204,113,.10), rgba(12,18,25,.6));
}
.profit-strip.down {
  border-color: rgba(240,91,91,.35);
  background: linear-gradient(90deg, rgba(240,91,91,.10), rgba(12,18,25,.6));
}
.profit-strip .profit-item { min-width: 140px; display: flex; flex-direction: column; gap: 2px; }
.profit-strip .profit-item.main .val { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.profit-strip .lab { font-size: 12px; color: var(--muted); }
.profit-strip .val { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }

@media (max-width: 920px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: 62px auto 1fr; grid-template-areas: "top" "side" "view"; }
  .sidebar { position: static; height: auto; border-left: none; border-bottom: 1px solid var(--line); padding: 12px; overflow: visible; }
  #nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; justify-content: stretch; flex: none; }
  .nav-item { width: 100%; white-space: normal; font-size: 14px; }
  .nav-sep { display: none; }
  .sidebar-foot { display: none; }
  .view { padding: 18px 14px 50px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  h1 { font-size: 22px; }
  .topbar-actions .pill { display: none; }
  .topbar-actions .pill#pill-data { display: inline-flex; }
}

/* Typography boost v2 */
h1{font-size:34px;font-weight:800;letter-spacing:-0.02em}
h2{font-size:24px;font-weight:800}
h3{font-size:18px;font-weight:700}
.page-head p{font-size:16px}
.brand strong{font-size:17px;font-weight:800;letter-spacing:.06em}
.brand em{font-size:13px;font-weight:600}
.nav-item{font-size:15px;font-weight:700}
.nav-item span.ic{font-size:17px}
.btn{font-size:15px;font-weight:700}
.btn-sm{font-size:14px;font-weight:700}
.pill{font-size:13px;font-weight:700}
.metric { min-width: 0; overflow: hidden; }
.metric b { font-size: clamp(13px, 1.3vw, 18px); font-weight: 800; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.metric span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; font-size: 11.5px; }
.kpi .val, .stat-val { font-size: 24px; font-weight: 800; }
.mono{font-weight:600}
input,select,textarea{font-size:15px;font-weight:600}
label,.field{font-size:14px;font-weight:700}
.small,.muted{font-size:14px}
.tiny{font-size:13px}
table{font-size:15px}
th{font-size:13px;font-weight:800}
td{font-size:15px;font-weight:500}
.card-head h2{font-size:22px}
.sidebar-foot .mini-stat span{font-size:13px}
.sidebar-foot .mini-stat b{font-size:16px}
.foot-note{font-size:12px;line-height:1.5}

/* 3D Team Scene / Non-overlapping Cyber-Ops Office Floor */
.team3d-card { overflow: visible; }
.team3d-stage {
  position: relative;
  border-radius: 18px;
  margin-top: 8px;
  padding: 20px;
  border: 1px solid rgba(0, 229, 255, 0.24);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.55), 0 18px 46px rgba(0, 0, 0, 0.5);
  background: radial-gradient(120% 100% at 50% 0%, #161426 0%, #0b101b 50%, #070a10 100%);
  overflow: hidden;
}
.office-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(0, 229, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 122, 0, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.55;
  pointer-events: none;
}
.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.025) 0, rgba(255,255,255,0.025) 1px, transparent 2px, transparent 4px);
  opacity: 0.35;
  pointer-events: none;
}

/* Central Holo Command Hub Banner */
.office-hub-banner {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  margin-bottom: 18px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(14, 22, 36, 0.95), rgba(20, 16, 34, 0.92), rgba(12, 22, 32, 0.95));
  border: 1px solid rgba(0, 229, 255, 0.28);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4), inset 0 0 24px rgba(0, 229, 255, 0.06);
}
.hub-core-visual {
  position: relative;
  width: 54px;
  height: 54px;
  flex-shrink: 0;
}
.hub-core-visual .holo-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 140, 0, 0.65);
  box-shadow: 0 0 16px rgba(255, 122, 0, 0.25);
  animation: spin 14s linear infinite;
}
.hub-core-visual .holo-ring.r2 {
  inset: 9px;
  border-style: solid;
  border-color: rgba(0, 229, 255, 0.65);
  animation-duration: 9s;
  animation-direction: reverse;
}
.hub-core-visual .holo-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff, #00e5ff 55%, #ff7a00 95%);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.9), 0 0 30px rgba(255, 122, 0, 0.5);
  animation: pulse 2.6s ease-in-out infinite;
}
.hub-info {
  flex: 1;
  min-width: 240px;
}
.hub-title {
  font-size: 15px;
  font-weight: 800;
  color: #f0f9ff;
  letter-spacing: 0.03em;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.3);
}
.hub-sub {
  font-size: 13px;
  color: #9fb3c8;
  margin-top: 2px;
}
.hub-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@keyframes spin { to { transform: rotateZ(360deg); } }
@keyframes pulse { 0%, 100% { transform: scale(0.9); opacity: 0.85; } 50% { transform: scale(1.18); opacity: 1; } }

/* 2x2 Non-overlapping Rooms Grid */
.office-rooms-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.office-rooms-grid.single-room-view {
  grid-template-columns: 1fr;
}

.office-room-card {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: rgba(11, 16, 26, 0.86);
  border: 1px solid rgba(88, 166, 255, 0.22);
  box-shadow: inset 0 0 36px rgba(0, 0, 0, 0.45), 0 10px 26px rgba(0, 0, 0, 0.35);
  padding: 14px 16px 16px;
  min-width: 0;
}
.office-room-card.accent-purple { border-color: rgba(167, 139, 250, 0.32); background: linear-gradient(180deg, rgba(22, 15, 36, 0.88), rgba(11, 15, 25, 0.9)); }
.office-room-card.accent-cyan   { border-color: rgba(0, 229, 255, 0.28);   background: linear-gradient(180deg, rgba(10, 24, 36, 0.88), rgba(11, 15, 25, 0.9)); }
.office-room-card.accent-blue   { border-color: rgba(88, 166, 255, 0.30);  background: linear-gradient(180deg, rgba(12, 21, 38, 0.88), rgba(11, 15, 25, 0.9)); }
.office-room-card.accent-green  { border-color: rgba(46, 204, 113, 0.30);  background: linear-gradient(180deg, rgba(10, 26, 22, 0.88), rgba(11, 15, 25, 0.9)); }

.office-room-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.room-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.room-ic {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: #7dd3fc;
  flex-shrink: 0;
}
.accent-purple .room-ic { background: rgba(167, 139, 250, 0.14); border-color: rgba(167, 139, 250, 0.4); color: #ddd6fe; }
.accent-green .room-ic  { background: rgba(46, 204, 113, 0.14);  border-color: rgba(46, 204, 113, 0.4);  color: #86efac; }
.room-title {
  font-size: 15px;
  font-weight: 800;
  color: #f8fafc;
}
.room-sub {
  font-size: 12px;
  color: #94a3b8;
}
.room-count-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  white-space: nowrap;
}
.room-count-pill.active {
  background: rgba(46, 204, 113, 0.15);
  border-color: rgba(46, 204, 113, 0.45);
  color: #86efac;
  box-shadow: 0 0 12px rgba(46, 204, 113, 0.2);
}

/* Room Floor: Responsive grid of dedicated agent lanes (never overlaps!) */
.office-room-floor {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 14px;
  align-items: stretch;
}

/* Individual Agent Workstation Lane */
.agent-lane {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(16, 23, 36, 0.92), rgba(9, 14, 22, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.agent-lane:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 229, 255, 0.45);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.55), 0 0 16px rgba(0, 229, 255, 0.14);
  z-index: 15;
}
.agent-lane.is-busy {
  border-color: rgba(255, 138, 0, 0.38);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45), inset 0 0 18px rgba(255, 122, 0, 0.05);
}

/* 1. Top Zone: Speech / Thought Bubble */
.agent3d-bubble {
  position: relative;
  width: 100%;
  min-height: 68px;
  background: rgba(8, 13, 21, 0.96);
  border: 1px solid rgba(0, 229, 255, 0.28);
  border-radius: 11px;
  padding: 7px 10px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  z-index: 5;
}
.agent3d-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  margin-top: -4.5px;
  background: rgba(8, 13, 21, 0.96);
  border-right: 1px solid rgba(0, 229, 255, 0.28);
  border-bottom: 1px solid rgba(0, 229, 255, 0.28);
  transform: rotate(45deg);
}
.agent3d-bubble.think {
  border-color: rgba(167, 139, 250, 0.45);
  background: linear-gradient(180deg, rgba(22, 16, 38, 0.96), rgba(10, 13, 22, 0.96));
}
.agent3d-bubble.think::after {
  border-right-color: rgba(167, 139, 250, 0.45);
  border-bottom-color: rgba(167, 139, 250, 0.45);
}
.agent3d-bubble.work, .agent3d-bubble.speak {
  border-color: rgba(46, 204, 113, 0.38);
}
.agent3d-bubble.work::after, .agent3d-bubble.speak::after {
  border-right-color: rgba(46, 204, 113, 0.38);
  border-bottom-color: rgba(46, 204, 113, 0.38);
}

.bubble-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
}
.agent3d-bubble .bubble-kind {
  font-size: 10.5px;
  font-weight: 800;
  color: #6ee7b7;
  letter-spacing: 0.02em;
}
.agent3d-bubble.think .bubble-kind {
  color: #c4b5fd;
}
.agent3d-bubble .bubble-text {
  font-size: 11.5px;
  line-height: 1.38;
  color: #e2e8f0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.agent3d-bubble .bubble-hover {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  padding: 9px 11px;
  border: 1px solid rgba(0, 229, 255, 0.5);
  border-radius: 11px;
  background: rgba(6, 10, 17, 0.99);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.7);
  font-size: 11.5px;
  line-height: 1.48;
  color: #f1f5f9;
  white-space: pre-wrap;
  z-index: 30;
}
.agent-lane:hover .agent3d-bubble .bubble-hover {
  display: block;
}

/* Animated Voice Equalizer & Thinking Dots */
.voice-wave {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 11px;
}
.voice-wave i {
  display: block;
  width: 2.5px;
  height: 4px;
  border-radius: 2px;
  background: #2ecc71;
  animation: voiceBars 0.75s ease-in-out infinite alternate;
}
.voice-wave i:nth-child(2) { animation-delay: 0.15s; height: 9px; }
.voice-wave i:nth-child(3) { animation-delay: 0.3s; height: 6px; }
.voice-wave i:nth-child(4) { animation-delay: 0.45s; height: 10px; }
@keyframes voiceBars {
  0% { transform: scaleY(0.35); opacity: 0.6; }
  100% { transform: scaleY(1.15); opacity: 1; }
}

.think-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.think-dots i {
  width: 4.5px;
  height: 4.5px;
  border-radius: 50%;
  background: #a78bfa;
  animation: thinkPulse 1.2s ease-in-out infinite;
}
.think-dots i:nth-child(2) { animation-delay: 0.25s; }
.think-dots i:nth-child(3) { animation-delay: 0.5s; }
@keyframes thinkPulse {
  0%, 100% { transform: scale(0.75); opacity: 0.4; }
  50% { transform: scale(1.3); opacity: 1; }
}

/* 2. Middle Zone: Walking Track & 3D Character */
.agent-track {
  position: relative;
  height: 92px;
  width: 100%;
  border-radius: 10px;
  background:
    radial-gradient(ellipse at 50% 80%, rgba(0, 229, 255, 0.09), transparent 70%),
    linear-gradient(180deg, rgba(8, 12, 20, 0.4), rgba(14, 22, 34, 0.75));
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.track-floor-line {
  position: absolute;
  left: 16%;
  right: 16%;
  bottom: 14px;
  height: 2px;
  background: linear-gradient(90deg, rgba(0,229,255,0.15), rgba(0,229,255,0.55), rgba(255,122,0,0.45), rgba(0,229,255,0.15));
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.35);
}

/* Mini Workstation & Holo Node at ends of each agent's track */
.track-station {
  position: absolute;
  bottom: 12px;
  z-index: 1;
}
.track-station.left-station { left: 8px; }
.track-station.right-station { right: 8px; }

.station-screen {
  width: 22px;
  height: 15px;
  border-radius: 3px;
  background: linear-gradient(135deg, #0ea5e9, #1e293b);
  border: 1px solid rgba(0, 229, 255, 0.6);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.35);
  animation: screenGlow 2.8s ease-in-out infinite alternate;
}
.station-base {
  width: 16px;
  height: 5px;
  margin: 1px auto 0;
  background: #334155;
  border-radius: 2px;
}
.holo-beacon {
  width: 14px;
  height: 22px;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 30%, rgba(167, 139, 250, 0.85), rgba(0, 229, 255, 0.15));
  border: 1px dashed rgba(167, 139, 250, 0.6);
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.45);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes screenGlow {
  0% { filter: brightness(0.85); }
  100% { filter: brightness(1.3); }
}

/* Walking Character Wrapper — patrols back and forth along the lane */
.agent3d-walker {
  position: absolute;
  bottom: 8px;
  left: 50%;
  width: 48px;
  height: 72px;
  margin-left: -24px;
  z-index: 3;
  animation: lanePatrol var(--walk-dur, 5.5s) ease-in-out infinite;
  animation-delay: var(--walk-delay, 0s);
}
@keyframes lanePatrol {
  0%   { transform: translateX(-36px) scaleX(1); }
  45%  { transform: translateX(36px) scaleX(1); }
  50%  { transform: translateX(36px) scaleX(-1); }
  95%  { transform: translateX(-36px) scaleX(-1); }
  100% { transform: translateX(-36px) scaleX(1); }
}

.agent3d-shadow {
  position: absolute;
  left: 50%;
  bottom: 1px;
  width: 34px;
  height: 7px;
  margin-left: -17px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 229, 255, 0.45), rgba(0, 0, 0, 0.7) 60%, transparent);
  filter: blur(1px);
  animation: shadowWalk 0.55s ease-in-out infinite alternate;
}
@keyframes shadowWalk {
  0% { transform: scaleX(0.88); opacity: 0.55; }
  100% { transform: scaleX(1.1); opacity: 0.85; }
}

.agent3d-figure {
  position: relative;
  width: 46px;
  height: 68px;
  margin: 0 auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.55));
  animation: walkBob 0.55s ease-in-out infinite alternate;
}
@keyframes walkBob {
  0%   { transform: translateY(0px) rotate(-1deg); }
  100% { transform: translateY(-3px) rotate(1deg); }
}

.agent3d-figure .a-antenna {
  position: absolute;
  left: 50%;
  top: -5px;
  width: 2px;
  height: 6px;
  margin-left: -1px;
  background: #00e5ff;
  box-shadow: 0 0 6px #00e5ff;
}
.agent3d-figure .a-head {
  position: absolute;
  left: 50%;
  top: 0;
  width: 30px;
  height: 28px;
  margin-left: -15px;
  border-radius: 8px;
  background: linear-gradient(180deg, #2d3e5e, #151f30);
  border: 1.5px solid rgba(0, 229, 255, 0.55);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.2);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.agent-lane.is-busy .a-head {
  border-color: rgba(255, 145, 0, 0.8);
  box-shadow: 0 0 14px rgba(255, 122, 0, 0.35);
}
.a-visor {
  display: flex;
  gap: 5px;
  margin-top: 2px;
}
.a-eye {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #00e5ff;
  box-shadow: 0 0 6px #00e5ff;
  animation: eyeBlink 3.6s infinite;
}
@keyframes eyeBlink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.15); }
}
.a-icon-badge {
  font-size: 11px;
  line-height: 1;
  color: #f8fafc;
  margin-top: 1px;
}
.a-mouth {
  width: 8px;
  height: 2px;
  border-radius: 2px;
  background: rgba(0, 229, 255, 0.6);
  margin-top: 2px;
}
.a-mouth.talking {
  background: #2ecc71;
  box-shadow: 0 0 5px #2ecc71;
  animation: mouthTalk 0.28s ease-in-out infinite alternate;
}
@keyframes mouthTalk {
  0% { height: 1.5px; width: 6px; }
  100% { height: 4px; width: 10px; }
}

.agent3d-figure .a-torso {
  position: absolute;
  left: 50%;
  top: 27px;
  width: 26px;
  height: 23px;
  margin-left: -13px;
  z-index: 2;
}
.agent3d-figure .a-body {
  position: absolute;
  inset: 0;
  border-radius: 6px 6px 8px 8px;
  background: linear-gradient(180deg, #24344d, #131c2b);
  border: 1px solid rgba(0, 229, 255, 0.25);
}
.agent-lane.is-busy .a-body {
  background: linear-gradient(180deg, #3b2618, #1c1510);
  border-color: rgba(255, 138, 0, 0.45);
}
.agent3d-figure .a-core {
  position: absolute;
  left: 50%;
  top: 7px;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: #00e5ff;
  box-shadow: 0 0 9px #00e5ff;
  z-index: 3;
  animation: pulse 2s ease-in-out infinite;
}
.agent-lane.is-busy .a-core {
  background: #ff8c00;
  box-shadow: 0 0 10px #ff8c00;
}

.agent3d-figure .a-arm, .agent3d-figure .a-leg {
  position: absolute;
  background: linear-gradient(180deg, #2c3f5e, #182234);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.agent3d-figure .a-arm {
  top: 29px;
  width: 5.5px;
  height: 18px;
  transform-origin: top center;
  z-index: 2;
}
.agent3d-figure .a-arm.left  { left: 4px;  animation: armWalkL 0.65s ease-in-out infinite alternate; }
.agent3d-figure .a-arm.right { right: 4px; animation: armWalkR 0.65s ease-in-out infinite alternate; }
@keyframes armWalkL { 0% { transform: rotate(22deg); } 100% { transform: rotate(-22deg); } }
@keyframes armWalkR { 0% { transform: rotate(-22deg); } 100% { transform: rotate(22deg); } }

.agent3d-figure .a-leg {
  bottom: 2px;
  width: 6.5px;
  height: 17px;
  transform-origin: top center;
  z-index: 1;
}
.agent3d-figure .a-leg.left  { left: 12px;  animation: legWalkL 0.65s ease-in-out infinite alternate; }
.agent3d-figure .a-leg.right { right: 12px; animation: legWalkR 0.65s ease-in-out infinite alternate; }
@keyframes legWalkL { 0% { transform: rotate(-20deg); } 100% { transform: rotate(20deg); } }
@keyframes legWalkR { 0% { transform: rotate(20deg); } 100% { transform: rotate(-20deg); } }

/* 3. Bottom Zone: Agent Name, Role & Progress Bar */
.agent3d-footer {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 2px;
}
.agent3d-tag {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}
.agent3d-tag b {
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
}
.agent3d-tag span {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agent3d-action {
  width: 100%;
}
.agent3d-action .act-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
}
.agent3d-action .act-text {
  font-size: 10.5px;
  color: #9fb3c8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agent3d-action .act-pct {
  font-size: 10px;
  color: #7dd3fc;
}
.agent3d-action .act-bar {
  height: 5px;
  border-radius: 999px;
  background: #0b111c;
  overflow: hidden;
  border: 1px solid rgba(0, 229, 255, 0.2);
}
.agent3d-action .act-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2ecc71, #00e5ff, #ff8c00);
  transition: width 0.4s ease;
}

.agent-detail-list { display: flex; flex-direction: column; gap: 10px; max-height: 620px; overflow-y: auto; padding-left: 4px; }
.agent-detail { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 12px; background: rgba(255,255,255,.02); }
.agent-detail.busy { border-color: rgba(255,122,0,.25); box-shadow: inset 0 0 0 1px rgba(255,122,0,.08); }
.agent-detail .av { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #121b27; border: 1px solid var(--line); font-size: 16px; flex-shrink: 0; }
.agent-detail .act-bar { height: 6px; border-radius: 999px; background: #0f1722; overflow: hidden; border: 1px solid rgba(88,166,255,.18); }
.agent-detail .act-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg,#ff7a00,#00e5ff); }

@media (max-width: 1120px) {
  .office-rooms-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   3D Free-Roaming & Social Meeting Cyber Arena (60fps Engine)
   ============================================================ */
.arena3d-stage {
  position: relative;
  width: 100%;
  height: 760px;
  border-radius: 20px;
  margin-top: 8px;
  background:
    radial-gradient(90% 80% at 50% 45%, rgba(22, 30, 52, 0.96) 0%, rgba(10, 15, 26, 0.98) 65%, #060911 100%);
  border: 1.5px solid rgba(0, 229, 255, 0.28);
  box-shadow:
    inset 0 0 110px rgba(0, 0, 0, 0.7),
    0 24px 60px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  perspective: 1100px;
  cursor: crosshair;
  user-select: none;
}

.arena3d-floor-plane {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  pointer-events: none;
}

.floor-grid-3d {
  position: absolute;
  inset: -12% -8% -8% -8%;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 166, 255, 0.08) 1px, transparent 1px);
  background-size: 46px 46px;
  transform: rotateX(34deg) scale(1.06);
  transform-origin: 50% 60%;
  opacity: 0.75;
}

/* Open Department Plazas on the 3D Floor (Watermarks stay on floor at z-index 1, never colliding) */
.plaza-zone {
  position: absolute;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: radial-gradient(ellipse at center, rgba(0, 229, 255, 0.05), rgba(8, 13, 22, 0.25));
  box-shadow: inset 0 0 36px rgba(0, 0, 0, 0.35);
  z-index: 1;
}
.plaza-research { left: 3%;  top: 5%;  width: 42%; height: 39%; border-color: rgba(0, 229, 255, 0.24); }
.plaza-gann     { right: 3%; top: 5%;  width: 42%; height: 39%; border-color: rgba(167, 139, 250, 0.28); background: radial-gradient(ellipse at center, rgba(167, 139, 250, 0.07), rgba(14, 11, 26, 0.25)); }
.plaza-quant    { left: 3%;  bottom: 5%; width: 42%; height: 41%; border-color: rgba(88, 166, 255, 0.24); }
.plaza-ops      { right: 3%; bottom: 5%; width: 42%; height: 41%; border-color: rgba(46, 204, 113, 0.26); background: radial-gradient(ellipse at center, rgba(46, 204, 113, 0.06), rgba(9, 20, 16, 0.25)); }

.plaza-watermark {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: rgba(226, 232, 240, 0.55);
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(7, 11, 18, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Central 3D Holographic Meeting Nexus */
.nexus-core-3d {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150px;
  height: 150px;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
}
.nexus-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px dashed rgba(0, 229, 255, 0.35);
  transform: rotateX(52deg);
  animation: spin3d 18s linear infinite;
}
.nexus-ring.r2 {
  inset: 22px;
  border-style: solid;
  border-color: rgba(255, 138, 0, 0.38);
  animation-duration: 11s;
  animation-direction: reverse;
}
.nexus-ring.r3 {
  inset: 44px;
  border-color: rgba(46, 204, 113, 0.45);
  animation-duration: 7s;
}
@keyframes spin3d {
  from { transform: rotateX(52deg) rotateZ(0deg); }
  to   { transform: rotateX(52deg) rotateZ(360deg); }
}
.nexus-orb {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 24px;
  margin: -12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff, #00e5ff 48%, #ff7a00 90%);
  box-shadow: 0 0 28px rgba(0, 229, 255, 0.8), 0 0 44px rgba(255, 122, 0, 0.4);
  animation: pulse 2.8s ease-in-out infinite;
}
.nexus-caption {
  position: absolute;
  left: 50%;
  top: 82%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(186, 230, 253, 0.72);
  background: rgba(6, 10, 18, 0.65);
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 229, 255, 0.2);
}

/* SVG Holographic Conversation Beams between Meeting Partners */
.arena3d-svg-links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}
.meet-beam-line {
  filter: drop-shadow(0 0 8px rgba(46, 204, 113, 0.75));
  animation: beamDash 1s linear infinite;
}
@keyframes beamDash {
  to { stroke-dashoffset: -20; }
}

/* ============================================================
   Volumetric 3D Humanoid Cyber-Agent (.bot3d)
   Anchored at feet (left %, top %); collision solver prevents overlap
   ============================================================ */
.bot3d {
  position: absolute;
  transform: translate(-50%, -100%) scale(var(--depth-scale, 1));
  transform-origin: center bottom;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 110px;
  pointer-events: auto;
  cursor: pointer;
  will-change: left, top, transform;
  transition: filter 0.25s ease;
}
.bot3d::after {
  content: '';
  position: absolute;
  bottom: 16px;
  left: 50%;
  width: 44px;
  height: 14px;
  transform: translateX(-50%) rotateX(62deg);
  border-radius: 50%;
  border: 1.5px solid rgba(0, 229, 255, 0.45);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.35), inset 0 0 8px rgba(59, 130, 246, 0.25);
  pointer-events: none;
}
.bot3d:hover {
  z-index: 120 !important;
}

/* Speech Bubble — shown only for active meeting speakers or on hover so 14 bubbles never collide! */
.bot3d-bubble {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(12, 19, 31, 0.97), rgba(7, 11, 19, 0.99));
  border: 1.5px solid rgba(46, 204, 113, 0.65);
  border-radius: 12px;
  padding: 6px 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.75), 0 0 16px rgba(46, 204, 113, 0.24);
  width: 195px;
  pointer-events: none;
  z-index: 30;
}
.bot3d-bubble.is-silent {
  display: none;
}
.bot3d:hover .bot3d-bubble.is-silent {
  display: block;
  border-color: rgba(0, 229, 255, 0.65);
}
.bot3d-bubble.is-expanded {
  display: block;
}
.bot3d.is-speaking .bot3d-bubble {
  border-color: #2ecc71;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.7), 0 0 18px rgba(46, 204, 113, 0.32);
}
.bot3d-bubble.think {
  border-color: rgba(167, 139, 250, 0.55);
}
.bot3d-bubble .bub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 2px;
}
.bot3d-bubble .bub-status {
  font-size: 9.5px;
  font-weight: 800;
  color: #6ee7b7;
}
.bot3d-bubble.think .bub-status {
  color: #c4b5fd;
}
.bot3d-bubble .bub-msg {
  font-size: 11px;
  line-height: 1.32;
  color: #f1f5f9;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: right;
}

/* 3D Body Container + Isometric Pedestal */
.bot3d-body-wrap {
  position: relative;
  width: 58px;
  height: 78px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.bot3d-pedestal {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 52px;
  height: 18px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 1;
}
.pedestal-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 229, 255, 0.5);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.35), inset 0 0 8px rgba(0, 229, 255, 0.2);
}
.bot3d.is-meeting .pedestal-ring {
  border-color: #2ecc71;
  box-shadow: 0 0 16px rgba(46, 204, 113, 0.7), inset 0 0 10px rgba(46, 204, 113, 0.35);
}
.pedestal-shadow {
  position: absolute;
  inset: 3px 6px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.8), transparent 75%);
}

/* 3D Humanoid Figure */
.bot3d-figure {
  position: relative;
  width: 48px;
  height: 72px;
  z-index: 2;
  transform: scaleX(var(--face, 1));
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.65));
}
.bot3d.is-walking .bot3d-figure {
  animation: bot3dStrideBob 0.44s ease-in-out infinite alternate;
}
.bot3d.is-meeting .bot3d-figure {
  animation: bot3dTalkGesture 1.2s ease-in-out infinite alternate;
}
@keyframes bot3dStrideBob {
  0%   { transform: scaleX(var(--face, 1)) translateY(0px) rotate(-1.5deg); }
  100% { transform: scaleX(var(--face, 1)) translateY(-4px) rotate(1.5deg); }
}
@keyframes bot3dTalkGesture {
  0%   { transform: scaleX(var(--face, 1)) translateY(0px); }
  100% { transform: scaleX(var(--face, 1)) translateY(-2px); }
}

/* 3D Isometric Head Cube */
.bot3d-head {
  position: absolute;
  left: 50%;
  top: 2px;
  width: 30px;
  height: 26px;
  margin-left: -15px;
  border-radius: 8px 8px 7px 7px;
  background:
    linear-gradient(135deg, #475e88 0%, #243452 45%, #11192a 100%);
  border: 1.5px solid rgba(0, 229, 255, 0.65);
  box-shadow:
    inset 2px 2px 4px rgba(255, 255, 255, 0.28),
    inset -3px -3px 6px rgba(0, 0, 0, 0.65),
    0 3px 10px rgba(0, 229, 255, 0.25);
  z-index: 4;
}
.head-top-plane {
  position: absolute;
  left: 3px;
  right: 3px;
  top: -3px;
  height: 5px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(90deg, #64748b, #94a3b8, #475569);
  border-top: 1px solid rgba(255, 255, 255, 0.45);
}
.head-antenna {
  position: absolute;
  left: 50%;
  top: -9px;
  width: 2.5px;
  height: 7px;
  margin-left: -1.25px;
  background: #00e5ff;
  border-radius: 2px;
  box-shadow: 0 0 8px #00e5ff;
}
.head-visor {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 6px;
  height: 9px;
  border-radius: 4px;
  background: #060b14;
  border: 1px solid rgba(0, 229, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 3px;
  box-shadow: inset 0 0 6px rgba(0, 229, 255, 0.35);
}
.visor-eye {
  width: 4.5px;
  height: 4.5px;
  border-radius: 50%;
  background: #00e5ff;
  box-shadow: 0 0 7px #00e5ff;
  animation: eyeBlink 3.4s infinite;
}
.bot3d.is-speaking .visor-eye {
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}
.head-mouth {
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 9px;
  height: 2.5px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: rgba(0, 229, 255, 0.65);
}
.bot3d.is-speaking .head-mouth {
  background: #4ade80;
  box-shadow: 0 0 7px #4ade80;
  animation: mouthTalk3d 0.24s ease-in-out infinite alternate;
}
@keyframes mouthTalk3d {
  0%   { width: 6px; height: 2px; }
  100% { width: 12px; height: 4.5px; }
}

.bot3d-neck {
  position: absolute;
  left: 50%;
  top: 27px;
  width: 10px;
  height: 4px;
  margin-left: -5px;
  background: #1e293b;
  z-index: 3;
}

/* 3D Volumetric Armored Torso & Shoulders */
.bot3d-torso {
  position: absolute;
  left: 50%;
  top: 29px;
  width: 28px;
  height: 24px;
  margin-left: -14px;
  z-index: 3;
}
.chest-plate {
  position: absolute;
  inset: 0;
  border-radius: 7px 7px 9px 9px;
  background: linear-gradient(135deg, #3b4f73 0%, #1d2b44 55%, #0e1626 100%);
  border: 1.2px solid rgba(0, 229, 255, 0.45);
  box-shadow:
    inset 2px 2px 4px rgba(255, 255, 255, 0.22),
    inset -3px -3px 6px rgba(0, 0, 0, 0.7);
  display: grid;
  place-items: center;
}
.bot3d.is-meeting .chest-plate {
  border-color: rgba(46, 204, 113, 0.75);
}
.shoulder {
  position: absolute;
  top: -1px;
  width: 8px;
  height: 9px;
  border-radius: 4px;
  background: linear-gradient(135deg, #64748b, #1e293b);
  border: 1px solid rgba(0, 229, 255, 0.45);
}
.shoulder.left  { left: -5px; }
.shoulder.right { right: -5px; }

.reactor-core {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.35), rgba(8, 15, 28, 0.9));
  border: 1px solid rgba(0, 229, 255, 0.7);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.6);
  display: grid;
  place-items: center;
  font-size: 9px;
  color: #f8fafc;
}
.bot3d.is-speaking .reactor-core {
  border-color: #4ade80;
  box-shadow: 0 0 12px #4ade80;
}

/* 3D Articulated Arms & Legs */
.bot3d-arm {
  position: absolute;
  top: 31px;
  width: 6.5px;
  height: 19px;
  border-radius: 4px;
  background: linear-gradient(90deg, #475569, #1e293b);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transform-origin: top center;
  z-index: 2;
}
.bot3d-arm.left  { left: 4px;  transform: rotate(10deg); }
.bot3d-arm.right { right: 4px; transform: rotate(-10deg); z-index: 4; }
.hand-glow {
  position: absolute;
  bottom: -1px;
  left: 1px;
  right: 1px;
  height: 4px;
  border-radius: 50%;
  background: #00e5ff;
  box-shadow: 0 0 5px #00e5ff;
}

.bot3d.is-walking .bot3d-arm.left  { animation: armSwing3dL 0.44s ease-in-out infinite alternate; }
.bot3d.is-walking .bot3d-arm.right { animation: armSwing3dR 0.44s ease-in-out infinite alternate; }
.bot3d.is-speaking .bot3d-arm.right { animation: armTalkGesture 0.55s ease-in-out infinite alternate; }
@keyframes armSwing3dL { 0% { transform: rotate(28deg); } 100% { transform: rotate(-26deg); } }
@keyframes armSwing3dR { 0% { transform: rotate(-28deg); } 100% { transform: rotate(26deg); } }
@keyframes armTalkGesture { 0% { transform: rotate(-15deg); } 100% { transform: rotate(-48deg); } }

.bot3d-leg {
  position: absolute;
  bottom: 4px;
  width: 7.5px;
  height: 19px;
  border-radius: 4px;
  background: linear-gradient(90deg, #334155, #0f172a);
  border: 1px solid rgba(0, 229, 255, 0.25);
  transform-origin: top center;
  z-index: 2;
}
.bot3d-leg.left  { left: 14px; }
.bot3d-leg.right { right: 14px; }
.boot {
  position: absolute;
  bottom: -2px;
  left: -1px;
  right: -2px;
  height: 5px;
  border-radius: 3px 5px 2px 2px;
  background: linear-gradient(90deg, #0ea5e9, #1e293b);
}
.bot3d.is-walking .bot3d-leg.left  { animation: legStride3dL 0.44s ease-in-out infinite alternate; }
.bot3d.is-walking .bot3d-leg.right { animation: legStride3dR 0.44s ease-in-out infinite alternate; }
@keyframes legStride3dL { 0% { transform: rotate(-26deg); } 100% { transform: rotate(26deg); } }
@keyframes legStride3dR { 0% { transform: rotate(26deg); } 100% { transform: rotate(-26deg); } }

/* Nameplate beneath feet */
.bot3d-nameplate {
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(6, 10, 18, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}
.bot3d-nameplate b {
  font-size: 11.5px;
  font-weight: 800;
  color: #f8fafc;
  margin-left: 4px;
}
.bot3d-nameplate span {
  font-size: 10px;
  color: #94a3b8;
}
.bot3d-zone-badge {
  margin-top: 2px;
  font-size: 9.5px;
  font-weight: 700;
  color: #7dd3fc;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 6px;
  padding: 1px 6px;
}

/* ==========================================================================
   MOBILE APP SHELL, PWA STANDALONE & RESPONSIVE DESIGN (iOS & Android Ready)
   ========================================================================== */

html, body {
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mobile-menu-btn,
.mobile-sidebar-head,
.mobile-drawer-backdrop,
.mobile-bottom-nav {
  display: none;
}

.pwa-install-btn {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.24), rgba(56, 189, 248, 0.24));
  border: 1px solid rgba(52, 211, 153, 0.55);
  color: #ecfdf5;
  font-weight: 700;
  white-space: nowrap;
}

.pwa-install-btn:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.36), rgba(56, 189, 248, 0.36));
}

/* Safe-area support for notched iPhones & standalone PWA / Capacitor */
@media (display-mode: standalone) {
  .topbar {
    padding-top: max(10px, env(safe-area-inset-top));
  }
}

@media (max-width: 960px) {
  .shell {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    width: 100%;
    overflow-x: hidden;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    padding: max(8px, env(safe-area-inset-top)) 12px 8px 12px;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: space-between;
    background: rgba(9, 15, 26, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .topbar .brand em {
    display: none;
  }

  .topbar .brand strong {
    font-size: 14px;
    letter-spacing: 0.04em;
  }

  .topbar-actions {
    gap: 6px;
    flex-wrap: nowrap;
    overflow: hidden;
  }

  #pill-tick,
  #pill-autopilot {
    display: none;
  }

  #pill-data {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    padding: 3px 7px;
  }

  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    font-size: 18px;
    border-radius: 10px;
    flex-shrink: 0;
  }

  /* Slide-out RTL drawer for full navigation */
  .mobile-drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(2, 6, 14, 0.72);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }

  .mobile-drawer-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed !important;
    top: 0;
    bottom: 0;
    right: 0;
    width: min(82vw, 310px) !important;
    max-width: 310px;
    z-index: 90;
    background: #0b1220 !important;
    border-left: 1px solid rgba(56, 189, 248, 0.22);
    padding: max(14px, env(safe-area-inset-top)) 12px max(18px, env(safe-area-inset-bottom)) 12px !important;
    transform: translateX(105%);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto;
    display: flex !important;
    flex-direction: column;
    box-shadow: -12px 0 36px rgba(0, 0, 0, 0.65);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 4px 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    font-size: 14px;
  }

  .sidebar .nav-item {
    min-height: 44px;
    font-size: 14px;
  }

  body.mobile-drawer-open {
    overflow: hidden;
  }

  /* Main content view with bottom tab bar clearance */
  .view {
    width: 100%;
    max-width: 100vw;
    padding: 12px 12px calc(78px + env(safe-area-inset-bottom)) 12px !important;
    overflow-x: hidden;
  }

  /* Native-style fixed mobile bottom navigation bar */
  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    background: rgba(9, 15, 26, 0.96);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)) 4px;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5);
  }

  .mobile-tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 5px 2px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    min-height: 46px;
    transition: color 0.15s ease, background 0.15s ease;
  }

  .mobile-tab-btn .m-ic {
    font-size: 18px;
    line-height: 1;
  }

  .mobile-tab-btn .m-lbl {
    font-size: 10.5px;
    font-weight: 600;
    white-space: nowrap;
  }

  .mobile-tab-btn.active {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
  }

  /* Responsive page headers, grids, cards & tables */
  .page-head {
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px;
  }

  .page-head h1 {
    font-size: 20px;
  }

  .head-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 6px;
  }

  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4 {
    grid-template-columns: 1fr !important;
  }

  .card {
    padding: 12px !important;
    border-radius: 12px;
  }

  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* TradingView Chart Workspace Mobile Tuning */
  .tv-workspace-root {
    min-height: 460px !important;
    border-radius: 10px !important;
  }

  .tv-center-pane {
    min-height: 360px !important;
  }

  .tv-left-rail {
    width: 34px !important;
    padding: 4px 0 !important;
    gap: 4px !important;
  }

  .tv-left-rail button {
    width: 28px !important;
    height: 28px !important;
    font-size: 12px !important;
  }

  .tv-hud {
    font-size: 10px !important;
    gap: 6px !important;
    padding: 3px 6px !important;
    flex-wrap: wrap;
    max-width: calc(100% - 20px);
  }

  .tv-countdown-badge {
    display: none;
  }

  .tv-right-drawer {
    position: absolute !important;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(85vw, 290px) !important;
    z-index: 25 !important;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.7);
  }

  .tv-gann-pivot-popover {
    width: min(92vw, 300px) !important;
    left: 50% !important;
    transform: translateX(-50%);
    top: 10px !important;
  }

  /* Toasts above mobile bottom nav */
  .toasts {
    bottom: calc(74px + env(safe-area-inset-bottom)) !important;
    left: 12px !important;
    right: 12px !important;
  }

  /* Page chat floating button above mobile bottom nav */
  .page-chat-fab,
  #page-chat-toggle {
    bottom: calc(74px + env(safe-area-inset-bottom)) !important;
  }
}

@media (max-width: 480px) {
  #pill-data {
    display: none;
  }

  #btn-quick-tick {
    padding: 5px 8px;
    font-size: 11px;
  }

  .pwa-install-btn {
    padding: 5px 8px;
    font-size: 11px;
  }

  .btn {
    min-height: 36px;
  }
}




