/*
   The embed builder (public/public-pages/embed-builder.js) on /developers/embed and in the customer panel.
   Built on the pricing page's kit (pricing.css: the --k-* tokens and .pr-page .btn), which both pages load,
   so light and dark follow the visitor's choice like the rest of the public site.
*/

.eb-hero { padding: 36px 0 8px; }
.eb-hero h1 { margin: 0; font-size: clamp(24px, 20px + 1.2vw, 30px); font-weight: 650; line-height: 1.2; letter-spacing: -.02em; color: var(--k-heading); }
.eb-hero p { max-width: 720px; margin: 8px 0 0; color: var(--k-subtle); font-size: 15px; line-height: 1.55; }
.eb-hero-links { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 14px !important; }
.eb-hero-links a { color: var(--k-accent); }

.eb { margin-top: 20px; }
.eb noscript p { color: var(--k-subtle); }

.eb-grid { display: grid; gap: 20px; align-items: start; }
@media (min-width: 64rem) {
    .eb-grid { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); }
    .eb-output { position: sticky; top: 16px; }
}

.eb-controls { display: grid; gap: 12px; min-width: 0; }
.eb-group { padding: 14px 16px; border: 1px solid var(--k-border-light); border-radius: var(--k-radius-box); background: var(--k-surface); box-shadow: var(--k-shadow-box); }
.eb-group-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--k-heading); font-size: 14px; font-weight: 650; }
.eb-group.is-locked .eb-field, .eb-group.is-locked .eb-checks { opacity: .7; }
.eb-badge { display: inline-flex; align-items: center; padding: 1px 6px; border-radius: var(--k-radius-badge); background: var(--k-warning-tint); color: var(--k-warning-ink); font-size: 11.5px; font-weight: 600; }
.eb-badge[hidden] { display: none; }

.eb-field { margin: 0 0 10px; }
.eb-field:last-child { margin-bottom: 0; }
.eb-field > label, .eb-checks legend { display: block; margin-bottom: 4px; color: var(--k-strong); font-size: 13px; font-weight: 600; }
.eb code, .eb-code { font-family: var(--k-mono); }
.eb-field > label code, .eb-checks legend code { padding: 0 4px; border-radius: 3px; background: var(--k-fill); color: var(--k-muted); font-size: 11.5px; font-weight: 500; }
.eb-field input[type="text"], .eb-field input[type="search"], .eb-field input[type="number"], .eb-field select {
    display: block; width: 100%; box-sizing: border-box; min-height: var(--k-control-height); padding: 5px 9px;
    border: 1px solid var(--k-control-border); border-radius: var(--k-radius-control); background: var(--k-control-bg); color: var(--k-text); font: 13px/20px var(--k-font);
}
.eb-field input:focus-visible, .eb-field select:focus-visible, .eb-check input:focus-visible, .eb-tab:focus-visible, .eb-result:focus-visible, .eb-link-btn:focus-visible { outline: none; box-shadow: var(--k-focus-ring); }
.eb-field input:disabled { opacity: .6; }
.eb-field input[type="color"] { width: 48px; height: var(--k-control-height); padding: 2px; border: 1px solid var(--k-control-border); border-radius: var(--k-radius-control); background: var(--k-control-bg); vertical-align: middle; }
.eb-help { margin: 4px 0 0; color: var(--k-muted); font-size: 12.5px; line-height: 1.45; }
.eb-note { display: inline-block; margin-top: 4px; color: var(--k-warning-ink); font-size: 12px; font-weight: 600; }
.eb-note[hidden] { display: none; }
.eb-error { margin: 4px 0 0; color: var(--k-error-ink); font-size: 12.5px; font-weight: 550; }
.eb-error[hidden] { display: none; }
.eb-warn { margin: 6px 0 0; padding: 6px 10px; border-radius: var(--k-radius-control); background: var(--k-warning-tint); color: var(--k-warning-ink); font-size: 13px; }
.eb-key p { margin: 0 0 4px; color: var(--k-text); font-size: 13px; }
.eb-key code { word-break: break-all; }

.eb-checks { margin: 0 0 10px; padding: 0; border: 0; min-width: 0; }
.eb-checks:last-child { margin-bottom: 0; }
.eb-checks .eb-check { margin-right: 12px; }
.eb-check { display: inline-flex; align-items: center; gap: 6px; margin: 2px 0; color: var(--k-text); font-size: 13px; cursor: pointer; }
.eb-field .eb-check { margin-top: 6px; }

.eb-link-btn { margin-left: 8px; padding: 0; border: 0; background: none; color: var(--k-accent); font: 500 13px var(--k-font); cursor: pointer; }
.eb-link-btn:hover { text-decoration: underline; }

.eb-search { position: relative; }
.eb-results { margin: 4px 0 0; padding: 4px; max-height: 260px; overflow: auto; border: 1px solid var(--k-border); border-radius: var(--k-radius-box); background: var(--k-surface); list-style: none; }
.eb-results[hidden] { display: none; }
.eb-results li.eb-help, .eb-results li.eb-error { padding: 6px 8px; margin: 0; }
.eb-result { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: var(--k-radius-control); background: none; color: var(--k-text); font: 13px/18px var(--k-font); text-align: left; cursor: pointer; }
.eb-result:hover { background: var(--k-fill); }
.eb-result-kind { flex: none; color: var(--k-muted); font-size: 12px; }
.eb-chosen { margin: 0 0 10px; color: var(--k-subtle); font-size: 13px; }
.eb-chosen strong { color: var(--k-heading); }
.eb-more summary { color: var(--k-accent); font-size: 13px; cursor: pointer; }
.eb-more[open] summary { margin-bottom: 8px; }

.eb-actions { display: flex; justify-content: flex-start; }

.eb-output { display: grid; gap: 16px; min-width: 0; }
.eb-preview, .eb-snippet { padding: 14px 16px; border: 1px solid var(--k-border-light); border-radius: var(--k-radius-box); background: var(--k-surface); box-shadow: var(--k-shadow-box); min-width: 0; }
.eb-out-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.eb-out-head h2 { margin: 0; color: var(--k-heading); font-size: 14px; font-weight: 650; }
.eb-frame-wrap { overflow: auto; border-radius: var(--k-radius-control); background: var(--k-fill); }
.eb-frame { display: block; width: 100%; height: 480px; border: 0; }

.eb-tabs { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: -1px; }
.eb-tab { padding: 6px 12px; border: 1px solid transparent; border-bottom: 0; border-radius: var(--k-radius-control) var(--k-radius-control) 0 0; background: none; color: var(--k-muted); font: 500 13px var(--k-font); cursor: pointer; }
.eb-tab[aria-selected="true"] { border-color: var(--k-charcoal-line); background: var(--k-charcoal); color: var(--k-charcoal-text); }
.eb-code-panel { border: 1px solid var(--k-charcoal-line); border-radius: 0 var(--k-radius-box) var(--k-radius-box) var(--k-radius-box); background: var(--k-charcoal); }
.eb-code { margin: 0; padding: 12px 14px; overflow: auto; max-height: 280px; color: var(--k-charcoal-text); font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-all; }
noscript .eb-code { border-radius: var(--k-radius-box); background: var(--k-charcoal); }

.eb-plans { margin-top: 32px; }
.eb-plans h2 { margin: 0 0 10px; color: var(--k-heading); font-size: 18px; font-weight: 650; }
.eb-table-scroll { overflow-x: auto; border: 1px solid var(--k-border-light); border-radius: var(--k-radius-box); background: var(--k-surface); }
.eb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.eb-table th, .eb-table td { padding: 8px 12px; border-bottom: 1px solid var(--k-border-faint); color: var(--k-text); text-align: left; white-space: nowrap; }
.eb-table thead th { color: var(--k-muted); font-weight: 600; }
.eb-table tbody th { color: var(--k-heading); font-weight: 600; }
.eb-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.eb-table tr:last-child > * { border-bottom: 0; }

@media (max-width: 480px) {
    .eb-field input, .eb-field select { font-size: 16px !important; }
}
