.ias-graph-container {
  position: relative;
  width: 100%;
  height: 600px; /* Base height for desktop */
  max-width: 1200px;
  margin: 40px auto;
  overflow: visible;
  /* subtle font settings */
  font-family: inherit;
}

@media (max-width: 809.98px) {
  .ias-graph-container {
    height: 500px;
  }
}

.ias-graph-edges {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.ias-graph-edge {
  fill: none;
  stroke: var(--token-9d24f47f-c5d3-4537-acab-640a0124327b, #1f1f1f);
  stroke-width: 1.5px;
  opacity: 0.15;
  transition: opacity 0.3s ease, stroke-width 0.3s ease;
}



.ias-graph-edge.is-highlighted {
  opacity: 0.5;
  stroke: var(--color-text-highlight, #a64823);
  stroke-width: 1.5px;
}
.ias-graph-edge.is-dimmed {
  opacity: 0.05;
}

.ias-graph-node-category {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #fff !important;
  transform: translate(-50%, -50%);
  opacity: 0.25;
  z-index: 2;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}



.ias-graph-node-category.is-highlighted {
  opacity: 0.5;
  transform: translate(-50%, -50%) scale(1.5);
}
.ias-graph-node-category.is-dimmed {
  opacity: 0.1;
}

.ias-graph-node-tool {
  position: absolute;
  width: 56px;
  height: 56px;
  transform: translate(-50%, -50%);
  z-index: 3;
  cursor: pointer;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
  padding: 8px;
  box-sizing: border-box;
  border: 0;
  font: inherit;
  touch-action: manipulation;
}



.ias-graph-node-tool img,
.ias-graph-node-tool svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
/* Ensure dark mode SVGs invert if needed, but framer usually handles this via classes. Let's just rely on current styles */

.ias-graph-node-tool.is-active {
  transform: translate(-50%, -50%) scale(1.15);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  z-index: 10;
}


.ias-graph-node-tool.is-dimmed {
  opacity: 0.45;
  filter: grayscale(100%);
}

.ias-graph-popover {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateY(10px);
  width: 240px;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  background: var(--token-f07a4a98-8ec1-4e78-9e53-3b4c10651da0, #ffffff);
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.1);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  pointer-events: none;
  z-index: 20;
  text-align: left;
}



.ias-graph-popover.is-visible {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ias-graph-popover-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.ias-graph-popover-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--token-9d24f47f-c5d3-4537-acab-640a0124327b, #1f1f1f) !important;
  margin: 0;
}
.ias-graph-popover-cat {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
  margin: 0 0 8px 0;
}


.ias-graph-popover-desc {
  font-size: 13px;
  line-height: 1.4;
  color: #444;
  margin: 0 0 12px 0;
}


.ias-graph-popover-uses-title {
  font-size: 11px;
  font-weight: 600;
  color: #666;
  margin: 0 0 4px 0;
  text-transform: uppercase;
}

.ias-graph-popover-uses {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.ias-graph-popover-uses li {
  font-size: 11px;
  background: rgba(0,0,0,0.05);
  padding: 4px 8px;
  border-radius: 4px;
  color: #333;
}


.ias-graph-popover {
  padding: var(--space-4, 16px);
  border: 1px solid var(--color-border-default, #d1cec7);
  background: var(--color-bg-primary, #faf9f7);
  color: var(--color-text-primary, #1f1f1f);
  font-family: inherit;
  text-align: start;
}
html[lang="ar"] .ias-graph-popover {
  font-family: var(--ias-arabic-ui, sans-serif);
  direction: rtl;
}
.ias-graph-popover-title {
  color: var(--color-text-primary, #1f1f1f) !important;
}
.ias-graph-popover :is(.ias-graph-popover-cat, .ias-graph-popover-desc, .ias-graph-popover-uses-title) {
  color: var(--color-text-secondary, #67635d);
}
.ias-graph-popover-uses li {
  color: var(--color-text-primary, #1f1f1f);
  background: var(--color-surface-hover, #faf9f7);
}
.ias-graph-node-tool:focus-visible {
  outline: 2px solid var(--color-text-highlight, #a64823);
  outline-offset: 4px;
}
@media (prefers-reduced-motion: reduce) {
  .ias-graph-container *, .ias-graph-container *::before {
    animation: none !important;
    transition: none !important;
  }
}

[dir="rtl"] .ias-graph-popover {
  text-align: right;
  direction: rtl;
}
[dir="rtl"] .ias-graph-popover-uses span {
  margin-right: 0;
  margin-left: 6px;
}

@keyframes engineRotateOuter {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes engineRotateInner {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(-360deg); }
}

@keyframes enginePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.85); opacity: 0.8; }
}

.engine-outer {
  animation: engineRotateOuter 20s linear infinite;
}
.engine-inner {
  animation: engineRotateInner 14s linear infinite;
}
.engine-core {
  animation: enginePulse 6s ease-in-out infinite;
}

.ias-graph-node-category.is-core:hover .engine-outer {
  animation: engineRotateOuter 8s linear infinite;
}
.ias-graph-node-category.is-core:hover .engine-inner {
  animation: engineRotateInner 6s linear infinite;
}
.ias-graph-node-category.is-core:hover .engine-core {
  animation: enginePulse 2s ease-in-out infinite;
}

/* When a tool is hovered, the core engine turns orange */
.ias-graph-node-category.is-core {
  transition: color 0.4s ease, opacity 0.3s ease;
}
.ias-graph-node-category.is-core.is-highlighted {
  color: var(--color-text-highlight, #a64823) !important;
  opacity: 1;
}
.ias-graph-node-category.is-core.is-highlighted .engine-outer {
  animation: engineRotateOuter 8s linear infinite;
}
.ias-graph-node-category.is-core.is-highlighted .engine-inner {
  animation: engineRotateInner 6s linear infinite;
}
.ias-graph-node-category.is-core.is-highlighted .engine-core {
  animation: enginePulse 2s ease-in-out infinite;
}
