.adv-library-toolbar {
  padding: 16px;
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}
.adv-library-bulk, .adv-set-head, .adv-creative-head, .adv-dialog-head {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}
.adv-library-bulk > label {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.adv-library-bulk input[type=checkbox], .adv-creative-head input[type=checkbox] {
  width: 17px;
  height: 17px;
  accent-color: var(--blue);
  flex: 0 0 auto;
}
.adv-counts, .adv-muted, .adv-creative-name small, .adv-set-head small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.adv-bulk-actions, .adv-dialog-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.adv-library-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
  gap: 10px;
}
.adv-library-filters > :first-child { grid-column: span 2; }
.adv-library-toolbar [hidden] { display: none; }
.adv-poster-radio { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); }
.adv-poster-radio input { width: 16px; height: 16px; accent-color: var(--blue); }
.adv-library-list, .adv-set-list { display: grid; gap: 14px; }
.adv-creative-card { min-width: 0; overflow: hidden; }
.adv-creative-head { border-bottom: 1px solid var(--line); padding: 13px 15px; }
.adv-creative-name { min-width: 0; flex: 1; }
.adv-creative-name h3, .adv-set-head h3 { margin: 0; font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.adv-card-meta { display: flex; flex-wrap: wrap; gap: 6px; max-width: 45%; justify-content: flex-end; }
.adv-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 5px;
  white-space: normal;
}
.adv-amber { color: var(--amber); }
.adv-creative-grid {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(170px, 1.3fr) minmax(160px, 1fr) minmax(125px, 145px);
  gap: 14px;
  padding: 15px;
  align-items: stretch;
}
.adv-media { min-width: 0; min-height: 175px; background: #191a1c; border: 1px solid var(--line-soft); border-radius: 8px; overflow: hidden; display: grid; place-items: center; }
.adv-media img, .adv-media video { width: 100%; height: 100%; max-height: 290px; object-fit: contain; display: block; }
.adv-media-empty { min-height: 165px; display: grid; place-content: center; text-align: center; gap: 5px; color: var(--muted); font-size: 12px; padding: 10px; }
.adv-media-empty b { font-weight: 500; color: var(--text); }
.adv-copy { min-width: 0; display: grid; gap: 7px; align-items: stretch; }
.adv-copy > div {
  background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 6px;
  padding: 9px 11px; min-width: 0; 
}
.adv-copy b, .adv-card-stats-title { font-size: 11px; color: var(--muted); font-weight: 500; }
.adv-copy p { margin: 4px 0 0; color: var(--text); font-size: 12px; line-height: 1.5; max-height: 6.2em; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.adv-card-stats { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; align-self: start; min-width: 0; }
.adv-card-stats-title { padding: 9px 11px; }
.adv-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.adv-metrics > div { min-width: 0; padding: 9px 6px; border-top: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); text-align: center; }
.adv-metrics > div:nth-child(3n) { border-right: 0; }
.adv-metrics > div:last-child { grid-column: 1/-1; border-right: 0; }
.adv-metrics small, .adv-metrics b { display: block; font-variant-numeric: tabular-nums; }
.adv-metrics small { font-size: 10px; color: var(--muted); }
.adv-metrics b { margin-top: 3px; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; color: var(--text); }
.adv-card-actions { display: flex; flex-direction: column; gap: 8px; align-self: center; }
.adv-card-actions .btn { font-size: 11px; min-height: 32px; white-space: normal; }
.adv-danger { border: 1px solid rgba(240,120,123,.28); background: rgba(240,120,123,.06); color: var(--red); }
.adv-danger:hover { border-color: var(--red); }
.adv-archived { opacity: .75; }
.adv-library-dialog {
  padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  color: var(--text); width: min(880px, calc(100vw - 32px)); max-width: none;
  max-height: calc(100dvh - 40px); overflow-y: auto; z-index: 50;
  box-shadow: 0 20px 80px rgba(0,0,0,.5);
}
.adv-library-dialog::backdrop { background: rgba(0,0,0,.65); }
.adv-launch-choice { width: min(580px,calc(100vw - 28px)); }
.adv-launch-choice-body { display: grid; gap: 12px; padding: 18px 20px 20px; }
.adv-launch-choice-summary { margin: 0; font-size: 12px; color: var(--muted); }
.adv-launch-choice-step { color: var(--text); font-size: 14px; font-weight: 600; }
.adv-launch-choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.adv-launch-choice .adv-launch-option { display: grid; align-content: start; justify-items: start; gap: 5px; text-align: left;
  white-space: normal; min-height: 82px; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; background: var(--surface-2); }
.adv-launch-choice .adv-launch-option:hover { border-color: var(--blue); background: var(--blue-soft); }
.adv-launch-option strong, .adv-launch-option small { font-weight: 500; line-height: 1.45; }
.adv-launch-option small { font-size: 11px; font-weight: 400; }
.adv-launch-choice-note { margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: 12px; }
.adv-launch-choice-materials { max-height: min(300px,40dvh); overflow-y: auto; display: grid; gap: 6px; }
.adv-launch-material { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.adv-launch-material span { min-width: 0; overflow-wrap: anywhere; }
.adv-launch-material input { flex-shrink: 0; }
.adv-launch-material strong, .adv-launch-material small { display: block; font-weight: 400; }
.adv-launch-choice-actions { display: flex; justify-content: space-between; gap: 10px; }
@media (max-width: 480px) { .adv-launch-choice-grid { grid-template-columns: minmax(0,1fr); } }
.adv-dialog-head { padding: 17px 20px; position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 1; }
.adv-dialog-head h2 { font-size: 19px; margin: 0; font-weight: 500; }
.adv-library-form { display: grid; gap: 14px; padding: 18px 20px 20px; }
.adv-dialog-actions { padding-top: 6px; }
.adv-drop { border: 1px dashed var(--line); background: #1e2022; padding: 28px 18px; text-align: center; border-radius: 8px; display: grid; gap: 7px; cursor: pointer; }
.adv-drop:hover, .adv-drop.dragging { border-color: var(--blue); background: var(--blue-soft); }
.adv-drop b { font-size: 14px; font-weight: 500; }
.adv-drop small, .adv-file-row small, .adv-edit-fields small { color: var(--muted); font-size: 11px; }
.adv-drop input { margin: 3px auto; max-width: 100%; }
.adv-file-list { display: grid; gap: 8px; }
.adv-file-row {
  display: grid; grid-template-columns: minmax(110px, 1fr) minmax(150px, 1.5fr) minmax(80px, auto) auto;
  align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 7px; padding: 10px; min-width: 0;
}
.adv-file-row b, .adv-file-row small { display: block; overflow-wrap: anywhere; }
.adv-file-row b { font-size: 12px; font-weight: 500; }
.adv-file-row small { margin-top: 3px; }
.adv-dialog-error { color: var(--red); font-size: 12px; overflow-wrap: anywhere; }
.adv-dialog-error:empty { display: none; }
.adv-edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 17px; }
.adv-edit-media { align-self: start; min-height: 210px; }
.adv-edit-media img, .adv-edit-media video { max-height: 510px; }
.adv-edit-fields { display: grid; gap: 11px; min-width: 0; }
.adv-library-form textarea { resize: vertical; padding: 9px 11px; min-width: 0; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 7px; font: inherit; width: 100%; }
.adv-upload-copy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px; }
.adv-upload-copy .adv-wide { grid-column: 1/-1; }
.adv-library-form [hidden] { display: none; }
.adv-library-form .field span, .adv-library-filters .field span { color: var(--muted); font-size: 12px; }
.adv-set-card { padding: 16px; display: grid; gap: 14px; }
.adv-set-head small { display: inline-block; margin-top: 4px; }
.adv-set-variants { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px,1fr)); gap: 9px; }
.adv-set-variants > div { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--line-soft); padding: 12px; border-radius: 7px; min-width: 0; }
.adv-set-variants img { width: 48px; height: 56px; border-radius: 4px; object-fit: contain; background: #191a1c; }
.adv-set-variants b, .adv-set-variants small { display: block; overflow-wrap: anywhere; font-weight: 400; }
.adv-set-variants b { font-size: 13px; color: var(--text); }
.adv-set-variants small { font-size: 11px; color: var(--muted); margin-top: 4px; }
.adv-set-form-top, .adv-retailers { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.adv-variant-list { display: grid; gap: 9px; }
.adv-set-variant { background: var(--surface-2); padding: 12px; border-radius: 8px; border: 1px solid var(--line); display: grid; grid-template-columns: minmax(120px, 1fr) minmax(135px, 1.3fr) minmax(135px, 1.8fr) auto; align-items: end; gap: 10px; min-width: 0; }
.adv-variant-order { align-self: center; color: var(--muted); font-size: 12px; }
.adv-variant-order b { color: var(--cyan); font-weight: 500; }
@media (max-width: 1150px) {
  .adv-creative-grid { grid-template-columns: 150px minmax(170px, 1fr) minmax(160px, .9fr); }
  .adv-card-actions { grid-column: 1/-1; flex-direction: row; align-items: stretch; flex-wrap: wrap; }
  .adv-card-actions .btn { flex: 1 1 100px; }
}
@media (max-width: 760px) {
  .adv-library-bulk, .adv-creative-head, .adv-dialog-head { flex-wrap: wrap; }
  .adv-library-bulk .adv-counts { flex: 1 1 200px; }
  .adv-bulk-actions { width: 100%; justify-content: space-between; }
  .adv-bulk-actions .btn { flex: 1; }
  .adv-library-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adv-creative-grid { grid-template-columns: 1fr 1fr; gap: 10px; padding: 11px; }
  .adv-media { min-height: 120px; }
  .adv-media img, .adv-media video { max-height: 250px; }
  .adv-copy { align-content: start; }
  .adv-copy p { max-height: 4.4em; }
  .adv-card-stats { grid-column: 1/-1; }
  .adv-card-meta { justify-content: flex-start; max-width: 100%; margin-left: 29px; flex-basis: 100%; }
  .adv-edit-grid { grid-template-columns: 1fr; }
  .adv-edit-media { max-height: 240px; }
  .adv-edit-media img, .adv-edit-media video { max-height: 238px; }
  .adv-file-row { grid-template-columns: minmax(0,1fr) auto; gap: 6px; }
  .adv-file-row > label { grid-row: 2; grid-column: 1/-1; }
  .adv-set-variant { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .adv-variant-order { grid-column: 1/-1; }
  .adv-set-variant button { grid-column: 2; }
  .adv-library-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 20px); }
  .adv-dialog-head, .adv-library-form { padding: 14px; }
  .adv-library-toolbar { padding: 11px; }
}

/* Creative library: a single compact table. These rules are scoped to the
   library so the set lists, upload forms and existing dialogs keep their layout. */
.main-content:has(.ct-creative-heading) {
  padding-top: 15px;
  padding-inline: clamp(12px, 1.1vw, 22px);
}
.ct-icon {
  display: inline-block;
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  vertical-align: middle;
  color: inherit;
}
.ct-creative-heading.page-heading {
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
}
.ct-creative-heading h1 {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0;
  font-size: clamp(20px, 1.55vw, 26px);
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -.45px;
}
.ct-creative-heading h1 > .ct-icon { width: 25px; height: 25px; color: #329efa; }
.ct-creative-heading .ct-title { min-width: 0; overflow-wrap: anywhere; }
.ct-creative-heading .ct-count {
  display: inline-flex;
  align-items: center;
  border-radius: 18px;
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
  background: #222930;
  color: #dce5ef;
  flex: 0 0 auto;
}
.ct-creative-heading p { display: none; }
.ct-creative-heading .heading-actions { align-items: center; flex: 0 1 auto; gap: 7px; }
.ct-creative-heading .heading-actions .btn {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 11px;
  line-height: 1.2;
  border-radius: 7px;
}
.ct-creative-heading .heading-actions .btn-ghost { background: #181e24; border-color: #303943; }
.ct-creative-heading .heading-actions .btn-primary { background: #238af1; border-color: #308ff0; }
.ct-creative-heading .ct-period { width: auto; max-width: 100%; }
.ct-period select {
  appearance: none;
  max-width: 100%;
  padding: 6px 26px 6px 31px;
  min-height: 32px;
  border: 1px solid #303943;
  border-radius: 7px;
  background: #141b21;
  color: #d3dce6;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.ct-period select:hover { border-color: #455567; }
.ct-period select:focus-visible { outline: 2px solid #5197d3; outline-offset: 1px; }
.ct-period-dates {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 10.5rem));
  gap: 8px;
}
.ct-filters .ct-period-dates input { padding-inline: 9px; }
.ct-library-toolbar {
  container: ct-controls / inline-size;
  display: grid;
  min-width: 0;
  max-width: 100%;
  gap: 6px;
  margin: 0 0 13px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
}
.ct-filters {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(6, minmax(0, 1fr));
  gap: 10px clamp(7px, 1.05vw, 18px);
  grid-row: 1;
  align-items: end;
  min-width: 0;
}
.ct-filters:has(#adv-owner) { grid-template-columns: minmax(0, 1.4fr) repeat(7, minmax(0, 1fr)); }
.ct-filters > :first-child { grid-column: auto; }
.ct-filter {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 4px;
}
.ct-filter > span:first-child, .ct-filter > label, .ct-filter > .field-label {
  font-size: 11px;
  line-height: 1.3;
  font-weight: 400;
  color: #b7c1cc;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ct-filter-control {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  position: relative;
  line-height: 1.3;
}
.ct-filter-control > .ct-icon {
  position: absolute;
  z-index: 1;
  left: 9px;
  width: 15px;
  height: 15px;
  color: #a5b2c0;
  pointer-events: none;
}
.ct-filters .ct-filter input, .ct-filters .ct-filter select {
  width: 100%;
  height: 34px;
  min-height: 34px;
  min-width: 0;
  padding: 6px 22px 6px 30px;
  font-size: 11px;
  line-height: 1.3;
  background: #141b21;
  border: 1px solid #2d3640;
  border-radius: 7px;
  color: #e4e9ee;
  text-overflow: ellipsis;
}
.ct-filters .ct-filter input[type=search] { background: #1a2128; }
.ct-filters .ct-filter select { appearance: none; }
.ct-filter-control:has(> select)::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #aab5c1;
  border-bottom: 1.5px solid #aab5c1;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.ct-filters .ct-filter input:hover, .ct-filters .ct-filter select:hover { border-color: #455567; }
.ct-filters .ct-filter input:focus, .ct-filters .ct-filter select:focus { border-color: #5197d3; }
.ct-bulk {
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 5px 10px;
  min-height: 22px;
  min-width: 0;
  font-size: 11px;
  color: #aebac7;
}
.ct-bulk .adv-counts { font-size: 11px; color: #aebac7; line-height: 1.3; }
.ct-bulk-actions, .ct-bulk .adv-bulk-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}
.ct-bulk .btn { min-height: 25px; padding: 4px 8px; line-height: 1.2; font-size: 11px; }
.ct-library-toolbar [hidden], .ct-results [hidden] { display: none !important; }
.ct-library-toolbar #adv-metric-note { font-size: 11px; line-height: 1.35; }
.ct-select-all-mobile { display: none; }
.ct-results {
  --ct-row-color: #151b21;
  --ct-head-color: #1c242b;
  --ct-line: #27313a;
  --ct-total-color: #172837;
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid #27313b;
  border-radius: 11px;
  background: var(--ct-row-color);
  overflow: visible;
}
.adv-library-list:has(.ct-results) { min-width: 0; grid-template-columns: minmax(0, 1fr); gap: 0; }
.ct-table-wrap { container: ct-grid / inline-size; width: 100%; min-width: 0; max-width: 100%; overflow: visible; }
.ct-table {
  --ct-text-font: 11px;
  --ct-text-font: clamp(10px, .72cqw, 13px);
  --ct-metric-font: 11px;
  --ct-metric-font: clamp(9px, .75cqw, 13px);
  --ct-header-font: 10px;
  --ct-header-font: clamp(8px, .67cqw, 11px);
  --ct-gap: clamp(4px, .55cqw, 10px);
  --ct-hpad: clamp(3px, .55cqw, 10px);
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
/* Metric widths share the space between the identity and actions columns. */
.ct-table col.ct-col-identity { width: 22%; }
.ct-table.ct-readonly-table col.ct-col-identity, .ct-table:not(:has(.ct-col-actions)) col.ct-col-identity { width: 30.3%; }
.ct-table col.ct-col-actions { width: 8.3%; }
.ct-table col.ct-col-metric[data-metric="spend"] { width: 4.5%; }
.ct-table col.ct-col-metric[data-metric="impressions"] { width: 3.7%; }
.ct-table col.ct-col-metric[data-metric="cpm"] { width: 3.27%; }
.ct-table col.ct-col-metric[data-metric="clicks"] { width: 3.42%; }
.ct-table col.ct-col-metric[data-metric="cpc"] { width: 3.105%; }
.ct-table col.ct-col-metric[data-metric="ctr"] { width: 3.105%; }
.ct-table col.ct-col-metric[data-metric="leads"] { width: 2.79%; }
.ct-table col.ct-col-metric[data-metric="cpl"] { width: 3.15%; }
.ct-table col.ct-col-metric[data-metric="cr"] { width: 3.33%; }
.ct-table col.ct-col-metric[data-metric="dialogs"] { width: 2.79%; }
.ct-table col.ct-col-metric[data-metric="cpd"] { width: 3.15%; }
.ct-table col.ct-col-metric[data-metric="crDia"] { width: 3.375%; }
.ct-table col.ct-col-metric[data-metric="fd"], .ct-table col.ct-col-metric[data-metric="rd"] { width: 2.07%; }
.ct-table col.ct-col-metric[data-metric="fdCost"], .ct-table col.ct-col-metric[data-metric="rdCost"] { width: 3.105%; }
.ct-table col.ct-col-metric[data-metric="crFd"], .ct-table col.ct-col-metric[data-metric="crRd"] { width: 3.465%; }
.ct-table col.ct-col-metric[data-metric="revenue"] { width: 4.275%; }
.ct-table col.ct-col-metric[data-metric="profit"] { width: 4.365%; }
.ct-table col.ct-col-metric[data-metric="roi"] { width: 4.095%; }
.ct-table th, .ct-table td, .ct-table col { min-width: 0; }
.ct-table th, .ct-table td {
  padding: 4px 2px;
  vertical-align: middle;
  line-height: 1.23;
  border-bottom: 1px solid var(--ct-line);
}
.ct-table thead th {
  background: var(--ct-head-color);
  border-bottom: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: var(--ct-header-font);
  font-weight: 500;
  color: #e0e7ee;
}
.ct-table thead .ct-header-object, .ct-table thead .ct-header-actions {
  font-size: var(--ct-text-font);
  font-weight: 600;
  padding: 6px var(--ct-hpad);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ct-table thead .ct-header-object {
  text-align: left;
  padding-left: var(--ct-hpad);
  border-top-left-radius: 10px;
}
.ct-header-object > label, .ct-header-object > .ct-header-select, .ct-header-object > div {
  display: flex;
  align-items: center;
  gap: var(--ct-gap);
  min-width: 0;
}
.ct-header-object > input { margin-right: var(--ct-gap); vertical-align: middle; }
.ct-table thead .ct-header-actions { text-align: center; border-top-right-radius: 10px; }
.ct-group-traffic, .ct-table [data-group="traffic"] { --ct-band: #172b3a; --ct-band-low: #1b2935; --ct-ink: #3ab9fc; }
.ct-group-leads, .ct-table [data-group="leads"] { --ct-band: #2a2337; --ct-band-low: #292637; --ct-ink: #cc8af2; }
.ct-group-dialogs, .ct-table [data-group="dialogs"] { --ct-band: #18303b; --ct-band-low: #1a3039; --ct-ink: #48cef4; }
.ct-group-fd, .ct-table [data-group="fd"] { --ct-band: #19372d; --ct-band-low: #20342e; --ct-ink: #77e68b; }
.ct-group-rd, .ct-table [data-group="rd"] { --ct-band: #342c23; --ct-band-low: #302b26; --ct-ink: #f5a34c; }
.ct-group-finance, .ct-table [data-group="finance"] { --ct-band: #1b352b; --ct-band-low: #21332b; --ct-ink: #75df85; }
.ct-table thead .ct-group {
  height: 33px;
  padding: 3px var(--ct-hpad);
  position: relative;
  isolation: isolate;
  text-align: center;
  font-weight: 600;
  overflow: hidden;
  font-size: var(--ct-text-font);
  white-space: nowrap;
}
.ct-table thead .ct-group::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 2px 1px 1px;
  border-radius: 9px;
  background: var(--ct-band, #242d35);
  pointer-events: none;
}
.ct-group-badge {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  line-height: 1.35;
}
.ct-group-badge .ct-icon { color: var(--ct-ink); width: clamp(12px, 1cqw, 18px); height: clamp(12px, 1cqw, 18px); }
.ct-group-badge span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ct-table thead .ct-metric-heading {
  position: relative;
  isolation: isolate;
  height: 26px;
  padding: 4px 1px 5px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: var(--ct-header-font);
}
.ct-metric-heading::before {
  content: '';
  position: absolute;
  inset: 1px 0 2px;
  z-index: -1;
  background: var(--ct-band-low, #242d35);
  pointer-events: none;
}
.ct-table thead .ct-metric-heading:is([data-metric="spend"], [data-metric="leads"], [data-metric="dialogs"], [data-metric="fd"], [data-metric="rd"], [data-metric="revenue"])::before {
  left: 1px;
  border-radius: 6px 0 0 6px;
}
.ct-table thead .ct-metric-heading:is([data-metric="ctr"], [data-metric="cr"], [data-metric="crDia"], [data-metric="crFd"], [data-metric="crRd"], [data-metric="roi"])::before {
  right: 1px;
  border-radius: 0 6px 6px 0;
}
.ct-metric-heading button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  max-width: 100%;
  min-width: 0;
  color: inherit;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: inherit;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ct-table tbody .ct-row { height: clamp(56px, 3.65cqw, 65px); background: var(--ct-row-color); }
.ct-table tbody .ct-row:hover { background: #1a222a; }
.ct-table tbody .ct-row:has(.ct-pick:checked) { background: #1a2b3b; }
.ct-table tbody .ct-row:is(.adv-archived, .ct-archived) .ct-identity-content { opacity: .68; }
.ct-table tbody td { color: #e6ecf3; font-size: var(--ct-text-font); }
.ct-table td.ct-identity { padding: 4px var(--ct-hpad); white-space: nowrap; overflow: hidden; }
.ct-identity-content {
  display: flex;
  width: 100%;
  align-items: center;
  min-width: 0;
  gap: var(--ct-gap);
}
.ct-table input[type=checkbox], .ct-select-all-mobile input[type=checkbox] {
  width: clamp(12px, 1cqw, 16px);
  height: clamp(12px, 1cqw, 16px);
  max-width: 100%;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--blue);
  cursor: pointer;
  vertical-align: middle;
}
.ct-preview {
  display: grid;
  place-items: center;
  position: relative;
  flex: 0 0 auto;
  width: clamp(36px, 4cqw, 66px);
  height: clamp(42px, 3.35cqw, 55px);
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #35434d;
  border-radius: 7px;
  background: #222b33;
  color: #acbac9;
}
.ct-preview:hover { border-color: #5ca6e4; }
.ct-preview img, .ct-preview video { display: block; width: 100%; height: 100%; min-width: 0; object-fit: cover; }
.ct-preview > svg.ct-icon { width: 21px; height: 21px; }
.ct-play {
  position: absolute;
  inset: auto auto 4px 4px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 5px;
  background: #0d151bd9;
  color: #f3f6f8;
}
.ct-play .ct-icon { width: 12px; height: 12px; }
.ct-object-info { display: grid; min-width: 0; flex: 1 1 0; gap: 3px; }
.ct-name {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  display: block;
  font-size: var(--ct-text-font);
  line-height: 1.25;
  font-weight: 600;
  margin: 0;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ct-name::before {
  content: '';
  display: inline-block;
  vertical-align: .14em;
  border: solid #8daecf;
  border-width: 0 1.5px 1.5px 0;
  height: .36em;
  width: .36em;
  margin: 0 .48em 0 .13em;
  transform: rotate(-45deg);
}
.ct-name[aria-expanded=true]::before { transform: translateY(-.12em) rotate(45deg); }
.ct-name:hover { color: #afd4f8; }
.ct-name:focus-visible { outline: 1px solid #77b7f1; outline-offset: -1px; border-radius: 3px; }
.ct-table .ct-source-row { background: #1b2836; }
.ct-table .ct-source-row .ct-source-name {
  position: relative;
  text-align: left;
  padding: 8px 3px 8px 37px;
  font-size: var(--ct-text-font);
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
}
.ct-open .ct-identity { position: relative; }
.ct-open .ct-identity::after, .ct-source-name::before, .ct-source-name::after {
  position: absolute;
  content: '';
  left: 15px;
  width: 1px;
  background: #557ca5;
  pointer-events: none;
}
.ct-open .ct-identity::after { top: calc(50% + 12px); bottom: 0; }
.ct-source-name::before { top: 0; bottom: -1px; }
.ct-source-last .ct-source-name::before { bottom: 50%; }
.ct-source-name::after { top: 50%; width: 15px; height: 1px; }
.ct-meta {
  display: flex;
  align-items: center;
  gap: clamp(4px, .5cqw, 8px);
  min-width: 0;
  font-size: clamp(10px, .66cqw, 12px);
  line-height: 1.25;
  color: #b7c2cd;
  white-space: nowrap;
}
.ct-meta-geo, .ct-meta-format, .ct-meta-active {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.ct-meta-geo, .ct-meta-active { flex: 0 0 auto; }
.ct-meta-format { flex: 0 1 auto; }
.ct-meta-format > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ct-meta .ct-icon { width: 12px; height: 12px; color: #9eacb9; }
.ct-meta-active .ct-icon.ct-icon-megaphone { color: #6cdb8c; }
.ct-meta-active.ct-active-unknown { color: #9eacb9; }
.ct-meta-active.ct-active-unknown .ct-icon.ct-icon-megaphone { color: #9eacb9; }
.ct-meta-active.ct-active-positive { color: #95e1ab; }
.ct-meta-active.ct-active-positive .ct-icon.ct-icon-megaphone { color: #6cdb8c; }
.ct-active-value { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ct-author {
  display: block;
  min-width: 0; max-width: 100%;
  font-size: clamp(10px, .66cqw, 12px);
  line-height: 1.25;
  color: #b7c2cd;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ct-detail-texts p { max-height: none; overflow: visible; overflow-wrap: anywhere; white-space: pre-wrap; }
.ct-detail-media { min-height: 180px; max-height: 58dvh; }
.ct-detail-media img, .ct-detail-media video { max-height: 55dvh; object-fit: contain; }
.ct-detail-edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 17px; }
.ct-detail-edit-grid > *, .ct-detail-fields { min-width: 0; align-self: start; }
.ct-detail-fields { display: grid; gap: 11px; }
.adv-library-dialog:has(.ct-detail-edit-grid) .adv-dialog-head h2 { min-width: 0; overflow-wrap: anywhere; }
.ct-details-media { display: grid; gap: 10px; min-width: 0; align-content: start; }
.ct-detail-replace-fields { display: grid; gap: 9px; min-width: 0; }
.ct-detail-filename, .ct-detail-replace-fields p { margin: 0; overflow-wrap: anywhere; }
.ct-detail-replace-fields small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.ct-detail-replace-fields .field { min-width: 0; }
.ct-detail-replace-fields input[type=file] {
  display: block; width: 100%; max-width: 100%; min-width: 0; height: auto;
  padding: 6px; font-size: 11px; line-height: 1.3;
}
.ct-detail-replace-fields input[type=file]::file-selector-button {
  margin: 0 8px 0 0; padding: 5px 8px; border: 1px solid #35434f;
  border-radius: 5px; background: #24313b; color: var(--text);
  font: inherit; cursor: pointer;
}
.ct-detail-fields textarea { min-height: 62px; line-height: 1.5; }
.ct-detail-note, .ct-save-status {
  margin: 0; font-size: 11px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere;
}
.ct-detail-note { padding: 9px 10px; border: 1px solid #32424e; border-radius: 7px; background: #1c262d; }
.ct-save-status { color: #92d8ad; }
.ct-save-status:empty { display: none; }
@media (max-width: 760px) {
  .ct-detail-edit-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .ct-detail-edit-grid .ct-detail-media { min-height: 150px; max-height: 42dvh; }
  .ct-detail-edit-grid .ct-detail-media img, .ct-detail-edit-grid .ct-detail-media video { max-height: 40dvh; }
}
.ct-table td.ct-metric {
  padding: 3px clamp(2px, .3cqw, 6px) 3px 1px;
  font-size: var(--ct-metric-font);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  letter-spacing: -.1px;
}
.ct-table td.ct-metric:is([data-metric="spend"], [data-metric="leads"], [data-metric="dialogs"], [data-metric="fd"], [data-metric="rd"], [data-metric="revenue"]) { border-left: 1px solid var(--ct-line); }
.ct-metric-value { display: flex; align-items: center; justify-content: flex-end; width: 100%; min-width: 0; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.ct-metric-content { display: inline-block; flex: 0 0 auto; white-space: nowrap; max-width: none; transform-origin: right center; }
.ct-value-detail { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 2px; }
.ct-value-detail:focus-visible { outline: 1px solid #6db8ff; outline-offset: 1px; }
.ct-table .ct-metric-positive { color: #75de8b; font-weight: 600; }
.ct-table .ct-metric-negative { color: #f18b91; font-weight: 600; }
.ct-table .ct-metric-zero { color: #9daab8; }
.ct-table .ct-metric-missing { color: #84919e; }
.ct-table td.ct-actions { border-left: 1px solid var(--ct-line); text-align: center; overflow: visible; padding: 4px clamp(2px, .36cqw, 7px); }
.ct-actions-inner { display: flex; min-width: 0; width: 100%; align-items: center; justify-content: center; gap: clamp(3px, .45cqw, 7px); }
.ct-table .ct-launch, .ct-table .ct-menu-toggle {
  min-width: 0;
  min-height: 27px;
  height: 29px;
  line-height: 1;
  padding: 4px 6px;
  border: 1px solid #34424f;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: clamp(9px, .65cqw, 11px);
  white-space: nowrap;
}
.ct-table .ct-launch { flex: 1 1 auto; background: #258cf5; border-color: #278df5; color: #fff; }
.ct-table .ct-launch:hover:not(:disabled) { background: #3c9aff; border-color: #4ca7ff; }
.ct-table .ct-launch[data-action="restore"] { background: #24313c; border-color: #3a4a58; color: #e1eaf4; }
.ct-table .ct-launch[data-action="restore"]:hover { background: #2d4150; border-color: #526777; }
.ct-launch > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-launch .ct-icon { width: 13px; height: 13px; }
.ct-table .ct-menu-toggle {
  width: clamp(23px, 2cqw, 31px);
  flex: 0 0 auto;
  padding: 0;
  background: #161d24;
  color: #d5dfeb;
}
.ct-menu-toggle:hover, .ct-menu-toggle[aria-expanded=true] { background: #2b3742; border-color: #4f6171; }
.ct-menu-toggle .ct-icon { width: 16px; height: 16px; }
.ct-action-menu {
  position: fixed;
  z-index: 180;
  width: min(210px, calc(100vw - 16px));
  max-width: calc(100vw - 16px);
  max-height: min(70dvh, 440px);
  padding: 5px;
  overflow: auto;
  border: 1px solid #42515e;
  border-radius: 8px;
  background: #242d35;
  box-shadow: 0 14px 35px #0009;
  color: #e0e8f1;
  text-align: left;
  white-space: normal;
}
.ct-action-menu .btn, .ct-action-menu button {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 31px;
  min-width: 0;
  margin: 0;
  padding: 7px 9px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 400;
  text-align: left;
  white-space: normal;
}
.ct-action-menu button:hover:not(:disabled) { border-color: #425464; background: #303e49; color: #fff; }
.ct-action-menu [data-action="archive"] { color: #f6a6a6; }
.ct-table tfoot .ct-total { background: var(--ct-total-color); }
.ct-table tfoot .ct-total td { height: 47px; border-bottom: 0; color: #e6eff8; font-weight: 600; }
.ct-table tfoot .ct-total-title { padding: 8px var(--ct-hpad); font-size: var(--ct-text-font); text-align: left; white-space: normal; overflow-wrap: anywhere; border-bottom-left-radius: 10px; }
.ct-table tfoot .ct-total td:last-child { border-bottom-right-radius: 10px; }
.ct-table tfoot .ct-metric { border-color: transparent; }
.ct-table tfoot .ct-total .ct-metric-positive { color: #86e99a; }
.ct-table tfoot .ct-total .ct-metric-negative { color: #f5a1a5; }
.ct-table .ct-empty {
  height: 105px;
  padding: 22px 16px;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  border-bottom: 0;
}
.ct-empty-title { margin: 0 0 5px; font-size: 14px; font-weight: 500; color: #e1e9f1; }
.ct-empty p { margin: 0; color: #9faebc; font-size: 12px; line-height: 1.5; }

/* Tablet and mobile are based on the width actually available to the table,
   not on the full screen (which may include the workspace sidebar). */
@container ct-controls (max-width: 1060px) {
  .ct-filters, .ct-filters:has(#adv-owner) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
}
@container ct-controls (max-width: 900px) {
  .ct-select-all-mobile { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; line-height: 1.2; white-space: nowrap; }
  .ct-select-all-mobile input[type=checkbox] { width: 16px; height: 16px; }
}
@container ct-controls (max-width: 580px) {
  .ct-filters, .ct-filters:has(#adv-owner) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ct-filters > :first-child { grid-column: 1 / -1; }
  .ct-bulk .adv-bulk-actions, .ct-bulk-actions { justify-content: flex-start; }
}
@container ct-grid (min-width: 901px) and (max-width: 1190px) {
  /* Keep the same exact 100% column allocation. Reduce icon and internal
     gaps only, so the author and the active count keep their own space. */
  .ct-table .ct-launch { padding: 3px 4px; gap: 2px; }
  .ct-launch .ct-icon { width: 11px; height: 11px; }
  .ct-meta .ct-icon { width: 11px; height: 11px; }
  .ct-meta { gap: 4px; }
}
@container ct-grid (min-width: 901px) and (max-width: 980px) {
  .ct-table .ct-launch { padding: 3px 4px; }
  .ct-launch .ct-icon { display: none; }
}
@container ct-grid (max-width: 900px) {
  .ct-table, .ct-table tbody, .ct-table tfoot { display: block; width: 100%; min-width: 0; white-space: normal; }
  .ct-table colgroup, .ct-table thead { display: none; }
  .ct-table tbody, .ct-table tfoot { display: grid; gap: 10px; padding: 10px; }
  .ct-table tfoot { padding-top: 0; }
  .ct-table tbody .ct-row, .ct-table tbody .ct-source-row, .ct-table tfoot .ct-total {
    display: grid;
    width: 100%;
    min-width: 0;
    height: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid #303b45;
    border-radius: 9px;
    padding: 9px;
  }
  .ct-table tbody .ct-source-row { position: relative; margin-left: 15px; width: calc(100% - 15px); }
  .ct-source-row::before, .ct-source-row::after { content:''; position:absolute; background:#557ca5; left:-10px; width:1px; top:-11px; bottom:-1px; }
  .ct-source-row.ct-source-last::before { bottom:auto; height:35px; }
  .ct-source-row::after { width:9px; height:1px; top:23px; bottom:auto; }
  .ct-open .ct-identity::after, .ct-source-name::before, .ct-source-name::after { display:none; }
  .ct-table .ct-source-row .ct-source-name { grid-column:1/-1; padding:6px 0; font-size:12px; }
  .ct-table .ct-source-row td.ct-actions { display:none; }
  .ct-table tbody td, .ct-table tfoot td { display: block; width: auto; height: auto; min-width: 0; max-width: none; padding: 7px; border: 0; font-size: 12px; white-space: normal; }
  .ct-table td.ct-identity, .ct-table tbody td.ct-actions { grid-column: 1 / -1; padding: 6px 0 9px; border: 0; overflow: visible; }
  .ct-identity-content { gap: 9px; }
  .ct-preview { width: 54px; height: 54px; }
  .ct-object-info { gap: 4px; }
  .ct-name { font-size: 13px; }
  .ct-meta { font-size: 11px; gap: 6px; flex-wrap: wrap; white-space: normal; }
  .ct-author { font-size: 11px; }
  .ct-table input[type=checkbox] { width: 16px; height: 16px; }
  .ct-table tbody td.ct-metric, .ct-table tfoot td.ct-metric {
    min-height: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 0;
    border-top: 1px solid var(--ct-line);
    padding: 7px 5px;
    text-align: center;
    font-size: 12px;
    white-space: normal;
    overflow: visible;
  }
  .ct-table td.ct-metric::before { content: attr(data-label); color: var(--ct-ink, #aeb9c6); display: block; margin-bottom: 4px; font-size: 10px; font-weight: 400; line-height: 1.3; }
  .ct-table .ct-metric-value { display: block; white-space: normal; max-width: 100%; overflow: visible; overflow-wrap: anywhere; text-overflow: clip; transform: none !important; font-size: inherit !important; }
  .ct-table .ct-metric-content { display: block; width: 100%; max-width: 100%; white-space: normal; overflow-wrap: anywhere; transform: none !important; font-size: inherit !important; }
  .ct-table .ct-actions-inner { justify-content: flex-end; }
  .ct-table .ct-launch, .ct-table .ct-menu-toggle { flex: 0 1 auto; min-height: 32px; height: 32px; font-size: 12px; }
  .ct-table .ct-launch { padding: 6px 13px; }
  .ct-table .ct-menu-toggle { width: 33px; }
  .ct-table tfoot .ct-total-title { grid-column: 1 / -1; height: auto; padding: 7px 4px; border-radius: 0; font-size: 13px; }
  .ct-table tfoot .ct-total td.ct-actions { display: none; }
  .ct-table tbody tr:has(.ct-empty) { display: block; padding: 0; border: 0; width: 100%; }
  .ct-table .ct-empty { display: block; min-width: 0; width: 100%; height: auto; padding: 19px 12px; }
}
@media (max-width: 820px) {
  .ct-creative-heading.page-heading { flex-wrap: wrap; gap: 9px; }
  .ct-creative-heading h1 { flex-wrap: wrap; gap: 7px; font-size: 21px; }
  .ct-creative-heading .heading-actions { flex-wrap: wrap; justify-content: flex-start; gap: 6px; }
  .ct-period select { min-height: 30px; }
  .ct-creative-heading .heading-actions .btn { font-size: 11px; }
}
