.flostlogic-app,
.flostlogic-app * {
  box-sizing: border-box;
}

.flostlogic-app {
  --fl-bg: #06111d;
  --fl-panel: #0a1d2c;
  --fl-panel-2: #0d2435;
  --fl-raised: #132b3b;
  --fl-grid: rgba(43, 104, 136, 0.2);
  --fl-cyan: #19d8f2;
  --fl-cyan-soft: #5da1bc;
  --fl-text: #e5f2f7;
  --fl-muted: #91aeba;
  --fl-green: #29ed70;
  --fl-red: #ff3447;
  --fl-amber: #ffbd24;
  --fl-blue: #05070a;
  position: relative;
  width: 100%;
  height: var(--flostlogic-height, 680px);
  min-height: 580px;
  overflow: hidden;
  border: 2px solid #183e55;
  border-radius: 7px;
  background: var(--fl-bg);
  color: var(--fl-text);
  font-family: "Cascadia Mono", "Lucida Console", "Courier New", monospace;
  font-size: 14px;
  line-height: 1.35;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  isolation: isolate;
}

.flostlogic-app.is-wide {
  width: calc(100vw - 18px);
  width: calc(100dvw - 18px);
  max-width: none;
  margin-right: calc(50% - 50vw + 9px);
  margin-right: calc(50% - 50dvw + 9px);
  margin-left: calc(50% - 50vw + 9px);
  margin-left: calc(50% - 50dvw + 9px);
  border-right: 0;
  border-left: 0;
  border-radius: 0;
}

.flostlogic-app:fullscreen {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  margin: 0;
  border: 0;
  border-radius: 0;
}

.flostlogic-app button,
.flostlogic-app input {
  font: inherit;
}

.flostlogic-topbar {
  display: flex;
  height: 48px;
  align-items: center;
  gap: 18px;
  padding: 5px 12px;
  border-bottom: 1px solid #35566a;
  background: linear-gradient(180deg, #0e2537 0%, #081725 100%);
}

.flostlogic-brand {
  display: flex;
  min-width: 330px;
  align-items: center;
  gap: 12px;
}

.flostlogic-gear {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--fl-cyan);
  border-radius: 4px;
  background: #102c40;
  color: var(--fl-cyan);
  font-size: 20px;
  text-shadow: 0 0 10px rgba(25, 216, 242, 0.75);
}

.flostlogic-brand strong {
  display: block;
  color: #c9effa;
  font-size: 16px;
  letter-spacing: 0.04em;
}

.flostlogic-brand small {
  display: block;
  margin-top: 1px;
  color: var(--fl-muted);
  font-size: 9px;
}

.flostlogic-top-caption {
  margin-left: auto;
  color: #88bad0;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-align: right;
}

.flostlogic-window-button {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border: 1px solid #477083;
  border-radius: 2px;
  background: #0a1d2c;
  color: var(--fl-text);
  cursor: pointer;
}

.flostlogic-window-button:hover {
  border-color: var(--fl-cyan);
  color: var(--fl-cyan);
}

.flostlogic-menubar {
  display: flex;
  height: 34px;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-bottom: 2px solid var(--fl-cyan);
  background: #081824;
}

.flostlogic-menubar button {
  min-height: 26px;
  padding: 3px 10px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: #bcd2dd;
  cursor: pointer;
}

.flostlogic-menubar button:hover,
.flostlogic-menubar button:focus-visible {
  border-color: #355e73;
  background: #10293b;
  color: white;
  outline: 0;
}

.flostlogic-menubar > span {
  flex: 1;
}

.flostlogic-menubar .flostlogic-load-example {
  border-color: #35677c;
  color: var(--fl-cyan);
}

.flostlogic-layout {
  display: grid;
  grid-template-columns: 210px minmax(620px, 1fr) 280px;
  height: calc(var(--flostlogic-height, 680px) - 150px);
  min-height: 0;
}

.flostlogic-app:fullscreen .flostlogic-layout {
  height: calc(100vh - 150px);
}

.flostlogic-library,
.flostlogic-properties {
  min-width: 0;
  overflow: auto;
  background: var(--fl-panel);
  scrollbar-color: #3d6a7c #071621;
  scrollbar-width: thin;
}

.flostlogic-library {
  padding: 8px;
  border-right: 1px solid var(--fl-cyan);
}

.flostlogic-properties {
  padding: 8px;
  border-left: 1px solid var(--fl-cyan);
}

.flostlogic-library h2,
.flostlogic-properties > h2 {
  margin: 0 0 6px;
  padding: 7px 9px;
  border: 1px solid var(--fl-cyan);
  background: #071522;
  color: var(--fl-cyan);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.flostlogic-library > p,
.flostlogic-muted {
  margin: 7px 2px 10px;
  color: var(--fl-muted);
  font-size: 10px;
}

.flostlogic-library-group {
  margin: 10px 2px 5px;
  color: #5c9bb6;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.flostlogic-palette-item {
  display: grid;
  grid-template-columns: 50px 1fr;
  width: 100%;
  min-height: 62px;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  padding: 6px;
  border: 1px solid #315268;
  border-radius: 3px;
  background: linear-gradient(145deg, #122838, #0a1925);
  color: var(--fl-text);
  text-align: left;
  cursor: grab;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.025);
}

.flostlogic-palette-item:hover {
  border-color: var(--fl-cyan);
  background: #153247;
}

.flostlogic-palette-item:active {
  cursor: grabbing;
}

.flostlogic-palette-item strong,
.flostlogic-palette-item small {
  display: block;
}

.flostlogic-palette-item strong {
  font-size: 10px;
}

.flostlogic-palette-item small {
  margin-top: 3px;
  color: var(--fl-muted);
  font-size: 9px;
}

.flostlogic-palette-symbol {
  position: relative;
  display: flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 2px solid #9dabb1;
  border-radius: 3px;
  background: linear-gradient(145deg, #e1e6e4, #7f9199);
  color: #07131b;
  font-weight: 900;
  box-shadow: inset 0 0 0 4px #bec9cb, 2px 3px 0 #243c49;
}

.flostlogic-palette-symbol.is-image {
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.flostlogic-palette-symbol.is-image img {
  display: block;
  width: 46px;
  height: 46px;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
}

.flostlogic-palette-symbol.is-source {
  align-items: stretch;
  gap: 2px;
  padding: 8px 5px;
}

.flostlogic-palette-symbol.is-source i {
  display: grid;
  flex: 1;
  place-items: center;
  color: #06111d;
  font-size: 10px;
  font-style: normal;
}

.flostlogic-palette-symbol.is-source i:nth-child(1) { background: #ff3b4c; }
.flostlogic-palette-symbol.is-source i:nth-child(2) { background: #ffbf27; }
.flostlogic-palette-symbol.is-source i:nth-child(3) { background: #05070a; color: #f1f5f7; }
.flostlogic-palette-symbol.is-source i:nth-child(4) { background: #69c9ff; }

.flostlogic-palette-symbol.is-breaker i,
.flostlogic-palette-symbol.is-contactor i,
.flostlogic-palette-symbol.is-thermal i {
  position: relative;
  display: block;
  width: 12px;
  height: 34px;
  background: #465862;
}

.flostlogic-palette-symbol.is-breaker i::after {
  position: absolute;
  top: 14px;
  right: 0;
  left: 0;
  height: 9px;
  background: #e51f32;
  content: "";
}

.flostlogic-palette-symbol.is-contactor i::after {
  position: absolute;
  top: 8px;
  right: 1px;
  left: 1px;
  height: 20px;
  background: #176fb0;
  content: "";
}

.flostlogic-palette-symbol.is-thermal i::after {
  position: absolute;
  top: 7px;
  right: 2px;
  left: 2px;
  height: 18px;
  border: 2px solid #17a64b;
  content: "";
}

.flostlogic-palette-symbol.is-motor {
  border-radius: 50%;
  background: #1268b7;
  color: white;
  font-size: 21px;
  box-shadow: inset 0 0 0 5px #0b4b89, 8px 0 0 #58798b;
}

.flostlogic-palette-symbol.is-transformer {
  color: #e39e00;
  font-size: 24px;
}

.flostlogic-palette-symbol.is-start,
.flostlogic-palette-symbol.is-stop {
  border-radius: 9px;
}

.flostlogic-palette-symbol.is-start i,
.flostlogic-palette-symbol.is-stop i {
  display: block;
  width: 32px;
  height: 32px;
  border: 4px solid #1b2930;
  border-radius: 50%;
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.22);
}

.flostlogic-palette-symbol.is-start i { background: #22d95e; }
.flostlogic-palette-symbol.is-stop i { background: #f13142; }

.flostlogic-palette-symbol.is-coil {
  color: #075e79;
  font-size: 10px;
  line-height: 1.15;
  text-align: center;
}

.flostlogic-palette-symbol.is-aux {
  color: #096f88;
  font-size: 9px;
}

.flostlogic-palette-symbol.is-lamp i {
  display: block;
  width: 34px;
  height: 34px;
  border: 4px solid #162730;
  border-radius: 50%;
  background: #16733d;
}

.flostlogic-palette-symbol.is-timer,
.flostlogic-palette-symbol.is-plc {
  display: grid;
  place-items: center;
  border: 3px solid #8fa4aa;
  background: linear-gradient(145deg, #cbd5d6, #75878e);
  color: #083445;
  font-size: 11px;
  font-weight: 900;
}

.flostlogic-palette-symbol.is-plc {
  border-color: #2788a6;
  color: #07546b;
}

.flostlogic-workspace {
  position: relative;
  min-width: 0;
  overflow: auto;
  outline: none;
  background: var(--fl-bg);
  scrollbar-color: #3d6a7c #071621;
  scrollbar-width: thin;
}

.flostlogic-workspace.is-drop-target {
  box-shadow: inset 0 0 0 3px var(--fl-cyan);
}

.flostlogic-canvas {
  position: relative;
  width: max(100%, 1120px);
  min-height: max(100%, 520px);
  overflow: hidden;
  background-color: var(--fl-bg);
  background-image:
    linear-gradient(var(--fl-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--fl-grid) 1px, transparent 1px);
  background-size: 20px 20px;
}

.flostlogic-zone-label {
  position: absolute;
  z-index: 0;
  top: 17px;
  color: var(--fl-cyan);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
  pointer-events: none;
}

.flostlogic-zone-label.is-power { left: 24px; }
.flostlogic-zone-label.is-control { left: 355px; }

.flostlogic-zone-divider {
  position: absolute;
  z-index: 0;
  top: 12px;
  bottom: 12px;
  left: 330px;
  border-left: 1px dashed rgba(25, 216, 242, 0.45);
  pointer-events: none;
}

.flostlogic-empty {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: var(--fl-muted);
  text-align: center;
  pointer-events: none;
}

.flostlogic-empty > span {
  display: grid;
  width: 55px;
  height: 55px;
  place-items: center;
  border: 1px dashed var(--fl-cyan);
  border-radius: 50%;
  color: var(--fl-cyan);
  font-size: 30px;
}

.flostlogic-empty.is-hidden {
  display: none;
}

.flostlogic-wires {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.flostlogic-wire {
  fill: none;
  stroke: #71838c;
  stroke-width: 4;
  stroke-linecap: square;
  stroke-linejoin: round;
  pointer-events: stroke;
  cursor: pointer;
  transition: stroke .12s, filter .12s;
}

.flostlogic-wire:hover,
.flostlogic-wire.is-selected {
  stroke: white !important;
  stroke-width: 7;
}

.flostlogic-wire.is-r {
  stroke: #ff3346;
  filter: drop-shadow(0 0 5px rgba(255, 51, 70, .8));
}

.flostlogic-wire.is-s {
  stroke: #ffbd24;
  filter: drop-shadow(0 0 5px rgba(255, 189, 36, .7));
}

.flostlogic-wire.is-t {
  stroke: #05070a;
  stroke-width: 5;
  filter: drop-shadow(0 0 1px rgba(255,255,255,.95)) drop-shadow(0 0 4px rgba(155,178,190,.75));
}

.flostlogic-wire.is-n {
  stroke: #69c9ff;
  filter: drop-shadow(0 0 5px rgba(105, 201, 255, .78));
}

.flostlogic-wire.is-live {
  stroke: #ff375d;
  filter: drop-shadow(0 0 5px rgba(255, 55, 93, .8));
}

.flostlogic-wire.is-zero {
  stroke: #24a6ff;
  filter: drop-shadow(0 0 5px rgba(36, 166, 255, .75));
}

.flostlogic-wire.is-conflict {
  stroke: white;
  animation: flostlogic-wire-fault .35s steps(2) infinite;
}

.flostlogic-component {
  position: absolute;
  z-index: 2;
  width: var(--component-width, 146px);
  height: var(--component-height, 112px);
  color: var(--fl-text);
  user-select: none;
  cursor: grab;
  touch-action: none;
}

.flostlogic-component.is-selected {
  filter: drop-shadow(0 0 5px rgba(255,255,255,.9));
}

.flostlogic-component.is-active {
  filter: drop-shadow(0 0 8px rgba(41,237,112,.55));
}

.flostlogic-component.is-fault {
  border-color: var(--fl-red);
  animation: flostlogic-alert .65s steps(2) infinite;
}

.flostlogic-component-label {
  position: absolute;
  z-index: 6;
  top: -19px;
  left: 50%;
  display: flex;
  max-width: 150px;
  padding: 2px 5px;
  border: 1px solid rgba(73,188,213,.5);
  border-radius: 3px;
  background: rgba(5,18,28,.9);
  color: #bceefa;
  font-size: 7px;
  white-space: nowrap;
  translate: -50% 0;
  pointer-events: none;
}

.flostlogic-component-label strong {
  margin-right: 4px;
  color: white;
}

.flostlogic-component-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.flostlogic-component-name {
  max-width: calc(100% - 4px);
  overflow: hidden;
  color: #d8e9ef;
  font-size: 8px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flostlogic-component-state {
  position: absolute;
  z-index: 6;
  bottom: -15px;
  left: 50%;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(5,18,28,.88);
  color: var(--fl-muted);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .03em;
  text-align: center;
  white-space: nowrap;
  translate: -50% 0;
  pointer-events: none;
}

.flostlogic-device-image {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.flostlogic-device-image.is-motor {
  width: 100%;
  height: 100%;
}

.flostlogic-device-image.is-button-image {
  width: 100%;
  height: 100%;
}

.flostlogic-device-image.is-button-image.is-pressed img {
  translate: 0 2px;
  filter: brightness(.82);
}

.flostlogic-button-hit {
  position: absolute;
  z-index: 2;
  inset: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.flostlogic-device-image img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
  user-select: none;
}

.flostlogic-component.is-active .flostlogic-device-image:not(.is-motor) img {
  filter: drop-shadow(0 0 4px rgba(41, 237, 112, .65));
}

.flostlogic-component.is-active .flostlogic-component-state {
  color: var(--fl-green);
}

.flostlogic-component.is-fault .flostlogic-component-state {
  color: #ff8d96;
}

.flostlogic-device-symbol {
  position: relative;
  display: flex;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 4px solid #a9b7bb;
  border-radius: 3px;
  background: linear-gradient(145deg, #d7dddc, #87979d);
  color: #07131b;
  box-shadow: inset 0 0 0 3px #c2cccd;
}

.flostlogic-device-symbol.is-source {
  align-items: stretch;
  gap: 2px;
  padding: 5px;
}

.flostlogic-device-symbol.is-source b {
  display: grid;
  flex: 1;
  place-items: center;
  font-size: 9px;
}

.flostlogic-device-symbol.is-source b:nth-child(1) { background: #ff3346; }
.flostlogic-device-symbol.is-source b:nth-child(2) { background: #ffbd24; }
.flostlogic-device-symbol.is-source b:nth-child(3) { background: #05070a; color: #f1f5f7; }
.flostlogic-device-symbol.is-source b:nth-child(4) { background: #69c9ff; }

.flostlogic-device-symbol.is-breaker,
.flostlogic-device-symbol.is-contactor,
.flostlogic-device-symbol.is-thermal {
  gap: 5px;
}

.flostlogic-device-symbol .flostlogic-pole {
  position: relative;
  width: 15px;
  height: 34px;
  background: #42535b;
}

.flostlogic-device-symbol.is-breaker .flostlogic-pole::after {
  position: absolute;
  top: 13px;
  right: 0;
  left: 0;
  height: 8px;
  background: #d92739;
  content: "";
}

.flostlogic-device-symbol.is-breaker.is-closed .flostlogic-pole::after {
  top: 8px;
  background: #24df69;
}

.flostlogic-device-symbol.is-contactor .flostlogic-pole::after {
  position: absolute;
  top: 7px;
  right: 2px;
  left: 2px;
  height: 20px;
  background: #1d72ad;
  content: "";
}

.flostlogic-component.is-active .flostlogic-device-symbol.is-contactor .flostlogic-pole::after {
  background: #20c9e8;
}

.flostlogic-device-symbol.is-thermal .flostlogic-pole::after {
  position: absolute;
  top: 6px;
  right: 2px;
  left: 2px;
  height: 21px;
  border: 2px solid #179647;
  content: "";
}

.flostlogic-device-symbol.is-thermal.is-tripped .flostlogic-pole::after {
  border-color: var(--fl-red);
  background: rgba(255,52,71,.35);
}

.flostlogic-device-symbol.is-transformer {
  gap: 2px;
  color: #e39c00;
  font-size: 24px;
}

.flostlogic-device-symbol.is-transformer::before,
.flostlogic-device-symbol.is-transformer::after {
  content: "∿∿";
}

.flostlogic-device-symbol.is-motor {
  width: 72px;
  height: 57px;
  overflow: visible;
  border-color: #0d589d;
  border-radius: 44% 42% 42% 44%;
  background: repeating-linear-gradient(90deg, #0f5ba6 0 5px, #1680d0 5px 8px);
  color: white;
  box-shadow: inset 0 0 0 5px rgba(0,36,80,.45), 12px 0 0 #4c7184;
}

.flostlogic-motor-rotor {
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  border: 2px solid #c3d7df;
  border-radius: 50%;
  background: #062544;
  font-size: 13px;
}

.flostlogic-motor-arrow {
  position: absolute;
  top: 7px;
  left: 37px;
  color: var(--fl-amber);
  font-size: 23px;
  transform-origin: 10px 20px;
  opacity: .25;
}

.flostlogic-component.is-running .flostlogic-motor-arrow {
  opacity: 1;
  animation: flostlogic-spin .75s linear infinite;
}

.flostlogic-component.is-reverse .flostlogic-motor-arrow {
  animation-direction: reverse;
}

.flostlogic-device-symbol.is-button {
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  border-radius: 6px;
}

.flostlogic-device-symbol.is-button button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 4px solid #1b2a31;
  border-radius: 50%;
  background: var(--button-color);
  box-shadow: inset 0 -6px 0 rgba(0,0,0,.22), 0 2px 0 #576b73;
  cursor: pointer;
}

.flostlogic-device-symbol.is-button button:active,
.flostlogic-device-symbol.is-button button.is-pressed {
  translate: 0 3px;
  box-shadow: inset 0 2px 0 rgba(0,0,0,.35);
}

.flostlogic-device-symbol.is-button.is-start { --button-color: #25df67; }
.flostlogic-device-symbol.is-button.is-stop { --button-color: #f23748; }

.flostlogic-device-symbol.is-coil {
  width: 100%;
  height: 100%;
  border-color: #93a5aa;
  background: #c9d3d3;
  color: #09485c;
  font-size: 11px;
}

.flostlogic-component.is-active .flostlogic-device-symbol.is-coil {
  border-color: #23ed74;
  background: #adf2c2;
  box-shadow: inset 0 0 0 3px #d9f9e1, 0 0 14px rgba(41,237,112,.55);
}

.flostlogic-device-symbol.is-contact {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.flostlogic-device-symbol.is-contact::before,
.flostlogic-device-symbol.is-contact::after {
  position: absolute;
  top: 20px;
  width: 27px;
  height: 3px;
  background: #c6d8df;
  content: "";
}

.flostlogic-device-symbol.is-contact::before { left: 5px; }
.flostlogic-device-symbol.is-contact::after { right: 5px; }

.flostlogic-contact-blade {
  position: absolute;
  top: 10px;
  left: 31px;
  width: 36px;
  height: 3px;
  background: #f0f8fa;
  rotate: -20deg;
  transform-origin: left center;
  transition: rotate .12s;
}

.flostlogic-component.is-active .flostlogic-contact-blade,
.flostlogic-device-symbol.is-contact.is-nc .flostlogic-contact-blade {
  rotate: 0deg;
}

.flostlogic-device-symbol.is-contact.is-nc.is-open .flostlogic-contact-blade {
  rotate: -20deg;
}

.flostlogic-device-symbol.is-lamp {
  width: 100%;
  height: 100%;
}

.flostlogic-device-symbol.is-timer {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: 1fr 1fr;
  gap: 2px 5px;
  padding: 9px 10px;
  border-color: #2a89aa;
  background: linear-gradient(145deg, #d6dfe1, #7d9299);
}

.flostlogic-device-symbol.is-timer b { font-size: 13px; }
.flostlogic-device-symbol.is-timer span {
  padding: 3px 5px;
  background: #09202c;
  color: #62f1ff;
  font: 800 10px monospace;
}
.flostlogic-timer-led {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #31503c;
}
.flostlogic-timer-led.is-on,
.flostlogic-device-symbol.is-timer.is-done .flostlogic-timer-led {
  background: var(--fl-green);
  box-shadow: 0 0 7px var(--fl-green);
}

.flostlogic-device-symbol.is-plc {
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-rows: auto auto 1fr 1fr;
  align-content: stretch;
  gap: 5px;
  padding: 14px 12px 13px;
  border-color: #177fa0;
  background: linear-gradient(145deg, #aebbc0, #62747b);
}
.flostlogic-device-symbol.is-plc strong { font-size: 12px; letter-spacing: .08em; }
.flostlogic-device-symbol.is-plc small { font-size: 8px; color: #153440; }
.flostlogic-plc-leds { display: flex; align-items: center; justify-content: space-between; }
.flostlogic-plc-leds i {
  width: 9px;
  height: 9px;
  border: 1px solid #26383e;
  border-radius: 50%;
  background: #3c4c50;
}
.flostlogic-plc-leds i.is-on {
  background: var(--fl-green);
  box-shadow: 0 0 6px var(--fl-green);
}
.flostlogic-device-symbol.is-plc.is-powered { border-color: var(--fl-green); }

.flostlogic-device-config {
  position: absolute;
  right: 3px;
  bottom: 3px;
  min-width: 21px;
  height: 18px;
  padding: 1px 3px;
  border: 1px solid #174f63;
  border-radius: 2px;
  background: #071d28;
  color: #6eeeff;
  font-size: 7px;
  font-weight: 900;
  cursor: pointer;
}

.flostlogic-lamp-bulb {
  width: 37px;
  height: 37px;
  border: 4px solid #26373e;
  border-radius: 50%;
  background: #135f35;
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.22);
}

.flostlogic-component.is-active .flostlogic-lamp-bulb {
  background: var(--fl-green);
  box-shadow: 0 0 18px rgba(41,237,112,.8), inset 0 -5px 0 rgba(0,0,0,.13);
}

.flostlogic-device-toggle {
  position: absolute;
  z-index: 7;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 6px;
  padding: 0;
  border: 1px solid #ff7580;
  border-radius: 2px;
  background: #d91f35;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 0 4px rgba(217,31,53,.55);
  cursor: pointer;
  translate: -50% -50%;
}

.flostlogic-device-toggle::before {
  position: absolute;
  inset: -10px;
  content: "";
}

.flostlogic-device-toggle.is-closed {
  border-color: #7dffad;
  background: #1bd75f;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22), 0 0 5px rgba(27,215,95,.65);
}

.flostlogic-port {
  position: absolute;
  z-index: 4;
  display: block;
  top: var(--port-y);
  left: var(--port-x);
  width: 9px;
  height: 9px;
  padding: 0;
  border: 1px solid var(--fl-cyan);
  border-radius: 50%;
  background: #06111d;
  color: white;
  cursor: crosshair;
  translate: -50% -50%;
}

.flostlogic-port::before {
  position: absolute;
  inset: -9px;
  content: "";
}

.flostlogic-port::after {
  position: absolute;
  z-index: 5;
  color: #d9edf3;
  content: attr(data-label);
  font-size: 7px;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}

.flostlogic-port.side-top::after {
  top: 11px;
  left: 50%;
  translate: -50% 0;
}

.flostlogic-port.side-bottom::after {
  right: 50%;
  bottom: 11px;
  translate: 50% 0;
}

.flostlogic-port.side-left::after {
  top: 50%;
  left: 11px;
  translate: 0 -50%;
}

.flostlogic-port.side-right::after {
  top: 50%;
  right: 11px;
  translate: 0 -50%;
}

.flostlogic-port.is-pending {
  border-color: var(--fl-amber);
  background: var(--fl-amber);
  box-shadow: 0 0 12px var(--fl-amber);
}

.flostlogic-port.is-r { border-color: var(--fl-red); }
.flostlogic-port.is-s { border-color: var(--fl-amber); }
.flostlogic-port.is-t {
  border-color: #05070a;
  background: #05070a;
  box-shadow: 0 0 0 1px #8ea0a9, 0 0 4px rgba(205,220,226,.7);
}
.flostlogic-port.is-n { border-color: #69c9ff; background: #174b67; }
.flostlogic-port.is-live { border-color: #ff375d; background: #7f1027; }
.flostlogic-port.is-zero { border-color: #24a6ff; background: #0b4771; }

.flostlogic-properties [data-role="properties-content"] {
  min-height: 220px;
}

.flostlogic-property-hero {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: center;
  gap: 11px;
  padding: 9px 2px 14px;
  border-bottom: 1px solid #315064;
}

.flostlogic-property-hero .flostlogic-device-symbol {
  width: 78px;
  height: 62px;
  transform: scale(.76);
  transform-origin: center;
}

.flostlogic-property-hero .flostlogic-device-image {
  width: 78px;
  height: 62px;
  transform: scale(.76);
  transform-origin: center;
}

.flostlogic-property-hero strong {
  display: block;
  color: #e8f7fb;
  font-size: 21px;
}

.flostlogic-property-hero small {
  color: #b9d1dc;
  font-size: 10px;
}

.flostlogic-properties dl {
  display: grid;
  grid-template-columns: minmax(90px, .8fr) minmax(120px, 1.2fr);
  gap: 9px;
  margin: 14px 0 0;
  font-size: 10px;
}

.flostlogic-properties dt {
  color: var(--fl-muted);
}

.flostlogic-properties dd {
  margin: 0;
  color: var(--fl-text);
  overflow-wrap: anywhere;
}

.flostlogic-tag-input {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid #426779;
  border-radius: 2px;
  background: #071623;
  color: white;
}

.flostlogic-terminal-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 11px;
}

.flostlogic-terminal-list span {
  padding: 3px 5px;
  border: 1px solid #3c6375;
  border-radius: 2px;
  color: #c9e0e9;
  font-size: 8px;
}

.flostlogic-settings {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #294e60;
  background: rgba(4,19,29,.68);
}

.flostlogic-settings label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #c8dbe3;
  font-size: 9px;
}

.flostlogic-settings input,
.flostlogic-settings select {
  min-width: 64px;
  padding: 4px;
  border: 1px solid #3e778e;
  background: #071722;
  color: white;
  font-size: 10px;
}

.flostlogic-settings small {
  color: var(--fl-muted);
  font-size: 8px;
  line-height: 1.35;
}

.flostlogic-link-note {
  margin: 13px 0 0;
  padding: 8px;
  border-left: 3px solid var(--fl-green);
  background: rgba(41,237,112,.07);
  color: #74ee9b;
  font-size: 9px;
}

.flostlogic-side-section {
  margin-top: 16px;
  padding-top: 11px;
  border-top: 1px solid #28485c;
}

.flostlogic-side-section h3 {
  margin: 0 0 8px;
  color: var(--fl-cyan);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.flostlogic-fault-button {
  width: 100%;
  min-height: 31px;
  margin: 0 0 6px;
  padding: 5px 8px;
  border: 1px solid #4b6572;
  border-radius: 2px;
  background: #0b1a25;
  color: #a9bec8;
  font-size: 9px;
  text-align: left;
  cursor: pointer;
}

.flostlogic-fault-button.is-active {
  border-color: var(--fl-red);
  background: rgba(255,52,71,.15);
  color: #ff9ba4;
}

.flostlogic-events {
  max-height: 104px;
  overflow: hidden;
  margin: 0;
  padding: 0 0 0 18px;
  color: #aac2cc;
  font-size: 8px;
}

.flostlogic-events li {
  margin-bottom: 3px;
}

.flostlogic-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
}

.flostlogic-legend h3 {
  grid-column: 1 / -1;
}

.flostlogic-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #b7cbd3;
  font-size: 8px;
}

.flostlogic-legend i {
  width: 23px;
  height: 3px;
  background: #71838c;
}

.flostlogic-legend i.is-r { background: var(--fl-red); }
.flostlogic-legend i.is-s { background: var(--fl-amber); }
.flostlogic-legend i.is-t {
  background: #05070a;
  box-shadow: 0 0 0 1px #74858e;
}
.flostlogic-legend i.is-n { background: #69c9ff; }
.flostlogic-legend i.is-live { background: #ff375d; }
.flostlogic-legend i.is-zero { background: #24a6ff; }

.flostlogic-footer {
  display: flex;
  height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 12px;
  border-top: 2px solid var(--fl-cyan);
  background: linear-gradient(180deg, #0a1b29, #07141f);
}

.flostlogic-status {
  display: flex;
  min-width: 300px;
  align-items: center;
  gap: 12px;
}

.flostlogic-status-dot {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 50%;
  background: var(--fl-muted);
  box-shadow: 0 0 12px currentColor;
}

.flostlogic-status strong,
.flostlogic-status small {
  display: block;
}

.flostlogic-status strong {
  color: var(--fl-green);
  font-size: 11px;
}

.flostlogic-status small {
  margin-top: 3px;
  color: #b1c5ce;
  font-size: 9px;
}

.flostlogic-status[data-tone="warning"] .flostlogic-status-dot { background: var(--fl-amber); }
.flostlogic-status[data-tone="warning"] strong { color: var(--fl-amber); }
.flostlogic-status[data-tone="danger"] .flostlogic-status-dot { background: var(--fl-red); }
.flostlogic-status[data-tone="danger"] strong { color: var(--fl-red); }
.flostlogic-status[data-tone="success"] .flostlogic-status-dot { background: var(--fl-green); }

.flostlogic-footer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.flostlogic-btn {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--fl-cyan);
  border-radius: 2px;
  background: #071724;
  color: var(--fl-cyan);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.flostlogic-btn:hover,
.flostlogic-btn:focus-visible {
  background: #123047;
  outline: 2px solid rgba(25,216,242,.22);
}

.flostlogic-btn:disabled {
  cursor: not-allowed;
  opacity: .32;
}

.flostlogic-btn-run {
  min-width: 120px;
  border-color: var(--fl-green);
  color: var(--fl-green);
}

.flostlogic-btn-run.is-active {
  background: var(--fl-green);
  color: #031009;
}

.flostlogic-btn-danger {
  border-color: var(--fl-red);
  color: var(--fl-red);
}

.flostlogic-help[hidden] {
  display: none;
}

.flostlogic-help {
  position: absolute;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(1,8,13,.82);
}

.flostlogic-help > div {
  position: relative;
  width: min(560px, 100%);
  padding: 24px;
  border: 1px solid var(--fl-cyan);
  background: #0b2030;
  box-shadow: 0 22px 70px black;
}

.flostlogic-help h2 {
  margin: 0 0 16px;
  color: var(--fl-cyan);
  font-size: 17px;
}

.flostlogic-help li,
.flostlogic-help p {
  margin-bottom: 9px;
  color: #c5dbe4;
  font-size: 11px;
}

.flostlogic-help > div > button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border: 1px solid var(--fl-red);
  background: #1c1016;
  color: var(--fl-red);
  cursor: pointer;
}

@keyframes flostlogic-spin {
  to { rotate: 360deg; }
}

@keyframes flostlogic-alert {
  50% { filter: brightness(1.75); }
}

@keyframes flostlogic-wire-fault {
  50% { stroke: var(--fl-red); }
}

@media (max-width: 1280px) {
  .flostlogic-layout {
    grid-template-columns: 195px minmax(600px, 1fr) 260px;
  }
  .flostlogic-palette-item {
    grid-template-columns: 46px 1fr;
  }
  .flostlogic-palette-symbol {
    scale: .84;
    transform-origin: center;
  }
  .flostlogic-top-caption {
    display: none;
  }
}

@media (max-width: 900px) {
  .flostlogic-app.is-wide {
    width: 100%;
    margin-right: 0;
    margin-left: 0;
  }
  .flostlogic-layout {
    grid-template-columns: 190px minmax(620px, 1fr);
  }
  .flostlogic-properties {
    display: none;
  }
  .flostlogic-brand {
    min-width: 0;
  }
  .flostlogic-menubar button:not(.flostlogic-load-example) {
    padding-right: 6px;
    padding-left: 6px;
    font-size: 10px;
  }
  .flostlogic-footer {
    height: auto;
    min-height: 64px;
    align-items: stretch;
    flex-direction: column;
  }
  .flostlogic-status {
    min-width: 0;
  }
  .flostlogic-footer-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 600px) {
  .flostlogic-topbar { height: 44px; padding: 4px 7px; }
  .flostlogic-brand { min-width: 0; gap: 7px; }
  .flostlogic-brand strong { font-size: 12px; }
  .flostlogic-brand small { font-size: 7px; }
  .flostlogic-gear { width: 28px; height: 28px; }
  .flostlogic-menubar { overflow-x: auto; padding: 2px 5px; }
  .flostlogic-menubar > span { display: none; }
  .flostlogic-menubar button { flex: 0 0 auto; }
  .flostlogic-layout { grid-template-columns: 118px minmax(760px, 1fr); }
  .flostlogic-library { padding: 4px; }
  .flostlogic-library h2 { padding: 5px; font-size: 10px; }
  .flostlogic-library > p { display: none; }
  .flostlogic-palette-item {
    grid-template-columns: 34px 1fr;
    min-height: 48px;
    gap: 4px;
    padding: 3px;
  }
  .flostlogic-palette-symbol { scale: .66; }
  .flostlogic-palette-item strong { font-size: 8px; }
  .flostlogic-palette-item small { font-size: 7px; }
}
