/* ============================================================================
   Pro UI — LABS drawer modal (surface: labs).  Scope root: #pro-labs
   Additive overlay over chat-slim; every selector is nested under #pro-labs so
   it can never collide with chat-slim.css generic classes (.rail/.card/.mode/
   .head/.body/.tag/.go/.item …). Uses var(--pro-*) from pro-tokens.css only —
   no hardcoded palette, no external assets (all SVG is inlined in the markup).
   z-index: root 1200, scrim 0, panel 1.
   Canon: A.I Vault/J-Bot/J-Bot Pro Surface Blueprint.md
   ============================================================================ */

/* ---- surface visibility: hidden until the flag/JS reveals it ---- */
#pro-labs.pro-surface { display: none; }
#pro-labs.pro-surface.is-open { display: block; }

/* ---- overlay root ---- */
#pro-labs {
  position: fixed;
  inset: 0;
  z-index: 1200;
  isolation: isolate;
  font-family: var(--pro-font-body);
  color: var(--pro-text);
}

/* ---- blurred scrim ---- */
#pro-labs .pro-labs-scrim {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(3, 6, 11, 0.68);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* ---- centered panel ---- */
#pro-labs .pro-labs-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  width: 660px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-sizing: border-box;
  padding: 26px 28px 22px;
  border: 1px solid rgba(34, 211, 238, 0.20);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(12, 18, 27, 0.96), rgba(9, 14, 21, 0.96));
  box-shadow:
    0 60px 150px rgba(0, 0, 0, 0.65),
    0 0 60px rgba(34, 211, 238, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: pro-labs-rise 0.18s ease-out;
}

@keyframes pro-labs-rise {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 10px)); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}

/* ---- header ---- */
#pro-labs .pro-labs-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}
#pro-labs .pro-labs-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pro-glow-cyan);
  background: radial-gradient(circle at 40% 30%, rgba(34, 211, 238, 0.22), rgba(34, 211, 238, 0.05));
  border: 1px solid rgba(34, 211, 238, 0.32);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.18);
}
#pro-labs .pro-labs-icon svg { width: 24px; height: 24px; display: block; }
#pro-labs .pro-labs-title {
  font-family: var(--pro-font-display);
  font-weight: 700;
  font-size: 23px;
  letter-spacing: 0.08em;
  color: #eaf6fa;
  line-height: 1.1;
}
#pro-labs .pro-labs-sub {
  font-size: 12.5px;
  color: var(--pro-text-muted);
  margin-top: 2px;
}
#pro-labs .pro-labs-close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pro-text-faint);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
#pro-labs .pro-labs-close svg { width: 16px; height: 16px; display: block; }
#pro-labs .pro-labs-close:hover {
  color: var(--pro-text);
  border-color: rgba(34, 211, 238, 0.30);
  background: rgba(34, 211, 238, 0.06);
}

/* ---- divider rule ---- */
#pro-labs .pro-labs-rule {
  height: 1px;
  margin: 18px 0;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.22), transparent);
}

/* ---- 2x2 tile grid ---- */
#pro-labs .pro-labs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ---- mode-creature tile ---- */
#pro-labs .pro-labs-tile {
  position: relative;
  display: flex;
  gap: 13px;
  padding: 16px 16px 15px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(8, 13, 20, 0.72);
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  transition: border-color 0.15s, transform 0.15s;
}
#pro-labs .pro-labs-tile:hover { border-color: rgba(34, 211, 238, 0.30); }
#pro-labs .pro-labs-tile:focus-visible {
  outline: none;
  border-color: var(--pro-spine-cyan);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.25);
}

/* ---- creature icon well (per-mode accent) ---- */
#pro-labs .pro-labs-creature {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#pro-labs .pro-labs-creature svg { width: 44px; height: 44px; display: block; }

#pro-labs .pro-labs-tile[data-mode-target="study"] .pro-labs-creature {
  background: radial-gradient(circle at 50% 32%, rgba(92, 199, 246, 0.16), rgba(92, 199, 246, 0.05));
  border: 1px solid rgba(92, 199, 246, 0.30);
}
#pro-labs .pro-labs-tile[data-mode-target="tabletop"] .pro-labs-creature {
  background: radial-gradient(circle at 50% 32%, rgba(179, 156, 249, 0.16), rgba(179, 156, 249, 0.05));
  border: 1px solid rgba(179, 156, 249, 0.30);
}
#pro-labs .pro-labs-tile[data-mode-target="social"] .pro-labs-creature {
  background: radial-gradient(circle at 50% 32%, rgba(242, 129, 192, 0.15), rgba(242, 129, 192, 0.05));
  border: 1px solid rgba(242, 129, 192, 0.28);
}
#pro-labs .pro-labs-tile[data-mode-target="botspot"] .pro-labs-creature {
  background: radial-gradient(circle at 50% 32%, rgba(67, 224, 163, 0.16), rgba(67, 224, 163, 0.05));
  border: 1px solid rgba(67, 224, 163, 0.30);
}

/* ---- tile body ---- */
#pro-labs .pro-labs-body { flex: 1; min-width: 0; }
#pro-labs .pro-labs-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
#pro-labs .pro-labs-name {
  font-family: var(--pro-font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  color: var(--pro-text);
}
#pro-labs .pro-labs-tag {
  font-family: var(--pro-font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 20px;
}
#pro-labs .pro-labs-tag.is-tool {
  color: var(--pro-text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
#pro-labs .pro-labs-tag.is-beta {
  color: var(--pro-amber);
  background: rgba(240, 182, 77, 0.08);
  border: 1px solid rgba(240, 182, 77, 0.24);
}
#pro-labs .pro-labs-eyebrow {
  font-family: var(--pro-font-mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  color: var(--pro-text-faint);
  margin-top: 1px;
}
#pro-labs .pro-labs-desc {
  font-size: 12px;
  line-height: 1.5;
  color: #8b969e;
  margin-top: 7px;
}

/* ---- corner arrow ---- */
#pro-labs .pro-labs-go {
  position: absolute;
  right: 14px;
  bottom: 13px;
  width: 15px;
  height: 15px;
  color: #3a6b78;
  transition: color 0.15s;
}
#pro-labs .pro-labs-go svg { width: 15px; height: 15px; display: block; }
#pro-labs .pro-labs-tile:hover .pro-labs-go { color: var(--pro-glow-cyan); }

/* ---- footer ---- */
#pro-labs .pro-labs-foot {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-family: var(--pro-font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--pro-text-faint);
}
#pro-labs .pro-labs-foot svg {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--pro-glow-cyan);
}

/* ---- narrow viewport: collapse to a single column ---- */
@media (max-width: 560px) {
  #pro-labs .pro-labs-grid { grid-template-columns: 1fr; }
}
