/*
 * p4-blueprint.css - Blueprint (assistant designer): Add block panel, canvas, blocks, sticky notes, minimap.
 * Values come from css/sola/tokens.css. Layout uses logical properties so the page chrome mirrors in Arabic;
 * canvas coordinates (block / note positions, pan, zoom, minimap) stay physical, as jsPlumb and the saved
 * diagram use left/top. Port colours of the connectors come from js/controllers/core/portColors.js.
 */

/* ---- Page frame ---------------------------------------------------------- */
.agentDetailsContainer {
  position: relative;
  display: flex;
  inline-size: 100%;
  block-size: calc(100vh - var(--topbar-height));
  overflow: hidden;
  background: var(--bg-color);
}
.agentDesigner__stroke { stroke-width: 1.5px; }

/* ---- Add block panel (end side, over the canvas) ------------------------ */
.agentDetailsContainer .agentBlockPanel {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  inline-size: 300px;
  max-inline-size: 100%;
  min-block-size: 0;
  background: var(--bg-sidebar);
  border-inline-start: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  transform: translateX(calc(100% + 16px));
  visibility: hidden;
  transition: transform .22s ease, visibility .22s;
}
html[dir="rtl"] .agentDetailsContainer .agentBlockPanel { transform: translateX(calc(-100% - 16px)); }
.agentDetailsContainer .agentBlockPanel.is-open,
html[dir="rtl"] .agentDetailsContainer .agentBlockPanel.is-open { transform: none; visibility: visible; }
.agentDetailsContainer .agentBlockPanel .agentSideBar__title { flex: 1 1 auto; }
.agentDetailsContainer .agentBlockPanel .btn-close { font-size: var(--fs-xs); }
.agentDetailsContainer .agentBlockPanel .agentSideBar__toggle { color: var(--text-light); padding: var(--space-1); }
.agentDetailsContainer .agentBlockPanel .agentSideBar__toggle.is-pinned { color: var(--sola-primary); }
.agentDetailsContainer .agentBlockPanel .agentSideBar__toggle.is-pinned i { transform: rotate(-45deg); }
/* Canvas controls at the end side step aside while the panel is open. */
.agentDetailsContainer.is-panel-open .fixed-right-bottom-container { inset-inline-end: calc(300px + var(--space-2)); }
.agentDetailsContainer.is-panel-open #minimap-container { inset-inline-end: calc(300px + var(--space-5)); }
.agentDetailsContainer.is-panel-open .agentAddBlockBtn { visibility: hidden; }
.agentSideBar__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-4) var(--space-3);
}
.agentSideBar__title { margin: 0; font-size: var(--fs-md); font-weight: var(--fw-bold); letter-spacing: var(--ls-tight); }
.agentSideBar__toggle { padding: 0; line-height: 1; color: var(--text-primary); }
.agentSideBar__toggle:hover,
.agentSideBar__toggle:focus-visible { color: var(--sola-primary); }
.agentSideBar__search { padding: 0 var(--space-4) var(--space-3); border-block-end: 1px solid var(--border-color); }
.searchComponentDiv { position: relative; }
.searchComponentDiv .searchComponentSpan {
  position: absolute;
  inset-inline-start: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}
.searchComponentDiv .form-control {
  padding-inline-start: 2.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--grey-100);
}
.searchComponentDiv .form-control:focus { border-color: var(--sola-primary); background: var(--bg-card); }

.agentDetailsContainer .toolbarComponents {
  flex: 1 1 auto;
  min-block-size: 0;
  overflow: auto;
  padding: var(--space-3) var(--space-3) var(--space-4);
  background: var(--bg-muted);
  scrollbar-width: thin;
}
/* Filter chip (shown after a port is clicked: only blocks that fit that port). */
.agentDetailsContainer .filterMessageDiv {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin: var(--space-3) var(--space-4) 0;
  padding: 6px 8px 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--sola-primary-soft);
  color: var(--sola-primary-dark);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}
.agentDetailsContainer .filterMessageDiv .filter-icon { color: var(--sola-primary); }
.agentDetailsContainer .filterMessageDiv__close { flex: 0 0 auto; font-size: 9px; }

/* Block sets: a heading row with an icon tile; the blocks of an open set are tiles in two columns. */
.agentDetailsContainer .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-block-end: var(--space-1);
  padding: 6px var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-weight: var(--fw-medium);
  cursor: pointer;
  user-select: none;
  transition: var(--transition-fast);
}
.agentDetailsContainer .section-header:hover { background: var(--bg-card); box-shadow: var(--shadow-xs); }
.agentDetailsContainer .section-header.fw-bold { color: var(--sola-primary-dark); }
.agentDetailsContainer .section-name {
  display: flex;
  align-items: center;
  min-inline-size: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.agentDetailsContainer .section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  inline-size: 28px;
  block-size: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--sola-primary);
  font-size: 13px;
}
.agentDetailsContainer .section-icon i,
.agentDetailsContainer .section-icon img { margin: 0 !important; }
.agentDetailsContainer .section-title { font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; }
.agentDetailsContainer .toggle-arrow { font-size: 10px; color: var(--text-light); }
.agentDetailsContainer .component-list { display: none; }
.agentDetailsContainer .component-list[style*="block"] {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  margin: var(--space-1) 0 var(--space-3);
}

.agentDetailsContainer .component-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-block-size: 92px;
  padding: var(--space-3) var(--space-2) var(--space-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  font-size: var(--fs-xs);
  text-align: center;
  cursor: grab;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.agentDetailsContainer .component-item:not(.ui-draggable-disabled):hover {
  border-color: var(--sola-primary);
  box-shadow: 0 6px 16px rgba(28, 132, 255, 0.14);
}
.agentDetailsContainer .component-item .component-name {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  inline-size: 100%;
  min-inline-size: 0;
  color: var(--text-primary);
  font-weight: var(--fw-medium);
  line-height: 1.3;
}
.agentDetailsContainer .component-item .component-name > i,
.agentDetailsContainer .component-item .component-name > img {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  inline-size: 38px;
  block-size: 38px;
  padding: 9px;
  border-radius: var(--radius-circle);
  background: var(--sola-primary-soft);
  color: var(--sola-primary);
  font-size: 16px;
  object-fit: contain;
}
.agentDetailsContainer .component-item .component-name > span {
  margin: 0 !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
/* "+" sits in the top end corner; the grip is not needed on a tile. */
.agentDetailsContainer .component-item .action-buttons {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  display: flex;
  color: var(--text-secondary);
}
.agentDetailsContainer .component-item .action-buttons > i:not(.createComponentDiv) { display: none; }
.agentDetailsContainer .component-item .action-buttons .fa-plus {
  display: none;
  align-items: center;
  justify-content: center;
  inline-size: 22px;
  block-size: 22px;
  border-radius: var(--radius-circle);
  background: var(--sola-primary);
  color: var(--text-white);
  font-size: 11px;
  cursor: pointer;
}
.agentDetailsContainer .component-item:hover .action-buttons .fa-plus,
.agentDetailsContainer .component-item:focus-within .action-buttons .fa-plus { display: inline-flex; }
.agentDetailsContainer .component-item .action-buttons .fa-plus:hover { background: var(--sola-primary-dark); }
.agentDetailsContainer .component-item.ui-draggable-dragging {
  z-index: 1045;
  inline-size: 140px !important;
  border-color: var(--sola-primary);
  box-shadow: var(--shadow-lg);
  opacity: .95;
}
.agentDetailsContainer .component-item.ui-draggable-dragging .action-buttons { display: none !important; }
.agentDetailsContainer .component-item.ui-draggable-disabled { cursor: not-allowed; background: transparent; border-style: dashed; }
.agentDetailsContainer .component-item.ui-draggable-disabled .fa-plus { display: none !important; }
.agentDetailsContainer .component-item.ui-draggable-disabled .component-name { color: var(--text-light); }
.agentDetailsContainer .component-item.ui-draggable-disabled .component-name > i,
.agentDetailsContainer .component-item.ui-draggable-disabled .component-name > img { background: var(--grey-100); color: var(--text-light); filter: grayscale(1); opacity: .7; }
.disabled-cursor { cursor: not-allowed; }
.drop-cursor { cursor: copy; }

/* ---- Page frame columns ------------------------------------------------- */
.agentDetailsContainer .agentContentDiv {
  position: relative;
  isolation: isolate; /* keeps the canvas layers under the pop-ups */
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-inline-size: 0;
  block-size: 100%;
}

/* ---- Top bar parts (moved into the app top bar) -------------------------- */
.agentTopbarTitle { display: flex; align-items: center; gap: var(--space-2); min-inline-size: 0; }
.agentTopbarTitle__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  inline-size: 34px;
  block-size: 34px;
  border-radius: var(--radius-sm);
  background: var(--text-white);
  overflow: hidden;
}
.agentTopbarTitle__icon img { max-inline-size: 26px; max-block-size: 26px; }
.agentTopbarTitle .titleEllipsis {
  min-inline-size: 0;
  max-inline-size: 320px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: var(--fs-md);
}
.agentTopbarTitle .dropbtn {
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-white);
  line-height: 1;
  box-shadow: none;
}
.agentTopbarTitle .dropbtn:hover,
.agentTopbarTitle .dropbtn.show { background: rgba(255, 255, 255, 0.24); color: var(--text-white); }
.agentTopbarTitle .dropbtn::after { display: none; }
.agentTopbarTitle .dropdown-menu,
.agentTopbarActions .dropdown-menu { font-size: var(--fs-sm); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }
.agentTopbarTitle .dropdown-item,
.agentTopbarActions .dropdown-item { padding: 0.6rem 1rem; }
.agentTopbarActions { display: flex; align-items: center; gap: var(--space-3); }
.agentTopbarActions .agentActions,
.agentTopbarActions .agentSaveEditButton { display: flex; align-items: center; gap: var(--space-2); }
.agentTopbarActions .agentActions:not(:empty) + .agentSaveEditButton {
  padding-inline-start: var(--space-3);
  border-inline-start: 1px solid rgba(255, 255, 255, 0.3);
}
.agentTopbarActions .agentLockedInfo { color: var(--warning-color); }
.agentTopbarActions .btn-padding-agent { padding: 6px 12px !important; }
html[dir="rtl"] .agentTopbarActions .agentBackButton > i { transform: scaleX(-1); }
@media (max-width: 768px) {
  .agentTopbarTitle .titleEllipsis { display: none; }
}
.agentTopbarTitle__icon .agent-details-icon svg * { stroke: var(--text-primary) !important; }

.agent-details-icon svg * { stroke: var(--text-primary) !important; }
.agent-details-icon .customSvg { inline-size: 25px !important; block-size: 30px !important; }

/* ---- Canvas -------------------------------------------------------------- */
.agentDetailsContainer .agentContent {
  position: relative;
  flex: 1 1 auto;
  min-block-size: 0;
  overflow: hidden;
  cursor: grab;
}
/* Two-level grid: small dots every 20px, faint lines every 100px. */
.agentDetailsContainer .divWithDotBackground {
  background-color: var(--bg-muted);
  background-image:
    radial-gradient(circle, var(--grey-300) 1px, transparent 1.4px),
    linear-gradient(to right, rgba(12, 34, 68, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(12, 34, 68, 0.045) 1px, transparent 1px);
  background-size: 20px 20px, 100px 100px, 100px 100px;
  background-repeat: repeat;
}
.agentDetailsContainer .agentCanvasArea { block-size: 100%; }
.agentDetailsContainer .jtk-demo-main { block-size: 100%; }
.agentDetailsContainer .jtk-demo-canvas { position: relative; block-size: 100%; transform-origin: 0 0; }
.agentDetailsContainer #canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-origin: 0 0; /* pan / zoom are computed from the top-left corner */
}

/* Ports: coloured dots with a white ring and a soft shadow (the colour still comes from the data type). */
.jtk-demo-canvas .jtk-endpoint { cursor: crosshair; }
.jtk-demo-canvas .jtk-endpoint svg { overflow: visible; }
.jtk-demo-canvas .jtk-endpoint circle:not([fill="Transparent"]):not([fill="transparent"]) {
  stroke: var(--bg-card);
  stroke-width: 3.5px;
  paint-order: stroke;
  filter: drop-shadow(0 1px 1.5px rgba(12, 34, 68, 0.35));
  transition: r .15s ease;
}
.jtk-demo-canvas .jtk-endpoint:hover circle:not([fill="Transparent"]):not([fill="transparent"]) { r: 7.5px; }
.jtk-endpoint.active { border: 1px dotted var(--success-color); }
.jtk-endpoint.jtk-endpoint-anchor svg { transition: transform 0.2s ease-in-out; }
.jtk-endpoint.jtk-endpoint-anchor:hover svg { filter: drop-shadow(0 0 4px var(--sola-primary)); }

/* Connections: round ends; hovering one shows it moving in its direction. */
.jtk-demo-canvas svg.jtk-connector path { stroke-linecap: round; stroke-linejoin: round; }
.jtk-demo-canvas svg.jtk-connector.jtk-hover path:not(.jtk-connector-outline) {
  stroke-width: 3px;
  stroke-dasharray: 7 6;
  animation: studio-wire-flow .6s linear infinite;
}
@keyframes studio-wire-flow { to { stroke-dashoffset: -13; } }
@media (prefers-reduced-motion: reduce) { .jtk-demo-canvas svg.jtk-connector.jtk-hover path:not(.jtk-connector-outline) { animation: none; } }
/* Delete handle on a connection: a small round "x" (the overlay's own text is a placeholder, hidden). */
.agentchart-demo .aLabel {
  z-index: 19;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 18px;
  block-size: 18px;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-circle);
  background: var(--bg-card);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
  font-size: 0;
  opacity: 1 !important;
  cursor: pointer;
  transition: var(--transition-fast);
}
.agentchart-demo .aLabel::before {
  content: "\f00d";
  font-family: "Font Awesome 6 Pro";
  font-weight: 400;
  font-size: 10px;
  line-height: 1;
}
.agentchart-demo .aLabel:hover { border-color: var(--danger-color); background: var(--danger-color); color: var(--text-white); }

/* Add block (top end of the canvas) */
.agentDetailsContainer .agentAddBlockBtn {
  position: absolute;
  top: var(--space-4);
  inset-inline-end: var(--space-4);
  z-index: 4;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-weight: var(--fw-semibold);
  box-shadow: 0 8px 20px rgba(28, 132, 255, 0.35);
}

/* Zoom / fit / sticky-note tools (bottom start): a floating pill. */
.agentDetailsContainer .fixed-bottom-bar {
  position: fixed;
  bottom: var(--space-2);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--space-2);
  padding: 4px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
}
.agentDetailsContainer .iconFixed-container { display: flex; align-items: center; gap: 2px; inline-size: 100%; }
.agentDetailsContainer .agentCanvasTool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 34px;
  block-size: 34px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-circle);
  background: transparent;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition-fast);
}
.agentDetailsContainer .agentCanvasTool:hover,
.agentDetailsContainer .agentCanvasTool:focus-visible { background: var(--sola-primary-soft); color: var(--sola-primary); }
/* The note tool starts a new group. */
.agentDetailsContainer .agentCanvasTool:last-child { margin-inline-start: 4px; position: relative; }
.agentDetailsContainer .agentCanvasTool:last-child::before {
  content: "";
  position: absolute;
  inset-inline-start: -4px;
  top: 8px;
  bottom: 8px;
  border-inline-start: 1px solid var(--border-color);
}

/* Minimap toggle / Discard draft (bottom end) */
.agentDetailsContainer .fixed-right-bottom-container {
  position: absolute;
  inset-inline-end: var(--space-2);
  bottom: var(--space-2);
  z-index: 10001;
  display: flex;
  align-items: center;
}
.agentDetailsContainer .fixed-right-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--space-2);
  padding: 9px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  color: var(--danger-color);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: var(--transition-fast);
}
.agentDetailsContainer .fixed-right-bottom-bar:hover { border-color: var(--danger-color); background: var(--danger-soft); }
.agentDetailsContainer .fixed-right-bottom-bar.minimap-toggle-button {
  inline-size: 42px;
  block-size: 42px;
  padding: 0;
  border-radius: var(--radius-circle);
  color: var(--text-secondary);
}
.agentDetailsContainer .fixed-right-bottom-bar.minimap-toggle-button:hover { border-color: var(--sola-primary); background: var(--sola-primary-soft); color: var(--sola-primary); }

/* Minimap: a map of the canvas coordinates, so it is never mirrored. */
#minimap-container {
  position: absolute;
  inset-inline-end: var(--space-5);
  bottom: 70px;
  z-index: 10000;
  direction: ltr;
  inline-size: 220px;
  block-size: 160px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
#minimap-container.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
#minimap-world { position: absolute; top: 0; left: 0; transform-origin: top left; }
#minimap-world .minimap-element {
  position: absolute;
  border: 1px solid var(--sola-primary);
  border-radius: 4px;
  background: var(--sola-primary-soft-2);
}
#minimap-world .minimap-sticky-note { border-color: var(--warning-color); background: var(--warning-soft); }
#minimap-viewport {
  position: absolute;
  border: 2px solid var(--sola-primary);
  border-radius: 6px;
  background: rgba(28, 132, 255, 0.06);
  cursor: grab;
}
#minimap-viewport:active { cursor: grabbing; }

/* ---- Blocks on the canvas -------------------------------------------------- */
/* Width and side padding stay as they were: the ports are anchored relative to them. */
.componentContainer { position: absolute; inline-size: 220px; block-size: auto; z-index: 1001; cursor: default; }
.componentContainer.hovered { cursor: move; }
.componentContainer.clicked,
.jtk-endpoint.clicked,
.sticky-note-container.clicked,
.sticky-note-container.editing { z-index: 1043 !important; }

.componentContainer .component {
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-card);
  box-shadow: 0 1px 2px rgba(12, 34, 68, 0.06), 0 6px 18px rgba(12, 34, 68, 0.07);
  font-size: var(--fs-sm);
  transition: box-shadow .15s ease, border-color .15s ease;
}
.componentContainer.hovered .component { box-shadow: 0 2px 4px rgba(12, 34, 68, 0.08), 0 14px 32px rgba(12, 34, 68, 0.12); }
.componentContainer.clicked .component {
  border-color: var(--sola-primary) !important;
  box-shadow: 0 0 0 4px var(--sola-primary-soft-2), 0 14px 32px rgba(12, 34, 68, 0.12);
}
/* Header: accent bar, icon tile, name, description. */
.component .component-heading {
  position: relative;
  padding: 14px 12px 10px;
  border: 0;
  border-start-start-radius: 14px;
  border-start-end-radius: 14px;
  background: transparent;
}
.component .component-heading::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 0;
  block-size: 4px;
  border-start-start-radius: 14px;
  border-start-end-radius: 14px;
  background: var(--gradient-primary);
}
.component .component-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 6px;
  font-size: 13.5px !important;
  font-weight: var(--fw-bold);
  line-height: 1.25;
  color: var(--text-primary);
}
.component .component-title > i:first-child,
.component .component-title > img:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 30px;
  inline-size: 30px;
  block-size: 30px;
  margin: 0 !important;
  padding: 7px;
  border-radius: 9px;
  background: var(--sola-primary-soft);
  color: var(--sola-primary);
  font-size: 13px;
  object-fit: contain;
}
.component .component-heading small {
  display: block;
  color: var(--text-secondary);
  font-size: 11px !important;
  line-height: 1.4;
}
.component .component-beta {
  margin-inline-start: auto;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--danger-soft);
  color: var(--danger-color);
  font-size: 9px;
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}
/* Settings: an inset area with white fields. */
.component .component-body {
  padding: 10px 10px 2px;
  border-block-start: 1px solid var(--border-color);
  background: var(--bg-muted);
  font-size: 12px;
}
html[dir="rtl"] .component .component-body { font-size: var(--fs-xs); }
.component .component-body .form-label {
  margin-block-end: 4px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: var(--fw-semibold);
}
.component .component-body .form-control:not(:disabled):not([readonly]),
.component .component-body .form-select:not(:disabled),
.component .component-body .select2-container--bootstrap-5 .select2-selection {
  border-color: var(--border-color);
  background-color: var(--bg-card);
}
.component .component-body .form-control,
.component .component-body .form-select,
.component .component-body .select2-container--bootstrap-5 .select2-selection { border-radius: 8px; }
.component .component-inputs .form-group { margin-block-end: 10px !important; }
.component .component-tools { padding-block: 2px 8px; }
/* Outputs: one row per output, the name as a chip at the end (next to its port). */
.component .component-footer {
  padding: 6px 0;
  border-block-start: 1px solid var(--border-color);
  background: var(--bg-card);
  border-end-start-radius: 14px;
  border-end-end-radius: 14px;
}
.component .component-body .select2-container--open:not(.select2-container--below) { top: auto !important; left: auto !important; }
html[dir="rtl"] .component .component-body .select2-container--open:not(.select2-container--below) { left: 11px !important; }

/* Floating toolbar of the selected block (duplicate, delete, skill mode, more): a dark pill. */
.customComponentsToolbar {
  position: absolute;
  top: -46px;
  left: 50%; /* centred on the block: the same in both directions */
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 2px;
  block-size: 36px;
  padding: 3px;
  border: 0;
  border-radius: 10px;
  background: var(--grey-900);
  box-shadow: var(--shadow-lg);
  color: var(--text-white);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  transform: translateX(-50%);
}
.customComponentsToolbar::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  inline-size: 10px;
  block-size: 10px;
  background: var(--grey-900);
  transform: translateX(-50%) rotate(45deg);
  border-radius: 2px;
}
.customComponentsToolbar > div {
  display: flex;
  align-items: center;
  block-size: 100%;
  padding: 0 9px;
  border-radius: 7px;
  color: inherit;
}
.customComponentsToolbar > div:hover { background: rgba(255, 255, 255, 0.14); cursor: pointer; transition: background-color var(--transition); }
.customComponentsToolbar label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-block-end: 0 !important;
  color: inherit;
  font-size: var(--fs-xs);
  cursor: pointer;
}
.customComponentsToolbar i { color: inherit; }
.customComponentsToolbar .customComponentsToolbar__switchLabel { inline-size: 55px; }
.customComponentsToolbar .componentToolbarMore { position: relative; cursor: pointer; }
.customComponentsToolbar .componentToolbarMore > i { font-size: var(--fs-md); }
.customComponentsToolbar .submenuToolbar {
  position: absolute;
  top: 38px;
  z-index: 10000;
  padding: 4px;
  border: 0;
  border-radius: 10px;
  background: var(--grey-900);
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
}
.customComponentsToolbar .submenuToolbar__item { display: flex; align-items: center; padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.customComponentsToolbar .submenuToolbar__item label { font-size: var(--fs-sm); white-space: nowrap; }
.customComponentsToolbar .submenuToolbar div:hover { background: rgba(255, 255, 255, 0.14); cursor: pointer; }
.customComponentsToolbar .customSwitch { position: relative; inline-size: 30px; block-size: 25px; vertical-align: middle; cursor: pointer; }
.customComponentsToolbar .customSwitch input { position: absolute; inline-size: 0; block-size: 0; opacity: 0; }
.customComponentsToolbar .customSwitch .slider {
  position: absolute;
  top: 4px;
  inline-size: 30px;
  block-size: 17px;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.25);
  transition: 0.25s;
}
.customComponentsToolbar .customSwitch .slider::before {
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  inline-size: 13px;
  block-size: 13px;
  border-radius: var(--radius-circle);
  background: var(--text-white);
  content: "";
  transition: 0.25s;
}
.customComponentsToolbar .customSwitch input:checked + .slider { background: var(--sola-primary); }
.customComponentsToolbar .customSwitch input:checked + .slider::before { inset-inline-start: 15px; }
.customComponentsToolbar .customSwitch input:focus-visible + .slider { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35); }
.customComponentsToolbar .customSwitch input:disabled + .slider { opacity: 0.5; cursor: not-allowed; }
.customComponentsToolbar .customSwitch input:disabled + .slider::before,
.customComponentsToolbar .disabled,
.customComponentsToolbar > div.disabled:hover,
.customComponentsToolbar > div.disabled label,
.customComponentsToolbar > div.disabled label:hover { cursor: not-allowed !important; }
.customComponentsToolbar > div.disabled { opacity: .55; }

/* ---- Sticky notes ---------------------------------------------------------- */
.sticky-note-container {
  position: absolute;
  z-index: 1000;
  inline-size: 250px;
  block-size: 200px;
  border: 0 solid transparent;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(12, 34, 68, 0.06), 0 10px 24px rgba(12, 34, 68, 0.10);
  cursor: grab;
  transition: box-shadow 0.2s ease;
}
.sticky-note-container.clicked { box-shadow: 0 0 0 3px var(--sola-primary-soft-2), 0 0 0 1px var(--sola-primary), 0 10px 24px rgba(12, 34, 68, 0.12); }
.sticky-note-container.hovered { cursor: grab; }
.sticky-note-display,
.sticky-note-edit {
  box-sizing: border-box;
  inline-size: 100%;
  block-size: 100%;
  padding: var(--space-3);
  overflow: auto;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--grey-900);
  font-family: inherit;
  font-size: 12px;
  word-break: break-word;
  scrollbar-width: thin;
  scrollbar-color: var(--grey-400) transparent;
}
.sticky-note-edit { display: none; resize: none; }
.sticky-note-display h1 { font-size: 1.2em !important; }
.sticky-note-display h2 { font-size: 1.1em !important; }
.sticky-note-display h3 { font-size: 1em !important; }
.sticky-note-display h4 { font-size: 0.9em !important; }
.sticky-note-display h5 { font-size: 0.8em !important; }
.sticky-note-display h6 { font-size: 0.7em !important; }
.sticky-note-display p { margin: 0.3em 0; }
.sticky-note-display ul,
.sticky-note-display ol { margin: 0.3em 0; padding-inline-start: 1.2em; }
.sticky-note-display li { margin: 0.2em 0; }
.sticky-note-display::-webkit-scrollbar,
.sticky-note-edit::-webkit-scrollbar { inline-size: 6px; }
.sticky-note-display::-webkit-scrollbar-thumb,
.sticky-note-edit::-webkit-scrollbar-thumb { border-radius: 3px; background: var(--grey-400); }

/* Resize handle: bottom-end corner (bottom-left in Arabic, as the note grows towards the start there). */
.sticky-note-container .resizer-handle {
  position: absolute;
  z-index: 1003;
  display: none;
  background: transparent;
  cursor: se-resize;
}
.sticky-note-container .resizer-handle-br {
  position: absolute;
  bottom: 0;
  inset-inline-end: 0;
  inline-size: 18px;
  block-size: 18px;
  overflow: hidden;
  cursor: se-resize;
}
.sticky-note-container .resizer-handle-br::after {
  position: absolute;
  bottom: 0;
  inset-inline-end: 0;
  inline-size: 100%;
  block-size: 100%;
  background: rgba(12, 34, 68, 0.25);
  border-end-end-radius: 12px;
  clip-path: polygon(0 100%, 100% 100%, 100% 0);
  content: "";
}
html[dir="rtl"] .sticky-note-container .resizer-handle,
html[dir="rtl"] .sticky-note-container .resizer-handle-br { cursor: sw-resize; }
html[dir="rtl"] .sticky-note-container .resizer-handle-br::after { clip-path: polygon(0 100%, 100% 100%, 0 0); }
.sticky-note-container .resizer-handle-br { display: none !important; }
.sticky-note-container:hover .resizer-handle-br,
.sticky-note-container.clicked .resizer-handle-br { display: block !important; }

/* Toolbar of the selected note (colour, delete) */
.customStickyToolbar {
  position: absolute;
  top: -40px;
  left: 50%; /* centred on the note: the same in both directions */
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  padding: 4px 6px;
  border: 0;
  border-radius: 10px;
  background: var(--grey-900);
  box-shadow: var(--shadow-lg);
  color: var(--text-white);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  transform: translateX(-50%);
  transition: all 0.2s ease;
}
.sticky-note-container.clicked .customStickyToolbar { display: flex; }
.sticky-toolbar-left,
.sticky-toolbar-right { display: flex; align-items: center; }
.sticky-color-indicator {
  position: relative;
  inline-size: 16px;
  block-size: 16px;
  margin: 3px 6px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-circle);
  cursor: pointer;
}
.transparent-pattern {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-circle);
  background: repeating-linear-gradient(45deg, var(--grey-600), var(--grey-600) 2px, var(--bg-card) 2px, var(--bg-card) 4px);
}
.sticky-delete-button { display: flex; align-items: center; margin: 0 2px; padding: 5px 7px; border-radius: 7px; color: inherit; cursor: pointer; }
.sticky-delete-button:hover { background: rgba(255, 255, 255, 0.14); }
.sticky-delete-button i { font-size: var(--fs-xs); }
.sticky-color-palette {
  position: absolute;
  bottom: 38px;
  left: 50%;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  padding: 8px;
  border-radius: 10px;
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  transform: translateX(-50%);
}
.sticky-color-option {
  position: relative;
  inline-size: 18px;
  block-size: 18px;
  border: 1px solid var(--grey-300);
  border-radius: var(--radius-circle);
  cursor: pointer;
  transition: transform 0.2s ease;
}
.sticky-color-option:hover { transform: scale(1.1); }
.sticky-color-option.active { box-shadow: 0 0 0 1px var(--sola-primary); }
.sticky-color-option.transparent-option { border: 1px dashed var(--grey-600); }
.sticky-color-check {
  position: absolute;
  top: 8px;
  left: 50%;
  z-index: 1;
  color: var(--grey-800);
  font-size: 10px;
  transform: translate(-50%, -50%);
}

/* Preview that follows the mouse while a new note is being placed (appended to <body>). */
.sticky-note-preview {
  position: absolute;
  z-index: 99999;
  border: 1px dashed var(--grey-400);
  opacity: 0.7;
}
.sticky-note-preview__text { padding: var(--space-3); color: var(--grey-900); font-size: 12px; }

/* ---- Block set colours ------------------------------------------------------------------------------
 * Eight category colours (data-set-color = block set id mod 8, set by agentDetails.js) for the block bar,
 * icon tiles and panel tiles. A categorical palette for the canvas only, so it is defined here.
 */
[data-set-color] { --set-color: var(--sola-primary); }
[data-set-color="1"] { --set-color: #7c5cff; }
[data-set-color="2"] { --set-color: #0f9f94; }
[data-set-color="3"] { --set-color: #ea7a2c; }
[data-set-color="4"] { --set-color: #db4f8a; }
[data-set-color="5"] { --set-color: var(--success-color); }
[data-set-color="6"] { --set-color: #c98a0b; }
[data-set-color="7"] { --set-color: #4f5bd5; }
[data-set-color] { --set-soft: color-mix(in srgb, var(--set-color) 13%, transparent); }

.componentContainer[data-set-color] .component .component-heading::before { background: var(--set-color); }
.componentContainer[data-set-color] .component .component-title > i:first-child,
.componentContainer[data-set-color] .component .component-title > img:first-child { background: var(--set-soft); color: var(--set-color); }
.agentDetailsContainer .section-header[data-set-color] .section-icon { color: var(--set-color); border-color: var(--set-soft); background: var(--set-soft); }
.agentDetailsContainer .component-item[data-set-color] .component-name > i,
.agentDetailsContainer .component-item[data-set-color] .component-name > img { background: var(--set-soft); color: var(--set-color); }
.agentDetailsContainer .component-item[data-set-color]:not(.ui-draggable-disabled):hover { border-color: var(--set-color); }

/* ---- Collapse (show connected settings only) ------------------------------------------------------ */
.component .component-heading { padding-inline-end: 36px; }
.studio-block-collapse {
  position: absolute;
  top: 14px;
  inset-inline-end: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 24px;
  block-size: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-circle);
  background: transparent;
  color: var(--text-light);
  font-size: 11px;
  cursor: pointer;
  transition: var(--transition-fast);
}
.studio-block-collapse:hover,
.studio-block-collapse:focus-visible { background: var(--bg-hover); color: var(--text-primary); }
.componentContainer.is-collapsed .studio-block-collapse i { transform: rotate(180deg); }
.componentContainer.is-collapsed .component-heading small { display: none; }
.componentContainer.is-collapsed .component-title { margin-block-end: 0; }
.studio-collapsed-hidden { display: none !important; }
/* Nothing connected: the empty settings area folds away too. */
.componentContainer.is-collapsed .component-body:not(:has(.form-group:not(.studio-collapsed-hidden))) { display: none; }

/* ---- Where a connected setting comes from --------------------------------------------------------- */
/* Text boxes: the box itself reads like a link chip ("Block · output"). */
.component .form-group.has-source .form-control:disabled {
  border: 1px dashed var(--set-color, var(--sola-primary));
  border-radius: var(--radius-pill);
  background: var(--sola-primary-soft);
  color: var(--sola-primary-dark);
  font-weight: var(--fw-semibold);
  opacity: 1;
}
.component .form-group.has-source .form-control:disabled::placeholder { color: var(--sola-primary-dark); opacity: 1; }
.component .form-group.has-source .studio-block-lock { color: var(--sola-primary); }
.component .form-group.has-source .studio-block-lock::before { content: "\f0c1"; }
/* Other kinds of settings: a chip under the setting name. */
.studio-block-source {
  display: flex;
  align-items: center;
  gap: 6px;
  max-inline-size: 100%;
  margin-block: 2px 4px;
  padding: 3px 10px;
  border: 1px dashed var(--sola-primary);
  border-radius: var(--radius-pill);
  background: var(--sola-primary-soft);
  color: var(--sola-primary-dark);
  font-size: 11px;
  font-weight: var(--fw-semibold);
}
.studio-block-source span { min-inline-size: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.studio-block-source i { flex: 0 0 auto; font-size: 10px; }

/* ---- Data type hints ------------------------------------------------------------------------------- */
.component .studio-port-hint::before {
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  inline-size: 7px;
  block-size: 7px;
  margin-inline-end: 6px;
  border-radius: var(--radius-circle);
  background: var(--port-color, var(--grey-400));
  vertical-align: 1px;
}
.component .output-label.studio-port-hint::before { margin-inline-end: 0; vertical-align: 0; }

/* ---- Zoom level ------------------------------------------------------------------------------------ */
.agentDetailsContainer .agentZoomLevel {
  min-inline-size: 44px;
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
  text-align: center;
  user-select: none;
}

/* ---- Direction: arrowhead on a connected receiving port, pointing into its block ---------------------- */
.jtk-demo-canvas .jtk-endpoint.studio-port-in.jtk-endpoint-connected::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -8px;
  inline-size: 7px;
  block-size: 9px;
  background: var(--port-color, var(--grey-500));
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  transform: translateY(-50%);
  pointer-events: none;
}
html[dir="rtl"] .jtk-demo-canvas .jtk-endpoint.studio-port-in.jtk-endpoint-connected::after {
  left: auto;
  right: -8px;
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
}

/* ---- Compact blocks (settings open in a pop-up) ----------------------------------------------------- */
/* On the canvas a block shows its name, one row per connectable setting (each keeps its port and wire)
   and its outputs. Double-click or the sliders button opens the full form in a pop-up. */
.component .component-heading { padding-inline-end: 62px; }
.studio-block-settings {
  position: absolute;
  top: 14px;
  inset-inline-end: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 24px;
  block-size: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-circle);
  background: transparent;
  color: var(--text-light);
  font-size: 11px;
  cursor: pointer;
  transition: var(--transition-fast);
}
.studio-block-settings:hover,
.studio-block-settings:focus-visible { background: var(--sola-primary-soft); color: var(--sola-primary); }

.componentContainer:not(.is-editing) .component-heading { padding-block-end: 12px; }
.componentContainer:not(.is-editing) .component-heading small { display: none; }
.componentContainer:not(.is-editing) .component-title { margin-block-end: 0; }
.componentContainer:not(.is-editing) .component-body { padding-block: 6px; user-select: none; }
.componentContainer:not(.is-editing) .component-body .form-group:not(:has(> .input-port)) { display: none !important; }
.componentContainer:not(.is-editing) .component-body .form-group {
  margin-block-end: 0 !important;
  padding-block: 4px;
  min-block-size: 24px;
}
.componentContainer:not(.is-editing) .component-body .form-group > :not(.form-label):not(.input-port):not(.form-check) { display: none !important; }
.componentContainer:not(.is-editing) .component-body .form-check { margin: 0; padding: 0; min-block-size: 0; }
.componentContainer:not(.is-editing) .component-body .form-check > :not(.form-check-label),
.componentContainer:not(.is-editing) .component-body .form-check-input { display: none !important; }
.componentContainer:not(.is-editing) .component-body .form-label,
.componentContainer:not(.is-editing) .component-body .form-check-label {
  display: block;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: var(--fw-medium);
  cursor: inherit;
}
.componentContainer:not(.is-editing) .component-body .form-label .text-danger,
.componentContainer:not(.is-editing) .component-body .form-label .fa-circle-info,
.componentContainer:not(.is-editing) .component-body .form-label [role="img"] { display: none; }
/* A connected setting names its source under the setting name. */
.componentContainer:not(.is-editing) .form-group[data-source-label] > .form-label[data-source-label]::after,
.componentContainer:not(.is-editing) .form-group[data-source-label] .form-check-label[data-source-label]::after {
  content: attr(data-source-label);
  display: block;
  overflow: hidden;
  margin-block-start: 1px;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--sola-primary-dark);
  font-size: 10.5px;
  font-weight: var(--fw-semibold);
}
/* Nothing to show (no connectable settings): the settings area folds away. */
.componentContainer:not(.is-editing) .component-body:not(:has(.form-group:not(.studio-collapsed-hidden):not([style*="display: none"]) > .input-port)) { display: none !important; }
.componentContainer:not(.is-editing) .component-body + .component-footer { border-block-start: 1px solid var(--border-color); }

/* The block inside its settings pop-up: a plain form. */
.studio-block-editor-modal .modal-body { padding: var(--space-5); }
.studio-block-editor .componentContainer {
  position: static !important;
  inline-size: auto !important;
  z-index: auto !important;
  cursor: default !important;
}
.studio-block-editor .componentContainer .component {
  border: 0 !important;
  border-radius: 0;
  background: transparent;
  box-shadow: none !important;
  font-size: var(--fs-sm);
}
.studio-block-editor .component-heading,
.studio-block-editor .component-footer,
.studio-block-editor .component-tools,
.studio-block-editor .input-port { display: none !important; }
.studio-block-editor .component .component-body {
  display: block !important;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: var(--fs-sm);
}
.studio-block-editor .component .component-body .form-label { font-size: var(--fs-sm); color: var(--text-primary); }
.studio-block-editor .component .component-inputs .form-group { margin-block-end: var(--space-4) !important; }
.studio-block-editor .component .component-inputs .form-group:last-child { margin-block-end: 0 !important; }
.studio-block-editor .component .studio-port-hint::before { display: none; }
.studio-block-editor__empty { margin: 0; color: var(--text-secondary); }

/* ---- Block look v2: header and outputs ------------------------------------------------------------ */
/* Header: no top bar; a solid icon tile in the block-set colour over a soft wash of the same colour.
   The header buttons show when the block is hovered, selected or reached with the keyboard. */
.componentContainer .component .component-heading,
.componentContainer[data-set-color] .component .component-heading {
  padding-block: 12px;
  padding-inline: 12px 64px;
  border-block-end: 1px solid var(--grey-100);
  background: linear-gradient(180deg, var(--set-soft, var(--sola-primary-soft)) 0%, transparent 100%);
}
.componentContainer .component .component-heading::before,
.componentContainer[data-set-color] .component .component-heading::before { display: none; }
.componentContainer .component .component-title > i:first-child,
.componentContainer .component .component-title > img:first-child,
.componentContainer[data-set-color] .component .component-title > i:first-child,
.componentContainer[data-set-color] .component .component-title > img:first-child {
  flex-basis: 32px; inline-size: 32px; block-size: 32px; padding: 8px;
  border-radius: 10px;
  background: var(--set-color, var(--sola-primary));
  color: var(--text-white);
  box-shadow: 0 4px 10px color-mix(in srgb, var(--set-color, var(--sola-primary)) 30%, transparent);
}
.componentContainer .component .component-title > img:first-child { background: var(--bg-card); box-shadow: inset 0 0 0 1px var(--border-color); }
.componentContainer .component .component-title { font-size: 13px !important; letter-spacing: -0.01em; }
.studio-block-settings,
.studio-block-collapse { top: 50%; margin-block-start: -12px; transition: opacity .15s ease, background-color .15s ease, color .15s ease; }
.componentContainer:not(.hovered):not(.clicked):not(.is-collapsed) .studio-block-collapse,
.componentContainer:not(.hovered):not(.clicked) .studio-block-settings { opacity: 0; }
.studio-block-settings:focus-visible,
.studio-block-collapse:focus-visible { opacity: 1 !important; }
@media (hover: none) {
  .componentContainer .studio-block-settings,
  .componentContainer .studio-block-collapse { opacity: 1 !important; }
}

/* One white surface: settings rows and outputs share it; a dashed line separates them. */
.componentContainer:not(.is-editing) .component .component-body { background: var(--bg-card); border-block-start: 0; }
.componentContainer .component .component-footer,
.componentContainer:not(.is-editing) .component-body + .component-footer {
  padding: 4px 0 6px;
  border-block-start: 1px dashed var(--grey-200);
  background: var(--bg-card);
}
.componentContainer .component .component-body[style*="display: none"] + .component-footer { border-block-start: 0; }

/* Outputs: plain rows, the name then its type dot next to the port (no chip, no arrow). */
.component .output-card:not(.output-card-toolset) .card-body { min-block-size: 26px; padding: 2px 12px; }
.component .output-card:not(.output-card-toolset) .output-label {
  flex-direction: row-reverse;
  gap: 7px;
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: var(--fw-medium);
}
.component .output-card:not(.output-card-toolset) .output-label::after { content: none; }
.component .output-card:not(.output-card-toolset) .output-label.studio-port-hint::before { margin: 0; inline-size: 8px; block-size: 8px; vertical-align: 0; }
html[dir="rtl"] .component .output-card:not(.output-card-toolset) .output-label::after { content: none; }

/* ==== Blueprint: dark only ============================================================================
   The designer always uses a dark navy theme (no light option). The design-system tokens are set again
   on the designer root only (the app's side bar and top bar keep their normal look), so every rule that uses them
   turns dark; Bootstrap controls follow data-bs-theme="dark" on the root. Pop-ups opened from the
   designer stay in the light theme. */
.agentDetailsContainer {
  color-scheme: dark;
  --grey-50:  #0f1b30;
  --grey-100: #172741;
  --grey-200: #22365a;
  --grey-300: #2d4470;
  --grey-400: #6f84a6;
  --grey-500: #9aabc7;
  --grey-600: #b7c4da;
  --grey-700: #cdd7e8;
  --grey-800: #e6edf8;
  --grey-900: #050c18;

  --bg-color:   #0b1424;
  --bg-card:    #13213a;
  --bg-muted:   #0f1b30;
  --bg-hover:   #1c2e4d;
  --bg-sidebar: #0f1b30;
  --card-bg:    #13213a;

  --text-primary:   #e6edf8;
  --text-secondary: #9aabc7;
  --text-light:     #6f84a6;
  --text-link:      #5aa8ff;
  --border-color:   #22365a;

  --sola-primary-soft:   rgba(61, 155, 255, 0.16);
  --sola-primary-soft-2: rgba(61, 155, 255, 0.26);
  --primary-soft:        var(--sola-primary-soft);
  --bg-sidebar-hover:    rgba(61, 155, 255, 0.16);
  --sola-primary-dark:   #5aa8ff;
  --primary-dark:        #5aa8ff;
  --success-soft: rgba(33, 182, 111, 0.18);
  --warning-soft: rgba(248, 182, 58, 0.18);
  --danger-soft:  rgba(240, 93, 94, 0.18);
  --info-soft:    rgba(94, 200, 255, 0.18);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 44px rgba(0, 0, 0, 0.45);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.5);
  --focus-ring: 0 0 0 3px rgba(61, 155, 255, 0.35);
  color: var(--text-primary);
}
.agentDetailsContainer[data-bs-theme="dark"] {
  --bs-body-bg: var(--bg-card);
  --bs-body-color: var(--text-primary);
  --bs-border-color: var(--border-color);
  --bs-secondary-bg: var(--bg-muted);
  --bs-tertiary-bg: var(--bg-hover);
  --bs-heading-color: var(--text-primary);
  --bs-emphasis-color: var(--text-primary);
  --bs-secondary-color: var(--text-secondary);
}

/* Canvas: dark grid. */
.agentDetailsContainer .divWithDotBackground {
  background-color: #0b1424;
  background-image:
    radial-gradient(circle, rgba(154, 171, 199, 0.22) 1px, transparent 1.4px),
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
}
.agentDetailsContainer #minimap-container { background: rgba(19, 33, 58, 0.9); }
.agentDetailsContainer #minimap-viewport { background: rgba(61, 155, 255, 0.1); }

/* Blocks: deeper shadows and a lit edge so cards lift off the dark canvas. */
.agentDetailsContainer .componentContainer .component {
  border-color: #263c62;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 8px 24px rgba(0, 0, 0, 0.45);
}
.agentDetailsContainer .componentContainer.hovered .component { border-color: #34507f; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 14px 34px rgba(0, 0, 0, 0.55); }
.agentDetailsContainer .componentContainer.clicked .component { box-shadow: 0 0 0 4px rgba(61, 155, 255, 0.3), 0 14px 34px rgba(0, 0, 0, 0.55); }
.agentDetailsContainer .jtk-demo-canvas .jtk-endpoint circle:not([fill="Transparent"]):not([fill="transparent"]) { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }
.agentDetailsContainer [data-set-color] { --set-soft: color-mix(in srgb, var(--set-color) 22%, transparent); }
.agentDetailsContainer .component .form-group[data-source-label] > .form-label[data-source-label]::after,
.agentDetailsContainer .component .form-group[data-source-label] .form-check-label[data-source-label]::after { color: #5aa8ff; }
