.layout-editor-shell {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10000;
  color: #eef4e8;
  font-family: var(--font-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
}

.layout-editor-toggle,
.layout-editor-panel button {
  border: 1px solid rgba(167, 244, 50, .35);
  background: rgba(13, 15, 13, .88);
  color: #eef4e8;
  cursor: pointer;
}

.layout-editor-toggle {
  min-width: 112px;
  height: 40px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .34);
}

.layout-editor-panel {
  display: none;
  width: min(360px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 34px));
  margin-bottom: 10px;
  border: 1px solid rgba(167, 244, 50, .22);
  border-radius: 8px;
  background: rgba(7, 8, 8, .94);
  box-shadow: 0 22px 70px rgba(0, 0, 0, .48);
  overflow: hidden;
  backdrop-filter: blur(22px);
}

.layout-editor-shell.is-open .layout-editor-panel {
  display: block;
}

.layout-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.layout-editor-title {
  display: grid;
  gap: 3px;
}

.layout-editor-title strong {
  font-size: 14px;
}

.layout-editor-title span {
  color: rgba(238, 244, 232, .58);
  font-size: 11px;
}

.layout-editor-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
}

.layout-editor-body {
  display: grid;
  gap: 12px;
  max-height: 590px;
  padding: 14px;
  overflow: auto;
}

.layout-editor-section {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 7px;
  background: rgba(255, 255, 255, .025);
}

.layout-editor-section-title {
  color: rgba(238, 244, 232, .86);
  font: 700 12px/1.2 var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.layout-editor-target,
.layout-editor-text-target {
  padding: 10px 11px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 6px;
  background: rgba(255, 255, 255, .045);
  color: rgba(238, 244, 232, .72);
  font: 12px/1.45 var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
}

.layout-editor-text-input {
  min-height: 86px;
  padding: 10px 11px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 6px;
  resize: vertical;
  background: rgba(0, 0, 0, .32);
  color: #eef4e8;
  font: 13px/1.55 var(--font-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
}

.layout-editor-text-input:disabled {
  cursor: not-allowed;
  opacity: .52;
}

.layout-editor-control {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 54px;
  gap: 10px;
  align-items: center;
}

.layout-editor-control label,
.layout-editor-control output {
  font-size: 12px;
  color: rgba(238, 244, 232, .72);
}

.layout-editor-control output {
  text-align: right;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
}

.layout-editor-control input {
  accent-color: #a7f432;
}

.layout-editor-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.layout-editor-actions--hero {
  grid-template-columns: repeat(2, 1fr);
}

.layout-editor-actions--text {
  grid-template-columns: repeat(3, 1fr);
}

.layout-editor-panel button {
  min-height: 34px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.layout-editor-export {
  display: none;
  min-height: 120px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 6px;
  resize: vertical;
  background: rgba(0, 0, 0, .4);
  color: #eef4e8;
  font: 11px/1.5 var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
}

.layout-editor-export.is-visible {
  display: block;
}

[data-layout-editor-active="true"] [data-layout-id] {
  outline: 1px dashed rgba(167, 244, 50, .24);
  outline-offset: 5px;
}

[data-layout-editor-active="true"] [data-layout-id]:hover {
  outline-color: rgba(167, 244, 50, .72);
}

[data-layout-editor-active="true"] [data-layout-selected="true"] {
  outline: 2px solid #a7f432;
  outline-offset: 6px;
}

[data-layout-editor-active="true"] [data-text-id] {
  cursor: text;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(167, 244, 50, .16);
}

[data-layout-editor-active="true"] [data-text-id]:hover {
  background: rgba(167, 244, 50, .1);
  box-shadow: 0 0 0 1px rgba(167, 244, 50, .62);
}

[data-layout-editor-active="true"] [data-text-selected="true"] {
  background: rgba(167, 244, 50, .16);
  box-shadow: 0 0 0 2px #a7f432, 0 0 24px rgba(167, 244, 50, .18);
}

@media (max-width: 640px) {
  .layout-editor-shell {
    right: 10px;
    bottom: 10px;
  }

  .layout-editor-control {
    grid-template-columns: 78px minmax(0, 1fr) 46px;
  }
}
