:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #a1a1a6;
  --line: #e8e8ed;
  --accent: #0071e3;
  --green: #30a46c;
  --red: #e5484d;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 18px rgba(0, 0, 0, .04);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { background: var(--card); border-radius: 28px; box-shadow: var(--shadow); padding: 48px 40px; max-width: 400px; text-align: center; }
.login-card h1 { font-size: 28px; letter-spacing: -.02em; margin: 18px 0 8px; }
.login-card p { color: var(--ink-2); margin: 0 0 28px; }
.brand-mark { width: 56px; height: 56px; margin: 0 auto; border-radius: 16px; background: linear-gradient(135deg, #1d1d1f, #48484a);
  color: #fff; font-weight: 700; font-size: 28px; display: grid; place-items: center; }
.brand-mark.small { width: 28px; height: 28px; border-radius: 8px; font-size: 15px; margin: 0; display: inline-grid; }
.btn-primary { background: var(--ink); color: #fff; border: 0; border-radius: 999px; padding: 13px 26px; font-weight: 600; }
.btn-primary:hover { background: #000; }
.error { color: var(--red); margin-top: 16px !important; font-size: 14px; }
.link { background: none; border: 0; color: var(--accent); padding: 0; }

/* Shell */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 14px; display: flex; flex-direction: column;
  background: rgba(245, 245, 247, .8); backdrop-filter: blur(20px); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; padding: 0 10px 18px; letter-spacing: -.01em; }
nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 12px; border: 0; background: none;
  text-align: left; color: var(--ink); width: 100%; }
.nav-item:hover { background: rgba(0, 0, 0, .04); }
.nav-item.active { background: var(--card); box-shadow: var(--shadow); }
.nav-item img, .nav-all { width: 34px; height: 34px; border-radius: 9px; flex: none; }
.nav-all { background: linear-gradient(135deg, #e8e8ed, #d2d2d7); display: grid; place-items: center; font-size: 16px; }
.nav-text { flex: 1; min-width: 0; }
.nav-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-sub { font-size: 12px; color: var(--ink-2); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block; margin-right: 5px; vertical-align: 1px;
  box-shadow: 0 0 0 0 rgba(48, 164, 108, .5); animation: pulse 2s infinite; }
.live-dot.off { background: var(--ink-3); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(48, 164, 108, .45); } 70% { box-shadow: 0 0 0 7px rgba(48, 164, 108, 0); } 100% { box-shadow: 0 0 0 0 rgba(48, 164, 108, 0); } }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; font-size: 12px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.sidebar-foot span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { padding: 34px 40px 60px; max-width: 1240px; width: 100%; }

/* Header */
.head { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; flex-wrap: wrap; }
.head img { width: 64px; height: 64px; border-radius: 15px; box-shadow: var(--shadow); }
.head h1 { font-size: 30px; letter-spacing: -.025em; margin: 0; line-height: 1.1; }
.head .sub { color: var(--ink-2); margin-top: 4px; font-size: 14px; }
.head-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.pill { background: var(--card); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow); white-space: nowrap; }
.seg { display: inline-flex; background: rgba(0, 0, 0, .05); border-radius: 10px; padding: 2px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 8px; font-size: 13px; color: var(--ink-2); }
.seg button.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

/* Cards */
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(4, 1fr); margin-bottom: 14px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; min-width: 0; }
.kpi .label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.kpi .value { font-size: 30px; font-weight: 700; letter-spacing: -.03em; margin-top: 6px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .note { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.kpi .value.muted { color: var(--ink-3); font-size: 22px; }
.two { grid-template-columns: 1.4fr 1fr; margin-bottom: 14px; }
.card h2 { font-size: 17px; margin: 0 0 4px; letter-spacing: -.01em; }
.card .hint { color: var(--ink-2); font-size: 13px; margin: 0 0 14px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* Charts */
.chart { width: 100%; height: 210px; display: block; }
.chart text { font-size: 11px; fill: var(--ink-3); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Funnel */
.funnel-row { display: grid; grid-template-columns: 170px 1fr 64px 58px; align-items: center; gap: 12px; padding: 7px 0; font-size: 14px; }
.funnel-row .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 22px; background: #f0f0f3; border-radius: 7px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 7px; }
.funnel-row .n { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.funnel-row .drop { text-align: right; font-size: 12px; color: var(--red); font-variant-numeric: tabular-nums; }

/* Table */
.table-wrap { overflow-x: auto; margin: 0 -22px -20px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 500; color: var(--ink-2); font-size: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #fafafc; }
th:first-child, td:first-child { padding-left: 22px; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.tag.pro { background: #e7f6ee; color: #1d7a4c; }
.tag.on { background: #e8f1fd; color: #1f62c9; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; color: var(--ink-2); }
.empty { color: var(--ink-3); text-align: center; padding: 30px 0; font-size: 14px; }
.notice { background: #fff8e6; border-radius: 14px; padding: 12px 16px; font-size: 13px; color: #8a5a00; margin-bottom: 14px; }

/* Reviews */
.review { padding: 12px 0; border-bottom: 1px solid var(--line); }
.review:last-child { border-bottom: 0; }
.stars { color: #ff9f0a; letter-spacing: 1px; font-size: 13px; }
.review b { font-size: 14px; }
.review p { margin: 4px 0 0; color: var(--ink-2); font-size: 13.5px; }
.review .meta { font-size: 12px; color: var(--ink-3); }

/* Overview (all apps) */
.apps-table td img { width: 30px; height: 30px; border-radius: 8px; vertical-align: middle; margin-right: 10px; }

/* Drawer */
.drawer { position: fixed; inset: 0; z-index: 10; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .18); }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(480px, 100%); background: var(--card); padding: 28px 26px;
  overflow-y: auto; box-shadow: -10px 0 40px rgba(0, 0, 0, .12); }
.drawer-close { position: absolute; top: 16px; right: 16px; border: 0; background: #f0f0f3; width: 30px; height: 30px; border-radius: 50%; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 18px 0 22px; font-size: 13.5px; }
.facts div span { display: block; color: var(--ink-2); font-size: 12px; }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 14px 16px; font-size: 13.5px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); }
.timeline li.k::before { background: var(--accent); }
.timeline time { display: block; color: var(--ink-3); font-size: 12px; }

@media (max-width: 1000px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .two { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; height: auto; z-index: 5; padding: 12px 16px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0 0 10px; }
  nav { flex-direction: row; overflow-x: auto; gap: 6px; }
  .nav-item { width: auto; flex: none; padding: 6px 10px 6px 6px; }
  .nav-sub, .sidebar-foot { display: none; }
  main { padding: 20px 16px 48px; }
  .head h1 { font-size: 24px; }
  .head-right { margin-left: 0; width: 100%; }
  .kpi .value { font-size: 24px; }
  .funnel-row { grid-template-columns: 110px 1fr 46px 46px; gap: 8px; font-size: 13px; }
  .facts { grid-template-columns: 1fr; }
}

/* Keep wide children (tables, charts) from stretching the page on narrow screens. */
main, .shell > *, .grid > *, .head > div { min-width: 0; }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
@media (max-width: 1000px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px -16px; }
  th:first-child, td:first-child { padding-left: 16px; }
  .kpi .value { font-size: 22px; }
}

/* ---------------------------------------------------------------- Office */
.nav-item img[src*="office/"] { border-radius: 50%; }
textarea { font: inherit; width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; resize: vertical; background: #fbfbfd; color: var(--ink); }
textarea:focus { outline: none; border-color: #c7c7cc; background: #fff; }
.mini { border: 0; background: var(--ink); color: #fff; border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 600; }
.mini.ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.mini:disabled { opacity: .5; }
.feed { display: flex; flex-direction: column; margin: 4px -8px 0; }
.feed-item { display: flex; gap: 12px; text-align: left; background: none; border: 0; padding: 12px 8px; border-radius: 14px; color: var(--ink); width: 100%; }
.feed-item:hover { background: #fafafc; }
.feed-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.feed-body { min-width: 0; flex: 1; }
.feed-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.feed-top time { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.feed-title { font-size: 14px; font-weight: 600; margin-top: 3px; }
.feed-summary { font-size: 13px; color: var(--ink-2); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 9px 2px 3px; border-radius: 999px;
  background: color-mix(in srgb, var(--team, #8e8e93) 12%, white); color: color-mix(in srgb, var(--team, #3a3a3c) 80%, black); border: 0; }
.chip img { width: 16px; height: 16px; border-radius: 5px; }
.chip.soft { padding: 2px 9px; background: #f0f0f3; color: var(--ink-2); }
.chip.link { cursor: pointer; padding: 4px 11px 4px 4px; font-size: 12.5px; }
.chip.link img { width: 22px; height: 22px; border-radius: 50%; }
.badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #f0f0f3; color: var(--ink-2); }
.badge.running { background: #e7f6ee; color: #1d7a4c; }
.badge.queued { background: #fff3e0; color: #b26b00; }
.badge.done { background: #e8f1fd; color: #1f62c9; }
.badge.failed { background: #fdecec; color: #c0392b; }
/* Thread drawer */
.drawer-panel { width: min(640px, 100%); }
.thread-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding-right: 30px; }
.thread-head img { width: 56px; height: 56px; border-radius: 50%; }
.thread-head h2 { margin: 0; font-size: 20px; }
.thread-head .sub { color: var(--ink-2); font-size: 13px; }
.messages { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.msg { font-size: 14px; line-height: 1.5; }
.msg time { display: block; font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.msg.user { align-self: flex-end; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 18px 18px 4px 18px; max-width: 85%; }
.msg.user time { color: rgba(255,255,255,.6); }
.msg.system { align-self: center; font-size: 12.5px; color: #c0392b; background: #fdecec; padding: 6px 12px; border-radius: 10px; }
.msg.agent, .msg.manager { display: flex; gap: 10px; align-items: flex-start; }
.msg-avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; }
.msg.agent > div, .msg.manager > div { background: #f5f5f7; border-radius: 4px 18px 18px 18px; padding: 10px 14px; min-width: 0; flex: 1; }
.msg-title { font-weight: 700; margin-bottom: 4px; }
.md { overflow-wrap: anywhere; }
.md p { margin: 0 0 8px; } .md p:last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3 { font-size: 15px; margin: 12px 0 6px; }
.md ul, .md ol { margin: 4px 0 8px; padding-left: 20px; }
.md table { font-size: 12.5px; margin: 8px 0; display: block; overflow-x: auto; }
.md th, .md td { padding: 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.md code { font-size: 12px; background: #e9e9ee; padding: 1px 5px; border-radius: 5px; }
.links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.proposals { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.proposal { background: #fff; border-radius: 14px; padding: 10px 12px; box-shadow: inset 0 0 0 1px var(--line); }
.proposal.approved { box-shadow: inset 0 0 0 1.5px #30a46c; }
.proposal.rejected { opacity: .55; }
.proposal-top { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.proposal .diff { font-size: 13px; margin: 6px 0 2px; display: flex; flex-direction: column; gap: 2px; }
.proposal .diff s { color: var(--ink-3); }
.proposal p { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-2); }
.proposal-actions { display: flex; gap: 6px; margin-top: 8px; }
.typing { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--ink-2); padding-left: 42px; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: #b0b0b5; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.composer { display: flex; gap: 10px; align-items: flex-end; position: sticky; bottom: -28px; background: #fff; padding: 12px 0 4px; }
/* 3D office: the scene fills the page, panels float on top. */
main.wide { max-width: none; padding: 0; height: 100vh; overflow: hidden; }
.office3d { position: relative; height: 100%; overflow: hidden; container-type: inline-size; --sky-top: #9fd3f2; --sky-bottom: #eaf6fb;
  background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom)); transition: background 2s; }
.scene { position: absolute; inset: 0; z-index: 0; }   /* own stacking context: labels stay under the panels and the drawer */
.scene canvas { display: block; }
.scene-labels { position: absolute; top: 0; left: 0; cursor: grab; touch-action: none; }
.scene-labels:active { cursor: grabbing; }
.scene-header { position: absolute; top: 16px; left: 16px; right: 360px; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.scene-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; pointer-events: none; }
.scene-top > * { pointer-events: auto; }
.scene-title { display: flex; flex-direction: column; padding: 6px 14px; border-radius: 16px; background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(18px); box-shadow: var(--shadow); line-height: 1.2; }
.scene-title b { font-size: 17px; letter-spacing: -.02em; }
.scene-title span { font-size: 11.5px; color: var(--ink-2); }
.scene-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.round-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .82); backdrop-filter: blur(18px);
  box-shadow: var(--shadow); font-size: 16px; color: var(--ink); }
.btn-pill.dark { background: var(--ink); color: #fff; }
.btn-pill.on { background: #30a46c; color: #fff; }
.scene-areas { display: flex; gap: 6px; flex-wrap: wrap; pointer-events: none; }
.scene-areas button { pointer-events: auto; white-space: nowrap; border: 0; border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; color: var(--ink);
  background: rgba(255, 255, 255, .72); backdrop-filter: blur(14px); box-shadow: 0 2px 10px rgba(30, 40, 60, .08); }
.scene-areas button:hover { background: #fff; }
.office3d.side-closed .scene-header { right: 16px; }
.present-exit { display: none; }
.btn-pill { border: 0; color: var(--ink); }
.office3d.side-closed .scene-side { display: none; }

.office3d:not(.side-closed) #side-toggle { background: var(--ink); color: #fff; }
.btn-pill:hover { background: #fafafa; }
/* Floating side panel: team list and live feed */
.scene-side { position: absolute; top: 16px; right: 16px; bottom: 150px; width: 328px; display: flex; flex-direction: column; gap: 10px;
  background: rgba(255, 255, 255, .82); backdrop-filter: blur(22px) saturate(1.4); border-radius: 22px; padding: 12px;
  box-shadow: 0 8px 40px rgba(40, 30, 20, .12), inset 0 0 0 1px rgba(255, 255, 255, .7); }
.scene-side .seg { align-self: stretch; }
.scene-side .seg button { flex: 1; }
.side-body { overflow-y: auto; margin: 0 -4px; padding: 0 4px; flex: 1; }
.side-body .feed { margin: 0; }
.side-body .feed-item { padding: 10px 6px; }
.side-body .feed-avatar { width: 34px; height: 34px; }
.side-body .feed-title { font-size: 13px; }
.side-body .feed-summary { font-size: 12px; }
.crew-team { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: color-mix(in srgb, var(--team) 80%, black);
  margin: 12px 6px 4px; text-transform: uppercase; letter-spacing: .04em; }
.crew-team img { width: 20px; height: 20px; border-radius: 6px; }
.crew { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 12px; }
.crew:hover { background: rgba(0, 0, 0, .035); }
.crew > img { width: 34px; height: 34px; border-radius: 50%; flex: none; }
.crew-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.crew-main[data-thread] { cursor: pointer; }
.crew-main b { font-size: 13.5px; }
.crew-main span { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crew-state { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.crew.running .crew-state { color: #1d7a4c; font-weight: 700; }
.crew.queued .crew-state { color: #b26b00; font-weight: 700; }
.icon-btn { border: 0; background: #fff; width: 26px; height: 26px; border-radius: 50%; font-size: 12px; color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line); flex: none; display: grid; place-items: center; padding: 0; }
.icon-btn:hover { background: var(--ink); color: #fff; }
.icon-btn:disabled { opacity: .4; }
/* Command bar: write a task, pick who gets it */
.scene-command { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(760px, calc(100% - 32px));
  background: rgba(255, 255, 255, .9); backdrop-filter: blur(22px) saturate(1.4); border-radius: 22px; padding: 12px 12px 10px;
  box-shadow: 0 12px 48px rgba(40, 30, 20, .16), inset 0 0 0 1px rgba(255, 255, 255, .7); }
.scene-command textarea { border: 0; background: transparent; resize: none; font-size: 15px; padding: 4px 6px; }
.scene-command textarea:focus { background: transparent; }
.command-row { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.command-row label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding-left: 6px; }
.command-row select { font: inherit; font-size: 13.5px; border: 0; background: #f0f0f3; border-radius: 10px; padding: 7px 10px; color: var(--ink);
  min-width: 0; flex: 0 1 300px; }
.kbd { margin-left: auto; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.command-row .btn-primary { padding: 10px 20px; white-space: nowrap; }
/* Labels in the scene */
.agent-anchor { pointer-events: none; }
.agent-box { position: relative; will-change: transform; }
.agent-box.lifted::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1.5px; height: var(--lift); margin-left: -.75px;
  background: linear-gradient(rgba(29, 29, 31, .35), rgba(29, 29, 31, 0)); }
.agent-tag { pointer-events: auto; cursor: pointer; display: flex; align-items: center; gap: 5px; white-space: nowrap; width: max-content;
  max-width: 260px; background: rgba(255, 255, 255, .96); border-radius: 999px; padding: 4px 6px 4px 8px; font-size: 11.5px; line-height: 1.3;
  box-shadow: 0 4px 14px rgba(30, 30, 50, .16); transition: transform .15s; }
.agent-tag:hover { transform: scale(1.06); }
.agent-anchor:hover { z-index: 999 !important; }
.agent-tag .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--team, #b0b0b5); flex: none; }
.agent-tag b { font-weight: 700; }
.agent-tag .who { color: var(--ink-3); font-weight: 600; padding: 1px 7px; border-radius: 999px; background: #f2f2f5; font-size: 10.5px; }
.agent-tag .job { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.agent-tag .model { font-style: normal; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: #f2f2f5; color: var(--ink-2); flex: none; }
.agent-tag[data-state="running"] { box-shadow: 0 6px 18px rgba(30, 30, 50, .2), inset 0 0 0 2px var(--team, #30a46c); }
.agent-tag[data-state="running"] .dot { animation: pulse 1.6s infinite; }
.agent-tag[data-state="queued"] { box-shadow: 0 6px 18px rgba(255, 159, 10, .25), inset 0 0 0 2px #ff9f0a; }
.agent-tag[data-state="queued"] .dot { background: #ff9f0a; }
/* detail follows zoom: far = only who is working, mid = role, near = role + name */
.scene-labels[data-lod="far"] .agent-tag[data-state="idle"] { display: none; }
.scene-labels[data-lod="mid"] .agent-tag[data-state="idle"] .who { display: none; }
.scene-labels[data-lod="far"] .agent-tag .job { max-width: 150px; }
.scene-labels.over-person { cursor: pointer; }
.agent-bubble { pointer-events: none; background: #fff; color: var(--ink); font-size: 12.5px; font-weight: 600; padding: 7px 12px; border-radius: 14px;
  width: max-content; max-width: 240px; box-shadow: 0 6px 20px rgba(30, 30, 50, .2); position: absolute; left: 50%; bottom: calc(100% + 10px);
  transform: translateX(-50%); animation: pop .25s ease-out; z-index: 2; }
.agent-bubble::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; background: #fff;
  transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 6px) scale(.9); } to { opacity: 1; transform: translateX(-50%); } }
.room-tag { pointer-events: auto; cursor: pointer; display: flex; align-items: center; gap: 6px; white-space: nowrap; border-radius: 999px;
  background: rgba(255, 255, 255, .94); padding: 4px 12px 4px 4px; font-size: 12.5px; box-shadow: 0 4px 14px rgba(30, 30, 50, .14); transition: transform .15s; }
.room-tag:hover { transform: scale(1.06); }
.room-tag img { width: 22px; height: 22px; border-radius: 7px; }
.room-tag.room { box-shadow: 0 4px 14px rgba(30, 30, 50, .14), inset 0 -2px 0 var(--team); }
.room-tag span { color: var(--ink-2); }
.room-tag.dark { background: #1d1d1f; color: #fff; padding-left: 12px; }
.room-tag.dark span { color: rgba(255, 255, 255, .65); }
.room-tag.zone { padding: 4px 11px; font-size: 12px; font-weight: 600; background: rgba(255, 255, 255, .8); backdrop-filter: blur(8px); }
/* collapsible chrome: menu, team panel, command bar; presentation mode hides it all */
.shell.nav-hidden, body.presenting .shell { grid-template-columns: minmax(0, 1fr); }
.shell.nav-hidden .sidebar, body.presenting .sidebar { display: none; }
.office3d.cmd-closed .scene-command { display: none; }
.cmd-show { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); border: 0; color: #fff; background: var(--ink);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2); padding: 11px 20px; }
.office3d:not(.cmd-closed) .cmd-show { display: none; }
.cmd-hide { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; font-size: 11px; color: var(--ink-3); }
.scene-command textarea { padding-right: 34px; }
body.presenting .scene-side, body.presenting .scene-command, body.presenting .cmd-show, body.presenting .scene-actions,
body.presenting #runner-pill, body.presenting #nav-toggle { display: none !important; }
body.presenting .scene-header { right: 16px; }
body.presenting .scene-areas { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); flex-wrap: nowrap; }
body.presenting .present-exit { display: inline-flex; position: absolute; top: 16px; right: 16px; border: 0; opacity: .6; }
body.presenting .present-exit:hover { opacity: 1; }
body.presenting main.wide { height: 100vh; }
@media (max-width: 1100px) {
  .scene-side { width: 290px; }
  .scene-header { right: 320px; }
}
@media (max-width: 760px) {
  main.wide { height: calc(100vh - 110px); height: calc(100dvh - 110px); }
  .scene-header { right: 12px; left: 12px; top: 12px; }
  .scene-title b { font-size: 18px; }
  .scene-side { left: 12px; right: 12px; width: auto; top: 112px; bottom: 140px; z-index: 3; }
  .scene-command { bottom: 12px; padding: 10px; }
  .agent-tag .model { display: none; }
  .agent-tag { font-size: 10.5px; padding: 2px 7px 2px 6px; }
  .room-tag { font-size: 11px; padding: 3px 8px 3px 3px; }
  .room-tag img { width: 18px; height: 18px; }
  .kbd, .command-row label, .scene-actions #tour-btn, .scene-title span { display: none; }
  .scene-areas { flex-wrap: nowrap; overflow-x: auto; }
  .command-row select { flex: 1; }
  .agent-tag .job { display: none; }
  .agent-tag { max-width: 120px; }
}

/* Left menu: narrow icon rail or hidden (wide screens) */
.brand .side-btn:first-of-type { margin-left: auto; }
.side-btn { border: 0; width: 26px; height: 26px; border-radius: 50%; background: rgba(0, 0, 0, .05); color: var(--ink-2); font-size: 13px;
  flex: none; display: grid; place-items: center; padding: 0; }
.side-btn:hover { background: var(--ink); color: #fff; }
.nav-icon { position: relative; display: inline-flex; flex: none; }
.nav-badge { display: none; position: absolute; right: -3px; bottom: -3px; width: 11px; height: 11px; border-radius: 50%; background: var(--green);
  border: 2px solid var(--bg); }
.shell.nav-rail { grid-template-columns: 72px minmax(0, 1fr); }
.shell.nav-rail .sidebar { padding: 16px 10px; align-items: center; }
.shell.nav-rail .brand { flex-direction: column; gap: 8px; padding: 0 0 12px; }
.shell.nav-rail .brand .side-btn:first-of-type { margin-left: 0; }
.shell.nav-rail .brand-text, .shell.nav-rail .nav-text, .shell.nav-rail #nav-close, .shell.nav-rail .sidebar-foot { display: none; }
.shell.nav-rail .nav-item { width: 50px; justify-content: center; padding: 8px; }
.shell.nav-rail .nav-badge.on { display: block; }
.nav-open { display: none; position: fixed; top: 16px; left: 16px; z-index: 6; }
.shell.nav-hidden .nav-open { display: grid; place-items: center; }
.shell:has(main.wide) .nav-open, body.presenting .nav-open { display: none !important; }
.shell.nav-hidden main:not(.wide) { padding-left: 76px; }
/* Team panel: header buttons and the narrow avatar rail */
.side-head { display: flex; align-items: center; gap: 6px; }
.side-head .seg { flex: 1; }
.office3d.side-rail .scene-side { width: 66px; padding: 8px; bottom: auto; max-height: calc(100% - 170px); }
.office3d.side-rail #side-tabs { display: none; }
.office3d.side-rail .side-head { flex-direction: column; }
.office3d.side-rail .side-body { margin: 0; padding: 0 2px; scrollbar-width: none; }
.office3d.side-rail .scene-header { right: 98px; }
.rail-av { border: 0; padding: 0; background: none; width: 40px; height: 40px; border-radius: 50%; display: block; margin: 6px auto; transition: transform .15s; }
.rail-av:hover { transform: scale(1.1); }
.rail-av img { width: 40px; height: 40px; border-radius: 50%; display: block; }
.rail-av.running { box-shadow: 0 0 0 2.5px #fff, 0 0 0 4.5px var(--green); }
.rail-av.queued { box-shadow: 0 0 0 2.5px #fff, 0 0 0 4.5px #ff9f0a; }
.rail-team { width: 22px; height: 22px; border-radius: 6px; display: block; margin: 12px auto 2px; opacity: .9; }
@media (max-width: 760px) { .brand .side-btn, .side-head .side-btn { display: none; } }

/* Clock next to the runner status */
.clock-pill { display: inline-flex; align-items: center; gap: 7px; }
.clock-pill b { font-size: 14px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.clock-date { color: var(--ink-2); font-weight: 500; }
/* the header packs itself into what the office has room for */
@container (max-width: 1500px) { .scene-top .btn-label { display: none; } }
@container (max-width: 1100px) { .clock-date { display: none; } }
@container (max-width: 900px) { .scene-title span { display: none; } }
