/* The control-tower overlay on the 3D office (public/js/office3d/hud.js) and the 3D labels */
#hud3d { position: absolute; inset: 0; pointer-events: none; z-index: 2; font-family: var(--font); color: var(--text); }
#hud3d > * { pointer-events: auto; }
.card { background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid rgba(222,228,242,0.95); border-radius: var(--radius); box-shadow: var(--shadow); }
.chip { display: inline-block; border-radius: 6px; padding: 2px 8px; font: 700 11.5px/1.5 var(--font); white-space: nowrap; }
.chip--green { background: var(--ok-50); color: var(--ok); }
.chip--blue { background: var(--accent-50); color: #3157d5; }
.chip--orange { background: var(--warn-50); color: var(--warn); }
.chip--gray { background: #f1f3f7; color: #8a92a6; }
.chip--purple { background: #f1eafe; color: #7a4fd6; }
.icon-btn { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--text); font: 700 14px/1 var(--font); cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: var(--panel-2); }
.icon-btn--active { background: var(--accent); color: #fff; border-color: var(--accent); }
.eyebrow { font: 800 10.5px/1.2 var(--font); letter-spacing: .05em; color: var(--accent); text-transform: uppercase; }
.grow { flex: 1; min-width: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; border: 1px solid rgba(0,0,0,0.08); }

/* KPI cards */
.h3-kpis { position: absolute; left: 22px; top: 16px; display: flex; gap: 10px; flex-wrap: wrap; max-width: calc(100% - 420px); }
.h3-kpis[hidden] { display: none; }
.kpi { display: flex; gap: 10px; align-items: center; padding: 10px 14px 10px 10px; min-width: 200px; text-align: left; cursor: pointer; font-family: var(--font); color: var(--text); }
.kpi:hover { border-color: #c9d6ff; }
.kpi-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-50); display: grid; place-items: center; font-size: 18px; flex: none; }
.kpi-txt { display: flex; flex-direction: column; line-height: 1.25; }
.kpi-txt small { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.kpi-txt b { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi-txt { min-width: 0; } .kpi-txt b, .kpi-txt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-txt em { font-style: normal; font-size: 11.5px; font-weight: 800; margin-left: 4px; }
.kpi-txt em.up { color: var(--ok); }
.kpi-txt em.down { color: var(--bad); }
.kpi-txt em.flat { color: var(--muted); font-weight: 700; }

/* map controls */
.h3-ctl { position: absolute; right: 22px; top: 16px; display: flex; flex-direction: row; align-items: center; gap: 6px; padding: 6px 7px; }
.h3-gfx { font-size: 12px; }
.h3-sep { width: 1px; height: 22px; background: var(--line); margin: 0 2px; }

/* the detail panel */
.h3-side { position: absolute; right: 22px; top: 70px; width: 350px; max-height: calc(100% - 324px); overflow: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.h3-head { display: flex; gap: 12px; align-items: center; }
.h3-name { font-size: 18px; font-weight: 800; line-height: 1.2; }
.h3-badge { width: 42px; height: 42px; border-radius: 11px; background: var(--accent); color: #fff; font-weight: 800; display: grid; place-items: center; flex: none; text-shadow: 0 1px 2px rgba(0,0,0,0.25); }
.h3-tools { display: flex; gap: 6px; align-self: flex-start; }
.h3-doing { font-size: 12.5px; font-weight: 600; color: #454c60; }
.h3-sub { font-weight: 800; font-size: 13px; margin-top: 2px; }
.h3-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.h3-grid > div { background: #f6f8fb; border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; display: flex; flex-direction: column; min-width: 0; }
.h3-grid small { color: var(--muted); font-size: 11px; font-weight: 600; }
.h3-grid b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h3-rows { display: flex; flex-direction: column; gap: 2px; }
.h3-row { display: flex; gap: 9px; align-items: center; width: 100%; text-align: left; border: 0; background: transparent; border-radius: 9px; padding: 6px 8px; cursor: pointer; font: 600 12.5px/1.3 var(--font); color: var(--text); }
.h3-row:hover { background: var(--accent-50); }
.h3-row b { font-weight: 800; }
.chev { color: #aab1c2; font-size: 16px; }
.h3-feed { display: flex; flex-direction: column; gap: 6px; }
.h3-fl { font-size: 12px; line-height: 1.35; border-left: 3px solid var(--line); padding: 2px 0 2px 8px; color: #3d4457; max-height: 4.1em; overflow: hidden; }
.h3-fl time { display: block; color: var(--muted); font-size: 10.5px; font-weight: 700; }
.h3-fl.say { border-color: #9fb3d1; }
.h3-fl.doing { border-color: #f0c84a; }
.h3-fl.handoff { border-color: #5dade2; }
.h3-fl.done { border-color: var(--ok); }
.h3-actions { gap: 6px; }

/* a bear's round avatar in its fur colour */
.h3-av { width: 28px; height: 28px; border-radius: 50%; background: var(--fur); position: relative; flex: none; box-shadow: inset 0 -3px 0 rgba(0,0,0,0.12); }
.h3-av::before, .h3-av::after { content: ""; position: absolute; top: -3px; width: 11px; height: 11px; border-radius: 50%; background: var(--fur); }
.h3-av::before { left: -1px; }
.h3-av::after { right: -1px; }
.h3-av i { position: absolute; left: 50%; top: 56%; width: 13px; height: 9px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--muz); z-index: 1; }
.h3-av.big { width: 46px; height: 46px; }
.h3-av.big::before, .h3-av.big::after { width: 17px; height: 17px; top: -4px; }
.h3-av.big i { width: 20px; height: 14px; }

/* the task tracker */
.h3-track { position: absolute; left: 22px; bottom: 18px; width: min(880px, calc(100% - 520px)); padding: 12px 16px; }
.h3-title { display: flex; gap: 8px; align-items: center; font-weight: 800; font-size: 14px; margin-bottom: 8px; }
.h3-trackbody { display: flex; gap: 14px; align-items: stretch; }
.h3-steps { display: flex; flex: 1; min-width: 0; }
.h3-step { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; gap: 3px; min-width: 0; }
.h3-step b { font-size: 12px; font-weight: 800; white-space: nowrap; }
.h3-step small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.h3-dotc { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #eef1f6; color: #8a92a6; font-size: 13px; z-index: 1; filter: grayscale(1); }
.h3-step.done .h3-dotc { background: var(--accent); color: #fff; filter: none; }
.h3-step.cur .h3-dotc { background: var(--accent); filter: none; box-shadow: 0 0 0 5px rgba(47,91,234,0.18); transform: scale(1.12); }
.h3-step.bad .h3-dotc { background: var(--bad); filter: none; }
.h3-bar { position: absolute; top: 15px; right: 50%; width: 100%; height: 3px; background: #e3e7ef; }
.h3-step.done .h3-bar, .h3-step.cur .h3-bar { background: var(--accent); }
.h3-taskcard { width: 300px; flex: none; text-align: left; background: #f6f8fb; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; cursor: pointer; font-family: var(--font); color: var(--text); display: flex; flex-direction: column; gap: 4px; }
.h3-taskcard:hover { border-color: #c9d6ff; }
.h3-tt { font-weight: 800; font-size: 13px; line-height: 1.3; max-height: 2.6em; overflow: hidden; }

/* the team panel */
.h3-team { position: absolute; right: 22px; bottom: 18px; width: 470px; padding: 10px 12px; }
.h3-tabs { display: flex; gap: 4px; align-items: center; margin-bottom: 6px; }
.h3-tabs button { border: 0; background: transparent; border-radius: 8px; padding: 5px 10px; font: 800 12.5px/1 var(--font); color: var(--muted); cursor: pointer; }
.h3-tabs button.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(36,56,120,0.12); }
.h3-tabs button span { color: var(--accent); }
.h3-scroll { max-height: 190px; overflow: auto; }
.h3-empty { padding: 8px; font-size: 12px; }
.h3-dotm { width: 10px; height: 10px; border-radius: 50%; background: #7a4fd6; box-shadow: 0 0 0 4px #f1eafe; flex: none; }

/* the 3D view and its labels */
.office3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.office3d:active { cursor: grabbing; }
.office3d-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; isolation: isolate; }
/* its own stacking context: the labels' z-indexes stay under the HUD */
body:not(.office3d-on) .office3d, body:not(.office3d-on) .office3d-labels, body:not(.office3d-on) #hud3d { visibility: hidden; pointer-events: none; }

/* the old pixel controls are replaced by the overlay */
/* (the HUD's own toggle only: the rule hid every label.toggle — the Safety block's approval and guard boxes too) */
body.office3d-on #focus-bar, body.office3d-on #hud label.toggle, body.office3d-on #btn-sound { display: none !important; }
body.office3d-on #hud, body.office3d-on #focus-bar, body.office3d-on #music-player { background: #ffffff; backdrop-filter: none; -webkit-backdrop-filter: none; }
@media (max-width: 1100px) { .h3-track { display: none; } .h3-kpis { max-width: calc(100% - 400px); } .kpi { min-width: 170px; } }
@media (max-width: 760px) {
  .h3-kpis, .h3-ctl, .h3-team { display: none; }
  /* (above the phone's bottom bar — style.css #mobile-bar, ~67 px: it covered the panel's last rows, a bear's Profile,
     Tasks and Memory buttons among them) */
  .h3-side { left: 10px; right: 10px; top: auto; bottom: calc(64px + env(safe-area-inset-bottom) + 8px); width: auto; max-height: min(45%, calc(100% - 64px - env(safe-area-inset-bottom) - 24px)); }
}
body.stream #hud3d { display: none; }

/* clickable props: a round badge over each (what it opens), lit with the prop's outline under the pointer */
.prop-badge { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; line-height: 1; cursor: pointer;
  background: #fff; border: 2px solid #2f5bea; box-shadow: 0 0 0 4px rgba(47,91,234,0.18), 0 3px 8px rgba(21,26,45,0.25); pointer-events: auto;
  animation: prop-badge 2.2s ease-in-out infinite; transition: transform .15s, background .15s; }
.prop-badge.on, .prop-badge:hover { background: #2f5bea; transform: scale(1.18); box-shadow: 0 0 0 6px rgba(47,91,234,0.3), 0 4px 10px rgba(21,26,45,0.3); }
@keyframes prop-badge { 0%, 100% { box-shadow: 0 0 0 3px rgba(47,91,234,0.15), 0 3px 8px rgba(21,26,45,0.25); } 50% { box-shadow: 0 0 0 8px rgba(47,91,234,0.05), 0 3px 8px rgba(21,26,45,0.25); } }
/* the floor headers of the grouped lists (building view) */
.h3-group { font: 800 11px/1.2 var(--font); letter-spacing: .05em; text-transform: uppercase; color: var(--accent); padding: 8px 8px 4px; position: sticky; top: 0; background: var(--panel); z-index: 1; border-bottom: 1px solid var(--line); }
.h3-group span { color: var(--muted); margin-left: 4px; }

/* the task tracker's list: every running task (or the 5 latest), with its times */
.h3-tlist { display: flex; flex-direction: column; gap: 4px; max-height: 168px; overflow: auto; margin-top: 4px; }
.h3-trow { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 1px solid var(--line); background: #f6f8fb; border-radius: 10px; padding: 6px 10px; cursor: pointer; font: 600 12.5px/1.3 var(--font); color: var(--text); }
.h3-trow:hover { border-color: #c9d6ff; background: var(--accent-50); }
.h3-trow .grow { display: flex; flex-direction: column; min-width: 0; }
.h3-trow b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h3-trow small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h3-trow time { flex: none; color: var(--muted); font-size: 11.5px; font-weight: 700; text-align: right; }
.h3-track .h3-steps { margin-bottom: 8px; }
.h3-role { display: inline-block; font-size: 10.5px; font-weight: 800; color: #3157d5; background: var(--accent-50); border-radius: 5px; padding: 0 6px; vertical-align: 1px; }

/* clearer panels on the light theme: solid white cards (no backdrop blur: cheaper too) with a firm border and shadow,
   a tinted strip for each panel's head / tabs, lines between rows */
.card { background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; border: 1px solid #cfd7e6; box-shadow: 0 8px 24px rgba(21,32,72,0.14), 0 1px 2px rgba(21,32,72,0.08); }
.h3-tabs { background: #eef2f8; border: 1px solid #dfe5ef; border-radius: 10px; padding: 3px; }
.h3-title { background: #eef2f8; border: 1px solid #dfe5ef; border-radius: 10px; padding: 6px 10px; }
.h3-fold { border: 0; background: transparent; cursor: pointer; color: var(--muted); font: 800 13px/1 var(--font); padding: 3px 6px; border-radius: 6px; margin-left: 4px; }
.h3-fold:hover { background: #fff; color: var(--text); }
.h3-track.h3-folded, .h3-team.h3-folded { width: auto; padding: 4px; }
.h3-pill { border: 0; background: transparent; cursor: pointer; font: 800 13px/1 var(--font); color: var(--text); padding: 7px 10px; border-radius: 8px; white-space: nowrap; }
.h3-pill:hover { background: #eef2f8; }
.h3-pill b { color: var(--muted); margin-left: 4px; }
.h3-side .h3-head { padding-bottom: 10px; border-bottom: 1px solid #e3e8f1; }
.h3-sub { padding-top: 8px; border-top: 1px solid #e3e8f1; text-transform: uppercase; font-size: 11px; letter-spacing: .05em; color: #4a5470; }
.h3-rows > .h3-row + .h3-row { border-top: 1px solid #edf0f6; border-radius: 0; }
.h3-row:hover { border-radius: 9px; }
.kpi { border-left: 4px solid var(--accent); }

/* phones: the button that hides / shows the menu rows and the panels (main.js); desktops never see it */
#mobile-toggle { display: none; }
@media (max-width: 760px) {
  #mobile-toggle { display: inline-flex; align-items: center; gap: 4px; position: fixed; top: 10px; right: 10px; z-index: 30; padding: 8px 12px; border-radius: 999px;
    border: 1px solid #cfd7e6; background: #fff; color: var(--text); font: 800 13px/1 var(--font); box-shadow: 0 6px 18px rgba(21,32,72,0.18); cursor: pointer; }
  body.panels-hidden #mobile-toggle { background: var(--accent); color: #fff; border-color: var(--accent); }
  /* (the money chip stays: the REAL-money desk said on a phone too, not only in 11 px in the bottom bar — review 65 R1) */
  body.panels-hidden #hud > :not(.brand):not(#floors):not(#btn-about) { display: none !important; }
  body.panels-hidden #hud { padding: 8px 12px; }
  body.panels-hidden #hud3d > *, body.panels-hidden #focus-bar { display: none !important; }
  body:not(.panels-hidden) #hud .brand { padding-right: 90px; } /* room for the button */
}
body.stream #mobile-toggle { display: none !important; }

.h3-side[hidden] { display: none; }
@media (max-width: 760px) { .h3-side[hidden] { display: flex; } } /* no toolbar on a phone to bring it back */

/* the stream at 1280 px: the widest caption stops short of the lower-third; a window open hides the phone's toggle where
   :has() is not supported (UI review 16 P2-11) */
body.stream.office3d-on #captions { max-width: min(64%, calc(100% - 520px)); }
body.modal-open #mobile-toggle { display: none !important; }

/* a picture in place of the drawn bear face (Eula, 31/10) */
.h3-av--img { background: #dbe8f5; overflow: hidden; }
.h3-av--img::before, .h3-av--img::after { display: none; }
.h3-av--img img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
