/* --------------------------------------------------------------------------
   BEAT 03: REAL PLATFORM OPERATIONS DAG STAGE & INTERACTIVE ENGINE
   -------------------------------------------------------------------------- */
.dag-sim-card {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  position: relative;
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

.dag-canvas-stage {
  position: relative;
  width: 100%;
  height: 840px;
  background: transparent;
  overflow: hidden;
  user-select: none;
  cursor: grab;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.dag-canvas-stage:active {
  cursor: grabbing;
}

.dag-svg-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.dag-gp-circle { fill: rgba(0, 0, 0, 0.05); }

.dag-orb {
  fill: none;
  stroke: rgba(0, 0, 0, 0.06);
  stroke-width: 1;
}

.dag-axis {
  stroke: rgba(0, 0, 0, 0.05);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.dag-ed {
  fill: none;
  stroke: rgba(0, 0, 0, 0.12);
  stroke-width: 1.3;
  transition: stroke 0.2s, stroke-width 0.2s, opacity 0.2s;
}

.dag-ed.active-edge {
  stroke: #18181B;
  stroke-width: 2;
}

.dag-ed.dimmed {
  opacity: 0.12;
}

.dag-pt {
  fill: #18181B;
  transition: opacity 0.3s;
}

.dag-nd {
  cursor: pointer;
  outline: none;
  transition: opacity 0.25s, transform 0.4s ease;
}

.dag-nd .hit { fill: transparent; }

.dag-nd .b {
  fill: #FFFFFF;
  stroke: rgba(0, 0, 0, 0.25);
  stroke-width: 1.4;
  transition: r 0.2s, stroke 0.2s, fill 0.2s;
}

.dag-nd:hover .b {
  stroke: #18181B;
  r: 12;
}

.dag-nd.selected .b {
  stroke: #18181B;
  stroke-width: 2.2;
}

.dag-nd.dimmed {
  opacity: 0.15;
  pointer-events: none;
}

.dag-nd.risk .in { fill: var(--accent-risk); }
.dag-nd.warn .in { fill: var(--accent-warn); }
.dag-nd.wip .in { fill: #2563EB; }
.dag-nd.todo .in { fill: #A1A1AA; }
.dag-nd.ok .in { fill: var(--accent-ok); }

.dag-nd.core .b {
  fill: #18181B;
  stroke: #18181B;
}

.dag-nd.core .cring {
  fill: none;
  stroke: rgba(24, 24, 27, 0.2);
  stroke-width: 1;
}

.dag-nd .lb {
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  fill: var(--text-main);
  pointer-events: none;
}

.dag-nd.br .lb {
  font-size: 12.5px;
  font-weight: 700;
}

.dag-nd .sb {
  font-family: var(--font-mono);
  font-size: 9px;
  fill: var(--text-dim);
  pointer-events: none;
}

/* UNIFIED CENTERED DAG HUD TOOLBAR & VISUAL TIMER */
.dag-hud-bar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}
.dag-hud-bar > * {
  pointer-events: auto;
}

.dag-legend-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 4px;
  border-radius: 8px;
  border: none;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}

.dag-lg-btn {
  position: relative;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.dag-lg-btn > *:not(.dag-timer-fill) {
  position: relative;
  z-index: 2;
}

.dag-lg-btn i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

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

.dag-lg-btn.active {
  background: transparent;
  color: var(--text-main);
  font-weight: 600;
  border: none;
}

.dag-timer-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: rgba(22, 22, 24, 0.08);
  border-radius: 6px;
  pointer-events: none;
  z-index: 1;
}
.dag-lg-btn.active .dag-timer-fill {
  width: 100%;
  transition: width 2.4s linear;
}

.dag-zoom-controls {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 8px;
  border: none;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.dag-zoom-btn {
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  padding: 6px 12px;
  min-height: 32px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.dag-zoom-btn:hover {
  background: var(--bg-hover);
}

.dag-inspector-panel {
  position: absolute;
  top: 16px;
  left: 18px;
  width: 320px;
  max-width: calc(100% - 36px);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 16px 18px;
  pointer-events: auto;
  display: none;
  z-index: 10;
}

.dag-inspector-panel.visible {
  display: block;
  animation: profileFadeIn 0.2s ease forwards;
}

.dag-inspector-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.dag-insp-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.dag-insp-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  margin: -10px -10px -10px 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dag-insp-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dag-insp-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.dag-insp-badge.risk { background: #FEE2E2; color: #991B1B; }
.dag-insp-badge.warn { background: #FEF3C7; color: #92400E; }
.dag-insp-badge.wip { background: #DBEAFE; color: #1E40AF; }
.dag-insp-badge.ok { background: #D1FAE5; color: #065F46; }

.dag-insp-tasks {
  list-style: none;
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dag-insp-tasks li {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 1024px) {
  .dag-lg-btn {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }
  .dag-zoom-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 8px 14px;
    font-size: 14px;
  }
}

@media (max-width: 960px) {
  .dag-hud-bar {
    bottom: 10px;
    left: 10px;
    right: 10px;
    transform: none;
    width: auto;
    max-width: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  .dag-legend-bar {
    width: 100%;
    max-width: 640px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    padding: 4px;
  }
  .dag-lg-btn {
    padding: 8px 10px;
    font-size: 12px;
  }
}

@media (max-width: 768px) {
  .dag-canvas-stage {
    height: 440px;
    touch-action: pan-y;
  }
  .dag-inspector-panel {
    top: 10px;
    left: 10px;
    right: 10px;
    width: auto;
    max-width: none;
    max-height: 54%;
    overflow-y: auto;
  }
}
