:root{
        --ink:#22303c; --ink-soft:#5a6b78; --card:#ffffff; --card-line:#dfe7ec;
        --accent:#0e7c86; --accent-soft:#e3f2f3;
        --cat-ops:#2e7fb8; --cat-studio:#d97706; --cat-lab:#3d9970; --cat-sosial:#c2507e;
        --st-work:#2f9e44; --st-idle:#e8a13a; --st-off:#9aa7b1;
      }
      *{ box-sizing:border-box; }
      html,body{ height:100%; }
      body{
        margin:0; font-family:"Avenir Next","Segoe UI",system-ui,-apple-system,sans-serif;
        color:var(--ink); overflow:hidden; background:#bfe0ee;
      }
      button{ min-height:2.25rem; font:inherit; cursor:pointer; }
      #scene{ position:fixed; inset:0; }
      #scene canvas{ display:block; touch-action:none; }

      .card{
        background:var(--card); border:1px solid var(--card-line); border-radius:14px;
        box-shadow:0 8px 24px rgba(34,48,60,.12);
      }
      /* ---------- panel kiri atas ---------- */
      #panel{
        position:fixed; top:12px; left:12px; z-index:10; width:min(330px, calc(100vw - 24px));
        padding:14px 16px 12px;
      }
      #panel h1{ margin:0 0 4px; font-size:1.06rem; letter-spacing:.01em; display:flex; align-items:center; gap:8px; }
      #panel h1 .dot{ width:9px; height:9px; border-radius:50%; background:#e4572e; flex:none; }
      #panel p{ margin:0 0 10px; font-size:.8rem; line-height:1.45; color:var(--ink-soft); }
      .filters{ display:flex; flex-wrap:wrap; gap:6px; }
      .filters button{
        border:1px solid var(--card-line); background:#f4f8fa; color:var(--ink);
        border-radius:999px; padding:4px 12px; font-size:.8rem; font-weight:600;
      }
      .filters button[aria-pressed="true"]{ background:var(--accent); border-color:var(--accent); color:#fff; }
      .filters button .cdot{ display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:6px; vertical-align:1px; }
      /* ---------- panel kanan atas : ringkasan kategori ---------- */
      #summary{
        position:fixed; top:12px; right:12px; z-index:10; width:230px; padding:12px 14px;
        font-size:.78rem; line-height:1.5;
      }
      #summary h2{ margin:0 0 6px; font-size:.86rem; text-align:right; }
      #summary .row{ display:flex; justify-content:space-between; gap:10px; padding:3px 0; border-top:1px dashed #e6edf1; }
      #summary .row:first-of-type{ border-top:none; }
      #summary .row b{ font-weight:700; white-space:nowrap; }
      #summary .row span{ color:var(--ink-soft); text-align:right; }
      #summary .catdot{ display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:5px; }

      /* ---------- bawah kiri : kontrol ---------- */
      #controls{ position:fixed; left:12px; bottom:12px; z-index:10; display:flex; gap:8px; padding:8px; }
      #controls button{
        border:1px solid var(--card-line); background:#f4f8fa; border-radius:9px;
        padding:5px 12px; font-size:.82rem; font-weight:600; color:var(--ink);
      }
      #controls button[aria-pressed="true"]{ background:var(--accent-soft); border-color:var(--accent); color:var(--accent); }

      /* ---------- bawah kanan : petunjuk ---------- */
      #hint{
        position:fixed; right:12px; bottom:12px; z-index:10; padding:8px 14px;
        font-size:.76rem; color:var(--ink-soft); border-radius:999px;
      }

      /* ---------- panel detail ruangan / agent ---------- */
      #detail{
        position:fixed; z-index:11; right:12px; bottom:64px; width:min(320px, calc(100vw - 24px));
        padding:14px 16px; display:none;
      }
      #detail.open{ display:block; }
      #detail h2{ margin:0 22px 2px 0; font-size:1rem; }
      #detail .meta{ font-size:.76rem; color:var(--ink-soft); margin-bottom:10px; }
      #detail .meta .catdot{ display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:5px; }
      #closeDetail{
        position:absolute; top:8px; right:8px; width:36px; height:36px; min-height:36px;
        border:none; background:transparent; font-size:1.05rem; color:var(--ink-soft); border-radius:8px;
      }
      .agent{ border-top:1px solid #edf2f5; padding:9px 0 7px; }
      .agent:first-of-type{ border-top:none; padding-top:2px; }
      .agent .top{ display:flex; align-items:center; gap:7px; }
      .agent .ava{ width:22px; height:22px; border-radius:7px; flex:none; display:grid; place-items:center; color:#fff; font-size:.68rem; font-weight:800; }
      .agent .name{ font-weight:700; font-size:.86rem; }
      .agent .role{ font-size:.76rem; color:var(--ink-soft); }
      .agent .task{ font-size:.78rem; margin-top:3px; line-height:1.4; }
      .badge{ margin-left:auto; flex:none; font-size:.68rem; font-weight:700; padding:2px 8px; border-radius:999px; color:#fff; }
      .badge.work{ background:var(--st-work); } .badge.idle{ background:var(--st-idle); } .badge.off{ background:var(--st-off); }
      #detail .empty{ font-size:.8rem; color:var(--ink-soft); }

      #err{
        position:fixed; inset:auto 12px 12px 12px; z-index:50; display:none;
        background:#fff3f0; color:#8c2f1b; border:1px solid #f0c4b8; border-radius:10px;
        padding:10px 14px; font-size:.82rem;
      }
      @media (max-width:760px){
        #summary{ display:none; }
        #hint{ display:none; }
        #detail{ bottom:64px; }
        #panel{ width:min(302px, calc(100vw - 24px)); padding:10px 12px 9px; }
        #panel h1{ font-size:.95rem; }
        #panel p{ font-size:.74rem; margin-bottom:8px; }
        .adminRow, .resRow{ grid-template-columns:1fr 1fr; }
        .adminRow .floorTag{ padding-bottom:0; }
      }
