/* Live editor workspace. Tokens come from admin-base.css (.wpagently-admin);
   this file must not define colours of its own. */

.wpagently-live-editor-page {
  color: var(--wpa-text);
  max-width: 1600px;
}

.wpagently-live-editor-page > .description {
  color: var(--wpa-muted);
  font-size: 14px;
  max-width: 920px;
}

.wpagently-live-editor-controls {
  align-items: center;
  background: var(--wpa-surface);
  border: 1px solid var(--wpa-border);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
  padding: 14px;
}

.wpagently-live-editor-controls label {
  font-weight: 600;
}

#wpagently-live-editor-status {
  color: var(--wpa-safe);
  flex: 1 1 260px;
}

#wpagently-live-editor-status.has-error {
  color: var(--wpa-risk);
}

.wpagently-live-editor-workspace {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(320px, 1fr) minmax(640px, 3fr);
}

.wpagently-live-editor-workspace[hidden] {
  display: none;
}

.wpagently-live-editor-actions,
.wpagently-live-editor-frame-panel {
  background: var(--wpa-surface);
  border: 1px solid var(--wpa-border);
  border-radius: 8px;
  min-width: 0;
  overflow: hidden;
}

.wpagently-live-editor-actions {
  height: 760px;
  overflow-y: auto;
  padding: 16px;
}

.wpagently-live-editor-actions h2 {
  margin-top: 0;
}

.wpagently-live-editor-session {
  color: var(--wpa-accent);
  font-family: var(--wpa-font-mono);
  font-size: 12px;
  font-weight: 600;
}

.wpagently-live-editor-action {
  border: 1px solid var(--wpa-border-strong);
  border-radius: 8px;
  margin-top: 12px;
  padding: 13px;
}

.wpagently-live-editor-action h3 {
  font-size: 14px;
  margin: 0 0 8px;
}

.wpagently-live-editor-action p {
  overflow-wrap: anywhere;
}

.wpagently-live-editor-action pre {
  background: var(--wpa-term-bg);
  border-radius: var(--wpa-radius-sm);
  color: var(--wpa-term-text);
  font-family: var(--wpa-font-mono);
  font-size: 11px;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  white-space: pre-wrap;
}

.wpagently-live-editor-action-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.wpagently-live-editor-action-status {
  color: var(--wpa-muted);
  margin-bottom: 0;
}

.wpagently-live-editor-action.is-completed {
  border-left: 4px solid var(--wpa-safe);
}

.wpagently-live-editor-action.is-denied,
.wpagently-live-editor-action.has-error {
  border-left: 4px solid var(--wpa-risk);
}

.wpagently-live-editor-frame-panel {
  display: flex;
  flex-direction: column;
  height: 760px;
}

.wpagently-live-editor-frame-status {
  border-bottom: 1px solid var(--wpa-border);
  color: var(--wpa-muted);
  min-height: 20px;
  padding: 10px 12px;
}

#wpagently-live-editor-frame {
  background: var(--wpa-surface);
  border: 0;
  flex: 1;
  min-height: 0;
  width: 100%;
}

@media (max-width: 1180px) {
  .wpagently-live-editor-workspace {
    grid-template-columns: 1fr;
  }

  .wpagently-live-editor-actions,
  .wpagently-live-editor-frame-panel {
    height: 620px;
  }
}

@media (max-width: 782px) {
  .wpagently-live-editor-controls {
    align-items: stretch;
    flex-direction: column;
  }
}
