.csp-body {
  padding-top: var(--ts-header-h);
}

.csp-main {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
  align-content: start;
  margin-left: var(--ts-sidebar-w);
  padding: 24px 24px 64px;
  transition: margin-left 0.36s var(--ts-ease);
}

.csp-body.is-panel-collapsed .csp-main {
  margin-left: 0;
}

@media (max-width: 900px) {
  .csp-main {
    margin-left: 0;
  }
}

/*
============================================================================
   SIDEBAR CONTENTS
============================================================================
*/
.csp-inject {
  width: 100%;
}

.csp-status {
  margin: 2px 0 0;
  font-family: var(--ts-mono);
  font-size: var(--ts-fs-sm);
  color: var(--ts-accent);
}
.csp-status:empty {
  display: none;
}
.csp-inject[aria-busy="true"]::before {
  content: "";
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: csp-spin 0.8s linear infinite;
}
@keyframes csp-spin {
  to {
    transform: rotate(360deg);
  }
}

.csp-policy {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--ts-border);
  border-radius: 8px;
  background: var(--ts-surface);
  font-family: var(--ts-mono);
  font-size: var(--ts-fs-sm);
  line-height: 1.7;
  color: var(--ts-ink-soft);
  overflow-x: auto;
}
.csp-policy-line {
  display: flex;
  align-items: center;
  gap: 8px;
}
.csp-policy b {
  color: var(--ts-warning);
  font-weight: 600;
}

.csp-violations-note {
  margin-bottom: 10px;
}

/*
============================================================================
   TAGS
============================================================================
*/
.csp-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  font-family: var(--ts-font);
  font-size: var(--ts-fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.csp-tag--muted {
  color: var(--ts-muted);
  background: var(--ts-surface-2);
}
.csp-tag--warning {
  color: var(--ts-warning);
  background: color-mix(in srgb, var(--ts-warning) 12%, transparent);
}
.csp-tag--error {
  color: var(--ts-error);
  background: var(--ts-error-bg);
}

/*
============================================================================
   CARDS
============================================================================
*/
.csp-card {
  background: var(--ts-surface);
  border: 1px solid var(--ts-border);
  border-radius: var(--ts-radius);
  padding: 18px 20px 20px;
}

.csp-h {
  margin: 0 0 6px;
  font-size: var(--ts-fs-lg);
  font-weight: 600;
  letter-spacing: 0.01em;
}

code {
  font-family: var(--ts-mono);
  font-size: 0.88em;
  background: var(--ts-surface-2);
  padding: 0.1em 0.34em;
  border-radius: 4px;
}

/*
============================================================================
   CHECK / VIOLATION ROWS
============================================================================
*/
.csp-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  gap: 1px;
  background: var(--ts-border);
  border: 1px solid var(--ts-border);
  border-radius: 8px;
  overflow: hidden;
}

.csp-list li {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 4px 12px;
  align-items: baseline;
  padding: 11px 14px;
  background: var(--ts-surface);
  font-size: var(--ts-fs-base);
}

.csp-list li::before {
  grid-row: 1 / span 2;
  align-self: start;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: var(--ts-fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.csp-list li.pass::before {
  content: "pass";
  color: var(--ts-success);
  background: color-mix(in srgb, var(--ts-success) 12%, transparent);
}

.csp-list li.fail::before {
  content: "fail";
  color: var(--ts-error);
  background: var(--ts-error-bg);
}

.csp-list li.pending::before {
  content: "pending";
  color: var(--ts-warning);
  background: color-mix(in srgb, var(--ts-warning) 12%, transparent);
}

.csp-list li.muted::before {
  content: "none";
  color: var(--ts-muted);
  background: var(--ts-surface-2);
}

.csp-list li.fail {
  background: var(--ts-error-bg);
}

.csp-list .csp-detail {
  grid-column: 2;
  font-size: var(--ts-fs-md);
  line-height: 1.5;
  color: var(--ts-muted);
}

.csp-list li.csp-violation {
  grid-template-columns: 1fr;
  gap: 4px;
  font-family: var(--ts-mono);
  font-size: var(--ts-fs-sm);
  align-items: baseline;
}

.csp-list li.csp-violation::before {
  content: none;
}

.csp-violation-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.csp-directive {
  font-weight: 600;
  white-space: nowrap;
}

.csp-blocked {
  color: var(--ts-muted);
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.csp-violation--expected .csp-directive {
  color: var(--ts-muted);
  font-weight: 500;
}

.csp-violation--unexpected {
  background: var(--ts-error-bg);
}

.csp-violation--unexpected .csp-directive {
  color: var(--ts-error);
}

/*
============================================================================
   SPECIMEN
============================================================================
*/
.csp-card > .uoa-field-note {
  margin-top: 2px;
}

.csp-scroll {
  overflow-x: auto;
  margin-top: 10px;
}

.csp-specimen {
  border-collapse: collapse;
  width: 100%;
  min-width: 640px;
}

.csp-specimen th {
  text-align: left;
  padding: 0 12px 8px 0;
  border-bottom: 1px solid var(--ts-border);
  font-size: var(--ts-fs-xs);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ts-muted);
  white-space: nowrap;
}

.csp-specimen td {
  padding: 11px 12px 11px 0;
  border-bottom: 1px solid var(--ts-border);
  vertical-align: baseline;
}

.csp-specimen tr:last-child td {
  border-bottom: 0;
}

.csp-specimen .stack-name {
  font-family: var(--ts-mono);
  font-size: var(--ts-fs-sm);
  color: var(--ts-ink-soft);
  white-space: nowrap;
}

.csp-specimen .stack-resolved {
  display: block;
  margin-top: 2px;
  font-size: var(--ts-fs-xs);
  color: var(--ts-muted);
  white-space: normal;
}

.csp-specimen .sample {
  font-size: var(--ts-fs-lg);
  color: var(--ts-ink);
  white-space: nowrap;
}

.csp-specimen .width,
.csp-specimen .delta {
  font-family: var(--ts-mono);
  font-size: var(--ts-fs-sm);
  font-variant-numeric: tabular-nums;
  color: var(--ts-ink-soft);
  text-align: right;
  white-space: nowrap;
}

.csp-specimen .delta.is-distinct {
  color: var(--ts-success);
  font-weight: 600;
}

.csp-specimen .delta.is-same {
  color: var(--ts-error);
  font-weight: 600;
}

.csp-specimen tr.sentinel {
  background: var(--ts-surface-2);
}

.csp-specimen tr.sentinel .stack-name {
  color: var(--ts-muted);
}

/*
============================================================================
   FIXTURE TILES
============================================================================
*/
.csp-fixtures {
  --csp-frame-w: 380px;
  display: grid;
  gap: 20px;
  margin-top: 10px;
}

.csp-fixtures:empty::after {
  content: "nothing injected yet";
  display: grid;
  place-items: center;
  width: var(--csp-frame-w);
  max-width: 100%;
  min-height: 120px;
  border: 1px dashed var(--ts-border-strong);
  border-radius: 12px;
  font-size: var(--ts-fs-md);
  font-style: italic;
  color: var(--ts-muted);
}

.csp-fixture-group-title {
  margin: 0 0 8px;
  font-size: var(--ts-fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ts-muted);
}

.csp-fixture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, calc(var(--csp-frame-w) + 2px));
  gap: 12px;
}

.csp-fixture {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.csp-fixture-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.csp-fixture-label {
  font-size: var(--ts-fs-sm);
  font-weight: 500;
  color: var(--ts-ink-soft);
}

.csp-fixture-count {
  margin-left: auto;
  font-family: var(--ts-mono);
  font-size: var(--ts-fs-xs);
  color: var(--ts-muted);
}

.csp-fixture-note {
  margin: 0;
  font-size: var(--ts-fs-xs);
  line-height: 1.45;
  color: var(--ts-muted);
}

/* Frames: the surface each fixture has in the widget. */
.csp-frame {
  width: calc(var(--csp-frame-w) + 2px);
  max-width: 100%;
  border: 1px solid var(--ts-border-strong);
  border-radius: 12px;
  overflow: hidden;
}

.csp-frame--page {
  background: var(--ts-bg);
}
/*
 * `transform` makes the stage the containing block for the launch popup's
 * `position: fixed`, and the launcher size it reads is the rest size, so its
 * offsets land it above the launcher as they do on the host page.
 */
.csp-frame--page .csp-fixture-stage {
  --watson-launch-icon-size: 54px;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  min-height: 236px;
  padding: var(--watson-launch-icon-inset, 32px);
  transform: translateZ(0);
}

.csp-frame--header {
  border-color: var(--watson-color-primary, #1f2bd4);
  background: var(--watson-color-primary, #1f2bd4);
}
.csp-frame--header .csp-fixture-stage {
  display: flex;
  align-items: center;
  height: 60px;
  padding: 12px;
}

.csp-frame--body {
  background: #fff;
}
.csp-frame--body .csp-fixture-stage {
  padding: 20px 24px;
}

.csp-fixture-stage {
  position: relative;
  isolation: isolate;
  min-width: 0;
}

/* Two states of one component, stacked and captioned. */
.csp-state + .csp-state {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--ts-border);
}
.csp-state-label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--ts-mono);
  font-size: var(--ts-fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ts-muted);
}

/*
 * Stand-in for IBM's box model. Layout and shape only; every colour, font
 * and icon size in these stages still comes from the bundle.
 */
.csp-fixture-stage .chatButton {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
}

.csp-fixture-stage .wxoLiteHeaderContainer {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
}
.csp-fixture-stage .wxoLiteHeaderTitle {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}
.csp-fixture-stage .avatar-line,
.csp-fixture-stage .avatarWrapper,
.csp-fixture-stage .wxoLiteHeaderActions {
  display: flex;
  align-items: center;
}
.csp-fixture-stage .agentAvatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 100%;
  overflow: hidden;
}
.csp-fixture-stage .sender-name {
  font-family: var(--watson-font-family, inherit);
  white-space: nowrap;
}
.csp-frame--header .sender-name {
  color: #fff;
}
.csp-frame--body .sender-name {
  margin-left: 4px;
}
.csp-fixture-stage .cds--btn--icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.csp-fixture-stage .WxOChat-welcome-component__message-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 300px;
  font-family: var(--watson-font-family, inherit);
}
/* The popover opens downward; putting the label last keeps the copy legible. */
.csp-fixture-stage
  .WxOChat-welcome-component__message-header
  > ai-label-button {
  order: 2;
}

.csp-fixture-stage .WxOChatRichTextComponent_content--layout {
  font-family: var(--watson-font-family, inherit);
  font-size: 14px;
}

.csp-fixture-stage .feedback-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}
.csp-fixture-stage .feedback-buttons-positive,
.csp-fixture-stage .feedback-buttons-negative {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  cursor: pointer;
}

/*
 * `overrides/feedback.css` pulls the panel left by 35px to align it with a
 * message body; the extra stage padding gives it that room to move into.
 */
.csp-fixture[data-fixture="Feedback panel"] .csp-fixture-stage {
  padding-left: 59px;
}
.csp-fixture-stage .stepContainer {
  width: 100%;
}
.csp-fixture-stage .feedback-panel {
  padding: 16px;
  border-radius: 8px;
  background: #fff;
  font-family: var(--watson-font-family, inherit);
}
.csp-fixture-stage .feedback-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.csp-fixture-stage .feedback-close-button {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
}
