:root {
  --bg: #0d0f10;
  --panel: #141714;
  --panel-2: #20251f;
  --text: #ebeedf;
  --muted: #a1ab93;
  --accent: #7ef07a;
  --gold: #fff093;
  --line: #2f382f;
  --shadow: rgba(0, 0, 0, 0.28);
  --purple: #241633;
  --purple-line: #8060b8;
  --stone: #3b413a;
  --wall: #65584c;
  --wall-dark: #4b4036;
  --floor-a: #495447;
  --floor-b: #40493f;
  --office-a: #516258;
  --office-b: #47554b;
  --archive-a: #585244;
  --archive-b: #4d473c;
  --wood: #b78d59;
  --wood-dark: #704a27;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: 'Courier New', monospace;
  background: radial-gradient(circle at top, #1b211d, #0a0c0b 58%);
}
.crt {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.04), rgba(255,255,255,.04) 1px, transparent 1px, transparent 3px);
  opacity: .08;
}
.topbar, .footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: rgba(10,12,10,.94);
  border-bottom: 2px solid #232823;
}
.footer {
  border-top: 2px solid #232823;
  border-bottom: 0;
  font-size: 12px;
  color: var(--muted);
}
h1 { margin: 0; font-size: 22px; letter-spacing: 2px; }
p { margin: 4px 0 0; color: var(--muted); }
.statusbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 2px solid #30362f;
  background: #171b17;
  font-size: 12px;
}
.lamp {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
}
.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(760px, 1fr) 360px;
  gap: 14px;
  padding: 14px;
  align-items: start;
}
.office-panel, .detail-panel {
  border: 3px solid #1f241f;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  box-shadow: inset 0 0 0 1px #090a09;
}
.panel-title {
  padding: 8px 10px;
  font-size: 13px;
  color: var(--accent);
  background: #101210;
  border-bottom: 2px solid #2a2e2a;
}
.office-scene {
  position: relative;
  overflow: hidden;
  min-height: 760px;
  background: #151917;
}
.room {
  position: absolute;
  image-rendering: pixelated;
  box-shadow: 8px 8px 0 var(--shadow);
  z-index: 1;
}
.room::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.room-a {
  left: 32px;
  top: 46px;
  width: 648px;
  height: 634px;
  border: 10px solid var(--wall-dark);
  background:
    linear-gradient(90deg, rgba(0,0,0,.05) 1px, transparent 1px) 0 0/40px 40px,
    linear-gradient(rgba(0,0,0,.05) 1px, transparent 1px) 0 0/40px 40px,
    linear-gradient(180deg, var(--office-a), var(--office-b));
}
.room-a::before {
  border: 6px solid var(--wall);
  box-shadow: inset 0 0 0 10px rgba(0,0,0,.08);
}
.room-b {
  left: 718px;
  top: 96px;
  width: 170px;
  height: 550px;
  border: 10px solid #4a4338;
  background:
    linear-gradient(90deg, rgba(0,0,0,.06) 1px, transparent 1px) 0 0/36px 36px,
    linear-gradient(rgba(0,0,0,.06) 1px, transparent 1px) 0 0/36px 36px,
    linear-gradient(180deg, var(--archive-a), var(--archive-b));
}
.room-b::before {
  border: 6px solid #726657;
  box-shadow: inset 0 0 0 10px rgba(0,0,0,.08);
}
.door {
  position: absolute;
  background: #8a573f;
  border: 4px solid #583323;
}
.door-a { left: 680px; top: 296px; width: 36px; height: 82px; }
.door-b { left: 782px; top: 646px; width: 56px; height: 16px; }
.furniture, .decor {
  position: absolute;
  image-rendering: pixelated;
  z-index: 3;
}
.trim { position: absolute; background: #2f362e; z-index: 2; }
.trim.top { left: 32px; top: 32px; width: 872px; height: 14px; }
.trim.bottom { left: 32px; top: 692px; width: 872px; height: 14px; }
.trim.left { left: 32px; top: 46px; width: 14px; height: 660px; }
.trim.right { left: 890px; top: 46px; width: 14px; height: 660px; }
.watercooler {
  left: 92px; top: 96px; width: 40px; height: 74px;
  background: linear-gradient(180deg, #9ad1fb 0 24px, #d9edf8 24px 34px, #dbdbdb 34px 74px);
  border: 4px solid #59605f;
  box-shadow: 4px 4px 0 var(--shadow);
}
.board {
  left: 752px; top: 298px; width: 96px; height: 66px;
  background: #92653b;
  border: 4px solid #694325;
  box-shadow: 4px 4px 0 var(--shadow);
}
.board::before {
  content: '';
  position: absolute;
  left: 10px; top: 10px; right: 10px; bottom: 10px;
  background: repeating-linear-gradient(180deg, #d4be89, #d4be89 8px, #b28e57 8px, #b28e57 16px);
}
.archive-cabinet {
  left: 758px; top: 164px; width: 84px; height: 62px;
  background: linear-gradient(180deg, #72685d, #534b44);
  border: 4px solid #362f2b;
  box-shadow: 4px 4px 0 var(--shadow);
}
.archive-cabinet::before, .archive-cabinet::after {
  content: '';
  position: absolute;
  left: 8px; right: 8px; height: 16px;
  border: 2px solid #95897c;
}
.archive-cabinet::before { top: 10px; }
.archive-cabinet::after { top: 34px; }
.archive-link-box {
  left: 744px; top: 544px; width: 118px; height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: linear-gradient(180deg, #233726, #121c14);
  border: 4px solid #5e7f46;
  color: #fff48a;
  box-shadow: 4px 4px 0 rgba(0,0,0,.25);
  z-index: 2;
}
.archive-link-box span {
  font-size: 13px;
  text-align: center;
  line-height: 1.1;
}
.archive-link-box:hover {
  border-color: #fff48a;
  color: #ffffff;
}
.plant {
  width: 32px; height: 40px;
  background: linear-gradient(180deg, #5eb45e 0 20px, #2d6d2d 20px 28px, #9a6735 28px 40px);
  border: 3px solid #4c3620;
  box-shadow: 4px 4px 0 var(--shadow);
}
.plant-a { left: 620px; top: 110px; }
.plant-b { left: 620px; top: 600px; }
.box-stack {
  left: 748px; width: 106px; height: 58px;
  background: linear-gradient(180deg, #9c7845 0 18px, #855f31 18px 58px);
  border: 4px solid #5a3d1f;
  box-shadow: 4px 4px 0 var(--shadow);
}
.box-stack::before, .box-stack::after {
  content: '';
  position: absolute;
  width: 42px; height: 24px;
  background: #b48a54;
  border: 3px solid #5a3d1f;
  top: -16px;
}
.box-stack::before { left: 4px; }
.box-stack::after { right: 4px; }
.box-a { top: 410px; }
.box-b { top: 468px; }
.rug {
  position: absolute;
  left: 118px;
  top: 250px;
  width: 470px;
  height: 244px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px) 0 0/28px 28px,
    linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px) 0 0/28px 28px,
    linear-gradient(180deg, #6e1f23, #54161b);
  border: 4px solid #8d7430;
  box-shadow:
    inset 0 0 0 4px #4b1217,
    inset 0 0 0 8px #7b6227,
    6px 6px 0 var(--shadow);
  z-index: 2;
}
.scene-object { position: absolute; z-index: 6; }

#scene-objects {
  position: absolute;
  inset: 0;
  z-index: 6;
}
.desk-sprite {
  position: absolute;
  width: 122px;
  height: 74px;
  background: linear-gradient(180deg, var(--wood) 0 14px, #e2c18d 14px 20px, var(--wood) 20px 62px, var(--wood-dark) 62px 74px);
  border: 4px solid var(--wood-dark);
  box-shadow: 4px 4px 0 var(--shadow);
}
.desk-sprite::before,
.desk-sprite::after {
  content: '';
  position: absolute;
  bottom: -14px;
  width: 9px;
  height: 14px;
  background: var(--wood-dark);
}
.desk-sprite::before { left: 14px; }
.desk-sprite::after { right: 14px; }
.monitor {
  position: absolute;
  left: 16px; top: 14px;
  width: 34px; height: 24px;
  background: #dce6df;
  border: 4px solid #525b52;
}
.monitor::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: #779c77;
}
.keyboard {
  position: absolute;
  left: 18px; top: 44px;
  width: 34px; height: 10px;
  background: #687468;
  border: 2px solid #394239;
}
.desk-lamp {
  position: absolute;
  right: 8px; top: 10px;
  width: 16px; height: 26px;
  background: linear-gradient(180deg, #eadb8c 0 10px, #726c52 10px 26px);
  border: 2px solid #494233;
}
.mug {
  position: absolute;
  right: 28px; top: 16px;
  width: 12px; height: 12px;
  background: #f3efe7;
  border: 2px solid #7d6b55;
}
.doc {
  position: absolute;
  left: 60px; top: 16px;
  width: 18px; height: 24px;
  background: #f9f4dc;
  border: 2px solid #786c58;
}
.actor {
  position: absolute;
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0;
  z-index: 7;
}
.actor-agent {
  width: 52px;
  height: 76px;
  animation: idle-shift var(--idle-dur, 6s) steps(2, end) infinite;
  animation-delay: var(--idle-delay, 0s);
}
@keyframes idle-shift {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(var(--idle-x, 3px), 0); }
  50% { transform: translate(0, var(--idle-y, -2px)); }
  75% { transform: translate(calc(var(--idle-x, 3px) * -0.6), calc(var(--idle-y, -2px) * -0.5)); }
}
.agent-sprite {
  position: absolute;
  inset: 0;
  image-rendering: pixelated;
}
.agent-sprite .shadow {
  position: absolute;
  left: 12px; top: 62px; width: 28px; height: 10px;
  background: rgba(0,0,0,.35);
}
.agent-sprite .hair {
  position: absolute;
  left: 12px; top: 2px; width: 28px; height: 12px;
  background: var(--hair, #2a1f18);
}
.agent-sprite .head {
  position: absolute;
  left: 14px; top: 10px; width: 24px; height: 20px;
  background: var(--skin, #d6a36f);
  border: 2px solid #392216;
}
.agent-sprite .eyes {
  position: absolute;
  left: 20px; top: 18px; width: 12px; height: 2px;
  background: #231b16;
}
.agent-sprite .coat {
  position: absolute;
  left: 12px; top: 30px; width: 28px; height: 20px;
  background: linear-gradient(180deg, var(--coat2, #5c7eb0), var(--coat, #2e4f74));
  border: 2px solid #1d2430;
}
.agent-sprite .arms {
  position: absolute;
  left: 8px; top: 32px; width: 36px; height: 8px;
  background: var(--coat, #2e4f74);
}
.agent-sprite .tie {
  position: absolute;
  left: 23px; top: 30px; width: 6px; height: 16px;
  background: var(--tie, #341515);
}
.agent-sprite .belt {
  position: absolute;
  left: 14px; top: 46px; width: 24px; height: 4px;
  background: #2f2a28;
}
.agent-sprite .legs {
  position: absolute;
  left: 14px; top: 50px; width: 24px; height: 14px;
  background: linear-gradient(90deg, var(--pants, #352d2b) 0 10px, transparent 10px 14px, var(--pants, #352d2b) 14px 24px);
}
.floating-label {
  position: absolute;
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 164px;
  max-width: 240px;
  padding: 5px 8px;
  background: #1b1430;
  border: 3px solid var(--purple-line);
  color: #fff;
  font-size: 11px;
  white-space: normal;
  line-height: 1.05;
  box-shadow: 4px 4px 0 rgba(0,0,0,.22);
  z-index: 6;
}
.floating-object-label { min-width: 138px; }
.status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #9aa396;
  box-shadow: 0 0 6px rgba(255,255,255,.15);
  flex: 0 0 auto;
}
.status-dot.is-active { background: #7ef07a; box-shadow: 0 0 8px #7ef07a; }
.status-dot.is-standby { background: #ffd25f; box-shadow: 0 0 8px #ffd25f; }
.status-dot.is-idle { background: #84a4ff; box-shadow: 0 0 8px #84a4ff; }
.status-dot.is-available { background: #b89af7; box-shadow: 0 0 8px #b89af7; }
.status-dot.is-unknown { background: #8b8b8b; }
.floating-label .meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.floating-label .mode { color: #c6b8eb; font-size: 10px; }
.object-hotspot {
  position: absolute;
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0;
  z-index: 8;
}
.object-hotspot.active .floating-label,
.actor-agent.active .floating-label {
  border-color: var(--gold);
}
.inspector {
  padding: 12px;
  display: grid;
  gap: 10px;
}
.note-card {
  border: 2px solid #384038;
  background: rgba(11,13,11,.74);
  padding: 10px;
}
.note-title {
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 6px;
}
.note-subtitle {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.note-body, .tiny-list {
  font-size: 12px;
  line-height: 1.35;
  color: var(--text);
}
.tiny-list {
  display: grid;
  gap: 6px;
}
.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  padding: 3px 0;
  border-bottom: 1px dotted #394239;
}
.metric-row:last-child { border-bottom: 0; }
.big-metric {
  font-size: 24px;
  color: var(--accent);
  margin: 4px 0 6px;
}
.office-link {
  display: inline-block;
  margin-top: 8px;
  color: #fff48a;
  text-decoration: none;
  border: 2px solid #6e6740;
  background: #1a1d12;
  padding: 6px 8px;
}
.office-link:hover {
  color: #fff;
  border-color: #fff48a;
}
@media (max-width: 1240px) {
  .app-shell { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .office-scene { overflow: auto; min-height: 700px; }
}
