.lbx-page {
  color: var(--text);
  padding: 34px 0 52px;
}

.lbx-app {
  display: grid;
  gap: 16px;
}

.lbx-command {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.7fr);
  gap: 16px;
  align-items: stretch;
}

.lbx-heading,
.lbx-current-panel,
.lbx-panel,
.lbx-stage {
  border: 1px solid var(--line);
  background: rgba(15, 21, 35, 0.76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.lbx-heading {
  border-radius: 26px;
  padding: 22px 24px;
  min-height: 142px;
  display: grid;
  align-content: center;
}

.lbx-heading h1 {
  margin: 0;
  font-size: clamp(31px, 4.2vw, 54px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.lbx-heading p {
  margin: 12px 0 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 15px;
}

.lbx-heading .crumb {
  margin-bottom: 12px;
}

.lbx-target-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.lbx-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(103, 232, 249, 0.22);
  border-radius: 999px;
  color: #c9f3ff;
  background: rgba(103, 232, 249, 0.07);
  font-size: 12px;
  font-weight: 900;
}

.lbx-chip.warn {
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.09);
}

.lbx-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.12);
  flex: 0 0 auto;
}

.lbx-dot.ok {
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.lbx-dot.warn {
  background: var(--warm);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
}

.lbx-current-panel {
  border-radius: 26px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px 160px;
  gap: 16px;
  align-items: center;
}

.lbx-current-panel > i {
  width: 1px;
  height: 58px;
  background: var(--line);
}

.lbx-current-panel span,
.lbx-info-row span,
.lbx-axis-card span,
.lbx-log small,
.lbx-support-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lbx-current-panel b {
  display: block;
  margin-top: 5px;
  color: #f7fbff;
  font-size: 19px;
  line-height: 1.22;
}

.lbx-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.lbx-stage {
  min-width: 0;
  min-height: 620px;
  border-radius: 26px;
  padding: 14px;
  overflow: auto;
  background:
    radial-gradient(circle at 18% 18%, rgba(6, 182, 212, 0.18), transparent 34%),
    radial-gradient(circle at 82% 78%, rgba(124, 58, 237, 0.24), transparent 38%),
    rgba(7, 10, 17, 0.92);
}

.lbx-stage::-webkit-scrollbar,
.lbx-log::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.lbx-stage::-webkit-scrollbar-thumb,
.lbx-log::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.lbx-scale-host {
  position: relative;
  margin: 0 auto;
}

.lbx-controller {
  position: absolute;
  inset: 0 auto auto 0;
  width: 1325px;
  height: 1025px;
  transform-origin: 0 0;
  overflow: visible;
}

.lbx-controller * {
  box-sizing: border-box;
}

.lbx-layer,
.lbx-base,
.lbx-control,
.lbx-fill,
.lbx-shape,
.lbx-state-image,
.lbx-text {
  position: absolute;
}

.lbx-base {
  inset: 0;
  z-index: 5;
  width: 1325px;
  height: 1025px;
  pointer-events: none;
  opacity: 0.82;
  filter: invert(1) brightness(1.28) drop-shadow(0 0 18px rgba(103, 232, 249, 0.18));
}

.lbx-fill-layer {
  z-index: 2;
  inset: 0;
}

.lbx-state-layer {
  z-index: 8;
  inset: 0;
}

.lbx-fill {
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0%;
  border-radius: inherit;
  background: linear-gradient(180deg, #67e8f9, #0ea5e9);
  box-shadow: 0 0 18px rgba(6, 182, 212, 0.36);
  transition: background 120ms ease;
  will-change: height;
}

.lbx-fill.passed {
  background: linear-gradient(180deg, #86efac, #22c55e);
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.32);
}

.lbx-analog-track {
  position: absolute;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(103, 232, 249, 0.08);
  pointer-events: none;
}

.lbx-shape,
.lbx-hit {
  border: 1px solid rgba(186, 230, 253, 0.72);
  background: rgba(6, 182, 212, 0.66);
  opacity: 0.94;
  transition: background 120ms ease, transform 120ms ease, box-shadow 120ms ease;
  pointer-events: none;
}

.lbx-shape.passed {
  background: rgba(34, 197, 94, 0.78);
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.24);
}

.lbx-shape.pressed {
  background: rgba(251, 113, 133, 0.86);
  transform: scale(0.94);
  box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.18), 0 0 20px rgba(251, 113, 133, 0.25);
}

.lbx-ellipse {
  border-radius: 50%;
}

.lbx-rounded {
  border-radius: 9px;
}

.lbx-state-image {
  pointer-events: none;
  transition: transform 120ms ease, filter 120ms ease;
  filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.18));
}

.lbx-state-image.pressed {
  transform: scale(0.94);
  filter: drop-shadow(0 0 10px rgba(251, 113, 133, 0.42));
}

.lbx-text {
  z-index: 12;
  color: #dff8ff;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 800;
  white-space: pre-line;
  pointer-events: none;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
}

.lbx-text.small {
  font-size: 13px;
}

.lbx-pass-text {
  color: #86efac;
  font-size: 15px;
  font-weight: 900;
  opacity: 0;
  transition: opacity 160ms ease;
}

.lbx-pass-text.visible {
  opacity: 1;
}

.lbx-stick-pad {
  position: absolute;
  left: 286px;
  top: 350px;
  width: 194px;
  height: 194px;
  z-index: 7;
  pointer-events: none;
}

.lbx-stick-pass {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: transparent;
  transition: background 160ms ease;
}

.lbx-stick-pass.passed {
  background: rgba(34, 197, 94, 0.22);
  box-shadow: inset 0 0 0 2px rgba(134, 239, 172, 0.42);
}

.lbx-stick-marker {
  position: absolute;
  left: 43px;
  top: 43px;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 1px solid rgba(186, 230, 253, 0.78);
  background: rgba(6, 182, 212, 0.66);
  transition: transform 90ms linear, background 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 0 18px rgba(6, 182, 212, 0.16);
}

.lbx-stick-marker.pressed {
  background: rgba(251, 113, 133, 0.86);
}

.lbx-side {
  display: grid;
  gap: 14px;
  align-content: start;
}

.lbx-panel {
  border-radius: 24px;
  padding: 16px;
}

.lbx-panel h2,
.lbx-panel h3 {
  margin: 0 0 12px;
  color: #f8fbff;
  line-height: 1.2;
  letter-spacing: 0;
}

.lbx-panel h2 {
  font-size: 22px;
}

.lbx-panel h3 {
  font-size: 16px;
}

.lbx-info-grid {
  display: grid;
  gap: 10px;
}

.lbx-info-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 26px;
}

.lbx-info-row b {
  color: #f7fbff;
  font-size: 17px;
  word-break: break-word;
}

.lbx-connection {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lbx-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.lbx-actions button,
.lbx-select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  outline: none;
}

.lbx-actions button:hover,
.lbx-select:hover {
  border-color: rgba(103, 232, 249, 0.38);
  background: rgba(255, 255, 255, 0.09);
}

.lbx-actions button.primary {
  border-color: rgba(103, 232, 249, 0.38);
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 14px 34px rgba(6, 182, 212, 0.18);
}

.lbx-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  box-shadow: none;
}

.lbx-select {
  width: 100%;
  padding: 0 10px;
}

.lbx-select option {
  background: #0f1523;
  color: var(--text);
}

.lbx-support-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.lbx-support-grid b {
  display: block;
  margin-top: 4px;
  color: #f7fbff;
  font-size: 12px;
}

.lbx-support-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  padding: 9px 10px;
}

.lbx-bridge-install {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(245, 158, 11, 0.34);
  border-radius: 14px;
  background: rgba(245, 158, 11, 0.09);
}

.lbx-bridge-install[hidden] {
  display: none;
}

.lbx-bridge-install b {
  color: #fde68a;
  font-size: 13px;
}

.lbx-bridge-install span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.lbx-bridge-install a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid rgba(103, 232, 249, 0.38);
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  font-size: 12px;
  font-weight: 900;
}

.lbx-axis-list {
  display: grid;
  gap: 8px;
}

.lbx-axis-card {
  display: grid;
  grid-template-columns: 82px 1fr 48px;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.lbx-axis-card b {
  color: #f7fbff;
  font-size: 12px;
  text-align: right;
}

.lbx-axis-card .bar {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.09);
}

.lbx-axis-card .bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand2), #67e8f9);
  border-radius: inherit;
  transition: background 120ms ease;
  will-change: width;
}

.lbx-axis-card.passed .bar i {
  background: linear-gradient(90deg, #22c55e, #86efac);
}

.lbx-log {
  max-height: 218px;
  overflow: auto;
  display: grid;
  gap: 7px;
  padding-right: 4px;
}

.lbx-log div {
  padding: 8px 10px;
  border-left: 3px solid rgba(103, 232, 249, 0.42);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.35;
}

.lbx-hardware-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1180px) {
  .lbx-command,
  .lbx-layout {
    grid-template-columns: 1fr;
  }

  .lbx-current-panel {
    grid-template-columns: minmax(0, 1fr) 1px 160px;
  }

  .lbx-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .lbx-page {
    padding-top: 18px;
  }

  .lbx-heading,
  .lbx-current-panel,
  .lbx-panel,
  .lbx-stage {
    border-radius: 20px;
  }

  .lbx-current-panel {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .lbx-current-panel > i {
    width: 100%;
    height: 1px;
  }

  .lbx-stage {
    min-height: 430px;
    padding: 10px;
  }

  .lbx-side {
    grid-template-columns: 1fr;
  }

  .lbx-actions,
  .lbx-support-grid {
    grid-template-columns: 1fr;
  }
}
