/* Public + lab Architecture diagram styles */
#itsl-viz-architecture.itsl-tabpanel-fill { overflow: hidden; }
.mkt-arch-mount #itsl-arch-workspace,
.itsl-arch-workspace { min-height: 0; }
/* ITSL Architecture tab — from docs/itsl/innov8heat_architecture_explainer.html */
#itsl-viz-architecture.itsl-tabpanel-fill { overflow: hidden; }
.itsl-arch-workspace {
  --arch-bg:#eef1f5;--arch-panel:#fff;--arch-ink:#16202c;--arch-ink-soft:#5c6774;--arch-ink-faint:#8b95a3;--arch-line:#dde3ea;
  --arch-accent:#0e4a7d;--arch-accent-ink:#0b3a63;--arch-accent-soft:#e6eef6;
  --arch-heat:#d64a3c;--arch-heat-soft:#fbe4e1;--arch-cool:#2f6fc4;--arch-cool-soft:#dcebfb;
  --arch-green:#1d7a46;--arch-green-soft:#e2f4e9;--arch-amber:#b98708;--arch-amber-soft:#fcf3d9;
  --arch-ctrl:#7048e8;--arch-ctrl-soft:#efe9fd;--arch-market:#c06a1b;--arch-market-soft:#fdeedd;
  --arch-steel:#26323f;
  height:100%;display:flex;flex-direction:column;min-height:0;background:var(--arch-panel);color:var(--arch-ink);font-size:14px;
}

.itsl-arch-top {
  height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 14px;
  border-bottom: 1px solid var(--arch-line); flex-shrink: 0; background: #fff;
}
.itsl-arch-top .ttl { font-size: 13px; font-weight: 700; color: var(--arch-accent-ink); }
.itsl-arch-top .badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: .4px; color: var(--arch-ink-soft);
  background: var(--arch-bg); border: 1px solid var(--arch-line); padding: 3px 9px; border-radius: 20px;
}
.itsl-arch-top .sub { font-size: 12px; color: var(--arch-ink-faint); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.itsl-arch-top .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.itsl-arch-btn {
  font-size: 12px; font-weight: 600; color: var(--arch-ink-soft); border: 1px solid var(--arch-line);
  background: #f7f9fb; padding: 7px 12px; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.itsl-arch-btn:hover { border-color: var(--arch-accent); color: var(--arch-accent); }
.itsl-arch-btn.primary {
  background: linear-gradient(180deg, #1461a5, var(--arch-accent));
  border-color: var(--arch-accent-ink); color: #fff !important;
}
.itsl-arch-btn.primary:hover { filter: brightness(1.07); color: #fff !important; }
.itsl-arch-btn.primary svg { fill: #fff; }
.itsl-arch-btn svg { width: 13px; height: 13px; fill: currentColor; }

.itsl-arch-main { flex: 1; display: grid; grid-template-columns: 1fr 310px; min-height: 0; }
.itsl-arch-scene {
  position: relative; overflow: hidden;
  background: radial-gradient(1500px 800px at 50% 18%, #fbfcfe, #eef2f7 82%);
}
#itsl-arch-svg {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}
#itsl-arch-svg:active { cursor: grabbing; }
#itsl-arch-svg .node { cursor: pointer; }

.itsl-arch-legend {
  position: absolute; left: 14px; top: 12px; background: rgba(255,255,255,.95);
  border: 1px solid var(--arch-line); border-radius: 10px; padding: 9px 13px;
  display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; color: var(--arch-ink-soft); z-index: 6;
}
.itsl-arch-legend .k { display: flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.itsl-arch-legend .k.off { opacity: .32; }
.itsl-arch-legend .sw { width: 22px; height: 3px; border-radius: 2px; }
.itsl-arch-legend .ttl {
  font-size: 9.5px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase;
  color: var(--arch-ink-faint); margin-bottom: 1px;
}
.itsl-arch-hint {
  position: absolute; left: 14px; bottom: 14px; font-size: 11.5px; color: var(--arch-ink-faint);
  background: rgba(255,255,255,.92); border: 1px solid var(--arch-line); padding: 5px 10px; border-radius: 8px; z-index: 6;
}
.itsl-arch-workspace.story .itsl-arch-hint { display: none; }

.itsl-arch-workspace .node { cursor: pointer; }
.itsl-arch-workspace .node .plinth { fill: rgba(16,32,44,.07); }
.itsl-arch-workspace .node:hover .halo { opacity: .5; }
.itsl-arch-workspace .halo { opacity: 0; transition: opacity .18s ease; }
.itsl-arch-workspace .node.active .halo { opacity: 1; }
.itsl-arch-workspace .nlabel { font-size: 13px; font-weight: 700; fill: var(--arch-ink); }
.itsl-arch-workspace .nsub { font-size: 11px; fill: var(--arch-ink-faint); }

.itsl-arch-workspace .pipe { fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: .30; }
.itsl-arch-workspace .flow {
  fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 9 15;
  animation: itsl-arch-march 1.1s linear infinite;
}
@keyframes itsl-arch-march { to { stroke-dashoffset: -24; } }
.itsl-arch-workspace .flow.slow { animation-duration: 1.9s; }
.itsl-arch-workspace .flowgrp.hidden { display: none; }
.itsl-arch-workspace .flabel { font-size: 10.5px; font-weight: 700; letter-spacing: .2px; }

.itsl-arch-dim {
  position: absolute; inset: 0; background: rgba(238,242,247,.74); opacity: 0;
  pointer-events: none; transition: opacity .28s ease; z-index: 3;
}
.itsl-arch-workspace.story .itsl-arch-dim { opacity: 1; }
.itsl-arch-workspace.story .node { opacity: .28; transition: opacity .3s ease; }
.itsl-arch-workspace.story .node.spot { opacity: 1; }
.itsl-arch-workspace.story .flowgrp { opacity: .15; transition: opacity .3s ease; }
.itsl-arch-workspace.story .flowgrp.lit { opacity: 1; }

.itsl-arch-aside {
  border-left: 1px solid var(--arch-line); display: flex; flex-direction: column;
  min-height: 0; background: var(--arch-panel);
}
.itsl-arch-ahead { padding: 14px 16px 12px; border-bottom: 1px solid var(--arch-line); flex-shrink: 0; }
.itsl-arch-akicker { font-size: 10px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; color: var(--arch-ink-faint); }
.itsl-arch-atitle { font-size: 16px; font-weight: 800; line-height: 1.25; margin-top: 3px; color: var(--arch-ink); }
.itsl-arch-abody { flex: 1; overflow-y: auto; padding: 14px 16px; }
.itsl-arch-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.itsl-arch-chip {
  font-size: 10.5px; font-weight: 700; padding: 4px 10px; border-radius: 20px;
  background: var(--arch-bg); color: var(--arch-ink-soft);
}
.itsl-arch-chip.elec { background: var(--arch-green-soft); color: var(--arch-green); }
.itsl-arch-chip.heat { background: var(--arch-heat-soft); color: var(--arch-heat); }
.itsl-arch-chip.ctrl { background: var(--arch-ctrl-soft); color: var(--arch-ctrl); }
.itsl-arch-chip.mkt { background: var(--arch-market-soft); color: var(--arch-market); }
.itsl-arch-lead { font-size: 13px; line-height: 1.55; color: var(--arch-ink); margin-bottom: 12px; }
.itsl-arch-sec {
  font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--arch-ink-faint); margin: 14px 0 7px;
}
.itsl-arch-abody ul { list-style: none; font-size: 12.5px; line-height: 1.55; color: var(--arch-ink-soft); margin: 0; padding: 0; }
.itsl-arch-abody li {
  padding: 6px 0 6px 15px; position: relative; border-bottom: 1px solid var(--arch-line);
}
.itsl-arch-abody li:last-child { border-bottom: none; }
.itsl-arch-abody li::before {
  content: ""; position: absolute; left: 0; top: 13px; width: 5px; height: 5px;
  border-radius: 1.5px; background: var(--arch-accent);
}
.itsl-arch-kv {
  display: flex; justify-content: space-between; gap: 10px; padding: 7px 0;
  border-bottom: 1px solid var(--arch-line); font-size: 12.5px;
}
.itsl-arch-kv .k { color: var(--arch-ink-soft); }
.itsl-arch-kv .v { font-weight: 700; text-align: right; }
.itsl-arch-note {
  margin-top: 12px; font-size: 11.5px; line-height: 1.55; color: var(--arch-ink-faint);
  background: var(--arch-bg); border: 1px solid var(--arch-line); border-radius: 9px; padding: 10px 12px;
}

.itsl-arch-storybar {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%) translateY(150%);
  z-index: 20; display: flex; align-items: center; gap: 10px; background: var(--arch-panel);
  border: 1px solid var(--arch-line); border-radius: 14px; padding: 10px 14px;
  box-shadow: 0 18px 44px rgba(16,32,44,.22);
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.itsl-arch-workspace.story .itsl-arch-storybar { transform: translateX(-50%) translateY(0); }
.itsl-arch-cbtn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--arch-line);
  background: #f7f9fb; color: var(--arch-ink); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.itsl-arch-cbtn:hover { border-color: var(--arch-accent); color: var(--arch-accent); }
.itsl-arch-cbtn svg { width: 15px; height: 15px; fill: currentColor; }
.itsl-arch-cbtn.play {
  width: 42px; background: linear-gradient(180deg, #1461a5, var(--arch-accent));
  border-color: var(--arch-accent-ink); color: #fff;
}
.itsl-arch-count {
  font-size: 12.5px; font-weight: 700; min-width: 64px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.itsl-arch-count span { color: var(--arch-ink-faint); font-weight: 500; }
.itsl-arch-dwrap { width: 120px; height: 6px; border-radius: 6px; background: var(--arch-bg); overflow: hidden; }
.itsl-arch-dbar { height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, #1461a5, var(--arch-accent)); }
.itsl-arch-dbar.run { animation: itsl-arch-fill 6s linear forwards; }
.itsl-arch-workspace.paused .itsl-arch-dbar { animation-play-state: paused; }
@keyframes itsl-arch-fill { from { width: 0; } to { width: 100%; } }
.itsl-arch-xbtn { border: none; background: transparent; color: var(--arch-ink-faint); cursor: pointer; font-size: 15px; padding: 3px; }
.itsl-arch-xbtn:hover { color: var(--arch-heat); }

.itsl-arch-cap {
  position: absolute; z-index: 8; width: 300px; background: var(--arch-panel);
  border: 1px solid var(--arch-line); border-radius: 13px;
  box-shadow: 0 22px 48px rgba(16,32,44,.24); padding: 14px 15px;
  opacity: 0; pointer-events: none; transition: opacity .25s ease, left .4s ease, top .4s ease;
}
.itsl-arch-cap.show { opacity: 1; }
.itsl-arch-cap .ck { font-size: 9.5px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; color: var(--arch-ink-faint); }
.itsl-arch-cap .ch { font-size: 15px; font-weight: 800; margin: 2px 0 6px; line-height: 1.25; }
.itsl-arch-cap .cb { font-size: 12.5px; line-height: 1.55; color: var(--arch-ink-soft); }

/* popup modal (3D-style) */
.itsl-arch-scrim {
  position: absolute; inset: 0; background: rgba(16,32,44,.42); display: none;
  align-items: center; justify-content: center; z-index: 40; padding: 16px;
}
.itsl-arch-scrim.on { display: flex; }
.itsl-arch-modal {
  width: 640px; max-width: 96%; max-height: 90%; overflow: auto; background: #fff;
  border-radius: 16px; border: 1px solid var(--arch-line);
  box-shadow: 0 30px 70px rgba(16,32,44,.34);
}
.itsl-arch-modal .mhead {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  border-bottom: 1px solid var(--arch-line); position: sticky; top: 0; background: #fff; z-index: 1;
}
.itsl-arch-modal .mtag {
  font-family: ui-monospace, Menlo, monospace; font-size: 11px; font-weight: 700;
  color: #fff; background: var(--arch-steel); padding: 3px 9px; border-radius: 6px;
}
.itsl-arch-modal .mtitle { font-size: 16px; font-weight: 800; color: var(--arch-ink); min-width: 0; }
.itsl-arch-modal .mx {
  margin-left: auto; border: 0; background: transparent; cursor: pointer;
  color: var(--arch-ink-faint); font-size: 18px; padding: 2px 4px;
}
.itsl-arch-modal .mx:hover { color: var(--arch-heat); }
.itsl-arch-modal .mbody { padding: 16px 18px 20px; }

@media (max-width: 980px) {
  .itsl-arch-main { grid-template-columns: 1fr; }
  .itsl-arch-aside { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .itsl-arch-workspace .flow { animation: none; }
  .itsl-arch-dbar.run { animation: none; width: 100%; }
  .itsl-arch-cap { transition: none; }
}
