#uc-ads-app {
  display: none;
  position: fixed;
  top: 64px;
  right: 0;
  bottom: 0;
  left: var(--uc-meta-rail, 272px);
  z-index: 2400;
  overflow: auto;
  background: #fff;
  font-family: Inter, Roboto, Helvetica, Arial, sans-serif;
  color: #1c1e21;
}

body.uc-page-ads #uc-ads-app {
  display: block;
}

body.uc-page-ads #root main > div:last-child {
  visibility: hidden !important;
  height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

body.uc-settings-open.uc-page-ads #uc-ads-app,
body.uc-connections-open.uc-page-ads #uc-ads-app {
  left: calc(var(--uc-meta-rail, 272px) + var(--uc-meta-settings, 240px));
}

body.uc-rail-collapsed.uc-page-ads #uc-ads-app {
  left: var(--uc-meta-rail-collapsed, 60px);
}

body.uc-rail-collapsed.uc-settings-open.uc-page-ads #uc-ads-app,
body.uc-rail-collapsed.uc-connections-open.uc-page-ads #uc-ads-app {
  left: calc(var(--uc-meta-rail-collapsed, 60px) + var(--uc-meta-settings, 240px));
}

.uc-ads-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px 48px;
}

.uc-ads-shell-manage {
  max-width: none;
  margin: 0;
  padding: 0 0 32px;
  background: #fff;
  min-height: 100%;
}

.uc-ads-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
}

/* Meta Ads Manager–style manage chrome */
.uc-meta-tabs-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  border-bottom: 1px solid #dadde1;
  background: #fff;
}

.uc-meta-tabs {
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
}

.uc-meta-tab {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  padding: 16px 14px 12px;
  font-size: 15px;
  font-weight: 600;
  color: #65676b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  border-radius: 8px 8px 0 0;
}

.uc-meta-tab:hover {
  background: #f2f3f5;
  color: #1c1e21;
}

.uc-meta-tab.is-active {
  color: #1877f2;
  border-bottom-color: #1877f2;
}

.uc-meta-tab-ico {
  display: none;
}

.uc-meta-sel-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  background: #e7f3ff;
  color: #1877f2;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}

.uc-meta-sel-x {
  appearance: none;
  border: 0;
  background: transparent;
  color: #1877f2;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 2px;
}

.uc-meta-date-range {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #ccd0d5;
  border-radius: 8px;
  padding: 4px 8px 4px 10px;
}

.uc-meta-date-field {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #8a8d91;
}

.uc-meta-date-field input[type="date"] {
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: #1c1e21;
  padding: 0;
  min-width: 128px;
  font-family: inherit;
}

.uc-meta-date-sep {
  color: #8a8d91;
  font-weight: 600;
  padding-top: 10px;
}

.uc-meta-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 20px 14px;
  background: linear-gradient(180deg, #f7f8fa 0%, #f0f2f5 100%);
  border-bottom: 1px solid #dadde1;
}

.uc-meta-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.uc-meta-toolbar-filters {
  justify-content: flex-start;
  gap: 10px;
}

.uc-meta-toolbar-left,
.uc-meta-toolbar-mid,
.uc-meta-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.uc-meta-btn {
  appearance: none;
  border: 1px solid #ccd0d5;
  background: #fff;
  color: #1c1e21;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.uc-meta-btn.create {
  background: #42b72a;
  border-color: #36a420;
  color: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.uc-meta-btn.create:hover:not(:disabled) {
  background: #36a420;
}

.uc-meta-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.uc-meta-account {
  min-width: 180px;
  border: 1px solid #ccd0d5;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  background: #fff;
  color: #1c1e21;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.uc-meta-search {
  flex: 1 1 220px;
  max-width: 340px;
}

.uc-meta-search input {
  width: 100%;
  border: 1px solid #ccd0d5;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.uc-meta-search input:focus,
.uc-meta-account:focus,
.uc-meta-date-field input:focus {
  outline: 2px solid #cde2fc;
  outline-offset: 1px;
  border-color: #1877f2;
}

.uc-meta-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0;
  background: #fff;
  border: 1px solid #ccd0d5;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.uc-meta-chip {
  appearance: none;
  border: 0;
  border-right: 1px solid #e4e6eb;
  background: #fff;
  color: #1c1e21;
  border-radius: 0;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.uc-meta-chip:last-child {
  border-right: 0;
}

.uc-meta-chip:hover {
  background: #f2f3f5;
}

.uc-meta-chip.is-active {
  background: #e7f3ff;
  color: #1877f2;
  box-shadow: inset 0 -2px 0 #1877f2;
}

.uc-meta-pill {
  font-size: 12px;
  font-weight: 600;
  color: #65676b;
  background: #fff;
  border: 1px solid #ccd0d5;
  border-radius: 8px;
  padding: 8px 12px;
}

.uc-meta-panel {
  background: #fff;
}

.uc-meta-loading,
.uc-meta-empty {
  padding: 28px 16px;
  color: #65676b;
  font-size: 13px;
}

.uc-meta-table-wrap {
  overflow: auto;
  max-height: calc(100vh - 280px);
  border-top: 0;
}

.uc-meta-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  color: #1c1e21;
}

.uc-meta-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f5f6f7;
  color: #65676b;
  font-weight: 600;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid #dadde1;
  white-space: nowrap;
}

.uc-meta-table tbody tr:hover td {
  background: #f7f8fa;
}

.uc-meta-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #eef0f2;
  vertical-align: middle;
  background: #fff;
}

.uc-meta-table tr.is-selected td {
  background: #e7f3ff;
}

.uc-meta-table tr.is-selected td:first-child {
  box-shadow: inset 3px 0 0 #1877f2;
}

.uc-meta-table td.num,
.uc-meta-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.uc-meta-check {
  width: 36px;
}

.uc-meta-check input {
  width: 16px;
  height: 16px;
  accent-color: #1877f2;
  cursor: pointer;
}

.uc-meta-offon-cell {
  width: 44px;
}

.uc-meta-offon {
  display: inline-flex;
  position: relative;
  width: 36px;
  height: 20px;
}

.uc-meta-offon input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.uc-meta-offon-ui {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #bcc0c4;
  position: relative;
  display: block;
}

.uc-meta-offon-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.uc-meta-offon input:checked + .uc-meta-offon-ui {
  background: #1877f2;
}

.uc-meta-offon input:checked + .uc-meta-offon-ui::after {
  transform: translateX(16px);
}

.uc-meta-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: 480px;
}

.uc-meta-thumb {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
  background: #f0f2f5;
  flex-shrink: 0;
}

.uc-meta-thumb-empty {
  display: inline-block;
  border: 1px solid #e4e6eb;
}

.uc-meta-name-link {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: #1877f2;
  font-weight: 600;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  line-height: 1.35;
}

.uc-meta-name-link:hover {
  text-decoration: underline;
}

.uc-meta-name-sub {
  color: #65676b;
  font-size: 12px;
  margin-top: 2px;
}

.uc-meta-delivery {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  white-space: nowrap;
}

.uc-meta-delivery .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #bcc0c4;
  flex-shrink: 0;
}

.uc-meta-delivery-active .dot {
  background: #31a24c;
}

.uc-meta-delivery-off .dot {
  background: #bcc0c4;
}

.uc-meta-footer {
  padding: 10px 16px;
  font-size: 12px;
  color: #65676b;
  border-top: 1px solid #e4e6eb;
  background: #fff;
}

@media (max-width: 900px) {
  .uc-meta-toolbar-row {
    align-items: stretch;
  }
  .uc-meta-search {
    max-width: none;
    flex: 1 1 100%;
  }
  .uc-meta-date-range {
    width: 100%;
    justify-content: space-between;
  }
}

.uc-ads-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  align-items: end;
}

.uc-ads-filter {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
}

.uc-ads-filter select {
  min-width: 180px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  background: #fff;
  color: #111827;
}

.uc-ads-muted {
  color: #6b7280;
  font-size: 13px;
}

.uc-ads-btn {
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.uc-ads-btn.primary {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.uc-ads-btn.ghost {
  color: #6b7280;
}

.uc-ads-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.uc-ads-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}

.uc-ads-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.uc-ads-switch-ui {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #d1d5db;
  position: relative;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.uc-ads-switch-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease;
}

.uc-ads-switch input:checked + .uc-ads-switch-ui {
  background: #059669;
}

.uc-ads-switch input:checked + .uc-ads-switch-ui::after {
  transform: translateX(18px);
}

.uc-ads-switch.is-blocked {
  cursor: not-allowed;
  color: #92400e;
}

.uc-ads-switch.is-blocked .uc-ads-switch-ui {
  background: #fcd34d;
}

.uc-ads-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.uc-ads-table th,
.uc-ads-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #f3f4f6;
}

.uc-ads-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.uc-ads-kpi {
  position: relative;
  min-width: 0;
}

.uc-ads-kpis .lbl,
.uc-ads-kpi .lbl {
  font-size: 12px;
  color: #6b7280;
}

.uc-ads-kpis .val,
.uc-ads-kpi .val {
  font-size: 22px;
  font-weight: 700;
  margin-top: 4px;
}

.uc-ads-kpi-spark {
  position: absolute;
  right: 0;
  top: 4px;
  width: 72px;
  height: 36px;
  opacity: 0.9;
  pointer-events: none;
}

.uc-ads-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 4px;
}

.uc-ads-chart-span-2 {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .uc-ads-chart-grid {
    grid-template-columns: 1fr;
  }
  .uc-ads-chart-span-2 {
    grid-column: auto;
  }
}

.uc-ads-chart-title {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 2px;
}

.uc-ads-chart-sub {
  font-size: 12px;
  color: #6b7280;
  margin: 0 0 10px;
}

.uc-ads-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 8px;
}

.uc-ads-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #4b5563;
}

.uc-ads-chart-legend-item i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.uc-ads-chart-legend-item i.is-dash {
  height: 2px;
  border-radius: 1px;
}

.uc-ads-chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.uc-ads-chart-grid-line,
.uc-ads-chart-grid {
  stroke: #e5e7eb;
  stroke-width: 1;
}

.uc-ads-chart-axis {
  fill: #9ca3af;
  font-size: 10px;
}

.uc-ads-chart-guide {
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
}

.uc-ads-chart-guide-label {
  font-size: 10px;
  font-weight: 600;
}

.uc-ads-chart-empty {
  padding: 36px 12px;
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
  border: 1px dashed #e5e7eb;
  border-radius: 10px;
  background: #fafafa;
}

.uc-ads-hbar {
  display: grid;
  gap: 10px;
}

.uc-ads-hbar-row {
  display: grid;
  grid-template-columns: minmax(90px, 28%) 1fr minmax(72px, auto);
  gap: 8px;
  align-items: center;
}

.uc-ads-hbar-label {
  font-size: 12px;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uc-ads-hbar-track {
  height: 10px;
  background: #f3f4f6;
  border-radius: 999px;
  overflow: hidden;
}

.uc-ads-hbar-fill {
  height: 100%;
  border-radius: 999px;
  min-width: 2px;
}

.uc-ads-hbar-val {
  font-size: 12px;
  color: #6b7280;
  text-align: right;
  white-space: nowrap;
}

.uc-ads-donut {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  align-items: center;
}

@media (max-width: 560px) {
  .uc-ads-donut {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

.uc-ads-donut-svg {
  width: 150px;
  height: 150px;
}

.uc-ads-donut-center {
  fill: #111827;
  font-size: 14px;
  font-weight: 700;
}

.uc-ads-donut-center-sub {
  fill: #9ca3af;
  font-size: 10px;
}

.uc-ads-donut-legend {
  display: grid;
  gap: 8px;
  width: 100%;
}

.uc-ads-donut-legend-item {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: #374151;
}

.uc-ads-donut-legend-item i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.uc-ads-donut-legend-item .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uc-ads-donut-legend-item .pct {
  color: #6b7280;
  font-variant-numeric: tabular-nums;
}

.uc-ads-banner {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 13px;
}

.uc-ads-banner.warn {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}

.uc-ads-banner.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.uc-ads-settings-lead {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.5;
  color: #4b5563;
}

.uc-ads-field {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 12px;
}

.uc-ads-field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}

.uc-ads-field-optional {
  font-weight: 500;
  color: #6b7280;
}

.uc-ads-field-hint {
  display: block;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 400;
  color: #6b7280;
}

.uc-ads-field-hint strong {
  color: #374151;
  font-weight: 600;
}

.uc-ads-field-status {
  display: block;
  font-size: 12px;
  line-height: 1.4;
  color: #065f46;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  padding: 8px 10px;
}

.uc-ads-field-status[hidden] {
  display: none;
}

.uc-ads-field input {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 14px;
}

.uc-ads-field.uc-ads-check {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
}

.uc-ads-field.uc-ads-check input {
  width: auto;
  padding: 0;
  margin-top: 3px;
}

.uc-ads-field.uc-ads-check .uc-ads-field-hint {
  margin-top: 2px;
}

.uc-ads-checklist {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.uc-ads-code {
  display: block;
  background: #111827;
  color: #e5e7eb;
  padding: 12px;
  border-radius: 8px;
  margin: 12px 0;
}

.uc-ads-steps {
  margin: 12px 0 12px 18px;
  line-height: 1.6;
}

body.uc-has-page-title #uc-ads-app .uc-ads-shell > h1 {
  display: none;
}

.uc-ads-btn.danger {
  color: #b91c1c;
  border-color: #fca5a5;
}

.uc-ads-store-status strong.ok {
  color: #047857;
}

.uc-ads-store-status strong.bad {
  color: #b91c1c;
}

.uc-ads-store-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}
