/* AI OFFICE V2 — full-width fluid layout (TENN 2026-07-21 §一).
 * The office map is a fixed 1449×1086 unit; we make it fluid by object-scaling
 * (image width:100% + overlay canvases width/height:100% keeping their fixed
 * internal resolution) instead of transform:scale on the whole UI. The page uses
 * the full available width, the sidebar stays at a readable width, and content
 * taller than the viewport scrolls with the normal browser vertical scrollbar. */

html, body { min-height: 100%; }
body {
  margin: 0;
  background: #0a0e1a;
  color: #cfe0ff;
  font-family: 'VT323', monospace;
  /* full-width page: never squeeze the UI into the viewport; allow natural
     vertical scroll, only clip incidental horizontal overflow. */
  overflow-x: hidden;
  overflow-y: auto;
}

@keyframes log-in { from { opacity:0; transform:translateX(6px); } to { opacity:1; transform:translateX(0); } }
@keyframes pulse-dot { 0%,100%{ opacity:1; box-shadow:0 0 5px #22cc66; } 50%{ opacity:0.4; box-shadow:0 0 12px #22cc66; } }

x-dc { display:block; padding:12px; }

/* ── Header ─────────────────────────────────────────────────────────────── */
#aioffice-header {
  position: sticky; top: 0; z-index: 400;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 16px; background: rgba(5,9,20,0.96);
  border-bottom: 1px solid rgba(74,158,255,0.25);
}
#aioffice-header .brand { font-size: 18px; color: #4a9eff; letter-spacing: 2px; }
#aioffice-header .demo-pill {
  font-size: 13px; color: #ffb84d; letter-spacing: 0.5px;
  background: rgba(60,34,8,0.85); border: 1px solid rgba(255,170,60,0.5);
  border-radius: 999px; padding: 3px 12px;
}
#aioffice-header .backend-pill {
  font-size: 13px; color: #9ab0d0; letter-spacing: 0.5px;
  background: rgba(20,32,55,0.7); border: 1px solid rgba(120,150,200,0.35);
  border-radius: 999px; padding: 3px 12px;
}
#aioffice-header .spacer { flex: 1; }

/* ── Full-width fluid stage (no transform:scale, no fixed max-width) ─────── */
#aioffice-stage-wrap { position: relative; width: 100%; }
#aioffice-stage { width: 100%; }

/* Adaptive layout: office fills remaining width, sidebar stays readable. */
.office-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(340px, 24vw, 400px);
  gap: 12px;
  align-items: start;
  padding: 12px 16px;
  box-sizing: border-box;
  width: 100%;
}
.office-map-col { min-width: 0; }

/* Section header — sits ABOVE the map in normal flow (never overlays the office).
   Removing the old position:absolute HUD is the root-cause fix for the map occlusion. */
.office-map-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 14px 10px;
  margin-bottom: 8px;
  background: rgba(5,9,20,0.93);
  border: 1px solid rgba(74,158,255,0.32);
  border-radius: 8px;
}
.office-map-head .ohd-title {
  font-family: 'VT323', monospace;
  font-size: 22px;
  color: #4a9eff;
  letter-spacing: 2px;
  line-height: 1.1;
}
.office-map-head .ohd-sub {
  font-family: 'VT323', monospace;
  font-size: 13px;
  color: rgba(160,207,255,0.72);
  letter-spacing: 1px;
}

/* Fixed-aspect office map made fluid: image drives the box height. */
.office-map {
  position: relative;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 24px 100px rgba(0,0,0,0.85);
}
.office-map-bg { display: block; width: 100%; height: auto; }

/* Overlay canvases keep their fixed 1449×1086 internal resolution but render
   at the container size, so drawing coordinates stay aligned with the map. */
#char-canvas, #cal-canvas {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
}
#line-layer {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  overflow: hidden; pointer-events: none;
}

/* ── Sidebar (roster + activity feed) ───────────────────────────────────── */
.office-side {
  position: sticky; top: 56px;
  display: flex; flex-direction: column; gap: 10px;
  min-width: 0;
  align-self: start;
}

/* Narrow / tablet: stack the sidebar below the map and let the page scroll. */
@media (max-width: 1024px) {
  .office-layout { grid-template-columns: minmax(0, 1fr); }
  .office-side { position: static; }
}

/* Developer tools are hidden in normal mode; revealed only with .dev-mode. */
.dev-only { display: none !important; }
.dev-mode .dev-only { display: inline-block !important; }
