:root {
  --bg: #1f1f1f;
  --bg-sidebar: #181818;
  --bg-card: #2a2a2a;
  --bg-hover: #333333;
  --border: #3a3a3a;
  --text: #e6e6e6;
  --text-muted: #9a9a9a;
  --accent: #4f8cff;
  --success: #3ec27a;
  --danger: #e5534b;
  --warning: #e0a52b;
  --sidebar-width: 240px;
  --sidebar-collapsed: 64px;
  --topbar-height: 56px;
  --radius: 8px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a { color: inherit; text-decoration: none; }

.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  transition: width 0.2s ease;
  overflow: hidden;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar-height);
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.sidebar__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 7px;
  background: transparent;
  color: #fff;
  font-weight: 700;
  object-fit: cover;
}

.sidebar__title { font-weight: 600; font-size: 16px; }

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 8px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--text-muted);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.is-active { background: var(--bg-card); color: var(--text); }
.nav-item.is-active .nav-item__icon { color: var(--accent); }

.nav-item__icon {
  width: 24px;
  flex-shrink: 0;
  text-align: center;
  font-size: 13px;
}

.sidebar__footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.user { display: flex; align-items: center; gap: 12px; white-space: nowrap; }

.user__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--bg-hover);
  font-weight: 600;
}

.user__meta { display: flex; flex-direction: column; line-height: 1.2; }
.user__role { color: var(--text-muted); font-size: 12px; }

/* Collapsed sidebar */
.sidebar.is-collapsed { width: var(--sidebar-collapsed); }
.sidebar.is-collapsed .sidebar__title,
.sidebar.is-collapsed .nav-item__label,
.sidebar.is-collapsed .user__meta { display: none; }
.sidebar.is-collapsed .sidebar__brand,
.sidebar.is-collapsed .sidebar__footer { padding-left: 16px; }

/* Main column */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--topbar-height);
  padding: 0 24px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
}

.topbar__toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.topbar__toggle:hover { background: var(--bg-hover); color: var(--text); }

.topbar__title { margin: 0; font-size: 18px; font-weight: 600; }

.topbar__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar__search {
  width: 220px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.topbar__search::placeholder { color: var(--text-muted); }
.topbar__search:focus { outline: none; border-color: var(--accent); }

.btn {
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { filter: brightness(1.1); }

.content { padding: 24px; flex: 1; }

.section { display: none; }
.section.is-visible { display: block; }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card__title { margin: 0 0 16px; font-size: 15px; font-weight: 600; }

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.card__header .card__title { margin: 0; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat__label { color: var(--text-muted); font-size: 13px; }
.stat__value { font-size: 26px; font-weight: 600; }
.stat__delta { font-size: 12px; color: var(--text-muted); }
.stat__delta--up { color: var(--success); }
.stat__delta--down { color: var(--danger); }

.grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

/* Table */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
.table th { color: var(--text-muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-hover); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.badge--live { background: rgba(62, 194, 122, 0.15); color: var(--success); }
.badge--paused { background: rgba(224, 165, 43, 0.15); color: var(--warning); }
.badge--draft { background: rgba(154, 154, 154, 0.15); color: var(--text-muted); }

.activity { list-style: none; margin: 0; padding: 0; }
.activity li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.activity li:last-child { border-bottom: none; }
.activity__time { display: inline-block; width: 32px; color: var(--text-muted); font-size: 12px; }

.muted { color: var(--text-muted); margin: 0; }

.link { color: var(--accent); }
.link:hover { text-decoration: underline; }
.table .link { word-break: break-all; }

.notice {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin-bottom: 16px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text-muted); font-size: 13px;
}
.notice__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); flex-shrink: 0; }
.notice--ok .notice__dot { background: var(--success); }
.notice--error { border-color: var(--danger); color: var(--text); }
.notice--error .notice__dot { background: var(--danger); }
.btn:disabled { opacity: 0.5; cursor: default; }

/* Scrolling table with a header that stays put */
.table-wrap { overflow-x: auto; }
.table-wrap--sticky { overflow: auto; max-height: calc(100vh - 270px); min-height: 200px; }
.table-wrap--sticky thead th {
  position: sticky; top: 0; z-index: 3;
  background: var(--bg-card);
  box-shadow: inset 0 -1px 0 var(--border);   /* border-collapse drops the border on sticky cells */
}
.table-wrap--sticky .table th { border-bottom: none; }

/* Editable table */
.table__actions-col { width: 1%; }

.sort {
  background: none; border: none; padding: 0; margin: 0; cursor: pointer;
  color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit;
  display: inline-flex; align-items: center; gap: 4px;
}
.sort:hover { color: var(--text); }
.sort::after { content: ''; width: 0.9em; font-size: 10px; opacity: 0.8; }
.sort.is-asc::after { content: '\25B2'; }
.sort.is-desc::after { content: '\25BC'; }
.sort.is-asc, .sort.is-desc { color: var(--text); }
.table__num { width: 1%; color: var(--text-muted); text-align: right; padding-right: 12px; white-space: nowrap; }
.table__actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }

.btn--small { padding: 4px 10px; font-size: 12px; }
.btn--danger { color: var(--danger); }
.btn--danger:hover { background: rgba(229, 83, 75, 0.15); border-color: var(--danger); }
.btn:hover { background: var(--bg-hover); }
.btn--primary:hover { background: var(--accent); }

.table__input {
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.table__textarea { resize: vertical; min-height: 34px; line-height: 1.4; }
.rules-text { white-space: pre-wrap; max-width: 36ch; }

/* Status blocks: the colour fills the entire cell, edge to edge */
.cell-status { position: relative; padding: 0; min-width: 120px; }
.status {
  position: absolute; inset: 0; width: 100%; height: 100%;
  margin: 0; padding: 0 8px; border: none; border-radius: 0; cursor: pointer;
  font: inherit; font-weight: 500; text-align: center; color: #fff;
  transition: filter 0.1s;
}
.status--none { background: #3a3b40; }
.status--green { background: #00c875; }
.status--amber { background: #fdab3d; }
.status--red { background: #e2445c; }
.status--notlive { background: var(--bg); color: var(--text-muted); }
.status:hover { filter: brightness(1.08); }
.status:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.table tbody tr:hover .cell-status { background: transparent; }

/* Colour picker that opens under a status block */
.status-menu {
  position: absolute; z-index: 50; min-width: 160px;
  display: flex; flex-direction: column; gap: 6px; padding: 8px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.status-menu__option {
  display: block; width: 100%; padding: 8px 12px; border: none; border-radius: 4px;
  font: inherit; font-weight: 500; color: #fff; cursor: pointer; text-align: center;
}
.status-menu__option:hover { filter: brightness(1.1); }
.status-menu__option.is-current { outline: 2px solid #fff; outline-offset: -2px; }
.status-menu__option.status--notlive { border: 1px solid var(--border); }
.status-menu__option:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.status-menu__clear { background: transparent; color: var(--text-muted); border: 1px dashed var(--border); }
.status-menu__clear:hover { color: var(--text); filter: none; background: var(--bg-hover); }

/* Click-to-edit cells */
.cell-editable { cursor: text; }
.cell-editable:hover { background: var(--bg-hover); }
.cell-editable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cell-editing { padding: 4px 8px; }
.link-text { color: var(--accent); word-break: break-all; }
.link--open { display: inline-block; margin-left: 8px; font-size: 12px; white-space: nowrap; opacity: 0.8; }
.link--open:hover { opacity: 1; }
.table__input:focus { outline: none; border-color: var(--accent); }
.table__input.is-invalid { border-color: var(--danger); }

.table--editable td { vertical-align: middle; }
.table--editable tbody tr.is-editing:hover { background: transparent; }
.card > .muted + .table { margin-top: 16px; }

/* Responsive */
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
}

.backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9;
  background: rgba(0, 0, 0, 0.5);
}

@media (max-width: 640px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 10;
    width: var(--sidebar-width);
    transition: transform 0.2s ease;
  }
  .sidebar.is-collapsed { width: var(--sidebar-width); transform: translateX(-100%); }
  .sidebar.is-collapsed .sidebar__title,
  .sidebar.is-collapsed .nav-item__label,
  .sidebar.is-collapsed .user__meta { display: initial; }
  .sidebar.is-collapsed .user__meta { display: flex; }
  .sidebar:not(.is-collapsed) ~ .backdrop { display: block; }
  .topbar { padding: 0 16px; }
  .topbar__search { display: none; }
  .content { padding: 16px; }
}

/* ---- Shared form bits ---- */
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500; }
.field__hint { font-size: 12px; color: var(--text-muted); }
.field .table__input { width: 100%; }
.field textarea.table__input { min-height: 80px; resize: vertical; line-height: 1.45; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
select.table__input { -webkit-appearance: none; appearance: none; padding-right: 28px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%239a9a9a'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; }
.settings-card { max-width: 640px; }

/* Toggle switch */
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 14px; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle__track { width: 36px; height: 20px; border-radius: 999px; background: var(--bg-hover); border: 1px solid var(--border); position: relative; transition: background 0.15s; flex-shrink: 0; }
.toggle__track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-muted); transition: transform 0.15s, background 0.15s; }
.toggle input:checked + .toggle__track { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .toggle__track::after { transform: translateX(16px); background: #fff; }
.toggle input:focus-visible + .toggle__track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Choice chips (radio groups) */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--text-muted); cursor: pointer; font: inherit; }
.chip:hover { color: var(--text); background: var(--bg-hover); }
.chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Checkbox lists */
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

/* ---- Ad Builder ---- */
.builder { max-width: 1040px; }
.builder__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 20px; }
.builder__bar .table__input { width: auto; min-width: 220px; }
.builder__name { font-weight: 600; font-size: 16px; min-width: 260px; }
.builder__save { font-size: 12px; color: var(--text-muted); margin-left: auto; white-space: nowrap; }
.builder__save.is-error { color: var(--danger); }
.builder__empty { text-align: center; padding: 48px 20px; }
.builder__empty p { margin: 0 0 16px; }
.step { margin-bottom: 16px; }
.step__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.step__num { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--bg); border: 1px solid var(--border); color: var(--text-muted); font-size: 12px; font-weight: 600; flex-shrink: 0; align-self: center; }
.step__title { margin: 0; font-size: 15px; font-weight: 600; }
.step__sub { font-size: 12px; color: var(--text-muted); }
.step.is-off { opacity: 0.55; }
.list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.list-item { display: flex; gap: 8px; align-items: flex-start; }
.list-item .table__input { flex: 1; }
.list-item__num { width: 22px; padding-top: 8px; color: var(--text-muted); font-size: 12px; text-align: right; flex-shrink: 0; }
.subcard { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 14px; margin-bottom: 12px; }
.subcard__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.subcard__head .table__input { flex: 1; font-weight: 600; }
.badge--ready { background: rgba(62, 194, 122, 0.15); color: var(--success); }
.badge--launched { background: rgba(79, 140, 255, 0.15); color: var(--accent); }
.warn-list { margin: 0 0 12px; padding-left: 18px; color: var(--warning); font-size: 13px; }
.warn-list li { margin: 2px 0; }

/* Creative library */
.creatives { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.creative { position: relative; border: 2px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--bg); cursor: pointer; }
.creative.is-on { border-color: var(--accent); }
.creative__thumb { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--bg-hover); }
.creative__thumb--icon { display: flex; align-items: center; justify-content: center; font-size: 28px; color: var(--text-muted); }
.creative__name { padding: 8px 10px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.creative__check { position: absolute; top: 6px; left: 6px; width: 20px; height: 20px; border-radius: 4px; background: rgba(0,0,0,0.55); border: 1px solid rgba(255,255,255,0.4); color: #fff; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.creative.is-on .creative__check { background: var(--accent); border-color: var(--accent); }
.creative__del { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,0.55); border: none; color: #fff; border-radius: 4px; width: 22px; height: 22px; cursor: pointer; font-size: 14px; line-height: 1; opacity: 0; }
.creative:hover .creative__del { opacity: 1; }
.upload { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .upload { grid-template-columns: 1fr; } }
.drop { border: 1px dashed var(--border); border-radius: 8px; padding: 18px; text-align: center; color: var(--text-muted); cursor: pointer; }
.drop:hover, .drop.is-over { border-color: var(--accent); color: var(--text); }
.drop input { display: none; }
.progress { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* Lead form question builder */
.question { border-left: 3px solid var(--accent); }
.option-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.option-row.has-logic { grid-template-columns: 1fr 220px auto; }
.logic-label { font-size: 12px; color: var(--text-muted); }
@media (max-width: 700px) { .option-row.has-logic { grid-template-columns: 1fr; } }

/* Hermes config + previews */
.hermes { border-color: #3d4a63; }
.hermes .step__num { background: rgba(79, 140, 255, 0.15); border-color: var(--accent); color: var(--accent); }
.reply { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 12px; margin-top: 12px; font-size: 13px; }
.reply__meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--text-muted); font-size: 12px; margin-bottom: 8px; }
.reply__ok { color: var(--success); }
.reply__bad { color: var(--danger); }
.reply pre { margin: 0; white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text); }
.creative__link { position: absolute; bottom: 30px; right: 6px; background: rgba(0,0,0,0.6); border: none; color: #fff; border-radius: 4px; padding: 2px 6px; font-size: 11px; cursor: pointer; opacity: 0; }
.creative:hover .creative__link { opacity: 1; }
.creative__link.is-copied { background: var(--success); opacity: 1; }

/* API key block */
.apikey { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; margin-bottom: 12px; }
.apikey__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.apikey__name { font: 13px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.04em; }
.apikey__row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.apikey__value { flex: 1; min-width: 200px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-card); font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text-muted); word-break: break-all; }
.apikey__value.is-fresh { color: var(--success); border-color: var(--success); user-select: all; }

/* Advanced fold */
.advanced { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 12px; }
.advanced summary { cursor: pointer; color: var(--text-muted); font-size: 13px; margin-bottom: 12px; }
.advanced summary:hover { color: var(--text); }
.notice .btn { margin-left: auto; }

/* AI cards */
.ai { border-color: #4a3d63; }
.ai .step__num { background: rgba(167, 139, 250, 0.15); border-color: #a78bfa; color: #a78bfa; }
.rules { margin: 0; padding-left: 20px; color: var(--text-muted); font-size: 13px; }
.rules li { margin: 4px 0; }

/* ---- Creative swipe file ---- */
.swipes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.swipe { display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.swipe.is-inactive { opacity: 0.6; }
.swipe__media { position: relative; background: var(--bg-hover); aspect-ratio: 1 / 1; }
.swipe__media img, .swipe__media video { display: block; width: 100%; height: 100%; object-fit: cover; }
.swipe__media video { object-fit: contain; background: #000; }
.swipe__type { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,0.6); color: #fff; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.swipe__status { position: absolute; top: 8px; right: 8px; }
.swipe__body { display: flex; flex-direction: column; gap: 6px; padding: 12px; }
.swipe__advertiser { font-weight: 600; }
.swipe__headline { font-size: 13px; }
.swipe__copy { font-size: 13px; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; cursor: pointer; }
.swipe__copy.is-open { -webkit-line-clamp: unset; }
.swipe__meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--text-muted); }
.swipe__meta a { color: var(--accent); }
.stars { display: inline-flex; gap: 2px; }
.stars button { background: none; border: none; padding: 0; cursor: pointer; font-size: 16px; line-height: 1; color: var(--border); }
.stars button.is-on { color: var(--warning); }
.stars button:hover { color: var(--warning); }
.swipe__actions { display: flex; gap: 6px; justify-content: space-between; align-items: center; margin-top: 4px; }
.card__header .btn-row .table__input { width: auto; min-width: 150px; }

/* Swipe file: rows view */
.swipes--rows { display: flex; flex-direction: column; gap: 6px; }
.swipe-row { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; }
.swipe-row.is-inactive { opacity: 0.6; }
.swipe-row__line { display: flex; align-items: center; gap: 12px; padding: 8px 10px; cursor: pointer; }
.swipe-row__line:hover { background: var(--bg-hover); }
.swipe-row__thumb { width: 44px; height: 44px; flex-shrink: 0; border-radius: 4px; overflow: hidden; background: var(--bg-hover); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.swipe-row__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.swipe-row__text { flex: 1; min-width: 0; }
.swipe-row__sub { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swipe-row__type { position: static; }
.swipe-row__detail { padding: 4px 14px 14px 66px; font-size: 13px; }
@media (max-width: 700px) { .swipe-row__line { flex-wrap: wrap; } .swipe-row__detail { padding-left: 14px; } }

/* Swipe file: advertiser groups (rows view) */
.swipe-group { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.swipe-group__head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; background: var(--bg-card); border: none; color: var(--text); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.swipe-group__head:hover { background: var(--bg-hover); }
.swipe-group__caret { display: inline-block; color: var(--text-muted); transition: transform 0.15s; }
.swipe-group__head.is-open .swipe-group__caret { transform: rotate(90deg); }
.swipe-group__count { margin-left: auto; font-weight: 400; font-size: 12px; color: var(--text-muted); }
.swipe-group__body { display: flex; flex-direction: column; gap: 4px; padding: 6px; background: var(--bg); }
.swipe-group__body .swipe-row { border-color: transparent; }
.swipe__advertiser { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.swipe__time { font-size: 12px; font-weight: 400; color: var(--text-muted); white-space: nowrap; }
.swipe-group__bar { display: flex; align-items: center; background: var(--bg-card); }
.swipe-group__bar .swipe-group__head { flex: 1; }
.swipe-group__delete { margin-right: 8px; flex-shrink: 0; }

/* Ad Library position badge */
.pos { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 24px; padding: 0 8px; border-radius: 6px; font-weight: 700; font-size: 13px; background: var(--bg-hover); color: var(--text); font-variant-numeric: tabular-nums; }
.pos--top { background: #f5b301; color: #1a1a1a; }
.pos--high { background: #d9d9d9; color: #1a1a1a; }
.pos--none { color: var(--text-muted); font-weight: 500; }
.pos--media { position: absolute; bottom: 8px; left: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.5); }
.pos--row { flex-shrink: 0; }
.swipe__posline { font-size: 12px; color: var(--text-muted); }

/* Swipe picker */
.creative__tag { position: absolute; top: 6px; left: 32px; padding: 2px 6px; border-radius: 4px; background: rgba(0,0,0,0.55); color: #fff; font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.picker { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; padding: 20px; }
.picker__panel { width: min(720px, 100%); max-height: 85vh; display: flex; flex-direction: column; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.picker__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.picker__list { overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.picker__item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.picker__item:hover { background: var(--bg-hover); }
.picker__item.is-added { border-color: var(--accent); }
.picker__item img, .picker__icon { width: 48px; height: 48px; border-radius: 4px; object-fit: cover; background: var(--bg-hover); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.picker__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.picker__text span { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker__state { font-size: 12px; color: var(--accent); white-space: nowrap; }

/* Campaigns tab: performance cards + campaign rows */
.perf-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.perf-toolbar .muted { font-size: 12px; }
.perf-page .notice { margin-bottom: 12px; }
.perf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "spend fb results" "delivery fb ctr"; gap: 14px; margin-bottom: 20px; }
.perf--spend { grid-area: spend; } .perf--fb { grid-area: fb; } .perf--results { grid-area: results; } .perf--delivery { grid-area: delivery; } .perf--ctr { grid-area: ctr; }
.perf { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 12px; }
.perf__head { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.perf__icon { width: 24px; height: 24px; border-radius: 50%; background: #3b3b3b; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.perf--fb .perf__icon, .perf--rc .perf__icon { background: #1877f2; font-family: Georgia, serif; }
.perf__block { background: #232323; border-radius: 10px; padding: 12px 14px; }
.perf__hero { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.perf__value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.perf__sub { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.perf__label { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }
.perf__big .perf__value { font-size: 30px; }
.perf__delta { font-size: 13px; font-weight: 600; }
.perf__delta.is-up { color: var(--success); } .perf__delta.is-down { color: var(--danger); }
.perf__grid { display: grid; grid-template-columns: 1fr 1fr; }
.perf__cell { padding: 8px 10px; border-bottom: 1px solid #333; }
.perf__cell:nth-child(odd) { border-right: 1px solid #333; }
.perf__cell:nth-last-child(-n+2) { border-bottom: 0; }
.perf__num { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.is-pos { color: var(--success); } .is-neg { color: var(--danger); }
.perf__nodaily { padding: 20px 4px; font-size: 13px; }
.chart__wrap { position: relative; padding-top: 4px; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart__grid { stroke: #383838; stroke-width: 1; stroke-dasharray: 2 4; }
.chart__tick { fill: #8a8a8a; font-size: 9px; font-weight: 600; letter-spacing: 0.03em; }
.chart__cross { stroke: #777; stroke-width: 1; stroke-dasharray: 3 3; }
.chart__tip { position: absolute; top: 6px; background: #161616; border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; font-size: 12px; pointer-events: none; min-width: 120px; z-index: 2; }
.chart__tipdate { color: var(--text-muted); font-weight: 600; margin-bottom: 2px; }
.chart__tiprow { display: flex; align-items: center; gap: 6px; } .chart__tiprow b { margin-left: auto; }
.chart__swatch { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.chart__legend { display: flex; gap: 14px; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 6px 2px 0; }
.chart__legend span { display: inline-flex; align-items: center; gap: 6px; }
.crow-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; margin: 0 4px 8px; }
.crow { padding: 12px 14px; margin-bottom: 10px; border-radius: 12px; }
.crow__main { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(0, 3.4fr) 140px 32px; align-items: center; gap: 16px; }
.crow__name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow__meta { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 12px; margin-top: 4px; flex-wrap: wrap; }
.crow__cid { font-family: ui-monospace, Menlo, Consolas, monospace; }
.crow__metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.crow__metric { background: #232323; border-radius: 8px; padding: 6px 8px; min-width: 0; }
.crow__num { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crow__label { color: var(--text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
.crow__spark .spark { width: 100%; height: 32px; display: block; }
.crow__remove { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--text-muted); font-size: 16px; cursor: pointer; }
.crow__remove:hover { background: rgba(229, 83, 75, 0.15); color: var(--danger); border-color: var(--danger); }
.perf-empty { padding: 28px; text-align: center; } .perf-empty h3 { margin: 0 0 8px; } .perf-empty p { max-width: 640px; margin: 0 auto 8px; }
.picker__group { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; margin: 8px 0 2px; }
.picker__item input[type=checkbox] { width: 16px; height: 16px; flex-shrink: 0; }
.picker__manual { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-top: 10px; }
.picker__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.picker .table__input { margin-bottom: 8px; }
@media (max-width: 1100px) { .perf-grid { grid-template-columns: 1fr 1fr; grid-template-areas: "spend fb" "results fb" "delivery ctr"; } .crow { grid-template-columns: 1fr; } .crow__metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); } .crow__remove { justify-self: end; } }
@media (max-width: 640px) { .perf-grid { grid-template-columns: 1fr; grid-template-areas: "spend" "results" "fb" "ctr" "delivery"; } .crow__metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); } .picker__manual { grid-template-columns: 1fr; } }
.picker__panel--wide { width: min(860px, 100%); }
.steps { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.steps__item { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding: 3px 8px; border-radius: 999px; border: 1px solid var(--border); }
.steps__item.is-on { color: #fff; border-color: var(--accent); background: rgba(79, 140, 255, 0.18); }
.steps__item.is-done { color: var(--success); border-color: var(--success); }
.picker .notice { margin-bottom: 8px; }
.picker__item--all { border-style: dashed; }
.picker__group--row { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.picker__show { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.picker__item.is-added .picker__show { color: var(--accent); }
.diag { margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 8px; font-size: 12px; color: var(--text-muted); display: flex; flex-direction: column; gap: 4px; }
.apikey__paste { display: flex; gap: 8px; margin-top: 8px; } .apikey__paste input { flex: 1; }

/* timeframe + ad breakdown */
.perf-toolbar__right { align-items: center; }
.frame { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.frame__select { width: auto; min-width: 150px; }
.frame__custom { display: flex; align-items: center; gap: 6px; }
.frame__date { width: 150px; }
.perf__list { display: flex; flex-direction: column; gap: 4px; padding: 4px 2px; }
.perf__row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; font-size: 13px; padding: 4px 6px; border-radius: 6px; }
.perf__row:hover { background: #232323; }
.perf__rowname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perf__rowval { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.crow__actions { margin-top: 8px; }
.crow__toggle { background: #232323; border: 1px solid var(--border); color: var(--text); border-radius: 999px; padding: 3px 12px; font: inherit; font-size: 12px; cursor: pointer; }
.crow__toggle:hover, .crow__toggle.is-open { border-color: var(--accent); color: #fff; }
.crow__ads { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.adrow { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(0, 3.4fr) 140px 32px; align-items: center; gap: 16px; padding: 8px 10px; border-radius: 10px; background: #232323; }
.adrow--head { display: block; background: transparent; padding: 0 4px; color: var(--text-muted); font-size: 12px; }
.adrow__id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.adrow__thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: #2f2f2f; flex-shrink: 0; }
.adrow__thumb--none { display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--text-muted); font-weight: 700; }
.adrow__text { min-width: 0; }
.adrow__name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
a.adrow__name:hover { color: var(--accent); }
.adrow .crow__metric { background: #1e1e1e; }
@media (max-width: 1100px) { .crow__main, .adrow { grid-template-columns: 1fr; } .crow__metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); } .crow__remove { justify-self: end; } }
@media (max-width: 640px) { .crow__metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } .perf-toolbar__right { width: 100%; } }

/* metric tiles: uniform squares, five per row */
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.tile { aspect-ratio: 1 / 1; display: flex; flex-direction: column; justify-content: flex-start; gap: 6px; padding: 16px; border-radius: 12px; position: relative; overflow: hidden; min-width: 0; }
.tile__label { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
.tile__value { font-size: clamp(22px, 2.1vw, 30px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .perf__delta { font-size: 12px; }
.tile__delta--none { visibility: hidden; }
.tile__spark { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 34%; display: block; pointer-events: none; }
.tile > * { position: relative; z-index: 1; }
.tile > .tile__spark { position: absolute; z-index: 0; }
/* campaign cards: full width, switch on the left */
.crow__main { grid-template-columns: auto minmax(240px, 1.2fr) minmax(0, 4fr) 120px 32px; }
.crow.is-off { opacity: 0.55; }
.crow.is-off .crow__metrics, .crow.is-off .crow__spark { filter: grayscale(1); }
.switch { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { width: 42px; height: 24px; border-radius: 999px; background: #3a3a3a; position: relative; transition: background 0.15s; }
.switch__track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked + .switch__track { background: var(--success); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch__text { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.crow__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .crow__main { grid-template-columns: auto 1fr; } .crow__main .crow__metrics, .crow__main .crow__spark { grid-column: 1 / -1; } .crow__main .crow__remove { grid-column: 2; } }
@media (max-width: 640px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.metacard { margin-top: 24px; } .metacard .notice { margin: 10px 0; } .metacard__row { display: flex; gap: 8px; flex-wrap: wrap; } .metacard__row input { flex: 1; min-width: 240px; }

/* ===== Campaigns tab: console look ===== */
.perf-page { --con-bg: #0f0f0f; --con-panel: #141414; --con-line: rgba(255,255,255,0.07); --con-line-strong: rgba(255,255,255,0.14); --con-mute: #8a908c; --con-green: #2ee6a6; --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  background: var(--con-bg); border: 1px solid var(--con-line); border-radius: 16px; padding: 20px 22px 26px; position: relative; overflow: hidden;
  background-image: linear-gradient(var(--con-line) 1px, transparent 1px), linear-gradient(90deg, var(--con-line) 1px, transparent 1px); background-size: 120px 120px, 120px 120px; background-position: -1px -1px; }
.perf-page > * { position: relative; }
.perf-page .mono, .perf-page .tile__label, .perf-page .crow__label, .perf-page .perf__label, .perf-page .steps__item, .perf-page .chart__tick, .perf-page .chart__legend { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.16em; font-size: 11px; color: var(--con-mute); }
.perf-page .crow__label { letter-spacing: 0.08em; font-size: 10px; }
.perf-page .perf-toolbar { margin-bottom: 18px; }
.perf-page .perf-toolbar .card__title { font-size: 18px; letter-spacing: -0.01em; }
.perf-page .perf-toolbar div.muted { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.perf-page .table__input, .perf-page .btn { background: var(--con-panel); border: 1px solid var(--con-line-strong); border-radius: 8px; }
.perf-page .btn--primary { background: var(--con-green); border-color: var(--con-green); color: #061a12; font-weight: 700; }
.perf-page .btn--primary:hover { filter: brightness(1.08); }
.perf-page .notice { background: var(--con-panel); border-color: var(--con-line-strong); border-radius: 10px; }
.perf-page .notice--ok .notice__dot { background: var(--con-green); box-shadow: 0 0 10px var(--con-green); }
.con__head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 0 14px; border-bottom: 1px solid var(--con-line); margin-bottom: 26px; }
.con__head span:first-child { color: var(--text); }
/* hero */
.hero { padding: 6px 4px 26px; }
.hero__nums { display: flex; align-items: flex-end; gap: 36px; flex-wrap: wrap; margin-bottom: 26px; }
.hero__big { font-size: clamp(44px, 5.4vw, 72px); font-weight: 800; letter-spacing: -0.04em; line-height: 1; margin: 10px 0 8px; color: #d7dbd9; font-variant-numeric: tabular-nums; }
.hero__big.is-green { color: var(--con-green); text-shadow: 0 0 24px rgba(46, 230, 166, 0.35); }
.hero__sub { color: var(--con-mute); font-size: 14px; }
.hero__but { align-self: center; padding-bottom: 26px; }
.split { display: flex; gap: 4px; height: 34px; padding: 3px; border: 1px solid var(--con-line-strong); border-radius: 10px; background: rgba(255,255,255,0.02); }
.split__seg { border-radius: 6px; min-width: 6px; transition: flex 0.3s; }
.split__seg.is-best { background: var(--con-green); box-shadow: 0 0 16px rgba(46, 230, 166, 0.55); }
.split__legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 40px; margin-top: 18px; }
.split__row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; font-size: 15px; color: #c9cecb; }
.split__row.is-best { color: #fff; font-weight: 600; }
.split__row--note { grid-column: 1 / -1; }
.split__dot { width: 10px; height: 10px; border-radius: 3px; background: #6a706d; flex-shrink: 0; }
.split__row.is-best .split__dot { background: var(--con-green); box-shadow: 0 0 10px rgba(46, 230, 166, 0.6); }
.split__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.split__val { font-family: var(--mono); font-size: 13px; color: var(--con-mute); letter-spacing: 0.02em; white-space: nowrap; }
.split__row.is-best .split__val { color: var(--con-green); }
/* tiles */
.perf-page .tiles { gap: 12px; }
.perf-page .tile { background: var(--con-panel); border: 1px solid var(--con-line); border-radius: 12px; box-shadow: none; }
.perf-page .tile:hover { border-color: var(--con-line-strong); }
.perf-page .tile__value { font-weight: 800; color: #e6eae8; font-variant-numeric: tabular-nums; }
.perf-page .tile .perf__delta { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; }
.perf-page .perf__delta.is-up { color: var(--con-green); } .perf-page .perf__delta.is-down { color: #ff6b5e; }
/* campaign cards */
.perf-page .crow-head { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.16em; font-size: 11px; color: var(--con-mute); margin: 26px 4px 10px; }
.perf-page .crow-head span:first-child { color: var(--text); }
.perf-page .crow { background: var(--con-panel); border: 1px solid var(--con-line); border-radius: 14px; }
.perf-page .crow:hover { border-color: var(--con-line-strong); }
.perf-page .crow__metric { background: #0f0f0f; border: 1px solid var(--con-line); }
.perf-page .crow__num { font-variant-numeric: tabular-nums; }
.perf-page .crow__name { font-size: 16px; letter-spacing: -0.01em; }
.perf-page .switch input:checked + .switch__track { background: var(--con-green); box-shadow: 0 0 12px rgba(46, 230, 166, 0.5); }
.perf-page .switch__track::after { background: #0f0f0f; }
.perf-page .crow__toggle { background: #0f0f0f; }
.crow__result { background: #0f0f0f; border: 1px solid var(--con-line-strong); color: var(--text); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 12px; max-width: 100%; min-width: 0; }
.perf-page .adrow { background: #0f0f0f; border: 1px solid var(--con-line); }
.perf-page .adrow .crow__metric { background: #141414; }
.perf-page .badge--live { background: rgba(46, 230, 166, 0.12); color: var(--con-green); }
.perf-page .metacard { background: var(--con-panel); border: 1px solid var(--con-line); border-radius: 14px; }
.perf-page .picker__panel { background: var(--con-panel); border-color: var(--con-line-strong); }
@media (max-width: 640px) { .perf-page { padding: 14px; } .hero__nums { gap: 18px; } .hero__but { display: none; } .split__legend { grid-template-columns: 1fr; } }

/* metrics chooser */
.tile--add { cursor: pointer; border-style: dashed !important; background: transparent !important; align-items: center; justify-content: center; gap: 8px; color: var(--text-muted); font: inherit; }
.tile--add:hover { color: var(--text); border-color: var(--con-green) !important; }
.tile__plus { font-size: 34px; line-height: 1; font-weight: 300; }
.mgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; min-height: 0; flex: 1; overflow: hidden; }
.mgrid__col { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: auto; }
.mlist { display: flex; flex-direction: column; gap: 6px; }
.mlist__row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto auto; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.mlist__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mlist__group { font-size: 10px; letter-spacing: 0.08em; }
.mlist__btn { background: transparent; border: 1px solid var(--border); color: var(--text-muted); border-radius: 6px; width: 26px; height: 26px; cursor: pointer; font-size: 11px; }
.mlist__btn:hover:not(:disabled) { color: var(--text); border-color: var(--text-muted); } .mlist__btn:disabled { opacity: 0.3; cursor: default; }
.mlist__btn--x:hover { color: var(--danger); border-color: var(--danger); }
.mcat { display: flex; flex-direction: column; gap: 4px; }
.mcat__item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.mcat__item:hover { background: var(--bg-hover); }
.mcat__item.is-added { color: var(--con-green, #3ec27a); }
.mcat__item.is-full { opacity: 0.45; cursor: not-allowed; }
@media (max-width: 640px) { .mgrid { grid-template-columns: 1fr; } }
.metasays { margin-top: 6px; } .metasays summary { cursor: pointer; list-style: none; } .metasays summary::before { content: '▸ '; } .metasays[open] summary::before { content: '▾ '; } .metasays__body { margin-top: 6px; padding: 8px 10px; border: 1px dashed var(--border); border-radius: 8px; font-size: 12px; color: var(--text-muted); word-break: break-word; }

/* best creatives strip */
.bestc { margin: 6px 0 10px; }
.bc-head__right { display: inline-flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; }
.bc-nav { padding: 2px 10px; font-size: 16px; line-height: 1.2; }
.bestc-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.bc { position: relative; padding: 12px; border-radius: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.perf-page .bc { background: var(--con-panel); border: 1px solid var(--con-line); }
.perf-page .bc.is-top { border-color: var(--con-green); box-shadow: 0 0 18px rgba(46, 230, 166, 0.18); }
.bc__rank { position: absolute; top: 10px; left: 10px; z-index: 1; background: rgba(0,0,0,0.65); padding: 2px 7px; border-radius: 999px; color: #fff; font-size: 11px; }
.bc.is-top .bc__rank { background: var(--con-green); color: #061a12; }
.bc__frame { display: block; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; background: #0b0b0b; }
.bc__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bc__img--none { display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 12px; }
.bc__name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc__meta { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc__stats { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--con-line, var(--border)); padding-top: 8px; }
.bc__stat { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; }
.bc__label { font-family: var(--mono, monospace); text-transform: uppercase; letter-spacing: 0.08em; font-size: 10px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc__num { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 1100px) { .bestc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .bestc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
