.lp-studio-active {
  --lp-studio-bg: #0d0f11;
  --lp-studio-panel: #15181c;
  --lp-studio-panel-2: #1d2227;
  --lp-studio-border: rgba(255, 255, 255, 0.14);
  --lp-studio-border-strong: rgba(255, 255, 255, 0.22);
  --lp-studio-muted: rgba(255, 255, 255, 0.58);
  --lp-studio-text: #f7f8f2;
  --lp-studio-accent: #1fd6ce;
  --lp-studio-accent-2: #9cff4c;
  --lp-studio-danger: #ff675c;
}

.lp-studio-active,
.lp-studio-active * {
  --lp-studio-font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.lp-studio-toolbar,
.lp-studio-layers,
.lp-studio-panel,
.lp-studio-frame,
.lp-studio-frame * {
  box-sizing: border-box;
  font-family: var(--lp-studio-font);
  letter-spacing: 0;
}

.lp-studio-toolbar {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(720px, calc(100vw - 32px));
  min-height: 46px;
  padding: 6px;
  color: var(--lp-studio-text);
  background: color-mix(in srgb, var(--lp-studio-bg) 92%, transparent);
  border: 1px solid var(--lp-studio-border);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.lp-studio-toolbar__brand,
.lp-studio-panel__title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.lp-studio-toolbar__brand strong,
.lp-studio-panel__title strong {
  color: var(--lp-studio-text);
  font-size: 13px;
  font-weight: 760;
}

.lp-studio-toolbar__brand span,
.lp-studio-panel__title span,
.lp-studio-panel__status,
.lp-studio-field label {
  color: var(--lp-studio-muted);
}

.lp-studio-toolbar__tools {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lp-studio-toolbar button,
.lp-studio-panel button,
.lp-studio-layers button {
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--lp-studio-text);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.lp-studio-toolbar button {
  padding: 0 10px;
}

.lp-studio-toolbar button:hover,
.lp-studio-toolbar button:focus-visible,
.lp-studio-toolbar button.is-active,
.lp-studio-panel button:hover,
.lp-studio-panel button:focus-visible,
.lp-studio-layers button:hover,
.lp-studio-layers button:focus-visible {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--lp-studio-border);
  outline: 0;
}

.lp-studio-toolbar button.is-active {
  color: #061311;
  background: var(--lp-studio-accent);
  border-color: var(--lp-studio-accent);
}

.lp-studio-layers,
.lp-studio-panel {
  position: fixed;
  z-index: 2147483000;
  width: min(300px, calc(100vw - 32px));
  max-height: calc(100vh - 86px);
  overflow: auto;
  padding: 14px;
  color: var(--lp-studio-text);
  background: color-mix(in srgb, var(--lp-studio-panel) 94%, transparent);
  border: 1px solid var(--lp-studio-border);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}

.lp-studio-layers {
  top: 74px;
  left: 16px;
}

.lp-studio-panel {
  top: 74px;
  right: 16px;
}

.lp-studio-layers__list {
  display: grid;
  gap: 5px;
  margin-top: 12px;
}

.lp-studio-layers button {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 9px;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 8px 9px;
  text-align: left;
}

.lp-studio-layers button span {
  color: var(--lp-studio-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  text-transform: uppercase;
}

.lp-studio-layers button strong {
  overflow: hidden;
  color: var(--lp-studio-text);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lp-studio-layers button.is-selected {
  background: rgba(31, 214, 206, 0.16);
  border-color: rgba(31, 214, 206, 0.52);
}

.lp-studio-panel__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.lp-studio-field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.lp-studio-field label {
  font-size: 10px;
  font-weight: 760;
  text-transform: uppercase;
}

.lp-studio-panel input,
.lp-studio-panel select,
.lp-studio-panel textarea {
  width: 100%;
  border: 1px solid var(--lp-studio-border);
  border-radius: 6px;
  outline: none;
  color: var(--lp-studio-text);
  background: rgba(255, 255, 255, 0.065);
  font: inherit;
  font-size: 12px;
}

.lp-studio-panel input,
.lp-studio-panel select {
  height: 32px;
  padding: 0 9px;
}

.lp-studio-panel textarea {
  min-height: 96px;
  padding: 9px;
  resize: vertical;
  line-height: 1.4;
}

.lp-studio-panel input:focus,
.lp-studio-panel select:focus,
.lp-studio-panel textarea:focus {
  border-color: var(--lp-studio-accent);
  box-shadow: 0 0 0 3px rgba(31, 214, 206, 0.16);
}

.lp-studio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.lp-studio-nudge {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 12px;
}

.lp-studio-nudge button,
.lp-studio-actions button {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--lp-studio-border);
  padding: 7px 8px;
}

.lp-studio-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.lp-studio-panel__status {
  min-height: 18px;
  margin-top: 10px;
  font-size: 11px;
}

.lp-studio-target {
  cursor: pointer;
}

.lp-studio-selected {
  outline: 0 !important;
}

.lp-studio-frame {
  position: fixed;
  z-index: 2147482999;
  border: 1.5px solid var(--lp-studio-accent);
  border-radius: 4px;
  box-shadow:
    0 0 0 1px rgba(31, 214, 206, 0.18),
    0 0 0 9999px rgba(0, 0, 0, 0.025);
  pointer-events: auto;
}

.lp-studio-frame__surface {
  position: absolute;
  inset: 0;
  cursor: move;
}

.lp-studio-frame__label {
  position: absolute;
  left: -1px;
  top: -28px;
  max-width: min(280px, calc(100vw - 32px));
  overflow: hidden;
  padding: 5px 7px;
  color: #041211;
  background: var(--lp-studio-accent);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 760;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lp-studio-frame [data-lp-studio-handle] {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 1.5px solid #041211;
  border-radius: 999px;
  background: var(--lp-studio-accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

.lp-studio-frame [data-lp-studio-handle="nw"] {
  left: -6px;
  top: -6px;
  cursor: nwse-resize;
}

.lp-studio-frame [data-lp-studio-handle="n"] {
  left: calc(50% - 5px);
  top: -6px;
  cursor: ns-resize;
}

.lp-studio-frame [data-lp-studio-handle="ne"] {
  right: -6px;
  top: -6px;
  cursor: nesw-resize;
}

.lp-studio-frame [data-lp-studio-handle="e"] {
  right: -6px;
  top: calc(50% - 5px);
  cursor: ew-resize;
}

.lp-studio-frame [data-lp-studio-handle="se"] {
  right: -6px;
  bottom: -6px;
  cursor: nwse-resize;
}

.lp-studio-frame [data-lp-studio-handle="s"] {
  left: calc(50% - 5px);
  bottom: -6px;
  cursor: ns-resize;
}

.lp-studio-frame [data-lp-studio-handle="sw"] {
  left: -6px;
  bottom: -6px;
  cursor: nesw-resize;
}

.lp-studio-frame [data-lp-studio-handle="w"] {
  left: -6px;
  top: calc(50% - 5px);
  cursor: ew-resize;
}

.lp-studio-dragging .lp-studio-frame__surface {
  cursor: grabbing;
}

@media (max-width: 860px) {
  .lp-studio-toolbar {
    left: 10px;
    right: 10px;
    width: auto;
    transform: none;
  }

  .lp-studio-layers {
    display: none;
  }

  .lp-studio-panel {
    inset: auto 10px 10px 10px;
    width: auto;
    max-height: 46vh;
  }
}
