/* ═══════════════════════════════════════════════════════════
   Ad Stack Detector — v1.3.0
   ═══════════════════════════════════════════════════════════ */

/* ── Design tokens ─────────────────────────────────────────── */
.asd-app {
	--asd-green:        #16a34a;
	--asd-green-pale:   #dcfce7;
	--asd-green-border: #86efac;
	--asd-red:          #dc2626;
	--asd-red-pale:     #fee2e2;
	--asd-border:       #e2e8f0;
	--asd-bg:           #f8fafc;
	--asd-card:         #ffffff;
	--asd-text:         #0f172a;
	--asd-muted:        #64748b;
	--asd-radius:       10px;
	--asd-shadow:       0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);

	border: 1px solid var(--asd-border);
	border-radius: 12px;
	background: var(--asd-bg);
	color: var(--asd-text);
	font-family: inherit;
	margin: 24px 0;
	max-width: 980px;
	padding: 24px;
}

.asd-app [hidden] { display: none !important; }

/* ── Input form ─────────────────────────────────────────────── */
.asd-label {
	display: block;
	font-weight: 700;
	font-size: .82rem;
	margin-bottom: 8px;
	color: var(--asd-muted);
	text-transform: uppercase;
	letter-spacing: .06em;
}

.asd-input-row { display: flex; gap: 10px; }

.asd-url {
	border: 1px solid var(--asd-border);
	border-radius: var(--asd-radius);
	flex: 1 1 auto;
	font: inherit;
	font-size: 1rem;
	min-width: 0;
	padding: 11px 14px;
	background: #fff;
	transition: border-color .15s, box-shadow .15s;
}
.asd-url:focus {
	outline: none;
	border-color: var(--asd-green);
	box-shadow: 0 0 0 3px rgba(22,163,74,.14);
}

.asd-button {
	background: var(--asd-green);
	border: none;
	border-radius: var(--asd-radius);
	color: #fff;
	cursor: pointer;
	font: inherit;
	font-weight: 700;
	font-size: .95rem;
	padding: 11px 22px;
	white-space: nowrap;
	box-shadow: 0 2px 6px rgba(22,163,74,.32);
	transition: background .15s, box-shadow .15s, transform .1s;
}
.asd-button:hover   { background: #15803d; box-shadow: 0 4px 12px rgba(22,163,74,.38); }
.asd-button:active  { transform: translateY(1px); }
.asd-button:disabled{ cursor: wait; opacity: .62; }

/* ── Loading ─────────────────────────────────────────────────── */
.asd-loading { margin-top: 20px; max-width: 460px; }

.asd-loading-row {
	align-items: center;
	display: flex;
	gap: 10px;
	margin-bottom: 10px;
}

.asd-spinner {
	animation: asd-spin .75s linear infinite;
	border: 3px solid var(--asd-border);
	border-radius: 50%;
	border-top-color: var(--asd-green);
	display: inline-block;
	flex-shrink: 0;
	height: 20px;
	width: 20px;
}
.asd-progress-text { font-size: .88rem; color: var(--asd-muted); }

.asd-progress {
	background: var(--asd-border);
	border-radius: 999px;
	height: 6px;
	overflow: hidden;
}
.asd-progress-bar {
	background: linear-gradient(90deg, var(--asd-green), #4ade80);
	border-radius: 999px;
	display: block;
	height: 100%;
	transition: width .25s ease;
	width: 0;
}

/* ── Error ───────────────────────────────────────────────────── */
.asd-error {
	background: var(--asd-red-pale);
	border: 1px solid #fca5a5;
	border-radius: var(--asd-radius);
	color: #7f1d1d;
	font-size: .95rem;
	margin-top: 18px;
	padding: 12px 16px;
}

/* ── Results wrapper ─────────────────────────────────────────── */
.asd-results { margin-top: 22px; }

/* ── Top grid: [left column] + [summary card] ────────────────── */
.asd-top-grid {
	display: grid;
	gap: 16px;
	grid-template-columns: 1fr 260px;
	margin-bottom: 16px;
	align-items: start;
}

/* Left column stacks the two tier cards vertically */
.asd-stack-col { display: flex; flex-direction: column; gap: 16px; }

/* ── Cards ───────────────────────────────────────────────────── */
.asd-card {
	background: var(--asd-card);
	border: 1px solid var(--asd-border);
	border-radius: var(--asd-radius);
	box-shadow: var(--asd-shadow);
	padding: 18px 20px;
}
.asd-card--full  {}

.asd-card-title {
	align-items: center;
	display: flex;
	gap: 8px;
	font-size: .95rem;
	font-weight: 700;
	line-height: 1.3;
	margin: 0 0 14px;
	color: var(--asd-text);
}

/* ── Tier badges ─────────────────────────────────────────────── */
.asd-card-badge {
	border-radius: 4px;
	font-size: .7rem;
	font-weight: 800;
	letter-spacing: .07em;
	padding: 2px 7px;
	text-transform: uppercase;
	flex-shrink: 0;
}
.asd-badge--core    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.asd-badge--premium { background: #faf5ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.asd-badge--txt     { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }

/* ── Tier 1: single-column stack rows ───────────────────────── */
.asd-stack-rows { display: flex; flex-direction: column; gap: 8px; }

.asd-stack-row {
	align-items: center;
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 10px;
	border-radius: 6px;
	background: var(--asd-bg);
	border: 1px solid var(--asd-border);
}
.asd-stack-name { font-size: .92rem; font-weight: 600; }
.asd-stack-right { display: flex; align-items: center; }

/* ── Tier 2: responsive network grid ────────────────────────── */
.asd-net-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 8px;
}

.asd-net-card {
	align-items: center;
	background: var(--asd-bg);
	border: 1px solid var(--asd-border);
	border-radius: 6px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 10px 10px 8px;
	text-align: center;
}
.asd-net-name {
	color: var(--asd-text);
	font-size: .8rem;
	font-weight: 600;
	line-height: 1.25;
}

/* ── Status pills ────────────────────────────────────────────── */
.asd-pill {
	border-radius: 999px;
	display: inline-block;
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .05em;
	padding: 3px 10px;
	white-space: nowrap;
}
.asd-pill--yes {
	background: var(--asd-green-pale);
	border: 1px solid var(--asd-green-border);
	color: #15803d;
}
.asd-pill--no {
	background: #f1f5f9;
	border: 1px solid var(--asd-border);
	color: var(--asd-muted);
}

.asd-badge--summary { background: #f0fdf4; color: #15803d; border: 1px solid #86efac; }

/* ── Monetization Summary card ───────────────────────────────── */
.asd-card--summary { }

.asd-summary-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.asd-summary-item {
	align-items: baseline;
	display: flex;
	gap: 9px;
	padding: 6px 8px;
	border-radius: 6px;
	font-size: .88rem;
	line-height: 1.4;
}

.asd-summary-item--yes {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
}

.asd-summary-item--no {
	background: #f8fafc;
	border: 1px solid transparent;
}

.asd-summary-item--ssp {
	background: #f0f9ff;
	border: 1px solid #bae6fd;
	margin-top: 6px;
}

.asd-summary-icon {
	flex-shrink: 0;
	font-style: normal;
	width: 14px;
	text-align: center;
}

.asd-summary-item--yes .asd-summary-icon { color: var(--asd-green); font-weight: 800; }
.asd-summary-item--no  .asd-summary-icon { color: #cbd5e1; font-weight: 400; }
.asd-summary-item--ssp .asd-summary-icon { color: #0284c7; font-size: .8rem; }

.asd-summary-text { color: var(--asd-text); }
.asd-summary-item--no .asd-summary-text  { color: var(--asd-muted); }
.asd-summary-item--yes .asd-summary-text strong { color: #15803d; }
.asd-summary-item--ssp .asd-summary-text strong { color: #0369a1; }

/* ── ads.txt stats row ───────────────────────────────────────── */
.asd-stat-row {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(4, 1fr);
	margin-bottom: 18px;
}
.asd-stat {
	background: var(--asd-bg);
	border: 1px solid var(--asd-border);
	border-radius: 8px;
	padding: 12px;
	text-align: center;
}
.asd-stat-label {
	color: var(--asd-muted);
	display: block;
	font-size: .75rem;
	font-weight: 600;
	letter-spacing: .05em;
	margin-bottom: 6px;
	text-transform: uppercase;
}
.asd-stat-value   { display: block; }
.asd-stat-number  { color: var(--asd-text); font-size: 1.5rem; font-weight: 800; }
.asd-stat--direct   { color: var(--asd-green); }
.asd-stat--reseller { color: #9333ea; }

/* ── SSP partner chips ───────────────────────────────────────── */
.asd-partners-title {
	color: var(--asd-muted);
	font-size: .8rem;
	font-weight: 700;
	letter-spacing: .06em;
	margin: 0 0 10px;
	text-transform: uppercase;
}
.asd-partners {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.asd-partners li {
	background: var(--asd-green-pale);
	border: 1px solid var(--asd-green-border);
	border-radius: 999px;
	color: #15803d;
	font-size: .8rem;
	font-weight: 600;
	padding: 4px 12px;
}
.asd-muted { color: var(--asd-muted); font-size: .9rem; margin: 0; }

/* ── Spin keyframe ───────────────────────────────────────────── */
@keyframes asd-spin { to { transform: rotate(360deg); } }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 720px) {
	.asd-input-row          { flex-direction: column; }
	.asd-button             { width: 100%; }
	.asd-top-grid           { grid-template-columns: 1fr; }
	.asd-net-grid           { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
	.asd-stat-row           { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
	.asd-stat-row           { grid-template-columns: 1fr; }
	.asd-net-grid           { grid-template-columns: 1fr 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   v1.3.0 additions — dual-layer detection UI
   ═══════════════════════════════════════════════════════════ */

/* ── Network card active state ───────────────────────────────── */
.asd-net-card--active {
	border-color: var(--asd-green-border);
	background: #f0fdf4;
}

/* ── Network status cell (pill + via tags stacked) ───────────── */
.asd-net-status {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 5px;
}

/* ── "via" source attribution tag wrapper ────────────────────── */
.asd-via-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
}

/* ── Individual "via" tag ────────────────────────────────────── */
.asd-via {
	border-radius: 4px;
	font-size: .68rem;
	font-weight: 600;
	letter-spacing: .03em;
	padding: 2px 7px;
	white-space: nowrap;
	line-height: 1.5;
}

/* via Script Signature — blue tint */
.asd-via--script {
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	color: #1d4ed8;
}

/* via ads.txt (domain.com) — amber tint */
.asd-via--adstxt {
	background: #fffbeb;
	border: 1px solid #fde68a;
	color: #92400e;
}

/* via [Network] Wrapper — violet tint (GAM implied by premium network) */
.asd-via--wrapper {
	background: #faf5ff;
	border: 1px solid #e9d5ff;
	color: #6b21a8;
}

/* ── MANAGERDOMAIN row in ads.txt report ─────────────────────── */
.asd-manager-row {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 16px;
	padding: 10px 14px;
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-radius: 8px;
}

.asd-manager-label {
	font-size: .75rem;
	font-weight: 800;
	letter-spacing: .07em;
	text-transform: uppercase;
	color: #92400e;
	white-space: nowrap;
	padding-top: 2px;
	flex-shrink: 0;
}

.asd-manager-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.asd-manager-chip {
	background: #fff;
	border: 1px solid #fcd34d;
	border-radius: 999px;
	color: #78350f;
	font-size: .78rem;
	font-weight: 600;
	padding: 2px 10px;
}

/* ── Responsive adjustments for new elements ─────────────────── */
@media (max-width: 720px) {
	.asd-manager-row { flex-direction: column; gap: 8px; }
	.asd-via         { font-size: .65rem; }
}

/* ═══════════════════════════════════════════════════════════
   v1.4.0 additions — firewall notice + summary-none state
   ═══════════════════════════════════════════════════════════ */

/* ── Firewall notice banner ──────────────────────────────────── */
.asd-firewall-notice {
	align-items: flex-start;
	border-radius: var(--asd-radius);
	display: flex;
	gap: 12px;
	margin-bottom: 16px;
	padding: 13px 16px;
	font-size: .9rem;
	line-height: 1.5;
}

.asd-firewall-notice--failed {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #7f1d1d;
}

.asd-firewall-notice--bypassed {
	background: #fffbeb;
	border: 1px solid #fde68a;
	color: #78350f;
}

.asd-fw-icon {
	flex-shrink: 0;
	font-size: 1.1rem;
	line-height: 1.5;
}

.asd-fw-body { flex: 1 1 auto; }
.asd-fw-body strong { font-weight: 700; }

/* ── Summary fallback row (zero networks detected) ───────────── */
.asd-summary-item--none {
	background: #f8fafc;
	border: 1px solid var(--asd-border);
}
.asd-summary-item--none .asd-summary-icon { color: #cbd5e1; }
.asd-summary-item--none .asd-summary-text { color: var(--asd-muted); font-style: italic; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 720px) {
	.asd-firewall-notice { flex-direction: column; gap: 6px; }
}

/* ═══════════════════════════════════════════════════════════
   v1.5.0 additions — Authorized SSP Bidder Capacity block
   ═══════════════════════════════════════════════════════════ */

/* ── Block wrapper ───────────────────────────────────────────── */
.asd-ssp-block {
	border-top: 1px solid var(--asd-border);
	margin-top: 20px;
	padding-top: 18px;
}

/* ── Header ──────────────────────────────────────────────────── */
.asd-ssp-header { margin-bottom: 14px; }

.asd-ssp-title {
	color: var(--asd-text);
	font-size: .9rem;
	font-weight: 700;
	margin: 0 0 4px;
	letter-spacing: .01em;
}

.asd-ssp-subtitle {
	color: var(--asd-muted);
	font-size: .78rem;
	line-height: 1.5;
	margin: 0;
}

/* ── Tag grid ────────────────────────────────────────────────── */
.asd-ssp-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 12px;
}

/* ── Individual exchange tag ─────────────────────────────────── */
.asd-ssp-tag {
	align-items: center;
	background: #f0fdf4;
	border: 1px solid var(--asd-green-border);
	border-radius: 8px;
	cursor: default;
	display: flex;
	gap: 8px;
	padding: 8px 14px;
	transition: background .12s, box-shadow .12s;
}

.asd-ssp-tag:hover {
	background: #dcfce7;
	box-shadow: 0 1px 4px rgba(22,163,74,.12);
}

/* ── Status dot ──────────────────────────────────────────────── */
.asd-ssp-dot {
	background: var(--asd-green);
	border-radius: 50%;
	display: inline-block;
	flex-shrink: 0;
	height: 7px;
	width: 7px;
}

/* ── Exchange name ───────────────────────────────────────────── */
.asd-ssp-name {
	color: var(--asd-text);
	font-size: .84rem;
	font-weight: 700;
	white-space: nowrap;
}

/* ── "Connection Configured" label ───────────────────────────── */
.asd-ssp-status {
	background: var(--asd-green-pale);
	border: 1px solid var(--asd-green-border);
	border-radius: 999px;
	color: #15803d;
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .04em;
	padding: 2px 8px;
	white-space: nowrap;
}

/* ── Footer count line ───────────────────────────────────────── */
.asd-ssp-count {
	color: var(--asd-muted);
	font-size: .8rem;
	margin: 0;
}
.asd-ssp-count strong { color: var(--asd-text); }

/* ── Empty / fallback state ──────────────────────────────────── */
.asd-ssp-empty { margin: 0; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 480px) {
	.asd-ssp-tag { width: 100%; justify-content: space-between; }
}
