/**
 * [B] ODS External API – public docs + request builder.
 * Brand-aligned with the ODSLocal graphic manual (ODS palette, Nunito/Tilt Warp).
 */

.bdw-oea-docs {
	--oea-navy: #0f2d42;
	--oea-blue: #19486a;
	--oea-gold: #fcc30b;
	--oea-magenta: #dd1367;
	--oea-green: #56c02b;
	--oea-cyan: #0a97d9;
	--oea-orange: #fd6925;
	--oea-text: #324049;
	--oea-muted: #5e6670;
	--oea-border: #dfe6ee;
	--oea-soft: #f6f8fb;
	--oea-white: #fff;
	--oea-radius: 14px;
	--oea-shadow: 0 14px 36px rgba(15, 45, 66, 0.1);

	box-sizing: border-box;
	max-width: 1080px;
	margin: 0 auto;
	padding: 8px;
	color: var(--oea-text);
	font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 16px;
	line-height: 1.65;
}

.bdw-oea-docs *,
.bdw-oea-docs *::before,
.bdw-oea-docs *::after { box-sizing: border-box; }

.bdw-oea-docs h1,
.bdw-oea-docs h2,
.bdw-oea-docs h3 {
	font-family: "Tilt Warp", "Nunito", sans-serif;
	color: var(--oea-navy);
	line-height: 1.2;
	margin: 0 0 12px;
}

/* ── Hero ─────────────────────────────────────────────────────────── */
.bdw-oea-hero {
	position: relative;
	overflow: hidden;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 28px;
	align-items: center;
	padding: clamp(28px, 5vw, 54px);
	border-radius: var(--oea-radius);
	background:
		linear-gradient(135deg, rgba(15, 45, 66, 0.98), rgba(25, 72, 106, 0.94));
	color: var(--oea-white);
	box-shadow: var(--oea-shadow);
}

.bdw-oea-hero::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 7px;
	background: linear-gradient(90deg, var(--oea-magenta), var(--oea-orange), var(--oea-gold), var(--oea-green), var(--oea-cyan), var(--oea-magenta));
}

.bdw-oea-hero h1 {
	color: var(--oea-white);
	font-size: clamp(1.7rem, 3.4vw, 2.6rem);
}

.bdw-oea-eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.14em;
	font-size: 0.78rem;
	font-weight: 800;
	color: var(--oea-gold);
	margin: 0 0 10px;
}

.bdw-oea-hero__lead {
	max-width: 70ch;
	margin: 0 0 18px;
	color: rgba(255, 255, 255, 0.92);
}

.bdw-oea-hero__badges { display: flex; flex-wrap: wrap; gap: 8px; }

.bdw-oea-badge {
	display: inline-flex;
	align-items: center;
	padding: 5px 12px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.25);
	font-size: 0.8rem;
	font-weight: 700;
}
.bdw-oea-badge--accent {
	background: var(--oea-green);
	border-color: var(--oea-green);
	color: #08311f;
}

.bdw-oea-hero__mark {
	font-family: "Tilt Warp", monospace;
	font-size: clamp(3rem, 10vw, 7rem);
	color: rgba(255, 255, 255, 0.12);
	line-height: 1;
}

/* ── Sections ─────────────────────────────────────────────────────── */
.bdw-oea-section {
	background: var(--oea-white);
	border: 1px solid var(--oea-border);
	border-radius: var(--oea-radius);
	padding: clamp(20px, 3vw, 34px);
	margin-top: 22px;
	box-shadow: 0 6px 20px rgba(15, 45, 66, 0.05);
}

.bdw-oea-section h2 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
.bdw-oea-section__lead { color: var(--oea-muted); margin: 0 0 18px; }

/* ── Steps ────────────────────────────────────────────────────────── */
.bdw-oea-steps {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 18px;
}

.bdw-oea-step {
	display: flex;
	gap: 14px;
	padding: 18px;
	border-radius: var(--oea-radius);
	background: var(--oea-soft);
	border: 1px solid var(--oea-border);
}

.bdw-oea-step h3 { font-size: 1.05rem; margin-bottom: 4px; }
.bdw-oea-step p { margin: 0; font-size: 0.94rem; color: var(--oea-muted); }

.bdw-oea-step__num {
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--oea-cyan), var(--oea-blue));
	color: #fff;
	font-family: "Tilt Warp", sans-serif;
	font-size: 1.1rem;
}

.bdw-oea-link { color: var(--oea-magenta); font-weight: 700; text-decoration: none; }
.bdw-oea-link:hover { text-decoration: underline; }

/* ── Builder ──────────────────────────────────────────────────────── */
.bdw-oea-builder__grid { margin-bottom: 8px; }

.bdw-oea-builder__desc {
	margin: 8px 0 0;
	color: var(--oea-muted);
	font-style: italic;
	font-size: 0.92rem;
}

.bdw-oea-builder__params {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 14px;
	margin: 18px 0;
}

.bdw-oea-builder__empty { grid-column: 1 / -1; color: var(--oea-muted); margin: 0; }

.bdw-oea-field { display: flex; flex-direction: column; gap: 6px; }

.bdw-oea-field label {
	font-weight: 700;
	font-size: 0.86rem;
	color: var(--oea-navy);
}

.bdw-oea-field input[type="text"],
.bdw-oea-field input[type="number"],
.bdw-oea-field select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--oea-border);
	border-radius: 9px;
	font: inherit;
	font-size: 0.92rem;
	background: var(--oea-white);
	color: var(--oea-text);
}

.bdw-oea-field input:focus,
.bdw-oea-field select:focus {
	outline: none;
	border-color: var(--oea-cyan);
	box-shadow: 0 0 0 3px rgba(10, 151, 217, 0.18);
}

.bdw-oea-field input[type="checkbox"] { width: 20px; height: 20px; }

.bdw-oea-field--key { margin: 6px 0 18px; }
.bdw-oea-hint { color: var(--oea-muted); font-size: 0.8rem; }

/* ── Output blocks ────────────────────────────────────────────────── */
.bdw-oea-output { display: grid; gap: 14px; }

.bdw-oea-output__block {
	border: 1px solid var(--oea-border);
	border-radius: var(--oea-radius);
	overflow: hidden;
}

.bdw-oea-output__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 14px;
	background: var(--oea-navy);
	color: #fff;
	font-weight: 700;
	font-size: 0.88rem;
}

.bdw-oea-output__actions { display: flex; gap: 8px; }

.bdw-oea-code {
	margin: 0;
	padding: 14px 16px;
	background: #0b1f2e;
	color: #e7f1f8;
	font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
	font-size: 0.86rem;
	line-height: 1.5;
	overflow-x: auto;
	white-space: pre-wrap;
	word-break: break-all;
}

.bdw-oea-code code { background: none; color: inherit; padding: 0; font: inherit; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.bdw-oea-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border: none;
	border-radius: 8px;
	background: var(--oea-gold);
	color: var(--oea-navy);
	font: inherit;
	font-weight: 800;
	font-size: 0.82rem;
	cursor: pointer;
	text-decoration: none;
	transition: transform 0.12s ease, background 0.15s ease, opacity 0.15s ease;
}

.bdw-oea-btn:hover { transform: translateY(-1px); }
.bdw-oea-btn.is-copied { background: var(--oea-green); color: #fff; }

.bdw-oea-btn--ghost {
	background: transparent;
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.5);
}
.bdw-oea-btn--ghost:hover { background: rgba(255, 255, 255, 0.12); }
.bdw-oea-btn--ghost[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

.bdw-oea-btn--lg { padding: 12px 22px; font-size: 0.95rem; }

/* ── Reference table ──────────────────────────────────────────────── */
.bdw-oea-inline-code,
.bdw-oea-table code {
	background: var(--oea-soft);
	border: 1px solid var(--oea-border);
	border-radius: 6px;
	padding: 2px 7px;
	font-family: "SFMono-Regular", Consolas, monospace;
	font-size: 0.85rem;
	color: var(--oea-blue);
	word-break: break-all;
}

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

.bdw-oea-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }

.bdw-oea-table th,
.bdw-oea-table td {
	text-align: left;
	padding: 11px 14px;
	border-bottom: 1px solid var(--oea-border);
	vertical-align: top;
}

.bdw-oea-table thead th {
	background: var(--oea-soft);
	color: var(--oea-navy);
	font-weight: 800;
}

.bdw-oea-table tbody tr:hover { background: #fafcfe; }

/* ── Scopes ───────────────────────────────────────────────────────── */
.bdw-oea-scopes { margin: 0; padding-left: 18px; }
.bdw-oea-scopes li { margin-bottom: 6px; }
.bdw-oea-scopes code {
	background: var(--oea-soft);
	border-radius: 6px;
	padding: 1px 7px;
	color: var(--oea-magenta);
}

/* ── Notices ──────────────────────────────────────────────────────── */
.bdw-oea-notice {
	margin: 14px 0 0;
	padding: 12px 16px;
	border-radius: 10px;
	background: var(--oea-soft);
	border-left: 4px solid var(--oea-cyan);
	font-size: 0.9rem;
}
.bdw-oea-notice--warn { border-left-color: var(--oea-orange); background: #fff6f0; }
.bdw-oea-notice--ok { border-left-color: var(--oea-green); background: #f0faef; }

/* ── CTA ──────────────────────────────────────────────────────────── */
.bdw-oea-cta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	flex-wrap: wrap;
	background: linear-gradient(135deg, var(--oea-soft), #eef4fb);
}
.bdw-oea-cta p { margin: 0; color: var(--oea-muted); }

/* ── Run console + result ─────────────────────────────────────────── */
.bdw-oea-run {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	margin-top: 18px;
}

.bdw-oea-btn--run {
	background: linear-gradient(135deg, var(--oea-green), #2f9e44);
	font-size: 1rem;
	padding: 12px 24px;
}
.bdw-oea-btn--run:disabled { opacity: 0.6; cursor: progress; }

.bdw-oea-run__status {
	font-weight: 700;
	font-size: 0.9rem;
	color: var(--oea-muted);
}
.bdw-oea-run__status.is-loading { color: var(--oea-cyan); }
.bdw-oea-run__status.is-ok { color: #2f9e44; }
.bdw-oea-run__status.is-warn { color: var(--oea-orange); }
.bdw-oea-run__status.is-error { color: var(--oea-magenta); }

.bdw-oea-result { margin-top: 16px; }
.bdw-oea-code--result {
	max-height: 460px;
	overflow: auto;
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 760px) {
	.bdw-oea-hero { grid-template-columns: 1fr; }
	.bdw-oea-hero__mark { display: none; }
	.bdw-oea-steps { grid-template-columns: 1fr; }
}
