.tst-schema-studio {
  --tst-schema-accent: var(--tst-tool-control-primary, #c8f65c);
  --tst-schema-border: #475569;
  --tst-schema-field: #1e293b;
  --tst-schema-panel: #111c2d;
  --tst-schema-ink: #f8fafc;
  --tst-schema-muted: #cbd5e1;
  color: var(--tst-schema-ink);
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.tst-schema-studio,
.tst-schema-studio * { box-sizing: border-box; min-width: 0; }
.tst-schema-studio h2,
.tst-schema-studio p { margin: 0; }
.tst-schema-studio h2 { color: var(--tst-schema-ink); }
.tst-schema-studio__privacy,
.tst-schema-studio__note { color: var(--tst-schema-muted); font-size: 0.82rem; line-height: 1.55; }
.tst-schema-studio form { display: grid; gap: 1rem; }
.tst-schema-studio fieldset,
.tst-schema-studio__result {
  background: color-mix(in srgb, var(--tst-schema-panel) 92%, #2563eb 8%);
  border: 1px solid var(--tst-schema-border);
  border-radius: 0.8rem;
  margin: 0;
  padding: 1rem;
}
.tst-schema-studio fieldset[hidden] { display: none; }
.tst-schema-studio legend { color: var(--tst-schema-accent); font-size: 0.8rem; font-weight: 900; padding: 0 0.35rem; }
.tst-schema-studio fieldset > p { color: var(--tst-schema-muted); font-size: 0.78rem; margin-bottom: 0.85rem; }
.tst-schema-studio label { display: block; font-size: 0.78rem; font-weight: 800; margin-bottom: 0.35rem; }
.tst-schema-studio :where(input, textarea, select) {
  background: var(--tst-schema-field);
  border: 1px solid var(--tst-schema-border);
  border-radius: 0.65rem;
  color: var(--tst-schema-ink);
  font: inherit;
  max-width: 100%;
  padding: 0.72rem;
  width: 100%;
}
.tst-schema-studio textarea { line-height: 1.5; resize: vertical; }
.tst-schema-studio :where(input, textarea, select, button):focus-visible { outline: 0.2rem solid var(--tst-tool-control-focus, #8ab1ff); outline-offset: 0.12rem; }
.tst-schema-studio__profile { max-width: 34rem; }
.tst-schema-studio__fields { display: grid; gap: 0.8rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tst-schema-studio__wide { grid-column: 1 / -1; }
.tst-schema-studio__confirmation { align-items: flex-start; display: flex !important; gap: 0.65rem; line-height: 1.45; margin: 0 !important; }
.tst-schema-studio__confirmation input { flex: 0 0 auto; margin-top: 0.15rem; width: auto; }
.tst-schema-studio__actions { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.tst-schema-studio button {
  background: var(--tst-schema-accent);
  border: 1px solid var(--tst-schema-accent);
  border-radius: 0.65rem;
  color: var(--tst-tool-control-on-primary, #101827);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 900;
  min-height: 2.65rem;
  padding: 0.6rem 0.9rem;
}
.tst-schema-studio button.tst-schema-studio__secondary { background: transparent; color: var(--tst-schema-ink); }
.tst-schema-studio__result { display: grid; gap: 0.8rem; }
.tst-schema-studio__result > label { color: var(--tst-schema-accent); font-size: 0.88rem; }
.tst-schema-studio__result textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.74rem; overflow-wrap: normal; white-space: pre; }
.tst-schema-studio__status { font-size: 0.84rem; font-weight: 800; min-height: 1.3rem; }
.tst-schema-studio__status[data-state='valid'] { color: var(--tst-schema-accent); }
.tst-schema-studio__status[data-state='invalid'] { color: #ff9b8f; }
.tst-schema-studio__findings ul { display: grid; gap: 0.4rem; list-style: none; margin: 0; padding: 0; }
.tst-schema-studio__findings li { overflow-wrap: anywhere; padding-left: 1.35rem; position: relative; }
.tst-schema-studio__findings li::before { left: 0; position: absolute; top: 0; }
.tst-schema-studio__findings li[data-state='error']::before { color: #ff9b8f; content: '×'; }
.tst-schema-studio__findings li[data-state='warning']::before { color: #ffd166; content: '!'; }
.tst-schema-studio__findings li[data-state='pass']::before { color: var(--tst-schema-accent); content: '✓'; }

[data-tst-site-shell][data-theme='light'] .tst-schema-studio {
  --tst-schema-border: #cbd5e1;
  --tst-schema-field: #f8fafc;
  --tst-schema-panel: #ffffff;
  --tst-schema-ink: #0f172a;
  --tst-schema-muted: #526071;
}

@media (max-width: 42rem) {
  .tst-schema-studio__fields { grid-template-columns: 1fr; }
  .tst-schema-studio__wide { grid-column: auto; }
}

@media (max-width: 20rem) {
  .tst-schema-studio fieldset,
  .tst-schema-studio__result { padding: 0.75rem; }
  .tst-schema-studio__actions { align-items: stretch; flex-direction: column; }
  .tst-schema-studio button { width: 100%; }
}
