:root {
  --ads-bg: #f5f7fb;
  --ads-panel: #ffffff;
  --ads-text: #172033;
  --ads-muted: #637083;
  --ads-line: #d8e1ee;
  --ads-soft: #eef3f9;
  --ads-accent: #2563eb;
  --ads-accent-dark: #1d4ed8;
  --ads-success: #15803d;
  --ads-warning: #b45309;
  --ads-danger: #dc2626;
  --ads-shadow: 0 16px 40px rgba(15, 23, 42, .08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--ads-bg);
  color: var(--ads-text);
  font-family: Arial, Helvetica, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

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

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: .62;
}

.ads-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.ads-topbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--ads-line);
  border-radius: 8px;
  background: var(--ads-panel);
  box-shadow: var(--ads-shadow);
}

.ads-brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: var(--ads-text);
  font-weight: 800;
  text-decoration: none;
}

.ads-brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.ads-topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ads-muted);
  font-size: .92rem;
  white-space: nowrap;
}

.ads-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ads-warning);
}

.ads-status-dot.is-ok {
  background: var(--ads-success);
}

.ads-status-dot.is-error {
  background: var(--ads-danger);
}

.ads-topbar-actions,
.ads-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.ads-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--ads-line);
  border-radius: 6px;
  background: #fff;
  color: var(--ads-text);
  font-weight: 800;
  text-decoration: none;
}

.ads-button:hover,
.ads-button:focus-visible {
  border-color: #9fb2ce;
}

.ads-button:focus-visible,
.ads-tab:focus-visible,
.ads-list-item:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .22);
  outline-offset: 2px;
}

.ads-button-primary {
  border-color: var(--ads-accent);
  background: var(--ads-accent);
  color: #fff;
}

.ads-button-primary:hover,
.ads-button-primary:focus-visible {
  border-color: var(--ads-accent-dark);
  background: var(--ads-accent-dark);
}

.ads-button-secondary {
  border-color: #b9c7dc;
  background: #edf4ff;
  color: #194185;
}

.ads-button-danger {
  border-color: rgba(220, 38, 38, .32);
  background: #fff1f2;
  color: var(--ads-danger);
}

.ads-button-ghost {
  background: transparent;
}

.ads-notice,
.ads-login,
.ads-manager {
  border: 1px solid var(--ads-line);
  border-radius: 8px;
  background: var(--ads-panel);
  box-shadow: var(--ads-shadow);
}

.ads-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 18px;
  align-items: start;
  padding: 18px;
}

.ads-notice h1,
.ads-login h1,
.ads-panel-head h2,
.ads-panel-head h3 {
  margin: 0;
  line-height: 1.16;
}

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

.ads-notice-warning {
  border-color: #f5c77a;
  background: #fffbeb;
}

.ads-login {
  width: min(460px, 100%);
  margin: 42px auto 0;
  padding: 22px;
}

.ads-login form {
  display: grid;
  gap: 16px;
}

.ads-manager {
  overflow: hidden;
}

.ads-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--ads-line);
  background: #fbfdff;
}

.ads-summary div {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border-right: 1px solid var(--ads-line);
}

.ads-summary div:last-child {
  border-right: 0;
}

.ads-summary span {
  color: var(--ads-muted);
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ads-summary strong {
  font-size: 1.45rem;
}

.ads-tabs {
  display: flex;
  gap: 2px;
  padding: 0 14px;
  border-bottom: 1px solid var(--ads-line);
  background: var(--ads-soft);
}

.ads-tab {
  min-height: 46px;
  padding: 8px 16px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--ads-muted);
  font-weight: 900;
}

.ads-tab.is-active {
  border-bottom-color: var(--ads-accent);
  color: var(--ads-text);
}

.ads-panel {
  display: none;
}

.ads-panel.is-active {
  display: block;
}

.ads-workspace {
  display: grid;
  min-height: 680px;
  background: #f8fafc;
}

.ads-workspace-editor {
  grid-template-columns: 300px minmax(0, 1fr) 360px;
}

.ads-workspace-placements {
  grid-template-columns: 320px minmax(0, 1fr);
}

.ads-list-panel,
.ads-editor,
.ads-preview-panel,
.ads-json-layout {
  min-width: 0;
  padding: 16px;
  background: var(--ads-panel);
}

.ads-list-panel {
  border-right: 1px solid var(--ads-line);
}

.ads-preview-panel {
  border-left: 1px solid var(--ads-line);
}

.ads-panel-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.ads-panel-head h2 {
  font-size: 1.08rem;
}

.ads-panel-head h3 {
  font-size: .98rem;
}

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

.ads-list-item {
  display: grid;
  width: 100%;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--ads-line);
  border-radius: 8px;
  background: #fff;
  color: var(--ads-text);
  text-align: left;
}

.ads-list-item:hover {
  border-color: #9fb2ce;
}

.ads-list-item.is-active {
  border-color: var(--ads-accent);
  background: #eff6ff;
}

.ads-list-item strong,
.ads-list-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-list-item span {
  color: var(--ads-muted);
  font-size: .82rem;
}

.ads-item-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
}

.ads-pill {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  background: #e8f7ef;
  color: var(--ads-success);
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.ads-pill.is-off {
  background: #f1f5f9;
  color: var(--ads-muted);
}

.ads-editor {
  overflow: auto;
}

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

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

.ads-field span {
  color: #3a4658;
  font-size: .82rem;
  font-weight: 900;
}

.ads-field small {
  color: var(--ads-muted);
  font-size: .78rem;
}

.ads-field input,
.ads-field select,
.ads-field textarea,
.ads-json-editor {
  width: 100%;
  min-width: 0;
  border: 1px solid #cfd9e8;
  border-radius: 6px;
  background: #fff;
  color: var(--ads-text);
}

.ads-field input,
.ads-field select {
  min-height: 40px;
  padding: 8px 10px;
}

.ads-field textarea,
.ads-json-editor {
  padding: 10px;
  line-height: 1.45;
}

.ads-field input:focus,
.ads-field select:focus,
.ads-field textarea:focus,
.ads-json-editor:focus {
  border-color: var(--ads-accent);
  outline: 3px solid rgba(37, 99, 235, .16);
}

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

.ads-field-inline {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.ads-field-inline input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
}

.ads-choice-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--ads-line);
}

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

.ads-choice {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--ads-line);
  border-radius: 8px;
  background: #fff;
}

.ads-choice input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.ads-choice span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-preview-stage {
  display: grid;
  min-height: 320px;
  place-items: center;
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed #b8c5d8;
  border-radius: 8px;
  background: #f8fafc;
}

.ads-preview-empty {
  color: var(--ads-muted);
  text-align: center;
}

.ptp-ad-card {
  position: relative;
  display: grid;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(37, 99, 235, .18);
  border-radius: 8px;
  background: #ffffff;
  color: #172033;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
}

.ptp-ad-card--wide,
.ptp-ad-card--medium,
.ptp-ad-card--mobile {
  grid-template-columns: minmax(92px, 36%) minmax(0, 1fr);
  min-height: 150px;
}

.ptp-ad-card--rail {
  max-width: 180px;
  min-height: 520px;
}

.ptp-ad-image {
  width: 100%;
  height: 100%;
  min-height: 130px;
  object-fit: cover;
  background: #e2e8f0;
}

.ptp-ad-card--rail .ptp-ad-image {
  height: 220px;
}

.ptp-ad-copy {
  display: grid;
  gap: 7px;
  align-content: center;
  padding: 16px;
}

.ptp-ad-label {
  width: fit-content;
  border-radius: 999px;
  padding: 3px 7px;
  background: #e8f7ef;
  color: var(--ads-success);
  font-size: .68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.ptp-ad-title {
  font-size: 1.08rem;
  line-height: 1.16;
}

.ptp-ad-description {
  color: var(--ads-muted);
  font-size: .9rem;
}

.ptp-ad-cta {
  width: fit-content;
  margin-top: 4px;
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--ads-accent);
  color: #fff;
  font-size: .82rem;
  font-weight: 900;
}

.ads-json-layout {
  min-height: 680px;
}

.ads-network-layout {
  display: grid;
  gap: 18px;
  min-height: 560px;
  padding: 22px;
  background: var(--ads-panel);
}

.ads-network-enabled {
  max-width: 420px;
}

.ads-network-code {
  min-height: 220px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  font-size: .9rem;
  tab-size: 2;
}

.ads-network-note {
  padding: 16px 18px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
}

.ads-network-note strong {
  color: #194185;
}

.ads-network-note p {
  margin: 8px 0 0;
  color: #3a526f;
}

.ads-funding-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 24px;
  min-height: 560px;
  padding: 22px;
  background: var(--ads-panel);
}

.ads-funding-layout > .ads-panel-head {
  grid-column: 1 / -1;
  margin-bottom: -4px;
}

.ads-panel-copy {
  max-width: 760px;
  margin: 7px 0 0;
  color: var(--ads-muted);
}

.ads-funding-note {
  align-self: start;
  padding: 18px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
}

.ads-context-help { padding: 0; overflow: hidden; }
.ads-context-help > summary {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 16px;
  cursor: pointer;
  list-style: none;
}
.ads-context-help > summary::-webkit-details-marker { display: none; }
.ads-context-help > summary::after { color: #57708f; font-size: 1.15rem; content: '+'; }
.ads-context-help[open] > summary::after { content: '−'; }
.ads-context-help > summary > span:first-child { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: #dfeaff; color: #315fc7; font-weight: 900; }
.ads-context-help > summary > span:nth-child(2) { display: grid; gap: 2px; }
.ads-context-help > summary small { color: #60748e; font-size: .72rem; font-weight: 600; }
.ads-context-help-body { padding: 0 16px 16px; border-top: 1px solid #d8e3f4; }

.ads-funding-note strong {
  color: #194185;
}

.ads-funding-note p {
  margin: 10px 0 0;
  color: #3a526f;
}

.ads-assistant-layout {
  display: grid;
  gap: 22px;
  min-height: 560px;
  padding: 22px;
  background: var(--ads-panel);
}

.ads-assistant-master {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
}

.ads-assistant-master strong {
  color: #194185;
  font-size: 1rem;
}

.ads-assistant-master p,
.ads-assistant-note p,
.ads-assistant-credential p {
  margin: 7px 0 0;
  color: #3a526f;
}

.ads-assistant-credential {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 480px);
  gap: 22px;
  align-items: start;
  padding: 18px;
  border: 1px solid var(--ads-line);
  border-radius: 10px;
  background: #fff;
}

.ads-assistant-credential-copy strong {
  color: var(--ads-text);
  font-size: 1rem;
}

.ads-assistant-credential-controls {
  display: grid;
  gap: 12px;
}

.ads-assistant-credential-controls .ads-inline-actions {
  justify-content: flex-start;
}

.ads-assistant-usage {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--ads-line);
  border-radius: 10px;
  background: #fff;
}

.ads-assistant-usage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.ads-assistant-usage-head p,
.ads-usage-pricing {
  margin: 6px 0 0;
  color: var(--ads-muted);
  font-size: .84rem;
}

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

.ads-usage-grid > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 13px;
  border: 1px solid #dbe5f2;
  border-radius: 9px;
  background: #f8fafc;
}

.ads-usage-grid span {
  color: var(--ads-muted);
  font-size: .76rem;
}

.ads-usage-grid strong {
  overflow-wrap: anywhere;
  font-size: 1.02rem;
}

.ads-credential-state {
  font-weight: 800;
}

.ads-credential-state.is-ok {
  color: var(--ads-success);
}

.ads-credential-state.is-off {
  color: var(--ads-danger);
}

.ads-credential-date:empty {
  display: none;
}

.ads-switch {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.ads-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.ads-switch > span {
  position: relative;
  width: 48px;
  height: 26px;
  border-radius: 999px;
  background: #94a3b8;
  transition: background .16s ease;
}

.ads-switch > span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(15, 23, 42, .22);
  content: '';
  transition: transform .16s ease;
}

.ads-switch input:checked + span {
  background: var(--ads-success);
}

.ads-switch input:checked + span::after {
  transform: translateX(22px);
}

.ads-switch input:focus-visible + span {
  outline: 3px solid rgba(37, 99, 235, .25);
  outline-offset: 3px;
}

.ads-switch b {
  min-width: 76px;
  color: var(--ads-muted);
  font-size: .88rem;
}

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

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

.ads-account-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--ads-line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.ads-account-card:hover,
.ads-account-card:focus-within {
  border-color: #9fb2ce;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .07);
}

.ads-account-card.is-premium {
  border-color: #c7d2fe;
  background: #fafaff;
}

.ads-account-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
}

.ads-account-card-head > span:not(.ads-account-icon) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.ads-account-card-head strong,
.ads-account-card-head small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.ads-account-card-head small,
.ads-account-description {
  color: var(--ads-muted);
  font-size: .82rem;
}

.ads-account-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 9px;
  background: #eaf2ff;
  color: #194185;
  font-weight: 900;
}

.ads-account-card-head input {
  width: 22px;
  height: 22px;
  accent-color: var(--ads-success);
}

.ads-account-card-head input:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .22);
  outline-offset: 2px;
}

.ads-account-description {
  min-height: 58px;
  line-height: 1.5;
}

.ads-account-card .ads-pill {
  width: fit-content;
}

.ads-assistant-note {
  padding: 16px 18px;
  border: 1px solid #d8e1ee;
  border-radius: 10px;
  background: #f8fafc;
}

.ads-assistant-note code {
  overflow-wrap: anywhere;
}

.ads-account-settings {
  display: grid;
  grid-template-columns: minmax(0, 560px) minmax(260px, 380px);
  gap: 24px;
  min-height: 560px;
  padding: 22px;
  background: var(--ads-panel);
}

.ads-account-settings > .ads-panel-head {
  grid-column: 1 / -1;
  margin-bottom: -4px;
}

.ads-password-form {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--ads-line);
  border-radius: 10px;
  background: #fff;
}

.ads-password-form h3 {
  margin: 0;
  font-size: 1rem;
}

.ads-password-form .ads-button {
  justify-self: start;
}

.ads-security-note {
  align-self: start;
  padding: 18px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
}

.ads-security-note strong {
  color: #194185;
}

.ads-security-note p {
  margin: 10px 0 0;
  color: #3a526f;
}

.ads-json-editor {
  min-height: 540px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  font-size: .9rem;
  tab-size: 2;
}

.ads-form-status {
  min-height: 22px;
  margin: 0;
  color: var(--ads-muted);
  font-size: .92rem;
}

.ads-form-status.is-error {
  color: var(--ads-danger);
}

.ads-form-status.is-ok {
  color: var(--ads-success);
}

.ads-pill.is-ok {
  border-color: rgba(22, 163, 74, .35);
  background: rgba(22, 163, 74, .1);
  color: var(--ads-success);
}

.ads-payments-layout {
  display: grid;
  gap: 22px;
  min-height: 620px;
  padding: 22px;
  background: var(--ads-panel);
}

.ads-payment-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--ads-line);
  border-radius: 12px;
  background: #fff;
}

.ads-payment-metrics div { display: grid; gap: 4px; padding: 18px; border-right: 1px solid var(--ads-line); }
.ads-payment-metrics div:last-child { border-right: 0; }
.ads-payment-metrics span, .ads-payment-metrics small { color: var(--ads-muted); }
.ads-payment-metrics strong { font-size: 1.35rem; }

.ads-payment-setup {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(340px, 1.2fr);
  gap: 20px;
  padding: 20px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
}

.ads-payment-setup h3, .ads-payment-detail h3, .ads-payment-detail h4 { margin: 0; }
.ads-payment-setup p { color: #3a526f; line-height: 1.5; }
.ads-payment-credential-form { display: grid; gap: 13px; }
.ads-payment-webhook-field { grid-column: 1 / -1; }
.ads-inline-input { display: flex; gap: 8px; }
.ads-inline-input input { min-width: 0; flex: 1; }

.ads-payment-filters {
  display: grid;
  grid-template-columns: minmax(210px, 2fr) repeat(3, minmax(135px, 1fr)) auto;
  align-items: end;
  gap: 12px;
}

.ads-payment-table-wrap { overflow: auto; border: 1px solid var(--ads-line); border-radius: 12px; background: #fff; }
.ads-payment-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.ads-payment-table th, .ads-payment-table td { padding: 12px 14px; border-bottom: 1px solid var(--ads-line); text-align: left; vertical-align: top; }
.ads-payment-table th { position: sticky; top: 0; z-index: 1; background: #f8fafc; color: var(--ads-muted); font-size: .73rem; letter-spacing: .04em; text-transform: uppercase; }
.ads-payment-table tr:last-child td { border-bottom: 0; }
.ads-payment-table code { overflow-wrap: anywhere; font-size: .78rem; }

.ads-payment-badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: #eef2f7; font-size: .72rem; font-weight: 800; }
.ads-payment-badge.is-paid { background: #dcfce7; color: #15713a; }
.ads-payment-badge.is-pending { background: #fef3c7; color: #92400e; }
.ads-payment-badge.is-problem { background: #fee2e2; color: #b42318; }
.ads-payment-pagination { display: flex; align-items: center; justify-content: center; gap: 14px; }

.ads-payment-detail { display: grid; gap: 18px; padding: 20px; border: 1px solid var(--ads-line); border-radius: 12px; background: #fff; }
.ads-payment-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ads-payment-detail-grid div { padding: 12px; border-radius: 9px; background: #f8fafc; }
.ads-payment-detail-grid span { display: block; margin-bottom: 4px; color: var(--ads-muted); font-size: .72rem; text-transform: uppercase; }
.ads-payment-detail-grid strong { overflow-wrap: anywhere; font-size: .85rem; }
.ads-payment-events { display: grid; gap: 8px; }
.ads-payment-event { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(120px, .6fr) minmax(160px, .8fr); gap: 10px; padding: 10px 12px; border: 1px solid var(--ads-line); border-radius: 8px; font-size: .82rem; }
.ads-payment-detail pre { max-height: 320px; overflow: auto; padding: 14px; border-radius: 8px; background: #101827; color: #dce7f7; white-space: pre-wrap; word-break: break-word; }

.ads-global-status {
  margin: 12px 2px 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1180px) {
  .ads-workspace-editor {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .ads-preview-panel {
    grid-column: 1 / -1;
    border-top: 1px solid var(--ads-line);
    border-left: 0;
  }
}

@media (max-width: 860px) {
  .ads-shell {
    padding: 10px;
  }

  .ads-topbar,
  .ads-notice,
  .ads-summary,
  .ads-workspace-editor,
  .ads-workspace-placements {
    grid-template-columns: 1fr;
  }

  .ads-topbar-actions,
  .ads-inline-actions {
    justify-content: flex-start;
  }

  .ads-summary div {
    border-right: 0;
    border-bottom: 1px solid var(--ads-line);
  }

  .ads-summary div:last-child {
    border-bottom: 0;
  }

  .ads-list-panel,
  .ads-preview-panel {
    border-right: 0;
    border-left: 0;
    border-bottom: 1px solid var(--ads-line);
  }

  .ads-form-grid,
  .ads-choice-list {
    grid-template-columns: 1fr;
  }

  .ads-workspace {
    min-height: 0;
  }

  .ads-funding-layout {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 16px;
  }

  .ads-assistant-layout {
    min-height: 0;
    padding: 16px;
  }

  .ads-assistant-credential {
    grid-template-columns: 1fr;
  }

  .ads-account-settings {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 16px;
  }

  .ads-payment-metrics,
  .ads-payment-setup,
  .ads-payment-filters,
  .ads-payment-detail-grid {
    grid-template-columns: 1fr;
  }

  .ads-payment-metrics div { border-right: 0; border-bottom: 1px solid var(--ads-line); }
  .ads-payment-metrics div:last-child { border-bottom: 0; }
  .ads-payment-webhook-field { grid-column: auto; }
  .ads-payment-event { grid-template-columns: 1fr; }

  .ads-account-settings > .ads-panel-head {
    grid-column: auto;
  }

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

  .ads-network-layout {
    min-height: 0;
    padding: 16px;
  }

  .ptp-ad-card--wide,
  .ptp-ad-card--medium,
  .ptp-ad-card--mobile {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .ads-brand span {
    display: none;
  }

  .ads-tabs {
    overflow-x: auto;
    padding: 0 8px;
  }

  .ads-assistant-master {
    align-items: flex-start;
    flex-direction: column;
  }

  .ads-button,
  .ads-tab {
    min-width: 0;
  }
}

/* Modern administration dashboard */
:root {
  --ads-bg: #edf2f8;
  --ads-panel: #ffffff;
  --ads-text: #132238;
  --ads-muted: #66758a;
  --ads-line: #dce5f0;
  --ads-soft: #f4f7fb;
  --ads-accent: #3568e8;
  --ads-accent-dark: #2855c7;
  --ads-success: #14804a;
  --ads-shadow: 0 18px 55px rgba(29, 48, 80, .09);
}

body {
  background:
    radial-gradient(circle at 10% 0, rgba(53, 104, 232, .08), transparent 34rem),
    linear-gradient(180deg, #f7f9fc 0, var(--ads-bg) 34rem);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ads-shell {
  width: min(1580px, 100%);
  padding: 20px 24px 32px;
}

.ads-topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  min-height: 70px;
  margin-bottom: 20px;
  padding: 11px 14px 11px 12px;
  border-color: rgba(203, 214, 229, .82);
  border-radius: 18px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 12px 36px rgba(30, 48, 80, .09);
  backdrop-filter: blur(18px);
}

.ads-brand > span {
  display: grid;
  gap: 1px;
}

.ads-brand strong { font-size: 1rem; letter-spacing: -.01em; }
.ads-brand small { color: var(--ads-muted); font-size: .75rem; font-weight: 700; }

.ads-button {
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 10px;
  transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.ads-button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 7px 16px rgba(29, 48, 80, .1); }

.ads-login {
  margin-top: 7vh;
  padding: 28px;
  border-radius: 20px;
}

.ads-manager {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  grid-template-areas:
    "navigation summary"
    "navigation workspace";
  align-items: start;
  overflow: visible;
  border-radius: 22px;
  background: #e9eff7;
  box-shadow: 0 25px 70px rgba(29, 48, 80, .11);
}

.ads-summary {
  grid-area: summary;
  margin: 18px 18px 0;
  overflow: hidden;
  border: 1px solid var(--ads-line);
  border-radius: 15px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 24px rgba(29, 48, 80, .05);
}

.ads-summary div { padding: 14px 18px; }
.ads-summary span { letter-spacing: .055em; }
.ads-summary strong { font-size: 1.35rem; letter-spacing: -.02em; }

.ads-tabs {
  position: sticky;
  top: 102px;
  grid-area: navigation;
  display: flex;
  flex-direction: column;
  align-self: start;
  gap: 20px;
  width: 100%;
  min-height: calc(100vh - 126px);
  padding: 22px 14px;
  border: 0;
  border-radius: 22px 0 0 22px;
  background: linear-gradient(180deg, #14233a, #0e1a2d);
}

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

.ads-nav-label {
  padding: 0 10px 5px;
  color: #8090a8;
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.ads-tab {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  min-height: 43px;
  padding: 6px 10px;
  border: 0;
  border-radius: 10px;
  color: #b9c5d6;
  font-size: .88rem;
  text-align: left;
  transition: color .15s ease, background .15s ease, transform .15s ease;
}

.ads-tab:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.ads-tab.is-active { color: #fff; background: linear-gradient(135deg, #3d73f0, #315ed2); box-shadow: 0 8px 20px rgba(25, 75, 194, .32); }
.ads-tab:active { transform: translateY(1px); }

.ads-tab-icon {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, .08);
  font-size: .75rem;
  font-weight: 900;
}

.ads-tab.is-active .ads-tab-icon { background: rgba(255, 255, 255, .18); }

.ads-panel.is-active {
  grid-area: workspace;
  min-width: 0;
  margin: 18px;
  overflow: hidden;
  border: 1px solid var(--ads-line);
  border-radius: 18px;
  background: var(--ads-panel);
  box-shadow: 0 12px 34px rgba(29, 48, 80, .06);
}

.ads-workspace,
.ads-network-layout,
.ads-funding-layout,
.ads-payments-layout,
.ads-assistant-layout,
.ads-account-settings,
.ads-json-layout { background: #fbfcfe; }

.ads-list-panel,
.ads-editor,
.ads-preview-panel,
.ads-json-layout { padding: 20px; }

.ads-panel-head h2 { font-size: 1.2rem; letter-spacing: -.025em; }
.ads-panel-head h3 { letter-spacing: -.015em; }
.ads-panel-copy { line-height: 1.55; }

.ads-field span { color: #34445b; font-size: .79rem; letter-spacing: .005em; }
.ads-field input,
.ads-field select,
.ads-field textarea,
.ads-json-editor { border-color: #d3deeb; border-radius: 10px; background: #fff; }
.ads-field input,
.ads-field select { min-height: 43px; padding: 9px 11px; }

.ads-funding-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  padding: 24px;
}

.ads-settings-stack { display: grid; gap: 16px; min-width: 0; }

.ads-settings-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--ads-line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(29, 48, 80, .035);
}

.ads-settings-card-accent { border-color: #bfd0fb; background: linear-gradient(145deg, #f8faff, #fff 55%); }
.ads-settings-card-bmc { border-color: #f1cc93; background: linear-gradient(145deg, #fffaf0, #fff 42%); }

.ads-settings-card-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  margin-bottom: 18px;
}

.ads-settings-card-head h3 { margin: 1px 0 0; font-size: 1rem; letter-spacing: -.015em; }
.ads-settings-card-head p { margin: 4px 0 0; color: var(--ads-muted); font-size: .8rem; }

.ads-settings-step {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: #e9efff;
  color: #2f5ed1;
  font-size: .76rem;
  font-weight: 900;
}

.ads-settings-card-bmc .ads-settings-step { background: #fff0d2; color: #a25b06; }

.ads-settings-advanced { padding: 0; }
.ads-settings-advanced > summary {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 17px 18px;
  cursor: pointer;
  list-style: none;
}
.ads-settings-advanced > summary::-webkit-details-marker { display: none; }
.ads-settings-advanced > summary::after { color: var(--ads-muted); font-size: 1.1rem; content: '+'; }
.ads-settings-advanced[open] > summary::after { content: '−'; }
.ads-settings-advanced > summary > span:nth-child(2) { display: grid; gap: 2px; }
.ads-settings-advanced > summary small { color: var(--ads-muted); font-weight: 500; }
.ads-settings-advanced > .ads-form-grid { padding: 0 18px 18px; }

.ads-settings-card-bmc > .ads-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ads-settings-card-bmc > .ads-form-grid > .ads-field-inline { grid-column: 1 / -1; padding: 12px 14px; border-radius: 11px; background: #fff8e8; }

.ads-product-card {
  display: grid;
  align-content: start;
  gap: 13px;
  min-width: 0;
  padding: 16px;
  border: 1px solid #e1e8f1;
  border-radius: 13px;
  background: #fff;
}

.ads-product-card-head { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 11px; align-items: center; }
.ads-product-card-head > span { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 11px; background: #fff0d2; color: #9a5909; font-weight: 900; }
.ads-product-card-head > div { display: grid; gap: 2px; }
.ads-product-card-head small { color: var(--ads-muted); font-size: .72rem; }

.ads-funding-note {
  position: sticky;
  top: 104px;
  border-color: #d8e3f4;
  border-radius: 15px;
  background: #f4f8ff;
}

.ads-payments-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 24px;
}

.ads-payments-layout > .ads-panel-head,
.ads-payments-layout > .ads-payment-metrics,
.ads-payments-layout > .ads-payment-filters,
.ads-payments-layout > .ads-payment-table-wrap,
.ads-payments-layout > .ads-payment-pagination,
.ads-payments-layout > .ads-payment-detail { grid-column: 1 / -1; }

.ads-payment-setup {
  display: block;
  padding: 0;
  overflow: hidden;
  border-color: #d8e3f4;
  background: #f7faff;
}

.ads-integration-summary {
  position: relative;
  display: grid;
  gap: 7px;
  min-height: 150px;
  align-content: start;
  padding: 18px 50px 18px 18px;
  cursor: pointer;
  list-style: none;
}

.ads-integration-summary::-webkit-details-marker { display: none; }
.ads-integration-summary::after { position: absolute; top: 18px; right: 18px; display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; background: #e7eef9; color: #45617f; font-size: 1.05rem; content: '+'; }
.ads-payment-setup[open] .ads-integration-summary::after { content: '−'; }
.ads-integration-summary p { margin: 0; font-size: .82rem; }

.ads-integration-body {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-top: 1px solid #d8e3f4;
  background: #fff;
}

.ads-payment-webhook-field { grid-column: auto; }
.ads-payment-metrics { box-shadow: 0 7px 20px rgba(29, 48, 80, .04); }
.ads-payment-table-wrap { box-shadow: 0 7px 20px rgba(29, 48, 80, .035); }

.ads-assistant-master,
.ads-assistant-credential,
.ads-assistant-usage,
.ads-account-card,
.ads-assistant-note,
.ads-password-form,
.ads-security-note,
.ads-network-note { border-radius: 15px; }

@media (max-width: 1220px) {
  .ads-manager { grid-template-columns: 210px minmax(0, 1fr); }
  .ads-tabs { padding-inline: 11px; }
  .ads-funding-layout { grid-template-columns: 1fr; }
  .ads-funding-note { position: static; }
  .ads-payments-layout { grid-template-columns: 1fr; }
  .ads-payment-setup { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .ads-shell { padding: 10px; }
  .ads-topbar { top: 6px; grid-template-columns: minmax(0, 1fr) auto; border-radius: 14px; }
  .ads-topbar-status { display: none; }
  .ads-manager {
    grid-template-columns: 1fr;
    grid-template-areas: "navigation" "summary" "workspace";
    border-radius: 17px;
  }
  .ads-tabs {
    position: static;
    flex-direction: row;
    min-height: 0;
    overflow-x: auto;
    gap: 5px;
    padding: 10px;
    border-radius: 17px 17px 0 0;
  }
  .ads-nav-group { display: flex; flex: 0 0 auto; gap: 5px; }
  .ads-nav-label { display: none; }
  .ads-tab { grid-template-columns: 25px auto; min-width: max-content; }
  .ads-summary { margin: 12px 12px 0; }
  .ads-panel.is-active { margin: 12px; }
  .ads-funding-layout,
  .ads-payments-layout,
  .ads-assistant-layout,
  .ads-account-settings,
  .ads-network-layout { padding: 16px; }
}

@media (max-width: 640px) {
  .ads-topbar { position: static; grid-template-columns: 1fr; }
  .ads-brand span { display: grid; }
  .ads-topbar-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ads-topbar-actions .ads-button { width: 100%; }
  .ads-summary { grid-template-columns: 1fr; }
  .ads-settings-card-bmc > .ads-form-grid,
  .ads-form-grid { grid-template-columns: 1fr; }
  .ads-settings-card-bmc > .ads-form-grid > .ads-field-inline { grid-column: auto; }
  .ads-settings-card { padding: 15px; }
  .ads-payment-filters { grid-template-columns: 1fr; }
  .ads-inline-input { flex-direction: column; }
}
