/* Experiments tab (experiments.js): experiment cards in the gutter, the
   selected one's write-up under four fixed headers on the right. */

.xp-rail {
  --xp-line: #34d399;
}

.xp-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 12px 24px;
}

/* An experiment: like a planning angle card, its variants in place of drafts. */
.xp-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 10px 10px 10px 12px;
  border: 1px solid #333335;
  border-radius: 14px;
  background: #171717;
  color: #fff;
  cursor: pointer;
  outline: none;
}

/* Draft: dashed grey, as planning's drafts. Live: solid grey. */
.xp-card.is-draft {
  border-style: dashed;
}

.xp-card:hover {
  border-color: #4a4a4d;
}

.xp-card.is-selected {
  border-color: #8e8e93;
}

.xp-card:focus-visible {
  box-shadow: 0 0 0 2px #2c2c2e;
}

.xp-card-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.xp-card-title {
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 2px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.xp-card-title.is-blank,
.xp-variant-name.is-blank {
  color: #6e6e73;
}

/* The goal metric(s), top right (left of a draft's options). */
.xp-card .xp-goal-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 3px;
}

.xp-goal-chip svg {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  stroke-width: 2;
}

/* The card's options: flat, just the icon. */
.xp-card-options {
  appearance: none;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.xp-card-options:hover,
.xp-card-options[aria-expanded="true"] {
  background: #222222;
  color: #fff;
}

.xp-card-options svg {
  width: 15px;
  height: 15px;
}

/* The hypothesis, under the title. */
.xp-card-hyp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  color: #8e8e93;
  font-size: 0.78rem;
  line-height: 1.45;
}

/* The Outcome, under the hypothesis. */
.xp-card-outcome {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  color: var(--xp-line);
  font-size: 0.78rem;
  line-height: 1.45;
}

.xp-variants {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 2px;
}

.xp-variant-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  outline: none;
}

.xp-card.is-selected .xp-variant-name,
.xp-card.is-selected .xp-card-title {
  cursor: text;
}

.xp-card-title.is-editing,
.xp-variant-name.is-editing {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  color: #fff;
  cursor: text;
}

/* ---- The write-up ---- */

.xp-sec {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  cursor: text;
}

.xp-sec:first-of-type {
  margin-top: 0;
}

/* Fixed: not part of the text, so it can't be edited or deleted. */
.xp-sec-title {
  margin: 0;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  user-select: none;
}

/* Under Interpreting Results: the plan above, what happened below. */
.xp-divider {
  height: 0;
  margin: 18px 0 4px;
  border: 0;
  border-top: 1px solid #2a2a2c;
}

.xp-sec[hidden],
.xp-divider[hidden] {
  display: none;
}

/* Live: the plan's sections only read. */
.xp-sec.is-readonly {
  cursor: default;
}

.xp-sec .xp-sec-body {
  flex: 0 0 auto;
  min-height: 0;
}

.xp-sec .xp-sec-body .cm-content {
  padding-bottom: 4px !important;
}

.xp-doc .notes-doc-inner {
  gap: 10px;
}

/* No experiment yet (or none picked). */
.xp-empty {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
}

.xp-doc.is-empty .xp-empty {
  display: flex;
}

.xp-doc.is-empty .notes-doc-scroll {
  display: none;
}

.xp-empty-new {
  appearance: none;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #1b1b1b;
  color: #fff;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.xp-empty-new:hover {
  background: #242424;
}

/* The experiment block: every variant shows, empty ones without the Logs
   block's "Move creatives here". */
.xp-block .note-exp-group-empty {
  display: none;
}

/* ---- Variants: a header each, its creatives under it ---- */

.xp-vgroup {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.xp-vhead {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 2px;
  color: #8e8e93;
  font-size: 0.78rem;
  font-weight: 600;
}

.xp-vhead .xp-variant-name.is-editing {
  color: #fff;
}

/* A creative: thumb, id, name, −. Solid when live, dashed while a draft. */
.xp-member {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px 4px 4px 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: #151516;
  font-size: 0.86rem;
  font-weight: 500;
}

.xp-member.is-pending {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.16);
}

.xp-member-thumb {
  flex: 0 0 auto;
  width: 18px;
  height: 24px;
  border-radius: 4px;
  background: #262626;
  object-fit: cover;
}

.xp-member-thumb.is-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6e6e73;
}

.xp-member-thumb.is-empty svg {
  width: 11px;
  height: 11px;
}

.xp-member-id {
  flex: 0 0 auto;
  font-family: var(--font-id);
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--text-muted);
}

.xp-member-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Remove: red, as every destructive control. */
.xp-member-remove {
  appearance: none;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: none;
  color: #f08a80;
  opacity: 0.7;
  cursor: pointer;
}

.xp-member-remove:hover {
  opacity: 1;
  background: #342425;
}

.xp-member-remove svg {
  width: 13px;
  height: 13px;
}

.xp-member-empty {
  padding: 2px 2px 0;
  color: #4a4a4c;
  font-size: 0.78rem;
}

/* A live variant's goal metric, in its color against the account: dark text
   on it. Grey until there's something to measure. */
.xp-metric-chip {
  margin-left: 8px;
}

.xp-metric-chip.is-colored {
  color: #141414;
}

/* Live rows end in the funnel chip, lined up with the header's chip. */
.xp-card.is-live .xp-member {
  padding-right: 6px;
}
