/* MHO (Monster Hunter Outlanders) Animation FSM & WebGL2 Rendering Pipeline Inspector */
:root {
  --bg-deep: #0b0e14;
  --bg-panel: rgba(15, 19, 28, 0.90);
  --bg-card: rgba(24, 30, 44, 0.86);
  --bg-card-hover: rgba(34, 43, 62, 0.95);
  --border: rgba(130, 156, 198, 0.22);
  --border-strong: rgba(130, 156, 198, 0.42);
  --text-main: #e8eef8;
  --text-muted: #93a4be;
  --text-dim: #667690;
  --accent: #38bdf8;
  --accent-warm: #f59e0b;
  --accent-red: #f43f5e;
  --accent-green: #22c55e;
  --accent-purple: #a78bfa;
  --topbar-h: 48px;
  --drawer-w: clamp(490px, 40vw, 660px);
  --font-sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "Cascadia Code", "Consolas", "SFMono-Regular", monospace;
}

* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
}

/* ==================== TOP TOOLBAR ==================== */
#topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px;
  background: rgba(11, 14, 20, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  flex: 0 1 auto;
}
@media (max-width: 1480px) {
  .brand-sub, .brand-title { display: none; }
}

.brand-badge {
  padding: 3px 8px;
  border-radius: 4px;
  background: linear-gradient(135deg, #be123c, #e11d48);
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.brand-title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: nowrap;
}

.seg-group {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.14s ease;
  white-space: nowrap;
}

.seg-btn:hover {
  color: var(--text-main);
}

.seg-btn.active {
  background: rgba(56, 189, 248, 0.22);
  color: #e0f2fe;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.45);
}

.tb-btn, .tb-select {
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(24, 30, 44, 0.92);
  color: var(--text-main);
  font-size: 12px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s;
  white-space: nowrap;
}

.tb-btn:hover, .tb-select:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}

.tb-btn.active {
  background: rgba(245, 158, 11, 0.20);
  border-color: rgba(245, 158, 11, 0.65);
  color: #fde68a;
}

.tb-btn.active-cyan {
  background: rgba(56, 189, 248, 0.20);
  border-color: rgba(56, 189, 248, 0.65);
  color: #bae6fd;
}

.tb-select option {
  background: #111622;
  color: var(--text-main);
}

/* ==================== MAIN WORKSPACE ==================== */
#workspace {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  overflow: hidden;
}

#viewport-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  background: #0b0e14;
  overflow: hidden;
}

#gl-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#gl-canvas:active {
  cursor: grabbing;
}

/* Floating 3D Damage & Counter Feedback Layer */
#floating-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 12;
}

.float-dmg {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 800;
  font-size: 16px;
  font-family: var(--font-mono);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.92), 0 0 2px #000;
  white-space: nowrap;
  will-change: transform, opacity;
}

.float-dmg.big {
  font-size: 21px;
  letter-spacing: 0.02em;
}

/* ==================== OVERLAY HUD (TOP-LEFT & BOTTOM) ==================== */
#hud-topleft {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 340px;
}

.hud-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  backdrop-filter: blur(8px);
}

.hud-state-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hud-state-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  font-weight: 600;
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.pill.warn {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.42);
}

.pill.danger {
  background: rgba(244, 63, 94, 0.22);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.5);
}

.pill.ok {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.42);
}

.hud-subline {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Weapon Resource Gauge (Taidao Renki / GreatSword Charge) */
.gauge-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  font-size: 11.5px;
  font-weight: 600;
}

.gauge-track {
  position: relative;
  width: 100%;
  height: 11px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.gauge-fill {
  height: 100%;
  width: 60%;
  border-radius: 4px;
  transition: width 0.06s linear, background 0.15s ease;
}

.aura-steps {
  display: flex;
  gap: 5px;
  margin-top: 6px;
}

.aura-chip {
  flex: 1;
  text-align: center;
  padding: 2px 0;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.aura-chip.active-0 { background: rgba(148, 163, 184, 0.25); color: #cbd5e1; border-color: #94a3b8; }
.aura-chip.active-1 { background: rgba(241, 245, 249, 0.26); color: #ffffff; border-color: #e2e8f0; box-shadow: 0 0 8px rgba(241, 245, 249, 0.4); }
.aura-chip.active-2 { background: rgba(250, 204, 21, 0.25); color: #fef08a; border-color: #facc15; box-shadow: 0 0 8px rgba(250, 204, 21, 0.45); }
.aura-chip.active-3 { background: rgba(244, 63, 94, 0.30); color: #ffe4e6; border-color: #fb7185; box-shadow: 0 0 10px rgba(244, 63, 94, 0.6); }

/* Dummy Damage Counter */
#hud-topright {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 15;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.combo-box {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  text-align: right;
  min-width: 156px;
  backdrop-filter: blur(8px);
}

.combo-num {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 800;
  color: #fde68a;
  line-height: 1.1;
}

.combo-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.fps-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(11, 14, 20, 0.78);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
}

/* ==================== BOTTOM ACTION BAR ==================== */
#hud-bottom {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 16;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.skill-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  pointer-events: auto;
  background: rgba(11, 14, 20, 0.84);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 9px;
  backdrop-filter: blur(8px);
}

.skill-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  padding: 6px 9px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  transition: transform 0.08s, border-color 0.12s, background 0.12s;
}

.skill-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

.skill-btn:active, .skill-btn.pressed, .skill-btn.active-slot {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.24);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.45);
}

.preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.preset-btn {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.preset-btn:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

.preset-btn.active {
  background: rgba(56, 189, 248, 0.22);
  border-color: #38bdf8;
  color: #e0f2fe;
}

.tex-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.tex-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: rgba(9, 12, 18, 0.85);
  border: 1px solid rgba(130, 156, 198, 0.18);
  border-radius: 5px;
  padding: 4px;
}

.tex-tile img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 3px;
  display: block;
}

.tex-tile span {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.skill-btn.ult {
  border-color: rgba(244, 63, 94, 0.55);
  background: rgba(136, 19, 55, 0.45);
}

.skill-btn.ult:hover {
  border-color: #fb7185;
  background: rgba(190, 18, 60, 0.55);
}

.skill-key {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.12);
  padding: 1px 5px;
  border-radius: 3px;
  margin-bottom: 3px;
}

.skill-btn.ult .skill-key {
  color: #fda4af;
  background: rgba(244, 63, 94, 0.22);
}

.skill-label {
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.controls-hint {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(11, 14, 20, 0.72);
  border: 1px solid rgba(130, 156, 198, 0.16);
  border-radius: 999px;
  padding: 3px 12px;
  white-space: nowrap;
}

/* ==================== DRAGGABLE SPLITTER & RIGHT INSPECTOR DRAWER ==================== */
#drawer-splitter {
  width: 6px;
  flex: 0 0 6px;
  height: 100%;
  background: rgba(15, 20, 30, 0.95);
  border-left: 1px solid var(--border);
  cursor: col-resize;
  z-index: 22;
  position: relative;
  transition: background 0.14s;
}

#drawer-splitter::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 2px;
  width: 2px;
  height: 44px;
  transform: translateY(-50%);
  border-radius: 2px;
  background: rgba(148, 163, 184, 0.35);
}

#drawer-splitter:hover, #drawer-splitter.dragging {
  background: rgba(56, 189, 248, 0.28);
}

#drawer-splitter:hover::after, #drawer-splitter.dragging::after {
  background: #38bdf8;
}

#inspector.collapsed {
  width: 0 !important;
  flex-basis: 0 !important;
  border-left: none;
}

#drawer-splitter.hidden {
  display: none;
}

#inspector {
  width: var(--drawer-w);
  flex: 0 0 var(--drawer-w);
  height: 100%;
  background: var(--bg-panel);
  border-left: 1px solid rgba(130, 156, 198, 0.14);
  display: flex;
  flex-direction: column;
  z-index: 20;
  transition: width 0.18s ease, flex-basis 0.18s ease;
  overflow: hidden;
}

#inspector.resizing {
  transition: none;
}

#inspector.wide-mode {
  width: 56vw !important;
  flex-basis: 56vw !important;
}

#inspector.full-mode {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw !important;
  flex-basis: 100vw !important;
  z-index: 40;
  border-left: none;
}

.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 13, 20, 0.82);
  flex-shrink: 0;
}

.tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 9px 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.14s, border-color 0.14s;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  color: #7dd3fc;
  border-bottom-color: var(--accent);
  background: rgba(56, 189, 248, 0.08);
}

.tab-pane {
  display: none;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 10px 11px;
  min-height: 0;
}

.tab-pane.active {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#tab-fsm.active {
  overflow: hidden;
  padding: 8px 9px;
}

.sec-box {
  background: rgba(20, 26, 39, 0.78);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}

.sec-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

/* ==================== UE5 ANIMGRAPH FSM VIEWPORT ==================== */
.fsm-graph-panel {
  flex: 1 1 auto;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  padding: 7px 8px;
  gap: 6px;
  background: rgba(14, 18, 27, 0.94);
  overflow: hidden;
}

.fsm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.fsm-toolbar-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.ue-bp-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fbbf24, #ea580c);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.75);
  flex-shrink: 0;
}

.fsm-toolbar-title {
  font-size: 12px;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
}

.fsm-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.fsm-mini-btn {
  height: 23px;
  min-width: 24px;
  padding: 0 7px;
  border-radius: 4px;
  border: 1px solid rgba(130, 156, 198, 0.26);
  background: rgba(25, 33, 49, 0.92);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}

.fsm-mini-btn:hover {
  color: #fff;
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(36, 48, 70, 0.96);
}

.fsm-mini-btn.accent {
  border-color: rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
}

.fsm-mini-btn.active {
  background: rgba(245, 158, 11, 0.24);
  border-color: rgba(251, 191, 36, 0.75);
  color: #fde68a;
}

.fsm-zoom-val {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  min-width: 36px;
  text-align: center;
}

#fsm-svg-wrap {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 260px;
  background: #10141c;
  border: 1px solid rgba(130, 156, 198, 0.24);
  border-radius: 6px;
  overflow: hidden;
  cursor: grab;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.55);
}

#fsm-svg-wrap:active {
  cursor: grabbing;
}

#fsm-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.fsm-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 10;
  max-width: 260px;
  padding: 7px 10px;
  border-radius: 6px;
  background: rgba(11, 15, 24, 0.96);
  border: 1px solid rgba(56, 189, 248, 0.55);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
  font-size: 11px;
  color: #e2e8f0;
  line-height: 1.45;
}

.fsm-legend-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 10.5px;
  color: var(--text-muted);
  padding: 2px 2px 0;
  flex-shrink: 0;
}

.leg-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.leg-item i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}

.leg-hint {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 10px;
}

/* Compact 2-Column Footer below FSM Graph */
.fsm-footer-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 8px;
  flex: 0 0 128px;
  min-height: 120px;
}

.fsm-footer-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 7px 9px;
}

/* ==================== AUTHENTIC UE5 ANIMATION BLUEPRINT (AnimBP) STYLES ==================== */
.ue-anim-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 3px;
  background: linear-gradient(135deg, #c2410c, #ea580c);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.ue-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(18, 21, 27, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 5px;
  padding: 2px 4px;
}

.ue-bc-btn {
  border: none;
  background: transparent;
  color: #9aa5b6;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}

.ue-bc-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.06);
}

.ue-bc-btn.active {
  color: #fff;
  background: rgba(234, 88, 12, 0.30);
  box-shadow: inset 0 0 0 1px rgba(251, 146, 60, 0.55);
}

.ue-bc-sep {
  color: #5b6678;
  font-size: 12px;
  line-height: 1;
}

/* Compact Live UE5 AnimGraph Pose Pipeline Strip */
.ue-pose-strip {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 5px 8px;
  background: #14171d;
  border: 1px solid rgba(148, 163, 184, 0.20);
  border-radius: 5px;
  overflow-x: auto;
  flex-shrink: 0;
}

.ue-ps-node {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 8px;
  border-radius: 4px;
  background: #232730;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 2px solid #6b7280;
  cursor: pointer;
  min-width: 96px;
  flex: 1 1 0;
  transition: border-color 0.14s, box-shadow 0.14s, background 0.14s;
}

.ue-ps-node:hover {
  background: #2b303b;
  border-color: rgba(255, 255, 255, 0.34);
}

.ue-ps-node.slot { border-top-color: #3b82f6; }
.ue-ps-node.inert { border-top-color: #0d9488; }
.ue-ps-node.out { border-top-color: #e2e8f0; background: #1e222b; }

.ue-ps-node.live {
  border-color: #ff9900;
  box-shadow: 0 0 10px rgba(255, 153, 0, 0.38);
  background: #2b2620;
}

.ue-ps-kind {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  color: #8b95a5;
  letter-spacing: 0.04em;
}

.ue-ps-name {
  font-size: 10.5px;
  font-weight: 700;
  color: #e5e9f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ue-ps-node.live .ue-ps-name {
  color: #fde68a;
}

.ue-ps-wire {
  position: relative;
  width: 22px;
  height: 2px;
  background: rgba(226, 232, 240, 0.45);
  flex: 0 0 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ue-ps-wire.active {
  background: #ff9900;
  height: 2.5px;
  box-shadow: 0 0 6px rgba(255, 153, 0, 0.75);
}

.ue-pose-man {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e2e8f0;
  border: 1.5px solid #14171d;
  display: block;
}

.ue-ps-wire.active .ue-pose-man {
  background: #fde047;
}

/* UE5 AnimBP Legend Swatches */
.ue-leg-state { background: #2d323c; border: 1.5px solid #9ca3af; }
.ue-leg-conduit { background: #262b36; border: 1.5px solid #a78bfa; border-radius: 50% !important; }
.ue-leg-alias { background: #1e2d32; border: 1.5px dashed #2dd4bf; }
.ue-leg-rule { background: #1c2028; border: 1.5px solid #cbd5e1; border-radius: 50% !important; }
.ue-leg-active { background: #ff9900; box-shadow: 0 0 6px #ff9900; }

/* State Internal Graph Mini-Preview in Footer */
.ue-state-internal {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 2px;
}

.ue-si-box {
  flex: 1 1 0;
  min-width: 0;
  padding: 4px 7px;
  border-radius: 4px;
  background: #20242c;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-left: 3px solid #22c55e;
  display: flex;
  flex-direction: column;
}

.ue-si-box.out {
  border-left-color: #e2e8f0;
}

.ue-si-tag {
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: #8b95a5;
  font-weight: 700;
}

.ue-si-val {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ue-si-wire {
  width: 18px;
  height: 2px;
  background: #e2e8f0;
  flex: 0 0 18px;
}

/* ==================== UE5 STATE MACHINE & ANIMGRAPH SVG CLASSES ==================== */
.ue-comment-bg {
  rx: 5;
  ry: 5;
  stroke-width: 1;
}

.ue-comment-title {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  pointer-events: none;
}

.ue-comment-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  pointer-events: none;
  opacity: 0.72;
}

/* UE5 State Machine Transition Arrows (clean straight lines + circular rule badge!) */
.fsm-edge {
  stroke: rgba(203, 213, 225, 0.42);
  stroke-width: 1.75;
  fill: none;
  transition: stroke 0.12s, stroke-width 0.12s, opacity 0.12s;
}

.fsm-edge.dimmed {
  opacity: 0.10;
}

.fsm-edge.hover-edge {
  stroke: #e2e8f0;
  stroke-width: 2.5;
  opacity: 1;
}

@keyframes ueEdgeFlow {
  from { stroke-dashoffset: 24; }
  to { stroke-dashoffset: 0; }
}

.fsm-edge.active-edge {
  stroke: #ff9900;
  stroke-width: 3.2;
  opacity: 1;
  filter: url(#ue-glow-amber);
}

.fsm-edge-pulse {
  stroke: #fef08a;
  stroke-width: 2.2;
  stroke-dasharray: 6 8;
  fill: none;
  pointer-events: none;
  display: none;
}

.fsm-edge-pulse.active-edge {
  display: inline;
  animation: ueEdgeFlow 0.5s linear infinite;
}

/* UE5 Iconic Circular Transition Rule Icon (SGraphNodeAnimTransition) */
.ue-trans-icon {
  cursor: pointer;
  transition: opacity 0.12s;
}

.ue-trans-icon.dimmed {
  opacity: 0.14;
}

.ue-trans-icon circle {
  fill: #1b1f27;
  stroke: rgba(203, 213, 225, 0.65);
  stroke-width: 1.35;
}

.ue-trans-icon:hover circle {
  fill: #2c3340;
  stroke: #ffffff;
  stroke-width: 1.8;
}

.ue-trans-icon.active-edge circle {
  fill: #78350f;
  stroke: #ffaa22;
  stroke-width: 2;
  filter: url(#ue-glow-amber);
}

.ue-trans-icon text {
  fill: #cbd5e1;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}

.ue-trans-icon.active-edge text {
  fill: #fef3c7;
}

/* UE5 State Node (SGraphNodeAnimState — iconic outer transition ring + inner dark-charcoal beveled card!) */
.fsm-node {
  cursor: pointer;
  transition: opacity 0.12s;
}

.fsm-node.dimmed {
  opacity: 0.25;
}

.fsm-node .ue-outer-ring {
  fill: rgba(255, 255, 255, 0.045);
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1.1;
  rx: 8;
  ry: 8;
  transition: stroke 0.12s, fill 0.12s;
}

.fsm-node:hover .ue-outer-ring {
  fill: rgba(255, 255, 255, 0.09);
  stroke: rgba(255, 255, 255, 0.45);
}

.fsm-node.active .ue-outer-ring {
  fill: rgba(255, 153, 0, 0.18);
  stroke: #ff9900;
  stroke-width: 2.2;
  filter: url(#ue-glow-amber);
}

.fsm-node .ue-inner-card {
  fill: #232730;
  stroke: rgba(0, 0, 0, 0.65);
  stroke-width: 1;
  rx: 5;
  ry: 5;
}

.fsm-node.conduit .ue-inner-card {
  fill: #242230;
  stroke: rgba(167, 139, 250, 0.55);
}

.fsm-node.alias .ue-inner-card {
  fill: #1b282b;
  stroke: rgba(45, 212, 191, 0.55);
  stroke-dasharray: 4 2.5;
}

.fsm-node.active .ue-inner-card {
  fill: #2d261d;
  stroke: rgba(255, 180, 50, 0.65);
}

.fsm-node .ue-title {
  fill: #edf2f7;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.fsm-node.active .ue-title {
  fill: #fef3c7;
}

.fsm-node .ue-sub {
  fill: #8d97a6;
  font-family: var(--font-mono);
  font-size: 9.5px;
  pointer-events: none;
}

.fsm-node .ue-weight-pill {
  fill: #ff9900;
  opacity: 0;
}

.fsm-node.active .ue-weight-pill {
  opacity: 1;
}

.fsm-node .ue-prog-bg {
  fill: rgba(255, 255, 255, 0.09);
  rx: 1.5;
}

.fsm-node .ue-prog-fill {
  fill: #ff9900;
  rx: 1.5;
  opacity: 0;
}

.fsm-node.active .ue-prog-fill {
  opacity: 1;
}

/* UE5 AnimGraph Pose Wire (White Bone-Pose Dataflow!) */
.ue-pose-wire {
  stroke: rgba(236, 240, 246, 0.72);
  stroke-width: 2.6;
  fill: none;
}

.ue-pose-wire.live {
  stroke: #ff9900;
  stroke-width: 3.6;
  filter: url(#ue-glow-amber);
}

.ue-ag-node {
  cursor: pointer;
}

.ue-ag-node .ag-bg {
  fill: #22262e;
  stroke: rgba(255, 255, 255, 0.20);
  stroke-width: 1.3;
  rx: 6;
  ry: 6;
}

.ue-ag-node:hover .ag-bg {
  stroke: #ffffff;
}

.ue-ag-node.live .ag-bg {
  stroke: #ff9900;
  stroke-width: 2.2;
  filter: url(#ue-glow-amber);
}

/* Blend bar & transition log */
.kv-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 8px;
  font-size: 11px;
}

.kv-k {
  color: var(--text-muted);
}

.kv-v {
  font-family: var(--font-mono);
  color: #e2e8f0;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-bar {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: auto;
}

.mini-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #f59e0b);
  width: 100%;
}

.log-list {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
}

.log-item {
  display: flex;
  gap: 6px;
  padding: 3px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  color: #cbd5e1;
}

.log-t {
  color: var(--accent);
  flex-shrink: 0;
}

/* ==================== TIMELINE TAB ==================== */
.timeline-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tl-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: center;
  gap: 8px;
}

.tl-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.tl-track {
  position: relative;
  height: 16px;
  background: rgba(9, 12, 18, 0.85);
  border: 1px solid rgba(130, 156, 198, 0.16);
  border-radius: 4px;
  overflow: hidden;
}

.tl-seg {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 2px;
}

.tl-seg.hit { background: rgba(244, 63, 94, 0.78); }
.tl-seg.iframe { background: rgba(34, 197, 94, 0.72); }
.tl-seg.counter { background: rgba(56, 189, 248, 0.85); }
.tl-seg.cat0 { background: rgba(245, 158, 11, 0.75); }
.tl-seg.cat1 { background: rgba(167, 139, 250, 0.78); }
.tl-seg.cat2 { background: rgba(45, 212, 191, 0.75); }
.tl-seg.move { background: rgba(148, 163, 184, 0.65); }

.tl-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ffffff;
  box-shadow: 0 0 6px #fff;
  pointer-events: none;
}

.buffer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 24px;
}

.buf-chip {
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(245, 158, 11, 0.20);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.hit-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.hit-table th, .hit-table td {
  padding: 4px 5px;
  border-bottom: 1px solid rgba(130, 156, 198, 0.14);
  text-align: left;
}

.hit-table th {
  color: var(--text-muted);
  font-weight: 600;
}

/* ==================== RENDER PIPELINE SLIDERS ==================== */
.slider-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 8px;
}

.slider-head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}

.slider-name {
  color: #cbd5e1;
  font-family: var(--font-mono);
}

.slider-val {
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 600;
}

input[type="range"] {
  width: 100%;
  accent-color: #38bdf8;
  cursor: pointer;
}

.prov-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
}

.prov-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 4px;
  font-weight: 700;
}

.prov-tag.rec { background: rgba(34, 197, 94, 0.20); color: #86efac; }
.prov-tag.fit { background: rgba(245, 158, 11, 0.20); color: #fde68a; }
.prov-tag.sub { background: rgba(167, 139, 250, 0.22); color: #ddd6fe; }

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.28); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.45); }

@media (max-width: 1100px) {
  :root { --drawer-w: 340px; }
  .brand-sub { display: none; }
}
