/* pcs-dynamic-behavior-inspector.css — Dynamic Behavior Profile V1 inspector (S4)
 *
 * A read-only semantic inspector. It intentionally has NO animation canvas and
 * NO decorative motion — S4 describes behavior; S5/S6 decide how it is drawn.
 */

.pcs-beh-inspector {
  font-family: var(--pcs-mono, "SF Mono", ui-monospace, monospace);
  font-size: 11px;
  color: var(--pcs-text, #d0d0d8);
  background: var(--pcs-surface, #0f0f14);
  overflow-y: auto;
  padding: 8px 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── No-behavior state ─────────────────────────────────────────────────────── */

.pcs-beh-unavailable {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  opacity: 0.5;
  text-align: center;
  padding: 24px;
}

.pcs-beh-unavailable-code {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #888;
}

.pcs-beh-unavailable-reason {
  font-size: 10px;
  color: #666;
  font-style: italic;
}

/* ── Multi-behavior tabs ───────────────────────────────────────────────────── */

.pcs-beh-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 8px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pcs-beh-tab {
  font: inherit;
  font-size: 9.5px;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
}

.pcs-beh-tab[aria-pressed="true"] {
  background: rgba(120, 170, 255, 0.16);
  border-color: rgba(120, 170, 255, 0.5);
  color: #cfe0ff;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */

.pcs-beh-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 8px;
}

.pcs-beh-family-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 3px;
  background: rgba(120, 170, 255, 0.16);
  color: #cfe0ff;
}

.pcs-beh-label {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.7);
}

/* ── Field grid ─────────────────────────────────────────────────────────────── */

.pcs-beh-fields {
  display: grid;
  grid-template-columns: minmax(90px, auto) 1fr;
  gap: 2px 10px;
  padding: 4px 8px;
}

.pcs-beh-key {
  font-size: 9px;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
}

.pcs-beh-val {
  font-size: 10.5px;
  color: var(--pcs-text, #d0d0d8);
}

/* Source-status colour coding — mirrors the S3 inspector semantics. */
.pcs-beh-val[data-status="EMPIRICAL"] { color: #7fd8a0; }
.pcs-beh-val[data-status="MODEL_DERIVED"] { color: #9fc0ff; }
.pcs-beh-val[data-status="SOURCE_DESCRIBED"] { color: #d8cf8f; }
.pcs-beh-val[data-status="CONCEPTUAL"] { color: #c8a0e0; }
.pcs-beh-val[data-status="UNKNOWN"] { color: #888; }

/* ── Sections ──────────────────────────────────────────────────────────────── */

.pcs-beh-section {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  padding: 10px 8px 3px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 6px;
}

.pcs-beh-list {
  list-style: none;
  margin: 0;
  padding: 0 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pcs-beh-item {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 10px;
}

.pcs-beh-tag {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 1px 5px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
}

.pcs-beh-obs-req[data-required="true"] { background: rgba(255, 180, 120, 0.18); color: #ffcfa0; }
.pcs-beh-obs-req[data-required="false"] { background: rgba(255, 255, 255, 0.06); color: rgba(255, 255, 255, 0.45); }

.pcs-beh-chain {
  padding: 3px 8px;
  font-size: 10px;
  color: #9fc0ff;
  word-break: break-word;
}

.pcs-beh-evidence-item {
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.5);
  cursor: default;
}

.pcs-beh-confidence {
  margin-top: auto;
  padding: 8px;
  font-size: 9px;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* S4 UI supplement: a read-only map beside the existing evidence inspector. */
#pcs-gms-behavior-panel { position: absolute; inset: 0; overflow: hidden; background: #020812; }
.pcs-beh-workspace { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .85fr); height: 100%; min-height: 520px; }
.pcs-beh-workspace-map { min-width: 0; min-height: 0; }
.pcs-beh-workspace-inspector { min-width: 0; min-height: 0; overflow: auto; border-left: 1px solid rgba(80, 220, 255, .22); background: #06101d; }
.pcs-beh-map { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; min-height: 520px; }
.pcs-beh-map-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 8px 12px; border-bottom: 1px solid rgba(80, 220, 255, .18); }
.pcs-beh-map-heading > div:first-child { display: grid; gap: 3px; }
.pcs-beh-map-heading strong { color: #72e6fa; font-size: 12px; letter-spacing: .08em; }
.pcs-beh-map-heading span { color: #fbd38d; font-size: 9px; letter-spacing: .05em; }
.pcs-beh-map-controls { display: flex; gap: 6px; }
.pcs-beh-map-controls button { min-height: 36px; padding: 5px 10px; border: 1px solid rgba(80,220,255,.45); border-radius: 5px; background: #071727; color: #d9f8ff; font: 700 10px var(--pcs-mono,"SF Mono",ui-monospace,monospace); }
.pcs-beh-map-controls button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.pcs-beh-map-viewport { min-height: 0; overflow: hidden; touch-action: none; cursor: grab; background: radial-gradient(circle at 50% 45%, rgba(18,74,95,.22), transparent 58%); }
.pcs-beh-map-viewport:active { cursor: grabbing; }
.pcs-beh-map-viewport svg { display: block; width: 100%; height: 100%; min-height: 460px; }
.pcs-beh-map-relations line { stroke: #5fb5c7; stroke-width: 2; stroke-dasharray: 5 5; opacity: .35; }
.pcs-beh-map-relations line.is-related { stroke: #fbbf24; stroke-width: 3; stroke-dasharray: none; opacity: .9; }
.pcs-beh-map-node { cursor: pointer; outline: none; transition: opacity .12s ease; }
.pcs-beh-map-node rect { fill: #092236; stroke: #4fb8ce; stroke-width: 2; }
.pcs-beh-map-node-label { fill: #f2fcff; font: 750 13px var(--pcs-mono,"SF Mono",ui-monospace,monospace); }
.pcs-beh-map-node-domain { fill: #9bc5cf; font: 9px var(--pcs-mono,"SF Mono",ui-monospace,monospace); letter-spacing: .03em; }
.pcs-beh-map-node.is-selected rect { stroke: #fff; stroke-width: 4; }
.pcs-beh-map-node.is-related rect { stroke: #fbbf24; stroke-width: 3; stroke-dasharray: 7 3; }
.pcs-beh-map-node.is-unrelated { opacity: .32; }
.pcs-beh-map-node:focus-visible rect { stroke: #fff; stroke-width: 4; stroke-dasharray: 5 3; }

@media (max-width: 768px) {
  #pcs-gms-behavior-panel { overflow: auto; }
  .pcs-beh-workspace { grid-template-columns: 1fr; grid-template-rows: minmax(420px, 55vh) auto; height: auto; min-height: 0; }
  .pcs-beh-workspace-inspector { border-left: 0; border-top: 1px solid rgba(80,220,255,.22); min-height: 420px; }
  .pcs-beh-map { min-height: 420px; }
  .pcs-beh-map-heading { align-items: flex-start; flex-wrap: wrap; }
  .pcs-beh-map-viewport svg { min-height: 350px; }
}
