/* Step 3 of the sales panel (views/creator-video-life.js, docs/prd-creator-sales-step3.md
   Part 2): "Paid promotion" under the order cards, and a video's days in a row that opens
   under it. Every rule is .cp-ads-*, .cp-life-* or .cp-ord-open.

   The chart's two oranges were checked for colour-blind readers on both themes' surfaces
   (through ads #dd6c35, the rest #a2421a: lightness band, contrast, CVD ΔE 15). Through ads
   sits at the base of each bar, so its share reads from one baseline. */

.cp-ord { --life-ads: #dd6c35; --life-rest: #a2421a; --life-spend: #8d97a5; --life-none: color-mix(in srgb, var(--muted) 40%, transparent); }

/* Paid promotion: the order cards' frame, with a split bar and its key. */
.cp-ads { margin-bottom: 12px; }
.cp-ads .cp-ord-bh { flex-wrap: wrap; }
.cp-ads-split { display: flex; gap: 2px; height: 10px; margin: 12px 0 6px; border-radius: 3px; overflow: hidden; }
.cp-ads-split .p-rest { background: var(--life-none); }
.cp-ads-split .p-ads.t-c0, .cp-ads-keys i.p-ads.t-c0 { background: var(--tt-c0); }
.cp-ads-split .p-ads.t-c1, .cp-ads-keys i.p-ads.t-c1 { background: var(--tt-c1); }
.cp-ads-keys { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 4px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cp-ads-keys > span { display: inline-flex; align-items: center; gap: 6px; }
.cp-ads-keys i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; }
.cp-ads-keys i.p-rest { background: var(--life-none); }
.cp-ads-keys .k { color: var(--muted); }

/* A video's open button, before its thumbnail. */
.cp-ord-open {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0;
  border: 1px solid var(--border); border-radius: 6px; background: none; color: var(--muted); cursor: pointer;
}
.cp-ord-open svg path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cp-ord-open svg { transition: transform .15s; }
.cp-ord-open[aria-expanded="true"] { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
.cp-ord-open[aria-expanded="true"] svg { transform: rotate(90deg); }
.cp-ord-open:hover { color: var(--text); }
.cp-ord-open:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .cp-ord-open svg { transition: none; } }

/* A LIVE or video CREA promoted: a quiet tag under its name, the spend's grey as its key. */
.cp-ord-ad {
  display: inline-flex; align-items: center; gap: 5px; width: fit-content; margin-top: 3px; padding: 0 7px; border-radius: 999px;
  border: 1px solid var(--border); font-size: 11.5px; color: var(--muted); white-space: nowrap;
}
.cp-ord-ad::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--life-spend); }

/* The opened row. */
.cp-ord-table tr.cp-life-row > td { padding: 0; }
.cp-life {
  display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; min-width: 0;
  background: color-mix(in srgb, var(--text) 3%, var(--surface)); border-top: 1px solid var(--border);
}
.cp-life .cp-note { margin: 0; }
.cp-life-h { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.cp-life-t { font-size: 13px; font-weight: 600; }
.cp-life-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px 16px; }
.cp-life-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cp-life-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.cp-life-legend .k { color: var(--muted); }
.cp-life-key { display: inline-block; width: 9px; height: 9px; border-radius: 2px; }
.cp-life-key.p-ads { background: var(--life-ads); }
.cp-life-key.p-rest { background: var(--life-rest); }
.cp-life-key.p-spend { background: var(--life-spend); }

.cp-life-chart { position: relative; }
.cp-life-svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.cp-life-svg .p-ads { fill: var(--life-ads); }
.cp-life-svg .p-rest { fill: var(--life-rest); }
/* CREA's spend: one series in its own lane, a neutral grey so it never reads as part of the order value. */
.cp-life-svg .p-spend { fill: var(--life-spend); }
.cp-life-svg .axis { stroke: var(--muted); stroke-width: 1; opacity: .5; }
.cp-life-svg .lane-t { fill: var(--text); font-size: 11.5px; font-weight: 600; }
.cp-life-svg .grid { stroke: var(--border); stroke-width: 1; }
.cp-life-svg .tick, .cp-life-svg .band-t { fill: var(--muted); font-size: 10.5px; }
.cp-life-svg .band { fill: color-mix(in srgb, var(--text) 5%, transparent); }
.cp-life-svg .hit { fill: transparent; cursor: crosshair; }
.cp-life-svg .hit:hover { fill: color-mix(in srgb, var(--text) 6%, transparent); }
.cp-life-tip {
  position: absolute; z-index: 2; display: flex; flex-direction: column; gap: 1px; min-width: 150px; padding: 8px 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow);
  font-size: 12px; font-variant-numeric: tabular-nums; pointer-events: none;
}
.cp-life-tip[hidden] { display: none; }
.cp-life-tip .d { font-weight: 600; }

.cp-life-days summary { width: fit-content; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.cp-life-days summary:hover { color: var(--text); }
.cp-life-days .cp-tt-tablebox { margin-top: 6px; max-height: 260px; overflow: auto; }
.cp-life-days td.r, .cp-life-days th.r { text-align: right; }
