:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef3f8;
  --ink: #18202f;
  --muted: #667085;
  --subtle: #98a2b3;
  --line: #dce3ec;
  --line-strong: #c6d0dd;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #e7efff;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --nav: #101828;
  --nav-muted: #98a2b3;
  --shadow: 0 18px 45px rgba(16, 24, 40, 0.08);
  --radius: 8px;
  --radius-sm: 6px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f131a;
  --surface: #171c25;
  --surface-2: #1f2632;
  --surface-3: #273242;
  --ink: #e6ebf3;
  --muted: #a5adba;
  --subtle: #7e8798;
  --line: #2f3a4b;
  --line-strong: #465468;
  --brand: #6aa7ff;
  --brand-dark: #93bdff;
  --brand-soft: #18345c;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --nav: #111720;
  --nav-muted: #8d98aa;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  min-height: 100vh;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--nav);
  color: #fff;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
  padding: 4px 6px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #60a5fa, #1d4ed8);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
  line-height: 1.2;
}

.brand small {
  color: var(--nav-muted);
  font-size: 12px;
  margin-top: 2px;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: #d0d5dd;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-size: 14px;
  text-align: left;
}

.nav-item:hover,
.nav-item.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav-icon {
  width: 28px;
  height: 24px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: #9cc2ff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}

.nav-group {
  display: grid;
  gap: 2px;
}

.nav-group-title {
  width: 100%;
  color: #d0d5dd;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-size: 14px;
  font-weight: 700;
}

.nav-sublist {
  display: grid;
  gap: 2px;
  padding-left: 40px;
}

.nav-subitem {
  min-height: 30px;
  border: 0;
  background: transparent;
  color: #d0d5dd;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  padding: 0 8px;
}

.nav-subitem:hover,
.nav-subitem.is-active {
  color: #fff;
}

.sidebar-card {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  padding: 14px;
}

.sidebar-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.sidebar-card p {
  margin: 0 0 6px;
  color: var(--nav-muted);
  font-size: 12px;
}

.sidebar-card-head p {
  margin: 0;
}

.sidebar-card strong {
  display: block;
  margin-bottom: 12px;
  font-size: 14px;
}

.sidebar-utilities {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  justify-content: flex-end;
  margin-top: auto;
  position: relative;
  z-index: 15;
}

.language-switcher {
  position: relative;
  min-width: 0;
  flex: 0 0 auto;
}

.language-toggle {
  display: inline-grid;
  grid-template-columns: 16px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 7px;
  min-width: 142px;
  max-width: 164px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-align: left;
  flex: 0 0 auto;
}

.language-toggle:hover,
.language-switcher.is-open .language-toggle {
  border-color: var(--brand);
  color: var(--brand);
}

.language-icon,
.language-caret {
  width: 15px;
  height: 15px;
  stroke-width: 1.9;
}

.language-current {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.language-caret {
  transition: transform 140ms ease;
}

.language-switcher.is-open .language-caret {
  transform: rotate(180deg);
}

.language-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  width: 164px;
  display: grid;
  gap: 4px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.language-menu[hidden] {
  display: none;
}

.language-option {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.language-option:hover,
.language-option[aria-checked="true"] {
  background: var(--brand-soft);
  color: var(--brand);
}

.language-check {
  width: 16px;
  color: var(--brand);
  opacity: 0;
}

.language-option[aria-checked="true"] .language-check {
  opacity: 1;
}

.theme-toggle {
  display: inline-grid;
  flex: 0 0 30px;
  width: 30px;
  min-width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  padding: 0;
}

.theme-toggle:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.theme-icon {
  display: none;
  width: 16px;
  height: 16px;
  stroke-width: 1.9;
}

.theme-icon-sun {
  display: block;
}

:root[data-theme="dark"] .theme-icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-icon-moon {
  display: block;
}

.admin-debug-panel {
  display: block;
}

.admin-debug-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.admin-debug-panel summary::-webkit-details-marker {
  display: none;
}

.admin-debug-panel summary::after {
  content: "+";
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
}

.admin-debug-panel[open] summary::after {
  content: "-";
}

.admin-debug-panel summary span {
  display: grid;
  gap: 4px;
}

.admin-debug-panel summary strong,
.admin-debug-body h3 {
  margin: 0;
  color: var(--ink);
}

.admin-debug-panel summary small,
.admin-debug-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.admin-debug-body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.admin-debug-body > div {
  display: grid;
  gap: 6px;
}

.admin-debug-status {
  color: var(--success);
  font-size: 12px;
}

.workspace {
  min-width: 0;
  padding: 24px 28px 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

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

.api-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.button {
  min-height: 38px;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.button-primary {
  background: var(--brand);
  color: #fff;
}

.button-primary:hover {
  background: var(--brand-dark);
}

.button-secondary {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.button-soft {
  color: #dce9ff;
  background: rgba(37, 99, 235, 0.25);
  border-color: rgba(147, 197, 253, 0.25);
}

.button-ghost {
  color: var(--brand);
  background: transparent;
  border-color: transparent;
  padding-inline: 6px;
}

.button-full {
  width: 100%;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  display: grid;
  gap: 4px;
  place-content: center;
}

.icon-button span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
}

.mobile-only {
  display: none;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.status-strip article {
  min-height: 70px;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.status-strip p,
.status-strip strong {
  margin: 0;
}

.status-strip p {
  color: var(--muted);
  font-size: 12px;
}

.status-strip strong {
  font-size: 14px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  grid-row: span 2;
}

.status-dot.success {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
}

.status-dot.warning {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.14);
}

.status-dot.danger {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

.view {
  display: grid;
  gap: 18px;
}

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

.metric-card,
.panel,
.table-panel,
.form-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 18px;
}

.metric-card p,
.panel-title p,
.field label,
.meta-text {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  letter-spacing: 0;
}

.metric-card small {
  display: block;
  margin-top: 8px;
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.7fr);
  gap: 18px;
  align-items: start;
}

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

.panel,
.table-panel,
.form-panel {
  padding: 18px;
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-title h2,
.panel-title h3 {
  margin: 0;
  font-size: 18px;
}

.panel-title h3 {
  font-size: 16px;
}

.chart-bars {
  height: 240px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding-top: 18px;
}

.bar {
  flex: 1;
  min-width: 18px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  position: relative;
}

.bar::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  bottom: -24px;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 11px;
}

.split-list {
  display: grid;
  gap: 10px;
}

.list-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.list-row strong,
.list-row p {
  margin: 0;
}

.list-row p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.automation-stream-panel {
  min-width: 0;
}

.automation-stream-title {
  align-items: center;
}

.automation-stream-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.automation-stream-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.automation-stream-live i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #06b6d4;
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.13);
}

.automation-stream-live.is-demo i,
.automation-stream-mode.is-demo i {
  background: #8b5cf6;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.14);
}

.automation-stream-live.is-empty i,
.automation-stream-mode.is-empty i {
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.16);
}

.automation-stream-live.is-error i,
.automation-stream-mode.is-error i {
  background: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

.automation-stream-shell {
  display: grid;
  gap: 10px;
  min-height: 260px;
  transition: opacity 140ms ease;
}

.automation-stream-shell.is-refreshing {
  opacity: 0.68;
}

.automation-stream-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11px;
}

.automation-stream-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  padding: 0 8px;
  font-weight: 800;
}

.automation-stream-meta span.is-danger {
  border-color: rgba(220, 38, 38, 0.24);
  color: #991b1b;
  background: #fee2e2;
}

.automation-stream-mode {
  gap: 6px;
}

.automation-stream-mode i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #06b6d4;
}

.automation-stream-list {
  display: grid;
  gap: 8px;
  max-height: 368px;
  overflow: auto;
  padding-right: 2px;
}

.automation-stream-entry {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  align-items: stretch;
}

.automation-stream-entry.is-new .automation-stream-item {
  animation: automation-stream-new 1600ms ease-out;
}

@keyframes automation-stream-new {
  0% {
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.24);
    background: #eff6ff;
  }
  100% {
    box-shadow: none;
    background: var(--surface);
  }
}

.automation-stream-item {
  appearance: none;
  width: 100%;
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: 70px 92px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid #0ea5e9;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.automation-stream-item:hover,
.automation-stream-item:focus-visible,
.automation-stream-item[aria-expanded="true"] {
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.automation-stream-item[aria-expanded="true"] {
  background: #f8fbff;
}

.automation-stream-item.is-success {
  border-left-color: #16a34a;
}

.automation-stream-item.is-warning {
  border-left-color: #d97706;
}

.automation-stream-item.is-danger {
  border-left-color: #dc2626;
}

.automation-stream-time,
.automation-stream-agent {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.automation-stream-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.automation-stream-agent {
  color: #0f766e;
}

.automation-stream-item.is-warning .automation-stream-agent {
  color: #92400e;
}

.automation-stream-item.is-danger .automation-stream-agent {
  color: #b91c1c;
}

.automation-stream-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.automation-stream-copy strong,
.automation-stream-copy small {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.automation-stream-copy strong {
  color: var(--ink);
  font-size: 13px;
}

.automation-stream-copy small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.automation-stream-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  width: max-content;
  max-width: 150px;
  border-radius: 999px;
  padding: 0 9px;
  color: #075985;
  background: #e0f2fe;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.automation-stream-detail {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 10px;
}

.automation-stream-detail[hidden] {
  display: none;
}

.automation-stream-detail div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: var(--muted);
  font-size: 11px;
}

.automation-stream-detail span {
  font-weight: 900;
  text-transform: uppercase;
}

.automation-stream-detail strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 700;
}

.automation-stream-item.is-success .automation-stream-status {
  color: #166534;
  background: #dcfce7;
}

.automation-stream-item.is-warning .automation-stream-status {
  color: #92400e;
  background: #fef3c7;
}

.automation-stream-item.is-danger .automation-stream-status {
  color: #991b1b;
  background: #fee2e2;
}

.automation-stream-empty {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 20px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.automation-stream-empty strong,
.automation-stream-empty span {
  max-width: 440px;
}

.automation-stream-empty span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.platform-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 800;
  font-size: 13px;
}

.tag {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  background: var(--surface-3);
  color: var(--muted);
}

.tag.success {
  background: #dcfce7;
  color: #166534;
}

.tag.warning {
  background: #fef3c7;
  color: #92400e;
}

.tag.danger {
  background: #fee2e2;
  color: #991b1b;
}

.template-workbench {
  display: grid;
  gap: 16px;
}

.template-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, #f8fafc);
  box-shadow: var(--shadow);
}

.template-hero h2,
.template-hero p {
  margin: 0;
}

.template-hero h2 {
  margin-top: 4px;
  font-size: 28px;
  letter-spacing: 0;
}

.template-hero span {
  display: block;
  margin-top: 8px;
  max-width: 720px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.template-kicker {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.template-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.template-summary-grid article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.template-summary-grid span,
.template-summary-grid small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.template-summary-grid strong {
  display: block;
  margin: 6px 0;
  font-size: 24px;
}

.template-table-panel {
  padding: 0;
  overflow: hidden;
}

.template-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.template-search {
  max-width: 360px;
}

.template-table-wrap {
  max-width: 100%;
  overflow: auto;
}

.template-table {
  min-width: 1280px;
}

.template-table th,
.template-table td {
  vertical-align: top;
}

.template-name-cell {
  min-width: 220px;
}

.template-name-cell strong,
.template-name-cell span {
  display: block;
}

.template-name-cell strong {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-name-cell span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.template-name-cell em {
  display: inline-flex;
  margin: 0 4px 4px 0;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-style: normal;
}

.template-truncate {
  display: inline-block;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 230px;
}

.template-actions .button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.danger-text {
  color: var(--danger);
}

.template-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 80;
  width: min(620px, calc(100vw - 32px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 60px rgba(15, 23, 42, 0.18);
}

.template-drawer header,
.template-drawer footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.template-drawer footer {
  align-items: center;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.template-drawer h2,
.template-drawer p {
  margin: 0;
}

.template-drawer header span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.template-drawer header p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.template-drawer-body {
  display: grid;
  gap: 12px;
  padding: 16px;
  overflow: auto;
}

.template-detail-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.template-detail-section h3 {
  margin: 0 0 12px;
  font-size: 14px;
}

.template-detail-section dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.template-detail-section dl div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
}

.template-detail-section dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.template-detail-section dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.template-editor {
  max-width: 900px;
}

.template-editor-page {
  padding-bottom: 24px;
}

.template-editor-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, #f8fafc);
  box-shadow: var(--shadow);
}

.template-editor-hero h2,
.template-editor-hero p {
  margin: 0;
}

.template-editor-hero h2 {
  margin-top: 6px;
  font-size: 30px;
  letter-spacing: 0;
}

.template-editor-hero span {
  display: block;
  margin-top: 8px;
  max-width: 720px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.template-editor-safe-note {
  min-width: 280px;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  background: #eff6ff;
  color: #1e3a8a;
}

.template-editor-safe-note strong,
.template-editor-safe-note span {
  display: block;
}

.template-editor-safe-note span {
  margin-top: 4px;
  font-size: 12px;
}

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

.template-editor-form-page {
  padding: 0;
  overflow: visible;
}

.template-editor-form .full,
.template-editor-group,
.template-editor-actions {
  grid-column: 1 / -1;
}

.template-editor-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.template-editor-group legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.template-editor-group-identity {
  background: #eef4fb;
}

.template-asset-policy {
  padding: 12px 14px;
  border: 1px dashed #bfdbfe;
  border-radius: var(--radius-sm);
  background: #f8fbff;
}

.template-asset-policy strong,
.template-asset-policy span {
  display: block;
}

.template-asset-policy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.template-check-row,
.template-binding-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.template-check-row {
  align-self: end;
}

.template-binding-group {
  grid-template-columns: 1fr;
}

.template-binding-row {
  justify-content: space-between;
}

.template-binding-row input[type="text"],
.template-binding-row input:not([type]) {
  max-width: 280px;
}

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

.template-editor-actions > div {
  margin-right: auto;
}

.template-editor-actions p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.template-editor-sticky {
  position: sticky;
  bottom: 16px;
  z-index: 10;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

tr:last-child td {
  border-bottom: 0;
}

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

.field {
  display: grid;
  gap: 7px;
}

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

.ai-assistant-root {
  position: fixed;
  left: 24px;
  top: 24px;
  z-index: 80;
  pointer-events: none;
}

.ai-assistant {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  pointer-events: auto;
}

.ai-assistant-launcher {
  --ai-robot-eye-x: 0px;
  --ai-robot-eye-y: 0px;
  width: 88px;
  height: 92px;
  border: 0;
  background: transparent;
  color: #0f172a;
  padding: 6px;
  border-radius: 0;
  box-shadow: none;
  font-weight: 800;
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  transition: transform 140ms ease;
}

.ai-assistant-launcher:hover {
  transform: translateY(-2px);
}

.ai-assistant-launcher:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.32);
  outline-offset: 4px;
  border-radius: 18px;
}

.ai-assistant-robot {
  position: relative;
  width: 74px;
  height: 76px;
  display: block;
  filter: drop-shadow(0 16px 18px rgba(15, 23, 42, 0.18));
  transition: filter 140ms ease, transform 140ms ease;
}

.ai-assistant-launcher:hover .ai-assistant-robot,
.ai-assistant-launcher:focus-visible .ai-assistant-robot {
  filter: drop-shadow(0 20px 20px rgba(15, 23, 42, 0.2));
}

.ai-assistant-robot-antenna {
  position: absolute;
  left: 50%;
  top: 0;
  width: 4px;
  height: 14px;
  border-radius: 999px;
  background: #2563eb;
  transform: translateX(-50%);
}

.ai-assistant-robot-antenna::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -6px;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #22d3ee;
  box-shadow: 0 0 0 5px rgba(34, 211, 238, 0.18);
  transform: translateX(-50%);
}

.ai-assistant-robot-head {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 0;
  height: 58px;
  border: 1px solid rgba(37, 99, 235, 0.36);
  border-radius: 18px 18px 15px 15px;
  background: linear-gradient(180deg, #ffffff 0%, #e0f2fe 100%);
  box-shadow:
    inset 0 -8px 18px rgba(37, 99, 235, 0.08),
    0 0 0 5px rgba(59, 130, 246, 0.12);
}

.ai-assistant-robot-head::before,
.ai-assistant-robot-head::after {
  content: "";
  position: absolute;
  top: 22px;
  width: 8px;
  height: 20px;
  border: 1px solid rgba(37, 99, 235, 0.26);
  border-radius: 999px;
  background: #bfdbfe;
}

.ai-assistant-robot-head::before {
  left: -9px;
}

.ai-assistant-robot-head::after {
  right: -9px;
}

.ai-assistant-robot-eyes {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 18px;
  height: 20px;
  border-radius: 9px;
  background: #172554;
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: inset 0 0 0 2px rgba(15, 23, 42, 0.12);
}

.ai-assistant-robot-eye {
  width: 16px;
  height: 13px;
  border-radius: 999px;
  background: transparent;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.ai-assistant-robot-pupil {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #67e8f9;
  box-shadow: 0 0 0 2px rgba(103, 232, 249, 0.16);
  transform: translate(var(--ai-robot-eye-x), var(--ai-robot-eye-y));
  transition: transform 80ms linear;
}

.ai-assistant-robot-mouth {
  position: absolute;
  left: 50%;
  bottom: 12px;
  width: 24px;
  height: 3px;
  border-radius: 999px;
  background: #2563eb;
  transform: translateX(-50%);
  opacity: 0.8;
}

.ai-assistant-robot-mouth::before,
.ai-assistant-robot-mouth::after {
  content: "";
  position: absolute;
  left: 3px;
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: #2563eb;
}

.ai-assistant-robot-mouth::before {
  top: -6px;
}

.ai-assistant-robot-mouth::after {
  top: 6px;
}

.ai-assistant-robot-status {
  position: absolute;
  right: 8px;
  bottom: 10px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16);
}

.ai-assistant.is-open .ai-assistant-launcher {
  display: none;
}

.ai-assistant-panel {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 320px;
  min-height: 420px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ai-assistant-head {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  cursor: move;
  touch-action: none;
  user-select: none;
}

.ai-assistant-head strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
}

.ai-assistant-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.ai-assistant-head .ai-assistant-config {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 3px 8px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.ai-assistant-head .ai-assistant-config.is-ready {
  background: #dcfce7;
  color: #166534;
}

.ai-assistant-head .ai-assistant-config.is-tested {
  background: #fffbeb;
  color: #92400e;
}

.ai-assistant-head .ai-assistant-config.is-missing {
  background: #fff1f2;
  color: #9f1239;
}

.ai-assistant-head-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
  cursor: auto;
  touch-action: auto;
}

.ai-assistant-prompts {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.ai-assistant-prompts button {
  border: 1px solid var(--line);
  background: #f8fbff;
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 10px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.ai-assistant-messages {
  flex: 1;
  overflow: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-assistant-message {
  max-width: 88%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
}

.ai-assistant-message p {
  margin: 4px 0 0;
  white-space: pre-wrap;
}

.ai-assistant-message.user {
  align-self: flex-end;
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.ai-assistant-message.assistant {
  align-self: flex-start;
}

.ai-assistant-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.ai-assistant-actions .button {
  min-height: 28px;
}

.ai-assistant-actions .button.is-success {
  border-color: rgba(22, 163, 74, 0.34);
  background: #f0fdf4;
  color: #15803d;
}

.ai-assistant-actions .button.is-error {
  border-color: rgba(220, 38, 38, 0.34);
  background: #fef2f2;
  color: #b91c1c;
}

.ai-assistant-action-feedback-list {
  display: grid;
  gap: 4px;
  margin-top: 6px;
}

.ai-assistant-action-feedback {
  font-size: 12px;
}

.ai-assistant-action-feedback.is-success {
  color: #15803d;
}

.ai-assistant-action-feedback.is-error {
  color: #b91c1c;
}

.ai-assistant-loading {
  color: var(--muted);
}

.ai-assistant-error {
  margin: 0 16px 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff7ed;
  color: #b45309;
  border: 1px solid #fed7aa;
  font-size: 12px;
}

.ai-assistant-input-row {
  border-top: 1px solid var(--line);
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.ai-assistant-input-row textarea {
  resize: none;
  min-height: 48px;
  max-height: 120px;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  font: inherit;
}

.ai-assistant-resize-handle {
  position: absolute;
  z-index: 3;
  touch-action: none;
}

.ai-assistant-resize-handle.right {
  top: 72px;
  right: 0;
  bottom: 18px;
  width: 8px;
  cursor: ew-resize;
}

.ai-assistant-resize-handle.bottom {
  right: 18px;
  bottom: 0;
  left: 18px;
  height: 8px;
  cursor: ns-resize;
}

.ai-assistant-resize-handle.corner {
  right: 0;
  bottom: 0;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
}

.ai-assistant-resize-handle.corner::after {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 9px;
  height: 9px;
  border-right: 2px solid rgba(100, 116, 139, 0.55);
  border-bottom: 2px solid rgba(100, 116, 139, 0.55);
  border-radius: 1px;
}

@media (max-width: 720px) {
  .ai-assistant-root {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }

  body[data-view="admin"] .ai-assistant-root:not(:has(.ai-assistant.is-open)) {
    display: none;
  }

  .ai-assistant {
    justify-content: flex-end;
  }

  .ai-assistant.is-open {
    display: block;
  }

  .ai-assistant-panel {
    width: 100%;
    height: min(620px, calc(100vh - 24px));
  }
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

.field textarea {
  padding-block: 10px;
  min-height: 92px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

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

.filter-chip {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
}

.filter-chip.is-active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.approval-card {
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.approval-card pre {
  margin: 0;
  white-space: pre-wrap;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.55;
}

.empty-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 24px;
}

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

.view-partial-campaigns,
.view-partial-campaigns > .view-partial-content {
  min-width: 0;
  max-width: 100%;
}

.ads-insight-panel,
.ads-insight-analytics,
.ads-insight-analytics > .panel,
.ads-insight-trend-card,
.ads-insight-funnel-card,
.ads-insight-trend-controls,
.ads-insight-trend-kpis,
.ads-insight-funnel,
.ads-insight-chart-shell,
.ads-insight-echart {
  min-width: 0;
  max-width: 100%;
}

.ads-insight-trend-control-panel {
  display: grid;
  gap: 10px;
  margin: 12px 0 18px;
  padding: 10px;
  border: 1px solid rgba(198, 208, 221, 0.72);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.ads-insight-trend-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(118px, 1fr));
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  padding: 4px;
  border: 1px solid rgba(220, 227, 236, 0.9);
  border-radius: 8px;
  background: #f3f6fb;
  scrollbar-width: none;
}

.ads-insight-trend-metrics::-webkit-scrollbar,
.ads-insight-trend-event-list::-webkit-scrollbar {
  display: none;
}

.ads-insight-trend-metric {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #667085;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.ads-insight-trend-metric:hover {
  color: var(--ink);
  transform: translateY(-1px);
}

.ads-insight-trend-metric.is-active {
  border-color: rgba(37, 99, 235, 0.22);
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.92);
}

.ads-insight-trend-metric-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 7px;
  background: rgba(37, 99, 235, 0.09);
  color: #2563eb;
  position: relative;
}

.ads-insight-trend-metric-icon::before,
.ads-insight-trend-metric-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border: 0;
  transform: translate(-50%, -50%);
}

.ads-insight-trend-metric-icon.is-spend::before {
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.ads-insight-trend-metric-icon.is-conversions {
  color: #0f9f94;
  border-color: rgba(15, 159, 148, 0.2);
  background: rgba(15, 159, 148, 0.1);
}

.ads-insight-trend-metric-icon.is-conversions::before {
  width: 6px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translate(-50%, -58%) rotate(45deg);
}

.ads-insight-trend-metric-icon.is-clicks {
  color: #475467;
  border-color: rgba(71, 84, 103, 0.22);
  background: rgba(71, 84, 103, 0.08);
}

.ads-insight-trend-metric-icon.is-clicks::before {
  width: 12px;
  height: 12px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translate(-50%, -50%) rotate(-45deg);
}

.ads-insight-trend-metric-icon.is-event {
  color: #7c3aed;
  border-color: rgba(124, 58, 237, 0.18);
  background: rgba(124, 58, 237, 0.09);
}

.ads-insight-trend-metric-icon.is-event::before {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 7px 0 0 currentColor, 0 7px 0 currentColor, 7px 7px 0 currentColor;
  transform: translate(-6px, -6px);
}

.ads-insight-trend-event-strip {
  min-width: 0;
  overflow: visible;
}

.ads-insight-trend-event-list {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  overflow: visible;
  padding: 2px;
}

.ads-insight-trend-event-button {
  flex: 1 1 190px;
  min-width: min(100%, 178px);
  max-width: none;
  min-height: 40px;
  border: 1px solid rgba(220, 227, 236, 0.92);
  border-radius: 8px;
  background: #ffffff;
  color: #667085;
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  white-space: normal;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.ads-insight-trend-event-button:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.28);
}

.ads-insight-trend-event-button.is-active {
  border-color: rgba(37, 99, 235, 0.36);
  background: #eef4ff;
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.ads-insight-trend-event-name {
  min-width: 0;
  overflow: visible;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.25;
}

.ads-insight-trend-event-count {
  align-self: center;
  min-width: 30px;
  border-radius: 7px;
  background: #eef3f8;
  color: var(--ink);
  padding: 2px 7px;
  text-align: center;
}

.ads-insight-trend-event-button.is-active .ads-insight-trend-event-count {
  background: #ffffff;
  color: #1d4ed8;
}

.ads-insight-trend-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ads-insight-trend-kpi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  min-height: 106px;
  border-color: rgba(198, 208, 221, 0.72);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.ads-insight-trend-kpi > div {
  min-width: 0;
}

.ads-insight-echart-shell {
  min-height: 400px;
  border-color: rgba(148, 163, 184, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 251, 255, 0.98) 100%),
    radial-gradient(circle at top right, rgba(20, 184, 166, 0.12), transparent 30%);
  padding: 14px 14px 8px;
  overflow: hidden;
}

.ads-insight-echart {
  width: 100%;
  height: 360px;
  min-height: 320px;
}

.ads-insight-echart-fallback {
  min-height: 280px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}



.ads-control-console {
  display: grid;
  gap: 14px;
}

.ads-control-console-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.ads-control-breadcrumb,
.ads-control-summaryline {
  margin: 0;
}

.ads-control-breadcrumb {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ads-control-breadcrumb span {
  color: var(--subtle);
  margin: 0 8px;
}

.ads-control-breadcrumb strong {
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}

.ads-control-summaryline {
  margin-top: 8px;
  color: #344054;
  font-size: 13px;
}

.ads-control-filter-grid {
  display: grid;
  grid-template-columns: minmax(190px, 220px) minmax(150px, 180px) minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

.ads-control-filter-grid .field {
  gap: 6px;
}

.ads-control-search-field {
  min-width: 260px;
}

.ads-control-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  align-items: center;
}

.ads-control-filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ads-control-filter-group > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ads-control-workspace {
  display: grid;
  grid-template-columns: minmax(720px, 1fr) minmax(340px, 360px);
  gap: 16px;
  align-items: start;
}

.ads-control-panel {
  min-width: 0;
}

.ads-control-bulkbar {
  align-items: center;
  margin-bottom: 12px;
}

.ads-control-action-row,
.ads-control-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.ads-control-row-actions {
  min-width: 92px;
  justify-content: flex-end;
}

.ads-control-name-cell {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  min-width: 0;
}

.ads-control-row.level-campaign {
  box-shadow: inset 3px 0 0 #2563eb;
  background: #f6f9ff;
}

.ads-control-row.level-adset {
  box-shadow: inset 3px 0 0 #10b981;
}

.ads-control-row.level-ad {
  box-shadow: inset 3px 0 0 #94a3b8;
}

.ads-control-level-dot {
  width: 9px;
  height: 9px;
  margin-top: 8px;
  border-radius: 999px;
  background: #94a3b8;
  flex: 0 0 9px;
}

.level-campaign .ads-control-level-dot {
  background: #2563eb;
}

.level-adset .ads-control-level-dot {
  background: #10b981;
}

.ads-control-name-cell strong,
.ads-control-name-cell small {
  display: block;
}

.ads-control-name-cell strong {
  color: #101828;
  line-height: 1.25;
}

.ads-control-name-cell small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.ads-control-spacer {
  width: 30px;
  flex: 0 0 30px;
}

.ads-control-status-pair {
  display: grid;
  gap: 4px;
}

.ads-control-status-cell {
  display: grid;
  grid-template-columns: 8px auto;
  gap: 5px 8px;
  align-items: center;
}

.ads-control-status-cell .delivery-badge,
.ads-control-status-cell small {
  grid-column: 2;
}

.ads-control-status-cell small {
  color: var(--muted);
  font-size: 11px;
}

.ads-control-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #94a3b8;
}

.ads-control-status-dot.is-active {
  background: #10b981;
}

.ads-control-status-dot.is-paused,
.ads-control-status-dot.is-parent_paused,
.ads-control-status-dot.is-not_delivering {
  background: #f59e0b;
}

.ads-control-status-dot.is-limited,
.ads-control-status-dot.is-account_issue {
  background: #ef4444;
}

.ads-control-level-badge,
.delivery-badge,
.ads-control-disabled-pill {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0 9px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.ads-control-level-badge.is-campaign {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.ads-control-level-badge.is-adset {
  color: #047857;
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.ads-control-level-badge.is-ad {
  color: #475569;
  background: #f8fafc;
  border-color: #e2e8f0;
}

.delivery-badge.is-active {
  color: #047857;
  background: #dcfce7;
  border-color: #bbf7d0;
}

.delivery-badge.is-paused,
.delivery-badge.is-parent_paused,
.delivery-badge.is-not_delivering {
  color: #92400e;
  background: #fffbeb;
  border-color: #fde68a;
}

.delivery-badge.is-review {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.delivery-badge.is-limited,
.delivery-badge.is-account_issue {
  color: #b91c1c;
  background: #fff1f2;
  border-color: #fecdd3;
}

.delivery-badge.is-missing {
  color: #64748b;
  background: #f8fafc;
}

.ads-control-delivery {
  display: grid;
  gap: 4px;
}

.ads-control-delivery small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.ads-control-disabled-pill {
  color: #64748b;
  background: #f8fafc;
  border-color: #e2e8f0;
}

.ads-control-drawer {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 118px);
  min-height: 560px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  padding: 0;
}

.ads-control-drawer-head {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
}

.ads-control-drawer-head h2,
.ads-control-drawer-head p {
  margin: 0;
}

.ads-control-drawer-head h2 {
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.25;
}

.ads-control-drawer-tabs {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.ads-control-drawer-body {
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.ads-control-drawer .field-grid {
  grid-template-columns: 1fr;
}

.ads-control-table {
  min-width: 1040px;
}

.ads-control-table th,
.ads-control-table td {
  white-space: normal;
  vertical-align: top;
  padding-top: 13px;
  padding-bottom: 13px;
}

.ads-control-table td:nth-child(2) {
  min-width: 330px;
}

.ads-control-select-col {
  width: 40px;
}

.ads-control-row {
  transition: background-color 120ms ease;
}

.ads-control-row:hover {
  background: #f8fbff;
}

.ads-control-row.is-selected {
  background: #eef4ff;
}

.ads-control-detail-stack {
  display: grid;
  gap: 12px;
}

.ads-control-detail-card,
.ads-control-preview,
.ads-control-rule-card,
.ads-control-step-card,
.ads-control-risk-note,
.ads-control-drawer-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.ads-control-detail-card h3,
.ads-control-rule-card strong,
.ads-control-step-card strong,
.ads-control-risk-note strong,
.ads-control-drawer-section h3 {
  margin: 0;
  font-size: 14px;
}

.ads-control-drawer-section h3 {
  color: #344054;
  font-size: 13px;
}

.ads-control-rule-card span,
.ads-control-step-card p,
.ads-control-risk-note span,
.ads-control-excluded-list small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.ads-control-step-card > span {
  color: #2563eb;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.ads-control-risk-note {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

.ads-control-excluded-list {
  display: grid;
  gap: 4px;
}

.ads-control-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.ads-control-detail-grid > div {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.ads-control-detail-grid span,
.ads-control-before-after span,
.ads-control-preview-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ads-control-detail-grid strong,
.ads-control-before-after strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ads-control-status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ads-control-before-after {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.ads-control-before-after span {
  grid-column: 1 / -1;
}

.ads-control-before-after em {
  color: var(--muted);
  font-style: normal;
}

.ads-control-preview-table {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.ads-control-preview-head,
.ads-control-preview-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.4fr) 70px minmax(86px, 0.9fr) minmax(86px, 0.9fr) 64px minmax(78px, 0.7fr);
  gap: 4px 8px;
  align-items: center;
  padding: 8px;
  border-top: 1px solid var(--line);
}

.ads-control-preview-head {
  border-top: 0;
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.ads-control-preview-row span {
  overflow-wrap: anywhere;
}

.ads-control-preview-row em {
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
}

.ads-control-drawer-actions {
  justify-content: stretch;
}

.ads-control-drawer-actions .button {
  flex: 1 1 0;
}

.ads-control-text-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: #0f4fc7;
  padding: 3px 4px;
  font-size: 12px;
  font-weight: 800;
}

.ads-control-text-button:hover {
  color: #0b3b95;
  text-decoration: underline;
}

.ads-control-muted-reason {
  color: var(--warning);
  font-size: 11px;
}

.ads-control-metrics-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: baseline;
  color: #344054;
}

.ads-control-metrics-compact strong {
  color: #101828;
  font-weight: 900;
}

.ads-control-metrics-compact span {
  color: var(--muted);
  font-size: 12px;
}

.ads-control-drawer-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ads-control-drawer-quick-actions .button {
  min-width: 0;
  justify-content: center;
}

.ads-control-kv-list {
  display: grid;
  grid-template-columns: minmax(86px, 0.8fr) minmax(0, 1fr);
  gap: 7px 10px;
  align-items: center;
}

.ads-control-kv-list span {
  color: var(--muted);
  font-size: 12px;
}

.ads-control-kv-list strong {
  justify-self: end;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.ads-control-metric-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ads-control-metric-card {
  display: grid;
  gap: 6px;
  min-height: 56px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.ads-control-metric-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.ads-control-metric-card strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.facebook-connect-card {
  min-height: 112px;
  border: 1px solid #13a39a;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.12), rgba(37, 99, 235, 0.08), #fff);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-shadow: var(--shadow);
}

.facebook-card-copy {
  display: flex;
  align-items: center;
  gap: 16px;
}

.facebook-card-copy h2,
.facebook-card-copy p {
  margin: 0;
}

.facebook-card-copy h2 {
  font-size: 21px;
}

.facebook-card-copy p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.facebook-mark {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #0f9f94;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}

.facebook-card-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.facebook-button {
  background: #1877f2;
  color: #fff;
  min-width: 224px;
}

.oauth-note {
  border: 1px solid #7aa2ff;
  background: #eef4ff;
  color: #385078;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 13px;
}

.danger-note {
  border-color: #fca5a5;
  background: #fff1f2;
  color: #9f1239;
}

.cooldown-note {
  display: grid;
  gap: 4px;
  border-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

.cooldown-note strong {
  color: #78350f;
}

.cooldown-note small {
  color: #b45309;
  line-height: 1.45;
}

.warning-panel {
  border-color: #f59e0b;
}

.code-block {
  margin: 0;
  white-space: pre-wrap;
  background: #0f172a;
  color: #dbeafe;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
}

.search-input {
  min-height: 38px;
  min-width: min(380px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  color: var(--ink);
}

.account-label {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 5px;
  border: 1px solid #14b8a6;
  background: #ccfbf1;
  color: #0f766e;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.account-label-input {
  width: 148px;
  min-height: 34px;
  border-radius: 5px;
  border: 1px solid #14b8a6;
  background: #ccfbf1;
  color: #0f766e;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
  outline: none;
}

.account-label-input:hover,
.account-label-input:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14);
  background: #ecfeff;
}

.account-label-input:disabled {
  opacity: 0.65;
  cursor: progress;
}

.remaining-days {
  color: var(--success);
}

.creative-hero {
  min-height: 150px;
  border-radius: var(--radius);
  padding: 26px 28px;
  background: linear-gradient(135deg, #dff8ff, #f7fbff 55%, #ffffff);
  border: 1px solid #e3eef8;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  box-shadow: var(--shadow);
}

.creative-hero p,
.creative-hero h2,
.creative-hero span {
  margin: 0;
}

.creative-hero p {
  color: #0f9f94;
  font-size: 13px;
  font-weight: 800;
}

.creative-hero h2 {
  margin-top: 8px;
  font-size: 34px;
  letter-spacing: 0;
}

.creative-hero span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

.creative-hero-v2 {
  min-height: 150px;
}

.creative-hero-copy {
  display: grid;
  gap: 8px;
  max-width: 760px;
}

.creative-hero-copy span {
  line-height: 1.7;
}

.creative-filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.creative-filter-set {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.creative-content-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.creative-groups {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow);
}

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

.creative-groups-toggle {
  border: 0;
  background: transparent;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.creative-groups-toggle strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
}

.creative-groups-toggle small {
  display: block;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.creative-groups-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.creative-groups-body[hidden] {
  display: none;
}

.creative-business-list {
  display: grid;
  gap: 8px;
}

.creative-business-group {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  overflow: hidden;
}

.creative-business-group.is-open {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.creative-business-group.is-active {
  border-color: #0f9f94;
}

.creative-group-head {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  display: grid;
  grid-template-columns: 24px minmax(180px, 1fr) minmax(120px, 180px) minmax(160px, 220px);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
}

.creative-group-head:hover {
  background: #f8fbff;
}

.creative-group-chevron {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #e8f3ff;
  color: var(--brand);
  display: grid;
  place-items: center;
  font-weight: 900;
  line-height: 1;
}

.creative-group-name,
.creative-group-stats,
.creative-account-button {
  display: grid;
  gap: 3px;
}

.creative-group-name small,
.creative-group-source,
.creative-group-stats small,
.creative-account-button small {
  color: var(--muted);
  font-size: 11px;
}

.creative-group-source {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creative-group-stats {
  justify-items: end;
  text-align: right;
}

.creative-group-stats strong {
  color: var(--brand);
  font-size: 14px;
}

.creative-account-list {
  display: grid;
  gap: 6px;
  padding: 0 14px 14px 50px;
}

.creative-account-list[hidden] {
  display: none;
}

.creative-account-button {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--ink);
  display: grid;
  grid-template-columns: minmax(180px, 1fr) max-content;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
}

.creative-account-button:hover {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.creative-account-button.is-active {
  border-color: #0f9f94;
  background: #e7fbf8;
}

.creative-account-button small {
  text-align: right;
}

@media (max-width: 760px) {
  .creative-group-head {
    grid-template-columns: 24px 1fr;
  }

  .creative-account-button {
    grid-template-columns: 1fr;
  }

  .creative-group-source,
  .creative-group-stats {
    grid-column: 2;
    justify-items: start;
    text-align: left;
  }

  .creative-account-button small {
    text-align: left;
  }

  .creative-account-list {
    padding-left: 14px;
  }
}

.upload-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.drop-zone {
  min-height: 112px;
  border: 1px dashed #c8d4e3;
  border-radius: var(--radius);
  background: #f8fbff;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  padding: 22px;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.drop-zone strong {
  display: block;
  color: var(--ink);
  margin-bottom: 5px;
}

.drop-zone span {
  display: block;
  font-size: 13px;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--brand);
  background: #eef5ff;
  transform: translateY(-1px);
}

.upload-preview {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.upload-preview:empty {
  display: none;
}

.upload-preview-item {
  display: grid;
  grid-template-columns: 70px 1fr;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.upload-preview-item img,
.upload-preview-item video {
  width: 70px;
  height: 54px;
  object-fit: cover;
  border-radius: 7px;
  background: #e5e7eb;
}

.upload-preview-item strong,
.upload-preview-item p {
  margin: 0;
}

.upload-preview-item p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.view-toggle {
  display: flex;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}

.icon-mini {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.icon-mini.is-active {
  background: #dff7f5;
  color: #0f9f94;
}

.creative-list {
  display: grid;
  gap: 10px;
}

.creative-list.is-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.creative-item {
  min-height: 76px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid #e4ebf3;
  border-radius: var(--radius);
  padding: 12px 14px;
}

.creative-item.is-upload-highlight {
  border-color: var(--brand);
  background: #e8f2ff;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.16);
}

.creative-thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  background: #dbeafe;
  display: grid;
  place-items: center;
  color: var(--brand);
  font-weight: 900;
}

.creative-thumb img,
.creative-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.creative-thumb-link {
  display: block;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.creative-thumb-link img {
  display: block;
}

.creative-main {
  min-width: 0;
}

.creative-main strong,
.creative-main p {
  margin: 0;
}

.creative-main strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creative-main p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.creative-title-link {
  color: inherit;
  text-decoration: none;
}

.creative-title-link:hover {
  color: var(--brand);
  text-decoration: underline;
}

.creative-list.is-grid .creative-item {
  min-height: 236px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.creative-list.is-grid .creative-thumb {
  width: 100%;
  height: 132px;
}

.creative-list.is-grid .creative-main strong {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.creative-list.is-grid .tag {
  align-self: flex-start;
  margin-top: auto;
}

.creative-results-panel.is-loading {
  opacity: 0.72;
  transition: opacity 120ms ease;
}

/* Creative library Apple-style layout refresh */
.creative-hero.creative-hero-v2 {
  min-height: 166px;
  border-radius: 20px;
  padding: 32px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.06), 0 2px 8px rgba(15, 23, 42, 0.03);
  align-items: flex-start;
}

.creative-hero-copy {
  gap: 7px;
  max-width: 820px;
}

.creative-hero p {
  color: #0f9f94;
  font-size: 13px;
  font-weight: 900;
}

.creative-hero h2 {
  margin-top: 6px;
  color: #111827;
  font-size: 30px;
  font-weight: 900;
  line-height: 1.12;
}

.creative-hero span {
  margin-top: 8px;
  color: #7a8496;
  font-size: 15px;
  line-height: 1.55;
}

.creative-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}

.creative-hero-actions .button {
  min-height: 36px;
  border-radius: 999px;
  padding: 0 17px;
  box-shadow: none;
}

.creative-hero-actions .button-secondary {
  border: 0;
  background: #e8e8ed;
  color: #1d1d1f;
}

.creative-hero-actions .button-secondary:hover {
  background: #d8d8df;
}

.creative-search-row {
  display: block;
}

.creative-search-row .asset-search-input {
  width: 100%;
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  padding: 0 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

.creative-search-row .asset-search-input:focus {
  border-color: rgba(24, 119, 242, 0.5);
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.1);
}

.creative-filter-row {
  display: flex;
  align-items: center;
  gap: 14px 22px;
  flex-wrap: wrap;
  padding: 4px 8px;
}

.creative-filter-group {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
}

.creative-filter-label {
  color: #7a8496;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.creative-segmented-control {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-wrap: nowrap;
  border-radius: 13px;
  background: #e8e8ed;
  padding: 4px;
}

.creative-segment-button {
  min-height: 28px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #111827;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: background 140ms ease, box-shadow 140ms ease, color 140ms ease;
}

.creative-segment-button:hover {
  background: rgba(255, 255, 255, 0.55);
}

.creative-segment-button.is-active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.16), 0 1px 2px rgba(15, 23, 42, 0.08);
}

.creative-master-section,
.creative-fold-panel {
  display: grid;
  gap: 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 6px 0 0;
  box-shadow: none;
}

.creative-section-head,
.creative-master-head,
.creative-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 8px 8px;
}

.creative-master-head {
  position: relative;
}

.creative-master-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.creative-master-toggle,
.creative-section-toggle {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: #111827;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px;
  text-align: left;
  cursor: pointer;
}

.creative-section-head .creative-section-toggle,
.creative-master-head .creative-section-toggle,
.creative-results-head .creative-section-toggle {
  flex: 1 1 auto;
}

.creative-section-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.creative-master-toggle:hover,
.creative-section-toggle:hover {
  background: rgba(15, 23, 42, 0.04);
}

.creative-master-title,
.creative-section-toggle strong {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #111827;
  font-size: 21px;
  font-weight: 900;
  line-height: 1.15;
}

.creative-master-subtitle,
.creative-section-toggle small {
  color: #7a8496;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.creative-section-side {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.creative-master-head .creative-section-side {
  margin-right: 102px;
}

.creative-selected-crumb {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #2563eb;
  display: inline;
  font: inherit;
  font-weight: 900;
  padding: 1px 4px;
  cursor: pointer;
}

.creative-selected-crumb:hover {
  background: rgba(37, 99, 235, 0.1);
}

.creative-selected-separator {
  margin: 0 5px;
  color: #94a3b8;
}

.creative-master-actions {
  position: absolute;
  top: 50%;
  right: 36px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.master-chevron,
.card-chevron {
  display: inline-block;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 180ms ease, margin 180ms ease;
}

.master-chevron {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  margin: 0 2px 0 0;
  color: #111827;
}

.creative-master-toggle.is-collapsed .master-chevron,
.creative-section-toggle.is-collapsed .master-chevron {
  transform: rotate(-45deg);
  margin: 0 2px 0 0;
}

.creative-groups-body[hidden],
.creative-section-body[hidden],
.creative-account-wrapper[hidden] {
  display: none;
}

.creative-business-list {
  display: grid;
  gap: 12px;
}

.creative-business-group.bm-card {
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04), 0 1px 4px rgba(15, 23, 42, 0.03);
}

.creative-business-group.bm-card.is-open {
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06), 0 1px 5px rgba(15, 23, 42, 0.04);
}

.creative-business-group.bm-card.is-active {
  border-color: rgba(24, 119, 242, 0.32);
}

.creative-group-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto 24px;
  gap: 20px;
  align-items: center;
  padding: 16px 20px;
}

.creative-group-head:hover {
  background: rgba(15, 23, 42, 0.035);
}

.creative-group-name {
  display: grid;
  gap: 3px;
}

.creative-group-name strong {
  color: #111827;
  font-size: 16px;
  line-height: 1.15;
}

.creative-group-name small,
.creative-group-stats,
.creative-account-button small {
  color: #64748b;
  font-size: 13px;
  line-height: 1.18;
}

.creative-group-stats {
  min-width: 120px;
  justify-items: end;
  text-align: right;
  font-weight: 700;
}

.creative-group-total {
  min-width: 60px;
  color: #64748b;
  font-size: 18px;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.card-chevron {
  width: 10px;
  height: 10px;
  color: #b9c0cc;
  transform: rotate(-45deg);
}

.creative-business-group.bm-card.is-open .card-chevron {
  transform: rotate(45deg);
}

.creative-account-wrapper {
  padding: 0 20px 16px;
}

.creative-account-list {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: #fbfbfd;
  padding: 0;
}

.creative-account-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 14px;
  border: 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: 0;
  background: transparent;
  padding: 12px 16px;
  text-align: left;
}

.creative-account-button:last-child {
  border-bottom: 0;
}

.creative-account-button:hover {
  background: rgba(15, 23, 42, 0.025);
}

.creative-account-button.is-active {
  background: #eaf2ff;
}

.creative-account-identity {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.creative-account-name {
  color: #111827;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creative-account-id {
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creative-account-counts {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.creative-account-button.is-active .creative-account-name {
  color: var(--brand);
  font-weight: 900;
}

.creative-account-button.is-active .creative-account-id {
  color: #3b82f6;
}

.creative-account-folder-block {
  display: grid;
  gap: 0;
}

.creative-account-folder-block + .creative-account-folder-block {
  border-top: 1px solid rgba(15, 23, 42, 0.05);
}

.creative-account-folder-block > .creative-account-button {
  border-bottom: 0;
}

.creative-folder-tree {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: #ffffff;
}

.creative-account-list .creative-folder-tree {
  margin: 0 12px 12px;
  background: #f8fafc;
}

.creative-folder-node {
  display: grid;
  gap: 6px;
}

.creative-folder-node-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  padding: 9px 10px 9px calc(10px + (var(--folder-depth, 0) * 18px));
  color: inherit;
  text-align: left;
}

.creative-folder-node-button:hover {
  background: rgba(15, 23, 42, 0.035);
}

.creative-folder-node.is-active > .creative-folder-node-button {
  border-color: rgba(24, 119, 242, 0.28);
  background: #eaf2ff;
}

.creative-folder-node-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.creative-folder-node-main strong {
  color: #111827;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creative-folder-node-main small {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creative-folder-node-counts {
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  text-align: right;
  white-space: nowrap;
}

.creative-folder-children {
  display: grid;
  gap: 6px;
}

.creative-section-body {
  min-width: 0;
}

.creative-fold-panel.upload-panel,
.creative-results-panel.creative-fold-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 6px 0 0;
  box-shadow: none;
}

.creative-fold-panel .drop-zone,
.creative-results-panel .creative-list,
.creative-results-panel .empty-state {
  margin: 0 4px;
}

.creative-upload-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 4px 10px;
}

.creative-upload-toolbar .button,
.creative-upload-actions .button {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 14px;
  box-shadow: none;
}

.creative-upload-queue,
.creative-local-folders {
  display: grid;
  gap: 12px;
  margin: 12px 4px 0;
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  background: #ffffff;
}

.creative-upload-queue-head,
.creative-local-folders-head,
.creative-local-folder-head,
.creative-local-folder-asset {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.creative-upload-queue-head > div:first-child,
.creative-local-folders-head,
.creative-local-folder-head > span:first-child,
.creative-local-folder-asset > span:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.creative-upload-queue-head strong,
.creative-local-folders-head strong,
.creative-local-folder strong,
.creative-local-folder-asset strong {
  color: #111827;
  font-weight: 900;
}

.creative-upload-queue-head span,
.creative-local-folders-head span,
.creative-local-folder small,
.creative-local-folder-asset small,
.upload-preview-copy p {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.creative-upload-actions,
.creative-local-folder-actions,
.creative-item-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.creative-upload-field {
  display: grid;
  gap: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.creative-upload-field input {
  min-height: 34px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  padding: 0 10px;
  color: #111827;
  font: inherit;
  outline: none;
}

.creative-upload-field input:focus {
  border-color: rgba(24, 119, 242, 0.5);
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.1);
}

.creative-upload-list,
.creative-local-folder-list {
  display: grid;
  gap: 8px;
}

.upload-preview-item {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: #fbfbfd;
}

.upload-preview-item img,
.upload-preview-item video {
  width: 88px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  background: #111827;
}

.upload-preview-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.creative-local-folder {
  display: grid;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.creative-local-folder.is-active {
  border-radius: 14px;
  padding: 10px;
  border: 1px solid rgba(24, 119, 242, 0.22);
  background: rgba(24, 119, 242, 0.06);
}

.creative-local-folder-head {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.creative-local-folder-meta {
  margin-left: auto;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.creative-local-folder-assets {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.86);
}

.creative-local-folder-asset {
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 10px;
}

.creative-local-folder-asset:hover {
  background: #ffffff;
}

.creative-local-folder:first-child {
  border-top: 0;
  padding-top: 0;
}

.creative-local-folder:last-child {
  padding-bottom: 0;
}

.creative-item-actions {
  margin-top: 6px;
}

.creative-results-panel {
  min-width: 0;
}

.creative-list.is-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
}

.creative-results-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 0 8px 8px;
}

.creative-load-more-row {
  margin: 12px 4px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.creative-load-more-row .button {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 16px;
}

.creative-thumb {
  position: relative;
}

.creative-thumb.is-preview-failed {
  background: #eef2f7;
  color: #475467;
}

.creative-preview-fallback {
  width: 100%;
  height: 100%;
  min-height: 52px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 8px;
  text-align: center;
}

.creative-preview-fallback[hidden] {
  display: none;
}

.creative-preview-fallback strong {
  color: #344054;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}

.creative-preview-fallback small {
  color: #667085;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
}

.creative-preview-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.creative-preview-actions .table-link {
  font-size: 10px;
}

.creative-results-panel .view-toggle {
  flex: 0 0 auto;
}

@media (max-width: 760px) {
  .creative-item {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .creative-item > .tag {
    grid-column: 2;
    justify-self: start;
  }

  .creative-hero.creative-hero-v2,
  .creative-section-head,
  .creative-master-head,
  .creative-results-head,
  .creative-group-head,
  .creative-account-button {
    grid-template-columns: 1fr;
  }

  .creative-hero.creative-hero-v2,
  .creative-hero-actions,
  .creative-section-head,
  .creative-master-head,
  .creative-results-head {
    align-items: stretch;
  }

  .creative-section-head,
  .creative-master-head,
  .creative-results-head {
    flex-direction: column;
  }

  .creative-section-toggle {
    align-items: flex-start;
  }

  .creative-master-head .creative-section-side {
    margin-right: 0;
  }

  .creative-master-actions {
    position: static;
    transform: none;
    align-self: flex-start;
    padding-left: 8px;
  }

  .creative-hero.creative-hero-v2 {
    padding: 24px;
    flex-direction: column;
  }

  .creative-hero-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .creative-hero-copy {
    max-width: none;
  }

  .creative-hero-actions .button {
    width: auto;
    min-width: 0;
    flex: 0 0 auto;
  }

  .creative-filter-row,
  .creative-filter-group {
    align-items: flex-start;
  }

  .creative-filter-group {
    display: grid;
    width: 100%;
  }

  .creative-segmented-control {
    overflow-x: auto;
  }

  .creative-master-actions,
  .creative-group-stats,
  .creative-group-total,
  .creative-account-button small {
    justify-items: start;
    text-align: left;
  }

  .creative-group-head {
    gap: 8px;
  }

  .creative-account-wrapper {
    padding: 0 14px 14px;
  }
}

/* Light admin shell refresh */
:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #f5f8fc;
  --surface-3: #edf3f9;
  --ink: #12203a;
  --muted: #7d8aa3;
  --line: #e2e9f2;
  --line-strong: #ced9e7;
  --brand: #1877f2;
  --brand-dark: #0f67d8;
  --teal: #0f9f94;
  --shadow: 0 20px 45px rgba(33, 48, 76, 0.08);
}

body {
  background: var(--bg);
}

.app-shell {
  grid-template-columns: 204px minmax(0, 1fr) 360px;
}

.sidebar {
  background: #ffffff;
  color: var(--ink);
  border-right: 1px solid var(--line);
  padding: 16px 10px;
}

.brand {
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 0 8px 14px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  background: linear-gradient(145deg, #4f8cff, #2563eb);
}

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

.nav-list {
  gap: 2px;
}

.nav-item {
  min-height: 36px;
  color: #8b9ab4;
  border-radius: 8px;
  font-weight: 700;
}

.nav-item:hover,
.nav-item.is-active {
  background: #dff4f2;
  color: var(--teal);
}

.nav-group.is-active .nav-group-title {
  background: #dff4f2;
  color: var(--teal);
}

.nav-subitem {
  color: #8b9ab4;
}

.nav-subitem:hover,
.nav-subitem.is-active {
  color: var(--teal);
}

.nav-icon {
  width: 22px;
  height: 22px;
  background: transparent;
  color: inherit;
  font-size: 12px;
}

.sidebar-card {
  background: #f7f9fc;
  border-color: var(--line);
  color: var(--ink);
}

.sidebar-card p {
  color: var(--muted);
}

.button {
  border-radius: 6px;
}

.button-primary {
  background: var(--brand);
}

.button-primary:hover {
  background: var(--brand-dark);
}

.button-secondary {
  background: #fff;
  border-color: var(--line);
}

.button-soft {
  color: #285dca;
  background: #e8f0ff;
  border-color: #c9d8ff;
}

.workspace {
  padding: 20px 28px 40px;
}

.topbar {
  min-height: 44px;
  margin-bottom: 10px;
}

.topbar h1 {
  font-size: 30px;
}

body[data-view="connections"] .topbar,
body[data-view="adAccounts"] .topbar,
body[data-view="assetPages"] .topbar,
body[data-view="businessManagers"] .topbar,
body[data-view="products"] .topbar {
  display: none;
}

.status-strip {
  display: none;
}

.view {
  gap: 14px;
}

.panel,
.table-panel,
.form-panel,
.metric-card {
  box-shadow: none;
  border-color: var(--line);
}

.task-pool {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #fff;
  border-left: 1px solid var(--line);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-pool-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #9aa7bd;
  font-size: 13px;
  letter-spacing: 0.12em;
}

.task-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.task-tabs button {
  border: 0;
  background: transparent;
  color: #9aa7bd;
  font-size: 12px;
  font-weight: 800;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
}

.task-tabs button.is-active {
  background: #dff7f5;
  color: var(--teal);
}

.task-tabs.secondary button.is-active {
  background: #ecfffb;
}

.task-list-mini {
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 10px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 2px;
}

.task-mini {
  background: #f0f4f9;
  border: 1px solid #e3ebf4;
  border-radius: 8px;
  min-height: 92px;
  padding: 12px 14px 18px;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 5px;
  position: relative;
}

.task-mini::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--success);
  position: absolute;
  left: 10px;
  top: 17px;
}

.task-mini.warning::before {
  background: var(--warning);
}

.task-mini::after {
  content: "";
  height: 3px;
  border-radius: 99px;
  background: var(--success);
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 10px;
}

.task-mini[data-status="running"]::before,
.task-mini[data-status="running"]::after {
  background: var(--brand);
}

.task-mini[data-status="queued"]::before,
.task-mini[data-status="queued"]::after,
.task-mini[data-status="pending"]::before,
.task-mini[data-status="pending"]::after,
.task-mini[data-status="rate_limited"]::before,
.task-mini[data-status="rate_limited"]::after {
  background: var(--warning);
}

.task-mini[data-status="partial_failed"]::before,
.task-mini[data-status="partial_failed"]::after,
.task-mini[data-status="failed"]::before,
.task-mini[data-status="failed"]::after {
  background: #dc2626;
}

.task-mini[data-status="completed"]::before,
.task-mini[data-status="completed"]::after {
  background: var(--success);
}

.task-mini.warning::after {
  background: var(--warning);
  right: 240px;
}

.task-mini strong,
.task-mini span {
  margin-left: 14px;
}

.task-mini span {
  color: #9aa7bd;
  font-size: 12px;
  margin-top: 4px;
}

.task-mini-header,
.task-mini-meta {
  margin-left: 14px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  min-width: 0;
}

.task-mini-header strong,
.task-mini-header span,
.task-mini-meta span {
  margin-left: 0;
  margin-top: 0;
}

.task-mini-header strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-mini-header .task-status-chip,
.task-mini-meta span:last-child {
  flex: 0 0 auto;
}

.task-mini-meta span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-status-chip {
  border-radius: 999px;
  padding: 3px 8px;
  background: #e8f0ff;
  color: var(--brand);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.task-status-chip[data-status="queued"],
.task-status-chip[data-status="pending"],
.task-status-chip[data-status="rate_limited"] {
  background: #fff7ed;
  color: #b45309;
}

.task-status-chip[data-status="partial_failed"] {
  background: #fef3c7;
  color: #92400e;
}

.task-status-chip[data-status="failed"] {
  background: #fee2e2;
  color: #b91c1c;
}

.task-status-chip[data-status="completed"] {
  background: #dcfce7;
  color: #15803d;
}

.task-mini-summary,
.task-mini-source {
  margin-left: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  min-width: 0;
}

.task-mini-summary,
.task-mini-source {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-mini-actions {
  margin: 8px 0 0 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.task-mini-actions.is-waiting {
  align-items: flex-start;
}

.task-mini-action-note {
  flex: 1 1 100%;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.task-mini-action {
  min-height: 30px;
  max-width: 100%;
  border: 1px solid #dbe7f5;
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  line-height: 1;
  cursor: pointer;
}

.task-mini-action.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(0, 113, 227, 0.18);
}

.task-mini-action.primary:hover {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
}

.task-mini-action.danger {
  border-color: #fecaca;
  background: #fff7f7;
  color: #b91c1c;
}

.task-mini-action.danger:hover {
  border-color: #fca5a5;
  background: #fee2e2;
}

.task-mini-action:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
  box-shadow: none;
}

.task-mini-action:focus-visible {
  outline: 2px solid rgba(0, 113, 227, 0.32);
  outline-offset: 2px;
}

.task-progress-toggle {
  margin: 6px 0 0 14px;
  border: 1px solid #dbe7f5;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  min-height: 34px;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  align-items: center;
  text-align: left;
  cursor: pointer;
}

.task-progress-toggle span:first-child {
  margin: 0;
  font-size: 12px;
  font-weight: 900;
}

.task-progress-toggle small {
  grid-column: 1 / -1;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-progress-toggle .chevron {
  margin: 0;
  color: #94a3b8;
}

.task-progress-panel {
  margin: 8px 0 0 14px;
  padding: 10px;
  border: 1px solid #dbe7f5;
  border-radius: 10px;
  background: #ffffff;
  display: grid;
  gap: 8px;
}

.task-progress-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.task-progress-meta span {
  margin: 0;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 800;
}

.task-progress-empty,
.task-progress-pending,
.task-error-summary {
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  padding: 8px;
  font-size: 12px;
  line-height: 1.45;
}

.task-error-summary {
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #991b1b;
  display: grid;
  gap: 5px;
  max-height: 180px;
  overflow: auto;
  overflow-x: hidden;
}

.task-error-summary strong,
.task-error-summary p,
.task-error-summary small {
  margin: 0;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.task-error-summary p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.task-error-summary small {
  color: #b91c1c;
  font-weight: 700;
}

.level-progress-row {
  display: grid;
  gap: 6px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 9px;
}

.level-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.level-head strong,
.level-head span,
.level-progress-row p {
  margin: 0;
}

.level-head strong {
  color: var(--ink);
  font-size: 12px;
}

.level-head span,
.level-progress-row p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.progress-fill.completed {
  background: var(--success);
}

.progress-fill.warning {
  background: var(--warning);
}

.progress-fill.failed {
  background: #dc2626;
}

.task-progress-refresh {
  justify-self: start;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.task-pool-foot {
  flex: 0 0 auto;
  width: 100%;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: inherit;
  color: #9aa7bd;
  font-size: 12px;
}

.task-pool-foot a,
.task-pool-foot button {
  border: 0;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  text-decoration: none;
  font-weight: 800;
  padding: 0;
}

.facebook-connect-card {
  min-height: 102px;
  border-color: #14b8a6;
  background: linear-gradient(110deg, #e2fbff, #f6fbff 58%, #ffffff);
  box-shadow: none;
  padding: 16px 22px;
}

.facebook-card-copy h2 {
  font-size: 20px;
}

.facebook-card-copy p {
  font-size: 12px;
}

.facebook-mark {
  width: 34px;
  height: 34px;
  font-size: 18px;
}

.facebook-button {
  min-width: 218px;
  height: 36px;
}

.oauth-note {
  min-height: 48px;
  display: block;
  border-color: #5f8cff;
  color: #596982;
  font-size: 12px;
  line-height: 1.55;
}

.danger-inline {
  color: #dc2626;
}

.linked-panel {
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
}

.linked-toolbar {
  padding: 14px 14px 10px;
}

.connection-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.pull-button {
  background: var(--teal);
}

.linked-title-row {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr);
  align-items: center;
  gap: 16px;
}

.linked-title-row h2 {
  margin: 0;
  font-size: 20px;
}

.linked-table {
  min-width: 1180px;
}

.linked-table-region {
  min-height: 0;
  border-top: 1px solid var(--line);
}

.linked-table th {
  color: #66758d;
  background: #f4f8fc;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.capability-head {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.capability-info {
  width: 14px;
  height: 14px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 900;
  text-transform: none;
}

.linked-table td {
  background: #eef3f9;
  border-bottom: 1px solid #dce6f0;
  height: 52px;
}

.linked-table tr:nth-child(even) td {
  background: #e9eff6;
}

.asset-data-table.asset-linked-table {
  min-width: 1180px;
}

.asset-data-table.asset-linked-table thead th {
  background: #f4f8fc;
  color: #66758d;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.asset-data-table.asset-linked-table td {
  height: 52px;
  background: #eef3f9;
  border-bottom: 1px solid #dce6f0;
}

.asset-data-table.asset-linked-table tr:nth-child(even) td {
  background: #e9eff6;
}

.asset-data-table.asset-linked-table .asset-column-label {
  text-transform: none;
}

.asset-data-table.asset-linked-table .asset-column-header-button.is-not-sortable {
  cursor: default;
}

.asset-data-table.asset-linked-table .empty-state.compact {
  place-items: center start;
  text-align: left;
}

.asset-data-table.asset-linked-table .account-label-input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 28px;
  box-sizing: border-box;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #ccfbf1;
}

.account-person {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-person strong {
  display: block;
}

.avatar-dot {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--teal);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.check-mark {
  width: 14px;
  height: 14px;
  display: inline-grid;
  place-items: center;
  border-radius: 2px;
  background: var(--teal);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

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

.capability-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #41516a;
}

.capability-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.capability-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.table-link {
  border: 0;
  background: transparent;
  color: #41516a;
  font-size: 12px;
  font-weight: 700;
}

.table-link:hover {
  color: var(--brand);
}

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

.danger-link {
  color: var(--danger);
}

.danger-link:hover {
  color: #991b1b;
}

.ad-account-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.source-pill {
  border: 1px solid #b8d7ff;
  background: #eef6ff;
  color: #2563eb;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 800;
}

.modal-source-note {
  border: 1px solid #d7e3f3;
  background: #f7fbff;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
}

.modal-source-note .compact-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.modal-source-note .compact-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: center;
}

.modal-source-note .compact-list small {
  grid-column: 1 / -1;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.ai-monitor-workspace-tabs,
.ai-report-source-toggles {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-monitor-workspace-tabs {
  margin: 12px 0;
}

.ai-report-source-toggles {
  padding: 10px 0 2px;
}

.ai-report-source-toggles > span {
  width: 100%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.ai-report-source-toggles label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12px;
}

.ai-report-center {
  align-items: stretch;
}

.ai-report-list-panel .panel-actions,
.ai-report-inspector-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-report-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.ai-report-metric {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface);
}

.ai-report-metric span,
.ai-report-card small,
.ai-report-card-kicker {
  color: var(--muted);
  font-size: 12px;
}

.ai-report-metric strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.ai-report-card-list {
  display: grid;
  gap: 8px;
}

.ai-report-card {
  width: 100%;
  display: grid;
  gap: 6px;
  text-align: left;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  cursor: pointer;
}

.ai-report-card.is-selected,
.ai-report-card:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 18%, transparent);
}

.ai-report-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-report-card-meta b {
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 11px;
}

.ai-report-inspector {
  display: grid;
  gap: 12px;
}

.ai-report-inspector-head h3 {
  margin: 6px 0;
}

.ai-report-section {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.ai-report-section h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

.ai-report-kv {
  display: grid;
  gap: 8px;
  margin: 0;
}

.ai-report-kv div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.ai-report-kv dt {
  color: var(--muted);
}

.ai-report-kv dd {
  margin: 0;
  font-weight: 700;
}

.ai-report-mini-list,
.ai-report-timeline {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ai-report-mini-list li,
.ai-report-timeline li,
.ai-report-empty {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface);
}

.ai-report-mini-list small,
.ai-report-timeline small,
.ai-report-timeline span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 900px) {
  .ai-report-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.asset-page-head {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr);
  align-items: center;
  gap: 14px;
}

.asset-title-line {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.asset-title-line h2 {
  margin: 0;
  font-size: 20px;
}

.ad-accounts-sync-status {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.ad-accounts-sync-status.is-running {
  color: var(--brand);
  font-weight: 700;
}

.compact-button {
  min-height: 30px;
  padding: 0 12px;
  color: var(--teal);
}

.asset-search-input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef3f8;
  color: var(--ink);
  outline: none;
  padding: 0 12px;
}

.asset-search-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.12);
}

.asset-table-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: calc(100vh - 94px);
  background: #eef3f8;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.asset-table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: auto;
}

.client-list-pagination {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.client-list-pagination > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.client-list-pagination .filters {
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.client-list-pagination .filter-chip {
  min-width: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 10px;
}

.client-list-pagination .filter-chip.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.client-list-pagination .pagination-ellipsis {
  min-width: 26px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.asset-ad-table {
  min-width: 1860px;
  border-collapse: collapse;
  table-layout: fixed;
}

.asset-ad-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f3f7fb;
  color: #6e7d95;
  font-size: 11px;
  letter-spacing: 0.12em;
}

.asset-ad-table td {
  min-height: 54px;
  background: #eef3f8;
  border-bottom: 1px solid #dfe8f2;
  color: #26364f;
  vertical-align: top;
}

.asset-ad-table tr:nth-child(even) td {
  background: #e8eef7;
}

.asset-ad-table th,
.asset-ad-table td {
  padding: 12px 10px;
  font-size: 12px;
  white-space: normal;
  word-break: break-word;
}

.ads-insight-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, #e6f7fb 0%, #f7fafc 62%, #eef3f9 100%);
  box-shadow: var(--shadow);
}

.ads-insight-hero h2,
.ads-insight-hero p {
  margin: 0;
}

.ads-insight-hero h2 {
  font-size: 26px;
  color: var(--ink);
}

.ads-insight-hero p {
  margin-top: 8px;
  color: #4d5d75;
}

.ads-insight-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.ads-insight-hero-actions .button {
  white-space: nowrap;
}

.ads-insight-tabs,
.ads-insight-filters,
.ads-insight-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ads-insight-tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #596a83;
  padding: 10px 4px;
  font-weight: 800;
}

.ads-insight-tab.is-active {
  color: var(--teal);
  border-color: var(--teal);
}

.ads-insight-filters {
  align-items: end;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.ads-insight-filters label,
.ads-insight-filters > div {
  display: grid;
  gap: 7px;
  min-width: 190px;
}

.ads-insight-filters label:nth-child(2) {
  flex: 1;
  min-width: 280px;
}

.ads-insight-filters span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ads-insight-filters input,
.ads-insight-filters select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

.ads-insight-controls {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.ads-insight-controls > .field {
  min-width: 180px;
  flex: 0 1 220px;
}

.ads-insight-controls .ads-insight-search {
  min-width: min(100%, 260px);
  flex: 1 1 280px;
}

.ads-insight-scope-board {
  display: grid;
  gap: 12px;
  margin: 12px 0 16px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.92));
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.ads-insight-scope-board.is-pending {
  border-color: rgba(0, 122, 255, 0.34);
  box-shadow: 0 10px 30px rgba(0, 122, 255, 0.08);
}

.ads-insight-scope-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ads-insight-scope-board-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ads-insight-scope-board-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.ads-insight-scope-board-head strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.2;
}

.ads-insight-scope-pending-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(0, 122, 255, 0.1);
  color: #006edb;
  font-size: 11px;
  font-weight: 850;
}

.ads-insight-scope-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(360px, 1.28fr);
  gap: 12px;
  align-items: start;
}

.ads-insight-scope-board .field {
  min-width: 0;
}

.ads-insight-scope-board .ads-insight-account-scope-field {
  min-width: 0;
  width: 100%;
  flex: none;
  z-index: 31;
}

.ads-insight-bm-scope-field {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
  width: 100%;
  z-index: 32;
}

.ads-insight-bm-select-control {
  cursor: text;
}

.ads-insight-account-popover.ads-insight-bm-popover {
  width: 100%;
  min-width: min(320px, 100%);
  max-width: min(520px, calc(100vw - 32px));
  z-index: 36;
}

.ads-insight-bm-options {
  display: grid;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
  overscroll-behavior: contain;
}

.ads-insight-bm-option {
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: start;
  min-height: 66px;
  width: 100%;
  padding: 10px;
}

.ads-insight-account-popover .ai-account-option.ads-insight-bm-option {
  height: auto;
  min-height: 66px;
}

.ads-insight-bm-option .ai-account-checkbox {
  margin-top: 4px;
}

.ads-insight-bm-option .ai-account-option-copy {
  align-content: start;
  gap: 4px;
}

.ads-insight-bm-drawer-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding: 6px;
  overscroll-behavior: contain;
}

.ads-insight-scope-summary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.ads-insight-scope-board.is-pending .ads-insight-scope-summary {
  color: #006edb;
}

.ads-insight-date-field {
  position: relative;
  min-width: 260px;
  flex: 0 0 280px;
}

.ads-insight-controls > .ads-insight-date-field {
  min-width: 260px;
  flex: 0 0 280px;
}

.ads-insight-account-scope-field {
  position: relative;
  min-width: 280px;
  flex: 1 1 320px;
  z-index: 24;
}

.ads-insight-account-scope-button {
  appearance: none;
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  grid-template-areas:
    "title caret"
    "meta caret";
  gap: 2px 10px;
  align-items: center;
  padding: 6px 11px;
  text-align: left;
}

.ads-insight-account-scope-button:hover,
.ads-insight-account-scope-button:focus-visible,
.ads-insight-account-scope-button.is-open {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.12);
  outline: none;
}

.ads-insight-account-scope-button strong,
.ads-insight-account-scope-button small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-insight-account-scope-button strong {
  grid-area: title;
  font-size: 13px;
}

.ads-insight-account-scope-button small {
  grid-area: meta;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.ads-insight-account-scope-button i {
  grid-area: caret;
  justify-self: center;
  width: 8px;
  height: 8px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  color: var(--muted);
  transform: translateY(-2px) rotate(45deg);
}

.ads-insight-account-scope-button.is-open i {
  transform: translateY(2px) rotate(225deg);
}

.ads-insight-account-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.ads-insight-account-popover {
  position: absolute;
  z-index: 48;
  top: calc(100% + 8px);
  left: 0;
  width: min(520px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.18);
  color: var(--ink);
}

.ads-insight-account-search {
  display: grid;
  gap: 5px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.ads-insight-account-search span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.ads-insight-account-search input {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
  outline: 0;
}

.ads-insight-account-search input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.1);
}

.ads-insight-scope-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ads-insight-scope-label-row > span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.ads-insight-scope-label-row > small {
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(0, 122, 255, 0.1);
  color: #006edb;
  font-size: 11px;
  font-weight: 800;
}

.ads-insight-controls > .ads-insight-account-scope-field,
.ads-insight-account-scope-field {
  min-width: 360px;
  flex: 1.7 1 520px;
  z-index: 28;
}

.ads-insight-account-select-control {
  min-height: 48px;
  border: 1px solid rgba(148, 163, 184, 0.48);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--ink);
  cursor: text;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.ads-insight-account-select-control:hover,
.ads-insight-account-select-control:focus-visible,
.ads-insight-account-select-control.is-open {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(24, 119, 242, 0.12);
  outline: 0;
}

.ads-insight-account-select-control.is-pending {
  border-color: rgba(0, 122, 255, 0.58);
  background: linear-gradient(180deg, #fff, rgba(239, 246, 255, 0.72));
}

.ads-insight-account-select-control > i {
  justify-self: center;
  width: 8px;
  height: 8px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  color: var(--muted);
  transform: translateY(-2px) rotate(45deg);
}

.ads-insight-account-select-control.is-open > i {
  transform: translateY(2px) rotate(225deg);
}

.ads-insight-account-value {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.ads-insight-account-placeholder {
  display: grid;
  gap: 1px;
  min-width: 0;
}

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

.ads-insight-account-placeholder strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.ads-insight-account-placeholder small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.ads-insight-account-clear-inline {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0;
  background: rgba(15, 23, 42, 0.07);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  line-height: 1;
}

.ads-insight-account-clear-inline:hover,
.ads-insight-account-clear-inline:focus-visible {
  outline: 0;
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
}

.ads-insight-account-scope-status {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

.ads-insight-account-scope-status.is-pending {
  color: #006edb;
}

.ads-insight-account-popover {
  width: min(680px, calc(100vw - 32px));
  border-radius: 14px;
  border-color: rgba(148, 163, 184, 0.38);
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.18);
}

.ads-insight-account-popover .ai-account-picker-options.is-virtual,
.ads-insight-account-drawer .ai-account-picker-options.is-virtual {
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  contain: content;
  padding: 6px;
}

.ads-insight-account-drawer .ai-account-picker-options.is-virtual {
  min-height: 0;
}

.ai-account-virtual-spacer {
  flex: 0 0 auto;
}

.ads-insight-account-popover .ai-account-option {
  grid-template-columns: 22px minmax(0, 1fr) auto;
  width: 100%;
  height: 104px;
  min-height: 104px;
  align-items: start;
  padding: 10px;
}

.ads-insight-account-popover .ai-account-option.is-unavailable {
  cursor: not-allowed;
  opacity: 0.66;
  background: #fff7ed;
  border-color: #fed7aa;
}

.task-error-details {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.task-error-details summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 700;
}

.task-error-details-full {
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff7f7;
  color: #991b1b;
  padding: 8px;
  max-height: 520px;
  overflow: auto;
  overscroll-behavior: contain;
}

.task-error-details-full p {
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ads-insight-account-popover .ai-account-checkbox {
  margin-top: 4px;
}

.ai-account-option.is-selected .ai-account-checkbox::after {
  content: "";
  width: 8px;
  height: 4px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-1px) rotate(-45deg);
}

.ai-account-status {
  justify-self: end;
  align-self: start;
  border-radius: 999px;
  padding: 4px 8px;
  background: #f2f4f7;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.ai-account-status.is-active {
  background: #dcfce7;
  color: #15803d;
}

.ai-account-status.is-disabled {
  background: #fee2e2;
  color: #b91c1c;
}

.ai-account-status.is-unsettled {
  background: #ffedd5;
  color: #c2410c;
}

.ai-account-status.is-warning {
  background: #fef3c7;
  color: #a16207;
}

.ai-account-status.is-neutral {
  background: #f2f4f7;
  color: var(--muted);
}

.ads-insight-account-popover .ai-account-option-copy,
.ads-insight-account-drawer .ai-account-option-copy {
  align-content: start;
  gap: 6px;
}

.ads-insight-account-popover .ai-account-option-copy strong,
.ads-insight-account-popover .ai-account-option-copy small,
.ads-insight-account-drawer .ai-account-option-copy strong,
.ads-insight-account-drawer .ai-account-option-copy small {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.ai-account-title-line {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ai-account-title-line strong {
  overflow-wrap: anywhere;
}

.ai-account-title-line small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.ai-account-source-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.ai-account-source-label {
  flex: 0 0 auto;
  min-width: 48px;
  padding-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ai-account-source-chips {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.ai-account-source-chip {
  max-width: 100%;
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(0, 113, 227, 0.08);
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.ai-account-source-chip.is-personal {
  background: rgba(14, 165, 233, 0.12);
  color: #0369a1;
}

.ai-account-source-chip.is-bm {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

.ads-insight-bm-source-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: start;
  gap: 4px 6px;
}

.ads-insight-bm-source-pairs {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 4px 6px;
  min-width: 0;
}

.ads-insight-bm-source-pair {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  min-width: 0;
}

.ads-insight-bm-source-pair .ai-account-source-chip {
  flex: 0 0 auto;
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-insight-bm-source-pair .ai-account-source-chip.is-personal {
  flex: 1 1 auto;
  min-width: 0;
  max-width: min(190px, calc(100% - 62px));
}

.ads-insight-account-drawer-portal {
  position: relative;
  z-index: 320;
}

.ads-insight-account-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(3px);
}

.ads-insight-account-drawer {
  width: min(460px, calc(100vw - 32px));
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0;
  padding: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: -24px 0 60px rgba(15, 23, 42, 0.22);
  color: var(--ink);
}

.ads-insight-account-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
}

.ads-insight-account-drawer-header div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ads-insight-account-drawer-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ads-insight-account-drawer-header strong {
  font-size: 20px;
  line-height: 1.15;
}

.ads-insight-account-drawer-header button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.07);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}

.ads-insight-account-drawer-header button:hover,
.ads-insight-account-drawer-header button:focus-visible {
  outline: 0;
  background: rgba(15, 23, 42, 0.12);
  color: var(--ink);
}

.ads-insight-account-drawer-results {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.ads-insight-account-drawer-results .ai-account-picker-actions {
  min-width: 0;
}

.ads-insight-account-drawer-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  max-height: min(520px, calc(100vh - 210px));
  overflow: auto;
  padding: 8px;
}

.ads-insight-account-drawer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 30px;
  align-items: start;
  gap: 10px;
  min-height: 0;
  border-radius: 10px;
  padding: 10px;
  background: #f7f8fb;
}

.ads-insight-account-drawer-row:hover {
  background: #f2f5f9;
}

.ai-monitor-account-drawer-row.is-unavailable {
  border: 1px solid rgba(220, 38, 38, 0.22);
  background: rgba(220, 38, 38, 0.07);
}

.ai-monitor-account-drawer-row.is-outside-scope,
.ai-monitor-bm-drawer-row.is-unavailable {
  border: 1px solid rgba(245, 158, 11, 0.24);
  background: rgba(245, 158, 11, 0.07);
}

.ai-monitor-account-drawer-row,
.ai-monitor-bm-drawer-row {
  flex: 0 0 auto;
  height: auto;
  min-height: max-content;
}

.ai-monitor-account-drawer-results .ads-insight-account-drawer-list,
.ai-monitor-bm-drawer-results .ads-insight-account-drawer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-monitor-account-drawer-row .ai-account-option-copy,
.ai-monitor-bm-drawer-row .ai-account-option-copy,
.ai-monitor-account-drawer-row .ads-control-account-title-line,
.ai-monitor-bm-drawer-row .ads-control-account-title-line {
  min-width: 0;
}

.ai-monitor-account-drawer-row .ai-account-option-copy,
.ai-monitor-bm-drawer-row .ai-account-option-copy {
  display: grid;
  gap: 7px;
}

.ai-monitor-account-drawer-row strong,
.ai-monitor-account-drawer-row small,
.ai-monitor-bm-drawer-row strong,
.ai-monitor-bm-drawer-row small {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ai-monitor-account-drawer-row .ads-control-account-status,
.ai-monitor-bm-drawer-row .ads-control-account-status {
  white-space: normal;
  text-align: right;
  overflow-wrap: anywhere;
  max-width: 128px;
}

.ai-monitor-drawer-source-row {
  align-items: flex-start;
}

.ai-monitor-drawer-note {
  color: var(--muted);
}

.ads-insight-bm-drawer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 30px;
  align-items: start;
  gap: 10px;
  min-height: 104px;
  border-radius: 10px;
  padding: 10px;
  background: #f7f8fb;
}

.ads-insight-bm-drawer-row .ai-account-option-copy {
  gap: 8px;
}

.ads-insight-bm-drawer-row:hover {
  background: #f2f5f9;
}

.ai-monitor-account-drawer,
.ai-monitor-bm-drawer {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

.ai-monitor-account-drawer-results,
.ai-monitor-bm-drawer-results {
  min-height: 0;
  overflow: hidden;
}

.ai-monitor-account-drawer-results .ads-insight-account-drawer-list,
.ai-monitor-bm-drawer-results .ads-insight-account-drawer-list {
  height: 100%;
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.ads-insight-account-drawer-row.ai-monitor-account-drawer-row,
.ads-insight-bm-drawer-row.ai-monitor-bm-drawer-row {
  height: auto;
  min-height: max-content;
}

.ads-insight-account-drawer-row.ai-monitor-account-drawer-row .ads-control-account-title-line,
.ads-insight-bm-drawer-row.ai-monitor-bm-drawer-row .ads-control-account-title-line,
.ads-insight-account-drawer-row.ai-monitor-account-drawer-row .ads-control-account-source-row,
.ads-insight-bm-drawer-row.ai-monitor-bm-drawer-row .ads-control-account-source-row {
  min-width: 0;
}

.ads-insight-account-drawer-row.ai-monitor-account-drawer-row .ads-control-account-source-chips,
.ads-insight-bm-drawer-row.ai-monitor-bm-drawer-row .ads-control-account-source-chips {
  flex-wrap: wrap;
}

.ads-insight-account-drawer-row.ai-monitor-account-drawer-row .ads-control-account-source-chip,
.ads-insight-bm-drawer-row.ai-monitor-bm-drawer-row .ads-control-account-source-chip {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ads-insight-account-drawer-remove {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  font-size: 18px;
  font-weight: 750;
  line-height: 1;
}

.ads-insight-account-drawer-remove:hover,
.ads-insight-account-drawer-remove:focus-visible {
  outline: 0;
  background: rgba(15, 23, 42, 0.08);
  color: var(--ink);
}

.ads-insight-date-field.is-open {
  z-index: 30;
}

.ads-insight-date-button {
  appearance: none;
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 0 12px;
  text-align: left;
}

.ads-insight-date-button:hover,
.ads-insight-date-button:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.12);
  outline: none;
}

.ads-insight-date-button strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.ads-insight-date-button-icon {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 4px;
  color: var(--brand);
  display: inline-block;
  position: relative;
}

.ads-insight-date-button-icon::before,
.ads-insight-date-button-icon::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
}

.ads-insight-date-button-icon::before {
  top: 3px;
  border-top: 2px solid currentColor;
}

.ads-insight-date-button-icon::after {
  top: -4px;
  height: 4px;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.ads-insight-date-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(620px, calc(100vw - 32px));
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.18);
  color: var(--ink);
  display: grid;
  gap: 12px;
  padding: 14px;
  z-index: 45;
}

.ads-insight-date-shortcuts,
.ads-insight-date-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ads-insight-date-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ads-insight-date-inputs .field {
  min-width: 0;
}

.ads-insight-calendar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 14px;
}

.ads-insight-month {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.ads-insight-month > strong {
  color: var(--ink);
  font-size: 13px;
}

.ads-insight-weekdays,
.ads-insight-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.ads-insight-weekdays {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.ads-insight-days {
  gap: 4px;
}

.ads-insight-date-empty,
.ads-insight-day {
  min-width: 0;
  height: 32px;
}

.ads-insight-day {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.ads-insight-day:hover,
.ads-insight-day:focus-visible {
  border-color: rgba(37, 99, 235, 0.38);
  background: #eef4ff;
  color: var(--brand);
  outline: none;
}

.ads-insight-day.is-in-range {
  background: #eaf8f4;
  color: #0f766e;
}

.ads-insight-day.is-selected {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.ads-insight-date-actions {
  justify-content: flex-end;
  padding-top: 2px;
}

@media (max-width: 760px) {
  .ads-insight-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .ads-insight-hero-actions {
    justify-content: stretch;
    min-width: 0;
    width: 100%;
  }

  .ads-insight-hero-actions .button {
    justify-content: center;
    min-width: 0;
    width: 100%;
    white-space: normal;
  }

  .ads-insight-controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .ads-insight-controls > .field,
  .ads-insight-controls .ads-insight-search {
    min-width: 0;
    width: 100%;
  }

  .ads-insight-date-field {
    min-width: 100%;
    flex-basis: auto;
  }

  .ads-insight-account-scope-field {
    min-width: 100%;
    flex-basis: auto;
  }

  .ads-insight-account-select-control {
    grid-template-columns: minmax(0, 1fr) auto 16px;
  }

  .ads-insight-account-drawer {
    width: min(100vw - 18px, 420px);
    padding: 14px;
  }

  .ads-insight-date-popover,
  .ads-insight-account-popover {
    width: min(100%, calc(100vw - 24px));
    max-height: calc(100vh - 180px);
    overflow: auto;
  }

  .ads-insight-date-inputs,
  .ads-insight-calendar-grid {
    grid-template-columns: 1fr;
  }

  .ads-insight-trend-kpis,
  .ads-insight-funnel span {
    grid-template-columns: 1fr;
  }

  .ads-insight-funnel-track,
  .ads-insight-funnel-last-seen {
    min-width: 0;
  }
}

.ads-insight-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ads-insight-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.ads-insight-kpi {
  min-height: 94px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 16px;
}

.ads-insight-kpi:first-child,
.ads-insight-kpi:nth-child(4),
.ads-insight-kpi:nth-child(5) {
  border-color: rgba(15, 159, 148, 0.45);
  background: #eaf8f4;
}

.ads-insight-kpi:nth-child(3) {
  border-color: rgba(37, 99, 235, 0.45);
  background: #eef4ff;
}

.ads-insight-kpi p,
.ads-insight-kpi small {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ads-insight-kpi strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 24px;
  color: var(--ink);
}

.ads-insight-trend {
  height: 190px;
  display: flex;
  align-items: end;
  gap: 10px;
  padding-top: 18px;
}

.ads-insight-trend span {
  flex: 1;
  min-width: 18px;
  display: grid;
  gap: 8px;
  align-items: end;
  justify-items: center;
}

.ads-insight-trend i {
  width: 100%;
  max-width: 34px;
  min-height: 4px;
  border-radius: 999px 999px 4px 4px;
  background: var(--teal);
}

.ads-insight-trend small {
  color: var(--muted);
  font-size: 11px;
}

.ads-insight-funnel {
  display: grid;
  gap: 12px;
}

.ads-insight-funnel span {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(160px, 2fr) 70px;
  align-items: center;
  gap: 12px;
}

.ads-insight-funnel strong,
.ads-insight-funnel em {
  font-size: 12px;
  font-style: normal;
}

.ads-insight-funnel i {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: #3b82f6;
}

.ads-insight-table-wrap {
  max-width: 100%;
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.ads-insight-table {
  min-width: 1900px;
}

.ads-insight-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f5f8fc;
}

.ads-insight-data-col {
  position: sticky;
  user-select: none;
}

.ads-insight-data-col.is-dragging {
  opacity: 0.58;
}

.ads-insight-data-col.is-drop-target {
  background: #eef6ff !important;
  box-shadow: inset 3px 0 0 var(--brand);
}

.ads-insight-column-header-button {
  appearance: none;
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) 12px;
  gap: 6px;
  align-items: center;
  padding: 0;
  text-align: left;
  font: inherit;
}

.ads-insight-column-header-button:disabled {
  cursor: default;
}

.ads-insight-column-header-button:hover .ads-insight-column-label,
.ads-insight-data-col.is-sorted .ads-insight-column-label {
  color: var(--brand);
}

.ads-insight-column-grip {
  width: 10px;
  height: 16px;
  border-radius: 4px;
  opacity: 0.42;
  cursor: grab;
  background-image: radial-gradient(circle, #94a3b8 1px, transparent 1.5px);
  background-size: 4px 4px;
}

.ads-insight-data-col.is-dragging .ads-insight-column-grip {
  cursor: grabbing;
}

.ads-insight-column-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-insight-sort-indicator {
  width: 12px;
  height: 12px;
  display: grid;
  place-items: center;
  color: #64748b;
}

.ads-insight-sort-indicator::before {
  content: "";
  display: block;
}

.ads-insight-sort-indicator[data-sort-state="none"]::before {
  width: 6px;
  height: 6px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  opacity: 0.45;
  transform: translateY(-1px) rotate(45deg);
}

.ads-insight-sort-indicator[data-sort-state="asc"]::before {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 6px solid var(--brand);
}

.ads-insight-sort-indicator[data-sort-state="desc"]::before {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid var(--brand);
}

.ads-insight-column-resize {
  position: absolute;
  top: 8px;
  right: -4px;
  bottom: 8px;
  width: 9px;
  cursor: col-resize;
  z-index: 12;
  touch-action: none;
}

.ads-insight-column-resize::after {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: 2px;
  border-radius: 999px;
  background: transparent;
  transition: background 140ms ease, box-shadow 140ms ease;
}

.ads-insight-column-resize:hover::after,
.ads-insight-column-resize.is-active::after,
.ads-insight-table.is-column-resizing .ads-insight-column-resize.is-active::after {
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

body.ads-insight-column-resizing {
  cursor: col-resize;
  user-select: none;
}

.ads-insight-table.is-column-resizing th,
.ads-insight-table.is-column-resizing td {
  transition: none;
}

.ads-insight-table td strong,
.ads-insight-table td span,
.ads-insight-table td small {
  display: block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-insight-table td small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.ads-insight-table .ads-insight-sticky-cell {
  position: sticky;
  left: 0;
  z-index: 3;
}

.ads-insight-table th.ads-insight-sticky-cell {
  z-index: 4;
  background: #f5f8fc;
}

.ads-insight-table td.ads-insight-sticky-cell {
  background: inherit;
}

.campaign-status-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 126px;
  min-width: 92px;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
}

.campaign-status-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ads-insight-table .campaign-status-toggle-track {
  width: 44px;
  height: 24px;
  flex: 0 0 44px;
  align-items: center;
  padding: 2px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.18s ease, opacity 0.18s ease;
}

.ads-insight-table .campaign-status-toggle-thumb {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.24);
  transition: transform 0.18s ease;
}

.campaign-status-toggle input:checked + .campaign-status-toggle-track {
  background: #16a34a;
}

.campaign-status-toggle input:checked + .campaign-status-toggle-track .campaign-status-toggle-thumb {
  transform: translateX(20px);
}

.ads-insight-table .campaign-status-toggle,
.ads-insight-table .campaign-status-toggle-track,
.ads-insight-table .campaign-status-toggle-thumb,
.ads-insight-table .campaign-status-toggle-text {
  display: inline-flex;
}

.ads-insight-table .campaign-status-toggle-text {
  min-width: 24px;
  max-width: 58px;
  overflow: hidden;
  color: inherit;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.campaign-status-toggle.is-active {
  color: #15803d;
}

.campaign-status-toggle.is-disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.ads-insight-page-size {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.ads-insight-metric-toolbar {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f8fbff);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 12px;
}

.ads-insight-metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ads-insight-metric-summary,
.ads-insight-selected-metrics {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ads-insight-selector-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ads-insight-metric-summary strong {
  font-size: 13px;
}

.ads-insight-metric-badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #edf6ff;
  color: var(--brand);
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 900;
}

.ads-insight-selected-pill {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #cde7e2;
  border-radius: 999px;
  background: #f0faf8;
  color: #0f766e;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 900;
}

.ads-insight-selected-pill:disabled {
  opacity: 1;
  cursor: default;
}

.ads-insight-metric-picker {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 12px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.22s ease, opacity 0.2s ease;
}

.ads-insight-metric-toolbar.is-open .ads-insight-metric-picker {
  max-height: 390px;
  opacity: 1;
}

.ads-insight-metric-side,
.ads-insight-metric-options {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.ads-insight-metric-side {
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.ads-insight-metric-search {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  outline: none;
  padding: 0 10px;
}

.ads-insight-metric-search:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.12);
}

.ads-insight-metric-groups {
  display: grid;
  gap: 6px;
}

.ads-insight-metric-group {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #50627c;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-weight: 900;
  text-align: left;
}

.ads-insight-metric-group.is-active {
  background: #eaf8f4;
  border-color: rgba(15, 159, 148, 0.28);
  color: var(--teal);
}

.ads-insight-metric-options {
  padding: 12px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ads-insight-metric-option {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f9fbfe;
  padding: 10px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
}

.ads-insight-metric-option:hover {
  border-color: rgba(24, 119, 242, 0.45);
  background: #f4f8ff;
}

.ads-insight-metric-option input {
  margin-top: 2px;
  accent-color: var(--teal);
}

.ads-insight-metric-option strong,
.ads-insight-metric-option small {
  display: block;
}

.ads-insight-metric-option strong {
  color: var(--ink);
  font-size: 12px;
}

.ads-insight-metric-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.ads-insight-table th.is-sticky,
.ads-insight-table td.is-sticky {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 260px;
  max-width: 260px;
}

.ads-insight-table th.is-sticky {
  z-index: 4;
  background: #f5f8fc;
}

.ads-insight-table td.is-sticky {
  background: inherit;
}

@media (max-width: 980px) {
  .ads-insight-metric-head {
    align-items: stretch;
    flex-direction: column;
  }

  .ads-insight-metric-picker {
    grid-template-columns: 1fr;
  }

  .ads-insight-metric-options {
    grid-template-columns: 1fr;
  }
}

.ads-insight-panel {
  display: grid;
  gap: 16px;
}

.ads-insight-controls {
  display: grid;
  grid-template-columns: minmax(190px, 0.7fr) minmax(280px, 1.4fr) minmax(260px, 1fr);
  gap: 14px;
  align-items: end;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.ads-insight-controls > .field,
.ads-insight-controls > label,
.ads-insight-controls > div {
  min-width: 0;
}

.ads-insight-controls .filters {
  align-items: center;
  gap: 8px;
}

.ads-insight-date-field {
  position: relative;
}

.ads-insight-date-button {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.ads-insight-date-button:hover,
.ads-insight-date-button:focus-visible,
.ads-insight-date-button.is-open {
  border-color: #0b7cff;
  box-shadow: 0 0 0 3px rgba(11, 124, 255, 0.16);
  outline: 0;
}

.ads-insight-date-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 2px solid #0b7cff;
  border-radius: 7px;
  background: #eef6ff;
  color: #0b7cff;
  display: grid;
  place-items: center;
}

.ads-insight-date-icon svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}

.ads-insight-date-button strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 800;
}

.ads-insight-date-popover {
  position: absolute;
  z-index: 45;
  top: calc(100% + 8px);
  left: 0;
  width: min(620px, calc(100vw - 48px));
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.16);
  padding: 16px;
  display: grid;
  gap: 14px;
}

.ads-insight-date-shortcuts,
.ads-insight-date-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ads-insight-date-actions {
  justify-content: flex-end;
}

.ads-insight-date-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ads-insight-calendar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.ads-insight-month {
  display: grid;
  gap: 10px;
}

.ads-insight-month > strong {
  text-align: left;
  font-size: 14px;
}

.ads-insight-weekdays,
.ads-insight-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(28px, 1fr));
  gap: 4px;
  text-align: center;
}

.ads-insight-weekdays span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.ads-insight-days button,
.ads-insight-date-empty {
  min-height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.ads-insight-days button:hover,
.ads-insight-days button.is-in-range {
  background: rgba(20, 184, 166, 0.12);
  color: #047a72;
}

.ads-insight-days button.is-selected {
  background: #0b7cff;
  color: #fff;
  font-weight: 800;
}

.ads-insight-kpis {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.ads-insight-kpi strong {
  color: var(--brand);
}

.ads-insight-analytics {
  grid-template-columns: minmax(0, 1fr);
}

.ads-insight-trend-card {
  overflow: hidden;
}

.ads-insight-trend-heading {
  gap: 16px;
  align-items: flex-start;
}

.ads-insight-trend-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.ads-insight-trend-kpi {
  min-height: 104px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(26, 124, 255, 0.07), rgba(255, 255, 255, 0) 44%),
    #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.ads-insight-trend-kpi span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.ads-insight-trend-kpi strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.05;
  overflow-wrap: normal;
  word-break: normal;
}

.ads-insight-trend-kpi small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ads-insight-funnel {
  display: grid;
  gap: 18px;
}

.ads-insight-funnel span {
  display: initial;
  grid-template-columns: none;
  align-items: initial;
  gap: 0;
}

.ads-insight-funnel-card .panel-title {
  flex-wrap: wrap;
}

.ads-insight-funnel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ads-insight-funnel-tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.ads-insight-funnel-tab.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.ads-insight-funnel-section {
  display: grid;
  gap: 8px;
}

.ads-insight-funnel-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
}

.ads-insight-funnel-section-header h3 {
  margin: 0;
  color: #12203a;
  font-size: 15px;
  line-height: 1.2;
}

.ads-insight-funnel-section-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ads-insight-funnel-group {
  display: grid;
  gap: 0;
}

.ads-insight-funnel-group-label {
  margin: 10px 0 2px;
  color: #8b9ab1;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ads-insight-funnel-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) minmax(58px, auto);
  gap: 14px 12px;
  align-items: center;
  min-height: 64px;
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--line);
}

.ads-insight-funnel-row:last-child {
  border-bottom: 0;
}

.ads-insight-funnel-icon {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #2fb56b;
  background: linear-gradient(145deg, #e8f8ef, #f5fbf8);
  box-shadow: inset 0 0 0 1px rgba(47, 181, 107, 0.05);
  grid-row: 1 / 3;
}

.ads-insight-funnel-icon svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
}

.ads-insight-funnel-name {
  grid-column: 2;
  min-width: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

.ads-insight-funnel-detail {
  display: grid;
  gap: 6px;
  grid-column: 2 / -1;
  grid-row: 2;
  min-width: 0;
}

.ads-insight-funnel-track {
  position: relative;
  display: block;
  height: 8px;
  border-radius: 999px;
  background: #edf2f8;
  overflow: hidden;
}

.ads-insight-funnel-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #31b66b;
  min-width: 0;
}

.ads-insight-funnel-value {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  color: #101828;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.ads-insight-funnel-value.is-muted {
  color: #7b879a;
  font-size: 13px;
  font-weight: 850;
}

.ads-insight-funnel-last-seen {
  color: #7b879a;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
}

.ads-insight-funnel-last-seen.is-empty {
  color: #98a2b3;
}

.ads-insight-funnel-count {
  max-width: 100%;
  padding: 7px 14px;
  background: #eaf1fb;
  color: #3474d7;
  font-size: 13px;
  line-height: 1.25;
}

.ads-insight-funnel-empty {
  padding: 12px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.ads-insight-funnel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ads-insight-funnel-footer span {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ads-insight-funnel-more {
  white-space: nowrap;
}

@media (max-width: 980px) {
  .ads-insight-scope-grid {
    grid-template-columns: 1fr;
  }

  .ads-insight-controls,
  .ads-insight-kpis,
  .ads-insight-trend-kpis,
  .ads-insight-calendar-grid,
  .ads-insight-date-inputs {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .ads-insight-scope-board {
    gap: 10px;
    padding: 12px;
  }

  .ads-insight-scope-board-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .ads-insight-date-popover {
    width: calc(100vw - 36px);
  }

  .ads-insight-funnel-row {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px 12px;
    min-height: 96px;
  }

  .ads-insight-funnel-icon {
    width: 34px;
    height: 34px;
    grid-row: 1 / 4;
  }

  .ads-insight-funnel-name {
    grid-column: 2;
    grid-row: 1;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .ads-insight-funnel-detail {
    grid-column: 2;
    grid-row: 2;
  }

  .ads-insight-funnel-track {
    grid-column: 2;
  }

  .ads-insight-funnel-value {
    grid-column: 2;
    grid-row: 3;
    justify-self: start;
    font-size: 18px;
  }

  .ads-insight-funnel-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

.asset-ad-table th:nth-child(1),
.asset-ad-table td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 3;
}

.asset-linked-table th:nth-child(1),
.asset-linked-table td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 3;
}

.asset-ad-table .tag {
  white-space: nowrap;
}

.asset-ad-table td:nth-child(1),
.asset-linked-table td:nth-child(1) {
  background: inherit;
}

.asset-ad-table th:nth-child(1),
.asset-linked-table th:nth-child(1) {
  background: #f3f7fb;
}

.asset-pages-panel {
  background: #eef3f8;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.asset-pages-table {
  min-width: 1380px;
  border-collapse: collapse;
  table-layout: fixed;
}

.asset-pages-table thead th {
  background: #f3f7fb;
  color: #6e7d95;
  font-size: 11px;
  letter-spacing: 0.12em;
}

.asset-pages-table th,
.asset-pages-table td {
  padding: 15px 16px;
  font-size: 12px;
  white-space: normal;
  word-break: break-word;
}

.asset-pages-table td {
  height: 64px;
  background: #eef3f8;
  border-bottom: 1px solid #dfe8f2;
  color: #26364f;
}

.asset-pages-table tr:nth-child(even) td {
  background: #e8eef7;
}

.asset-pages-table tr:last-child td {
  border-bottom: 0;
}

.asset-pages-table th:nth-child(1),
.asset-pages-table td:nth-child(1) {
  width: 170px;
}

.asset-pages-table th:nth-child(2),
.asset-pages-table td:nth-child(2) {
  width: 200px;
}

.asset-pages-table th:nth-child(3),
.asset-pages-table td:nth-child(3) {
  width: 180px;
}

.asset-pages-table th:nth-child(4),
.asset-pages-table td:nth-child(4),
.asset-pages-table th:nth-child(5),
.asset-pages-table td:nth-child(5),
.asset-pages-table th:nth-child(6),
.asset-pages-table td:nth-child(6) {
  width: 150px;
  white-space: nowrap;
  word-break: normal;
}

.asset-pages-table th:nth-child(7),
.asset-pages-table td:nth-child(7),
.asset-pages-table th:nth-child(8),
.asset-pages-table td:nth-child(8) {
  width: 230px;
}

.asset-business-table {
  min-width: 1720px;
  border-collapse: collapse;
  table-layout: fixed;
}

.asset-business-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f3f7fb;
  color: #6e7d95;
  font-size: 11px;
  letter-spacing: 0.12em;
}

.asset-business-table th,
.asset-business-table td {
  padding: 14px 16px;
  font-size: 12px;
  white-space: normal;
  word-break: break-word;
  vertical-align: top;
}

.asset-business-table td {
  min-height: 64px;
  background: #eef3f8;
  border-bottom: 1px solid #dfe8f2;
  color: #26364f;
}

.asset-business-table tr:nth-child(even) td {
  background: #e8eef7;
}

.asset-business-table th:nth-child(1),
.asset-business-table td:nth-child(1) {
  width: 150px;
  position: sticky;
  left: 0;
  z-index: 3;
}

.asset-business-table th:nth-child(1) {
  background: #f3f7fb;
}

.asset-business-table td:nth-child(1) {
  background: inherit;
}

.asset-business-table th:nth-child(2),
.asset-business-table td:nth-child(2) {
  width: 200px;
}

.asset-business-table th:nth-child(3),
.asset-business-table td:nth-child(3) {
  width: 180px;
}

.asset-business-table th:nth-child(4),
.asset-business-table td:nth-child(4) {
  width: 320px;
}

.asset-business-table th:nth-child(5),
.asset-business-table td:nth-child(5) {
  width: 170px;
}

.asset-business-table th:nth-child(6),
.asset-business-table td:nth-child(6),
.asset-business-table th:nth-child(7),
.asset-business-table td:nth-child(7),
.asset-business-table th:nth-child(8),
.asset-business-table td:nth-child(8) {
  width: 240px;
}

.business-name-cell {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.business-name-cell strong {
  color: #18243b;
  line-height: 1.25;
}

.asset-data-table {
  width: 100%;
  table-layout: fixed;
}

.asset-data-table.asset-ad-table th,
.asset-data-table.asset-ad-table td,
.asset-data-table.asset-linked-table th,
.asset-data-table.asset-linked-table td,
.asset-data-table.asset-pages-table th,
.asset-data-table.asset-pages-table td,
.asset-data-table.asset-business-table th,
.asset-data-table.asset-business-table td {
  width: auto;
  white-space: normal;
  word-break: break-word;
}

.asset-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
}

.asset-data-table th {
  position: relative;
  user-select: none;
}

.asset-data-table.asset-ad-table thead th:nth-child(1),
.asset-data-table.asset-linked-table thead th:nth-child(1),
.asset-data-table.asset-business-table thead th:nth-child(1) {
  z-index: 7;
}

.asset-data-col.is-dragging {
  opacity: 0.58;
}

.asset-data-col.is-drop-target {
  background: #eef6ff !important;
  box-shadow: inset 3px 0 0 var(--brand);
}

.asset-column-header-button {
  appearance: none;
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) 12px;
  gap: 6px;
  align-items: center;
  padding: 0;
  text-align: left;
  font: inherit;
}

.asset-column-header-button:hover .asset-column-label,
.asset-data-col.is-sorted .asset-column-label {
  color: var(--brand);
}

.asset-column-grip {
  width: 10px;
  height: 16px;
  border-radius: 4px;
  opacity: 0.42;
  cursor: grab;
  background-image: radial-gradient(circle, #94a3b8 1px, transparent 1.5px);
  background-size: 4px 4px;
}

.asset-data-col.is-dragging .asset-column-grip {
  cursor: grabbing;
}

.asset-column-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-sort-indicator {
  width: 12px;
  height: 12px;
  display: grid;
  place-items: center;
  color: #64748b;
}

.asset-sort-indicator::before {
  content: "";
  display: block;
}

.asset-sort-indicator[data-sort-state="none"]::before {
  width: 6px;
  height: 6px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  opacity: 0.45;
  transform: translateY(-1px) rotate(45deg);
}

.asset-sort-indicator[data-sort-state="asc"]::before {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 6px solid var(--brand);
}

.asset-sort-indicator[data-sort-state="desc"]::before {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid var(--brand);
}

.asset-column-resize {
  position: absolute;
  top: 8px;
  right: -4px;
  bottom: 8px;
  width: 9px;
  cursor: col-resize;
  z-index: 12;
  touch-action: none;
}

.asset-column-resize::after {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: 2px;
  border-radius: 999px;
  background: transparent;
  transition: background 140ms ease, box-shadow 140ms ease;
}

.asset-column-resize:hover::after,
.asset-column-resize.is-active::after,
.asset-data-table.is-column-resizing .asset-column-resize.is-active::after {
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

body.asset-column-resizing {
  cursor: col-resize;
  user-select: none;
}

.asset-data-table.is-column-resizing th,
.asset-data-table.is-column-resizing td {
  transition: none;
}

.business-name-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.business-source-accesses {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

.business-source-pair {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  min-width: 0;
}

.business-source-chip {
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 5px 9px;
}

.business-source-chip.is-personal {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.business-source-chip.is-partner {
  border-color: #bfdbfe;
  background: #dbeafe;
  color: #1d4ed8;
}

.business-source-chip.is-overflow {
  border-color: #d1d5db;
  background: #f3f4f6;
  color: #4b5563;
}

.asset-detail-count {
  display: block;
  color: #18243b;
  font-weight: 900;
  margin-bottom: 4px;
}

.asset-detail-list {
  display: grid;
  gap: 8px;
}

.asset-detail-list summary {
  cursor: pointer;
  color: #18243b;
  font-weight: 900;
  list-style-position: outside;
}

.asset-detail-list div {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.asset-detail-list span,
.asset-detail-list strong,
.asset-detail-list small,
.asset-detail-list em {
  display: block;
}

.asset-detail-list strong {
  color: #18243b;
  line-height: 1.25;
}

.asset-detail-list small {
  color: #93a0b7;
  margin-top: 2px;
}

.asset-detail-list em {
  color: var(--teal);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  margin-top: 3px;
}

.ad-account-asset-detail summary {
  white-space: nowrap;
}

.ad-account-asset-detail div {
  max-width: 220px;
}

.ad-account-asset-preview {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.ad-account-asset-preview-items {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.ad-account-asset-open {
  width: max-content;
  max-width: 100%;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ad-account-asset-open strong,
.ad-account-asset-open small,
.ad-account-asset-note strong,
.ad-account-asset-note small {
  display: block;
}

.ad-account-asset-open strong {
  color: #18243b;
  font-weight: 900;
  line-height: 1.2;
}

.ad-account-asset-open small {
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  margin-top: 2px;
}

.ad-account-asset-open:hover strong,
.ad-account-asset-open:focus-visible strong {
  color: var(--brand);
}

.ad-account-asset-open:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.ad-account-asset-count-button {
  color: #18243b;
}

.ad-account-asset-more-button strong {
  color: #1d4ed8;
}

.ad-account-asset-note strong {
  color: #18243b;
  font-size: 12px;
  line-height: 1.25;
}

.ad-account-asset-note small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.ad-account-asset-drawer-portal {
  position: relative;
  z-index: 340;
}

.ad-account-asset-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 340;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(3px);
}

.ad-account-asset-drawer {
  width: min(560px, calc(100vw - 28px));
  height: 100%;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  gap: 12px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: -24px 0 60px rgba(15, 23, 42, 0.22);
  color: var(--ink);
}

.ad-account-asset-drawer-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.ad-account-asset-drawer-header div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ad-account-asset-drawer-header span,
.ad-account-asset-drawer-header small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ad-account-asset-drawer-header strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.ad-account-asset-drawer-header button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.07);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}

.ad-account-asset-drawer-header button:hover,
.ad-account-asset-drawer-header button:focus-visible {
  outline: 0;
  background: rgba(15, 23, 42, 0.12);
  color: var(--ink);
}

.ad-account-asset-drawer-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ad-account-asset-drawer-meta span {
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px;
  background: #f8fafc;
}

.ad-account-asset-drawer-meta strong,
.ad-account-asset-drawer-meta small {
  display: block;
}

.ad-account-asset-drawer-meta strong {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.ad-account-asset-drawer-meta small {
  margin-top: 3px;
  color: #1e293b;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-account-asset-drawer-meta p {
  grid-column: 1 / -1;
  margin: 0;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.4;
}

.ad-account-asset-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.ad-account-asset-tabs button {
  min-width: 0;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  padding: 9px 10px;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  text-align: left;
}

.ad-account-asset-tabs button strong {
  display: block;
  margin-top: 2px;
  color: #0f172a;
  font-size: 14px;
}

.ad-account-asset-tabs button.is-active {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(37, 99, 235, 0.09);
  color: #1d4ed8;
}

.ad-account-asset-search {
  display: grid;
  gap: 5px;
}

.ad-account-asset-search span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.ad-account-asset-search input {
  width: 100%;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.ad-account-asset-drawer-body {
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.ad-account-asset-diagnostic {
  margin-bottom: 10px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 8px;
  padding: 10px 11px;
  background: rgba(245, 158, 11, 0.09);
  color: #92400e;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.ad-account-asset-diagnostic.is-muted {
  border-color: #dbe3ef;
  background: #f8fafc;
  color: #475569;
}

.ad-account-asset-section {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.ad-account-asset-section header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ad-account-asset-section h3 {
  margin: 0;
  color: #172033;
  font-size: 13px;
  line-height: 1.25;
}

.ad-account-asset-section header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.ad-account-asset-full-list {
  display: grid;
  gap: 8px;
}

.ad-account-asset-full-list p {
  margin: 0;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
}

.ad-account-asset-full-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.ad-account-asset-full-item div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ad-account-asset-full-item strong {
  color: #172033;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ad-account-asset-full-item small {
  color: #64748b;
  font-size: 11px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ad-account-asset-tags {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 190px;
}

.ad-account-asset-tags em {
  border-radius: 999px;
  padding: 3px 7px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.2;
}

@media (max-width: 640px) {
  .ad-account-asset-drawer {
    width: 100vw;
    padding: 14px;
  }

  .ad-account-asset-drawer-meta {
    grid-template-columns: 1fr;
  }

  .ad-account-asset-full-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .ad-account-asset-tags {
    justify-content: flex-start;
    max-width: 100%;
  }
}

.business-users-detail small {
  overflow-wrap: anywhere;
}

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

.business-cell strong {
  color: #18243b;
  line-height: 1.25;
}

.business-cell small {
  color: #93a0b7;
  margin-top: 3px;
}

.asset-label {
  color: var(--teal);
  font-weight: 900;
}

.ad-account-label-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.ad-account-label-item {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ad-account-label-item strong {
  color: #18243b;
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ad-account-label-item small {
  color: #93a0b7;
  font-size: 10px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.used-meter {
  display: inline-grid;
  gap: 5px;
  min-width: 46px;
}

.used-meter strong {
  font-weight: 800;
  font-size: 12px;
}

.used-meter > span {
  width: 44px;
  height: 3px;
  border-radius: 999px;
  background: #dce6f1;
  overflow: hidden;
}

.used-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.used-meter.success strong {
  color: var(--success);
}

.used-meter.success i {
  background: var(--success);
}

.used-meter.warning strong {
  color: var(--warning);
}

.used-meter.warning i {
  background: var(--warning);
}

.used-meter.danger strong {
  color: #ef4444;
}

.used-meter.danger i {
  background: #ef4444;
}

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

.asset-muted {
  color: var(--muted);
  font-size: 12px;
}

.linked-assets {
  display: grid;
  gap: 5px;
}

.linked-assets span,
.linked-assets strong,
.linked-assets small {
  display: block;
}

.linked-assets strong {
  color: #18243b;
  line-height: 1.25;
}

.linked-assets small {
  color: #93a0b7;
  margin-top: 2px;
}

.modal-search-row {
  display: grid;
  grid-template-columns: minmax(260px, 430px) auto minmax(180px, 1fr);
  gap: 10px;
  align-items: end;
}

.modal-search-field {
  display: grid;
  gap: 6px;
}

.modal-search-field span {
  color: #66758d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.modal-search-field input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  outline: none;
  padding: 0 12px;
}

.modal-search-field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.12);
}

.modal-search-status {
  min-height: 38px;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.modal-root:empty {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  z-index: 80;
}

.modal-card {
  position: fixed;
  inset: 6vh 5vw;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
  z-index: 81;
  padding: 18px;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
}

.modal-card.wide {
  inset: 5vh max(18px, calc((100vw - 960px) / 2));
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.modal-head h2,
.modal-head p,
.modal-head span {
  margin: 0;
}

.modal-head span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.icon-close {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 22px;
}

.modal-body {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 12px;
}

.modal-body .code-block {
  border: 0;
  font-family: var(--mono, ui-monospace, SFMono-Regular, Consolas, monospace);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.modal-table-wrap {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.modal-table {
  min-width: 900px;
}

.modal-table th {
  background: #f7f9fc;
  position: sticky;
  top: 0;
  z-index: 1;
}

.modal-table tr.is-search-match td {
  background: #f8fbff;
}

.modal-table tr.is-located td {
  background: #fff7ed;
  box-shadow: inset 0 1px 0 #fed7aa, inset 0 -1px 0 #fed7aa;
}

.modal-table tr.is-located td:first-child {
  box-shadow: inset 4px 0 0 #f59e0b, inset 0 1px 0 #fed7aa, inset 0 -1px 0 #fed7aa;
}

.products-hero {
  min-height: 112px;
  border: 1px solid #e1eaf4;
  background: linear-gradient(110deg, #dff7ff, #f8fbff 56%, #f4f7fb);
  border-radius: 16px;
  padding: 18px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
}

.products-step-badge {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--teal);
  color: #fff;
  font-weight: 900;
}

.products-hero-copy p,
.products-hero-copy h2,
.products-hero-copy span {
  margin: 0;
}

.products-hero-copy p {
  color: #8ea0ba;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.products-hero-copy h2 {
  margin-top: 6px;
  font-size: 28px;
}

.products-hero-copy span {
  display: block;
  margin-top: 6px;
  color: #596982;
  font-size: 13px;
}

.products-hero-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.products-summary-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.products-summary-grid span {
  min-height: 62px;
  border: 1px solid #dfe8f2;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px 12px;
}

.products-summary-grid small {
  color: #71809a;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.products-summary-grid strong {
  color: #08152b;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.products-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) repeat(3, minmax(160px, auto));
  gap: 14px;
  align-items: center;
}

.product-filter {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.product-filter span {
  color: #71809a;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product-filter select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #26364f;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.products-panel {
  background: #eef3f8;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 12px;
}

.product-card {
  background: #eef3f8;
  border: 1px solid #dfe8f2;
  border-radius: 12px;
  overflow: hidden;
}

.product-card[hidden] {
  display: none;
}

.product-card-top {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: #41516a;
  font-size: 12px;
}

.product-title-stack {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.product-title-stack strong {
  color: #12203a;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-title-stack small {
  color: #7d8aa3;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.product-checkline {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-weight: 900;
  color: #12203a;
}

.product-checkline span {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card-stat {
  color: #596982;
  white-space: nowrap;
}

.product-detail {
  border-top: 1px solid #dfe8f2;
}

.product-detail summary {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  cursor: pointer;
  background: linear-gradient(90deg, #eef3f8, #e5f6fb 52%, #eef3f8);
  list-style: none;
}

.product-detail summary::-webkit-details-marker {
  display: none;
}

.product-detail summary > span:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.product-detail summary strong {
  font-size: 16px;
  color: #08152b;
  overflow-wrap: anywhere;
}

.product-summary-metrics {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 2px 14px;
  text-align: right;
  color: #8ea0ba;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.product-summary-metrics strong {
  font-size: 13px;
  color: #08152b;
}

.product-tag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border: 1px solid #b8d7ff;
  border-radius: 999px;
  background: #eef6ff;
  color: #2563eb;
  padding: 0 7px;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.product-tag.green {
  border-color: #9fe3cc;
  background: #e4fbf3;
  color: #047857;
}

.product-tag.warning {
  border-color: #f8d38d;
  background: #fff7e6;
  color: #b45309;
}

.product-tag.danger {
  border-color: #f5b4b4;
  background: #fff1f2;
  color: #be123c;
}

.product-tag.muted {
  border-color: #b8c5d6;
  background: #f7f9fc;
  color: #526178;
}

.product-info-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 18px 6px;
}

.product-info-strip span {
  display: grid;
  gap: 3px;
}

.product-info-strip small,
.product-section-label {
  color: #8ea0ba;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product-info-strip strong {
  color: #12203a;
  overflow-wrap: anywhere;
}

.product-info-strip em {
  color: #8ea0ba;
  font-size: 11px;
  font-style: normal;
  overflow-wrap: anywhere;
}

.product-warning {
  margin: 8px 18px;
  border-left: 3px solid #f59e0b;
  background: #fff7ed;
  color: #92400e;
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 12px;
}

.product-section {
  margin: 0 18px;
  padding: 14px 0;
  border-top: 1px solid #dfe8f2;
}

.product-section-label {
  margin: 0 0 10px;
}

.product-linked-app {
  min-height: 40px;
  border: 1px solid #dfe8f2;
  border-radius: 10px;
  display: flex;
  align-items: center;
  padding: 0 12px;
}

.product-linked-app span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.product-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
  gap: 14px;
}

.product-event-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.product-event-grid > div {
  border: 1px solid #dfe8f2;
  border-radius: 10px;
  padding: 12px;
  min-height: 126px;
}

.product-event-grid strong {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
}

.product-pill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-pill-cloud span {
  min-height: 28px;
  border: 1px solid #dfe8f2;
  border-radius: 999px;
  background: #f8fbff;
  color: #12203a;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.product-pill-cloud em,
.product-muted-box {
  color: #93a0b7;
  font-size: 12px;
  font-style: normal;
}

.product-muted-box {
  min-height: 40px;
  border: 1px dashed #d8e3ef;
  border-radius: 10px;
  display: flex;
  align-items: center;
  padding: 0 12px;
}

.product-funnel {
  min-height: 42px;
  border: 1px dashed #d8e3ef;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  flex-wrap: wrap;
}

.product-funnel span {
  min-height: 26px;
  border-radius: 999px;
  background: #ecfffb;
  color: #047857;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 900;
}

.product-funnel i {
  width: 20px;
  height: 1px;
  background: #b8c5d6;
}

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

.product-item-preview,
.product-metrics span {
  min-height: 64px;
  border: 1px solid #dfe8f2;
  border-radius: 8px;
  background: #f5f8fc;
  padding: 10px;
  display: grid;
  align-content: center;
  gap: 5px;
}

.product-item-preview {
  grid-template-columns: 64px minmax(0, 1fr);
  align-content: stretch;
}

.product-item-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #e7eef7;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.product-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-item-thumb span {
  color: #526178;
  font-size: 12px;
  font-weight: 900;
}

.product-item-body {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
}

.product-item-preview strong,
.product-item-preview small,
.product-item-preview a,
.product-item-preview em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.product-item-preview strong {
  color: #12203a;
  font-size: 12px;
}

.product-item-preview small,
.product-item-preview em {
  color: #7d8aa3;
  font-size: 11px;
  font-style: normal;
}

.product-item-preview a {
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
}

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

.product-metrics small {
  color: #596982;
  font-size: 11px;
}

.product-metrics strong {
  color: #08152b;
  font-size: 20px;
}

.product-metrics .target,
.product-metrics .good {
  background: #dff4f2;
}

.product-metrics .target small,
.product-metrics .good small {
  color: #047857;
}

.product-metrics .warning {
  background: #fff7e6;
}

.product-diagnostics,
.product-readiness-list {
  display: grid;
  gap: 8px;
}

.product-diagnostics article,
.product-readiness-list span {
  border: 1px solid #dfe8f2;
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px 12px;
}

.product-diagnostics article {
  display: grid;
  gap: 6px;
}

.product-diagnostics strong,
.product-readiness-list strong {
  color: #12203a;
  font-size: 12px;
}

.product-diagnostics p {
  margin: 0;
  color: #41516a;
  font-size: 12px;
  line-height: 1.45;
}

.product-diagnostics small,
.product-readiness-list small {
  color: #7d8aa3;
  font-size: 11px;
  line-height: 1.35;
}

.product-readiness-list span {
  display: grid;
  gap: 3px;
  border-left: 3px solid #f59e0b;
}

.product-readiness-list span.good {
  border-left-color: #10b981;
}

.product-field-note {
  margin: 10px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.product-card-foot {
  min-height: 54px;
  border-top: 1px solid #dfe8f2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
}

.product-decision summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  color: #08152b;
}

.product-decision p {
  margin: 8px 0 0;
  color: #596982;
  font-size: 12px;
}

.product-optimize {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 900;
  color: #12203a;
}

.products-hero {
  border-radius: 12px;
  background: linear-gradient(135deg, #f8fafc, #eef6ff 62%, #f7f8fb);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.products-toolbar {
  display: grid !important;
  grid-template-columns: minmax(360px, 520px) minmax(0, 1fr) !important;
  gap: 10px !important;
  align-items: start !important;
}

.products-search-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.products-search-field > span,
.product-filter > span,
.product-business-search > span {
  color: #667085;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

.product-search-input {
  width: 100%;
  min-height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
}

.products-filter-cluster {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.product-filter-dropdown {
  position: relative;
  min-width: 142px;
}

.product-business-filter {
  min-width: min(320px, 100%);
}

.product-filter-button,
.product-clear-filters {
  min-height: 38px;
  border: 1px solid #d6dde8;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #172033;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, transform 180ms ease;
}

.product-filter-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 11px;
  cursor: pointer;
  font: inherit;
}

.product-filter-button strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 750;
}

.product-filter-button i {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  opacity: 0.58;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 180ms ease;
}

.product-filter-dropdown.is-open .product-filter-button i {
  transform: rotate(225deg) translate(-1px, -1px);
}

.product-filter-button:hover,
.product-filter-button:focus-visible,
.product-clear-filters:hover,
.product-clear-filters:focus-visible {
  outline: 0;
  border-color: #9db7d9;
  background: #fff;
  box-shadow: 0 8px 24px rgba(33, 54, 92, 0.08);
}

.product-filter-button:active,
.product-clear-filters:active {
  transform: translateY(1px) scale(0.99);
}

.product-clear-filters {
  padding: 0 12px;
  color: #344054;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
}

.product-clear-filters:disabled {
  opacity: 0.42;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.product-dropdown-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  min-width: 100%;
  max-height: 260px;
  overflow: auto;
  border: 1px solid rgba(214, 221, 232, 0.92);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.14);
  padding: 6px;
}

.product-dropdown-option,
.product-business-option {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  background: transparent;
  color: #172033;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.product-dropdown-option:hover,
.product-dropdown-option:focus-visible,
.product-business-option:hover,
.product-business-option:focus-visible {
  outline: 0;
  background: #f2f6fb;
}

.product-dropdown-option.is-selected,
.product-business-option.is-selected {
  background: #eaf3ff;
  color: #1d4ed8;
}

.product-status-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #98a2b3;
  box-shadow: 0 0 0 3px rgba(152, 162, 179, 0.14);
}

.product-status-dot.green {
  background: #12b76a;
  box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.14);
}

.product-status-dot.warning {
  background: #f79009;
  box-shadow: 0 0 0 3px rgba(247, 144, 9, 0.14);
}

.product-status-dot.danger {
  background: #f04438;
  box-shadow: 0 0 0 3px rgba(240, 68, 56, 0.14);
}

.product-business-menu {
  width: min(360px, 88vw);
  max-height: none;
  overflow: visible;
}

.product-business-search {
  display: grid;
  gap: 5px;
  padding: 4px 4px 8px;
}

.product-business-search input {
  min-height: 34px;
  border: 1px solid #d6dde8;
  border-radius: 8px;
  padding: 0 10px;
  color: #172033;
  font: inherit;
  font-size: 12px;
}

.product-business-search input:focus {
  outline: 2px solid rgba(45, 127, 249, 0.24);
  border-color: #8eb8f8;
}

.product-business-dropdown-body {
  max-height: 230px;
  overflow: auto;
  display: grid;
  gap: 3px;
}

.product-business-option > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.product-business-option strong,
.product-business-option small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-business-option strong {
  font-size: 12px;
}

.product-business-option small {
  color: #667085;
  font-size: 11px;
}

.product-option-check {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  border: 1px solid #b8c5d6;
  border-radius: 5px;
  background: #fff;
}

.product-business-option.is-selected .product-option-check {
  border-color: #2563eb;
  background: #2563eb;
  box-shadow: inset 0 0 0 3px #fff;
}

.product-business-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.product-business-chip {
  min-width: 0;
  max-width: 180px;
  min-height: 24px;
  border: 1px solid #d6dde8;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 3px 2px 9px;
  background: #f8fafc;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.product-business-chip > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-business-chip button {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0;
  background: rgba(16, 24, 40, 0.08);
  color: #667085;
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.product-business-chip button:hover,
.product-business-chip button:focus-visible {
  outline: 0;
  background: rgba(240, 68, 56, 0.12);
  color: #d92d20;
}

.product-dropdown-empty {
  min-height: 56px;
  display: grid;
  place-items: center;
  color: #667085;
  font-size: 12px;
}

.products-warning-bar {
  border: 1px solid #fedf89;
  border-radius: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px;
  align-items: center;
  padding: 10px 12px;
  background: #fffcf5;
  color: #7a2e0e;
}

.products-warning-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.product-warning-icon {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #f79009;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.products-warning-copy strong,
.products-warning-copy small {
  display: block;
}

.products-warning-copy strong {
  font-size: 13px;
}

.products-warning-copy small {
  margin-top: 2px;
  color: #93370d;
  font-size: 12px;
}

.products-warning-actions,
.products-empty-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.products-warning-details {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(247, 144, 9, 0.22);
  padding-top: 8px;
}

.products-warning-details summary {
  cursor: pointer;
  color: #7a2e0e;
  font-size: 12px;
  font-weight: 800;
}

.products-warning-details div {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.products-warning-details p {
  margin: 0;
  display: grid;
  gap: 2px;
  color: #93370d;
  font-size: 12px;
}

.products-panel {
  border-radius: 10px;
  background: #f6f8fb;
  padding: 10px;
}

.products-empty-card {
  min-height: 148px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 10px;
  padding: 22px;
  background: #fff;
  color: #344054;
}

.products-empty-card.is-filtered {
  justify-items: center;
  text-align: center;
}

.products-empty-card strong {
  color: #101828;
  font-size: 17px;
}

.products-empty-card p {
  margin: 0;
  color: #667085;
  font-size: 13px;
}

.products-empty-card ul {
  margin: 0;
  padding-left: 18px;
  color: #667085;
  font-size: 13px;
  line-height: 1.7;
}

.product-card {
  border-radius: 8px;
  background: #fff;
  border-color: #e4e7ec;
}

.product-detail {
  border-top: 0;
}

.product-card-row {
  min-height: 66px;
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(150px, 1.2fr) minmax(86px, 0.7fr) minmax(96px, 0.8fr) repeat(3, minmax(72px, 0.55fr)) minmax(96px, 0.8fr) 18px;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
}

.product-detail summary.product-card-row {
  background: #fff;
}

.product-detail[open] summary.product-card-row {
  background: #fbfcfe;
}

.product-card-cell {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.product-card-cell small,
.product-title-stack small {
  color: #667085;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0;
}

.product-card-cell strong,
.product-title-stack strong {
  min-width: 0;
  color: #172033;
  font-size: 12px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-title-stack strong {
  font-size: 14px;
}

.product-number-cell strong {
  font-variant-numeric: tabular-nums;
}

.product-status-cell strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.product-card-expand {
  width: 8px;
  height: 8px;
  justify-self: end;
  border-right: 1.5px solid #98a2b3;
  border-bottom: 1.5px solid #98a2b3;
  transform: rotate(45deg);
  transition: transform 180ms ease;
}

.product-detail[open] .product-card-expand {
  transform: rotate(225deg);
}

.product-detail-body {
  border-top: 1px solid #edf1f6;
  padding-bottom: 16px;
}

body[data-view="connections"] .workspace,
body[data-view="adAccounts"] .workspace,
body[data-view="assetPages"] .workspace,
body[data-view="businessManagers"] .workspace,
body[data-view="products"] .workspace {
  padding-top: 24px;
}

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

  .task-pool {
    display: none;
  }
}

@media (max-width: 1180px) {
  .products-toolbar {
    grid-template-columns: 1fr !important;
  }

  .products-filter-cluster {
    justify-content: flex-start;
  }

  .product-card-row {
    grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(92px, 1fr)) 18px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    background: #fff;
  }

  .linked-title-row {
    grid-template-columns: 1fr;
  }

  .asset-page-head {
    grid-template-columns: 1fr;
  }

  .asset-title-line {
    flex-wrap: wrap;
  }

  .asset-table-panel {
    height: calc(100vh - 150px);
  }

  .products-hero,
  .products-summary-grid,
  .products-toolbar,
  .product-info-strip,
  .product-two-col,
  .product-event-grid,
  .product-item-list,
  .product-metrics {
    grid-template-columns: 1fr;
  }

  .products-hero {
    align-items: stretch;
  }

  .products-hero-actions {
    justify-content: stretch;
  }

  .products-hero-actions .button {
    flex: 1;
  }

  .product-detail summary,
  .product-card-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .products-filter-cluster {
    display: grid;
    grid-template-columns: 1fr;
  }

  .product-filter-dropdown,
  .product-business-filter {
    width: 100%;
    min-width: 0;
  }

  .product-dropdown-menu,
  .product-business-menu {
    left: 0;
    right: auto;
    width: 100%;
  }

  .products-warning-bar {
    grid-template-columns: 1fr;
  }

  .products-warning-actions,
  .products-empty-actions {
    justify-content: flex-start;
  }

  .product-card-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .product-card-expand {
    justify-self: start;
  }

  .modal-card {
    inset: 3vh 12px;
    padding: 14px;
  }

  .modal-search-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 50;
}

.toast {
  width: min(360px, calc(100vw - 36px));
  background: #111827;
  color: #fff;
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-size: 13px;
}

.drawer-backdrop {
  display: none;
}

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

  .content-grid,
  .content-grid.equal {
    grid-template-columns: 1fr;
  }

  .template-hero,
  .template-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .template-search {
    max-width: none;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 300px);
    transform: translateX(-100%);
    transition: transform 160ms ease;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .workspace {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .mobile-only {
    display: grid;
  }

  .metric-grid,
  .status-strip,
  .field-grid,
  .template-summary-grid,
  .template-editor-form,
  .template-editor-group {
    grid-template-columns: 1fr;
  }

  .automation-stream-title {
    align-items: flex-start;
  }

  .automation-stream-actions {
    justify-content: flex-start;
  }

  .automation-stream-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px;
  }

  .automation-stream-time {
    grid-column: 1;
    grid-row: 1;
  }

  .automation-stream-status {
    grid-column: 2;
    grid-row: 1;
  }

  .automation-stream-agent,
  .automation-stream-copy {
    grid-column: 1 / -1;
  }

  .template-table {
    min-width: 0;
  }

  .template-table thead {
    display: none;
  }

  .template-table tr {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
  }

  .template-table td {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 10px;
    padding: 0;
    border: 0;
  }

  .template-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .template-actions {
    min-width: 0;
  }

  .template-drawer {
    width: 100vw;
  }

  .template-detail-section dl div {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .chart-bars {
    height: 190px;
  }
}

.admin-settings-section {
  display: grid;
  gap: 14px;
  padding: 0 0 18px;
}

.admin-settings-section + .admin-settings-section {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.admin-settings-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-settings-section h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.admin-settings-section p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.admin-settings-stack {
  display: grid;
  gap: 18px;
}

.admin-secondary-settings {
  align-items: start;
}

.ai-model-console {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #f8fafc;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.06);
}

.ai-model-console-head,
.ai-model-toolbar,
.ai-model-panel-head,
.ai-model-row,
.ai-model-row-main,
.ai-model-row-actions,
.ai-model-actions,
.ai-model-log-actions,
.ai-model-storage-note,
.ai-model-status {
  display: flex;
  align-items: center;
}

.ai-model-console-head {
  justify-content: space-between;
  gap: 18px;
}

.ai-model-console-head h3 {
  margin: 0 0 5px;
  font-size: 24px;
  line-height: 1.2;
  color: #111827;
}

.ai-model-console-head p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.ai-model-toolbar {
  justify-content: space-between;
  gap: 12px;
}

.ai-model-search {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: min(420px, 100%);
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #64748b;
}

.ai-model-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111827;
  font-size: 13px;
}

.ai-model-filter-group,
.ai-model-provider-segments {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.ai-model-filter,
.ai-model-provider {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  padding: 0 10px;
  cursor: pointer;
}

.ai-model-filter.is-active,
.ai-model-provider.is-active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.ai-model-storage-note {
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid rgba(217, 119, 6, 0.16);
  border-radius: 8px;
  background: #fff7ed;
  color: #92400e;
}

.ai-model-storage-note.is-ready {
  border-color: rgba(13, 148, 136, 0.16);
  background: #f0fdfa;
  color: #0f766e;
}

.ai-model-storage-note p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.ai-model-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(340px, 1.05fr);
  gap: 14px;
  align-items: start;
}

.ai-model-list-panel,
.ai-model-detail-panel,
.ai-model-logs {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.ai-model-list-panel,
.ai-model-detail-panel {
  min-width: 0;
  padding: 14px;
}

.ai-model-detail-panel {
  display: grid;
  gap: 12px;
}

.ai-model-panel-head {
  justify-content: space-between;
  gap: 12px;
}

.ai-model-panel-head strong {
  display: block;
  color: #111827;
  font-size: 14px;
}

.ai-model-panel-head span {
  display: block;
  color: #64748b;
  font-size: 12px;
  margin-top: 3px;
}

.ai-model-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.ai-model-row {
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #ffffff;
}

.ai-model-row.is-selected {
  border-color: rgba(0, 113, 227, 0.34);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.08);
}

.ai-model-row-main {
  flex: 1 1 auto;
  min-width: 0;
  gap: 10px;
  justify-content: space-between;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  padding: 0;
}

.ai-model-row-main span {
  min-width: 0;
}

.ai-model-row-main strong,
.ai-model-row-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-model-row-main strong {
  color: #111827;
  font-size: 13px;
  margin-bottom: 3px;
}

.ai-model-row-main small,
.ai-model-row-meta span {
  color: #64748b;
  font-size: 12px;
}

.ai-model-row-main em {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eff6ff;
  color: #0369a1;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  padding: 4px 7px;
}

.ai-model-row-meta {
  display: grid;
  gap: 4px;
  width: 124px;
}

.ai-model-row-actions {
  flex: 0 0 auto;
  gap: 4px;
}

.ai-model-icon-button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
}

.ai-model-icon-button:hover {
  color: #111827;
  border-color: rgba(15, 23, 42, 0.18);
}

.ai-model-icon-button.is-filled {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.ai-model-icon-button.is-danger {
  color: #dc2626;
}

.ai-model-icon-button.is-disabled,
.ai-model-icon-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ai-model-svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-model-status {
  width: fit-content;
  gap: 6px;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
}

.ai-model-status span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.ai-model-status.is-connected {
  background: #ecfdf5;
  color: #047857;
}

.ai-model-status.is-untested {
  background: #fff7ed;
  color: #b45309;
}

.ai-model-status.is-failed {
  background: #fef2f2;
  color: #dc2626;
}

.ai-model-default-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #f8fafc;
  color: #111827;
  font-size: 13px;
  font-weight: 700;
}

.ai-model-actions {
  justify-content: flex-end;
  gap: 8px;
}

.ai-model-inline-status {
  min-height: 38px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  line-height: 1.5;
}

.ai-model-inline-status.is-warning {
  border-color: rgba(217, 119, 6, 0.2);
  background: #fff7ed;
  color: #92400e;
}

.ai-model-inline-status.is-danger {
  border-color: rgba(220, 38, 38, 0.2);
  background: #fef2f2;
  color: #b91c1c;
}

.ai-model-empty {
  display: grid;
  gap: 4px;
  padding: 18px;
  border: 1px dashed rgba(15, 23, 42, 0.14);
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
}

.ai-model-empty strong {
  color: #111827;
  font-size: 13px;
}

.ai-model-empty p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.ai-model-empty.is-compact {
  margin: 12px 14px 14px;
}

.ai-model-logs {
  padding: 14px;
}

.ai-model-log-list {
  display: grid;
  gap: 2px;
  margin-top: 12px;
}

.ai-model-log-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(160px, 1fr) auto minmax(120px, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 38px;
  padding: 7px 0;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  color: #64748b;
  font-size: 12px;
}

.ai-model-log-row:first-child {
  border-top: 0;
}

.ai-model-log-row strong,
.ai-model-log-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-model-log-row strong {
  color: #111827;
}

.ai-model-log-row small {
  color: #64748b;
}

.ai-model-log-actions {
  gap: 8px;
}

.ai-model-text-button {
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 980px) {
  .ai-model-console-head,
  .ai-model-toolbar,
  .ai-model-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .ai-model-workspace {
    grid-template-columns: 1fr;
  }

  .ai-model-filter-group,
  .ai-model-provider-segments {
    width: 100%;
    overflow-x: auto;
  }

  .ai-model-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .ai-model-row-meta {
    width: auto;
    min-width: 132px;
  }

  .ai-model-row-actions {
    margin-left: auto;
  }

  .ai-model-log-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .ai-model-actions {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .ai-model-actions .button {
    flex: 1 1 140px;
  }
}

.password-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.password-input-wrap input {
  min-width: 0;
}

.password-toggle {
  width: 40px;
  height: 40px;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.ai-monitor-shell {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.ai-bid-workbench {
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
}

.ai-monitor-status-bar {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  min-width: 0;
}

.ai-monitor-status-item {
  display: grid;
  gap: 4px;
  flex: 1 1 124px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 10px;
}

.ai-monitor-status-item span,
.ai-monitor-status-item small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.ai-monitor-status-item strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.ai-monitor-status-item.is-success {
  border-color: rgba(22, 163, 74, 0.28);
  background: rgba(22, 163, 74, 0.08);
}

.ai-monitor-status-item.is-warning {
  border-color: rgba(217, 119, 6, 0.28);
  background: rgba(217, 119, 6, 0.1);
}

.ai-monitor-status-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.ai-objective-segments,
.ai-strategy-tabs,
.ai-execution-tabs,
.ai-monitor-segmented {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ai-strategy-card-list {
  display: grid;
  gap: 8px;
}

.ai-strategy-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 10px;
}

.ai-strategy-card > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.ai-strategy-card strong,
.ai-strategy-card p,
.ai-strategy-card small {
  margin: 0;
  overflow-wrap: anywhere;
}

.ai-strategy-card strong {
  font-size: 13px;
  color: var(--ink);
}

.ai-strategy-card p,
.ai-strategy-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.ai-monitor-sidebar,
.ai-monitor-list-panel,
.ai-monitor-detail-panel,
.ai-monitor-task-panel,
.ai-monitor-metric {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.ai-monitor-sidebar {
  position: sticky;
  top: 18px;
  padding: 18px;
  min-width: 0;
}

.ai-monitor-heading p {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.ai-monitor-heading h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  text-wrap: balance;
}

.ai-monitor-heading span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}

.ai-monitor-filters,
.ai-monitor-main,
.ai-monitor-recommendation-list,
.ai-monitor-task-list,
.ai-monitor-detail-stack {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.ai-monitor-filters {
  margin-top: 18px;
}

.ai-monitor-filters .field input,
.ai-monitor-filters .field select,
.ai-monitor-settings .field input,
.ai-monitor-settings .field select {
  min-height: 44px;
}

.ai-monitor-settings {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.ai-monitor-settings-head strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.ai-monitor-settings-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.ai-monitor-scheduler-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.ai-monitor-scheduler-card .ai-strategy-card-meta {
  margin: 0;
}

.growth-monitor-card {
  gap: 14px;
}

.ai-monitor-main > .growth-monitor-card {
  margin-bottom: 14px;
}

.growth-monitor-statusbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  align-items: stretch;
  gap: 8px;
}

.growth-monitor-statusbar .ai-monitor-status-actions {
  justify-content: flex-start;
  align-content: center;
}

.growth-monitor-enabled {
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: var(--surface);
  font-weight: 900;
}

.growth-monitor-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(360px, 1.35fr) minmax(240px, 0.9fr) minmax(240px, 0.9fr);
  align-items: start;
  gap: 12px;
}

.growth-monitor-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  background: transparent;
}

.growth-monitor-panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
}

.growth-monitor-panel .ai-account-picker-field {
  z-index: 25;
}

.growth-monitor-panel .ai-account-picker-field + .ai-account-picker-field {
  z-index: 24;
}

.growth-monitor-panel .ai-account-picker-control {
  min-height: 64px;
  align-items: center;
  border-radius: 12px;
  padding: 7px 8px;
}

.growth-monitor-panel .ai-account-picker-selected {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 5px 8px;
  width: 100%;
  min-height: 50px;
}

.growth-monitor-panel .ai-account-picker-placeholder {
  grid-column: 1 / -1;
}

.growth-monitor-panel .ai-account-chip {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  justify-content: space-between;
  flex: 0 0 auto;
  padding-left: 9px;
}

.growth-monitor-panel button.ai-account-chip.is-overflow {
  justify-content: center;
}

.growth-monitor-run-panel {
  align-content: start;
}

.ai-monitor-main .growth-monitor-panel .ai-account-picker-popover {
  right: auto;
  width: min(640px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
  border-color: rgba(148, 163, 184, 0.38);
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.18);
}

.growth-monitor-panel .ai-account-picker-options {
  gap: 4px;
  max-height: min(330px, 46vh);
  padding: 8px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.growth-monitor-panel .ai-monitor-picker-option {
  grid-template-columns: 22px minmax(0, 1fr) max-content;
  align-items: start;
  gap: 10px;
  min-height: 84px;
  padding: 10px;
  border-radius: 10px;
}

.growth-monitor-panel .ai-monitor-picker-option:hover,
.growth-monitor-panel .ai-monitor-picker-option:focus-visible {
  background: #f5f8fc;
}

.growth-monitor-panel .ai-monitor-picker-option.is-selected {
  background: #e7f2ff;
}

.growth-monitor-panel .ai-monitor-picker-option .ai-account-checkbox {
  margin-top: 4px;
}

.growth-monitor-panel .ai-monitor-picker-option .ai-account-option-copy {
  gap: 6px;
  align-content: start;
}

.growth-monitor-panel .ai-monitor-picker-option .ai-account-title-line,
.growth-monitor-panel .ai-monitor-picker-option .ads-control-account-title-line {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.growth-monitor-panel .ai-monitor-picker-option .ai-account-option-copy strong,
.growth-monitor-panel .ai-monitor-picker-option .ai-account-option-copy small {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.growth-monitor-panel .ai-monitor-picker-option .ads-control-account-source-row {
  align-items: flex-start;
}

.growth-monitor-panel .ai-monitor-picker-option .ads-control-account-source-chips {
  flex-wrap: wrap;
  min-width: 0;
}

.growth-monitor-panel .ai-monitor-picker-option .ads-control-account-source-chip {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.growth-monitor-panel .ai-monitor-picker-option .ads-control-account-status {
  justify-self: end;
  white-space: nowrap;
}

@media (max-width: 1440px) {
  .growth-monitor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .growth-monitor-grid {
    grid-template-columns: 1fr;
  }

  .ai-monitor-main .growth-monitor-panel .ai-account-picker-popover {
    width: min(100%, calc(100vw - 32px));
  }
}

@media (max-width: 520px) {
  .growth-monitor-panel .ai-account-picker-selected {
    grid-template-columns: minmax(0, 1fr);
  }

  .growth-monitor-panel .ai-account-picker-control {
    min-height: 42px;
  }

  .growth-monitor-panel .ai-monitor-picker-option {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .growth-monitor-panel .ai-monitor-picker-option .ads-control-account-status {
    grid-column: 2;
    justify-self: start;
  }
}

.ai-monitor-failed-accounts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(220, 38, 38, 0.22);
  border-radius: var(--radius-sm);
  background: rgba(220, 38, 38, 0.07);
  color: var(--danger);
  font-size: 12px;
}

.ai-monitor-failed-accounts span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.form-hint.strong {
  font-weight: 900;
  color: var(--ink);
}

.compact-actions {
  justify-content: flex-start;
}

.ai-monitor-date-grid,
.ai-monitor-target-grid,
.ai-evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ai-monitor-date-grid.is-hidden {
  display: none;
}

.ai-monitor-levels {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-monitor-levels label {
  flex: 0 1 auto;
  min-width: 86px;
  max-width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  background: var(--surface-2);
  cursor: pointer;
  touch-action: manipulation;
  overflow: hidden;
  white-space: nowrap;
}

.ai-monitor-levels label:nth-child(1) {
  min-width: 112px;
}

.ai-monitor-levels label:nth-child(2) {
  min-width: 92px;
}

.ai-monitor-levels label:nth-child(3) {
  min-width: 72px;
}

.ai-monitor-levels input {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  margin: 0;
  appearance: none;
  display: grid;
  place-content: center;
  border: 1.5px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
}

.ai-monitor-levels input::after {
  content: "";
  width: 7px;
  height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: translateY(-1px) rotate(-45deg);
  opacity: 0;
}

.ai-monitor-levels input:checked {
  border-color: var(--brand);
  background: var(--brand);
}

.ai-monitor-levels input:checked::after {
  opacity: 1;
}

.ai-monitor-levels label:has(input:checked) {
  border-color: rgba(0, 113, 227, 0.35);
  background: var(--brand-soft);
  color: var(--brand);
}

.ai-monitor-levels span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-monitor-settings .checkbox-line {
  min-height: 44px;
  cursor: pointer;
  touch-action: manipulation;
}

.ai-monitor-actions,
.ai-rec-topline,
.ai-detail-action-strip,
.ai-detail-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-monitor-actions .button,
.ai-detail-buttons .button,
.ai-monitor-notice .button {
  min-height: 44px;
}

.ai-monitor-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.ai-monitor-metric,
.ai-monitor-list-panel,
.ai-monitor-detail-panel,
.ai-monitor-task-panel {
  padding: 18px;
  min-width: 0;
}

.ai-monitor-metric span,
.ai-evidence-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ai-monitor-metric strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.ai-monitor-metric small {
  display: block;
  margin-top: 8px;
  color: var(--subtle);
}

.ai-monitor-content {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.ai-bid-workbench .ai-monitor-content {
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
}

.ai-monitor-queue-toolbar {
  display: grid;
  grid-template-columns: max-content minmax(260px, 1fr) minmax(180px, 260px) minmax(128px, 150px) minmax(116px, 140px);
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.ai-monitor-queue-toolbar .ai-monitor-segmented,
.ai-monitor-queue-toolbar .ai-monitor-search {
  min-width: 0;
}

.ai-monitor-search input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
}

.ai-monitor-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.ai-monitor-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  font-size: 12px;
}

.ai-monitor-table th,
.ai-monitor-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.ai-monitor-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.ai-recommendation-row {
  cursor: pointer;
}

.ai-recommendation-row:hover,
.ai-recommendation-row.is-active {
  background: #f8fbff;
}

.ai-recommendation-row td strong,
.ai-recommendation-row td span {
  display: block;
  max-width: 240px;
  overflow-wrap: anywhere;
}

.ai-recommendation-row td strong {
  color: var(--ink);
  font-size: 12px;
}

.ai-recommendation-row td span {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.ai-detail-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.ai-detail-mini-grid span {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.ai-detail-mini-grid strong {
  color: var(--ink);
  font-size: 13px;
}

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

.ai-monitor-list-panel .panel-title {
  align-items: start;
}

.ai-monitor-list-panel select {
  min-width: 132px;
}

.ai-monitor-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius);
  background: var(--brand-soft);
  color: var(--brand);
}

.ai-monitor-notice > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.ai-monitor-notice strong,
.ai-monitor-notice span {
  overflow-wrap: anywhere;
}

.ai-monitor-notice strong {
  font-size: 13px;
}

.ai-monitor-notice span {
  font-size: 12px;
  line-height: 1.5;
}

.ai-monitor-notice.is-warning {
  border-color: rgba(217, 119, 6, 0.22);
  background: rgba(217, 119, 6, 0.1);
  color: #9a4d00;
}

.ai-monitor-notice.is-error {
  border-color: rgba(220, 38, 38, 0.22);
  background: rgba(220, 38, 38, 0.1);
  color: #b42318;
}

.ai-monitor-rule-builder {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.ai-monitor-rule-head {
  display: grid;
  gap: 4px;
}

.ai-monitor-rule-head strong {
  font-size: 13px;
  color: var(--ink);
}

.ai-monitor-rule-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.ai-monitor-rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ai-monitor-rule-summary {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.ai-monitor-rule-chip {
  display: block;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.ai-recommendation-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  text-align: left;
  background: var(--surface-2);
  display: grid;
  gap: 8px;
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
}

.ai-recommendation-card:hover,
.ai-recommendation-card.is-active {
  border-color: var(--brand);
  background: #f8fbff;
}

.ai-recommendation-card strong {
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.ai-recommendation-card small,
.ai-recommendation-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.severity-dot {
  min-width: 28px;
  height: 24px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  color: #fff;
  background: var(--success);
}

.severity-dot.is-medium {
  background: var(--warning);
}

.severity-dot.is-high {
  background: var(--danger);
}

.ai-rec-action {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.ai-monitor-detail-head h2 {
  margin: 8px 0 6px;
  font-size: 22px;
  line-height: 1.25;
}

.ai-monitor-detail-head p {
  margin: 0;
  color: var(--muted);
}

.ai-evidence-grid div,
.ai-detail-section {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 12px;
}

.ai-evidence-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  word-break: break-word;
}

.ai-detail-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.ai-detail-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.ai-monitor-task-panel .list-row {
  box-shadow: none;
}

.danger-text {
  color: var(--danger);
}

@media (max-width: 1520px) {
  .ai-bid-workbench .ai-monitor-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1200px) {
  .ai-monitor-shell,
  .ai-monitor-content {
    grid-template-columns: 1fr;
  }

  .ai-monitor-queue-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-monitor-sidebar {
    position: static;
  }
}

@media (max-width: 780px) {
  .ai-monitor-date-grid,
  .ai-monitor-target-grid,
  .ai-monitor-rule-grid,
  .ai-evidence-grid,
  .ai-detail-mini-grid,
  .ai-monitor-queue-toolbar {
    grid-template-columns: 1fr;
  }

  .ai-monitor-summary-grid {
    grid-template-columns: 1fr;
  }

  .ai-monitor-levels {
    justify-content: stretch;
  }

  .ai-monitor-levels label {
    flex: 1 1 100%;
  }

  .ai-monitor-list-panel .panel-title {
    gap: 12px;
  }

  .ai-monitor-list-panel select,
  .ai-monitor-actions .button,
  .ai-monitor-status-actions .button,
  .ai-detail-buttons .button {
    width: 100%;
  }

  .ai-monitor-actions,
  .ai-monitor-status-actions,
  .ai-detail-buttons {
    align-items: stretch;
  }

  .ai-monitor-notice {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .ai-monitor-sidebar,
  .ai-monitor-metric,
  .ai-monitor-list-panel,
  .ai-monitor-detail-panel,
  .ai-monitor-task-panel {
    padding: 14px;
  }

  .ai-monitor-summary-grid {
    grid-template-columns: 1fr;
  }

  .ai-monitor-metric strong {
    font-size: 22px;
  }
}

.ai-optimization-console {
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.ai-opt-topbar {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.35fr) minmax(280px, auto);
  gap: 14px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  padding: 14px;
  min-width: 0;
}

.ai-opt-title-block {
  display: grid;
  gap: 8px;
  align-content: center;
  min-width: 0;
}

.ai-opt-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.ai-opt-title-row h1 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: 0;
}

.ai-opt-title-block p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  max-width: 680px;
}

.ai-opt-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
  min-width: 0;
}

.ai-opt-status-chip,
.ai-opt-metric {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 10px;
}

.ai-opt-status-chip span,
.ai-opt-status-chip small,
.ai-opt-metric span,
.ai-opt-metric small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.ai-opt-status-chip strong,
.ai-opt-metric strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.ai-opt-status-chip.is-success,
.ai-opt-metric.is-success {
  border-color: rgba(22, 163, 74, 0.24);
  background: rgba(22, 163, 74, 0.08);
}

.ai-opt-status-chip.is-warning {
  border-color: rgba(217, 119, 6, 0.28);
  background: rgba(217, 119, 6, 0.1);
}

.ai-opt-top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.ai-opt-automation-switch {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 8px 10px;
  color: var(--ink);
  cursor: pointer;
}

.ai-opt-automation-switch input {
  grid-row: span 2;
  width: 34px;
  height: 20px;
  margin: 0;
  appearance: none;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #d1d5db;
  position: relative;
}

.ai-opt-automation-switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
  transition: transform 0.16s ease;
}

.ai-opt-automation-switch input:checked {
  border-color: var(--brand);
  background: var(--brand);
}

.ai-opt-automation-switch input:checked::after {
  transform: translateX(14px);
}

.ai-opt-automation-switch span,
.ai-opt-automation-switch small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ai-opt-automation-switch span {
  font-size: 12px;
  font-weight: 900;
}

.ai-opt-automation-switch small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.ai-opt-workspace {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.ai-opt-workspace.is-nav-collapsed {
  grid-template-columns: 56px minmax(0, 1fr);
}

.ai-opt-module-nav {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 10px;
  min-width: 0;
}

.ai-opt-module-nav-head,
.ai-opt-module-nav nav button,
.ai-opt-module-head,
.ai-opt-queue-head,
.ai-opt-progress-head,
.ai-opt-safety-row,
.ai-opt-log-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ai-opt-module-nav-head {
  justify-content: space-between;
  color: var(--ink);
  font-size: 13px;
}

.ai-opt-module-nav-head .ai-opt-nav-toggle {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.ai-opt-module-nav-head .ai-opt-nav-toggle i {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(135deg);
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.ai-opt-module-nav-head .ai-opt-nav-toggle:hover i,
.ai-opt-module-nav-head .ai-opt-nav-toggle:focus-visible i {
  border-color: var(--brand);
}

.ai-opt-workspace.is-nav-collapsed .ai-opt-module-nav-head .ai-opt-nav-toggle i {
  transform: rotate(-45deg);
}

.ai-opt-module-nav nav {
  display: grid;
  gap: 4px;
}

.ai-opt-module-nav nav button {
  width: 100%;
  min-height: 34px;
  justify-content: space-between;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.ai-opt-module-nav nav button:hover,
.ai-opt-module-nav nav button.is-active {
  border-color: rgba(0, 113, 227, 0.18);
  background: var(--brand-soft);
  color: var(--brand);
}

.ai-opt-module-nav nav button span,
.ai-opt-module-nav nav button small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-opt-workspace.is-nav-collapsed .ai-opt-module-nav-head strong,
.ai-opt-workspace.is-nav-collapsed .ai-opt-module-nav nav button span,
.ai-opt-workspace.is-nav-collapsed .ai-opt-module-nav nav button small {
  display: none;
}

.ai-opt-workspace.is-nav-collapsed .ai-opt-module-nav nav button {
  justify-content: center;
  padding: 0;
}

.ai-opt-workspace.is-nav-collapsed .ai-opt-module-nav nav button::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.8;
}

.ai-opt-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.ai-opt-module {
  position: relative;
}

.ai-opt-module:has(.ai-select.is-open) {
  z-index: 640;
  overflow: visible;
}

.ai-opt-module {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  min-width: 0;
  overflow: clip;
}

.ai-opt-module-head {
  width: 100%;
  justify-content: space-between;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 14px 16px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ai-opt-module-head span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ai-opt-module-head strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
}

.ai-opt-module-head small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ai-opt-module-head i {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.16s ease;
}

.ai-opt-module.is-collapsed .ai-opt-module-head i {
  transform: rotate(-45deg);
}

.ai-opt-module-body {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 16px;
  min-width: 0;
}

.ai-opt-module.is-collapsed .ai-opt-module-body,
.ai-opt-module-body[hidden] {
  display: none;
}

.ai-opt-module-body > .ai-monitor-scheduler-card,
.ai-opt-module-body > .ai-monitor-settings,
.ai-opt-module-body > .ai-monitor-task-panel {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.ai-opt-schedule-card {
  gap: 12px;
  color: var(--ink);
}

.ai-opt-schedule-row {
  display: grid;
  grid-template-columns: minmax(108px, 0.38fr) minmax(320px, 1.42fr) minmax(150px, 0.66fr) minmax(160px, 0.72fr);
  align-items: end;
  gap: 12px;
  min-width: 0;
}

.ai-opt-schedule-row.is-secondary {
  grid-template-columns: minmax(150px, 0.62fr) minmax(260px, 1fr) minmax(240px, 0.88fr) max-content;
  align-items: end;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.ai-opt-switch-line,
.ai-opt-schedule-field,
.ai-opt-schedule-preview {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.ai-opt-switch-line > span,
.ai-opt-schedule-field > span,
.ai-opt-schedule-preview > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.ai-opt-switch-line {
  align-self: end;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: start;
  gap: 8px;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.ai-opt-switch-line input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.ai-opt-switch-line i {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #d1d5db;
  transition: background 0.16s ease;
}

.ai-opt-switch-line i::after {
  position: absolute;
  content: "";
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
  transition: transform 0.16s ease;
}

.ai-opt-switch-line input:checked + i {
  background: #24a148;
}

.ai-opt-switch-line input:checked + i::after {
  transform: translateX(16px);
}

.ai-opt-switch-line:has(input:focus-visible) {
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

.ai-opt-schedule-field .ai-select-trigger,
.ai-opt-schedule-field input[type="date"],
.ai-opt-schedule-field input[type="number"],
.ai-opt-scope-button {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
}

.ai-opt-schedule-field .ai-select-trigger {
  padding-left: 11px;
  padding-right: 34px;
}

.ai-opt-schedule-field .ai-select-trigger i {
  right: 13px;
}

.ai-opt-schedule-field .ai-select-menu {
  border-radius: var(--radius-sm);
}

.ai-opt-schedule-interval {
  position: relative;
  --schedule-segment-border: rgba(148, 163, 184, 0.38);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  width: 100%;
  padding: 2px;
  border: 1px solid var(--schedule-segment-border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
}

.ai-opt-schedule-interval > input[type="hidden"] {
  display: none;
}

.ai-opt-segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-height: 34px;
  min-width: 0;
  border: 0;
  border-left: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 6px;
  padding: 0 6px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.ai-opt-segment:first-of-type {
  border-left: 0;
}

.ai-opt-segment:hover,
.ai-opt-segment:focus-visible {
  outline: 0;
  color: var(--brand);
  background: #edf5ff;
}

.ai-opt-segment.is-active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 113, 227, 0.22);
}

.ai-opt-custom-interval {
  display: none;
  align-items: center;
  flex: 1 1 160px;
  gap: 8px;
  min-width: 140px;
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid rgba(148, 163, 184, 0.32);
}

.ai-opt-custom-interval.is-visible {
  display: flex;
}

.ai-opt-custom-interval span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.ai-opt-custom-interval input {
  width: 92px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.ai-opt-scope-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 1px solid var(--line);
  padding: 0 12px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.ai-opt-scope-button:hover,
.ai-opt-scope-button:focus-visible {
  outline: 0;
  border-color: rgba(0, 113, 227, 0.38);
  box-shadow: var(--focus-ring);
}

.ai-opt-scope-button i {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
}

.ai-opt-scope-button[aria-expanded="true"] i {
  transform: rotate(225deg);
}

.ai-opt-schedule-preview {
  min-height: 36px;
  justify-content: center;
  padding: 0 14px;
  border-left: 1px solid var(--line);
}

.ai-opt-schedule-preview strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.ai-opt-schedule-actions {
  display: flex;
  justify-content: flex-end;
}

.ai-opt-schedule-actions .button {
  min-width: 154px;
  min-height: 36px;
  border-radius: var(--radius-sm);
}

.ai-opt-custom-window {
  display: grid;
  grid-template-columns: minmax(160px, 0.5fr) minmax(160px, 0.5fr) minmax(260px, 1fr);
  align-items: end;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.ai-opt-custom-window p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.ai-opt-scope-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.ai-opt-scope-panel .ai-account-picker-control {
  min-height: 48px;
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.ai-opt-scope-panel .ai-account-picker-popover {
  z-index: 260;
  border-radius: var(--radius-sm);
}

.ai-opt-schedule-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.ai-opt-schedule-footer span:first-child {
  color: var(--ink);
}

.ai-opt-hidden-check {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.ai-opt-auto-grid,
.ai-opt-auto-expanded-grid,
.ai-opt-diagnosis-layout,
.ai-opt-rules-grid,
.ai-opt-safety-lists {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.ai-opt-progress-card,
.ai-opt-auto-panel,
.ai-opt-config-panel,
.ai-opt-queue-panel,
.ai-opt-rules-panel,
.ai-opt-table-panel,
.ai-opt-detail-panel,
.ai-opt-safety-lists section {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 12px;
}

.ai-opt-progress-head,
.ai-opt-queue-head {
  justify-content: space-between;
}

.ai-opt-progress-head span,
.ai-opt-queue-head span,
.ai-opt-panel-head,
.ai-opt-safety-row span,
.ai-opt-log-row span:not(.platform-mark) {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ai-opt-progress-head strong,
.ai-opt-queue-head strong,
.ai-opt-panel-head strong,
.ai-opt-safety-lists h3,
.ai-opt-log-row strong {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.ai-opt-progress-head small,
.ai-opt-queue-head small,
.ai-opt-panel-head span,
.ai-opt-safety-row small,
.ai-opt-log-row small,
.ai-opt-log-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ai-opt-progress-track {
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.ai-opt-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #34c759);
}

.ai-opt-data-pull-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 12px;
}

.ai-opt-pull-topline,
.ai-opt-pull-bottomline {
  display: grid;
  align-items: center;
  min-width: 0;
}

.ai-opt-pull-topline {
  grid-template-columns: minmax(180px, 1.35fr) repeat(5, minmax(104px, 0.72fr));
  gap: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.ai-opt-pull-bottomline {
  grid-template-columns: repeat(4, minmax(118px, 0.78fr)) minmax(156px, 0.92fr) max-content;
  gap: 0;
}

.ai-opt-pull-progress,
.ai-opt-pull-stat,
.ai-opt-pull-status {
  display: grid;
  gap: 4px;
  min-width: 0;
  min-height: 54px;
  align-content: center;
  padding: 0 14px;
  border-left: 1px solid var(--line);
}

.ai-opt-pull-progress {
  border-left: 0;
  padding-left: 0;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
}

.ai-opt-pull-progress span,
.ai-opt-pull-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.ai-opt-pull-progress strong {
  color: var(--brand);
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.ai-opt-pull-progress .ai-opt-progress-track {
  grid-column: 1 / -1;
  height: 7px;
  margin-top: 2px;
}

.ai-opt-pull-stat strong {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.15;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.ai-opt-pull-stat small,
.ai-opt-pull-status small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.ai-opt-pull-stat.is-success strong {
  color: #128a3a;
}

.ai-opt-pull-stat.is-danger strong {
  color: var(--danger);
}

.ai-opt-pull-stat.is-warning strong {
  color: #b45f06;
}

.ai-opt-pull-stat.is-link strong {
  color: var(--brand);
}

.ai-opt-pull-status {
  justify-items: start;
}

.ai-opt-pull-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.ai-opt-pull-actions .button {
  min-height: 34px;
  border-radius: var(--radius-sm);
}

.ai-opt-pull-actions,
.ai-opt-safety-row {
  flex-wrap: wrap;
}

.ai-opt-metric-grid,
.ai-opt-safety-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 10px;
  min-width: 0;
}

.ai-opt-diagnosis-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.ai-opt-diagnosis-bucket {
  display: grid;
  gap: 4px;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.ai-opt-diagnosis-bucket:hover,
.ai-opt-diagnosis-bucket.is-active {
  border-color: rgba(0, 113, 227, 0.32);
  background: var(--brand-soft);
}

.ai-opt-diagnosis-bucket strong {
  color: var(--brand);
  font-size: 22px;
  line-height: 1;
}

.ai-opt-diagnosis-bucket span {
  font-size: 13px;
  font-weight: 900;
}

.ai-opt-diagnosis-bucket small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.ai-opt-diagnosis-strip {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.ai-opt-diagnosis-strip .ai-opt-diagnosis-bucket {
  min-height: 76px;
  padding: 10px;
}

.ai-opt-diagnosis-strip .ai-opt-diagnosis-bucket strong {
  font-size: 18px;
}

.ai-opt-diagnosis-strip .ai-opt-diagnosis-bucket small {
  display: none;
}

.ai-opt-diagnosis-layout {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  align-items: start;
}

.ai-opt-diagnosis-compact {
  grid-template-columns: 1fr;
}

.ai-opt-table-panel .ai-monitor-queue-toolbar {
  margin-bottom: 0;
}

.ai-opt-diagnosis-panel {
  gap: 12px;
}

.ai-opt-detail-panel {
  align-self: start;
}

.ai-opt-detail-panel > .ai-monitor-detail-head,
.ai-opt-detail-panel > .ai-detail-section,
.ai-opt-detail-panel > .ai-trend-evidence-panel {
  background: var(--surface);
}

.ai-opt-action-table,
.ai-opt-diagnosis-table {
  min-width: 1120px;
}

.ai-opt-issue-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(0, 113, 227, 0.18);
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.08);
  color: var(--brand);
  padding: 0 9px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.ai-opt-issue-pill.is-high_cpa,
.ai-opt-issue-pill.is-spend_anomaly,
.ai-opt-issue-pill.is-no_conversion_spend {
  border-color: rgba(217, 119, 6, 0.24);
  background: rgba(217, 119, 6, 0.1);
  color: #b45309;
}

.ai-opt-issue-pill.is-low_roas,
.ai-opt-issue-pill.is-learning_abnormal {
  border-color: rgba(220, 38, 38, 0.2);
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
}

.ai-opt-issue-pill.is-creative_fatigue {
  border-color: rgba(124, 58, 237, 0.22);
  background: rgba(124, 58, 237, 0.08);
  color: #6d28d9;
}

.ai-opt-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-opt-diagnosis-detail {
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(0, 1.4fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(0, 113, 227, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(0, 113, 227, 0.055);
  padding: 12px;
}

.ai-opt-diagnosis-detail > div,
.ai-opt-diagnosis-detail dl {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.ai-opt-diagnosis-detail strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
}

.ai-opt-diagnosis-detail small,
.ai-opt-diagnosis-detail dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.ai-opt-diagnosis-detail dl {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.ai-opt-diagnosis-detail dd {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.ai-opt-diagnosis-detail .ai-detail-action-bar {
  justify-content: flex-end;
}

.ai-opt-safety-banner {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(217, 119, 6, 0.24);
  border-radius: var(--radius-sm);
  background: rgba(217, 119, 6, 0.09);
  color: #8a4a00;
  padding: 12px;
}

.ai-opt-safety-banner.is-hard {
  border-color: rgba(220, 38, 38, 0.22);
  background: rgba(220, 38, 38, 0.08);
  color: #a01d1d;
}

.ai-opt-safety-banner strong {
  font-size: 13px;
}

.ai-opt-safety-banner span {
  font-size: 12px;
  line-height: 1.5;
}

.ai-opt-auto-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
}

.ai-opt-auto-expanded-grid {
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr) minmax(260px, 1fr);
  align-items: stretch;
}

.ai-opt-rules-grid {
  grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.35fr) minmax(260px, 0.9fr);
  align-items: start;
}

.ai-opt-analysis-form,
.ai-opt-gate-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.ai-opt-auto-panel,
.ai-opt-rules-panel {
  align-content: start;
  background: var(--surface);
}

.ai-opt-auto-strategy-list,
.ai-opt-default-rule-list,
.ai-opt-guardrail-list,
.ai-opt-safety-check-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.ai-opt-auto-strategy-list .checkbox-line,
.ai-opt-guardrail-list .checkbox-line,
.ai-opt-rule-enable,
.ai-opt-rule-card .checkbox-line {
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
}

.ai-opt-rule-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 10px;
}

.ai-opt-rule-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin: 0;
}

.ai-opt-rule-card dt,
.ai-opt-rule-card dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.ai-opt-rule-card dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.ai-opt-rule-card dd {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.ai-opt-rule-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.ai-opt-rule-fields.is-compact {
  margin-top: 2px;
}

.ai-opt-rule-fields .field.full {
  grid-column: 1 / -1;
}

.ai-opt-guardrail-note {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(0, 113, 227, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(0, 113, 227, 0.06);
  padding: 10px;
}

.ai-opt-guardrail-note strong {
  color: var(--brand);
  font-size: 12px;
}

.ai-opt-guardrail-note span {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}

.ai-opt-rules-footer,
.ai-opt-queue-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px solid rgba(0, 113, 227, 0.22);
  border-radius: var(--radius-sm);
  background: rgba(0, 113, 227, 0.055);
  padding: 10px 12px;
}

.ai-opt-rules-footer span,
.ai-opt-queue-footer span {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}

.ai-opt-queue-footer > span::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 8px 2px 0;
  border-radius: 999px;
  background: var(--brand);
}

.ai-opt-queue-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.ai-opt-threshold-grid,
.ai-opt-advanced-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ai-opt-advanced-analysis {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.ai-opt-advanced-analysis summary {
  color: var(--brand);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.ai-opt-advanced-analysis[open] {
  display: grid;
  gap: 10px;
}

.ai-opt-auth-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 3px;
}

.ai-opt-auth-toggle span {
  display: grid;
  place-items: center;
  min-height: 30px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.ai-opt-auth-toggle .is-active {
  background: #e5e7eb;
}

.ai-opt-auth-toggle .is-disabled {
  color: var(--muted);
}

.ai-opt-auth-notice {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(217, 119, 6, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(217, 119, 6, 0.09);
  padding: 10px;
}

.ai-opt-auth-notice strong {
  color: #9a5800;
  font-size: 12px;
}

.ai-opt-auth-notice span {
  color: #8a4a00;
  font-size: 12px;
  line-height: 1.45;
}

.ai-opt-auth-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ai-opt-auth-fields .field {
  position: relative;
}

.ai-opt-auth-fields .field.full {
  grid-column: 1 / -1;
}

.ai-opt-auth-fields .field small {
  position: absolute;
  right: 10px;
  bottom: 11px;
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
}

.ai-opt-auth-fields input[readonly] {
  background: var(--surface-2);
  color: var(--ink);
}

.ai-opt-safety-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  border-top: 1px solid var(--line);
  color: var(--ink);
}

.ai-opt-safety-check:first-child {
  border-top: 0;
}

.ai-opt-safety-check span {
  font-size: 12px;
  line-height: 1.35;
}

.ai-opt-safety-check strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  padding: 0 8px;
  font-size: 12px;
}

.ai-opt-safety-check.is-success strong {
  border-color: rgba(22, 163, 74, 0.2);
  background: rgba(22, 163, 74, 0.08);
  color: #15803d;
}

.ai-opt-safety-check.is-warning strong {
  border-color: rgba(217, 119, 6, 0.24);
  background: rgba(217, 119, 6, 0.1);
  color: #b45309;
}

.ai-opt-safety-check.is-danger strong {
  border-color: rgba(220, 38, 38, 0.2);
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
}

.ai-opt-safety-check.is-info strong {
  border-color: rgba(0, 113, 227, 0.2);
  background: rgba(0, 113, 227, 0.08);
  color: var(--brand);
}

.ai-opt-guardrail-dl,
.ai-strategy-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ai-opt-guardrail-dl {
  margin: 0;
}

.ai-opt-guardrail-dl div {
  display: grid;
  gap: 3px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.ai-opt-guardrail-dl dt,
.ai-opt-guardrail-dl dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.ai-opt-guardrail-dl dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.ai-opt-guardrail-dl dd {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.ai-opt-strategy-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.ai-opt-strategy-strip article {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 10px;
}

.ai-opt-strategy-strip strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.25;
}

.ai-opt-strategy-strip span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.ai-opt-queue-head {
  flex-wrap: wrap;
}

.ai-opt-safety-lists {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ai-opt-safety-row {
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.ai-opt-safety-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.ai-opt-log-list {
  display: grid;
  gap: 8px;
}

.ai-opt-log-row {
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 10px;
}

.ai-opt-log-row .platform-mark {
  flex: 0 0 auto;
}

.ai-opt-log-row .tag,
.ai-opt-log-row .status-tag {
  flex: 0 0 auto;
}

@media (max-width: 1400px) {
  .ai-opt-topbar {
    grid-template-columns: 1fr;
  }

  .ai-opt-top-actions {
    justify-content: flex-start;
  }

  .ai-opt-strategy-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .ai-opt-workspace,
  .ai-opt-workspace.is-nav-collapsed,
  .ai-opt-auto-grid,
  .ai-opt-auto-expanded-grid,
  .ai-opt-diagnosis-layout,
  .ai-opt-rules-grid,
  .ai-opt-safety-lists {
    grid-template-columns: 1fr;
  }

  .ai-opt-module-nav {
    position: static;
  }

  .ai-opt-workspace.is-nav-collapsed .ai-opt-module-nav-head strong,
  .ai-opt-workspace.is-nav-collapsed .ai-opt-module-nav nav button span,
  .ai-opt-workspace.is-nav-collapsed .ai-opt-module-nav nav button small {
    display: initial;
  }

  .ai-opt-workspace.is-nav-collapsed .ai-opt-module-nav nav button {
    justify-content: space-between;
    padding: 0 8px;
  }

  .ai-opt-workspace.is-nav-collapsed .ai-opt-module-nav nav button::before {
    content: none;
  }

  .ai-opt-scope-panel,
  .ai-opt-custom-window {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1280px) {
  .ai-opt-pull-bottomline {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .ai-opt-pull-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    margin-top: 10px;
    padding: 10px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 980px) {
  .ai-opt-schedule-row,
  .ai-opt-schedule-row.is-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-opt-pull-topline,
  .ai-opt-pull-bottomline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-opt-pull-progress,
  .ai-opt-pull-stat,
  .ai-opt-pull-status {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 10px 0 0;
  }

  .ai-opt-pull-progress,
  .ai-opt-pull-topline .ai-opt-pull-stat:nth-child(2),
  .ai-opt-pull-bottomline .ai-opt-pull-stat:first-child {
    border-top: 0;
    padding-top: 0;
  }

  .ai-opt-schedule-preview {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 10px 0 0;
  }

  .ai-opt-schedule-actions {
    align-self: end;
  }
}

@media (max-width: 780px) {
  .ai-opt-topbar,
  .ai-opt-module-body {
    padding: 12px;
  }

  .ai-opt-status-grid,
  .ai-opt-metric-grid,
  .ai-opt-safety-grid,
  .ai-opt-diagnosis-summary,
  .ai-opt-diagnosis-detail,
  .ai-opt-guardrail-dl,
  .ai-opt-strategy-strip,
  .ai-opt-rule-fields,
  .ai-opt-auth-fields,
  .ai-opt-threshold-grid,
  .ai-opt-advanced-grid {
    grid-template-columns: 1fr;
  }

  .ai-opt-top-actions,
  .ai-opt-pull-actions {
    align-items: stretch;
  }

  .ai-opt-top-actions .button,
  .ai-opt-pull-actions .button,
  .ai-opt-automation-switch {
    width: 100%;
  }

  .ai-opt-schedule-row,
  .ai-opt-schedule-row.is-secondary {
    grid-template-columns: 1fr;
  }

  .ai-opt-schedule-actions,
  .ai-opt-schedule-actions .button {
    width: 100%;
  }

  .ai-opt-schedule-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

.ads-control-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.045);
}

.ads-control-hero-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.ads-control-title-row,
.ads-control-hero-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ads-control-hero h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.16;
  letter-spacing: 0;
}

.ads-control-hero .eyebrow {
  margin: 0;
}

.ads-control-hero-status {
  color: var(--muted);
  font-size: 12px;
}

.ads-control-api-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
}

.ads-control-api-pill.is-live {
  border-color: rgba(16, 185, 129, 0.28);
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
}

.ads-control-hero-actions,
.ads-control-row-actions,
.ads-control-rule-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ads-control-hero-actions {
  justify-content: flex-end;
  align-items: center;
}

.ads-control-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(3, minmax(140px, 1fr)) minmax(240px, 1.6fr);
  gap: 12px;
  align-items: end;
}

.ads-control-search {
  grid-column: span 2;
}

.ads-control-filter-submit {
  min-width: 92px;
}

.ads-control-custom-date.is-hidden {
  display: none;
}

.ads-control-kpis {
  margin: 18px 0;
}

.ads-control-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.ads-control-table-head {
  gap: 16px;
  align-items: center;
}

.ads-control-bulkbar {
  display: grid;
  grid-template-columns: minmax(160px, auto) minmax(280px, 1fr);
  gap: 10px 14px;
  align-items: center;
  margin: 12px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.ads-control-bulk-summary {
  display: grid;
  gap: 2px;
}

.ads-control-bulk-summary strong {
  color: var(--text);
  font-size: 13px;
}

.ads-control-bulk-summary span,
.ads-control-bulk-budget p,
.ads-control-ai-head span {
  color: var(--muted);
  font-size: 12px;
}

.ads-control-bulk-controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.ads-control-bulk-controls select,
.ads-control-bulk-budget select,
.ads-control-bulk-budget input {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
}

.ads-control-bulk-budget {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(150px, 180px) minmax(180px, 240px) minmax(240px, 1fr);
  gap: 10px;
  align-items: end;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.ads-control-bulk-budget label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.ads-control-check-col {
  width: 44px;
  text-align: center;
}

.ads-control-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.ads-control-level-tabs {
  justify-content: flex-end;
}

.ads-control-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.ads-control-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.ads-control-table th,
.ads-control-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.ads-control-table th {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-2);
}

.ads-control-row {
  cursor: pointer;
}

.ads-control-row:hover,
.ads-control-row.is-selected {
  background: rgba(37, 99, 235, 0.06);
}

.ads-control-object {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: calc(var(--depth, 0) * 18px);
}

.ads-control-object strong,
.ads-control-detail h2 {
  display: block;
  color: var(--text);
}

.ads-control-object small,
.ads-control-status-cell small,
.ads-control-task small,
.ads-control-task span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.ads-control-level-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(100, 116, 139, 0.12);
  flex: 0 0 auto;
}

.ads-control-level-dot.campaign {
  background: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.ads-control-level-dot.adset {
  background: #0f766e;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
}

.ads-control-level-dot.ad {
  background: #9333ea;
  box-shadow: 0 0 0 4px rgba(147, 51, 234, 0.14);
}

.ads-control-status-cell {
  display: grid;
  gap: 4px;
}

.ads-control-detail-panel {
  position: sticky;
  top: 18px;
}

.ads-control-detail h2 {
  margin: 4px 0 14px;
  font-size: 20px;
}

.ads-control-kv {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.ads-control-kv span {
  color: var(--muted);
}

.ads-control-kv strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ads-control-rule-list {
  margin: 14px 0;
}

.ads-control-inspector-tabs {
  display: flex;
  gap: 8px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.ads-control-ai-panel {
  display: grid;
  gap: 12px;
}

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

.ads-control-ai-source {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ads-control-ai-source small {
  color: var(--muted);
  font-size: 12px;
}

.ads-control-ai-head > div {
  display: grid;
  gap: 3px;
}

.ads-control-ai-list {
  display: grid;
  gap: 10px;
}

.ads-control-ai-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.ads-control-ai-card.is-saved {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.ads-control-ai-card.is-medium {
  border-color: #fed7aa;
  background: #fffaf2;
}

.ads-control-ai-card.is-high {
  border-color: #fecaca;
  background: #fff7f7;
}

.ads-control-ai-card.is-drafted {
  border-color: rgba(36, 107, 253, 0.3);
  background: #f8fbff;
}

.ads-control-ai-card.is-rejected {
  opacity: 0.68;
  background: #f8fafc;
}

.ads-control-ai-card > div:first-child {
  display: grid;
  gap: 2px;
}

.ads-control-ai-card strong {
  color: var(--text);
}

.ads-control-ai-card span,
.ads-control-ai-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.ads-control-ai-account-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8 !important;
  padding: 3px 8px;
  font-weight: 700;
}

.ads-control-ai-evidence,
.ads-control-ai-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.ads-control-ai-actions {
  justify-content: space-between;
}

.ads-control-ai-inline-error {
  padding: 9px 10px;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  background: #fff7ed;
  color: #92400e;
  font-size: 12px;
}

.ads-control-ai-skeleton {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.ads-control-ai-skeleton span {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e5e7eb, #f8fafc, #e5e7eb);
  background-size: 200% 100%;
  animation: ads-control-skeleton 1.2s linear infinite;
}

.ads-control-ai-skeleton span:nth-child(1) {
  width: 72%;
}

.ads-control-ai-skeleton span:nth-child(2) {
  width: 92%;
}

.ads-control-ai-skeleton span:nth-child(3) {
  width: 58%;
}

@keyframes ads-control-skeleton {
  to {
    background-position-x: -200%;
  }
}

.ads-control-ai-draft-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 3px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
}

.ads-control-issues {
  display: grid;
  gap: 8px;
}

.ads-control-issues p {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.08);
  color: #92400e;
}

.ads-control-task-list {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.ads-control-task {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.ads-control-account-field {
  position: relative;
}

.ads-control-account-trigger {
  min-height: 38px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  text-align: left;
}

.ads-control-account-trigger strong,
.ads-control-account-trigger small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-control-account-trigger strong {
  font-size: 13px;
}

.ads-control-account-trigger small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.ads-control-account-picker-caret {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid #64748b;
  border-bottom: 1.5px solid #64748b;
  transform: rotate(45deg) translateY(-2px);
}

.ads-control-account-badge {
  min-height: 28px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.ads-control-account-badge small {
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
}

.ads-control-account-detail {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.ads-control-change-account-group {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.ads-control-change-account-group h3 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
}

.ads-control-change-account-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ads-control-account-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  width: min(360px, 92vw);
  padding: 12px;
  border: 1px solid rgba(203, 213, 225, 0.92);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
}

.ads-control-account-popover input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
}

.ads-control-account-popover-actions {
  display: flex;
  justify-content: space-between;
  margin: 10px 0;
}

.ads-control-account-popover-actions button {
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.ads-control-account-options {
  max-height: 280px;
  overflow: auto;
  display: grid;
  gap: 4px;
}

.ads-control-account-option {
  width: 100%;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 8px;
  color: var(--text);
  text-align: left;
}

.ads-control-account-option:hover,
.ads-control-account-option.is-selected {
  background: rgba(37, 99, 235, 0.07);
}

.ads-control-account-option strong,
.ads-control-account-option small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-control-account-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.ads-control-account-check {
  width: 18px;
  height: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 12px;
  line-height: 1;
}

.ads-control-account-option.is-selected .ads-control-account-check {
  border-color: var(--brand);
  background: var(--brand);
}

.ads-control-account-badge {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 6px 8px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--text);
  text-align: left;
}

.ads-control-account-badge strong,
.ads-control-account-badge small,
.ads-control-ai-account-badge {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-control-account-badge strong {
  font-size: 12px;
}

.ads-control-account-badge small {
  color: var(--muted);
  font-size: 11px;
}

.ads-control-table {
  table-layout: fixed;
  min-width: 1480px;
}

.ads-control-check-col-width {
  width: 40px;
}

.ads-control-tree-col-width {
  width: 34px;
}

.ads-control-object-col-width {
  width: 300px;
}

.ads-control-status-col-width {
  width: 156px;
}

.ads-control-budget-col-width {
  width: 150px;
}

.ads-control-metric-col-width {
  width: 106px;
}

.ads-control-actions-col-width {
  width: 220px;
}

.ads-control-tree-col {
  text-align: center;
}

.ads-control-tree-toggle {
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: #475569;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.ads-control-lazy-state-row td {
  background: #f8fafc;
}

.ads-control-lazy-state {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding-left: calc(var(--depth, 0) * 22px);
  color: #64748b;
  font-size: 12px;
}

.ads-control-lazy-state span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-control-table th,
.ads-control-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.ads-control-object {
  min-width: 0;
}

.ads-control-object > div {
  min-width: 0;
}

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

.ads-control-status-cell {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 4px;
  min-width: 0;
}

.ads-control-status-cell .tag,
.ads-control-status-cell .delivery-badge {
  width: max-content;
  max-width: 100%;
  white-space: nowrap;
}

.ads-control-status-cell small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-control-metric-cell {
  color: #0f172a;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ads-control-row-actions {
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: flex-start;
}

.ads-control-row-actions .compact-button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 11px;
}

.ads-control-inspector-stack {
  display: grid;
  gap: 12px;
}

.ads-control-detail-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.ads-control-detail-metrics span {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.ads-control-detail-metrics small,
.ads-control-task-composer-head span,
.ads-control-task-empty p,
.ads-control-draft-summary small,
.ads-control-validation-card span,
.ads-control-validation-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.ads-control-detail-metrics strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 13px;
}

.ads-control-task-composer {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 12px;
  background: #f8fbff;
}

.ads-control-task-composer-head,
.ads-control-draft-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.ads-control-task-draft {
  display: grid;
  gap: 10px;
}

.ads-control-draft-summary {
  display: grid;
  gap: 4px;
}

.ads-control-draft-groups {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.06);
}

.ads-control-draft-groups strong,
.ads-control-draft-groups span,
.ads-control-draft-groups small {
  font-size: 12px;
}

.ads-control-draft-groups span,
.ads-control-draft-groups small {
  color: var(--muted);
}

.ads-control-budget-resolution {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(14, 165, 233, 0.18);
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.07);
}

.ads-control-budget-resolution strong,
.ads-control-budget-resolution span,
.ads-control-budget-resolution small {
  font-size: 12px;
}

.ads-control-budget-resolution span,
.ads-control-budget-resolution small {
  color: var(--muted);
}

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

.ads-control-draft-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.ads-control-draft-grid input,
.ads-control-draft-grid select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #ffffff;
  padding: 0 10px;
}

.ads-control-draft-checks {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 10px;
  background: rgba(255, 251, 235, 0.86);
}

.ads-control-draft-checks label {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 8px;
  margin: 0;
  color: #92400e;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.ads-control-draft-checks input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
}

.ads-control-inline-error {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
  font-size: 12px;
  font-weight: 800;
}

.ads-control-validation-card {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(16, 185, 129, 0.24);
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.08);
}

.ads-control-validation-card.is-blocked {
  border-color: rgba(239, 68, 68, 0.22);
  background: rgba(239, 68, 68, 0.07);
}

@media (max-width: 1180px) {
  .ads-control-workspace,
  .ads-control-filters {
    grid-template-columns: 1fr;
  }

  .ads-control-search,
  .ads-control-filter-submit {
    grid-column: auto;
  }

  .ads-control-bulkbar,
  .ads-control-bulk-budget {
    grid-template-columns: 1fr;
  }

  .ads-control-bulk-controls {
    justify-content: flex-start;
  }

  .ads-control-detail-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .ads-control-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .ads-control-level-tabs {
    justify-content: flex-start;
  }
}

/* Ads Control final pass: sticky object/actions columns and custom dropdowns. */
.ads-control-table-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: auto;
  border-radius: 12px;
}

.ads-control-table {
  width: 100%;
  min-width: 1720px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.ads-control-check-col-width {
  width: 42px;
}

.ads-control-tree-col-width {
  width: 36px;
}

.ads-control-object-col-width {
  width: 330px;
}

.ads-control-status-col-width {
  width: 150px;
}

.ads-control-budget-col-width {
  width: 160px;
}

.ads-control-metric-col-width {
  width: 112px;
}

.ads-control-actions-col-width {
  width: 210px;
}

.ads-control-table th,
.ads-control-table td {
  background: #ffffff;
}

.ads-control-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fbfcff;
}

.ads-control-table th {
  position: relative;
}

.ads-control-table th:nth-child(1),
.ads-control-table td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 6;
}

.ads-control-table th:nth-child(2),
.ads-control-table td:nth-child(2) {
  position: sticky;
  left: 42px;
  z-index: 6;
}

.ads-control-table th:nth-child(3),
.ads-control-table td:nth-child(3) {
  position: sticky;
  left: 78px;
  z-index: 6;
  box-shadow: 12px 0 18px rgba(15, 23, 42, 0.04);
}

.ads-control-table th:last-child,
.ads-control-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 6;
  box-shadow: -12px 0 18px rgba(15, 23, 42, 0.05);
}

.ads-control-table thead th:nth-child(-n + 3),
.ads-control-table thead th:last-child {
  z-index: 8;
  background: #fbfcff;
}

.ads-control-data-col {
  user-select: none;
}

.ads-control-static-col {
  user-select: none;
}

.ads-control-data-col.is-dragging {
  opacity: 0.58;
}

.ads-control-data-col.is-drop-target {
  background: #eef6ff !important;
  box-shadow: inset 3px 0 0 var(--brand);
}

.ads-control-column-header-button {
  appearance: none;
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) 12px;
  gap: 6px;
  align-items: center;
  padding: 0;
  text-align: left;
  font: inherit;
}

.ads-control-static-column-header {
  display: flex;
  align-items: center;
  min-width: 0;
  padding-right: 8px;
}

.ads-control-static-column-header span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-control-column-header-button:hover .ads-control-column-label,
.ads-control-data-col.is-sorted .ads-control-column-label {
  color: var(--brand);
}

.ads-control-column-grip {
  width: 10px;
  height: 16px;
  border-radius: 4px;
  opacity: 0.42;
  cursor: grab;
  background-image: radial-gradient(circle, #94a3b8 1px, transparent 1.5px);
  background-size: 4px 4px;
}

.ads-control-data-col.is-dragging .ads-control-column-grip {
  cursor: grabbing;
}

.ads-control-column-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-control-sort-indicator {
  width: 12px;
  height: 12px;
  display: grid;
  place-items: center;
  color: #64748b;
}

.ads-control-sort-indicator::before {
  content: "";
  display: block;
}

.ads-control-sort-indicator[data-sort-state="none"]::before {
  width: 6px;
  height: 6px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  opacity: 0.45;
  transform: translateY(-1px) rotate(45deg);
}

.ads-control-sort-indicator[data-sort-state="asc"]::before {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 6px solid var(--brand);
}

.ads-control-sort-indicator[data-sort-state="desc"]::before {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid var(--brand);
}

.ads-control-column-resize {
  position: absolute;
  top: 8px;
  right: -4px;
  bottom: 8px;
  width: 9px;
  cursor: col-resize;
  z-index: 12;
  touch-action: none;
}

.ads-control-column-resize::after {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: 2px;
  border-radius: 999px;
  background: transparent;
  transition: background 140ms ease, box-shadow 140ms ease;
}

.ads-control-column-resize:hover::after,
.ads-control-column-resize.is-active::after,
.ads-control-table.is-column-resizing .ads-control-column-resize.is-active::after {
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

body.ads-control-column-resizing {
  cursor: col-resize;
  user-select: none;
}

.ads-control-table.is-column-resizing th,
.ads-control-table.is-column-resizing td {
  transition: none;
}

.ads-control-row:hover td {
  background: #f8fbff;
}

.ads-control-row.is-selected td {
  background: #eef5ff;
}

.ads-control-object {
  max-width: 100%;
}

.ads-control-object strong {
  white-space: normal;
  line-height: 1.2;
}

.ads-control-object small {
  max-width: 100%;
}

.ads-control-row-actions {
  display: flex;
  width: 100%;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
}

.ads-control-row-actions .compact-button {
  min-width: 0;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 11px;
  white-space: nowrap;
}

.ads-control-field-cell,
.ads-control-metric-cell {
  font-size: 12px;
  line-height: 1.25;
  color: #0f172a;
  white-space: nowrap;
}

.ads-control-stacked-cell {
  display: grid;
  gap: 2px;
  min-width: 0;
  font-size: 12px;
  line-height: 1.2;
}

.ads-control-stacked-cell strong,
.ads-control-stacked-cell small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-control-stacked-cell strong {
  color: #0f172a;
  font-weight: 700;
}

.ads-control-stacked-cell small {
  color: #64748b;
  font-size: 11px;
}

.ads-control-bulkbar,
.ads-control-bulk-controls,
.ads-control-bulk-budget,
.ads-control-task-composer,
.ads-control-draft-grid,
.ads-control-detail-panel,
.ads-control-main-panel {
  overflow: visible;
}

.ads-control-select-field {
  position: relative;
  min-width: 0;
}

.ads-control-dropdown {
  position: relative;
  min-width: 148px;
}

.ads-control-dropdown-trigger {
  width: 100%;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  text-align: left;
}

.ads-control-dropdown-trigger:hover {
  border-color: #b9d4ff;
  background: #f8fbff;
}

.ads-control-dropdown-trigger:disabled {
  cursor: not-allowed;
  color: #94a3b8;
  background: #f8fafc;
}

.ads-control-dropdown.is-open .ads-control-dropdown-trigger {
  border-color: #0a84ff;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.14);
}

.ads-control-dropdown-caret,
.ads-control-account-picker-caret {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid #64748b;
  border-bottom: 1.5px solid #64748b;
  transform: rotate(45deg);
  flex: 0 0 auto;
}

.ads-control-dropdown-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 90;
  width: max-content;
  min-width: 100%;
  max-width: min(360px, 88vw);
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.14);
}

.ads-control-dropdown-option {
  width: 100%;
  min-height: 36px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #0f172a;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  text-align: left;
  white-space: nowrap;
}

.ads-control-dropdown-option:hover {
  background: #f1f7ff;
}

.ads-control-dropdown-option.is-selected {
  background: #e8f2ff;
  color: #075ec5;
  font-weight: 800;
}

.ads-control-dropdown-mark {
  color: #0a84ff;
  font-weight: 900;
  text-align: center;
}

.ads-control-bulk-dropdown {
  min-width: 124px;
}

.ads-control-bulk-budget .ads-control-dropdown,
.ads-control-draft-grid .ads-control-dropdown {
  min-width: 100%;
}

.ads-control-account-popover {
  border-color: rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.14);
}

.ads-control-account-popover input {
  border-radius: 10px;
  box-shadow: 0 0 0 0 transparent;
}

.ads-control-account-option {
  min-height: 42px;
  border-radius: 10px;
  transition: background 0.16s ease, color 0.16s ease;
}

.ads-control-account-option:hover {
  background: #f1f7ff;
}

.ads-control-account-option.is-selected {
  background: #e8f2ff;
}

.ads-control-account-option.is-selected strong {
  color: #075ec5;
}

/* Ads Control account picker: wide dropdown, virtualized rows, and selected drawer. */
.ads-control-account-field {
  min-width: 360px;
  flex: 1.7 1 520px;
  z-index: 120;
}

.ads-control-account-trigger {
  min-height: 42px;
  border-radius: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.ads-control-account-trigger:hover,
.ads-control-account-trigger:focus-visible,
.ads-control-account-trigger.is-open {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(24, 119, 242, 0.12);
  outline: 0;
}

.ads-control-account-trigger-value {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.ads-control-account-placeholder {
  display: grid;
  gap: 2px;
  min-width: 0;
}

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

.ads-control-account-placeholder strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.ads-control-account-placeholder small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.ads-control-account-chip {
  min-width: 0;
  max-width: 100%;
  min-height: 28px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: #eef6ff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 800;
}

.ads-control-account-chip > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-control-account-chip button {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0;
  background: rgba(15, 23, 42, 0.08);
  color: #64748b;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  line-height: 1;
}

.ads-control-account-chip button:hover,
.ads-control-account-chip button:focus-visible {
  outline: 0;
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
}

.ads-control-account-chip.is-overflow {
  border-color: #0f172a;
  background: #fff;
  cursor: pointer;
}

.ads-control-account-popover {
  z-index: 180;
  width: min(680px, calc(100vw - 32px));
  overflow: hidden;
  padding: 0;
  border-radius: 14px;
  border-color: rgba(148, 163, 184, 0.38);
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.18);
}

.ads-control-account-search {
  display: grid;
  gap: 5px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.ads-control-account-search span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.ads-control-account-search input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
  outline: 0;
}

.ads-control-account-search input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.1);
}

.ads-control-account-popover-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 10px;
}

.ads-control-account-popover-actions span {
  min-width: 0;
  flex: 1 1 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ads-control-account-popover-actions button {
  border: 0;
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(15, 23, 42, 0.06);
  color: #475569;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.ads-control-account-popover-actions button:hover:not(:disabled),
.ads-control-account-popover-actions button:focus-visible:not(:disabled) {
  outline: 0;
  background: #e8f2ff;
  color: #075ec5;
}

.ads-control-account-popover-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.ads-control-account-options.is-virtual,
.ads-control-account-options.is-drawer {
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 6px;
}

.ads-control-account-options.is-virtual {
  contain: content;
}

.ads-control-account-virtual-spacer {
  flex: 0 0 auto;
}

.ads-control-account-option {
  grid-template-columns: 22px minmax(0, 1fr) auto;
  width: 100%;
  height: 122px;
  min-height: 122px;
  align-items: start;
  gap: 10px;
  margin: 0 0 4px;
  padding: 10px;
}

.ads-control-account-check {
  margin-top: 4px;
}

.ads-control-account-option-copy {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}

.ads-control-account-option-copy strong,
.ads-control-account-option-copy small {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.ads-control-account-title-line {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ads-control-account-title-line strong,
.ads-control-account-title-line small {
  overflow-wrap: anywhere;
}

.ads-control-account-title-line small {
  color: var(--muted);
}

.ads-control-account-source-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.ads-control-account-source-label {
  flex: 0 0 auto;
  min-width: 48px;
  padding-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.ads-control-account-source-chips {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

.ads-control-account-source-chip {
  min-width: 0;
  max-width: 100%;
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(0, 113, 227, 0.08);
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.ads-control-account-source-chip.is-personal {
  background: rgba(14, 165, 233, 0.12);
  color: #0369a1;
}

.ads-control-account-source-chip.is-bm {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

.ads-control-account-status {
  justify-self: end;
  align-self: start;
  border-radius: 999px;
  padding: 4px 8px;
  background: #f2f4f7;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.ads-control-account-status.is-active {
  background: #dcfce7;
  color: #15803d;
}

.ads-control-account-status.is-disabled {
  background: #fee2e2;
  color: #b91c1c;
}

.ads-control-account-status.is-unsettled {
  background: #ffedd5;
  color: #c2410c;
}

.ads-control-account-status.is-warning {
  background: #fef3c7;
  color: #a16207;
}

.ads-control-account-empty {
  margin: 0;
  padding: 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.ads-control-account-drawer-portal {
  position: relative;
  z-index: 340;
}

.ads-control-account-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 340;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(3px);
}

.ads-control-account-drawer {
  width: min(460px, calc(100vw - 32px));
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0;
  padding: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: -24px 0 60px rgba(15, 23, 42, 0.22);
  color: var(--text);
}

.ads-control-account-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
}

.ads-control-account-drawer-header div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ads-control-account-drawer-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ads-control-account-drawer-header strong {
  font-size: 20px;
  line-height: 1.15;
}

.ads-control-account-drawer-header button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.07);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}

.ads-control-account-drawer-header button:hover,
.ads-control-account-drawer-header button:focus-visible {
  outline: 0;
  background: rgba(15, 23, 42, 0.12);
  color: var(--text);
}

.ads-control-account-drawer-results {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.ads-control-account-drawer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 30px;
  align-items: start;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  margin: 0 0 4px;
  border-radius: 10px;
  padding: 10px;
  background: #f7f8fb;
}

.ads-control-account-drawer-row:hover {
  background: #f2f5f9;
}

.ads-control-account-drawer-remove {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  font-size: 18px;
  font-weight: 750;
  line-height: 1;
}

.ads-control-account-drawer-remove:hover,
.ads-control-account-drawer-remove:focus-visible {
  outline: 0;
  background: rgba(15, 23, 42, 0.08);
  color: var(--text);
}

@media (max-width: 720px) {
  .ads-control-account-field {
    min-width: 0;
    flex-basis: 100%;
  }

  .ads-control-account-popover {
    width: min(680px, calc(100vw - 24px));
  }

  .ads-control-account-popover-actions {
    flex-wrap: wrap;
  }
}

body[data-view="adsControl"] {
  overflow-x: hidden;
}

body[data-view="adsControl"] .view-partial-content,
body[data-view="adsControl"] .ads-control-workspace,
body[data-view="adsControl"] .ads-control-main-panel,
body[data-view="adsControl"] .ads-control-detail-panel,
body[data-view="adsControl"] .ads-control-kpis,
body[data-view="adsControl"] .ads-control-filters {
  min-width: 0;
  max-width: 100%;
}

/* Apple-inspired usability pass */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-3: #eef1f6;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --subtle: #8e8e93;
  --line: #e5e5ea;
  --line-strong: #d1d1d6;
  --brand: #0071e3;
  --brand-dark: #0066cc;
  --brand-soft: #e8f2ff;
  --teal: #0a84ff;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.06);
  --focus-ring: 0 0 0 3px rgba(0, 113, 227, 0.18);
}

html {
  background: var(--bg);
}

body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(245, 245, 247, 0.96) 260px),
    var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  letter-spacing: 0;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.app-shell {
  grid-template-columns: 220px minmax(0, 1fr) 344px;
}

.sidebar {
  padding: 14px 10px;
  background: rgba(255, 255, 255, 0.86);
  border-right: 1px solid rgba(229, 229, 234, 0.86);
  backdrop-filter: blur(18px);
}

.brand-row,
.brand-lockup,
.brand-copy,
.toolbar-group,
.system-status,
.primary-tools {
  display: flex;
  align-items: center;
}

.brand-row {
  min-height: 46px;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px 10px;
  border-bottom: 1px solid rgba(229, 229, 234, 0.82);
}

.brand-lockup {
  min-width: 0;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(145deg, #0a84ff, #0071e3);
  box-shadow: 0 8px 18px rgba(0, 113, 227, 0.18);
  font-size: 15px;
}

.brand-copy {
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.brand-copy strong,
.brand-copy span {
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy strong {
  font-size: 15px;
  line-height: 1.2;
}

.brand-copy span {
  color: var(--muted);
  font-size: 12px;
}

.sidebar-collapse-toggle {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.sidebar-collapse-toggle:hover {
  background: #f2f2f7;
  color: var(--ink);
}

.sidebar-collapse-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 160ms ease;
}

.nav-list {
  gap: 12px;
  padding-top: 12px;
}

.nav-section {
  display: grid;
  gap: 3px;
}

.nav-label {
  margin: 8px 10px 3px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-transform: none;
}

.nav-item {
  min-height: 36px;
  padding: 0 9px;
  border-radius: 8px;
  color: #62666f;
  font-size: 13px;
  font-weight: 650;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.nav-item:hover {
  background: #f2f2f7;
  color: var(--ink);
}

.nav-item.is-active {
  background: #e8f2ff;
  color: var(--brand);
}

.nav-item:active,
.button:active,
.icon-button:active,
.sidebar-collapse-toggle:active {
  transform: scale(0.98);
}

.nav-icon {
  width: 20px;
  height: 20px;
  color: inherit;
  stroke-width: 1.85;
}

.sidebar-card {
  border-radius: 8px;
  background: #f5f5f7;
  border-color: rgba(209, 209, 214, 0.82);
  padding: 12px;
}

.sidebar-card strong {
  color: var(--ink);
}

.workspace {
  padding: 22px 30px 42px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  min-height: 58px;
  margin: -22px -30px 16px;
  padding: 16px 30px 12px;
  background: rgba(245, 245, 247, 0.82);
  border-bottom: 1px solid rgba(229, 229, 234, 0.74);
  backdrop-filter: blur(18px);
}

.title-stack {
  min-width: 0;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-transform: none;
}

.topbar h1 {
  color: var(--ink);
  font-size: 28px;
  font-weight: 720;
  line-height: 1.12;
}

.topbar-actions,
.toolbar-group {
  gap: 8px;
}

.toolbar-group {
  min-height: 40px;
  padding: 3px;
  border: 1px solid rgba(229, 229, 234, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
}

.button,
.icon-button,
.api-switch,
.compact-button,
.task-mini-action,
.pull-button,
.facebook-button {
  min-height: 36px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.task-mini .task-mini-action {
  min-height: 30px;
  border-radius: 999px;
}

.button-primary,
.facebook-button {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 113, 227, 0.18);
}

.button-primary:hover,
.facebook-button:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.button-secondary,
.icon-button {
  background: #ffffff;
  border-color: rgba(209, 209, 214, 0.88);
  color: var(--ink);
}

.button-secondary:hover,
.icon-button:hover {
  background: #f5f5f7;
  border-color: rgba(142, 142, 147, 0.48);
}

.button-soft {
  background: var(--brand-soft);
  border-color: #cfe5ff;
  color: var(--brand);
}

.button svg,
.icon-action svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.9;
}

.api-switch {
  gap: 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
}

.api-switch-track {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #d1d1d6;
  transition: background 140ms ease;
}

.api-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
  transition: transform 140ms ease;
}

.api-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.api-switch input:checked ~ .api-switch-track {
  background: #34c759;
}

.api-switch input:checked ~ .api-switch-track::after {
  transform: translateX(14px);
}

.panel,
.table-panel,
.form-panel,
.metric-card,
.linked-panel,
.asset-table-panel,
.task-mini,
.modal-card {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(229, 229, 234, 0.95);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.035);
}

.metric-card:hover,
.panel:hover,
.table-panel:hover,
.form-panel:hover {
  border-color: rgba(0, 113, 227, 0.18);
}

table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}

table tbody tr {
  transition: background 140ms ease;
}

table tbody tr:hover td {
  background: #f5faff;
}

.tag,
.delivery-badge,
.task-status-chip,
.ads-insight-metric-badge,
.ai-model-status {
  border-radius: 999px;
}

.task-pool {
  width: 344px;
  background: rgba(255, 255, 255, 0.88);
  border-left: 1px solid rgba(229, 229, 234, 0.86);
  backdrop-filter: blur(18px);
  padding: 16px 14px;
}

.task-pool-head {
  color: var(--muted);
  letter-spacing: 0;
  font-size: 12px;
}

.task-pool-toggle {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}

.task-pool-toggle:hover {
  background: #f2f2f7;
  color: var(--ink);
}

.task-tabs {
  gap: 5px;
}

.task-tabs button {
  min-height: 28px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 650;
}

.task-tabs button:hover {
  background: #f2f2f7;
  color: var(--ink);
}

.task-tabs button.is-active,
.task-tabs.secondary button.is-active {
  background: #e8f2ff;
  color: var(--brand);
}

.task-mini {
  background: #ffffff;
  border-color: rgba(229, 229, 234, 0.95);
  min-height: 88px;
  padding: 12px 12px 16px;
}

.task-mini:hover {
  border-color: rgba(0, 113, 227, 0.2);
}

.toast {
  border-radius: 8px;
  background: rgba(29, 29, 31, 0.94);
  backdrop-filter: blur(12px);
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 72px minmax(0, 1fr) 344px;
}

body.sidebar-collapsed .sidebar {
  align-items: center;
  padding-inline: 4px;
}

body.sidebar-collapsed .brand-row {
  justify-content: center;
}

body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-item span,
body.sidebar-collapsed .sidebar-card {
  display: none;
}

body.sidebar-collapsed .sidebar-collapse-toggle svg {
  transform: rotate(180deg);
}

body.sidebar-collapsed .brand-mark {
  width: 36px;
  height: 36px;
}

body.sidebar-collapsed .nav-list {
  width: 100%;
}

body.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 0;
}

body.sidebar-collapsed .sidebar-utilities {
  width: 100%;
  justify-content: center;
  gap: 4px;
}

body.sidebar-collapsed .language-switcher {
  flex: 1 1 0;
  min-width: 0;
  max-width: 30px;
}

body.sidebar-collapsed .language-toggle {
  min-width: 0;
  width: 100%;
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 0;
}

body.sidebar-collapsed .theme-toggle {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  max-width: 30px;
}

body.sidebar-collapsed .language-current,
body.sidebar-collapsed .language-caret {
  display: none;
}

body.sidebar-collapsed .language-menu {
  left: 0;
  width: 156px;
}

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

@media (max-width: 760px) {
  .topbar {
    margin: -18px -18px 14px;
    padding: 14px 18px 12px;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .topbar-actions,
  .toolbar-group {
    width: 100%;
    justify-content: stretch;
  }

  .toolbar-group {
    flex-wrap: wrap;
  }

  .primary-tools .button,
  .primary-tools .icon-action {
    flex: 1 1 auto;
  }

  body.sidebar-collapsed .brand-copy,
  body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed .nav-item span,
  body.sidebar-collapsed .sidebar-card {
    display: block;
  }

  body.sidebar-collapsed .brand-copy {
    display: flex;
  }

  body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed .nav-item span {
    display: inline;
  }

  body.sidebar-collapsed .app-shell {
    grid-template-columns: 1fr;
  }
}

.ads-control-inline-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 28px;
  padding: 3px 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ads-control-inline-edit:hover,
.ads-control-inline-edit.has-draft {
  border-color: rgba(36, 107, 253, 0.28);
  background: rgba(36, 107, 253, 0.06);
}

.ads-control-inline-edit:disabled {
  cursor: not-allowed;
  color: var(--muted);
  background: transparent;
}

.ads-control-inline-edit.is-blocked {
  cursor: help;
  color: var(--muted);
  background: transparent;
}

.ads-control-inline-edit.is-blocked:hover {
  border-color: rgba(217, 119, 6, 0.28);
  background: #fff7ed;
  color: #92400e;
}

.ads-control-inline-edit small {
  color: #246bfd;
  font-size: 11px;
}

.ads-control-inline-edit.is-editing {
  padding: 0;
  background: transparent;
}

.ads-control-inline-edit input,
.ads-control-inline-edit select {
  width: min(220px, 100%);
  min-height: 30px;
  border: 1px solid rgba(36, 107, 253, 0.45);
  border-radius: 6px;
  padding: 4px 8px;
  font: inherit;
}

.ads-control-inline-edit button {
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  padding: 0 8px;
}

.ads-control-name-edit {
  font-weight: 700;
}

.ads-control-switch {
  width: 38px;
  height: 22px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #d7dce5;
  padding: 2px;
  cursor: pointer;
}

.ads-control-switch span {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  transition: transform 0.16s ease;
}

.ads-control-switch.is-on {
  border-color: #1f9d55;
  background: #24b263;
}

.ads-control-switch.is-on span {
  transform: translateX(16px);
}

.ads-control-switch.has-draft {
  outline: 2px solid rgba(245, 158, 11, 0.25);
}

.ads-control-draft-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
}

.ads-control-draft-bar > div {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ads-control-draft-bar span {
  color: var(--muted);
  font-size: 12px;
}

.ads-control-change-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 60;
  width: min(460px, 100vw);
  height: 100vh;
  padding: 18px;
  overflow: auto;
  border-left: 1px solid var(--border);
  background: var(--surface);
  box-shadow: -18px 0 40px rgba(15, 23, 42, 0.16);
}

.ads-control-change-drawer-head,
.ads-control-publish-summary {
  display: flex;
  gap: 10px;
}

.ads-control-change-drawer-head {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.ads-control-change-drawer-head div,
.ads-control-change-object-head > div,
.ads-control-change-row-copy {
  display: grid;
  gap: 3px;
}

.ads-control-change-drawer-head span,
.ads-control-change-item small {
  color: var(--muted);
  font-size: 12px;
}

.ads-control-change-list {
  display: grid;
  gap: 18px;
}

.ads-control-change-list h3 {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--muted);
}

.ads-control-change-item {
  display: grid;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.ads-control-change-item.is-high {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.08);
}

.ads-control-change-item.is-blocked {
  border-color: rgba(220, 38, 38, 0.45);
  background: rgba(220, 38, 38, 0.06);
}

.ads-control-change-item p {
  margin: 0;
  font-size: 13px;
}

.ads-control-change-object-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ads-control-change-object-head .tag {
  flex: 0 0 auto;
}

.ads-control-change-field-list {
  display: grid;
  gap: 8px;
}

.ads-control-change-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.88);
}

.ads-control-change-row.is-high {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.08);
}

.ads-control-change-row.is-blocked {
  border-color: rgba(220, 38, 38, 0.42);
  background: rgba(220, 38, 38, 0.06);
}

.ads-control-change-row-copy {
  min-width: 0;
}

.ads-control-change-row-copy span {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.ads-control-change-row-copy .ads-control-change-source {
  color: #2563eb;
}

.ads-control-change-row-copy p {
  overflow-wrap: anywhere;
}

.ads-control-change-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.ads-control-publish-modal .modal-card {
  max-width: 720px;
  max-height: min(86vh, 860px);
  overflow: auto;
}

.ads-control-publish-summary {
  flex-wrap: wrap;
  margin: 10px 0 14px;
}

.ads-control-publish-summary span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--muted);
}

.ads-control-publish-risk-note,
.ads-control-review-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.ads-control-publish-risk-note {
  padding: 10px;
  border: 1px solid rgba(245, 158, 11, 0.36);
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.08);
  color: #92400e;
  font-size: 12px;
  font-weight: 700;
}

.ads-control-review-list {
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.ads-control-review-list h3 {
  margin: 8px 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.ads-control-publish-confirm-line {
  margin-top: 12px;
}

.ads-control-draft-bar.is-publishing {
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(37, 99, 235, 0.06);
}

.ads-control-draft-publish-status {
  color: #1d4ed8;
  font-weight: 800;
}

.ads-control-publishing-banner,
.ads-control-submit-state,
.ads-control-task-kind {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.06);
  color: #1e3a8a;
  font-size: 12px;
}

.ads-control-publishing-banner strong,
.ads-control-submit-state strong,
.ads-control-task-kind strong {
  color: #172554;
  font-size: 13px;
}

.ads-control-status-cell {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  min-width: 118px;
}

.ads-control-status-cell > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ads-control-status-cell .tag,
.ads-control-status-cell .delivery-badge {
  width: max-content;
  max-width: 100%;
  white-space: nowrap;
}

.ads-control-status-cell small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-control-inline-edit {
  min-width: 0;
}

.ads-control-inline-edit > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-control-inline-edit.is-editing {
  position: relative;
  z-index: 8;
  width: max-content;
  max-width: none;
  min-width: 220px;
  padding: 3px;
  border: 1px solid rgba(36, 107, 253, 0.18);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.ads-control-inline-edit.is-editing input,
.ads-control-inline-edit.is-editing select {
  flex: 1 0 120px;
  width: 120px;
  max-width: none;
  min-width: 120px;
  font-variant-numeric: tabular-nums;
}

.ads-control-inline-edit.is-editing.ads-control-inline-edit-field-budget,
.ads-control-inline-edit.is-editing.ads-control-inline-edit-field-number {
  min-width: 270px;
}

.ads-control-inline-edit.is-editing.ads-control-inline-edit-field-budget input,
.ads-control-inline-edit.is-editing.ads-control-inline-edit-field-number input {
  flex-basis: 150px;
  width: 150px;
  min-width: 150px;
}

.ads-control-inline-edit.is-editing.ads-control-inline-edit-field-time {
  min-width: 300px;
}

.ads-control-inline-edit.is-editing.ads-control-inline-edit-field-time input {
  flex-basis: 170px;
  width: 170px;
  min-width: 170px;
}

.ads-control-inline-edit.is-editing.ads-control-inline-edit-field-name {
  min-width: min(360px, calc(100vw - 132px));
}

.ads-control-inline-edit.is-editing.ads-control-inline-edit-field-name input {
  flex-basis: 220px;
  width: 220px;
  min-width: 220px;
}

.ads-control-inline-edit.is-editing button {
  flex: 0 0 auto;
  min-width: 44px;
  padding: 0 7px;
  font-size: 11px;
  white-space: nowrap;
}

.ads-control-detail-draft-card {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(36, 107, 253, 0.28);
  border-radius: 8px;
  background: rgba(36, 107, 253, 0.06);
}

.ads-control-detail-draft-card.is-high {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.08);
}

.ads-control-detail-draft-card.is-blocked {
  border-color: rgba(220, 38, 38, 0.45);
  background: rgba(220, 38, 38, 0.06);
}

.ads-control-detail-draft-card > div {
  display: grid;
  gap: 3px;
}

.ads-control-detail-draft-card span,
.ads-control-detail-draft-card small {
  color: var(--muted);
  font-size: 12px;
}

.view-partial-campaigns:has(.ads-control-draft-bar),
.view-partial-content:has(.ads-control-draft-bar) {
  padding-bottom: 92px;
}

.ads-control-row:has(.ads-control-inline-edit.is-editing) td,
.ads-control-row:has(.ads-control-inline-edit.is-editing) .ads-control-object,
.ads-control-row:has(.ads-control-inline-edit.is-editing) .ads-control-object > div {
  overflow: visible;
}

.ads-control-row:has(.ads-control-inline-edit-field-name.is-editing) td:nth-child(3) {
  z-index: 14;
}

.ads-control-draft-bar {
  position: fixed;
  left: 76px;
  right: 368px;
  bottom: 18px;
  z-index: 80;
  margin-top: 0;
}

body.task-pool-collapsed .ads-control-draft-bar {
  right: 80px;
}

@media (max-width: 860px) {
  .ads-control-draft-bar {
    left: 12px;
    right: 12px;
    bottom: 12px;
    align-items: flex-start;
    flex-direction: column;
  }

  .view-partial-campaigns:has(.ads-control-draft-bar),
  .view-partial-content:has(.ads-control-draft-bar) {
    padding-bottom: 150px;
  }
}

/* Restore the original right-side Task Pool rail. Keep this late in the
   cascade so Ads Control utility styles cannot collapse the shell panel. */
:root {
  --task-width: 360px;
  --task-collapsed-width: 56px;
}

.app-shell {
  grid-template-columns: 220px minmax(0, 1fr) var(--task-width);
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 72px minmax(0, 1fr) var(--task-width);
}

body.task-pool-collapsed .app-shell {
  grid-template-columns: 220px minmax(0, 1fr) var(--task-collapsed-width);
}

body.sidebar-collapsed.task-pool-collapsed .app-shell {
  grid-template-columns: 72px minmax(0, 1fr) var(--task-collapsed-width);
}

.task-pool {
  position: sticky;
  top: 0;
  z-index: 30;
  width: var(--task-width);
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  padding: 16px 14px;
  border-left: 1px solid rgba(229, 229, 234, 0.86);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.task-pool-head {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
}

.task-pool-toggle {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  padding: 0 6px;
  text-align: left;
}

.task-pool-toggle strong {
  font-size: 12px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.task-pool-body {
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.task-pool-collapsed-summary {
  display: none;
}

body.task-pool-collapsed .task-pool {
  width: var(--task-collapsed-width);
  align-items: center;
  padding: 12px 8px;
}

body.task-pool-collapsed .task-pool-head {
  width: 100%;
}

body.task-pool-collapsed .task-pool-toggle {
  min-height: 112px;
  width: 100%;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 0;
}

body.task-pool-collapsed .task-pool-toggle strong {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.14em;
}

body.task-pool-collapsed .task-pool-caret {
  transform: rotate(180deg);
}

body.task-pool-collapsed .task-tabs,
body.task-pool-collapsed .task-list-mini,
body.task-pool-collapsed .task-pool-foot,
body.task-pool-collapsed .task-pool-empty {
  display: none;
}

body.task-pool-collapsed .task-pool-body {
  width: 100%;
  align-items: center;
  justify-content: flex-start;
}

body.task-pool-collapsed .task-pool-collapsed-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  color: var(--muted);
  font-size: 12px;
}

body.task-pool-collapsed .task-pool-collapsed-summary strong {
  color: var(--ink);
  font-size: 14px;
}

.ads-control-draft-bar {
  right: calc(var(--task-width) + 24px);
}

body.task-pool-collapsed .ads-control-draft-bar {
  right: calc(var(--task-collapsed-width) + 24px);
}

:root[data-theme="dark"] body {
  background: var(--bg);
  color: var(--ink);
}

:root[data-theme="dark"] .sidebar,
:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .task-pool {
  background: rgba(17, 23, 32, 0.92);
  border-color: rgba(66, 80, 102, 0.78);
}

:root[data-theme="dark"] .brand-row {
  border-color: rgba(66, 80, 102, 0.82);
}

:root[data-theme="dark"] .brand-lockup,
:root[data-theme="dark"] .topbar h1,
:root[data-theme="dark"] .sidebar-card strong {
  color: var(--ink);
}

:root[data-theme="dark"] .nav-item {
  color: #b9c2d1;
}

:root[data-theme="dark"] .nav-item:hover,
:root[data-theme="dark"] .sidebar-collapse-toggle:hover,
:root[data-theme="dark"] .task-pool-toggle:hover,
:root[data-theme="dark"] .task-tabs button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

:root[data-theme="dark"] .nav-item.is-active,
:root[data-theme="dark"] .task-tabs button.is-active,
:root[data-theme="dark"] .task-tabs.secondary button.is-active {
  background: rgba(106, 167, 255, 0.16);
  color: var(--brand);
}

:root[data-theme="dark"] .language-option {
  color: var(--ink);
}

:root[data-theme="dark"] .language-option:hover,
:root[data-theme="dark"] .language-option[aria-checked="true"] {
  background: rgba(106, 167, 255, 0.16);
  color: var(--brand);
}

:root[data-theme="dark"] .sidebar-card,
:root[data-theme="dark"] .language-menu,
:root[data-theme="dark"] .toolbar-group,
:root[data-theme="dark"] .status-strip article,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .table-panel,
:root[data-theme="dark"] .form-panel,
:root[data-theme="dark"] .metric-card,
:root[data-theme="dark"] .linked-panel,
:root[data-theme="dark"] .asset-table-panel,
:root[data-theme="dark"] .task-mini,
:root[data-theme="dark"] .modal-card,
:root[data-theme="dark"] .creative-group,
:root[data-theme="dark"] .creative-results-panel,
:root[data-theme="dark"] .creative-upload-panel,
:root[data-theme="dark"] .ads-control-inline-edit.is-editing {
  background: rgba(23, 28, 37, 0.96);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

:root[data-theme="dark"] .panel:hover,
:root[data-theme="dark"] .table-panel:hover,
:root[data-theme="dark"] .form-panel:hover,
:root[data-theme="dark"] .metric-card:hover {
  border-color: rgba(106, 167, 255, 0.36);
}

:root[data-theme="dark"] .button-secondary,
:root[data-theme="dark"] .icon-button,
:root[data-theme="dark"] .compact-button,
:root[data-theme="dark"] .language-toggle,
:root[data-theme="dark"] .theme-toggle,
:root[data-theme="dark"] .task-mini-action,
:root[data-theme="dark"] .pull-button,
:root[data-theme="dark"] .creative-hero-actions .button-secondary {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--ink);
}

:root[data-theme="dark"] .task-mini-action.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

:root[data-theme="dark"] .task-mini-action.primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

:root[data-theme="dark"] .task-mini-action.danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(248, 113, 113, 0.36);
  color: #fca5a5;
}

:root[data-theme="dark"] .task-mini-action.danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(248, 113, 113, 0.52);
}

:root[data-theme="dark"] .button-secondary:hover,
:root[data-theme="dark"] .icon-button:hover,
:root[data-theme="dark"] .compact-button:hover,
:root[data-theme="dark"] .language-toggle:hover,
:root[data-theme="dark"] .language-switcher.is-open .language-toggle,
:root[data-theme="dark"] .theme-toggle:hover,
:root[data-theme="dark"] .creative-hero-actions .button-secondary:hover {
  background: var(--surface-3);
  border-color: var(--line-strong);
}

:root[data-theme="dark"] .button-soft,
:root[data-theme="dark"] .tag,
:root[data-theme="dark"] .delivery-badge,
:root[data-theme="dark"] .task-status-chip,
:root[data-theme="dark"] .ads-insight-metric-badge {
  background: var(--brand-soft);
  border-color: rgba(106, 167, 255, 0.24);
  color: var(--brand);
}

:root[data-theme="dark"] .tag.success,
:root[data-theme="dark"] .delivery-badge.is-success,
:root[data-theme="dark"] .task-status-chip.is-success {
  background: rgba(74, 222, 128, 0.16);
  color: #86efac;
}

:root[data-theme="dark"] .tag.warning,
:root[data-theme="dark"] .delivery-badge.is-warning,
:root[data-theme="dark"] .task-status-chip.is-warning {
  background: rgba(251, 191, 36, 0.16);
  color: #fcd34d;
}

:root[data-theme="dark"] .tag.danger,
:root[data-theme="dark"] .delivery-badge.is-danger,
:root[data-theme="dark"] .task-status-chip.is-danger {
  background: rgba(248, 113, 113, 0.16);
  color: #fca5a5;
}

:root[data-theme="dark"] .business-source-chip {
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
}

:root[data-theme="dark"] .business-source-chip.is-personal {
  border-color: rgba(96, 165, 250, 0.55);
  background: rgba(59, 130, 246, 0.18);
  color: #bfdbfe;
}

:root[data-theme="dark"] .business-source-chip.is-partner {
  border-color: rgba(96, 165, 250, 0.55);
  background: rgba(59, 130, 246, 0.2);
  color: #bfdbfe;
}

:root[data-theme="dark"] .business-source-chip.is-overflow {
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field select,
:root[data-theme="dark"] .field textarea,
:root[data-theme="dark"] .asset-search-input,
:root[data-theme="dark"] .account-label-input,
:root[data-theme="dark"] .modal-search-field input,
:root[data-theme="dark"] .ads-control-inline-edit input,
:root[data-theme="dark"] .ads-control-inline-edit select {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--ink);
}

:root[data-theme="dark"] .field input:focus,
:root[data-theme="dark"] .field select:focus,
:root[data-theme="dark"] .field textarea:focus,
:root[data-theme="dark"] .asset-search-input:focus,
:root[data-theme="dark"] .account-label-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(106, 167, 255, 0.16);
}

:root[data-theme="dark"] .ads-insight-date-button,
:root[data-theme="dark"] .ads-insight-date-popover {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--ink);
}

:root[data-theme="dark"] .ads-insight-date-popover {
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.42);
}

:root[data-theme="dark"] .ads-insight-month > strong,
:root[data-theme="dark"] .ads-insight-day {
  color: var(--ink);
}

:root[data-theme="dark"] .ads-insight-day:hover,
:root[data-theme="dark"] .ads-insight-day:focus-visible {
  background: rgba(106, 167, 255, 0.14);
  color: var(--brand);
}

:root[data-theme="dark"] .ads-insight-day.is-in-range {
  background: rgba(45, 212, 191, 0.16);
  color: #5eead4;
}

:root[data-theme="dark"] .ads-insight-day.is-selected {
  background: var(--brand);
  color: #08111f;
}

:root[data-theme="dark"] table th,
:root[data-theme="dark"] .template-table th,
:root[data-theme="dark"] .linked-table th,
:root[data-theme="dark"] .modal-table th,
:root[data-theme="dark"] .asset-ad-table thead th,
:root[data-theme="dark"] .asset-linked-table thead th,
:root[data-theme="dark"] .asset-pages-table thead th,
:root[data-theme="dark"] .asset-business-table thead th,
:root[data-theme="dark"] .ads-insight-table thead th,
:root[data-theme="dark"] .ads-control-table thead th {
  background: var(--surface-2);
  color: var(--muted);
  border-color: var(--line);
}

:root[data-theme="dark"] table td,
:root[data-theme="dark"] .template-table td,
:root[data-theme="dark"] .linked-table td,
:root[data-theme="dark"] .modal-table td,
:root[data-theme="dark"] .asset-ad-table td,
:root[data-theme="dark"] .asset-linked-table td,
:root[data-theme="dark"] .asset-pages-table td,
:root[data-theme="dark"] .asset-business-table td,
:root[data-theme="dark"] .ads-insight-table td,
:root[data-theme="dark"] .ads-control-table td {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

:root[data-theme="dark"] table tbody tr:hover td,
:root[data-theme="dark"] .ads-insight-table tbody tr:hover td,
:root[data-theme="dark"] .ads-control-table tbody tr:hover td,
:root[data-theme="dark"] .asset-ad-table tr:nth-child(even) td,
:root[data-theme="dark"] .asset-linked-table tr:nth-child(even) td,
:root[data-theme="dark"] .asset-pages-table tr:nth-child(even) td,
:root[data-theme="dark"] .asset-business-table tr:nth-child(even) td,
:root[data-theme="dark"] .linked-table tr:nth-child(even) td {
  background: var(--surface-2);
}

:root[data-theme="dark"] .ads-insight-table .ads-insight-sticky-cell,
:root[data-theme="dark"] .ads-insight-table th.ads-insight-sticky-cell,
:root[data-theme="dark"] .ads-insight-table td.ads-insight-sticky-cell,
:root[data-theme="dark"] .ads-control-table th.is-sticky,
:root[data-theme="dark"] .ads-control-table td.is-sticky,
:root[data-theme="dark"] .ads-control-table thead th:nth-child(-n + 3),
:root[data-theme="dark"] .ads-control-table thead th:last-child {
  background: var(--surface-2);
}

:root[data-theme="dark"] .modal-backdrop {
  background: rgba(0, 0, 0, 0.62);
}

:root[data-theme="dark"] .modal-source-note,
:root[data-theme="dark"] .empty-state,
:root[data-theme="dark"] .ads-control-detail-draft-card,
:root[data-theme="dark"] .ads-control-detail-draft-card.is-high,
:root[data-theme="dark"] .ads-control-detail-draft-card.is-blocked {
  background: var(--surface-2);
  border-color: var(--line);
}

:root[data-theme="dark"] .toast {
  background: rgba(8, 12, 18, 0.96);
  color: var(--ink);
  border: 1px solid var(--line);
}

:root[data-theme="dark"] .api-switch-track {
  background: #4b5563;
}

:root[data-theme="dark"] .api-switch-track::after,
:root[data-theme="dark"] .campaign-status-toggle-thumb {
  background: #f8fafc;
}

:root[data-theme="dark"] .creative-hero,
:root[data-theme="dark"] .creative-hero-v2,
:root[data-theme="dark"] .creative-filter-row,
:root[data-theme="dark"] .creative-search-row,
:root[data-theme="dark"] .ads-control-filter-grid .field,
:root[data-theme="dark"] .ads-control-table-head,
:root[data-theme="dark"] .ads-control-account-badge,
:root[data-theme="dark"] .ads-control-change-account-group,
:root[data-theme="dark"] .ads-control-draft-bar {
  background: var(--surface);
  border-color: var(--line);
}

/* Dark theme coverage for newer asset-heavy modules. */
:root[data-theme="dark"] .creative-hero.creative-hero-v2,
:root[data-theme="dark"] .creative-business-group.bm-card,
:root[data-theme="dark"] .creative-account-list,
:root[data-theme="dark"] .creative-upload-queue,
:root[data-theme="dark"] .creative-local-folders,
:root[data-theme="dark"] .upload-preview-item,
:root[data-theme="dark"] .creative-local-folder-assets,
:root[data-theme="dark"] .drop-zone,
:root[data-theme="dark"] .asset-pages-panel,
:root[data-theme="dark"] .products-hero,
:root[data-theme="dark"] .products-panel,
:root[data-theme="dark"] .products-summary-grid span,
:root[data-theme="dark"] .product-filter select,
:root[data-theme="dark"] .product-card,
:root[data-theme="dark"] .product-detail summary,
:root[data-theme="dark"] .product-linked-app,
:root[data-theme="dark"] .product-event-grid > div,
:root[data-theme="dark"] .product-pill-cloud span,
:root[data-theme="dark"] .product-muted-box,
:root[data-theme="dark"] .product-item-preview,
:root[data-theme="dark"] .product-diagnostics article,
:root[data-theme="dark"] .product-readiness-list span,
:root[data-theme="dark"] .product-metrics span,
:root[data-theme="dark"] .ai-model-console,
:root[data-theme="dark"] .ai-model-toolbar,
:root[data-theme="dark"] .ai-model-filter-group,
:root[data-theme="dark"] .ai-model-provider-segments,
:root[data-theme="dark"] .ai-model-list-panel,
:root[data-theme="dark"] .ai-model-detail-panel,
:root[data-theme="dark"] .ai-model-logs,
:root[data-theme="dark"] .ai-model-row,
:root[data-theme="dark"] .ai-model-empty,
:root[data-theme="dark"] .ai-model-log-row,
:root[data-theme="dark"] .admin-debug-panel,
:root[data-theme="dark"] .admin-debug-body {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: none;
}

:root[data-theme="dark"] .creative-account-list,
:root[data-theme="dark"] .creative-local-folder-assets,
:root[data-theme="dark"] .product-detail summary,
:root[data-theme="dark"] .product-linked-app,
:root[data-theme="dark"] .product-event-grid > div,
:root[data-theme="dark"] .product-pill-cloud span,
:root[data-theme="dark"] .product-muted-box,
:root[data-theme="dark"] .product-item-preview,
:root[data-theme="dark"] .product-diagnostics article,
:root[data-theme="dark"] .product-readiness-list span,
:root[data-theme="dark"] .product-metrics span,
:root[data-theme="dark"] .ai-model-toolbar,
:root[data-theme="dark"] .ai-model-filter-group,
:root[data-theme="dark"] .ai-model-provider-segments,
:root[data-theme="dark"] .ai-model-row,
:root[data-theme="dark"] .ai-model-empty,
:root[data-theme="dark"] .ai-model-log-row,
:root[data-theme="dark"] .admin-debug-body {
  background: var(--surface-2);
}

:root[data-theme="dark"] .creative-hero h2,
:root[data-theme="dark"] .creative-master-title,
:root[data-theme="dark"] .creative-section-toggle strong,
:root[data-theme="dark"] .creative-group-name strong,
:root[data-theme="dark"] .creative-account-name,
:root[data-theme="dark"] .creative-upload-queue-head strong,
:root[data-theme="dark"] .creative-local-folders-head strong,
:root[data-theme="dark"] .creative-local-folder strong,
:root[data-theme="dark"] .creative-local-folder-asset strong,
:root[data-theme="dark"] .drop-zone strong,
:root[data-theme="dark"] .business-name-cell strong,
:root[data-theme="dark"] .asset-detail-count,
:root[data-theme="dark"] .asset-detail-list summary,
:root[data-theme="dark"] .asset-detail-list strong,
:root[data-theme="dark"] .ad-account-label-item strong,
:root[data-theme="dark"] .business-cell strong,
:root[data-theme="dark"] .linked-assets strong,
:root[data-theme="dark"] .products-summary-grid strong,
:root[data-theme="dark"] .products-hero-copy h2,
:root[data-theme="dark"] .product-title-stack strong,
:root[data-theme="dark"] .product-checkline,
:root[data-theme="dark"] .product-detail summary strong,
:root[data-theme="dark"] .product-summary-metrics strong,
:root[data-theme="dark"] .product-info-strip strong,
:root[data-theme="dark"] .product-event-grid strong,
:root[data-theme="dark"] .product-pill-cloud span,
:root[data-theme="dark"] .product-item-preview strong,
:root[data-theme="dark"] .product-diagnostics strong,
:root[data-theme="dark"] .product-readiness-list strong,
:root[data-theme="dark"] .product-metrics strong,
:root[data-theme="dark"] .product-decision summary,
:root[data-theme="dark"] .ai-model-console-head h3,
:root[data-theme="dark"] .ai-model-panel-head strong,
:root[data-theme="dark"] .ai-model-row-main strong,
:root[data-theme="dark"] .ai-model-row-main span,
:root[data-theme="dark"] .ai-model-empty strong,
:root[data-theme="dark"] .ai-model-log-row strong,
:root[data-theme="dark"] .admin-debug-panel summary strong,
:root[data-theme="dark"] .admin-debug-body h3 {
  color: var(--ink);
}

:root[data-theme="dark"] .creative-hero span,
:root[data-theme="dark"] .creative-filter-label,
:root[data-theme="dark"] .creative-master-subtitle,
:root[data-theme="dark"] .creative-section-toggle small,
:root[data-theme="dark"] .creative-group-name small,
:root[data-theme="dark"] .creative-group-stats,
:root[data-theme="dark"] .creative-group-total,
:root[data-theme="dark"] .creative-account-button small,
:root[data-theme="dark"] .creative-account-id,
:root[data-theme="dark"] .creative-account-counts,
:root[data-theme="dark"] .creative-upload-queue-head span,
:root[data-theme="dark"] .creative-local-folders-head span,
:root[data-theme="dark"] .creative-local-folder small,
:root[data-theme="dark"] .creative-local-folder-asset small,
:root[data-theme="dark"] .creative-local-folder-meta,
:root[data-theme="dark"] .upload-preview-copy p,
:root[data-theme="dark"] .drop-zone span,
:root[data-theme="dark"] .asset-detail-list small,
:root[data-theme="dark"] .ad-account-label-item small,
:root[data-theme="dark"] .business-cell small,
:root[data-theme="dark"] .linked-assets small,
:root[data-theme="dark"] .products-summary-grid small,
:root[data-theme="dark"] .product-filter span,
:root[data-theme="dark"] .products-hero-copy p,
:root[data-theme="dark"] .products-hero-copy span,
:root[data-theme="dark"] .product-title-stack small,
:root[data-theme="dark"] .product-card-top,
:root[data-theme="dark"] .product-card-stat,
:root[data-theme="dark"] .product-summary-metrics,
:root[data-theme="dark"] .product-info-strip small,
:root[data-theme="dark"] .product-info-strip em,
:root[data-theme="dark"] .product-section-label,
:root[data-theme="dark"] .product-pill-cloud em,
:root[data-theme="dark"] .product-muted-box,
:root[data-theme="dark"] .product-item-preview small,
:root[data-theme="dark"] .product-item-preview em,
:root[data-theme="dark"] .product-diagnostics p,
:root[data-theme="dark"] .product-diagnostics small,
:root[data-theme="dark"] .product-readiness-list small,
:root[data-theme="dark"] .product-field-note,
:root[data-theme="dark"] .product-metrics small,
:root[data-theme="dark"] .product-decision p,
:root[data-theme="dark"] .ai-model-console-head p,
:root[data-theme="dark"] .ai-model-panel-head span,
:root[data-theme="dark"] .ai-model-row-main small,
:root[data-theme="dark"] .ai-model-row-meta span,
:root[data-theme="dark"] .ai-model-empty p,
:root[data-theme="dark"] .ai-model-log-row small,
:root[data-theme="dark"] .admin-debug-panel summary small,
:root[data-theme="dark"] .admin-debug-body p,
:root[data-theme="dark"] .admin-debug-status {
  color: var(--muted);
}

:root[data-theme="dark"] .creative-hero p {
  color: var(--success);
}

:root[data-theme="dark"] .creative-search-row .asset-search-input,
:root[data-theme="dark"] .creative-upload-field input,
:root[data-theme="dark"] .ai-model-search,
:root[data-theme="dark"] .ai-model-search input {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--ink);
}

:root[data-theme="dark"] .creative-segmented-control {
  background: var(--surface-2);
  border: 1px solid var(--line);
}

:root[data-theme="dark"] .creative-segment-button {
  color: var(--muted);
}

:root[data-theme="dark"] .creative-segment-button:hover,
:root[data-theme="dark"] .creative-master-toggle:hover,
:root[data-theme="dark"] .creative-section-toggle:hover,
:root[data-theme="dark"] .creative-group-head:hover,
:root[data-theme="dark"] .creative-account-button:hover,
:root[data-theme="dark"] .creative-local-folder-asset:hover,
:root[data-theme="dark"] .drop-zone:hover,
:root[data-theme="dark"] .ai-model-row:hover,
:root[data-theme="dark"] .ai-model-icon-button:hover {
  background: var(--surface-3);
  color: var(--ink);
}

:root[data-theme="dark"] .creative-segment-button.is-active,
:root[data-theme="dark"] .creative-account-button.is-active,
:root[data-theme="dark"] .creative-local-folder.is-active,
:root[data-theme="dark"] .ai-model-filter.is-active,
:root[data-theme="dark"] .ai-model-provider.is-active,
:root[data-theme="dark"] .ai-model-row.is-selected {
  background: var(--brand-soft);
  border-color: rgba(106, 167, 255, 0.34);
  color: var(--brand);
  box-shadow: none;
}

:root[data-theme="dark"] .creative-account-button,
:root[data-theme="dark"] .creative-local-folder,
:root[data-theme="dark"] .product-detail,
:root[data-theme="dark"] .product-section,
:root[data-theme="dark"] .product-card-foot,
:root[data-theme="dark"] .ai-model-row,
:root[data-theme="dark"] .ai-model-log-row {
  border-color: var(--line);
}

:root[data-theme="dark"] .master-chevron,
:root[data-theme="dark"] .card-chevron {
  color: var(--muted);
}

:root[data-theme="dark"] .creative-account-button.is-active .creative-account-name,
:root[data-theme="dark"] .creative-account-button.is-active .creative-account-id {
  color: var(--brand);
}

:root[data-theme="dark"] .empty-state.compact,
:root[data-theme="dark"] .creative-results-panel .empty-state {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--muted);
}

:root[data-theme="dark"] .asset-pages-table th:nth-child(1),
:root[data-theme="dark"] .asset-pages-table td:nth-child(1),
:root[data-theme="dark"] .asset-business-table th:nth-child(1),
:root[data-theme="dark"] .asset-business-table td:nth-child(1) {
  background: var(--surface-2);
}

:root[data-theme="dark"] .asset-pages-table tr:nth-child(even) td:nth-child(1),
:root[data-theme="dark"] .asset-business-table tr:nth-child(even) td:nth-child(1) {
  background: var(--surface-3);
}

:root[data-theme="dark"] .asset-detail-list em,
:root[data-theme="dark"] .asset-label {
  color: var(--success);
}

:root[data-theme="dark"] .used-meter > span,
:root[data-theme="dark"] .product-funnel i {
  background: var(--line-strong);
}

:root[data-theme="dark"] .product-tag,
:root[data-theme="dark"] .ai-model-status {
  background: var(--brand-soft);
  border-color: rgba(106, 167, 255, 0.26);
  color: var(--brand);
}

:root[data-theme="dark"] .product-tag.green,
:root[data-theme="dark"] .product-funnel span,
:root[data-theme="dark"] .product-metrics .target,
:root[data-theme="dark"] .product-metrics .good,
:root[data-theme="dark"] .ai-model-status.is-connected {
  background: rgba(74, 222, 128, 0.14);
  border-color: rgba(74, 222, 128, 0.28);
  color: var(--success);
}

:root[data-theme="dark"] .product-tag.warning,
:root[data-theme="dark"] .product-warning,
:root[data-theme="dark"] .product-metrics .warning,
:root[data-theme="dark"] .ai-model-inline-status.is-warning,
:root[data-theme="dark"] .ai-model-status.is-untested {
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.26);
  color: var(--warning);
}

:root[data-theme="dark"] .product-tag.danger {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.28);
  color: #fca5a5;
}

:root[data-theme="dark"] .product-tag.muted,
:root[data-theme="dark"] .ai-model-inline-status {
  background: var(--surface-3);
  border-color: var(--line);
  color: var(--muted);
}

:root[data-theme="dark"] .product-search-input,
:root[data-theme="dark"] .product-filter-button,
:root[data-theme="dark"] .product-clear-filters,
:root[data-theme="dark"] .product-dropdown-menu,
:root[data-theme="dark"] .product-business-search input,
:root[data-theme="dark"] .product-option-check,
:root[data-theme="dark"] .product-business-chip,
:root[data-theme="dark"] .products-empty-card,
:root[data-theme="dark"] .product-card-row,
:root[data-theme="dark"] .product-detail summary.product-card-row {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--ink);
}

:root[data-theme="dark"] .product-filter-button:hover,
:root[data-theme="dark"] .product-filter-button:focus-visible,
:root[data-theme="dark"] .product-clear-filters:hover,
:root[data-theme="dark"] .product-clear-filters:focus-visible,
:root[data-theme="dark"] .product-dropdown-option:hover,
:root[data-theme="dark"] .product-dropdown-option:focus-visible,
:root[data-theme="dark"] .product-business-option:hover,
:root[data-theme="dark"] .product-business-option:focus-visible,
:root[data-theme="dark"] .product-detail[open] summary.product-card-row {
  background: var(--surface-3);
}

:root[data-theme="dark"] .product-dropdown-option.is-selected,
:root[data-theme="dark"] .product-business-option.is-selected {
  background: var(--brand-soft);
  color: var(--brand);
}

:root[data-theme="dark"] .product-business-chip button {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

:root[data-theme="dark"] .products-warning-bar {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.26);
  color: var(--warning);
}

:root[data-theme="dark"] .products-warning-copy small,
:root[data-theme="dark"] .products-warning-details summary,
:root[data-theme="dark"] .products-warning-details p {
  color: var(--warning);
}

:root[data-theme="dark"] .products-warning-details,
:root[data-theme="dark"] .product-detail-body {
  border-color: var(--line);
}

:root[data-theme="dark"] .ai-model-inline-status.is-danger,
:root[data-theme="dark"] .ai-model-status.is-failed {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.26);
  color: var(--danger);
}

:root[data-theme="dark"] .oauth-note,
:root[data-theme="dark"] .warning-panel,
:root[data-theme="dark"] .ai-assistant-panel,
:root[data-theme="dark"] .ai-assistant-message,
:root[data-theme="dark"] .ai-assistant-prompts button,
:root[data-theme="dark"] .ai-assistant-input-row textarea,
:root[data-theme="dark"] .ads-control-ai-card,
:root[data-theme="dark"] .ads-control-ai-card.is-saved,
:root[data-theme="dark"] .ads-control-ai-card.is-drafted,
:root[data-theme="dark"] .ads-control-ai-card.is-rejected {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--ink);
}

:root[data-theme="dark"] .oauth-note code,
:root[data-theme="dark"] .ai-assistant-head .ai-assistant-config,
:root[data-theme="dark"] .ai-assistant-action-feedback {
  background: var(--surface-3);
  border-color: var(--line);
  color: var(--ink);
}

:root[data-theme="dark"] .danger-note,
:root[data-theme="dark"] .ai-assistant-head .ai-assistant-config.is-missing,
:root[data-theme="dark"] .ai-assistant-action-feedback.is-error,
:root[data-theme="dark"] .ads-control-ai-card.is-high {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.26);
  color: var(--danger);
}

:root[data-theme="dark"] .ai-monitor-sidebar,
:root[data-theme="dark"] .ai-monitor-status-bar,
:root[data-theme="dark"] .ai-monitor-list-panel,
:root[data-theme="dark"] .ai-monitor-detail-panel,
:root[data-theme="dark"] .ai-monitor-task-panel,
:root[data-theme="dark"] .ai-monitor-metric,
:root[data-theme="dark"] .ai-monitor-table-wrap,
:root[data-theme="dark"] .ai-recommendation-card,
:root[data-theme="dark"] .ai-evidence-grid div,
:root[data-theme="dark"] .ai-detail-section {
  background: var(--surface);
  border-color: var(--line);
}

:root[data-theme="dark"] .ai-monitor-levels label,
:root[data-theme="dark"] .ai-monitor-status-item,
:root[data-theme="dark"] .ai-strategy-card,
:root[data-theme="dark"] .ai-monitor-table th,
:root[data-theme="dark"] .ai-detail-mini-grid span,
:root[data-theme="dark"] .ai-recommendation-card,
:root[data-theme="dark"] .ai-evidence-grid div,
:root[data-theme="dark"] .ai-detail-section {
  background: var(--surface-2);
}

:root[data-theme="dark"] .ai-monitor-levels label:has(input:checked) {
  border-color: rgba(106, 167, 255, 0.42);
  background: var(--brand-soft);
  color: var(--brand);
}

:root[data-theme="dark"] .ai-recommendation-card:hover,
:root[data-theme="dark"] .ai-recommendation-card.is-active,
:root[data-theme="dark"] .ai-recommendation-row:hover,
:root[data-theme="dark"] .ai-recommendation-row.is-active {
  background: var(--brand-soft);
  border-color: rgba(106, 167, 255, 0.42);
}

:root[data-theme="dark"] .ai-monitor-notice {
  background: var(--brand-soft);
  border-color: rgba(106, 167, 255, 0.28);
  color: var(--brand);
}

:root[data-theme="dark"] .ai-monitor-notice.is-warning {
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.26);
  color: var(--warning);
}

:root[data-theme="dark"] .ai-monitor-notice.is-error {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.26);
  color: var(--danger);
}

:root[data-theme="dark"] .warning-note,
:root[data-theme="dark"] .cooldown-note,
:root[data-theme="dark"] .ai-assistant-head .ai-assistant-config.is-tested,
:root[data-theme="dark"] .ads-control-ai-card.is-medium {
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.26);
  color: var(--warning);
}

:root[data-theme="dark"] .cooldown-note strong {
  color: var(--warning);
}

:root[data-theme="dark"] .cooldown-note small {
  color: var(--muted);
}

:root[data-theme="dark"] .ai-assistant-head .ai-assistant-config.is-ready,
:root[data-theme="dark"] .ai-assistant-action-feedback.is-success {
  background: rgba(74, 222, 128, 0.14);
  border-color: rgba(74, 222, 128, 0.26);
  color: var(--success);
}

:root[data-theme="dark"] .ai-assistant-message.user {
  background: var(--brand-soft);
  border-color: rgba(106, 167, 255, 0.26);
  color: var(--ink);
}

:root[data-theme="dark"] .ai-assistant-message.assistant {
  background: var(--surface);
}

:root[data-theme="dark"] .ai-assistant-head strong,
:root[data-theme="dark"] .ads-control-ai-card strong {
  color: var(--ink);
}

:root[data-theme="dark"] .ai-assistant-head span,
:root[data-theme="dark"] .ads-control-ai-card span,
:root[data-theme="dark"] .ads-control-ai-card p {
  color: var(--muted);
}

:root[data-theme="dark"] .modal-table tr.is-search-match td {
  background: var(--brand-soft);
}

:root[data-theme="dark"] .modal-table tr.is-located td {
  background: rgba(251, 191, 36, 0.14);
  box-shadow: inset 0 1px 0 rgba(251, 191, 36, 0.26), inset 0 -1px 0 rgba(251, 191, 36, 0.26);
}

:root[data-theme="dark"] .modal-table tr.is-located td:first-child {
  box-shadow: inset 4px 0 0 var(--warning), inset 0 1px 0 rgba(251, 191, 36, 0.26), inset 0 -1px 0 rgba(251, 191, 36, 0.26);
}

:root[data-theme="dark"] .icon-close {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--ink);
}

@media (max-width: 1320px) {
  .app-shell,
  body.sidebar-collapsed .app-shell,
  body.task-pool-collapsed .app-shell,
  body.sidebar-collapsed.task-pool-collapsed .app-shell {
    grid-template-columns: 72px minmax(0, 1fr) var(--task-collapsed-width);
  }

  .task-pool {
    width: var(--task-collapsed-width);
    align-items: center;
    padding: 12px 8px;
  }

  .task-pool .task-tabs,
  .task-pool .task-list-mini,
  .task-pool .task-pool-foot,
  .task-pool .task-pool-empty {
    display: none;
  }

  .task-pool .task-pool-toggle {
    min-height: 112px;
    width: 100%;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
    padding: 8px 0;
  }

  .task-pool .task-pool-toggle strong {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.14em;
  }

  .task-pool .task-pool-body {
    width: 100%;
    align-items: center;
    justify-content: flex-start;
  }

  .task-pool .task-pool-collapsed-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    color: var(--muted);
    font-size: 12px;
  }

  .ads-control-draft-bar {
    right: calc(var(--task-collapsed-width) + 24px);
  }
}

@media (max-width: 760px) {
  .app-shell,
  body.sidebar-collapsed .app-shell,
  body.task-pool-collapsed .app-shell,
  body.sidebar-collapsed.task-pool-collapsed .app-shell {
    grid-template-columns: 1fr;
  }

  .task-pool {
    display: none;
  }

  .ads-control-draft-bar {
    right: 12px;
  }
}

/* AI Monitor trend workbench overlays. */
:root {
  --radius-control: var(--radius-sm);
  --radius-panel: var(--radius);
  --surface-muted: var(--surface-2);
  --surface-elevated: var(--surface);
  --shadow-soft: var(--shadow);
}

.ai-monitor-status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  overflow: hidden;
  padding: 0;
  border-radius: var(--radius-panel);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-soft);
}

.ai-monitor-status-item {
  flex: 1 1 108px;
  min-width: 96px;
  min-height: 58px;
  padding: 10px 12px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.ai-monitor-status-actions {
  flex: 0 0 auto;
  margin-left: auto;
  min-width: max-content;
  flex-wrap: nowrap;
  padding: 10px 12px;
  border-left: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.ai-monitor-status-actions .button {
  white-space: nowrap;
}

.ai-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.ai-select.is-open {
  z-index: 700;
}

.ai-select input[type="hidden"] {
  display: none;
}

.ai-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: max(var(--radius-control), 16px);
  padding: 0 42px 0 14px;
  background: var(--surface-muted);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  text-align: left;
  box-shadow: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.ai-select-trigger span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-select-trigger i {
  position: absolute;
  right: 16px;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 140ms ease;
}

.ai-select.is-open .ai-select-trigger i {
  transform: translateY(2px) rotate(225deg);
}

.ai-select-trigger:focus-visible,
.ai-select.is-open .ai-select-trigger {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.ai-select-menu {
  position: absolute;
  z-index: 680;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: none;
  max-height: min(312px, calc(100vh - 96px));
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: max(var(--radius-control), 16px);
  background: var(--surface-elevated);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16), 0 4px 16px rgba(15, 23, 42, 0.08);
}

.ai-monitor-sidebar .field.full .ai-select-menu {
  max-height: min(232px, 42vh);
}

.ai-select.is-open .ai-select-menu {
  display: grid;
  gap: 2px;
  z-index: 720;
}

.ai-select.is-date-select .ai-select-menu {
  max-height: min(312px, calc(100vh - 128px));
}

.ai-select-option {
  min-height: 34px;
  border: 0;
  border-radius: calc(var(--radius-control) - 2px);
  padding: 8px 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  line-height: 1.25;
  text-align: left;
}

.ai-select-option:hover,
.ai-select-option:focus-visible {
  outline: 0;
  background: var(--brand-soft);
  color: var(--brand);
}

.ai-select-option.is-active {
  background: var(--brand);
  color: #fff;
}

.ai-account-picker-field {
  position: relative;
  z-index: 20;
}

.ai-account-picker-guidance {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.ai-account-picker-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  grid-template-areas: "selected toggle";
  align-items: center;
  gap: 6px 8px;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.ai-account-picker-control:hover,
.ai-account-picker-control.is-open {
  border-color: color-mix(in srgb, var(--brand) 54%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent);
}

.ai-account-picker-search-row {
  min-width: 0;
}

.ai-account-picker-search-row input {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 0;
  border-radius: 6px;
  padding: 0 6px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  outline: 0;
}

.ai-account-picker-selected {
  grid-area: selected;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
  min-height: 26px;
  overflow: visible;
}

.ai-account-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 1 min(100%, 180px);
  max-width: 100%;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 4px 3px 9px;
  background: #f2f4f7;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.ai-account-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-account-chip button {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0;
  background: rgba(15, 23, 42, 0.08);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  line-height: 1;
}

.ai-account-chip button:hover,
.ai-account-chip button:focus-visible {
  outline: 0;
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
}

.ai-account-chip.is-unavailable {
  border: 1px solid rgba(220, 38, 38, 0.22);
  background: rgba(220, 38, 38, 0.08);
  color: #b42318;
}

.ai-account-chip.is-overflow {
  color: var(--muted);
}

button.ai-account-chip.is-overflow {
  border: 0;
  cursor: pointer;
}

button.ai-account-chip.is-overflow:hover,
button.ai-account-chip.is-overflow:focus-visible {
  outline: 0;
  background: var(--brand-soft);
  color: var(--brand);
}

.ai-account-picker-placeholder {
  color: var(--muted);
  font-size: 13px;
  line-height: 24px;
}

.ai-monitor-sidebar .ai-account-chip {
  max-width: 100%;
}

.ai-monitor-sidebar .ai-account-picker-control {
  min-width: 0;
}

.ai-account-picker-search-row input::placeholder {
  color: var(--muted);
}

.ai-account-picker-toggle {
  grid-area: toggle;
  position: relative;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.ai-account-picker-toggle:hover,
.ai-account-picker-toggle:focus-visible {
  outline: 0;
  background: var(--surface-soft);
  color: var(--brand);
}

.ai-account-picker-toggle i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: translate(-50%, -60%) rotate(45deg);
}

.ai-account-picker-control.is-open .ai-account-picker-toggle i {
  transform: translate(-50%, -35%) rotate(225deg);
}

.ai-account-picker-summary {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.ai-account-picker-summary.is-empty {
  color: var(--danger);
}

.ai-account-picker-popover {
  position: absolute;
  z-index: 260;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.16), 0 4px 16px rgba(15, 23, 42, 0.08);
}

.ai-account-picker-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
}

.ai-account-picker-actions span {
  flex: 1;
  min-width: 0;
}

.ai-account-picker-actions button {
  border: 0;
  border-radius: 8px;
  padding: 5px 8px;
  background: #f5f6f8;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.ai-account-picker-actions button:hover:not(:disabled),
.ai-account-picker-actions button:focus-visible {
  outline: 0;
  background: var(--brand-soft);
  color: var(--brand);
}

.ai-account-picker-actions button:disabled {
  opacity: 0.45;
}

.ai-account-picker-options {
  display: grid;
  gap: 2px;
  max-height: min(272px, 42vh);
  overflow-y: auto;
  padding: 6px;
}

.ai-account-option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  padding: 7px 9px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.ai-account-option:hover,
.ai-account-option:focus-visible {
  outline: 0;
  background: #f6f8fb;
}

.ai-account-option.is-selected {
  background: color-mix(in srgb, var(--brand) 10%, #fff);
}

.ai-account-checkbox {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.ai-account-option.is-selected .ai-account-checkbox {
  border-color: var(--brand);
  background: var(--brand);
}

.ai-account-option-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ai-account-option-copy strong,
.ai-account-option-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-account-option-copy strong {
  font-size: 13px;
  line-height: 1.25;
}

.ai-account-option-copy small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.ai-account-picker-empty {
  margin: 0;
  padding: 18px 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.ai-account-scope-badge,
.ai-monitor-scope-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  border-radius: 999px;
  padding: 4px 9px;
  background: #f2f4f7;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.ai-account-scope-badge small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.ai-monitor-scope-tag {
  flex: 0 1 auto;
  min-height: 30px;
}

:root[data-theme="dark"] .ai-account-picker-control,
:root[data-theme="dark"] .ai-account-picker-popover,
:root[data-theme="dark"] .ads-insight-account-scope-button,
:root[data-theme="dark"] .ads-insight-account-select-control,
:root[data-theme="dark"] .ads-insight-account-popover,
:root[data-theme="dark"] .ads-insight-account-drawer,
:root[data-theme="dark"] .ads-insight-account-search input {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
}

:root[data-theme="dark"] .ads-insight-account-select-control.is-pending {
  background: color-mix(in srgb, var(--brand) 14%, rgba(15, 23, 42, 0.96));
}

:root[data-theme="dark"] .ads-insight-account-search {
  border-color: rgba(148, 163, 184, 0.2);
}

:root[data-theme="dark"] .ai-account-chip,
:root[data-theme="dark"] .ai-account-scope-badge,
:root[data-theme="dark"] .ai-monitor-scope-tag,
:root[data-theme="dark"] .ai-account-picker-actions button,
:root[data-theme="dark"] .ai-account-status,
:root[data-theme="dark"] .ads-insight-account-clear-inline,
:root[data-theme="dark"] .ads-insight-account-drawer-header button {
  background: rgba(148, 163, 184, 0.14);
}

:root[data-theme="dark"] .ai-account-option:hover,
:root[data-theme="dark"] .ai-account-option:focus-visible,
:root[data-theme="dark"] .ads-insight-account-drawer-row:hover,
:root[data-theme="dark"] .ads-insight-bm-drawer-row:hover {
  background: rgba(148, 163, 184, 0.14);
}

:root[data-theme="dark"] .ads-insight-account-drawer-row,
:root[data-theme="dark"] .ads-insight-bm-drawer-row {
  border-bottom-color: rgba(15, 23, 42, 0.96);
  background: rgba(148, 163, 184, 0.08);
}

:root[data-theme="dark"] .ad-account-asset-drawer,
:root[data-theme="dark"] .ad-account-asset-search input,
:root[data-theme="dark"] .ad-account-asset-full-item {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.96);
  color: #e5edf7;
}

:root[data-theme="dark"] .ad-account-asset-drawer-header button,
:root[data-theme="dark"] .ad-account-asset-drawer-meta span,
:root[data-theme="dark"] .ad-account-asset-tabs button,
:root[data-theme="dark"] .ad-account-asset-diagnostic.is-muted,
:root[data-theme="dark"] .ad-account-asset-full-list p {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(148, 163, 184, 0.1);
}

:root[data-theme="dark"] .ad-account-asset-drawer-header strong,
:root[data-theme="dark"] .ad-account-asset-open strong,
:root[data-theme="dark"] .ad-account-asset-note strong,
:root[data-theme="dark"] .ad-account-asset-tabs button strong,
:root[data-theme="dark"] .ad-account-asset-section h3,
:root[data-theme="dark"] .ad-account-asset-full-item strong,
:root[data-theme="dark"] .ad-account-asset-drawer-meta small {
  color: #f8fafc;
}

:root[data-theme="dark"] .ad-account-asset-full-item small,
:root[data-theme="dark"] .ad-account-asset-open small,
:root[data-theme="dark"] .ad-account-asset-note small {
  color: #94a3b8;
}

:root[data-theme="dark"] .ads-insight-account-drawer-remove {
  color: #94a3b8;
}

:root[data-theme="dark"] .ads-insight-account-drawer-remove:hover,
:root[data-theme="dark"] .ads-insight-account-drawer-remove:focus-visible {
  background: rgba(148, 163, 184, 0.18);
  color: #f8fafc;
}

:root[data-theme="dark"] .ai-account-option.is-selected {
  background: color-mix(in srgb, var(--brand) 22%, rgba(15, 23, 42, 0.92));
}

:root[data-theme="dark"] .ai-account-source-chip {
  background: rgba(96, 165, 250, 0.16);
  color: #93c5fd;
}

:root[data-theme="dark"] .ai-account-source-chip.is-personal {
  background: rgba(14, 165, 233, 0.18);
  color: #7dd3fc;
}

:root[data-theme="dark"] .ai-account-source-chip.is-bm {
  background: rgba(96, 165, 250, 0.18);
  color: #bfdbfe;
}

:root[data-theme="dark"] .ai-account-status.is-active {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}

:root[data-theme="dark"] .ai-account-status.is-disabled {
  background: rgba(248, 113, 113, 0.2);
  color: #fca5a5;
}

:root[data-theme="dark"] .ai-account-status.is-unsettled {
  background: rgba(251, 146, 60, 0.2);
  color: #fdba74;
}

:root[data-theme="dark"] .ai-account-status.is-warning {
  background: rgba(250, 204, 21, 0.18);
  color: #fde68a;
}

:root[data-theme="dark"] .ai-account-status.is-neutral {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

.ai-monitor-queue-toolbar .ai-select {
  min-width: 118px;
}

.ai-monitor-queue-toolbar .ai-select.is-compact {
  justify-self: end;
  max-width: 150px;
}

.ai-monitor-queue-toolbar .ai-select.is-compact .ai-select-menu {
  left: auto;
  right: 0;
  width: max-content;
  min-width: 140px;
  max-width: min(240px, calc(100vw - 32px));
}

.ai-monitor-levels {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-monitor-levels label {
  flex: 0 1 auto;
  min-height: 36px;
  border-radius: var(--radius-control);
  border-color: var(--line);
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}

.ai-monitor-levels label:has(input:checked) {
  border-color: rgba(0, 113, 227, 0.35);
  background: var(--brand-soft);
  color: var(--brand);
}

.ai-sparkline {
  width: 108px;
  height: 34px;
}

.ai-sparkline line {
  stroke: rgba(0, 0, 0, 0.1);
}

.ai-sparkline polyline {
  stroke: var(--brand);
  stroke-width: 2;
}

.ai-sparkline.is-empty {
  width: 108px;
  height: 34px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--surface-muted);
  color: var(--subtle);
  font-size: 10px;
  font-weight: 650;
  text-transform: none;
}

.ai-trend-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ai-trend-mini-chart {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 8px;
}

.ai-trend-mini-chart div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.ai-execution-record {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.ai-execution-record span:not(.platform-mark) {
  min-width: 0;
}

.ai-execution-record small,
.ai-execution-record p {
  overflow-wrap: anywhere;
}

.ai-execution-record-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-execution-record-actions .table-link {
  white-space: nowrap;
}

.empty-state.compact {
  min-height: 108px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface-muted);
}

@media (max-width: 1180px) {
  .ai-monitor-status-item {
    flex: 1 1 calc(33.333% - 1px);
    min-width: 0;
  }

  .ai-monitor-status-actions {
    flex: 1 1 100%;
    margin-left: 0;
    justify-content: flex-start;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 780px) {
  .ai-monitor-queue-toolbar,
  .ai-trend-chart-grid {
    grid-template-columns: 1fr;
  }

  .ai-monitor-status-item {
    flex: 1 1 100%;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .ai-monitor-status-actions {
    flex: 1 1 100%;
    align-items: stretch;
  }

  .ai-monitor-status-actions .button {
    width: 100%;
  }
}
