.sandbox-page {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 250, 252, 0.94)),
    radial-gradient(circle at 14% 10%, rgba(24, 169, 153, 0.16), transparent 28rem);
}

.sandbox-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 46px;
}

.sandbox-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 18px;
  align-items: end;
  margin-bottom: 20px;
}

.sandbox-hero h1 {
  font-size: clamp(2rem, 5vw, 4rem);
}

.sandbox-status-card {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid #cfe7df;
  border-left: 7px solid var(--teal);
  border-radius: var(--radius);
  background: #f4fbf8;
  color: #174037;
}

.sandbox-status-card span {
  color: #3c5c55;
}

.sandbox-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 18px;
  align-items: stretch;
}

.sandbox-focus {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.sandbox-focus div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid #cfe7df;
  border-radius: var(--radius);
  background: #f4fbf8;
}

.sandbox-focus strong {
  color: #0f6953;
  font-size: 0.9rem;
  line-height: 1.25;
}

.sandbox-focus span {
  color: #29453f;
  font-size: 0.94rem;
  line-height: 1.4;
}

.sandbox-editor-panel,
.sandbox-output-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(23, 32, 51, 0.08);
}

.sandbox-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.sandbox-panel-head h2 {
  margin-bottom: 6px;
  font-size: 1.35rem;
}

.sandbox-panel-head p {
  margin: 0;
  color: var(--muted);
}

.sandbox-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.sandbox-actions .button {
  min-width: 88px;
}

.sandbox-message-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.sandbox-message-actions .button {
  width: 100%;
  min-height: 48px;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
}

.sandbox-label {
  display: block;
  font-weight: 850;
}

.code-editor,
.test-message {
  width: 100%;
  border: 2px solid #cbd8e7;
  border-radius: var(--radius);
  color: var(--ink);
  font: 500 0.95rem/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.code-editor {
  min-height: 520px;
  padding: 16px;
  resize: vertical;
  background: #101827;
  color: #f8fafc;
  tab-size: 2;
}

.test-message {
  min-height: 110px;
  padding: 14px;
  resize: vertical;
  background: #fbfdff;
}

.sandbox-help {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.output-frame {
  display: grid;
  min-height: 330px;
  overflow: hidden;
  border: 1px solid #22304a;
  border-radius: var(--radius);
  background: #0b1220;
}

.output-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

.output-title {
  display: grid;
  gap: 2px;
}

.output-title strong {
  color: #f8fafc;
  font-size: 0.95rem;
  line-height: 1.2;
}

.output-title span {
  color: #cbd5e1;
  font-size: 0.9rem;
  line-height: 1.2;
}

.output-clear {
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  background: transparent;
  color: #e2e8f0;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

.sandbox-output {
  min-height: 280px;
  max-height: 420px;
  margin: 0;
  padding: 16px;
  overflow: auto;
  color: #d6f6e8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 500 0.96rem/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.sandbox-checklist {
  padding: 16px;
  border: 1px solid #d8e2ee;
  border-radius: var(--radius);
  background: #fbfdff;
}

.sandbox-checklist h3 {
  margin-top: 0;
}

.sandbox-api-panel {
  display: grid;
  gap: 11px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.sandbox-api-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sandbox-api-head h3,
.sandbox-api-head p {
  margin: 0;
}

.sandbox-api-head h3 {
  font-size: 1.08rem;
}

.sandbox-api-head p {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.42;
}

.model-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid #b8e8d8;
  border-radius: 999px;
  background: #eef8f5;
  color: #0f6953;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.api-key-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.sandbox-secret-input {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border: 2px solid #cbd8e7;
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  line-height: 1.35;
}

.sandbox-secret-input:focus-visible {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(36, 107, 253, 0.16);
}

.sandbox-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.92rem;
  font-weight: 850;
}

.sandbox-error:empty {
  display: none;
}

.sandbox-error:not(:empty) {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #ffc8c3;
  border-radius: var(--radius);
  background: #fff2f1;
}

.live-ai-log {
  display: grid;
  gap: 8px;
  min-height: 98px;
  max-height: 230px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7fbff;
  overscroll-behavior: contain;
}

.live-ai-log:empty::before {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
  content: attr(data-empty);
}

.live-message {
  display: flex;
  max-width: 94%;
}

.live-message.user {
  justify-self: end;
}

.live-message.assistant {
  justify-self: start;
}

.live-bubble {
  display: grid;
  gap: 3px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(23, 32, 51, 0.05);
}

.live-message.user .live-bubble {
  border-color: #bfd1e7;
  background: #edf4ff;
}

.live-speaker,
.live-text {
  margin: 0;
}

.live-speaker {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.live-text {
  line-height: 1.48;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.intent-chip-list,
.quick-tests,
.candidate-list,
.quick-profiles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.intent-chip-list span,
.quick-tests button,
.candidate-list span,
.quick-profiles button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 800;
}

.intent-chip-list span {
  padding: 7px 10px;
  background: #eef8f5;
  color: #0f6953;
}

.candidate-list span {
  padding: 7px 10px;
  border: 1px solid #d8e2ee;
  background: #fbfdff;
  color: #334155;
}

.quick-tests button,
.quick-profiles button {
  padding: 8px 10px;
  border: 1px solid #cbd8e7;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.quick-tests button:hover,
.quick-profiles button:hover,
.quick-tests button:focus-visible,
.quick-profiles button:focus-visible {
  border-color: var(--blue);
  background: #f7fbff;
}

.quick-profiles button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

.profile-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 850;
}

.sandbox-select {
  width: 100%;
  min-height: 48px;
  padding: 9px 34px 9px 10px;
  border: 2px solid #cbd8e7;
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.sandbox-select:focus-visible {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(36, 107, 253, 0.16);
}

.sandbox-footer-note {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

html[data-embed="true"] .site-header,
html[data-embed="true"] .site-footer,
html[data-embed="true"] .sandbox-footer-note {
  display: none;
}

html[data-embed="true"] body,
html[data-embed="true"] main {
  background: #ffffff;
}

html[data-embed="true"] body {
  font-size: 16px;
  overflow-x: hidden;
}

html[data-embed="true"] .sandbox-shell {
  width: min(1180px, calc(100% - 16px));
  padding: 10px 0 14px;
}

html[data-embed="true"] .sandbox-hero {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 10px;
  align-items: stretch;
  margin-bottom: 10px;
}

html[data-embed="true"] .sandbox-hero h1 {
  font-size: clamp(1.35rem, 3vw, 2.1rem);
}

html[data-embed="true"] .eyebrow {
  margin-bottom: 6px;
  font-size: 0.72rem;
}

html[data-embed="true"] .lead {
  margin-top: 8px;
  font-size: 0.95rem;
  line-height: 1.45;
}

html[data-embed="true"] .sandbox-status-card {
  gap: 4px;
  padding: 12px;
  border-left-width: 5px;
  font-size: 0.92rem;
  line-height: 1.35;
}

html[data-embed="true"] .sandbox-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(310px, 0.78fr);
  gap: 10px;
}

html[data-embed="true"] .sandbox-focus {
  gap: 8px;
  margin-bottom: 10px;
}

html[data-embed="true"] .sandbox-focus div {
  padding: 9px 10px;
}

html[data-embed="true"] .sandbox-focus strong {
  font-size: 0.8rem;
}

html[data-embed="true"] .sandbox-focus span {
  font-size: 0.82rem;
  line-height: 1.32;
}

html[data-embed="true"] .sandbox-editor-panel,
html[data-embed="true"] .sandbox-output-panel {
  gap: 10px;
  padding: 12px;
  box-shadow: none;
}

html[data-embed="true"] .sandbox-panel-head {
  gap: 10px;
}

html[data-embed="true"] .sandbox-panel-head h2 {
  margin-bottom: 3px;
  font-size: 1.08rem;
}

html[data-embed="true"] .sandbox-panel-head p,
html[data-embed="true"] .sandbox-help {
  font-size: 0.86rem;
  line-height: 1.35;
}

html[data-embed="true"] .sandbox-actions {
  gap: 8px;
}

html[data-embed="true"] .sandbox-actions .button {
  min-width: 76px;
  min-height: 48px;
  padding: 8px 12px;
  font-size: 0.92rem;
}

html[data-embed="true"] .sandbox-message-actions {
  gap: 8px;
}

html[data-embed="true"] .sandbox-message-actions .button {
  min-height: 48px;
  padding: 8px 10px;
  font-size: 0.9rem;
}

html[data-embed="true"] .sandbox-label {
  font-size: 0.92rem;
}

html[data-embed="true"] .code-editor {
  min-height: clamp(260px, 46vh, 430px);
  padding: 12px;
  font-size: 0.86rem;
  line-height: 1.45;
}

html[data-embed="true"] .test-message {
  min-height: 76px;
  padding: 10px;
  font-size: 0.9rem;
}

html[data-embed="true"] .output-frame {
  min-height: clamp(180px, 30vh, 270px);
}

html[data-embed="true"] .output-toolbar {
  min-height: 40px;
  padding: 6px 10px;
}

html[data-embed="true"] .sandbox-output {
  min-height: clamp(132px, 24vh, 220px);
  max-height: 30vh;
  padding: 12px;
  font-size: 0.86rem;
  line-height: 1.45;
}

html[data-embed="true"] .sandbox-checklist {
  padding: 12px;
  font-size: 0.9rem;
}

html[data-embed="true"] .sandbox-checklist h3 {
  font-size: 1rem;
}

html[data-embed="true"] .sandbox-api-panel {
  gap: 8px;
  padding-top: 10px;
}

html[data-embed="true"] .sandbox-api-head {
  gap: 8px;
}

html[data-embed="true"] .sandbox-api-head h3 {
  font-size: 0.98rem;
}

html[data-embed="true"] .sandbox-api-head p {
  font-size: 0.84rem;
  line-height: 1.32;
}

html[data-embed="true"] .model-pill {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 0.76rem;
}

html[data-embed="true"] .sandbox-secret-input {
  min-height: 48px;
  padding: 8px 10px;
  font-size: 0.86rem;
}

html[data-embed="true"] .api-key-row .button {
  min-height: 48px;
  padding: 8px 10px;
  font-size: 0.86rem;
}

html[data-embed="true"] .sandbox-error:not(:empty) {
  min-height: 38px;
  padding: 7px 9px;
  font-size: 0.84rem;
}

html[data-embed="true"] .live-ai-log {
  min-height: 86px;
  max-height: 180px;
  padding: 8px;
}

html[data-embed="true"] .live-bubble {
  padding: 8px 9px;
}

html[data-embed="true"] .live-speaker {
  font-size: 0.75rem;
}

html[data-embed="true"] .live-text {
  font-size: 0.84rem;
  line-height: 1.4;
}

html[data-embed="true"] .intent-chip-list,
html[data-embed="true"] .quick-tests,
html[data-embed="true"] .candidate-list,
html[data-embed="true"] .quick-profiles {
  gap: 6px;
}

html[data-embed="true"] .intent-chip-list span,
html[data-embed="true"] .candidate-list span {
  min-height: 36px;
  padding: 6px 8px;
  font-size: 0.82rem;
}

html[data-embed="true"] .quick-tests button,
html[data-embed="true"] .quick-profiles button {
  min-height: 44px;
  padding: 8px;
  font-size: 0.82rem;
}

html[data-embed="true"] .profile-grid {
  gap: 7px;
}

html[data-embed="true"] .profile-field {
  gap: 4px;
  font-size: 0.84rem;
}

html[data-embed="true"] .sandbox-select {
  min-height: 48px;
  padding-top: 9px;
  padding-bottom: 9px;
  font-size: 0.86rem;
}

@media (max-width: 960px) {
  .sandbox-hero,
  .sandbox-focus,
  .sandbox-workspace {
    grid-template-columns: 1fr;
  }

  .sandbox-panel-head {
    flex-direction: column;
  }

  .sandbox-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .sandbox-actions .button {
    flex: 1 1 110px;
  }

  html[data-embed="true"] .sandbox-hero,
  html[data-embed="true"] .sandbox-focus,
  html[data-embed="true"] .sandbox-workspace {
    grid-template-columns: 1fr;
  }

  html[data-embed="true"] .sandbox-panel-head {
    flex-direction: row;
  }
}

@media (max-width: 640px) {
  .sandbox-shell {
    width: min(100% - 20px, 1240px);
    padding-top: 14px;
  }

  .sandbox-editor-panel,
  .sandbox-output-panel {
    padding: 14px;
  }

  .code-editor {
    min-height: 430px;
    font-size: 0.88rem;
  }

  .sandbox-output {
    font-size: 0.88rem;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .quick-profiles button {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
  }

  html[data-embed="true"] .sandbox-shell {
    width: min(100% - 12px, 1240px);
    padding-top: 8px;
  }

  html[data-embed="true"] .sandbox-hero {
    gap: 8px;
  }

  html[data-embed="true"] .sandbox-hero h1 {
    font-size: 1.35rem;
  }

  html[data-embed="true"] .sandbox-status-card {
    display: none;
  }

  html[data-embed="true"] .sandbox-panel-head {
    flex-direction: column;
  }

  html[data-embed="true"] .sandbox-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  html[data-embed="true"] .sandbox-actions .button {
    width: 100%;
    min-width: 0;
    padding-right: 6px;
    padding-left: 6px;
  }

  html[data-embed="true"] .sandbox-message-actions {
    grid-template-columns: 1fr;
  }

  html[data-embed="true"] .sandbox-api-head {
    flex-direction: column;
  }

  html[data-embed="true"] .model-pill {
    width: 100%;
  }

  html[data-embed="true"] .code-editor {
    min-height: 300px;
    font-size: 0.82rem;
  }

  html[data-embed="true"] .test-message {
    min-height: 72px;
  }

  html[data-embed="true"] .output-frame {
    min-height: 190px;
  }

  html[data-embed="true"] .sandbox-output {
    min-height: 140px;
    max-height: 230px;
    font-size: 0.82rem;
  }

  html[data-embed="true"] .quick-tests button {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
  }

  html[data-embed="true"] .profile-grid {
    grid-template-columns: 1fr;
  }

  html[data-embed="true"] .quick-profiles button {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
  }
}
