[hidden]:not([hidden="until-found"]) { display: none !important; }

.editor-link,
.editor-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--stroke);
  border-radius: 9px;
  background: var(--control);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.editor-link:hover,
.editor-button:hover { border-color: var(--hover-border); }

.editor-link svg,
.editor-button svg {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.demo[data-mode="editor"] {
  width: min(100% - 64px, 1160px);
  padding-block-end: 48px;
}

.signal-editor {
  --editor-accent: #dde1ea;
  --editor-accent-ink: #181b22;
  --editor-track: #626777;
  --editor-stage: #141416;
  --editor-active: #24262c;
  --editor-outline: #686c7a;
  color: var(--text);
}

.editor-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-block: 24px 18px;
}

.editor-heading h2 {
  margin: 0;
  font-size: clamp(26px, 4.2vw, 43px);
  font-weight: 460;
  line-height: 1.12;
  letter-spacing: -0.052em;
}

.editor-heading h2:focus { outline: none; }

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.editor-button--primary {
  min-width: 118px;
  border-color: var(--editor-accent);
  background: var(--editor-accent);
  color: var(--editor-accent-ink);
}

.editor-button--primary:hover { filter: brightness(0.93); }
.editor-button:disabled { opacity: 0.70; cursor: progress; }

.editor-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  align-items: start;
  gap: 14px;
}

.editor-preview,
.editor-settings {
  min-width: 0;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: var(--card);
}

.editor-preview {
  position: sticky;
  top: 16px;
}

.editor-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding-inline: 16px;
  border-bottom: 1px solid var(--stroke);
}

.editor-panel-heading h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 460;
}

.editor-value {
  color: var(--muted);
  font: 11px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
  text-align: end;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.editor-preview__stage {
  container-type: inline-size;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  min-height: clamp(430px, 63vh, 655px);
  padding: clamp(16px, 4vw, 48px);
  border-radius: 0 0 15px 15px;
  background: radial-gradient(ellipse at 50% 48%, var(--editor-stage), var(--card) 78%);
}

.editor-artboard {
  --shimmer-position: 0%;
  display: flex;
  align-items: center;
  gap: clamp(9px, 2.5vw, 18px);
  width: fit-content;
  max-width: 100%;
  padding-inline: 6px clamp(12px, 3vw, 24px);
  border-radius: 15px;
  background: #0f0f0f;
  box-shadow: 0 16px 42px -24px rgb(0 0 0 / 48%);
}

.editor-artboard[data-background="light"] { background: #fdfef9; }

.editor-artboard[data-background="transparent"] {
  --checker-a: #18191c;
  --checker-b: #212226;
  background: repeating-conic-gradient(var(--checker-a) 0% 25%, var(--checker-b) 0% 50%) top left / 16px 16px;
}

.editor-artboard canvas {
  display: block;
  width: calc(var(--editor-artboard-size, 256px) * 0.56);
  min-width: 0;
  height: auto;
  aspect-ratio: 1;
}

.editor-artboard .thinking__text {
  --editor-label-size: calc(var(--editor-artboard-size, 256px) * 0.1953125);
  flex: none;
  font-size: clamp(18px, min(5.8vw, var(--editor-label-size)), 50px);
  font-size: clamp(18px, min(9cqi, var(--editor-label-size)), 50px);
}

.editor-reset {
  min-height: 34px;
  margin-right: -8px;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.editor-reset:hover { color: var(--text); }

.editor-group {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 10px 16px 16px;
  border: 0;
  border-bottom: 1px solid var(--stroke);
  font-size: 13px;
}

.editor-group legend {
  float: left;
  width: 100%;
  margin: 5px 0 1px;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
}

.editor-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.28fr);
  align-items: center;
  gap: 9px;
  min-height: 34px;
  font-size: 13px;
}

.editor-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--editor-outline);
  border-radius: 7px;
  background: var(--control);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  text-align: start;
  cursor: pointer;
}

.editor-select__trigger [data-slot="select-value"] {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-chevron, .editor-select__content svg {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.editor-select__content {
  width: max(126px, var(--anchor-width, 160px));
  max-width: calc(100vw - 24px);
  max-height: min(296px, var(--available-height, calc(100dvh - 24px)));
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--hover-border);
  border-radius: 8px;
  background: var(--control);
  color: var(--text);
  box-shadow: 0 12px 35px -12px rgb(0 0 0 / 55%);
}

.editor-select__content [data-slot="select-item"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 32px;
  padding-inline: 8px;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
}

.editor-select__content [data-highlighted] {
  background: var(--editor-active);
  outline: 1px solid var(--editor-outline);
  outline-offset: -1px;
}

.editor-select__content [data-slot="select-item-indicator"] { display: inline-flex; }
.editor-color-picker { justify-self: end; }

.editor-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 8px;
}

.editor-range [data-slot="slider-control"] {
  display: flex;
  align-items: center;
  grid-column: 1 / -1;
  height: 22px;
  padding-inline: 6px;
  touch-action: none;
  cursor: ew-resize;
}

.editor-range [data-slot="slider-track"] {
  position: relative;
  width: 100%;
  height: 3px;
  border-radius: 4px;
  background: var(--editor-track);
}

.editor-range [data-slot="slider-indicator"] {
  height: 100%;
  border-radius: inherit;
  background: var(--editor-accent);
}

.editor-range [data-slot="slider-thumb"] {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--editor-accent);
}

.editor-range [data-slot="slider-thumb"]:has(:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.editor-gif-settings { padding-inline: 16px; }

.editor-gif-settings [data-slot="collapsible-trigger"] {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 14px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.editor-gif-settings [data-slot="collapsible-trigger"]:not([data-open]) svg { transform: rotate(-90deg); }
.editor-gif-settings [data-slot="collapsible-panel"] { padding-bottom: 14px; }
.editor-gif-settings .editor-row + .editor-row { margin-top: 8px; }

.editor-feedback {
  position: fixed;
  z-index: 5;
  right: 22px;
  bottom: 22px;
  max-width: calc(100vw - 44px);
  margin: 0;
  padding: 11px 14px;
  border: 1px solid var(--editor-outline);
  border-radius: 9px;
  background: var(--control);
  color: var(--text);
  font-size: 13px;
  box-shadow: 0 12px 32px -10px rgb(0 0 0 / 40%);
}

.editor-code {
  position: fixed;
  inset: 0;
  width: min(760px, calc(100vw - 32px));
  max-width: none;
  height: max-content;
  max-height: min(700px, calc(100dvh - 32px));
  margin: auto;
  padding: 17px;
  overflow-y: auto;
  border: 1px solid var(--editor-outline);
  border-radius: 15px;
  background: var(--card);
  color: var(--text);
}

.editor-code[data-open] { display: grid; gap: 12px; }

.editor-code__backdrop {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 56%);
  backdrop-filter: blur(4px);
}

.editor-code__header, .editor-code__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.editor-code__header h3 { margin: 0; font-size: 19px; font-weight: 460; letter-spacing: -0.035em; }
.editor-code__close { min-width: 36px; min-height: 36px; padding-inline: 0; }

.editor-code__platforms {
  display: flex;
  justify-self: start;
  max-width: 100%;
  gap: 3px;
  margin: 0;
  padding: 3px;
  border: 1px solid var(--stroke);
  border-radius: 9px;
  background: var(--control);
  font-size: 13px;
}

.editor-code__platform {
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.editor-code__platform[data-checked] { background: var(--editor-active); color: var(--text); }

.editor-code__source {
  width: 100%;
  height: min(45vh, 390px);
  min-height: 140px;
  padding: 12px;
  resize: vertical;
  overflow-wrap: normal;
  white-space: pre;
  border: 1px solid var(--stroke);
  border-radius: 9px;
  background: var(--preview-panel);
  color: var(--text);
  font: 12px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.editor-code__footer p { margin: 0; color: var(--muted); font-size: 12px; }
.editor-code__footer .editor-button { margin-left: auto; }

.editor-link:focus-visible,
.signal-editor :is(button, textarea):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .editor-workspace { grid-template-columns: minmax(0, 1fr); }
  .editor-preview { z-index: 2; top: 8px; }
  .editor-preview__stage { min-height: clamp(150px, 28vh, 238px); padding: 12px; }
  .editor-artboard canvas { max-width: clamp(124px, calc(28vh - 24px), 214px); }
  .editor-range [data-slot="slider-control"] { height: 28px; }
  .editor-settings :is(input, button) { scroll-margin-top: calc(clamp(150px, 28vh, 238px) + 66px); }
}

@media (max-width: 760px) and (max-height: 510px) {
  .editor-preview { position: static; }
  .editor-settings :is(input, button) { scroll-margin-top: 16px; }
}

@media (max-width: 620px) {
  .demo[data-mode="editor"] { width: calc(100% - 32px); padding-block-end: 32px; }
  .editor-heading { padding-block: 18px 14px; }
}

