: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; }
