/* Presents Scalar as a calm Enad API workstation rather than a stock embed. */
:root {
  color-scheme: dark;
  --playground-bg: #080403;
  --playground-bg-raised: #0d0706;
  --playground-panel: #120908;
  --playground-panel-soft: #1a0d0a;
  --playground-border: rgba(255, 220, 211, 0.13);
  --playground-border-strong: rgba(255, 220, 211, 0.2);
  --playground-text: #fff8f5;
  --playground-muted: #d8cbc7;
  --playground-dim: #a89791;
  --playground-accent: #ff4e22;
  --playground-accent-soft: #ff8a70;
  --playground-accent-wash: rgba(255, 78, 34, 0.11);
  --playground-ok: #9ad6b2;
  --playground-font-body: "Uncut Sans Variable", "Geist Variable", "Helvetica Neue", Arial, sans-serif;
  --playground-font-heading: Aeonik, "Geist Variable", "Helvetica Neue", Arial, sans-serif;
  --playground-font-code: "Geist Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

html,
body {
  min-height: 100%;
  margin: 0;
  overflow: auto;
  background:
    linear-gradient(235deg, rgba(255, 78, 34, 0.12), transparent 28rem),
    linear-gradient(115deg, rgba(255, 220, 211, 0.045), transparent 22rem),
    linear-gradient(180deg, #120705 0%, var(--playground-bg) 30rem);
  color: var(--playground-text);
  font-family: var(--playground-font-body);
  text-rendering: geometricPrecision;
}

body {
  scrollbar-color: rgba(255, 220, 211, 0.28) transparent;
}

.api-playground-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.api-playground-toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.82rem clamp(1rem, 2vw, 1.35rem);
  border-bottom: 1px solid var(--playground-border);
  background: color-mix(in oklch, var(--playground-bg) 88%, transparent);
  backdrop-filter: blur(20px) saturate(1.08);
}

.api-playground-identity {
  min-width: 0;
  display: grid;
  gap: 0.38rem;
}

.api-playground-title-group {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.8rem;
  align-items: baseline;
}

.api-playground-kicker {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 78, 34, 0.36);
  border-radius: 6px;
  background: var(--playground-accent-wash);
  color: var(--playground-accent-soft);
  font-size: 0.66rem;
  font-weight: 780;
  letter-spacing: 0.13em;
  line-height: 1;
  padding: 0.4rem 0.58rem;
  text-transform: uppercase;
}

.api-playground-title {
  margin: 0;
  color: var(--playground-text);
  font-family: var(--playground-font-heading);
  font-size: clamp(1.02rem, 1.65vw, 1.26rem);
  font-weight: 780;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.api-playground-summary {
  max-width: 72ch;
  margin: 0;
  color: var(--playground-muted);
  font-size: 0.86rem;
  line-height: 1.48;
}

.api-playground-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.api-playground-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.08rem;
  border: 1px solid var(--playground-border);
  border-radius: 999px;
  background: rgba(255, 220, 211, 0.05);
  color: var(--playground-muted);
  font-size: 0.77rem;
  font-weight: 710;
  line-height: 1;
  padding: 0 0.78rem;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.api-playground-action[data-primary="true"] {
  border-color: rgba(255, 78, 34, 0.5);
  background: rgba(255, 78, 34, 0.14);
  color: #ffd8ce;
}

.api-playground-action:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 78, 34, 0.46);
  background: rgba(255, 78, 34, 0.1);
  color: var(--playground-text);
}

.api-playground-action:focus-visible {
  outline: 2px solid #ff714e;
  outline-offset: 3px;
}

.api-playground-action[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.46;
}

.api-playground-workflow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.72rem clamp(1rem, 2vw, 1.35rem);
  border-bottom: 1px solid rgba(255, 220, 211, 0.1);
  background:
    linear-gradient(90deg, rgba(255, 78, 34, 0.08), transparent 36rem),
    rgba(18, 9, 8, 0.72);
}

.api-playground-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.api-playground-status-item {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-height: 1.8rem;
  border: 1px solid rgba(255, 220, 211, 0.12);
  border-radius: 999px;
  background: rgba(8, 4, 3, 0.46);
  color: var(--playground-muted);
  font-size: 0.72rem;
  font-weight: 680;
  line-height: 1;
  padding: 0 0.62rem;
  white-space: nowrap;
}

.api-playground-status-label {
  color: var(--playground-dim);
  font-weight: 620;
}

.api-playground-status-value {
  color: var(--playground-text);
}

.api-playground-status-dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: var(--playground-ok);
  box-shadow: 0 0 0 3px rgba(154, 214, 178, 0.12);
}

.api-playground-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.api-playground-guide-note {
  padding: 0.78rem clamp(1rem, 2vw, 1.35rem);
  border-bottom: 1px solid rgba(255, 220, 211, 0.08);
  background: rgba(12, 7, 6, 0.76);
}

.api-playground-guide-note-copy {
  max-width: 88ch;
  margin: 0;
  color: var(--playground-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.api-playground-step {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  color: var(--playground-muted);
  font-size: 0.76rem;
  font-weight: 660;
  line-height: 1.2;
  white-space: nowrap;
}

.api-playground-step-index {
  display: inline-grid;
  width: 1.28rem;
  height: 1.28rem;
  place-items: center;
  border: 1px solid rgba(255, 78, 34, 0.4);
  border-radius: 999px;
  color: var(--playground-accent-soft);
  font-family: var(--playground-font-code);
  font-size: 0.68rem;
}

.api-playground-preflight {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(16rem, 0.9fr);
  gap: 1rem;
  padding: 0.95rem clamp(1rem, 2vw, 1.35rem);
  border-bottom: 1px solid rgba(255, 220, 211, 0.1);
  background:
    linear-gradient(135deg, rgba(255, 78, 34, 0.14), rgba(255, 220, 211, 0.04)),
    rgba(13, 7, 6, 0.86);
}

.api-playground-preflight-copy {
  min-width: 0;
}

.api-playground-preflight-eyebrow,
.api-playground-setup-eyebrow {
  margin: 0 0 0.28rem;
  color: var(--playground-accent-soft);
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.api-playground-preflight-title {
  margin: 0;
  font-family: var(--playground-font-heading);
  font-size: 1rem;
  letter-spacing: -0.03em;
}

.api-playground-preflight-summary {
  margin: 0.42rem 0 0;
  color: var(--playground-muted);
  line-height: 1.55;
}

.api-playground-preflight-summary code {
  font-family: var(--playground-font-code);
}

.api-playground-preflight-steps {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--playground-text);
  display: grid;
  gap: 0.5rem;
}

.api-playground-preflight-steps li {
  color: var(--playground-muted);
  line-height: 1.45;
}

.api-playground-preflight-steps strong {
  color: var(--playground-text);
}

.api-playground-workbench {
  display: grid;
  grid-template-columns: minmax(18rem, 23rem) minmax(0, 1fr);
  gap: clamp(0.9rem, 1.6vw, 1.3rem);
  align-items: start;
  padding: clamp(0.9rem, 1.7vw, 1.35rem);
}

.api-playground-setup-rail {
  position: sticky;
  top: 5.3rem;
  z-index: 2;
  display: grid;
  gap: 0.85rem;
  max-height: calc(100vh - 6.6rem);
  overflow: auto;
  scrollbar-color: rgba(255, 220, 211, 0.24) transparent;
}

.api-playground-setup-card {
  border: 1px solid var(--playground-border);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 220, 211, 0.06), rgba(255, 220, 211, 0.025)),
    rgba(9, 5, 4, 0.74);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
  padding: 1rem;
}

.api-playground-setup-heading {
  margin: 0;
  color: var(--playground-text);
  font-family: var(--playground-font-heading);
  font-size: 1.18rem;
  font-weight: 760;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.api-playground-setup-heading--compact {
  font-size: 1rem;
}

.api-playground-setup-copy,
.api-playground-field-note,
.api-playground-empty {
  color: var(--playground-muted);
  font-size: 0.86rem;
  line-height: 1.48;
}

.api-playground-setup-copy {
  margin: 0.7rem 0 1rem;
}

.api-playground-field-note {
  margin: 0.55rem 0 0;
}

.api-playground-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.api-playground-inline-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  border: 1px solid rgba(255, 78, 34, 0.34);
  border-radius: 999px;
  background: rgba(255, 78, 34, 0.1);
  color: #ffd8ce;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 720;
  line-height: 1;
  padding: 0 0.78rem;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.api-playground-inline-action:hover {
  border-color: rgba(255, 78, 34, 0.5);
  background: rgba(255, 78, 34, 0.15);
  color: var(--playground-text);
}

.api-playground-inline-action:focus-visible {
  outline: 2px solid #ff714e;
  outline-offset: 3px;
}

.api-playground-count {
  display: inline-flex;
  min-width: 1.55rem;
  min-height: 1.55rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 78, 34, 0.34);
  border-radius: 999px;
  background: var(--playground-accent-wash);
  color: var(--playground-accent-soft);
  font-size: 0.76rem;
  font-weight: 760;
}

.api-playground-field,
.api-playground-route-fields,
.api-playground-story-list,
.api-playground-inline-actions {
  display: grid;
  gap: 0.55rem;
}

.api-playground-story-option {
  display: grid;
  gap: 0.2rem;
  width: 100%;
  border: 1px solid rgba(255, 220, 211, 0.13);
  border-radius: 16px;
  background: rgba(255, 220, 211, 0.04);
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 0.8rem 0.82rem;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.api-playground-story-option:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 78, 34, 0.32);
  background: rgba(255, 78, 34, 0.08);
}

.api-playground-story-option:focus-visible {
  outline: 2px solid #ff714e;
  outline-offset: 3px;
}

.api-playground-story-option[data-active="true"] {
  border-color: rgba(255, 78, 34, 0.42);
  background: linear-gradient(180deg, rgba(255, 78, 34, 0.11), rgba(255, 220, 211, 0.03));
}

.api-playground-story-label {
  color: var(--playground-text);
  font-size: 0.82rem;
  font-weight: 720;
}

.api-playground-story-copy {
  color: var(--playground-muted);
  font-size: 0.78rem;
  line-height: 1.42;
}

.api-playground-field {
  margin-top: 0.75rem;
}

.api-playground-field span,
.api-playground-choice span {
  color: var(--playground-text);
  font-size: 0.77rem;
  font-weight: 720;
}

.api-playground-field input,
.api-playground-field textarea,
.api-playground-field select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255, 220, 211, 0.16);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--playground-text);
  font: inherit;
  font-size: 0.88rem;
  outline: none;
  padding: 0.74rem 0.78rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.api-playground-field textarea {
  min-height: 8.5rem;
  font-family: var(--playground-font-code);
  line-height: 1.48;
  resize: vertical;
}

.api-playground-field select {
  appearance: none;
}

.api-playground-field input:focus,
.api-playground-field textarea:focus,
.api-playground-field select:focus {
  border-color: rgba(255, 78, 34, 0.56);
  background: rgba(0, 0, 0, 0.32);
  box-shadow: 0 0 0 3px rgba(255, 78, 34, 0.14);
}

.api-playground-field input::placeholder,
.api-playground-field textarea::placeholder {
  color: rgba(216, 203, 199, 0.52);
}

.api-playground-choice {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-top: 0.75rem;
  color: var(--playground-muted);
}

.api-playground-choice input {
  margin-top: 0.15rem;
}

.api-playground-inline-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.75rem;
}

.api-playground-inline-actions .api-playground-inline-action {
  width: 100%;
}

.api-playground-persisted-auth-card[data-auth-state="active"] {
  border-color: rgba(154, 214, 178, 0.28);
  background: linear-gradient(180deg, rgba(154, 214, 178, 0.08), rgba(255, 220, 211, 0.03));
}

.api-playground-persisted-auth-card[data-auth-state="rejected"] {
  border-color: rgba(255, 138, 112, 0.3);
  background: linear-gradient(180deg, rgba(255, 138, 112, 0.08), rgba(255, 220, 211, 0.03));
}

.api-playground-persisted-auth-indicator {
  margin: 0;
  color: var(--playground-text);
  font-size: 0.82rem;
  font-weight: 720;
}

.api-playground-persisted-auth-feedback:empty {
  display: none;
}

.api-playground-empty[hidden] {
  display: none;
}

.api-playground-url-preview {
  display: block;
  overflow-wrap: anywhere;
  border: 1px solid rgba(255, 220, 211, 0.14);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.28);
  color: #ffe0d7;
  font-family: var(--playground-font-code);
  font-size: 0.78rem;
  line-height: 1.48;
  padding: 0.82rem;
}

.api-playground-checklist {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.api-playground-checklist li {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  color: var(--playground-muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.api-playground-checklist li::before {
  content: "";
  flex: 0 0 auto;
  width: 0.58rem;
  height: 0.58rem;
  margin-top: 0.28rem;
  border-radius: 999px;
  background: rgba(255, 220, 211, 0.28);
}

.api-playground-checklist li.is-ready::before {
  background: var(--playground-ok);
  box-shadow: 0 0 0 3px rgba(154, 214, 178, 0.12);
}

.api-playground-checklist li.is-pending::before {
  background: var(--playground-accent-soft);
  box-shadow: 0 0 0 3px rgba(255, 78, 34, 0.13);
}

.api-playground-share-warning,
.api-playground-share-status {
  margin: 0.6rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
}

.api-playground-share-warning {
  border: 1px solid rgba(255, 138, 112, 0.22);
  border-radius: 14px;
  background: rgba(255, 138, 112, 0.08);
  color: #ffd6cc;
  padding: 0.68rem 0.72rem;
}

.api-playground-share-status {
  color: var(--playground-muted);
}

[data-enad-request-setup] {
  position: relative;
  border: 1px solid rgba(255, 78, 34, 0.22) !important;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 78, 34, 0.08), rgba(255, 220, 211, 0.03)),
    rgba(18, 9, 8, 0.88) !important;
  box-shadow: inset 0 1px 0 rgba(255, 220, 211, 0.04);
  padding-bottom: 0.7rem;
}

[data-enad-request-setup="authentication"] {
  border-color: rgba(255, 138, 112, 0.34) !important;
}

[data-enad-request-setup="variables"] {
  border-color: rgba(154, 214, 178, 0.28) !important;
}

[data-enad-request-setup] h2 {
  color: var(--playground-text) !important;
}

.api-playground-request-setup-helper {
  margin: 0.5rem 0.9rem 0;
  color: var(--playground-muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.api-playground-mount {
  min-height: calc(100vh - 8.6rem);
  overflow: visible;
  background:
    linear-gradient(90deg, rgba(255, 220, 211, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 220, 211, 0.028) 1px, transparent 1px),
    var(--playground-bg);
  background-size: 44px 44px;
}

.api-playground-console {
  min-width: 0;
  border: 1px solid var(--playground-border);
  border-radius: 24px;
  background: rgba(9, 5, 4, 0.54);
  overflow: clip;
}

.api-playground-loading,
.api-playground-error {
  max-width: 40rem;
  margin: 1rem;
  border: 1px solid rgba(255, 220, 211, 0.14);
  border-radius: 20px;
  background: rgba(18, 9, 8, 0.82);
  color: var(--playground-text);
  padding: 1rem;
}

.api-playground-loading-title,
.api-playground-error-title {
  margin: 0;
  color: var(--playground-text);
  font-size: 0.95rem;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.api-playground-loading-copy,
.api-playground-error-copy {
  margin: 0.36rem 0 0;
  color: var(--playground-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.api-playground-error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.api-playground-error-actions a {
  color: var(--playground-accent-soft);
  font-size: 0.82rem;
  font-weight: 720;
  text-decoration: none;
}

@media (max-width: 980px) {
  .api-playground-workbench {
    grid-template-columns: 1fr;
  }

  .api-playground-setup-rail {
    position: static;
    max-height: none;
  }
}

@media (max-width: 960px) {
  .api-playground-toolbar,
  .api-playground-workflow,
  .api-playground-preflight {
    grid-template-columns: 1fr;
  }

  .api-playground-actions,
  .api-playground-steps {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .api-playground-workbench {
    padding: 0.75rem;
  }

  .api-playground-setup-card,
  .api-playground-console {
    border-radius: 18px;
  }
}

@media (max-width: 640px) {
  .api-playground-summary {
    display: none;
  }

  .api-playground-status,
  .api-playground-steps {
    gap: 0.38rem;
  }

  .api-playground-status-item,
  .api-playground-step {
    white-space: normal;
  }
}
