/* Structure map — boxes and wire routes come from the ELK plan (structure-layout.js); the look follows the
   PatternFly topology view: white boxes with a status dot, lightly shaded groups, plain thin lines.
   Logical properties keep the page right for Arabic; the diagram itself reads left to right (dir="ltr"). */
.cs-root {
  --cs-ok: var(--action, #238656);
  --cs-bad: var(--danger, #ba544d);
  --cs-warn: var(--warn, #c47a2c);
  --cs-grey: #8a9094;
  --cs-ext: #6d7f8c;
  --cs-line: color-mix(in srgb, var(--muted, #7a9182) 70%, var(--ink, #15241b));
  display: grid;
  gap: 0.75rem;
  margin-block: 0.35rem 1rem;
  color: var(--ink, inherit);
  max-inline-size: 100%;
}
.cs-toolbar {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) minmax(12rem, 1fr) auto auto;
  gap: 0.65rem;
  align-items: end;
}
.cs-toolbar .field {
  margin: 0;
  min-inline-size: 0;
}
.cs-search {
  inline-size: 100%;
}
.cs-zoom {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}
.cs-zoom-label {
  min-inline-size: 3rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  color: var(--muted, #5a6a60);
}
.cs-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}
.cs-clock {
  margin: 0;
  color: var(--muted, #5a6a60);
}
.cs-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  font-size: 0.78rem;
  color: var(--muted, #5a6a60);
}
.cs-key {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.cs-key::before {
  content: '';
  inline-size: 0.6rem;
  block-size: 0.6rem;
  border-radius: 50%;
  background: var(--cs-grey);
}
.cs-key[data-kind='live']::before {
  background: var(--cs-ok);
}
.cs-key[data-kind='fault']::before {
  background: var(--cs-bad);
}
.cs-key[data-kind='external']::before {
  background: transparent;
  border: 2px solid var(--cs-ext);
  box-sizing: border-box;
}

.cs-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
}
/* Details drawer over the side of the map, only while something is selected. */
.cs-root[data-detail='closed'] .cs-detail {
  display: none;
}
.cs-root[data-detail='open'] .cs-detail {
  position: absolute;
  inset-block-start: 0.6rem;
  inset-inline-end: 0.6rem;
  z-index: 5;
  inline-size: min(20rem, calc(100% - 1.2rem));
  max-block-size: calc(100% - 1.2rem);
  overflow: auto;
  box-shadow: 0 10px 30px rgba(15, 30, 22, 0.18);
}
.cs-close {
  justify-self: end;
  font: inherit;
  font-size: 1.2rem;
  line-height: 1;
  border: 0;
  background: transparent;
  color: var(--muted, #5a6a60);
  cursor: pointer;
  padding: 0.1rem 0.35rem;
  margin-block-end: -1.6rem;
}
.cs-graph-stack {
  display: grid;
  gap: 0.85rem;
  min-inline-size: 0;
}

/* The board scrolls over the scaled diagram; the sizer holds the scaled size. */
.cs-board {
  position: relative;
  overflow: auto;
  min-block-size: 20rem;
  max-block-size: min(72vh, 46rem);
  border: 1px solid var(--line, #c9d6cd);
  border-radius: 0.75rem;
  background:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink, CanvasText) 9%, transparent) 1px, transparent 0) 0 0 / 20px 20px,
    color-mix(in srgb, var(--panel, Canvas) 94%, var(--soft, #e4eee7));
  padding: 0.75rem;
  cursor: grab;
  overscroll-behavior: contain;
}
.cs-board[data-dragging='true'] {
  cursor: grabbing;
  user-select: none;
}
.cs-board:focus-visible {
  outline: 2px solid var(--focus, #2f6b4f);
  outline-offset: 2px;
}
.cs-sizer {
  position: relative;
  overflow: hidden;
  margin-inline: auto;
}
.cs-stage {
  position: relative;
  transform-origin: top left;
  inset-block-start: 0;
}
.cs-stage > .cs-wires {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.cs-circuit {
  position: relative;
  z-index: 2;
  min-inline-size: 0;
}
.cs-circuit-placed {
  position: absolute;
  inset: 0;
}
.cs-placed {
  position: absolute;
  box-sizing: border-box;
  margin: 0;
}
/* Without a plan (older pages), a simple grid. */
.cs-circuit-overview:not(.cs-circuit-placed) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
}
.cs-circuit-project:not(.cs-circuit-placed) {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(15rem, 1fr);
  gap: 1.5rem;
  align-items: start;
}

/* Status dot shared by every box */
.cs-dot {
  inline-size: 0.7rem;
  block-size: 0.7rem;
  border-radius: 50%;
  background: var(--cs-grey);
  flex: none;
}
[data-kind='live'] > .cs-dot {
  background: var(--cs-ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cs-ok) 18%, transparent);
}
[data-kind='fault'] > .cs-dot,
[data-chain='failed'] > .cs-dot {
  background: var(--cs-bad);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cs-bad) 22%, transparent);
}
[data-kind='affected'] > .cs-dot {
  background: var(--cs-warn);
}
[data-kind='external'] > .cs-dot {
  background: transparent;
  border: 2px solid var(--cs-ext);
  box-sizing: border-box;
}
[data-kind='registered'] > .cs-dot {
  background: var(--cs-ext);
}

/* Project boxes on the overview */
.cs-project-card,
.cs-project-node {
  font: inherit;
  color: inherit;
  text-align: start;
  background: var(--panel, Canvas);
  border: 1px solid var(--line, #c9d6cd);
  border-inline-start: 5px solid var(--cs-grey);
  border-radius: 0.6rem;
  padding: 0.6rem 0.75rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  column-gap: 0.55rem;
  row-gap: 0.2rem;
  align-items: center;
  align-content: center;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(26, 51, 36, 0.08);
  overflow: hidden;
}
.cs-project-node[data-kind='live'] {
  border-inline-start-color: var(--cs-ok);
}
.cs-project-node[data-faults='true'],
.cs-project-node[data-kind='fault'] {
  border-inline-start-color: var(--cs-bad);
}
.cs-project-node .cs-name {
  font-size: 1rem;
}
.cs-project-node .cs-meta,
.cs-project-node .cs-counts,
.cs-project-node .cs-agents {
  grid-column: 2;
}
.cs-counts {
  font-size: 0.76rem;
  color: var(--muted, #5a6a60);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cs-agents {
  font-size: 0.72rem;
  color: var(--focus, #4c74ab);
}
.cs-agents:empty {
  display: none;
}
.cs-project-card:focus-visible,
.cs-project-node:focus-visible {
  outline: 2px solid var(--focus, #2f6b4f);
  outline-offset: 2px;
}
.cs-project-node[data-agent='true'] {
  outline: 2px solid color-mix(in srgb, var(--focus, #4c74ab) 70%, transparent);
}
.cs-project-node[data-selected='true'] {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--action, #2f6b4f) 55%, transparent);
}
.cs-project-card .sub,
.cs-project-node .sub {
  margin: 0;
}

/* One line for the name, one line for state and age: nothing wraps over anything. */
.cs-name {
  min-inline-size: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  line-height: 1.25;
}
.cs-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  min-inline-size: 0;
  font-size: 0.76rem;
  color: var(--muted, #5a6a60);
  line-height: 1.2;
}
.cs-status {
  min-inline-size: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: inherit;
}
[data-kind='live'] .cs-status {
  color: var(--action-text, #1f6b45);
}
[data-kind='fault'] .cs-status {
  color: var(--danger, #9b3b34);
  font-weight: 600;
}
.cs-age {
  font-variant-numeric: tabular-nums;
  color: var(--muted, #6a7278);
  white-space: nowrap;
  flex: none;
  font-size: 0.74rem;
}

/* Groups (lanes) inside a project */
.cs-project,
.cs-lane {
  border: 1px solid color-mix(in srgb, var(--line, #c9d6cd) 85%, transparent);
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--panel, Canvas) 55%, transparent);
  z-index: 0;
}
.cs-lane.cs-placed {
  padding: 0;
}
.cs-lane > h2 {
  position: absolute;
  inset-block-start: 0.55rem;
  inset-inline-start: 0.8rem;
  inset-inline-end: 0.8rem;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted, #5a6a60);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cs-unplaced,
.cs-registry .cs-project {
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--panel, Canvas);
}
.cs-unplaced > h2,
.cs-registry .cs-project > h2 {
  position: static;
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: 0;
  color: inherit;
  white-space: normal;
}
.cs-registry {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.85rem;
}
.cs-project-registry {
  background: color-mix(in srgb, var(--panel, Canvas) 90%, var(--soft, #d7e0d9));
}

/* Service boxes */
.cs-node {
  font: inherit;
  color: inherit;
  text-align: start;
  background: var(--panel, Canvas);
  border: 1px solid var(--line, #becbc2);
  border-inline-start: 4px solid var(--cs-grey);
  border-radius: 0.5rem;
  padding: 0.45rem 0.6rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 0.5rem;
  row-gap: 0.15rem;
  align-items: center;
  align-content: center;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 1px 2px rgba(26, 51, 36, 0.07);
  overflow: hidden;
  transition: box-shadow 120ms ease, opacity 120ms ease;
}
.cs-node .cs-meta {
  grid-column: 2;
}
.cs-node:not(.cs-placed) {
  position: relative;
  min-block-size: 3.4rem;
}
.cs-node:hover {
  box-shadow: 0 2px 8px rgba(26, 51, 36, 0.16);
}
.cs-node:focus-visible,
.cs-a11y-item:focus-visible {
  outline: 2px solid var(--focus, #2f6b4f);
  outline-offset: 1px;
}
.cs-node[data-lane='registry'] {
  border-style: dashed;
}
.cs-node[data-agent='true'] {
  outline: 2px solid color-mix(in srgb, var(--focus, #4c74ab) 75%, transparent);
}
.cs-node[data-selected='true'] {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--action, #2f6b4f) 60%, transparent);
}
.cs-node[data-kind='live'] {
  border-inline-start-color: var(--cs-ok);
}
.cs-node[data-kind='fault'],
.cs-node[data-observation='failed'],
.cs-node[data-chain='failed'] {
  border-inline-start-color: var(--cs-bad);
  background: color-mix(in srgb, var(--panel, Canvas) 92%, var(--cs-bad));
}
.cs-node[data-kind='affected'] {
  border-inline-start-color: var(--cs-warn);
}
.cs-node[data-kind='external'],
.cs-node[data-kind='registered'] {
  border-inline-start-color: var(--cs-ext);
}

/* Only real running units and fresh measured signals move. */
.cs-node[data-observation='running'] > .cs-dot {
  animation: cs-activity 0.9s ease-in-out infinite alternate;
}
.cs-wire[data-fresh='true'][data-phase='started'] {
  stroke-dasharray: 6 6;
  animation: cs-flow 0.8s linear infinite;
}
.cs-project-node[data-agent='true'] .cs-agents {
  animation: cs-activity 1.1s ease-in-out infinite alternate;
}
@keyframes cs-activity {
  to {
    opacity: 0.4;
  }
}
@keyframes cs-flow {
  to {
    stroke-dashoffset: -12;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cs-node[data-observation='running'] > .cs-dot,
  .cs-wire[data-fresh='true'][data-phase='started'],
  .cs-project-node[data-agent='true'] .cs-agents {
    animation: none;
  }
}

/* Wires: thin plain lines; hover a box to light up its own wires. */
.cs-wires {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: visible;
}
.cs-wire {
  fill: none;
  stroke: var(--cs-line);
  stroke-width: 1.6;
  stroke-linejoin: round;
  opacity: 0.75;
  transition: opacity 120ms ease, stroke-width 120ms ease;
}
.cs-wire-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 14;
  pointer-events: stroke;
  cursor: pointer;
}
.cs-wire[data-phase='failed'],
.cs-wire[data-chain='failed'] {
  stroke: var(--cs-bad);
  stroke-width: 2.6;
  opacity: 1;
}
.cs-wire[data-phase='completed'] {
  stroke: var(--cs-ok);
}
.cs-wire[data-fresh='true'][data-phase='started'] {
  stroke: var(--focus, #4476b1);
  stroke-width: 2.6;
  opacity: 1;
}
.cs-wire[data-hover='true'] {
  opacity: 0.18;
}
.cs-wire[data-hot='true'] {
  opacity: 1;
  stroke: var(--focus, #2f6b4f);
  stroke-width: 2.6;
}
.cs-wire[data-dim='true'] {
  opacity: 0.18;
}

/* Details panel */
.cs-detail {
  display: grid;
  gap: 0.45rem;
  align-content: start;
  overflow-wrap: anywhere;
}
.cs-project h2,
.cs-detail h2,
.cs-events h3,
.cs-a11y summary,
.cs-graph-stack > h3 {
  font-family: var(--font-display, inherit);
}
.cs-detail h2 {
  font-size: 1.05rem;
  margin: 0;
}
.cs-detail h3,
.cs-events h3 {
  font-size: 0.95rem;
  margin: 0.4rem 0 0;
}
.cs-detail .sub,
.cs-events .sub,
.cs-a11y .sub {
  margin: 0;
}
.cs-state[data-observation='failed'],
.cs-state[data-kind='fault'] {
  color: var(--danger, #9b3b34);
}
.cs-state[data-kind='affected'] {
  color: var(--warn, #8a5a16);
}
.cs-state[data-observation='running'],
.cs-state[data-observation='ready'],
.cs-state[data-observation='available'],
.cs-state[data-kind='live'] {
  color: var(--action-text, #1f6b45);
}
.cs-events,
.cs-raw,
.cs-a11y {
  display: grid;
  gap: 0.45rem;
}
.cs-a11y,
.cs-raw {
  border: 1px solid var(--line, #c9d6cd);
  border-radius: 0.65rem;
  padding: 0.55rem 0.75rem;
  background: color-mix(in srgb, var(--panel, Canvas) 96%, var(--soft, #e8f0ea));
}
.cs-a11y summary,
.cs-raw summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
}
.cs-a11y-body {
  margin-block-start: 0.55rem;
}
.cs-a11y-list {
  display: grid;
  gap: 0.35rem;
  max-block-size: 22rem;
  overflow: auto;
}
.cs-a11y-item {
  font: inherit;
  color: inherit;
  text-align: start;
  background: transparent;
  border: 0;
  border-block-end: 1px solid color-mix(in srgb, var(--line, #c9d6cd) 80%, transparent);
  padding: 0.4rem 0.1rem;
  cursor: pointer;
  display: grid;
  gap: 0.12rem;
}
.cs-a11y-item[data-kind='fault'] strong {
  color: var(--danger, #9b3b34);
}
.cs-a11y-item[data-kind='live'] strong {
  color: var(--action-text, #1f6b45);
}
.cs-raw-body {
  display: grid;
  gap: 0.3rem;
  max-block-size: 16rem;
  overflow: auto;
  margin-block-start: 0.5rem;
}
.cs-board [hidden],
.cs-registry [hidden],
.cs-project[hidden] {
  display: none !important;
}

@media (max-width: 1100px) {
  .cs-toolbar {
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  }
}
@media (max-width: 760px) {
  .cs-layout {
    grid-template-columns: 1fr;
  }
  .cs-root[data-detail='open'] .cs-detail {
    position: static;
    inline-size: auto;
    max-block-size: none;
  }
  .cs-board {
    min-block-size: 16rem;
    max-block-size: min(60vh, 30rem);
    padding: 0.5rem;
  }
  .cs-registry {
    grid-template-columns: minmax(0, 1fr);
  }
}

html[lang='ar'] .cs-root {
  letter-spacing: 0;
}
html[lang='ar'] .cs-lane > h2 {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.8rem;
}

[data-theme='dark'] .cs-board {
  background:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink) 14%, transparent) 1px, transparent 0) 0 0 / 20px 20px,
    color-mix(in srgb, var(--panel) 92%, var(--bg-accent, #173022));
}
[data-theme='dark'] .cs-project-node,
[data-theme='dark'] .cs-node {
  box-shadow: var(--shadow, none);
}
[data-theme='dark'] .cs-lane {
  background: color-mix(in srgb, var(--panel) 40%, transparent);
}

/* One fold for everything that is not the map. */
.cs-more { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.cs-more > summary { cursor: pointer; padding: 12px 16px; font-weight: 600; color: var(--muted); list-style-position: inside; }
.cs-more[open] > summary { border-bottom: 1px solid var(--line); }
.cs-more > :not(summary) { margin: 12px 16px; }
.cs-follow { max-width: 320px; }

/* ==========================================================================================================
   The world (owner, 25 Nov 2026: «ابي STRUCTURE شاشه كامله وعالم كامل حي اتعمق فيه وارى كل الطرق والادوات»).
   One full screen: every project is a region, every unit, tool and repository sits inside it, every road is drawn.
   The wheel zooms like a map; the farther out, the less text.
   ========================================================================================================== */
.cs-root[data-full='true'] {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  padding: 14px 18px 18px;
  background:
    radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--glow, rgba(34, 197, 94, .3)) 60%, transparent), transparent 60%),
    radial-gradient(900px 500px at 100% 110%, color-mix(in srgb, #06b6d4 18%, transparent), transparent 60%),
    var(--bg, #09090b);
}
.cs-root:fullscreen { background-color: var(--bg, #09090b); }
.cs-root[data-full='true'] > .cs-more { display: none; }
.cs-root[data-full='true'] .cs-layout { min-block-size: 0; block-size: 100%; }
.cs-root[data-full='true'] .cs-graph-stack { position: relative; block-size: 100%; min-block-size: 0; }
.cs-root[data-full='true'] .cs-board {
  block-size: 100%;
  max-block-size: none;
  min-block-size: 0;
  border-radius: 18px;
  cursor: grab;
  background:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink, CanvasText) 10%, transparent) 1px, transparent 0) 0 0 / 26px 26px,
    color-mix(in srgb, var(--panel, Canvas) 70%, transparent);
}
.cs-root[data-full='true'] .cs-board[data-dragging='true'] { cursor: grabbing; }
.cs-world-btn[aria-pressed='true'] { box-shadow: 0 0 0 2px var(--action, #15803d), 0 0 24px -4px var(--glow, rgba(34, 197, 94, .5)); }

/* Regions: one glass island per project; its colour follows the project's state. */
.cs-region {
  position: absolute;
  border: 1px solid color-mix(in srgb, var(--line, #d4d4d8) 80%, transparent);
  border-radius: 22px;
  background: color-mix(in srgb, var(--panel, Canvas) 62%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 8%, transparent), 0 20px 50px -30px rgba(0, 0, 0, .45);
  backdrop-filter: blur(6px);
}
.cs-region[data-kind='live'] { border-color: color-mix(in srgb, var(--cs-ok, #16a34a) 45%, transparent); }
.cs-region[data-kind='fault'] { border-color: color-mix(in srgb, var(--cs-bad, #dc2626) 60%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--cs-bad, #dc2626) 30%, transparent), 0 0 60px -20px color-mix(in srgb, var(--cs-bad, #dc2626) 60%, transparent); }
.cs-region[data-kind='external'] { border-style: dashed; }
.cs-region > h2 {
  position: absolute;
  inset-inline: 20px;
  inset-block-start: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cs-region > h2 .cs-status { font-size: .78rem; font-weight: 550; color: var(--muted, #71717a); }
.cs-region[data-kind='fault'] > h2 .cs-status { color: var(--cs-bad, #dc2626); }
.cs-region > h2 .cs-dot { flex: none; }

/* Lanes inside an island, and the roads between islands. */
.cs-world-lane {
  position: absolute;
  border-radius: 14px;
  background: color-mix(in srgb, var(--soft, #f4f4f5) 55%, transparent);
  pointer-events: none;
}
.cs-world-lane > h3 {
  margin: 0;
  padding: 12px 16px 0;
  font-size: .72rem;
  font-weight: 650;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted, #71717a);
}
html[lang='ar'] .cs-world-lane > h3 { letter-spacing: 0; text-transform: none; font-size: .8rem; }
.cs-world-lane[data-lane-kind='tools'] { background: color-mix(in srgb, #06b6d4 6%, transparent); }
.cs-wire[data-road='between'] { stroke-width: 2.4; stroke: color-mix(in srgb, #06b6d4 70%, var(--cs-line, #94a3b8)); }
.cs-root[data-lod='far'] .cs-world-lane > h3 { opacity: 0; }

/* Level of detail. */
.cs-root[data-lod='far'] .cs-circuit-world .cs-node .cs-meta,
.cs-root[data-lod='mid'] .cs-circuit-world .cs-node[data-lane='registry'] .cs-meta { display: none; }
.cs-root[data-lod='far'] .cs-circuit-world .cs-node { justify-content: center; }
.cs-root[data-lod='far'] .cs-region > h2 { font-size: 2.6rem; inset-block-start: 6px; }
.cs-root[data-lod='far'] .cs-region > h2 .cs-status { font-size: 1.4rem; }
.cs-root[data-lod='far'] .cs-circuit-world .cs-node .cs-name { font-size: 1.05rem; }

/* Minimap, bottom corner of the world. */
.cs-minimap {
  position: absolute;
  inset-inline-end: 16px;
  inset-block-end: 16px;
  inline-size: 190px;
  padding: 8px;
  border: 1px solid var(--line, #d4d4d8);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel, Canvas) 85%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .45);
  cursor: crosshair;
  z-index: 3;
}
.cs-minimap[hidden] { display: none; }
.cs-minimap svg { display: block; inline-size: 100%; block-size: auto; }
.cs-minimap-region { fill: color-mix(in srgb, var(--action, #15803d) 10%, transparent); stroke: color-mix(in srgb, var(--action, #15803d) 45%, transparent); stroke-width: 8; }
.cs-minimap-node { fill: color-mix(in srgb, var(--ink, #09090b) 35%, transparent); }
.cs-minimap-view { fill: color-mix(in srgb, var(--action, #15803d) 12%, transparent); stroke: var(--action, #15803d); stroke-width: 14; }

@media (max-width: 760px) {
  .cs-root[data-full='true'] { padding: 8px; }
  .cs-minimap { inline-size: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  .cs-region { backdrop-filter: none; }
}

/* In the world the roads run above the island backgrounds, thicker so they read when zoomed out. */
.cs-stage[data-mode='world'] .cs-wires { z-index: 3; pointer-events: none; }
.cs-stage[data-mode='world'] .cs-wires .cs-wire-hit { pointer-events: stroke; }
.cs-stage[data-mode='world'] .cs-wire { stroke-width: 2.6; opacity: .9; }
.cs-stage[data-mode='world'] .cs-wire[data-road='between'] { stroke-width: 4; }

/* Structure takes the whole page (owner, 25 Nov 2026): no page heading or footer around it. */
.main[data-workspace='structure'] > .breadcrumb,
.main[data-workspace='structure'] > .pagehead,
.main[data-workspace='structure'] > .foot { display: none; }

/* Lines (owner, 25 Nov 2026: «الخطوط تنبض بالحياه»; 26 Nov 2026: «الخطوط تولع وتطفي كل شي بشكل غريب كانها خربت»).
   With every link measured and healthy, a pulse on all of them made the whole map blink. A healthy measured wire is
   now a steady solid line. Movement means one thing only: the wires of the box under the pointer flow, and a wire
   carrying a real signal that has just started flows. A failed chain stays solid red. */
.cs-wire[data-live='true']:not([data-chain='failed']) { stroke-dasharray: none; animation: none; opacity: .9; }
.cs-wire[data-live='true'][data-hot='true']:not([data-chain='failed']):not([data-phase='started']) {
  stroke-dasharray: 14 10;
  animation: cs-pulse-flow 1.6s linear infinite;
  opacity: 1;
}
@keyframes cs-pulse-flow { to { stroke-dashoffset: -24; } }
@media (prefers-reduced-motion: reduce) {
  .cs-wire[data-live='true'] { animation: none; stroke-dasharray: none; }
}
/* The minimap stays small and see-through until the pointer reaches it, so it never hides a project. */
.cs-minimap { inline-size: 150px; opacity: .72; transition: opacity .2s ease; }
.cs-minimap:hover { opacity: 1; }

/* The whole window, no frame (owner, 25 Nov 2026: «عندك الصفحه كامله ليه حاطها بفرايم»). */
.cs-root[data-full='true'] { padding: 10px 14px 0; gap: 6px; }
.cs-root[data-full='true'] .cs-board {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin-inline: -14px;
  background:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink, CanvasText) 9%, transparent) 1px, transparent 0) 0 0 / 26px 26px,
    transparent;
}
.cs-root[data-full='true'] .cs-graph-stack { margin-inline: 0; }

/* One map, a colour per project. */
.cs-node[data-project='hospital-bot'] { --cs-project: #16a34a; }
.cs-node[data-project='opseye'] { --cs-project: #2563eb; }
.cs-node[data-project='patient-relations'] { --cs-project: #9333ea; }
.cs-node[data-project='executive-assistant'] { --cs-project: #d97706; }
.cs-node[data-project='almather-hr'] { --cs-project: #0d9488; }
.cs-node[data-project='marketing-ideas'] { --cs-project: #db2777; }
.cs-circuit-world .cs-node {
  border-inline-start: 4px solid var(--cs-project, var(--line, #d4d4d8));
  background: color-mix(in srgb, var(--cs-project, transparent) 7%, var(--panel, Canvas));
}
.cs-circuit-world .cs-node[data-kind='script'] { border-style: dashed; border-inline-start-style: solid; }
.cs-key {
  position: absolute;
  inset-inline-start: 16px;
  inset-block-start: 12px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-inline-size: calc(100% - 200px);
}
.cs-key[hidden] { display: none; }
.cs-key-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line, #d4d4d8) 80%, transparent);
  background: color-mix(in srgb, var(--panel, Canvas) 88%, transparent);
  backdrop-filter: blur(8px);
  font-size: .8rem;
}
.cs-key-item i { inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--cs-project); }
.cs-key-item .cs-status { color: var(--muted, #71717a); font-size: .72rem; }
.cs-key-item[data-kind='fault'] .cs-status { color: var(--cs-bad, #dc2626); }
.cs-key-item[data-project='hospital-bot'] { --cs-project: #16a34a; }
.cs-key-item[data-project='opseye'] { --cs-project: #2563eb; }
.cs-key-item[data-project='patient-relations'] { --cs-project: #9333ea; }
.cs-key-item[data-project='executive-assistant'] { --cs-project: #d97706; }
.cs-key-item[data-project='almather-hr'] { --cs-project: #0d9488; }
.cs-key-item[data-project='marketing-ideas'] { --cs-project: #db2777; }
/* In the whole window the tools sit on one slim row; the project key sits beside the sample time. */
.cs-root[data-full='true'] .cs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}
.cs-root[data-full='true'] .cs-toolbar > .field:first-child { flex: 0 0 13rem; }
.cs-root[data-full='true'] .cs-toolbar > .field:nth-child(2) { flex: 1 1 16rem; }
.cs-root[data-full='true'] .cs-key { position: static; max-inline-size: none; }
.cs-status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.cs-status-row > .cs-key { flex: 1 1 auto; }

/* What a box does, and a change request for the Council (owner, 25 Nov 2026). */
.cs-does { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; line-height: 1.5; }
.cs-ask { display: grid; gap: 8px; padding: 10px; border-radius: 12px; background: color-mix(in srgb, #16a34a 8%, transparent); }
.cs-ask h3 { margin: 0; }
.cs-ask-input { inline-size: 100%; box-sizing: border-box; resize: vertical; padding: 8px 10px; border-radius: 10px; font: inherit; }
