/* Shaded Oasis HQ — 3D WebGL shell (HUD only; scene is Three.js) */
:root {
  --sand: #f4e6c8;
  --sand-deep: #e8d4a8;
  --teal: #2a8f8a;
  --teal-deep: #1a5f5c;
  --ink: #1e2a2a;
  --foam: #fffaf0;
  --panel: rgba(255, 250, 240, 0.94);
  --shadow: rgba(30, 42, 42, 0.18);
  --idle: #7eb8a8;
  --working: #3db8a0;
  --waiting: #e6b84d;
  --blocked: #e05252;
  --away: #9aa3a8;
  --meeting: #6b8cff;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(160deg, #1a5f5c 0%, #2a8f8a 40%, #c4a574 100%);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

#loading {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #1a5f5c, #2a8f8a 50%, #c4a574);
  transition: opacity 0.4s ease, visibility 0.4s;
}
#loading.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-card {
  text-align: center;
  color: var(--foam);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.loader-orb {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6e0, #2a8f8a 55%, #1a5f5c);
  box-shadow: 0 0 0 6px rgba(255,250,240,0.15), 0 12px 28px rgba(0,0,0,0.25);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.65rem 1rem;
  background: linear-gradient(180deg, rgba(30,42,42,0.55), transparent);
  color: var(--foam);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 0.65rem; }
.logo { font-size: 1.75rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); }
.brand h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 4px rgba(0,0,0,0.35);
}
.tag {
  margin: 0.1rem 0 0;
  font-size: 0.72rem;
  opacity: 0.85;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-size: 0.75rem;
}
.live {
  font-weight: 700;
  color: #9dffc8;
  text-shadow: 0 0 8px rgba(61,184,160,0.6);
}
.live.stale { color: #ffb4a8; text-shadow: none; }
.board-time { opacity: 0.85; }
.meeting-chip {
  background: rgba(107, 140, 255, 0.9);
  color: #fff;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

#canvas-wrap {
  position: fixed;
  inset: 0;
  z-index: 1;
}
#c {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  cursor: grab;
}
#c:active { cursor: grabbing; }
#label-root {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hint {
  position: fixed;
  bottom: 0.85rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(30, 42, 42, 0.55);
  color: var(--foam);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  pointer-events: none;
  white-space: nowrap;
  backdrop-filter: blur(6px);
}

.panel {
  position: fixed;
  top: 4.5rem;
  right: 1rem;
  z-index: 30;
  width: min(320px, calc(100vw - 2rem));
  max-height: calc(100vh - 6rem);
  overflow: auto;
  padding: 1rem 1.1rem 1.15rem;
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 12px 40px var(--shadow), 0 0 0 1px rgba(42,143,138,0.15);
  backdrop-filter: blur(10px);
  animation: slideIn 0.22s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: none; }
}
.panel-close {
  position: absolute;
  top: 0.5rem;
  right: 0.55rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: rgba(42, 143, 138, 0.12);
  color: var(--teal-deep);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.panel-close:hover { background: rgba(42, 143, 138, 0.25); }
.panel-head {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.85rem;
  padding-right: 1.5rem;
}
.panel-avatar {
  font-size: 2.4rem;
  width: 3.2rem;
  height: 3.2rem;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--sand), var(--sand-deep));
  box-shadow: inset 0 0 0 2px rgba(42,143,138,0.2);
}
.panel h2 { margin: 0; font-size: 1.15rem; }
.panel-vibe {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--teal-deep);
  opacity: 0.9;
}
.panel-dl {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.45rem 0.6rem;
  margin: 0;
  font-size: 0.86rem;
}
.panel-dl dt {
  margin: 0;
  color: var(--teal-deep);
  font-weight: 600;
  opacity: 0.8;
}
.panel-dl dd { margin: 0; word-break: break-word; }
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
  opacity: 0.75;
}

.status-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--idle);
}
.status-pill.idle { background: var(--idle); }
.status-pill.working { background: var(--working); }
.status-pill.waiting { background: var(--waiting); color: #3a2a00; }
.status-pill.blocked { background: var(--blocked); }
.status-pill.away { background: var(--away); }
.status-pill.meeting { background: var(--meeting); }

/* CSS2D labels (injected into #label-root) */
.bot-label {
  pointer-events: none;
  transform: translate(-50%, -100%);
  text-align: center;
  white-space: nowrap;
  user-select: none;
}
.bot-label .name {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  background: rgba(30, 42, 42, 0.78);
  color: #fffaf0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.bot-label .bubble {
  display: inline-block;
  margin-top: 3px;
  max-width: 140px;
  padding: 0.2rem 0.45rem;
  border-radius: 10px 10px 10px 4px;
  background: rgba(255, 250, 240, 0.95);
  color: var(--ink);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
  box-shadow: 0 3px 10px rgba(0,0,0,0.18);
  overflow: hidden;
  text-overflow: ellipsis;
}
.bot-label .bubble.blocked {
  background: #ffe0e0;
  color: #8a1f1f;
}
.bot-label .bubble.meeting {
  background: #e4ebff;
  color: #2a3f8a;
}
.bot-label .bubble.working {
  background: #d8f5ef;
}
.zone-label {
  pointer-events: none;
  transform: translate(-50%, -50%);
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.72);
  color: var(--teal-deep);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  white-space: nowrap;
  user-select: none;
}

@media (max-width: 560px) {
  .brand h1 { font-size: 0.95rem; }
  .tag { display: none; }
  .panel { top: auto; bottom: 3.2rem; right: 0.5rem; left: 0.5rem; width: auto; }
  .hint { font-size: 0.65rem; bottom: 0.5rem; }
}

#loading[hidden]{display:none!important;visibility:hidden!important;pointer-events:none!important;}

/* Activity bridge — routine progress + handoff packet labels */
.routine-bar {
  min-width: 88px;
  max-width: 140px;
  padding: 3px 6px 4px;
  border-radius: 6px;
  background: rgba(12, 28, 28, 0.9);
  border: 1px solid rgba(61, 184, 160, 0.45);
  box-shadow: 0 0 10px rgba(61, 184, 160, 0.25);
}
.routine-bar.pulse {
  animation: routine-pulse 0.55s ease;
}
@keyframes routine-pulse {
  0% { box-shadow: 0 0 4px rgba(255, 224, 120, 0.2); transform: scale(1); }
  40% { box-shadow: 0 0 16px rgba(255, 200, 60, 0.75); transform: scale(1.06); }
  100% { box-shadow: 0 0 10px rgba(61, 184, 160, 0.25); transform: scale(1); }
}
.routine-label {
  font: 600 9px/1.2 system-ui, sans-serif;
  color: #d8f5ec;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
  text-align: center;
}
.routine-track {
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.routine-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, #2a8f8a, #ffe08a);
  transition: width 0.35s ease;
}
.handoff-packet-label {
  font: 700 10px/1.2 system-ui, sans-serif;
  color: #1e2a2a;
  background: linear-gradient(180deg, #ffe8a0, #ffc040);
  padding: 2px 7px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 12px rgba(255, 180, 40, 0.85), 0 2px 4px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.zone-label{z-index:40!important;pointer-events:none;}
.speech{transition:opacity .25s;}
