.wtzm-code-workspace {
  --code-canvas: #101827;
  --code-canvas-deep: #0d1421;
  --code-chrome: #17213a;
  --code-chrome-control: #202c44;
  --code-line: #293449;
  --code-line-strong: #46526b;
  --code-ink: #dce5f5;
  --code-muted: #aeb8cb;
  --code-brand: #78adff;
  --code-success: #48c79a;
  --code-danger: #ff7474;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--code-line-strong);
  border-radius: 10px;
  color: var(--code-ink);
  background: var(--code-canvas);
  box-shadow: 0 4px 14px rgba(16, 24, 39, .07);
}

.wtzm-code-workspace:focus-within {
  border-color: #0068e8;
  box-shadow: 0 0 0 3px rgba(0, 104, 232, .16);
}

.wtzm-code-workspace__toolbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--code-line);
  background: var(--code-chrome);
}

.wtzm-code-workspace__identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.wtzm-code-workspace__identity > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.wtzm-code-workspace__identity strong {
  color: #f7f9ff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.wtzm-code-workspace__identity small {
  color: var(--code-muted);
  font-size: 11px;
  line-height: 1.4;
}

.wtzm-code-workspace__icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: var(--control-radius);
  color: #aeb7ff;
  background: rgba(119, 128, 255, .12);
}

.wtzm-code-workspace__icon :is(svg, .app-lord-icon, .manager-button-icon) {
  width: 15px;
  height: 15px;
}

.wtzm-code-workspace__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.wtzm-code-workspace__action {
  min-height: var(--control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--code-line-strong);
  border-radius: var(--control-radius);
  color: #f7f9ff;
  background: var(--code-chrome-control);
  font: 600 12px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
}

.wtzm-code-workspace__action:hover {
  border-color: #7984d8;
  background: #293652;
}

.wtzm-code-workspace__action:focus-visible {
  outline: 2px solid #9cc6ff;
  outline-offset: 2px;
}

.wtzm-code-workspace__surface {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  min-height: 180px;
  background: var(--code-canvas);
}

.wtzm-code-workspace__lines {
  min-height: 180px;
  height: 100%;
  overflow: hidden;
  margin: 0;
  padding: 16px 10px;
  border-right: 1px solid var(--code-line);
  color: #62708b;
  background: var(--code-canvas-deep);
  font: 12px/24px ui-monospace, SFMono-Regular, Consolas, monospace;
  text-align: right;
  user-select: none;
}

.wtzm-code-workspace .wtzm-code-workspace__input {
  width: 100%;
  min-width: 0;
  min-height: 180px;
  resize: vertical;
  overflow: auto;
  padding: 16px 18px;
  border: 0;
  border-radius: 0;
  outline: 0;
  color: var(--code-ink);
  background: var(--code-canvas);
  caret-color: #8fe0c1;
  font: 13px/24px ui-monospace, SFMono-Regular, Consolas, monospace;
  tab-size: 2;
  white-space: pre;
}

.wtzm-code-workspace .wtzm-code-workspace__input::placeholder {
  color: #73819a;
  opacity: 1;
}

.wtzm-code-workspace__preview {
  max-width: 100%;
  max-height: 460px;
  overflow: auto;
  margin: 0;
  padding: 16px 18px;
  color: var(--code-ink);
  background: var(--code-canvas);
  font: 13px/24px ui-monospace, SFMono-Regular, Consolas, monospace;
  tab-size: 2;
  white-space: pre;
}

.wtzm-code-workspace__preview code {
  font-family: inherit;
  font-size: var(--control-font-size);
}

.wtzm-code-workspace__status {
  min-height: var(--control-height);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-top: 1px solid var(--code-line);
  color: #b8c2d6;
  background: var(--code-chrome);
  font-size: 11px;
  line-height: 1.4;
}

.wtzm-code-workspace__status > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.wtzm-code-workspace__indicator {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #7c879d;
}

.wtzm-code-workspace__status kbd {
  padding: 3px 7px;
  border: 1px solid var(--code-line-strong);
  border-radius: var(--control-radius);
  color: #c8d0df;
  background: var(--code-canvas);
  font: 10px ui-monospace, SFMono-Regular, Consolas, monospace;
}

.wtzm-code-workspace[data-state="valid"] .wtzm-code-workspace__indicator {
  background: var(--code-success);
  box-shadow: 0 0 0 4px rgba(72, 199, 154, .1);
}

.wtzm-code-workspace[data-state="valid"] .wtzm-code-workspace__status > span:nth-child(2) {
  color: #9ce4c9;
}

.wtzm-code-workspace[data-state="invalid"] {
  border-color: #c95959;
}

.wtzm-code-workspace[data-state="invalid"] .wtzm-code-workspace__indicator {
  background: var(--code-danger);
}

.wtzm-code-workspace[data-state="invalid"] .wtzm-code-workspace__status > span:nth-child(2) {
  color: #ffb4b4;
}

.wtzm-code-workspace__issues {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 11px 14px 13px 38px;
  border-top: 1px solid #5f3038;
  color: #ffd0d0;
  background: #321b24;
  font-size: 11px;
}

.wtzm-code-workspace__issues[hidden] {
  display: none;
}

.wtzm-code-workspace__issues strong {
  margin-right: 7px;
  color: #ff9292;
}

.wtzm-code-workspace--expanded .wtzm-code-workspace__surface,
.wtzm-code-workspace--expanded .wtzm-code-workspace__lines,
.wtzm-code-workspace--expanded .wtzm-code-workspace__input {
  min-height: 460px;
  height: 460px;
}

@media (max-width: 640px) {
  .wtzm-code-workspace__toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
  }

  .wtzm-code-workspace__identity small {
    display: none;
  }

  .wtzm-code-workspace__actions {
    min-width: 0;
  }

  .wtzm-code-workspace__surface {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .wtzm-code-workspace .wtzm-code-workspace__input,
  .wtzm-code-workspace__preview {
    padding-inline: 12px;
    font-size: 12px;
  }

  .wtzm-code-workspace__status kbd {
    display: none;
  }
}
