:root {
  --bg: #07111f;
  --bg-soft: #0d1a2c;
  --panel: rgba(16, 30, 50, 0.9);
  --panel-2: rgba(20, 38, 64, 0.78);
  --line: rgba(142, 169, 205, 0.22);
  --line-strong: rgba(50, 211, 255, 0.42);
  --text: #eef6ff;
  --muted: #8fa4c3;
  --cyan: #32d3ff;
  --blue: #5d8dff;
  --green: #37d68a;
  --warning: #f4b84f;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

/* Business-domain separation: affiliate and Amazon stay visually and structurally distinct. */
.nav-business-section {
  padding: 0 0 6px;
}

.nav-business-section + .nav-business-section {
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-business-label {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 4px 20px 3px;
  color: #a9bbd8;
  font-size: 11px;
  font-weight: 750;
}

.nav-business-label > span {
  width: 6px;
  height: 6px;
  background: #48a3ff;
  border-radius: 50%;
}

.nav-business-amazon .nav-business-label > span {
  background: #ff9f2e;
}

.nav-business-amazon .nav-item.active {
  background: #c96508;
  border-color: #ffbd6d;
}

.nav-icon-box {
  border: 2px solid currentColor;
  border-radius: 2px;
}

.nav-icon-box::before {
  position: absolute;
  top: 3px;
  left: -2px;
  width: 14px;
  border-top: 2px solid currentColor;
  content: "";
  transform: rotate(-18deg);
}

.nav-icon-amazon::before {
  color: currentColor;
  content: "a";
  font-family: Arial, sans-serif;
  font-size: 18px;
  font-weight: 800;
  line-height: 12px;
}

.business-domain-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  color: #175da8;
  background: #eaf4ff;
  border: 1px solid #bdd9f7;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.business-domain-badge.is-amazon {
  color: #8b4700;
  background: #fff3df;
  border-color: #f3c37d;
}

.primary-btn.amazon-primary {
  color: #ffffff;
  background: #dc7208;
  border-color: #c66200;
}

.primary-btn.amazon-primary:hover {
  background: #bd5e00;
}

.amazon-product-filters {
  grid-template-columns: minmax(300px, 1.8fr) repeat(4, minmax(150px, 1fr));
  align-items: end;
}

.amazon-product-filters .field-wide {
  grid-column: span 2;
}

.amazon-product-filter-reset {
  align-self: end;
  min-height: 50px;
}

.amazon-product-table-shell {
  overflow-x: auto;
}

.amazon-product-table {
  min-width: 2240px;
}

.amazon-product-pagination {
  flex-wrap: wrap;
  padding: 14px 16px;
}

.amazon-product-pagination-top {
  background: #fbfcff;
  border-bottom: 1px solid var(--line);
}

.amazon-product-pagination .pagination-controls {
  flex-wrap: wrap;
}

.amazon-product-head,
.amazon-product-row {
  display: grid;
  grid-template-columns:
    minmax(230px, 1.35fr)
    175px
    160px
    145px
    130px
    125px
    125px
    120px
    115px
    125px
    135px
    125px
    145px
    230px;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e3e9f2;
}

.amazon-product-head {
  min-height: 46px;
  color: #60708a;
  background: #f5f7fb;
  font-size: 12px;
  font-weight: 800;
}

.amazon-product-sort-button {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.amazon-product-sort-button small {
  color: #95a1b5;
  font-size: 10px;
  font-weight: 700;
}

.amazon-product-sort-button.is-active,
.amazon-product-sort-button.is-active small {
  color: #1778e8;
}

.amazon-product-row {
  min-height: 104px;
  color: #2f3e56;
  background: #ffffff;
}

.amazon-product-row:nth-child(odd) {
  background: #fbfcfe;
}

.amazon-product-row:hover {
  background: #fff8ed;
}

.amazon-product-identity {
  display: flex;
  gap: 11px;
  align-items: center;
  min-width: 0;
}

.amazon-product-image {
  display: grid;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  overflow: hidden;
  place-items: center;
  color: #a45200;
  background: #fff1db;
  border: 1px solid #f0c481;
  border-radius: 6px;
  font-weight: 850;
}

.amazon-product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
}

.amazon-product-actions {
  justify-content: flex-end;
}

.amazon-product-row .cell-stack {
  min-width: 0;
}

.amazon-product-row .cell-stack > strong,
.amazon-product-row .cell-stack > span,
.amazon-product-row .cell-stack > small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amazon-product-link-cell {
  align-items: flex-start;
}

.amazon-product-link-cell .table-text-link {
  color: #1778e8;
  font-weight: 800;
  text-decoration: none;
}

.amazon-product-link-cell .table-text-link:hover {
  text-decoration: underline;
}

.amazon-product-row .cell-stack > small {
  color: #8a98ad;
  font-size: 11px;
}

.amazon-product-actions .small {
  min-height: 30px;
  padding: 4px 7px;
  font-size: 11px;
}

.amazon-offer-page {
  display: grid;
  gap: 14px;
}

.amazon-offer-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.amazon-offer-summary > div {
  min-height: 84px;
}

.amazon-offer-filters {
  grid-template-columns: minmax(360px, 1fr) 180px 180px auto;
}

.amazon-offer-table-shell {
  overflow-x: auto;
  background: #ffffff;
  border: 1px solid #dce4ef;
  border-radius: 6px;
}

.amazon-offer-table {
  min-width: 1120px;
}

.amazon-offer-head,
.amazon-offer-row {
  display: grid;
  grid-template-columns: 150px minmax(210px, 1.35fr) 110px minmax(190px, 1.15fr) 105px 120px 230px;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e3e9f2;
}

.amazon-offer-head {
  min-height: 46px;
  color: #60708a;
  background: #f5f7fb;
  font-size: 12px;
  font-weight: 800;
}

.amazon-offer-row {
  min-height: 82px;
  color: #2f3e56;
  background: #ffffff;
}

.amazon-offer-row:nth-child(odd) {
  background: #fbfcfe;
}

.amazon-offer-row:hover {
  background: #fff8ed;
}

.amazon-offer-row .cell-stack {
  min-width: 0;
}

.amazon-offer-row .cell-stack small,
.amazon-offer-row .cell-stack span {
  overflow: hidden;
  color: #72819a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amazon-offer-actions {
  justify-content: flex-end;
}

.amazon-offer-actions .small {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 11px;
}

.amazon-offer-pagination {
  flex-wrap: wrap;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid #dce4ef;
  border-radius: 6px;
}

.amazon-empty-state > div {
  display: grid;
  gap: 8px;
  text-align: center;
}

.amazon-empty-state strong {
  color: #2f3e56;
}

.business-context-strip {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  color: #285b91;
  background: #eef6ff;
  border: 1px solid #c7def7;
  border-radius: 6px;
}

.business-context-strip.is-amazon {
  color: #7d4307;
  background: #fff6e8;
  border-color: #efcc98;
}

.business-context-strip span {
  color: inherit;
  font-size: 12px;
}

.is-amazon-task {
  box-shadow: inset 3px 0 0 #e78420;
}

.amazon-launch-note {
  color: #74400c;
  background: #fff6e8;
  border-left-color: #e78420;
}

@media (max-width: 980px) {
  .nav-business-section {
    display: contents;
  }

  .nav-business-label {
    display: none;
  }

  .nav-business-section + .nav-business-section {
    border-top: 0;
  }

  .amazon-product-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .amazon-offer-filters {
    grid-template-columns: minmax(260px, 1fr) repeat(2, 160px) auto;
  }
}

@media (max-width: 680px) {
  .amazon-product-filters {
    grid-template-columns: 1fr;
  }

  .amazon-offer-summary,
  .amazon-offer-filters {
    grid-template-columns: 1fr;
  }

  .business-context-strip {
    display: grid;
    gap: 5px;
  }

  .amazon-product-pagination .pagination-controls {
    width: 100%;
    margin-left: 0;
  }
}

/* Keep the Amazon filters visible as real, combinable controls in the light theme. */
.offer-panel .amazon-product-filters {
  grid-template-columns: minmax(300px, 1.8fr) repeat(4, minmax(150px, 1fr));
  align-items: end;
}

@media (max-width: 1320px) {
  .offer-panel .amazon-product-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .offer-panel .amazon-product-filters {
    grid-template-columns: 1fr;
  }

  .amazon-product-filters .field-wide {
    grid-column: auto;
  }
}

.mcc-claim-diagnostic,
.workflow-path-note {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 4px;
}

.mcc-claim-diagnostic.error {
  background: #fff1f0;
  border: 1px solid #ffb3b8;
  color: #9f2430;
}

.mcc-claim-diagnostic.warning {
  background: #fff8e6;
  border: 1px solid #f2c66d;
  color: #7d5412;
}

.mcc-claim-diagnostic.info,
.workflow-path-note {
  background: #eef6ff;
  border: 1px solid #9dc6ff;
  color: #234a75;
}

.workflow-path-note code {
  overflow-wrap: anywhere;
}

.tracking-suffix-warning {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  color: #7d5412;
  background: #fff8e6;
  border: 1px solid #f2c66d;
  border-radius: 4px;
}

.tracking-suffix-warning.wide {
  grid-column: 1 / -1;
}

.tracking-suffix-warning strong {
  color: #9a6300;
}

.tracking-suffix-warning code {
  color: inherit;
  overflow-wrap: anywhere;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background:
    linear-gradient(120deg, rgba(15, 70, 88, 0.28), rgba(15, 20, 43, 0.5) 44%, rgba(16, 23, 43, 0.88)),
    #07111f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  height: 100vh;
  min-height: 0;
}

.sidebar {
  min-width: 0;
  padding: 24px 18px;
  overflow-y: auto;
  background: rgba(7, 18, 32, 0.94);
  border-right: 1px solid var(--line);
  box-shadow: 18px 0 42px rgba(0, 0, 0, 0.22);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}

.avatar,
.merchant-logo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #00111d;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border-radius: 12px;
  font-weight: 900;
}

.brand-name {
  font-size: 24px;
  font-weight: 850;
  line-height: 1.1;
}

.muted {
  color: var(--muted);
}

.account-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 20px;
  gap: 14px;
  align-items: center;
  padding: 14px;
  margin-bottom: 28px;
  background: rgba(15, 29, 49, 0.92);
  border: 1px solid rgba(115, 144, 185, 0.28);
  border-radius: 12px;
}

.avatar {
  width: 58px;
  height: 58px;
  font-size: 23px;
}

.account-meta {
  min-width: 0;
}

.account-meta strong,
.account-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-meta span {
  margin-top: 4px;
  color: var(--muted);
}

.chevron {
  color: var(--muted);
}

.account-logout {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
}

.account-logout:hover {
  color: var(--text);
  border-color: var(--line);
  background: rgba(50, 211, 255, 0.08);
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  padding: 28px;
  place-items: center;
  background:
    linear-gradient(120deg, rgba(15, 70, 88, 0.25), rgba(15, 20, 43, 0.62) 48%, rgba(16, 23, 43, 0.92)),
    #07111f;
}

.auth-panel {
  width: min(420px, 100%);
  padding: 32px;
  background: rgba(10, 23, 39, 0.96);
  border: 1px solid rgba(142, 169, 205, 0.26);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.auth-brand strong,
.auth-brand span {
  display: block;
}

.auth-brand strong {
  font-size: 21px;
}

.auth-heading {
  margin: 28px 0 22px;
}

.auth-heading h1 {
  margin: 0;
  font-size: 30px;
}

.auth-heading p {
  margin: 8px 0 0;
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 18px;
}

.auth-form label,
.auth-form label span {
  display: grid;
  gap: 8px;
}

.auth-form label span {
  color: #afc1dc;
  font-size: 14px;
  font-weight: 750;
}

.auth-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  color: var(--text);
  background: #081422;
  border: 1px solid rgba(142, 169, 205, 0.3);
  border-radius: 7px;
  outline: none;
}

.auth-form input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(50, 211, 255, 0.12);
}

.auth-form .primary-btn {
  min-height: 48px;
  margin-top: 4px;
}

.auth-error {
  padding: 12px 14px;
  margin-bottom: 18px;
  color: #ffd0cc;
  background: rgba(255, 96, 84, 0.12);
  border: 1px solid rgba(255, 96, 84, 0.34);
  border-radius: 7px;
}

.auth-loading {
  color: var(--muted);
  font-weight: 700;
}

.nav-group {
  margin-bottom: 24px;
}

.nav-label {
  margin: 0 0 10px 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.nav-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  width: 100%;
  height: 46px;
  padding: 0 14px;
  margin: 5px 0;
  color: #a8bad5;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
}

.nav-item:hover,
.nav-item.active {
  color: var(--text);
  background: rgba(50, 211, 255, 0.12);
  border-color: rgba(50, 211, 255, 0.34);
}

.nav-item.active {
  box-shadow: inset 3px 0 0 var(--cyan);
}

.nav-icon {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 16px;
  color: var(--cyan);
}

.nav-icon-grid {
  background-image:
    linear-gradient(currentColor 2px, transparent 2px),
    linear-gradient(90deg, currentColor 2px, transparent 2px);
  background-size: 6px 6px;
  opacity: 0.85;
}

.nav-icon-diamond {
  border: 2px solid currentColor;
  transform: rotate(45deg) scale(0.72);
}

.nav-icon-play {
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid currentColor;
}

.nav-icon-swap::before {
  content: "↔";
}

.nav-icon-bolt::before {
  content: "⌁";
}

.nav-icon-api::before {
  content: "[]";
}

.nav-icon-queue::before {
  content: "≡";
}

.nav-icon-target {
  border: 2px solid currentColor;
  border-radius: 50%;
}

.nav-icon-target::after {
  position: absolute;
  inset: 4px;
  content: "";
  border: 2px solid currentColor;
  border-radius: 50%;
}

.nav-icon-spark::before {
  content: "✦";
}

.main {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 104px;
  padding: 22px 40px;
  background: rgba(8, 18, 34, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.back-link {
  padding: 0;
  color: var(--muted);
  background: none;
  border: 0;
  font-weight: 750;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 4px;
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1;
}

h2 {
  font-size: 25px;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.mode-pill,
.status-pill,
.list-pill,
.text-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 9px;
  color: #a8c4e6;
  background: rgba(140, 168, 213, 0.12);
  border: 1px solid rgba(140, 168, 213, 0.22);
  border-radius: 999px;
  white-space: nowrap;
}

.content {
  width: 100%;
  max-width: 1740px;
  min-width: 0;
  padding: 28px 40px 52px;
}

.panel,
.metric-card,
.flow-card,
.modal {
  background: linear-gradient(180deg, rgba(18, 32, 54, 0.95), rgba(12, 24, 41, 0.94));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.panel {
  border-radius: 12px;
}

.offer-panel {
  min-width: 0;
  overflow: visible;
}

.offer-panel .panel-head {
  padding: 0 0 22px;
}

.offer-panel .filter-panel {
  padding: 0 0 26px;
  background: transparent;
  border-top: 0;
  border-bottom: 1px solid var(--line-strong);
}

.panel-head {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 28px;
}

.panel-head p {
  max-width: 900px;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.55;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.icon-btn {
  min-height: 42px;
  padding: 0 18px;
  color: var(--text);
  background: rgba(17, 30, 50, 0.92);
  border: 1px solid rgba(129, 156, 198, 0.28);
  border-radius: 10px;
  font-weight: 850;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.primary-btn {
  color: #031622;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border-color: transparent;
}

.ghost-btn {
  color: #c8d7ef;
  background: transparent;
}

.small {
  min-height: 34px;
  padding: 0 8px;
  font-size: 14px;
}

.icon-btn {
  width: 44px;
  padding: 0;
  font-size: 32px;
  line-height: 1;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(290px, 1.8fr) repeat(4, minmax(150px, 1fr));
  gap: 14px;
  padding: 20px 28px;
  background: rgba(15, 30, 50, 0.78);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line-strong);
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field span {
  color: #9eb1cd;
  font-size: 14px;
  font-weight: 850;
}

.field-wide {
  grid-column: span 2;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  color: var(--text);
  background: rgba(9, 18, 33, 0.94);
  border: 1px solid rgba(131, 157, 198, 0.25);
  border-radius: 10px;
  outline: none;
}

input,
select {
  height: 52px;
  padding: 0 14px;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--cyan);
}

textarea {
  padding: 14px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(50, 211, 255, 0.14);
}

.filter-button {
  align-self: end;
  width: 100%;
}

.advanced-panel {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  background: rgba(7, 18, 31, 0.74);
  border-bottom: 1px solid var(--line);
}

.advanced-panel span {
  color: var(--muted);
}

.advanced-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.advanced-tags span {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.table-shell {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border-top: 0;
}

.offer-table {
  min-width: 1088px;
}

.offer-head,
.offer-row {
  display: grid;
  grid-template-columns: 34px 200px 150px 240px 92px 56px 84px 190px;
  gap: 6px;
  align-items: center;
  padding: 0 28px;
}

.offer-head {
  min-height: 72px;
  color: #9eb1cd;
  font-size: 14px;
  font-weight: 850;
  background: rgba(13, 25, 43, 0.58);
  border-bottom: 1px solid var(--line);
}

.offer-row {
  min-height: 116px;
  border-bottom: 1px solid var(--line);
}

.offer-panel .offer-head,
.offer-panel .offer-row {
  padding-right: 0;
  padding-left: 0;
}

.offer-row:hover {
  background: rgba(50, 211, 255, 0.05);
}

.merchant-cell {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.merchant-logo {
  width: 42px;
  height: 42px;
  color: var(--cyan);
  background: rgba(50, 211, 255, 0.11);
  border: 1px solid rgba(50, 211, 255, 0.25);
}

.cell-stack {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.merchant-name,
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.has-tooltip {
  position: relative;
}

.has-tooltip:hover {
  z-index: 3;
}

.has-tooltip:hover::after {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  width: max-content;
  max-width: 320px;
  padding: 8px 10px;
  color: var(--text);
  content: attr(data-tooltip);
  background: rgba(5, 13, 25, 0.98);
  border: 1px solid rgba(91, 207, 255, 0.5);
  border-radius: 6px;
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  white-space: normal;
  pointer-events: none;
}

.link {
  color: var(--cyan);
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

.text-chip {
  width: 100%;
  max-width: 100%;
  color: var(--text);
  text-align: left;
  background: rgba(36, 52, 78, 0.82);
  border-color: rgba(116, 148, 192, 0.24);
}

.text-chip-strong {
  justify-content: flex-start;
  min-height: 38px;
  height: auto;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.status-pill.good {
  color: #79f2b6;
  background: rgba(55, 214, 138, 0.13);
  border-color: rgba(55, 214, 138, 0.32);
}

.list-pill {
  color: var(--cyan);
  background: rgba(50, 211, 255, 0.12);
  border-color: rgba(50, 211, 255, 0.28);
}

.roi-cell {
  color: #cbd8ed;
  line-height: 1.2;
}

.row-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.row-actions .secondary-btn {
  grid-column: 1 / -1;
}

.workflow-preview {
  display: grid;
  gap: 20px;
  padding: 26px;
}

.workflow-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.workflow-summary > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px 14px;
  background: rgba(8, 18, 32, 0.65);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.workflow-summary span,
.workflow-step small {
  color: var(--muted);
}

.workflow-summary strong {
  overflow-wrap: anywhere;
}

.review-account-selection {
  display: grid;
  gap: 16px;
  padding: 18px;
  background: rgba(11, 29, 49, 0.88);
  border: 1px solid rgba(50, 211, 255, 0.42);
  border-radius: 8px;
}

.review-account-selection-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.review-account-selection-head > div {
  display: grid;
  gap: 5px;
}

.review-account-selection-head span,
.review-account-selection-head p {
  margin: 0;
  color: var(--muted);
}

.review-account-selection-head h3 {
  margin: 0;
}

.workflow-steps {
  display: grid;
  gap: 8px;
}

.workflow-progress-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: rgba(11, 29, 49, 0.88);
  border: 1px solid rgba(50, 211, 255, 0.42);
  border-radius: 8px;
}

.workflow-progress-head {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.workflow-progress-head > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.workflow-progress-head span,
.workflow-progress-card small,
.workflow-step-timing,
.workflow-row-progress {
  color: var(--muted);
}

.workflow-progress-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-progress-track {
  height: 8px;
  overflow: hidden;
  background: rgba(129, 156, 193, 0.16);
  border-radius: 4px;
}

.workflow-progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #22c9f3, #4d8eff);
  transition: width 240ms ease;
}

.workflow-step {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 11px 13px;
  background: rgba(8, 18, 32, 0.52);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.workflow-step-content {
  display: grid;
  gap: 6px;
}

.workflow-step-title {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.workflow-step-state {
  flex: 0 0 auto;
  padding: 3px 9px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.workflow-step.completed {
  background: rgba(55, 214, 138, 0.07);
  border-color: rgba(55, 214, 138, 0.48);
}

.workflow-step.completed .workflow-step-state {
  color: #79f2b6;
}

.workflow-step.completed .step-index {
  color: #79f2b6 !important;
  background: rgba(55, 214, 138, 0.12);
  border-color: rgba(55, 214, 138, 0.48);
}

.workflow-step.pending,
.workflow-step.failed,
.workflow-step.blocked {
  background: rgba(255, 92, 92, 0.065);
  border-color: rgba(255, 92, 92, 0.48);
}

.workflow-step.pending .workflow-step-state,
.workflow-step.failed .workflow-step-state,
.workflow-step.blocked .workflow-step-state {
  color: #ff8f8f;
}

.workflow-step.pending .step-index,
.workflow-step.failed .step-index,
.workflow-step.blocked .step-index {
  color: #ff8f8f !important;
  background: rgba(255, 92, 92, 0.1);
  border-color: rgba(255, 92, 92, 0.48);
}

.workflow-step.waiting,
.workflow-step.running {
  background: rgba(50, 211, 255, 0.08);
  border-color: rgba(50, 211, 255, 0.58);
  box-shadow: inset 3px 0 0 rgba(50, 211, 255, 0.9);
}

.workflow-step.waiting .workflow-step-state,
.workflow-step.running .workflow-step-state,
.workflow-step.waiting .step-index,
.workflow-step.running .step-index {
  color: #4ee3ff !important;
  border-color: rgba(50, 211, 255, 0.58);
}

.workflow-step.waiting .workflow-step-state::before,
.workflow-step.running .workflow-step-state::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  content: "";
  background: currentColor;
  border-radius: 50%;
  animation: workflow-pulse 1s ease-in-out infinite;
}

@keyframes workflow-pulse {
  50% { opacity: 0.28; }
}

.step-index {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--text) !important;
  background: rgba(50, 211, 255, 0.11);
  border: 1px solid rgba(50, 211, 255, 0.24);
  border-radius: 50%;
  font-weight: 850;
}

.workflow-links {
  display: grid;
  gap: 14px;
}

.workflow-test-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: rgba(5, 17, 31, 0.42);
}

.workflow-test-link div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.workflow-test-link small {
  color: var(--muted);
}

.workflow-test-link a {
  flex: 0 0 auto;
  text-decoration: none;
}

.ad-copy-preview {
  display: grid;
  gap: 7px;
  padding: 14px;
  background: rgba(8, 18, 32, 0.65);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ad-copy-preview span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.task-center {
  display: grid;
  gap: 18px;
}

.task-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.task-metrics > div {
  display: flex;
  min-height: 82px;
  padding: 16px 18px;
  align-items: center;
  justify-content: space-between;
  background: rgba(9, 20, 35, 0.72);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.task-metrics span,
.task-row .cell-stack > span,
.task-time {
  color: var(--muted);
}

.task-metrics strong {
  color: var(--cyan);
  font-size: 28px;
}

.task-toolbar {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 230px auto;
  gap: 12px;
  align-items: end;
}

.task-add {
  height: 50px;
}

.task-table-shell {
  min-width: 0;
  overflow-x: auto;
  border-top: 1px solid var(--line-strong);
}

.task-table {
  min-width: 880px;
}

.task-head,
.task-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) 95px 120px minmax(160px, 1fr) 80px 230px;
  gap: 8px;
  align-items: center;
  padding: 14px 8px;
  border-bottom: 1px solid var(--line);
}

.task-head {
  min-height: 56px;
  color: var(--muted);
  font-weight: 850;
}

.task-row {
  min-height: 92px;
}

.task-row .cell-stack,
.task-row .cell-stack strong,
.task-row .cell-stack span {
  min-width: 0;
}

.ads-state-line {
  color: #7f9aba !important;
  font-size: 11px;
  white-space: nowrap;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.task-actions .small {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 12px;
}

.ghost-btn.danger {
  color: #ffaaa3;
  border-color: rgba(255, 110, 100, 0.34);
}

.modal-subtitle {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.template-confirmation {
  display: grid;
  gap: 16px;
  padding: 26px;
}

.template-note {
  padding: 12px 14px;
  color: #c6d7ee;
  background: rgba(50, 211, 255, 0.08);
  border-left: 3px solid var(--cyan);
}

.template-preflight {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: rgba(45, 132, 237, 0.08);
  border: 1px solid rgba(45, 132, 237, 0.32);
  border-radius: 6px;
}

.template-preflight.passed {
  background: rgba(32, 163, 93, 0.08);
  border-color: rgba(32, 163, 93, 0.4);
}

.template-preflight.failed {
  background: rgba(212, 70, 82, 0.08);
  border-color: rgba(212, 70, 82, 0.42);
}

.template-preflight.warning {
  background: rgba(224, 157, 28, 0.1);
  border-color: rgba(224, 157, 28, 0.48);
}

.template-preflight-title {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.template-preflight-title span {
  color: var(--muted);
  font-size: 12px;
}

.template-preflight p,
.template-preflight small {
  margin: 0;
}

.template-preflight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.template-preflight-grid > span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
}

.template-preflight-grid strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-preflight-grid small,
.template-preflight-disclaimer {
  color: var(--muted);
}

.workflow-preflight-audit {
  margin-top: 2px;
}

.template-preflight-urls {
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.template-preflight-urls summary {
  width: fit-content;
  cursor: pointer;
  color: var(--blue);
  font-weight: 600;
}

.template-preflight-urls > span {
  display: grid;
  gap: 4px;
  min-width: 0;
  margin-top: 8px;
}

.template-preflight-urls code {
  display: block;
  max-height: 92px;
  overflow: auto;
  padding: 8px 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.template-field-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.template-field-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.template-field-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  background: rgba(8, 18, 32, 0.62);
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
}

.template-field-item > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.template-field-item strong,
.template-field-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-field-item small {
  color: var(--muted);
}

.template-field-item em {
  color: #79f2b6;
  font-style: normal;
  font-weight: 800;
}

.template-field-item.is-removed {
  border-color: rgba(255, 110, 100, 0.38);
  opacity: 0.7;
}

.template-field-item.is-removed em {
  color: #ffaaa3;
}

.empty-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  color: var(--muted);
}

.table-footer {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  color: var(--muted);
  background: transparent;
  border-top: 1px solid var(--line);
}

.pagination-footer {
  flex-wrap: wrap;
}

.pagination-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-left: auto;
}

.pagination-controls > span {
  color: var(--text);
  font-weight: 750;
  white-space: nowrap;
}

.page-select select {
  width: auto;
  height: 34px;
  padding: 0 28px 0 10px;
  font-size: 14px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.api-panel {
  overflow: hidden;
}

.integration-layout {
  display: grid;
  gap: 18px;
}

.integration-card {
  padding: 24px;
  background: rgba(9, 20, 35, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.integration-head,
.integration-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.integration-head > div {
  min-width: 0;
}

.integration-head p {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.integration-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.integration-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.is-hidden,
.s5-mode-group.is-hidden {
  display: none;
}

.s5-test-summary.is-success {
  color: var(--green);
}

.integration-alert {
  margin-top: 14px;
  padding: 11px 13px;
  color: #ffe0a3;
  background: rgba(244, 184, 79, 0.1);
  border: 1px solid rgba(244, 184, 79, 0.34);
  border-radius: 6px;
}

.integration-alert.is-error {
  color: #ffadad;
  background: rgba(255, 91, 91, 0.1);
  border-color: rgba(255, 91, 91, 0.4);
}

.ai-saved-config {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  background: rgba(50, 211, 255, 0.05);
  border: 1px solid rgba(50, 211, 255, 0.22);
  border-radius: 8px;
}

.ai-saved-config-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.ai-config-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.s5-provider-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.s5-provider-row {
  display: grid;
  grid-template-columns: 42px minmax(220px, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: rgba(8, 18, 32, 0.62);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.priority-badge {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--cyan);
  background: rgba(50, 211, 255, 0.1);
  border: 1px solid rgba(50, 211, 255, 0.26);
  border-radius: 6px;
  font-weight: 900;
}

.s5-provider-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.s5-provider-main span {
  color: var(--muted);
}

.s5-provider-main .s5-test-summary {
  color: #88a5c8;
  font-size: 13px;
  line-height: 1.35;
}

.s5-provider-main .s5-test-summary.is-error {
  color: #f4b86f;
}

.s5-provider-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}

.empty-state.compact {
  min-height: 100px;
}

.modal-integration-form {
  padding: 26px;
  margin-top: 0;
}

.toggle-field {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  color: #9eb1cd;
  font-weight: 850;
}

.toggle-field input {
  flex: 0 0 auto;
}

.api-grid {
  display: grid;
  gap: 16px;
  padding: 0 28px 28px;
}

.api-card {
  display: grid;
  gap: 18px;
  padding: 22px;
  background: rgba(8, 18, 32, 0.62);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.api-card-head,
.api-card-actions {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
}

.api-card h3,
.api-empty h3 {
  margin: 0;
  font-size: 22px;
}

.api-card p,
.api-empty p {
  margin-top: 8px;
  color: var(--muted);
}

.api-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.api-meta-grid > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  background: rgba(15, 30, 50, 0.58);
  border: 1px solid rgba(120, 148, 190, 0.16);
  border-radius: 8px;
}

.api-meta-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.api-meta-grid strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-meta-grid .credential-ok {
  color: #63e6a9;
}

.api-meta-grid .credential-missing {
  color: #ffbf7a;
}

.api-meta-grid .offer-count {
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}

.mapping-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mapping-strip span {
  padding: 7px 10px;
  color: #b8c9e4;
  background: rgba(140, 168, 213, 0.1);
  border: 1px solid rgba(140, 168, 213, 0.18);
  border-radius: 999px;
}

.api-empty {
  display: grid;
  justify-items: start;
  gap: 14px;
  min-height: 260px;
  padding: 32px 28px;
  border-top: 1px solid var(--line);
}

.api-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 26px;
}

.metrics-grid,
.flow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.metric-card,
.flow-card {
  min-height: 126px;
  padding: 22px;
  border-radius: 12px;
}

.metric-card span,
.flow-card span {
  display: block;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin-top: 14px;
  font-size: 34px;
}

.flow-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 18px;
}

.flow-card.active {
  border-color: var(--line-strong);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 30px;
  background: rgba(0, 0, 0, 0.58);
}

.modal {
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 60px));
  overflow: auto;
  border-radius: 14px;
}

.modal-large {
  width: min(1020px, 100%);
}

.modal-head {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  border-bottom: 1px solid var(--line);
}

.detail-grid,
.launch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 26px;
}

.ads-account-picker {
  min-width: 0;
  padding: 0;
  border: 0;
}

.ads-account-picker legend {
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 700;
}

.launch-account-note {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  background: rgba(50, 211, 255, 0.07);
  border: 1px solid rgba(50, 211, 255, 0.32);
  border-radius: 8px;
}

.launch-account-note small {
  color: var(--muted);
}

.ads-manager-list {
  display: grid;
  gap: 16px;
  max-height: 340px;
  overflow: auto;
}

.ads-manager-group {
  display: grid;
  gap: 8px;
}

.ads-manager-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.ads-manager-head small {
  color: var(--muted);
}

.ads-account-list {
  display: grid;
  gap: 8px;
}

.ads-account-option {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) minmax(130px, 0.65fr) auto minmax(130px, auto);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px 14px;
  cursor: pointer;
  background: rgba(8, 18, 32, 0.65);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ads-account-option:has(input:checked) {
  background: rgba(50, 211, 255, 0.08);
  border-color: rgba(50, 211, 255, 0.62);
}

.ads-account-option.is-unavailable {
  cursor: not-allowed;
  background: rgba(255, 90, 110, 0.055);
  border-color: rgba(255, 90, 110, 0.28);
}

.ads-account-option.is-locked {
  cursor: not-allowed;
  background: rgba(245, 158, 11, 0.065);
  border-color: rgba(245, 158, 11, 0.34);
}

.ads-account-option.is-unavailable .ads-account-main,
.ads-account-option.is-unavailable .ads-account-budget,
.ads-account-option.is-unavailable .ads-account-count,
.ads-account-option.is-locked .ads-account-main,
.ads-account-option.is-locked .ads-account-budget,
.ads-account-option.is-locked .ads-account-count {
  opacity: 0.68;
}

.ads-account-budget {
  display: grid;
  gap: 3px;
  min-width: 0;
  justify-items: start;
}

.ads-account-budget small {
  color: var(--muted);
  font-size: 12px;
}

.ads-account-budget strong {
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-account-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.ads-account-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ads-account-main strong,
.ads-account-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-account-main small,
.ads-account-count {
  color: var(--muted);
}

.status-pill.busy {
  color: #ffca80;
  background: rgba(255, 174, 64, 0.12);
  border-color: rgba(255, 174, 64, 0.32);
}

.ads-account-empty {
  padding: 16px;
  color: var(--muted);
  background: rgba(8, 18, 32, 0.65);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.mcc-overview {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-block: 1px solid var(--line);
}

.mcc-overview > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 20px 24px;
  border-right: 1px solid var(--line);
}

.mcc-overview > div:last-child {
  border-right: 0;
}

.mcc-overview span,
.mcc-table-head,
.mcc-account-cell small,
.mcc-campaign-cell small,
.mcc-table-row time,
.muted-text {
  color: var(--muted);
}

.mcc-overview strong {
  color: var(--cyan);
  font-size: 30px;
  line-height: 1;
}

.mcc-overview strong.danger-number {
  color: #e05a67;
}

.mcc-management {
  padding: 24px 0 0;
}

.mcc-management-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 0 24px 20px;
}

.mcc-management-head h2 {
  margin: 0 0 6px;
  font-size: 24px;
}

.mcc-management-head p {
  margin: 0;
  color: var(--muted);
}

.mcc-filter-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) repeat(3, minmax(170px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 0 24px 22px;
  border-bottom: 1px solid var(--line);
}

.mcc-filter-bar .field {
  min-width: 0;
}

.mcc-filter-bar .field span {
  margin-bottom: 6px;
}

.mcc-filter-bar input,
.mcc-filter-bar select {
  min-height: 44px;
  padding: 0 12px;
}

.mcc-reset {
  min-height: 44px;
}

.mcc-subsection-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 24px 12px;
}

.mcc-subsection-head h3,
.mcc-subsection-head p {
  margin: 0;
}

.mcc-subsection-head h3 {
  font-size: 17px;
}

.mcc-subsection-head p,
.mcc-subsection-head > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.mcc-subsection-head.campaign-heading {
  margin-top: 10px;
  border-top: 1px solid var(--line);
}

.mcc-account-inventory-wrap {
  min-width: 0;
  overflow-x: auto;
  border-block: 1px solid var(--line);
}

.mcc-account-inventory {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(170px, 1.15fr) 100px 92px 105px 125px 118px;
  gap: 12px;
  align-items: center;
  min-width: 1040px;
  padding-inline: 20px;
}

.mcc-account-inventory-head {
  min-height: 44px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: rgba(8, 18, 32, 0.4);
}

.mcc-account-inventory-row {
  min-height: 64px;
  border-top: 1px solid rgba(54, 78, 108, 0.55);
}

.mcc-account-inventory-row.is-unavailable {
  background: rgba(255, 90, 110, 0.045);
}

.mcc-hidden-accounts {
  margin: 18px 20px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.mcc-hidden-accounts > summary {
  padding: 14px 16px;
  color: #8a5360;
  background: #fff7f8;
  cursor: pointer;
  font-weight: 700;
}

.mcc-hidden-accounts > p {
  margin: 0;
  padding: 10px 16px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.mcc-account-inventory-row > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.mcc-account-inventory-row strong,
.mcc-account-inventory-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mcc-account-inventory-row small,
.mcc-account-inventory-row time {
  color: var(--muted);
  font-size: 12px;
}

.mcc-account-inventory-row > .mcc-availability-cell {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.mcc-availability-cell small {
  line-height: 1.35;
}

.mcc-table-wrap {
  min-width: 0;
  overflow-x: auto;
}

.mcc-table {
  display: grid;
  grid-template-columns: minmax(180px, 1.05fr) minmax(210px, 1.35fr) 84px 96px 110px 88px;
  gap: 10px;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  min-width: 860px;
  padding-inline: 20px;
}

.mcc-table-head {
  min-height: 50px;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}

.mcc-table-row {
  min-height: 74px;
  border-bottom: 1px solid rgba(54, 78, 108, 0.55);
}

.mcc-table-row:hover {
  background: rgba(50, 211, 255, 0.035);
}

.mcc-account-cell,
.mcc-campaign-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.mcc-account-cell strong,
.mcc-account-cell small,
.mcc-campaign-cell strong,
.mcc-campaign-cell small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mcc-budget,
.mcc-table-row time {
  font-variant-numeric: tabular-nums;
}

.removal-audit-heading {
  margin-top: 24px;
  border-top: 1px solid var(--line);
}

.mcc-removal-audit-wrap {
  min-width: 0;
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

.mcc-removal-audit {
  display: grid;
  grid-template-columns: minmax(150px, 0.85fr) minmax(210px, 1.2fr) minmax(210px, 1.25fr) 150px 120px 120px;
  gap: 12px;
  align-items: center;
  min-width: 1080px;
  padding: 14px 20px;
}

.mcc-removal-audit-head {
  min-height: 48px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  background: var(--panel-strong);
}

.mcc-removal-audit-row {
  min-height: 72px;
  border-top: 1px solid var(--line);
}

.mcc-removal-audit-row > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.mcc-removal-audit-row strong,
.mcc-removal-audit-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mcc-removal-audit-row time {
  font-variant-numeric: tabular-nums;
}

.status-pill.danger {
  color: #ff9ca8;
  background: rgba(255, 90, 110, 0.1);
  border-color: rgba(255, 90, 110, 0.3);
}

.compact-btn {
  min-height: 36px;
  padding: 7px 12px;
  white-space: nowrap;
}

.mcc-empty {
  padding: 48px 24px;
  color: var(--muted);
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.mcc-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  color: var(--muted);
}

.mcc-pagination > div {
  display: flex;
  gap: 8px;
}

.detail-grid > div {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: rgba(8, 18, 32, 0.65);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.wide {
  grid-column: 1 / -1;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 0 26px 26px;
}

.toast {
  position: fixed;
  right: 30px;
  bottom: 30px;
  z-index: 70;
  padding: 14px 18px;
  color: #061421;
  background: var(--cyan);
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-weight: 850;
}

.toast[hidden] {
  display: none;
}

@media (max-width: 1320px) {
  .app-shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .sidebar {
    padding: 22px 14px;
  }

  .topbar {
    padding: 20px 28px;
  }

  .content {
    padding: 24px 28px 46px;
  }

  .filter-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-wide {
    grid-column: 1 / -1;
  }

  .mcc-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mcc-search {
    grid-column: 1 / -1;
  }

  .mcc-reset {
    width: 100%;
  }

  .metrics-grid,
  .flow-grid,
  .api-meta-grid,
  .task-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }

  .sidebar {
    position: static;
    padding: 18px;
  }

  .filter-panel,
  .metrics-grid,
  .flow-grid,
  .detail-grid,
  .launch-grid,
  .workflow-summary,
  .workflow-progress-head,
  .integration-form,
  .api-meta-grid,
  .api-form {
    grid-template-columns: 1fr;
  }

  .workflow-test-link {
    align-items: stretch;
    flex-direction: column;
  }

  .workflow-test-link a {
    text-align: center;
  }

  .ads-account-option {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .ads-account-budget,
  .ads-account-tags,
  .ads-account-count {
    grid-column: 2 / -1;
  }

  .ads-account-tags {
    justify-content: flex-start;
  }

  .review-account-selection-head {
    align-items: stretch;
    flex-direction: column;
  }

  .task-toolbar,
  .task-metrics,
  .template-field-list {
    grid-template-columns: 1fr;
  }

  .mcc-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mcc-overview > div:nth-child(2) {
    border-right: 0;
  }

  .mcc-overview > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .mcc-filter-bar {
    grid-template-columns: 1fr;
    padding-inline: 18px;
  }

  .mcc-search {
    grid-column: auto;
  }

  .mcc-management-head,
  .mcc-pagination {
    align-items: stretch;
    flex-direction: column;
    padding-inline: 18px;
  }

  .mcc-pagination > div {
    width: 100%;
  }

  .mcc-pagination button {
    flex: 1;
  }

  .field-wide,
  .wide {
    grid-column: auto;
  }

  .template-preflight-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .content,
  .topbar {
    padding-right: 18px;
    padding-left: 18px;
  }

  .api-card-head,
  .api-card-actions,
  .s5-provider-row {
    align-items: stretch;
    flex-direction: column;
  }

  .s5-provider-row {
    display: flex;
  }

  .s5-provider-actions {
    flex-wrap: wrap;
  }

  .panel-actions {
    justify-content: stretch;
  }

  .panel-actions > button {
    flex: 1;
  }

  .pagination-controls {
    width: 100%;
    flex-wrap: wrap;
    margin-left: 0;
  }
}

/* Google Ads account workspace: account-pool-first layout. */
.mcc-pool-banner {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding: 20px 24px;
  color: #405979;
  background: #eef5ff;
  border: 1px solid #bfd4f1;
  border-radius: 8px;
}

/* Google Ads 账号管理使用全宽工作区，避免账号列被侧栏挤压。 */
.app-shell[data-current-page="mcc"] {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell[data-current-page="mcc"] .sidebar {
  display: none;
}

.mcc-pool-banner strong {
  color: #334c6f;
  font-size: 18px;
}

.mcc-pool-banner span {
  font-size: 13px;
  line-height: 1.6;
}

.mcc-account-management {
  padding-top: 0;
  overflow: hidden;
}

.mcc-account-access-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 24px 18px;
}

.mcc-account-access-head h2,
.mcc-account-access-head p {
  margin: 0;
}

.mcc-account-access-head h2 {
  font-size: 22px;
}

.mcc-account-access-head p,
.mcc-account-access-head > strong {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.mcc-account-toolbar {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(220px, 300px) auto;
  gap: 12px;
  align-items: end;
  margin: 0 24px 20px;
  padding: 16px;
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.mcc-account-toolbar .mcc-search {
  grid-column: auto;
}

.mcc-accessible-table-wrap {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.mcc-accessible-table {
  display: grid;
  grid-template-columns: minmax(150px, 1.15fr) minmax(104px, 0.76fr) minmax(140px, 0.95fr) minmax(120px, 0.82fr) minmax(70px, 0.5fr) minmax(95px, 0.66fr) minmax(142px, 0.98fr) minmax(130px, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 1040px;
  padding-inline: 18px;
}

.mcc-accessible-table-head {
  min-height: 54px;
  color: #60708a;
  background: #f5f7fb;
  border-bottom: 1px solid var(--line);
}

.mcc-accessible-table-row {
  min-height: 78px;
  color: #2f3e56;
  background: #ffffff;
  border-bottom: 1px solid #e3e9f2;
}

.mcc-accessible-table-row:nth-child(odd) {
  background: #fbfcfe;
}

.mcc-accessible-table-row:hover {
  background: #f2f7ff;
}

.mcc-accessible-table-row.is-unavailable {
  background: #fff7f8;
}

.mcc-accessible-table-row > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.mcc-accessible-table-row strong,
.mcc-accessible-table-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mcc-accessible-table-row small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.mcc-inline-account-action {
  justify-self: start;
  padding: 0;
  color: #d04f5d;
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.mcc-inline-account-action:hover {
  color: #a93340;
  text-decoration: underline;
}

.mcc-tabular {
  color: #465974;
  font-variant-numeric: tabular-nums;
}

.mcc-sort-button {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.mcc-sort-button small {
  color: #94a2b7;
  font-size: 10px;
  font-weight: 600;
}

.mcc-sort-button.is-active {
  color: #176fd1;
}

.mcc-sort-button.is-active small {
  color: #176fd1;
}

.mcc-linked-offers {
  min-width: 0;
}

.mcc-secondary-sections {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.mcc-secondary-panel,
.mcc-hidden-accounts.mcc-secondary-panel {
  margin: 0;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.mcc-secondary-panel > summary,
.mcc-hidden-accounts.mcc-secondary-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 20px;
  color: #34445e;
  background: #ffffff;
  cursor: pointer;
  font-weight: 700;
  list-style-position: inside;
}

.mcc-secondary-panel > summary strong {
  color: var(--muted);
  font-size: 12px;
}

.mcc-secondary-panel[open] > summary {
  color: #176fd1;
  background: #f8faff;
  border-bottom: 1px solid var(--line);
}

.mcc-secondary-panel > p {
  margin: 0;
  padding: 11px 20px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.mcc-campaign-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.mcc-campaign-toolbar .field {
  width: min(280px, 100%);
}

@media (max-width: 1100px) {
  .mcc-account-access-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .mcc-account-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(200px, 0.55fr);
  }

  .mcc-account-toolbar .mcc-reset {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .mcc-pool-banner {
    padding: 16px 18px;
  }

  .mcc-account-access-head {
    padding: 18px;
  }

  .mcc-account-toolbar {
    grid-template-columns: 1fr;
    margin-inline: 18px;
  }

  .mcc-account-toolbar .mcc-reset {
    grid-column: auto;
  }
}

/* Link rotation operations */
.rotation-page {
  display: grid;
  gap: 14px;
}

.rotation-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.rotation-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 15px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.rotation-summary span {
  color: var(--muted);
  font-size: 13px;
}

.rotation-summary strong {
  color: #237ee8;
  font-size: 26px;
}

.rotation-summary .has-error strong {
  color: #d64f5d;
}

.rotation-head code {
  color: #175bd6;
  font-weight: 700;
}

.rotation-toolbar {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 220px;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8faff;
}

.rotation-toolbar label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.rotation-toolbar label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.rotation-toolbar input,
.rotation-toolbar select {
  width: 100%;
  min-height: 38px;
  padding: 0 11px;
  color: var(--text);
  background: #fff;
  border: 1px solid #cfd9e8;
  border-radius: 4px;
}

.rotation-table {
  min-width: 980px;
}

.rotation-console {
  overflow-x: auto;
}

.rotation-table-head,
.rotation-table-row {
  display: grid;
  grid-template-columns: minmax(225px, 1.15fr) minmax(250px, 1.25fr) minmax(150px, .7fr) minmax(145px, .7fr) minmax(250px, 1fr);
  gap: 16px;
  align-items: center;
  padding: 13px 20px;
}

.rotation-table-head {
  min-height: 48px;
  color: var(--muted);
  background: #f5f8fd;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
}

.rotation-table-row {
  min-height: 114px;
  border-bottom: 1px solid var(--line);
}

.rotation-table-row:last-child {
  border-bottom: 0;
}

.rotation-offer-cell,
.rotation-rule-cell,
.rotation-time-cell,
.rotation-status-cell {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.rotation-offer-cell strong,
.rotation-offer-cell small,
.rotation-rule-cell code,
.rotation-status-cell small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rotation-table-row small {
  color: var(--muted);
  font-size: 12px;
}

.rotation-rule-cell code,
.rotation-history-item code {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: #36557e;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.rotation-status {
  justify-self: start;
  padding: 5px 9px;
  color: #556681;
  background: #f2f5fa;
  border: 1px solid #cfd9e8;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 800;
}

.rotation-status.running,
.rotation-status.waiting {
  color: #176fd1;
  background: #eef6ff;
  border-color: #8dbcf0;
}

.rotation-status.scheduled {
  color: #168451;
  background: #effaf4;
  border-color: #98dcb8;
}

.rotation-status.failed {
  color: #c94353;
  background: #fff2f4;
  border-color: #efabb3;
}

.rotation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rotation-empty {
  padding: 30px 20px;
  color: var(--muted);
  text-align: center;
}

.rotation-modal {
  width: min(760px, calc(100vw - 32px));
}

.rotation-edit-form {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  padding: 20px;
}

.rotation-edit-form .wide {
  grid-column: 1 / -1;
}

.rotation-edit-form small {
  color: var(--muted);
  line-height: 1.5;
}

.rotation-history-list {
  display: grid;
  gap: 10px;
  padding: 18px 20px 24px;
}

.rotation-history-item {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: #f8faff;
  border: 1px solid var(--line);
  border-left: 3px solid #8dbcf0;
  border-radius: 3px;
}

.rotation-history-item.success {
  border-left-color: #37b978;
}

.rotation-history-item.failed {
  border-left-color: #d64f5d;
}

.rotation-history-title,
.rotation-history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: space-between;
}

.rotation-history-title time,
.rotation-history-meta,
.rotation-history-item > div > span {
  color: var(--muted);
  font-size: 12px;
}

.rotation-history-error {
  margin: 0;
  color: #c94353;
  font-size: 12px;
}

@media (max-width: 980px) {
  .rotation-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rotation-toolbar,
  .rotation-edit-form {
    grid-template-columns: 1fr;
  }

  .rotation-edit-form .wide {
    grid-column: auto;
  }
}

@media (max-width: 600px) {
  .rotation-summary {
    grid-template-columns: 1fr;
  }
}

/* Business dashboard */
.dashboard-business-toolbar {
  margin-bottom: 16px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.dashboard-range-tabs,
.dashboard-filter-row,
.dashboard-source-strip,
.dashboard-trend-legend {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.dashboard-range-tabs {
  margin-bottom: 13px;
}

.dashboard-range-tabs button {
  min-height: 34px;
  padding: 0 14px;
  color: #536985;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  background: #f6f8fb;
  border: 1px solid #d9e1ec;
  border-radius: 5px;
  cursor: pointer;
}

.dashboard-range-tabs button.is-active {
  color: #1768c9;
  background: #eaf3ff;
  border-color: #91bff2;
}

.dashboard-filter-row {
  align-items: flex-end;
}

.dashboard-filter-row label {
  display: grid;
  gap: 5px;
  min-width: 145px;
}

.dashboard-filter-row label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.dashboard-filter-row select,
.dashboard-filter-row input {
  min-height: 38px;
  padding: 0 10px;
  color: #30415a;
  font: inherit;
  font-size: 12px;
  background: #fff;
  border: 1px solid #ccd7e5;
  border-radius: 5px;
}

.dashboard-sync-btn {
  min-height: 38px;
  margin-left: auto;
}

.dashboard-source-strip {
  margin-top: 12px;
  padding-top: 11px;
  color: #708098;
  font-size: 10px;
  border-top: 1px solid #edf1f6;
}

.dashboard-source-strip .is-warning {
  color: #9a6816;
}

.dashboard-source {
  padding: 3px 7px;
  border-radius: 3px;
}

.dashboard-source.is-ready {
  color: #267b50;
  background: #eef8f3;
}

.dashboard-source.is-error {
  color: #b64a55;
  background: #fff1f2;
}

.dashboard-source.is-empty {
  color: #7d8797;
  background: #f4f6f9;
}

.dashboard-business-kpis .dashboard-money-value {
  overflow: hidden;
  font-size: clamp(18px, 1.8vw, 28px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-business-main-grid {
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, 0.85fr);
}

.dashboard-trend-wrap {
  min-height: 245px;
  padding: 12px 16px 8px;
}

.dashboard-trend-legend {
  justify-content: flex-end;
  min-height: 24px;
  color: #64758c;
  font-size: 10px;
}

.dashboard-trend-legend span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.dashboard-trend-legend i {
  width: 16px;
  height: 3px;
  background: #2f84e8;
  border-radius: 2px;
}

.dashboard-trend-legend i.is-spend,
.dashboard-trend-line.is-spend {
  background: #df9a2e;
  stroke: #df9a2e;
}

.dashboard-trend-legend i.is-profit,
.dashboard-trend-line.is-profit {
  background: #33a36a;
  stroke: #33a36a;
}

.dashboard-trend-chart {
  display: block;
  width: 100%;
  min-height: 190px;
}

.dashboard-trend-chart text {
  fill: #7b8aa0;
  font-size: 9px;
}

.dashboard-zero-line {
  stroke: #dfe5ed;
  stroke-dasharray: 4 4;
}

.dashboard-trend-line {
  fill: none;
  stroke: #2f84e8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.dashboard-commission-statuses {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}

.dashboard-commission-row {
  position: relative;
  display: grid;
  gap: 5px;
  min-height: 90px;
  align-content: center;
  padding: 12px 13px 10px;
  background: #f7f9fc;
  border: 1px solid #e1e7ef;
  border-radius: 5px;
}

.dashboard-commission-row::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  content: "";
  background: #e0a13e;
}

.dashboard-commission-row.status-payable::before { background: #4a91df; }
.dashboard-commission-row.status-cashed::before { background: #38a26d; }
.dashboard-commission-row.status-canceled::before { background: #cf6670; }

.dashboard-commission-row > span,
.dashboard-commission-row > small {
  color: var(--muted);
  font-size: 10px;
}

.dashboard-commission-row > strong {
  overflow: hidden;
  color: #2b3b52;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-leaderboard-section {
  margin-bottom: 18px;
}

.dashboard-profit-table {
  overflow-x: auto;
}

.dashboard-profit-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.1fr) minmax(170px, 1.2fr) 85px 130px 120px 120px 80px;
  gap: 12px;
  align-items: center;
  min-width: 980px;
  min-height: 58px;
  padding: 10px 18px;
  color: #44556e;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
}

.dashboard-profit-row:last-child {
  border-bottom: 0;
}

.dashboard-profit-row > div {
  min-width: 0;
}

.dashboard-profit-row strong,
.dashboard-profit-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-profit-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.dashboard-profit-head {
  min-height: 43px;
  color: #6a7890;
  font-size: 10px;
  font-weight: 700;
  background: #f5f7fa;
}

.dashboard-profit-row .is-positive { color: #238c52; font-weight: 700; }
.dashboard-profit-row .is-negative { color: #c94f5b; font-weight: 700; }

.dashboard-business-lower-grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.dashboard-business-alerts {
  display: grid;
  max-height: 300px;
  overflow-y: auto;
}

.dashboard-business-alert {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.dashboard-business-alert:last-child {
  border-bottom: 0;
}

.dashboard-business-alert strong,
.dashboard-business-alert small {
  display: block;
}

.dashboard-business-alert strong {
  color: #34445c;
  font-size: 12px;
}

.dashboard-business-alert small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.dashboard-system-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-system-card {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 104px;
  align-content: center;
  padding: 13px 15px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.dashboard-system-card:nth-child(3n) { border-right: 0; }
.dashboard-system-card:nth-last-child(-n + 3) { border-bottom: 0; }

.dashboard-system-card::before {
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 0;
  width: 3px;
  content: "";
  background: #3b87df;
}

.dashboard-system-card.tone-green::before { background: #3aa16d; }
.dashboard-system-card.tone-warning::before { background: #d79a36; }
.dashboard-system-card.tone-danger::before { background: #d55d69; }

.dashboard-system-card > span,
.dashboard-system-card > small {
  color: var(--muted);
  font-size: 10px;
}

.dashboard-system-card > strong {
  color: #2e4059;
  font-size: 22px;
}

.dashboard-business-empty {
  display: grid;
  gap: 5px;
  min-height: 150px;
  place-content: center;
  padding: 18px;
  color: #7d8ba0;
  text-align: center;
}

.dashboard-business-empty strong {
  color: #52627a;
  font-size: 13px;
}

.dashboard-business-empty span {
  font-size: 11px;
}

.dashboard-table-empty {
  min-width: 980px;
}

@media (max-width: 1180px) {
  .dashboard-business-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-business-kpis .dashboard-kpi:nth-child(3) {
    border-right: 0;
  }

  .dashboard-business-main-grid,
  .dashboard-business-lower-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .dashboard-business-kpis,
  .dashboard-system-cards,
  .dashboard-commission-statuses {
    grid-template-columns: 1fr;
  }

  .dashboard-filter-row label,
  .dashboard-sync-btn {
    width: 100%;
  }

  .dashboard-sync-btn {
    margin-left: 0;
  }

  .dashboard-system-card,
  .dashboard-system-card:nth-child(3n) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

/* Dashboard data overview */
.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.dashboard-kpi {
  position: relative;
  min-width: 0;
  min-height: 116px;
  padding: 17px 18px 15px;
  border-right: 1px solid var(--line);
}

.dashboard-kpi:last-child {
  border-right: 0;
}

.dashboard-kpi::before {
  position: absolute;
  top: 0;
  right: 18px;
  left: 18px;
  height: 3px;
  content: "";
  background: #2784ed;
}

.dashboard-kpi.tone-green::before {
  background: #32a66a;
}

.dashboard-kpi.tone-warning::before {
  background: #e5a128;
}

.dashboard-kpi.tone-danger::before {
  background: #dc5965;
}

.dashboard-kpi > span,
.dashboard-kpi > small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-kpi > span {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
}

.dashboard-kpi > strong {
  display: block;
  margin: 6px 0 5px;
  color: #1974df;
  font-size: 30px;
  line-height: 1;
}

.dashboard-kpi.tone-green > strong {
  color: #238c52;
}

.dashboard-kpi.tone-warning > strong {
  color: #bb7a12;
}

.dashboard-kpi.tone-danger > strong {
  color: #cf4e5a;
}

.dashboard-kpi > small {
  font-size: 11px;
}

.dashboard-data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.dashboard-section {
  min-width: 0;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.dashboard-section-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 70px;
  padding: 16px 18px 13px;
  border-bottom: 1px solid var(--line);
}

.dashboard-section-head h2 {
  margin: 0 0 4px;
  font-size: 16px;
}

.dashboard-section-head span,
.dashboard-section-head > strong {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-section-head > strong {
  color: #36557e;
  white-space: nowrap;
}

.dashboard-bar-list {
  display: grid;
  gap: 12px;
  padding: 17px 18px 18px;
}

.dashboard-bar-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 34px;
  gap: 12px;
  align-items: center;
  min-height: 21px;
  color: #50617b;
  font-size: 12px;
}

.dashboard-bar-row > strong {
  color: #2f3e56;
  text-align: right;
}

.dashboard-bar-track {
  height: 8px;
  overflow: hidden;
  background: #edf1f6;
  border-radius: 2px;
}

.dashboard-bar-track i {
  display: block;
  height: 100%;
  background: #2784ed;
  border-radius: 2px;
}

.dashboard-bar-track .tone-green {
  background: #32a66a;
}

.dashboard-bar-track .tone-warning {
  background: #e5a128;
}

.dashboard-bar-track .tone-danger {
  background: #dc5965;
}

.dashboard-bar-track .tone-muted {
  background: #97a5b9;
}

.dashboard-lower-grid {
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
}

.dashboard-integrations {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-height: 86px;
  border-bottom: 1px solid var(--line);
}

.dashboard-integration-row {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 3px 8px;
  align-content: center;
  min-width: 0;
  padding: 13px 12px;
  border-right: 1px solid var(--line);
}

.dashboard-integration-row:last-child {
  border-right: 0;
}

.dashboard-integration-row > strong,
.dashboard-integration-row > b,
.dashboard-integration-row > small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-integration-row > strong {
  color: #3a4961;
  font-size: 12px;
}

.dashboard-integration-row > b,
.dashboard-integration-row > small {
  grid-column: 2;
}

.dashboard-integration-row > b {
  color: #26364f;
  font-size: 16px;
}

.dashboard-integration-row > small {
  color: var(--muted);
  font-size: 10px;
}

.dashboard-health-dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  background: #e5a128;
  border-radius: 50%;
}

.dashboard-health-dot.is-good {
  background: #32a66a;
}

.dashboard-offer-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-offer-strip > span {
  padding: 13px 12px;
  color: var(--muted);
  border-right: 1px solid var(--line);
  font-size: 11px;
  text-align: center;
}

.dashboard-offer-strip > span:last-child {
  border-right: 0;
}

.dashboard-offer-strip b {
  margin-right: 4px;
  color: #1974df;
  font-size: 15px;
}

.dashboard-alert-list {
  max-height: 162px;
  overflow-y: auto;
}

.dashboard-alert-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 88px;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
}

.dashboard-alert-row:last-child {
  border-bottom: 0;
}

.dashboard-alert-row .status-pill.warning {
  color: #a66c0d;
  background: #fff8e8;
  border-color: #ebca88;
}

.dashboard-alert-row > div {
  min-width: 0;
}

.dashboard-alert-row strong,
.dashboard-alert-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-alert-row strong {
  color: #33435b;
  font-size: 12px;
}

.dashboard-alert-row small,
.dashboard-alert-row time {
  color: var(--muted);
  font-size: 10px;
}

.dashboard-alert-row time {
  text-align: right;
}

.dashboard-danger-text {
  color: #cf4e5a !important;
}

.dashboard-good-text {
  color: #238c52 !important;
}

.dashboard-empty-state {
  display: grid;
  place-content: center;
  min-height: 108px;
  color: var(--muted);
  text-align: center;
}

.dashboard-empty-state strong,
.dashboard-empty-state span {
  display: block;
}

.dashboard-empty-state strong {
  margin-bottom: 4px;
  color: #3a4961;
  font-size: 13px;
}

.dashboard-empty-state span {
  font-size: 11px;
}

.dashboard-recent-section {
  margin-bottom: 16px;
}

.dashboard-task-table {
  min-width: 0;
  overflow-x: auto;
}

.dashboard-task-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.25fr) minmax(120px, 0.8fr) minmax(190px, 1.15fr) 128px 100px;
  gap: 14px;
  align-items: center;
  min-width: 850px;
  min-height: 58px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
}

.dashboard-task-row:last-child {
  border-bottom: 0;
}

.dashboard-task-head {
  min-height: 40px;
  color: #60708a;
  background: #f5f7fb;
  font-size: 11px;
  font-weight: 800;
}

.dashboard-task-row > div {
  min-width: 0;
}

.dashboard-task-row strong,
.dashboard-task-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-task-row strong {
  color: #33435b;
  font-size: 12px;
}

.dashboard-task-row small,
.dashboard-task-row time {
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 1480px) {
  .dashboard-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-kpi:nth-child(3) {
    border-right: 0;
  }

  .dashboard-kpi:nth-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }

  .dashboard-integrations {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-integration-row:nth-child(3) {
    border-right: 0;
  }

  .dashboard-integration-row:nth-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 1040px) {
  .dashboard-data-grid,
  .dashboard-lower-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .dashboard-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-kpi,
  .dashboard-kpi:nth-child(3) {
    min-height: 104px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .dashboard-kpi:nth-child(even) {
    border-right: 0;
  }

  .dashboard-kpi:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .dashboard-integrations {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-integration-row,
  .dashboard-integration-row:nth-child(3) {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .dashboard-integration-row:nth-child(even) {
    border-right: 0;
  }

  .dashboard-integration-row:last-child {
    border-bottom: 0;
  }

  .dashboard-offer-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-offer-strip > span:nth-child(2) {
    border-right: 0;
  }

  .dashboard-offer-strip > span:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .dashboard-alert-row {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .dashboard-alert-row time {
    display: none;
  }

  .dashboard-bar-row {
    grid-template-columns: 82px minmax(0, 1fr) 28px;
    gap: 8px;
  }
}

/* Blue-white operations console */
:root {
  --bg: #f3f6fb;
  --bg-soft: #eef3fa;
  --panel: #ffffff;
  --panel-2: #f8faff;
  --line: #dce4f0;
  --line-strong: #c8d5e7;
  --text: #26344d;
  --muted: #71819b;
  --cyan: #1684ff;
  --blue: #2456d7;
  --green: #34b96f;
  --warning: #e9a23b;
  --danger: #e95b67;
  --nav: #132f68;
  --nav-deep: #102756;
  --shadow: 0 6px 18px rgba(36, 70, 126, 0.08);
}

html,
body,
#app {
  background: var(--bg);
}

body {
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
}

.app-shell {
  grid-template-columns: 236px minmax(0, 1fr);
  background: var(--bg);
}

.sidebar {
  padding: 0 0 18px;
  color: #eef5ff;
  background: var(--nav);
  border-right: 0;
  box-shadow: none;
}

.brand {
  min-height: 58px;
  gap: 10px;
  padding: 0 18px;
  margin: 0;
  background: var(--nav-deep);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.avatar,
.merchant-logo {
  color: #ffffff;
  background: #2589f8;
  border-radius: 4px;
}

.brand-name {
  color: #ffffff;
  font-size: 18px;
  font-weight: 750;
}

.sidebar-promise {
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 0 20px;
  color: #ffffff;
  background: #1c49a5;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 16px;
  font-weight: 800;
}

.account-card {
  grid-template-columns: 36px minmax(0, 1fr) 24px;
  gap: 10px;
  min-height: 62px;
  padding: 12px 16px;
  margin: 0;
  color: #ffffff;
  background: rgba(4, 20, 53, 0.22);
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
}

.avatar {
  width: 36px;
  height: 36px;
  color: #ffffff;
  font-size: 14px;
}

.account-meta strong {
  font-size: 13px;
}

.account-meta span {
  margin-top: 2px;
  color: #b7c7e2;
  font-size: 11px;
}

.account-logout,
.header-logout {
  color: #dce9ff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
}

.account-logout:hover,
.header-logout:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.35);
}

.nav {
  padding-top: 8px;
}

.nav-group {
  margin: 0 0 10px;
}

.nav-label {
  margin: 0;
  padding: 8px 20px 5px;
  color: #839bc3;
  font-size: 11px;
  font-weight: 700;
}

.nav-item {
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  height: 38px;
  padding: 0 20px;
  margin: 0;
  color: #c8d6ec;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0;
  font-size: 13px;
}

.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}

.nav-item.active {
  color: #ffffff;
  background: #167eea;
  border-color: #63c6ff;
  box-shadow: none;
}

.nav-icon {
  width: 14px;
  height: 14px;
  color: currentColor;
}

.main {
  background: var(--bg);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 28px;
  color: #ffffff;
  background: #2456c7;
}

.app-header-brand,
.app-header-account {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-header-brand strong {
  font-size: 17px;
}

.app-header-brand span,
.app-header-account span {
  color: #ccdcff;
  font-size: 12px;
}

.header-logout {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.workspace-tabs {
  display: flex;
  min-height: 44px;
  padding: 0 16px;
  overflow-x: auto;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(36, 70, 126, 0.04);
}

.workspace-tab {
  flex: 0 0 auto;
  min-width: 92px;
  padding: 0 14px;
  color: #52627c;
  background: #ffffff;
  border: 0;
  border-right: 1px solid #edf1f7;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 650;
}

.workspace-tab:hover {
  color: #175bd6;
  background: #f7faff;
}

.workspace-tab.active {
  color: #175bd6;
  background: #f7faff;
  border-bottom-color: #2487ff;
}

.topbar {
  position: static;
  min-height: 74px;
  padding: 14px 28px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  backdrop-filter: none;
}

.back-link {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

h1 {
  margin-top: 3px;
  color: #24324a;
  font-size: 25px;
  line-height: 1.15;
}

h2 {
  color: #2b3950;
  font-size: 18px;
}

.top-actions {
  gap: 8px;
}

.mode-pill,
.status-pill,
.list-pill,
.text-chip {
  min-height: 24px;
  padding: 3px 8px;
  color: #657793;
  background: #f2f5fa;
  border-color: #d7e0ed;
  border-radius: 3px;
  font-size: 12px;
}

.content {
  max-width: none;
  padding: 18px 24px 42px;
}

.panel,
.metric-card,
.flow-card,
.modal,
.integration-card,
.api-card,
.task-metrics > div,
.workflow-progress-card,
.workflow-summary > div,
.ad-copy-preview,
.detail-grid > div,
.launch-preview,
.ai-saved-config,
.ads-account-option,
.mcc-account-inventory-row {
  color: var(--text);
  background: #ffffff;
  border-color: var(--line);
  border-radius: 4px;
  box-shadow: none;
}

.panel {
  border-radius: 4px;
}

.panel-head {
  padding: 18px 20px;
}

.panel-head p {
  max-width: 1100px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.panel-actions {
  gap: 8px;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.icon-btn {
  min-height: 36px;
  padding: 0 14px;
  color: #35445d;
  background: #ffffff;
  border: 1px solid #cfd9e8;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
}

.primary-btn {
  color: #ffffff;
  background: #237ee8;
  border-color: #237ee8;
}

.primary-btn:hover {
  background: #176bd0;
  border-color: #176bd0;
}

.secondary-btn:hover,
.ghost-btn:hover {
  color: #175bd6;
  background: #f4f8ff;
  border-color: #8db8ef;
}

.ghost-btn {
  color: #556681;
  background: transparent;
}

.ghost-btn.danger {
  color: #d64f5d;
  border-color: #efb8be;
}

.small,
.compact-btn,
.task-actions .small {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.icon-btn {
  width: 36px;
  padding: 0;
  font-size: 24px;
}

.metrics-grid,
.task-metrics {
  gap: 12px;
}

.metric-card {
  min-height: 88px;
  padding: 18px;
}

.metric-card span,
.task-metrics span,
.task-row .cell-stack > span,
.task-time,
.muted {
  color: var(--muted);
}

.metric-card strong,
.task-metrics strong {
  color: #1974df;
  font-size: 28px;
}

.flow-grid {
  gap: 12px;
}

.flow-card {
  min-height: 100px;
  padding: 18px;
}

.flow-card span {
  color: var(--muted);
}

.filter-panel {
  grid-template-columns: minmax(260px, 1.8fr) repeat(4, minmax(132px, 1fr));
  gap: 10px;
  padding: 14px 20px;
  background: #ffffff;
  border-color: var(--line);
}

.offer-panel .filter-panel {
  padding: 0 0 16px;
  background: #ffffff;
  border-bottom-color: var(--line-strong);
}

.advanced-panel {
  padding: 12px 20px;
  background: #f8faff;
  border-color: var(--line);
}

.field {
  gap: 5px;
}

.field span,
.auth-form label span {
  color: #596a84;
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea,
.auth-form input {
  color: #27354c;
  background: #ffffff;
  border-color: #cfd9e8;
  border-radius: 4px;
}

input,
select {
  height: 38px;
  padding: 0 11px;
}

textarea {
  padding: 10px 11px;
}

input:focus,
select:focus,
textarea:focus,
.auth-form input:focus {
  border-color: #2784ed;
  box-shadow: 0 0 0 2px rgba(39, 132, 237, 0.12);
}

.table-shell,
.task-table-shell,
.mcc-table-wrap {
  background: #ffffff;
  border-color: var(--line);
}

.offer-head,
.task-head,
.mcc-table-head {
  min-height: 46px;
  color: #60708a;
  background: #f5f7fb;
  border-color: var(--line);
  font-size: 12px;
}

.offer-head,
.offer-row {
  grid-template-columns: 28px 175px 135px 210px 64px 42px 64px 150px;
  padding: 0 16px;
}

.offer-table {
  min-width: 920px;
}

.offer-row {
  min-height: 82px;
  color: #2f3e56;
  background: #ffffff;
  border-color: #e3e9f2;
}

.offer-row:nth-child(odd),
.task-row:nth-child(odd),
.mcc-table-row:nth-child(odd) {
  background: #fbfcfe;
}

.offer-row:hover,
.task-row:hover,
.mcc-table-row:hover {
  background: #f2f7ff;
}

.merchant-logo {
  width: 36px;
  height: 36px;
  color: #237ee8;
  background: #eaf4ff;
  border-color: #b8d8f8;
}

.link {
  color: #1673d9;
}

.text-chip {
  color: #34445e;
  background: #f2f5fa;
  border-color: #d7e0ed;
}

.status-pill.good {
  color: #238c52;
  background: #eaf8f0;
  border-color: #a9dfbf;
}

.status-pill.danger {
  color: #cf4e5a;
  background: #fff0f2;
  border-color: #f1b3ba;
}

.list-pill {
  color: #176fd1;
  background: #eaf4ff;
  border-color: #b8d8f8;
}

.has-tooltip:hover::after {
  color: #ffffff;
  background: #23354e;
  border-color: #23354e;
  border-radius: 3px;
  box-shadow: 0 8px 22px rgba(20, 43, 78, 0.2);
}

.table-footer,
.mcc-pagination {
  color: var(--muted);
  background: #ffffff;
  border-color: var(--line);
}

.task-center {
  gap: 14px;
}

.task-metrics > div {
  min-height: 72px;
  padding: 14px 16px;
}

.task-toolbar {
  gap: 10px;
}

.task-add {
  height: 38px;
}

.task-head,
.task-row {
  padding: 12px 10px;
  border-color: #e3e9f2;
}

.task-row {
  min-height: 76px;
  background: #ffffff;
}

.integration-card,
.api-card {
  border: 1px solid var(--line);
}

.integration-head,
.api-card-head,
.api-card-actions,
.integration-actions,
.s5-provider-row {
  border-color: var(--line);
}

.integration-form,
.api-form,
.api-meta-grid {
  gap: 10px;
}

.api-meta-grid > div,
.provider-row,
.s5-provider-row,
.ai-saved-config,
.launch-preview {
  color: var(--text);
  background: #f8faff;
  border-color: var(--line);
  border-radius: 4px;
}

.s5-test-summary,
.credential-missing,
.ads-state-line {
  color: var(--muted) !important;
}

.credential-ok {
  color: #238c52;
}

.s5-test-summary.is-error,
.credential-missing {
  color: #d65662 !important;
}

.mcc-management {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.mcc-management-head,
.mcc-overview,
.mcc-filter-bar,
.mcc-account-inventory-wrap,
.mcc-account-inventory-row,
.mcc-table-row,
.mcc-pagination {
  border-color: var(--line);
}

.mcc-overview > div {
  background: #f8faff;
  border-color: var(--line);
}

.mcc-filter-bar {
  background: #ffffff;
}

.mcc-account-inventory-head {
  color: #60708a;
  background: #f5f7fb;
}

.mcc-account-inventory-row {
  background: #ffffff;
}

.mcc-account-inventory-row.is-unavailable,
.ads-account-option.is-unavailable {
  background: #fff7f8;
}

.ads-account-option.is-locked {
  background: #fffbeb;
}

.mcc-table-row {
  background: #ffffff;
}

.workflow-preview,
.template-confirmation {
  background: #ffffff;
}

.review-account-selection,
.launch-account-note {
  background: #f8faff;
  border-color: var(--line-strong);
}

.workflow-progress-card,
.workflow-summary > div,
.workflow-step,
.workflow-test-link,
.ad-copy-preview,
.template-field-item,
.detail-grid > div {
  background: #f8faff;
  border-color: var(--line);
  border-radius: 4px;
}

.workflow-progress-track {
  background: #dce5f1;
}

.workflow-progress-track span {
  background: #2784ed;
}

.workflow-step.completed {
  background: #eff9f3;
  border-color: #a9dfbf;
}

.workflow-step.completed .workflow-step-state,
.workflow-step.completed .step-index {
  color: #238c52 !important;
}

.workflow-step.pending,
.workflow-step.failed,
.workflow-step.blocked {
  background: #fff4f5;
  border-color: #efb8be;
}

.workflow-step.pending .workflow-step-state,
.workflow-step.failed .workflow-step-state,
.workflow-step.blocked .workflow-step-state,
.workflow-step.pending .step-index,
.workflow-step.failed .step-index,
.workflow-step.blocked .step-index {
  color: #d64f5d !important;
}

.workflow-step.waiting,
.workflow-step.running {
  background: #eef6ff;
  border-color: #8dbcf0;
  box-shadow: inset 3px 0 0 #2784ed;
}

.workflow-step.waiting .workflow-step-state,
.workflow-step.running .workflow-step-state,
.workflow-step.waiting .step-index,
.workflow-step.running .step-index {
  color: #176fd1 !important;
  border-color: #8dbcf0;
}

.step-index {
  color: #176fd1 !important;
  background: #eaf4ff;
  border-color: #b8d8f8;
}

.modal-backdrop {
  background: rgba(26, 43, 69, 0.55);
}

.modal {
  color: var(--text);
  background: #ffffff;
  border-color: #cfd9e8;
  box-shadow: 0 24px 70px rgba(22, 48, 91, 0.24);
}

.modal-head,
.modal-actions {
  background: #ffffff;
  border-color: var(--line);
}

.modal-subtitle,
.workflow-summary span,
.workflow-step small,
.workflow-progress-head span,
.workflow-progress-card small,
.workflow-step-timing,
.workflow-row-progress,
.workflow-test-link small,
.ad-copy-preview span,
.template-field-item small {
  color: var(--muted);
}

.template-note {
  color: #36557e;
  background: #eef6ff;
  border-left-color: #2784ed;
}

.toast {
  right: 24px;
  bottom: 24px;
  color: #ffffff;
  background: #237ee8;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(34, 91, 177, 0.24);
}

.auth-shell {
  background: #eff4fb;
}

.auth-panel {
  padding: 28px;
  color: var(--text);
  background: #ffffff;
  border-color: var(--line);
  border-radius: 4px;
  box-shadow: 0 18px 46px rgba(24, 63, 121, 0.12);
}

.auth-brand,
.auth-heading,
.auth-heading h1 {
  color: var(--text);
  border-color: var(--line);
}

.auth-heading p,
.auth-loading {
  color: var(--muted);
}

/* adpilotxf brand lockup */
.brand-lockup {
  display: flex;
  align-items: center;
}

.brand-logo {
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand .brand-logo {
  width: 38px;
  height: 38px;
}

.brand .brand-name {
  color: #ffffff;
  font-size: 18px;
  font-weight: 760;
  letter-spacing: 0.01em;
}

.auth-brand {
  gap: 18px;
}

.auth-brand .brand-logo {
  width: 68px;
  height: 68px;
}

.auth-brand .brand-name {
  color: #24324a;
  font-size: 32px;
  font-weight: 780;
  line-height: 1;
  letter-spacing: -0.02em;
}

@media (max-width: 520px) {
  .auth-brand .brand-logo {
    width: 56px;
    height: 56px;
  }

  .auth-brand .brand-name {
    font-size: 27px;
  }
}

/* PartnerBoost Amazon application is an isolated fourth Amazon workflow. */
.pb-amazon-applications {
  display: grid;
  gap: 22px;
}

.pb-application-config-panel,
.pb-candidate-panel,
.pb-queue-panel,
.pb-audit-panel {
  min-width: 0;
  overflow: hidden;
}

.pb-application-settings-grid {
  padding: 0 28px;
}

.pb-application-settings-grid .field small {
  margin-top: 5px;
  color: var(--muted);
}

.pb-switch-card {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 70px;
  padding: 13px 15px;
  background: rgba(50, 211, 255, 0.06);
  border: 1px solid rgba(50, 211, 255, 0.2);
  border-radius: 10px;
}

.pb-switch-card.is-danger {
  background: rgba(255, 159, 46, 0.07);
  border-color: rgba(255, 159, 46, 0.32);
}

.pb-switch-card input {
  width: 19px;
  height: 19px;
  accent-color: #dc7208;
}

.pb-switch-card span {
  display: grid;
  gap: 4px;
}

.pb-switch-card small,
.pb-two-factor-row span,
.pb-sync-footnote {
  color: var(--muted);
}

.pb-two-factor-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 180px auto;
  gap: 12px;
  align-items: center;
  margin: 18px 28px 0;
  padding: 14px;
  background: rgba(244, 184, 79, 0.1);
  border: 1px solid rgba(244, 184, 79, 0.36);
  border-radius: 10px;
}

.pb-two-factor-row > div {
  display: grid;
  gap: 4px;
}

.pb-two-factor-row input {
  min-height: 42px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(7, 17, 31, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.pb-application-config-actions {
  padding: 0 28px 24px;
}

.pb-application-config-actions .s5-test-summary {
  margin-right: auto;
}

.pb-candidate-table-shell,
.pb-queue-table-shell {
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

.pb-candidate-table {
  min-width: 1120px;
}

.pb-queue-table {
  min-width: 1180px;
}

.pb-candidate-head,
.pb-candidate-row,
.pb-queue-head,
.pb-queue-row {
  display: grid;
  gap: 16px;
  align-items: center;
  min-height: 70px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
}

.pb-candidate-head,
.pb-candidate-row {
  grid-template-columns: 48px minmax(220px, 1.15fr) minmax(260px, 1.5fr) 180px 150px;
}

.pb-queue-head,
.pb-queue-row {
  grid-template-columns: minmax(250px, 1.2fr) minmax(210px, 1fr) minmax(280px, 1.35fr) 120px 130px;
}

.pb-candidate-head,
.pb-queue-head {
  min-height: 46px;
  color: var(--muted);
  background: rgba(50, 211, 255, 0.04);
  font-size: 12px;
  font-weight: 800;
}

.pb-candidate-row:hover,
.pb-queue-row:hover {
  background: rgba(93, 141, 255, 0.05);
}

.pb-candidate-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #dc7208;
}

.pb-sync-footnote {
  display: block;
  padding: 12px 22px 18px;
}

.pb-audit-panel summary {
  padding: 20px 24px;
  cursor: pointer;
  font-weight: 850;
}

.pb-audit-list {
  display: grid;
  max-height: 360px;
  overflow: auto;
  border-top: 1px solid var(--line);
}

.pb-audit-list > div:not(.empty-state) {
  display: grid;
  grid-template-columns: 145px 190px minmax(260px, 1fr);
  gap: 14px;
  padding: 11px 24px;
  border-bottom: 1px solid var(--line);
}

.pb-audit-list time,
.pb-audit-list span {
  color: var(--muted);
}

@media (max-width: 900px) {
  .pb-application-settings-grid {
    grid-template-columns: 1fr;
  }

  .pb-two-factor-row {
    grid-template-columns: 1fr;
  }

  .pb-audit-list > div:not(.empty-state) {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* ROI snapshots */
.roi-overview {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 18px 20px;
  color: #2b3950;
  background: #eef6ff;
  border: 1px solid #b9d7fa;
  border-radius: 5px;
}

.roi-overview > div {
  display: grid;
  gap: 5px;
}

.roi-overview strong {
  font-size: 17px;
}

.roi-overview span {
  max-width: 1050px;
  color: #5d718e;
  font-size: 13px;
  line-height: 1.55;
}

.roi-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
  background: #fff;
  border: 1px solid #d7e0ed;
  border-radius: 5px;
  overflow: hidden;
}

.roi-kpis > div {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 18px;
  border-right: 1px solid #e0e6ef;
}

.roi-kpis > div:last-child {
  border-right: 0;
}

.roi-kpis > div:nth-child(4n) {
  border-right: 0;
}

.roi-kpis > div:nth-child(-n + 4) {
  border-bottom: 1px solid #e0e6ef;
}

.roi-kpis > div::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  content: "";
  background: #879ab3;
}

.roi-kpis .tone-green::before { background: #34a66f; }
.roi-kpis .tone-blue::before { background: #2a80e6; }
.roi-kpis .tone-warning::before { background: #dfa22e; }

.roi-kpis span,
.roi-kpis small {
  color: #70819a;
}

.roi-kpis span {
  font-size: 12px;
  font-weight: 750;
}

.roi-kpis strong {
  overflow: hidden;
  color: #26364e;
  font-size: clamp(20px, 1.8vw, 28px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roi-kpis small {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roi-panel {
  overflow: hidden;
}

.roi-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(170px, 240px);
  gap: 12px;
  padding: 14px 20px;
  background: #f8fafd;
  border-top: 1px solid #edf1f6;
  border-bottom: 1px solid #dce4ef;
}

.roi-toolbar label {
  display: grid;
  gap: 5px;
  color: #61738d;
  font-size: 11px;
  font-weight: 700;
}

.roi-toolbar input,
.roi-toolbar select {
  min-height: 38px;
  padding: 0 11px;
  color: #30415a;
  background: #fff;
  border: 1px solid #ccd7e5;
  border-radius: 4px;
}

.roi-table-head,
.roi-table-row {
  display: grid;
  grid-template-columns: minmax(245px, 1.3fr) minmax(190px, 0.85fr) minmax(170px, 0.72fr) minmax(160px, 0.68fr) minmax(180px, 0.78fr);
  gap: 18px;
  align-items: center;
}

.roi-table-head {
  padding: 13px 20px;
  color: #64758e;
  font-size: 11px;
  font-weight: 750;
  background: #f3f6fa;
  border-bottom: 1px solid #dce4ef;
}

.roi-table-item {
  border-bottom: 1px solid #e1e7f0;
}

.roi-table-item:last-child {
  border-bottom: 0;
}

.roi-table-row {
  min-height: 134px;
  padding: 18px 20px;
  color: #2c3b53;
}

.roi-table-row > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.roi-table-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.roi-table-row small {
  overflow: hidden;
  color: #71819a;
  font-size: 11px;
  line-height: 1.4;
  text-overflow: ellipsis;
}

.roi-identity strong {
  font-size: 15px;
}

.roi-amounts strong,
.roi-result strong {
  font-size: 15px;
}

.roi-amounts .roi-pending-value {
  color: #b9780d;
}

.roi-result .is-positive { color: #208154; }
.roi-result .is-negative { color: #d44e5a; }

.roi-state {
  align-items: start;
}

.roi-state .status-pill {
  width: fit-content;
}

.roi-state button {
  width: fit-content;
  margin-top: 4px;
}

.roi-evidence {
  background: #f8fafd;
  border-top: 1px dashed #d7e0eb;
}

.roi-evidence summary {
  padding: 10px 20px;
  color: #40638c;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.roi-evidence-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 4px 20px 14px;
}

.roi-evidence-grid > div {
  display: grid;
  gap: 4px;
  padding: 11px;
  background: #fff;
  border: 1px solid #e0e6ef;
  border-radius: 4px;
}

.roi-evidence-grid span,
.roi-evidence-grid small {
  color: #71819a;
  font-size: 10px;
}

.roi-evidence-grid strong {
  overflow: hidden;
  color: #30415a;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roi-warnings,
.roi-complete-note {
  display: grid;
  gap: 3px;
  margin: 0 20px 16px;
  padding: 10px 12px;
  font-size: 11px;
  border-radius: 4px;
}

.roi-warnings {
  color: #8a5e13;
  background: #fff8e8;
  border: 1px solid #f0d08d;
}

.roi-complete-note {
  color: #287a52;
  background: #eef9f3;
  border: 1px solid #aedfc7;
}

.roi-empty {
  display: grid;
  gap: 7px;
  place-items: center;
  min-height: 220px;
  padding: 30px;
  color: #6c7e98;
  text-align: center;
}

.roi-empty strong {
  color: #31425b;
  font-size: 17px;
}

@media (max-width: 1280px) {
  .roi-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .roi-kpis > div:nth-child(2n) {
    border-right: 0;
  }

  .roi-kpis > div:nth-child(-n + 6) {
    border-bottom: 1px solid #e0e6ef;
  }

  .roi-table-head {
    display: none;
  }

  .roi-table-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .roi-state {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .roi-overview {
    align-items: stretch;
    flex-direction: column;
  }

  .roi-kpis,
  .roi-table-row,
  .roi-evidence-grid,
  .roi-toolbar {
    grid-template-columns: 1fr;
  }

  .roi-kpis > div {
    border-right: 0;
    border-bottom: 1px solid #e0e6ef;
  }

  .roi-table-row {
    gap: 14px;
  }

  .roi-state {
    grid-column: auto;
  }
}

.auth-error {
  color: #bc4752;
  background: #fff0f2;
  border-color: #efb8be;
  border-radius: 4px;
}

@media (max-width: 1320px) {
  .app-shell {
    grid-template-columns: 218px minmax(0, 1fr);
  }

  .sidebar {
    padding: 0 0 16px;
  }

  .topbar,
  .app-header {
    padding-right: 20px;
    padding-left: 20px;
  }

  .content {
    padding: 16px 18px 36px;
  }

  .metrics-grid,
  .task-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    overflow: visible;
  }

  .brand {
    min-width: 154px;
  }

  .sidebar-promise,
  .account-card,
  .nav-label {
    display: none;
  }

  .nav {
    display: flex;
    min-width: 0;
    padding: 0;
    overflow-x: auto;
    background: var(--nav-deep);
  }

  .nav-group {
    display: contents;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    height: 58px;
    padding: 0 14px;
    border-left: 0;
    border-bottom: 3px solid transparent;
  }

  .nav-item.active {
    border-bottom-color: #63c6ff;
  }

  .app-header {
    min-height: 48px;
  }

  .app-header-brand span,
  .app-header-account span,
  .mode-pill {
    display: none;
  }

  .workspace-tabs {
    min-height: 40px;
    padding: 0;
  }

  .workspace-tab {
    min-width: 82px;
    padding: 0 10px;
    font-size: 12px;
  }

  .topbar {
    min-height: 64px;
    padding: 10px 14px;
  }

  h1 {
    font-size: 22px;
  }

  .content {
    padding: 12px 10px 30px;
  }

  .metrics-grid,
  .task-metrics {
    grid-template-columns: 1fr;
  }

  .filter-panel,
  .integration-form,
  .api-form,
  .api-meta-grid,
  .workflow-summary,
  .workflow-progress-head,
  .launch-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .field-wide,
  .wide {
    grid-column: auto;
  }

  .panel-head {
    padding: 15px;
  }

  .filter-panel {
    padding: 12px 15px;
  }
}

/* Stable application scrolling: chrome stays fixed while page data moves. */
.modal {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: contain;
}

.modal-head,
.modal-actions {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
}

.modal-scroll-region {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.modal-actions {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.mcc-queue-recovery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

@media (min-width: 761px) {
  .main {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    overflow: hidden;
  }

  .content {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .app-shell[data-current-page="offers"] .content,
  .app-shell[data-current-page="launch"] .content {
    overflow: auto;
    padding-bottom: 42px;
  }

  .offer-panel {
    display: block;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .offer-controls {
    position: relative;
    z-index: 3;
    min-width: 0;
    background: #ffffff;
  }

  .offer-panel > .table-shell {
    min-height: auto;
    overflow-x: auto;
    overflow-y: visible;
    overscroll-behavior-x: contain;
  }

  .offer-panel .offer-head {
    position: static;
  }

  .offer-panel > .table-footer {
    position: relative;
    z-index: 3;
    flex: 0 0 auto;
  }

  .task-center {
    display: block;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .task-table-shell {
    min-height: auto;
    overflow-x: auto;
    overflow-y: visible;
    overscroll-behavior-x: contain;
  }

  .task-head {
    position: static;
    background: #f5f7fb;
  }
}

.workflow-execution-gate,
.workflow-failure-card {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 6px;
}

.workflow-execution-gate {
  color: #244f7f;
  background: #eef6ff;
  border: 1px solid #9bc5f2;
}

.workflow-failure-card {
  color: #8f2633;
  background: #fff2f4;
  border: 1px solid #efabb3;
}

.workflow-execution-gate > div,
.workflow-failure-card > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.workflow-execution-gate span,
.workflow-failure-card span,
.workflow-failure-card small {
  color: var(--muted);
}

.workflow-execution-gate p,
.workflow-failure-card p {
  margin: 0;
  line-height: 1.6;
}

.offer-ad-review {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: #f8fbff;
  border: 1px solid #9bc5f2;
  border-radius: 6px;
}

.offer-ad-review-head,
.offer-ad-review-head > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.offer-ad-review-head > div {
  justify-content: flex-start;
}

.offer-ad-review-head h3,
.offer-ad-review-copy ol {
  margin: 0;
}

.offer-ad-review-head span,
.offer-ad-review-destinations span,
.offer-ad-review-copy > div > span {
  color: var(--muted);
}

.offer-ad-review-destinations,
.offer-ad-review-copy {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.offer-ad-review-destinations > div,
.offer-ad-review-copy > div {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.offer-ad-review-destinations .wide,
.offer-ad-review-copy .wide {
  grid-column: 1 / -1;
}

.offer-ad-review code {
  overflow-wrap: anywhere;
  white-space: normal;
}

.offer-ad-review-copy ol {
  display: grid;
  gap: 5px;
  padding-left: 24px;
}

.offer-ad-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.offer-ad-keywords b {
  padding: 5px 8px;
  color: #244f7f;
  background: #eef6ff;
  border: 1px solid #c1daf5;
  border-radius: 3px;
  font-size: 12px;
}

.review-keywords-editor > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.ad-copy-preview .review-keywords-editor {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
}

.review-keywords-editor > span strong {
  color: var(--text);
}

.review-keywords-editor > span small,
.review-keywords-help {
  color: var(--muted);
  font-weight: 500;
}

.review-keywords-editor textarea {
  min-height: 172px;
  line-height: 1.55;
}

.review-keywords-editor textarea[aria-invalid="true"] {
  border-color: #df5b67;
}

.review-keywords-help {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.review-keywords-help b {
  color: #226bb8;
}

.review-keywords-error {
  color: #c63e4b;
  font-weight: 700;
}

@media (max-width: 760px) {
  .offer-ad-review-destinations,
  .offer-ad-review-copy {
    grid-template-columns: 1fr;
  }

  .offer-ad-review-destinations .wide,
  .offer-ad-review-copy .wide {
    grid-column: auto;
  }

  .review-keywords-editor > span,
  .review-keywords-help {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Launch task counters: soft status colors with a five-column desktop layout. */
.task-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.task-metrics > .task-metric {
  border-width: 1px;
  box-shadow: inset 0 3px 0 var(--task-metric-accent);
}

.task-metrics > .task-metric span {
  color: var(--task-metric-label);
  font-weight: 650;
}

.task-metrics > .task-metric strong {
  color: var(--task-metric-number);
}

.task-metric-current {
  --task-metric-accent: #9eb6d5;
  --task-metric-label: #60748f;
  --task-metric-number: #4f74a3;
  background: #f2f6fb !important;
  border-color: #d4deeb !important;
}

.task-metric-template {
  --task-metric-accent: #b9a6ce;
  --task-metric-label: #766786;
  --task-metric-number: #7d6397;
  background: #f7f4fa !important;
  border-color: #e0d7e8 !important;
}

.task-metric-review {
  --task-metric-accent: #d9bc84;
  --task-metric-label: #7f6e51;
  --task-metric-number: #9b763a;
  background: #fbf7ef !important;
  border-color: #eadfc9 !important;
}

.task-metric-pending-online {
  --task-metric-accent: #8fbccd;
  --task-metric-label: #587786;
  --task-metric-number: #4b8196;
  background: #f0f7f9 !important;
  border-color: #d1e3e9 !important;
}

.task-metric-online {
  --task-metric-accent: #91c4a4;
  --task-metric-label: #557763;
  --task-metric-number: #43805a;
  background: #f0f8f3 !important;
  border-color: #d1e6d8 !important;
}

@media (max-width: 1100px) {
  .task-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .task-metrics {
    grid-template-columns: 1fr;
  }
}

/* Compact alliance-platform cards. Keep technical configuration folded by default. */
.api-panel > .panel-head {
  padding: 14px 18px;
}

.api-panel {
  container-type: inline-size;
}

.api-panel > .panel-head h2 {
  margin-bottom: 3px;
}

.api-panel > .panel-head p {
  margin: 0;
  font-size: 12px;
}

.api-panel .api-grid {
  gap: 10px;
  padding: 0 18px 18px;
}

.partnerboost-api-card {
  border-color: #b9d5f4;
}

.partnerboost-api-card .api-compact-main {
  background: #fbfdff;
}

.api-compact-stats .status-ok {
  color: #27845c;
}

.api-compact-stats .status-error {
  color: #c94553;
}

.partnerboost-details-body {
  padding: 14px 16px 16px;
}

.partnerboost-details-intro {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.partnerboost-configuration-form {
  grid-template-columns: minmax(180px, 0.7fr) repeat(2, minmax(280px, 1.15fr));
  margin-top: 12px;
}

.partnerboost-phase-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.partnerboost-phase-note span {
  padding: 5px 8px;
  color: #5b6e89;
  background: #f1f6fc;
  border: 1px solid #d7e4f2;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.partnerboost-connect-actions .s5-test-summary {
  margin-right: auto;
}

.partnerboost-sync-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.partnerboost-sync-status-grid > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  background: #f8faff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.partnerboost-sync-status-grid span,
.partnerboost-sync-status-grid small {
  color: var(--muted);
}

.partnerboost-sync-status-grid strong {
  overflow: hidden;
  color: #34465f;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.partnerboost-sync-status-grid strong.is-error {
  color: #c94553;
}

.api-card.api-card-compact {
  display: block;
  padding: 0;
  overflow: hidden;
}

.api-compact-main {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(500px, 1.5fr) 402px;
  gap: 18px;
  align-items: center;
  min-height: 88px;
  padding: 14px 16px;
}

.api-compact-identity {
  min-width: 0;
}

.api-compact-identity h3 {
  overflow: hidden;
  margin: 0;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-compact-identity p {
  overflow: hidden;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-compact-stats {
  display: grid;
  grid-template-columns: 0.7fr 0.8fr 1.35fr 0.7fr;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.api-compact-stats > span {
  display: grid;
  gap: 3px;
  min-width: 0;
  min-height: 48px;
  align-content: center;
  padding: 7px 10px;
  border-right: 1px solid var(--line);
}

.api-compact-stats > span:last-child {
  border-right: 0;
}

.api-compact-stats small,
.api-compact-stats strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-compact-stats small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.api-compact-stats strong {
  color: #34465f;
  font-size: 12px;
}

.api-compact-stats .offer-count {
  color: #1974df;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.api-compact-stats .partnerboost-data-count {
  font-size: 12px;
}

.api-card-actions.api-compact-actions {
  display: grid;
  grid-template-columns: 116px 116px 76px 76px;
  gap: 6px;
  align-items: center;
  width: 402px;
  white-space: nowrap;
}

.api-card-actions.api-compact-actions .compact-btn {
  width: 100%;
  min-width: 0;
}

.api-card-details {
  border-top: 1px solid var(--line);
}

.api-card-details > summary {
  padding: 9px 16px;
  color: #5f718c;
  font-size: 11px;
  font-weight: 700;
  background: #f8faff;
  cursor: pointer;
  list-style-position: inside;
}

.api-card-details[open] > summary {
  color: #286fbf;
  border-bottom: 1px solid var(--line);
}

.api-card-details .api-meta-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 12px 14px 0;
}

.api-card-details .api-meta-grid > div {
  padding: 9px 10px;
}

.api-card-details .mapping-strip {
  gap: 6px;
  padding: 10px 14px 14px;
}

.api-card-details .mapping-strip span {
  padding: 4px 7px;
  font-size: 10px;
}

@container (max-width: 1450px) {
  .api-compact-main {
    grid-template-columns: minmax(190px, 0.8fr) minmax(390px, 1.4fr);
  }

  .api-card-actions.api-compact-actions {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

@media (max-width: 1180px) {
  .api-compact-main {
    grid-template-columns: minmax(190px, 0.8fr) minmax(390px, 1.4fr);
  }

  .api-card-actions.api-compact-actions {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .partnerboost-configuration-form {
    grid-template-columns: 1fr;
  }

  .partnerboost-connect-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .partnerboost-sync-status-grid {
    grid-template-columns: 1fr;
  }

  .api-compact-main,
  .api-card-details .api-meta-grid {
    grid-template-columns: 1fr;
  }

  .api-compact-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .api-compact-stats > span:nth-child(2) {
    border-right: 0;
  }

  .api-compact-stats > span:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .api-card-actions.api-compact-actions {
    grid-column: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-self: stretch;
    width: 100%;
  }
}

/* Login: product overview and administrator access. */
.auth-shell {
  display: block;
  min-height: 100vh;
  height: 100vh;
  padding: 0;
  overflow: auto;
  place-items: normal;
  color: #1d2a43;
  background:
    radial-gradient(circle at 14% 38%, rgba(39, 126, 232, 0.13), transparent 34%),
    radial-gradient(circle at 89% 42%, rgba(244, 178, 131, 0.15), transparent 32%),
    #f8faff;
}

.auth-topbar {
  display: flex;
  width: 100%;
  min-height: 78px;
  align-items: center;
  padding: 0 clamp(28px, 5vw, 76px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid #e4eaf3;
}

.auth-topbar .auth-brand {
  gap: 12px;
  padding: 0;
  border: 0;
}

.auth-topbar .auth-brand .brand-logo {
  width: 42px;
  height: 42px;
}

.auth-topbar .auth-brand .brand-name {
  color: #17396d;
  font-size: 25px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.auth-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(420px, 0.74fr);
  gap: clamp(54px, 7vw, 112px);
  width: min(1480px, calc(100% - clamp(56px, 9vw, 144px)));
  min-height: calc(100vh - 78px);
  margin: 0 auto;
  padding: clamp(54px, 7vh, 86px) 0;
  align-items: center;
}

.auth-overview {
  max-width: 820px;
}

.auth-eyebrow,
.auth-panel-kicker {
  display: inline-flex;
  align-items: center;
  color: #236fd2;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.auth-eyebrow {
  min-height: 34px;
  padding: 0 15px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid #b9d8ff;
  border-radius: 999px;
}

.auth-overview h1 {
  max-width: 760px;
  margin: 26px 0 22px;
  color: #101a2e;
  font-size: clamp(48px, 5.25vw, 76px);
  font-weight: 830;
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.auth-overview-copy {
  max-width: 740px;
  margin: 0;
  color: #50617b;
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.75;
}

.auth-capability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 34px;
}

.auth-capability-card {
  min-height: 152px;
  padding: 22px 24px;
  background: rgba(255, 255, 255, 0.87);
  border: 1px solid #dbe4f1;
  border-radius: 18px;
  box-shadow: 0 12px 34px rgba(37, 71, 126, 0.07);
}

.auth-capability-card > span {
  display: block;
  color: #237ee8;
  font-size: 13px;
  font-weight: 750;
}

.auth-capability-card > strong {
  display: block;
  margin-top: 14px;
  color: #182640;
  font-size: 22px;
  line-height: 1.25;
}

.auth-capability-card > p {
  margin: 10px 0 0;
  color: #63738d;
  font-size: 14px;
  line-height: 1.6;
}

.auth-feature-panel {
  margin-top: 18px;
  padding: 22px 26px;
  color: #244c84;
  background: rgba(234, 243, 255, 0.82);
  border: 1px solid #b9d8ff;
  border-radius: 18px;
}

.auth-feature-panel > strong {
  font-size: 14px;
}

.auth-feature-panel ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 28px;
  margin: 14px 0 0;
  padding-left: 20px;
  color: #315d99;
  font-size: 14px;
  line-height: 1.55;
}

.auth-panel {
  width: 100%;
  max-width: 560px;
  justify-self: end;
  padding: clamp(34px, 4vw, 54px);
  color: #1d2a43;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #dce4ef;
  border-radius: 28px;
  box-shadow: 0 26px 70px rgba(38, 68, 117, 0.13);
}

.auth-panel .auth-heading {
  margin: 0 0 32px;
}

.auth-panel .auth-heading h2 {
  margin: 12px 0 0;
  color: #101a2e;
  font-size: clamp(34px, 3vw, 44px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.auth-panel .auth-heading p {
  margin: 12px 0 0;
  color: #62728a;
  font-size: 15px;
  line-height: 1.6;
}

.auth-panel .auth-form {
  gap: 22px;
}

.auth-panel .auth-form label,
.auth-panel .auth-form label span {
  gap: 10px;
}

.auth-panel .auth-form label span {
  color: #2d3b52;
  font-size: 14px;
  font-weight: 750;
}

.auth-panel .auth-form input {
  min-height: 58px;
  padding: 0 17px;
  color: #1c2a42;
  background: #ffffff;
  border: 1px solid #cbd6e5;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(35, 75, 130, 0.04);
}

.auth-panel .auth-form input::placeholder {
  color: #a3afc1;
}

.auth-panel .auth-form input:focus {
  border-color: #237ee8;
  box-shadow: 0 0 0 4px rgba(35, 126, 232, 0.12);
}

.auth-panel .auth-form .primary-btn {
  min-height: 58px;
  margin-top: 4px;
  color: #ffffff;
  background: #235ae0;
  border-color: #235ae0;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 760;
  box-shadow: 0 13px 28px rgba(35, 90, 224, 0.22);
}

.auth-panel .auth-form .primary-btn:hover {
  background: #164bca;
  border-color: #164bca;
}

.auth-panel .auth-form .primary-btn:disabled {
  box-shadow: none;
}

.auth-panel .auth-error {
  margin: -12px 0 22px;
  border-radius: 10px;
}

.auth-security-note {
  margin: 22px 0 0;
  color: #8794a8;
  font-size: 12px;
  text-align: center;
}

@media (max-width: 1060px) {
  .auth-stage {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 0.82fr);
    gap: 42px;
    width: min(100% - 48px, 1120px);
  }

  .auth-overview h1 {
    font-size: clamp(44px, 5.5vw, 62px);
  }

  .auth-capability-grid {
    grid-template-columns: 1fr;
  }

  .auth-capability-card {
    min-height: auto;
  }

  .auth-feature-panel ul {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .auth-topbar {
    min-height: 68px;
    padding: 0 22px;
  }

  .auth-topbar .auth-brand .brand-logo {
    width: 36px;
    height: 36px;
  }

  .auth-topbar .auth-brand .brand-name {
    font-size: 22px;
  }

  .auth-stage {
    grid-template-columns: 1fr;
    gap: 34px;
    width: min(100% - 36px, 620px);
    min-height: 0;
    padding: 38px 0 48px;
  }

  .auth-overview {
    max-width: none;
  }

  .auth-overview h1 {
    margin-top: 20px;
    font-size: clamp(40px, 12vw, 58px);
  }

  .auth-overview-copy {
    font-size: 16px;
  }

  .auth-capability-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 26px;
  }

  .auth-capability-card {
    padding: 18px;
  }

  .auth-capability-card > strong {
    font-size: 18px;
  }

  .auth-feature-panel ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-panel {
    max-width: none;
    justify-self: stretch;
    padding: 34px;
    border-radius: 22px;
  }
}

@media (max-width: 520px) {
  .auth-stage {
    width: min(100% - 28px, 480px);
    padding-top: 28px;
  }

  .auth-eyebrow {
    min-height: 31px;
    padding: 0 12px;
    font-size: 11px;
  }

  .auth-overview h1 {
    margin-bottom: 16px;
    font-size: 40px;
    letter-spacing: -0.045em;
  }

  .auth-overview-copy {
    font-size: 15px;
    line-height: 1.65;
  }

  .auth-capability-grid,
  .auth-feature-panel ul {
    grid-template-columns: 1fr;
  }

  .auth-capability-card,
  .auth-feature-panel {
    border-radius: 14px;
  }

  .auth-panel {
    padding: 28px 22px;
    border-radius: 18px;
  }

  .auth-panel .auth-heading h2 {
    font-size: 34px;
  }

  .auth-panel .auth-form input,
  .auth-panel .auth-form .primary-btn {
    min-height: 54px;
  }
}
