.embed-page { --embed-border: #dce6f5; }
.dark .embed-page { --embed-border: #2a508a; }
.embed-page .page-intro { margin-bottom: .65rem; }
.embed-start, .embed-preview-header, .embed-code-toolbar, .embed-code-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .65rem;
}
.embed-start { margin-bottom: 1.35rem; }
.embed-section { scroll-margin-top: 5rem; }
.embed-section-title { font-size: clamp(1.25rem, 3vw, 1.7rem); letter-spacing: -.025em; font-weight: 800; margin-bottom: .55rem; }
.embed-workspace { display: grid; gap: .7rem; align-items: stretch; }
.embed-workspace > *, .embed-code { min-width: 0; }
.embed-preview { display: flex; flex-direction: column; min-height: 0; }
.embed-preview-header { justify-content: space-between; margin-bottom: .65rem; }
.embed-preview-header h3 { display: inline-flex; gap: .35rem; align-items: center; font-weight: 750; }
.embed-choice-group { display: flex; flex-wrap: wrap; gap: .25rem; min-width: 0; }
.embed-choice { display: inline-flex; position: relative; cursor: pointer; }
.embed-choice input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.embed-choice span {
  padding: .35rem .6rem; min-height: 44px; display: inline-flex; align-items: center;
  border: 1px solid #94a3b8; border-radius: .5rem; color: #1e3d70;
  font-size: .8125rem; font-weight: 700; transition: background-color .15s, border-color .15s;
}
.embed-choice input:checked + span { background: #dce6f5; border-color: #5a84ba; }
.embed-choice input:focus-visible + span { outline: 2px solid #1e3d70; outline-offset: 2px; }
.dark .embed-choice span { color: #e8f0fa; border-color: #5a84ba; }
.dark .embed-choice input:checked + span { background: #1e3d70; }
.dark .embed-choice input:focus-visible + span { outline-color: #8aabd3; }
.embed-frame-wrap { flex: 0 0 auto; height: 450px; min-height: 280px; overflow: hidden; border: 1px solid var(--embed-border); border-radius: .7rem; background: #e8f0fa; }
.embed-frame-wrap iframe { width: 100%; height: 100%; display: block; border: 0; }
.embed-note { color: #475569; font-size: .8125rem; line-height: 1.5; margin-top: .5rem; }
.dark .embed-note { color: #dce6f5; }
.embed-note a, .embed-consent a { text-decoration: underline; text-underline-offset: .18em; }
.embed-settings > summary, .embed-code > summary { padding-inline: .15rem; color: #1e3d70; font-size: 1rem; }
.dark :is(.embed-settings, .embed-code) > summary { color: #e8f0fa; }
.embed-settings-form { display: grid; gap: .75rem; padding-top: .55rem; }
.embed-field-label { display: block; margin-bottom: .35rem; font-size: .875rem; font-weight: 650; }
.embed-theme-picker { min-width: 0; }
.embed-theme-tabs { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--embed-border); scrollbar-width: thin; }
.embed-theme-tabs button {
  flex: 0 0 auto; min-height: 40px; padding: .45rem .65rem; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: #475569; font-size: .78rem; font-weight: 700; cursor: pointer;
}
.embed-theme-tabs button[aria-selected="true"] { color: #1e3d70; border-bottom-color: #3866a5; }
.embed-theme-tabs button:focus-visible { outline: 2px solid #3866a5; outline-offset: -2px; border-radius: .25rem; }
.dark .embed-theme-tabs button { color: #dce6f5; }
.dark .embed-theme-tabs button[aria-selected="true"] { color: #fff; border-bottom-color: #8aabd3; }
.embed-theme-panel { min-width: 0; }
.embed-theme-note { margin: .35rem 0 0; }
.embed-theme-strip {
  display: flex; gap: .5rem; min-width: 0; margin: 0; padding: .55rem .1rem .65rem;
  overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x proximity; scrollbar-width: thin;
  scrollbar-color: #94a3b8 transparent;
}
.embed-theme-card { position: relative; flex: 0 0 6.15rem; cursor: pointer; scroll-snap-align: start; }
.embed-theme-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.embed-theme-card-content {
  display: block; padding: .3rem; border: 1px solid #cbd5e1; border-radius: .6rem;
  background: #fff; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.dark .embed-theme-card-content { background: #101d33; border-color: #46648d; }
.embed-theme-card input:checked + .embed-theme-card-content { border: 2px solid #3866a5; padding: calc(.3rem - 1px); box-shadow: 0 0 0 2px rgb(56 102 165 / 15%); }
.dark .embed-theme-card input:checked + .embed-theme-card-content { border-color: #8aabd3; box-shadow: 0 0 0 2px rgb(138 171 211 / 20%); }
.embed-theme-card input:focus-visible + .embed-theme-card-content { outline: 2px solid #1e3d70; outline-offset: 2px; }
.dark .embed-theme-card input:focus-visible + .embed-theme-card-content { outline-color: #b9d1f1; }
.embed-theme-card:hover .embed-theme-card-content { transform: translateY(-1px); border-color: #5a84ba; }
.embed-theme-sample {
  display: block; height: 3.15rem; overflow: hidden; padding: .35rem; border-radius: .35rem;
  background: var(--sample-bg); border: 1px solid color-mix(in srgb, var(--sample-accent) 22%, transparent);
}
.embed-theme-sample-bar { display: block; height: .27rem; width: 55%; border-radius: 1rem; background: var(--sample-accent); opacity: .8; }
.embed-theme-sample-map { display: flex; align-items: center; justify-content: center; gap: .22rem; height: 1.9rem; margin-top: .22rem; border-radius: .2rem; background: var(--sample-map); }
.embed-theme-sample-map i { display: block; width: .7rem; height: .48rem; border-radius: 50% 50% 45% 45%; background: var(--sample-accent); opacity: .55; }
.embed-theme-sample-map i:nth-child(2) { align-self: flex-start; margin-top: .2rem; opacity: .82; }
.embed-theme-sample-map i:nth-child(3) { align-self: flex-end; margin-bottom: .2rem; opacity: .35; }
.embed-theme-sample-map b { display: block; width: 1px; height: 1.3rem; background: var(--sample-accent); opacity: .25; transform: rotate(35deg); }
.embed-theme-name { display: block; padding: .34rem .15rem .12rem; overflow: hidden; text-align: center; text-overflow: ellipsis; white-space: nowrap; font-size: .72rem; font-weight: 700; }
.embed-height-control { display: flex; align-items: center; gap: .55rem; }
.embed-height-control input { flex: 1; padding: 0; accent-color: #3866a5; }
.embed-height-control output { min-width: 4rem; font-size: .8125rem; font-weight: 700; text-align: right; white-space: nowrap; }
.embed-advanced { border-top: 1px solid var(--embed-border); padding-top: .55rem; }
.embed-advanced > h3 { margin: 0 0 .55rem; color: #1e3d70; font-size: .9rem; font-weight: 750; }
.dark .embed-advanced > h3 { color: #e8f0fa; }
.embed-check { display: inline-flex; gap: .45rem; align-items: center; min-height: 44px; padding-block: .25rem; margin-top: .3rem; font-size: .875rem; }
.embed-check input, .embed-consent input { width: 1.1rem; height: 1.1rem; accent-color: #3866a5; }
.embed-code { margin-top: .65rem; }
.embed-code-toolbar { justify-content: space-between; margin-top: .35rem; }
.embed-note code { padding: .1rem .24rem; border-radius: .15rem; color: #713f12; background: #fef3c7; }
.dark .embed-note code { color: #fde68a; background: #422006; }
.embed-snippet {
  display: block; width: 100%; max-width: 100%; margin-top: .65rem; border-radius: .6rem;
  padding: .75rem; background: #0f172a; color: #e2e8f0; font: .8125rem/1.55 ui-monospace, monospace;
  overflow: auto; resize: vertical;
}
.embed-feedback { min-height: 1.3em; margin-top: .35rem; font-size: .8125rem; color: #1e3d70; }
.dark .embed-feedback { color: #bacde8; }
.embed-request { margin: clamp(1.6rem, 5vw, 3rem) 0 0; width: 100%; }
.embed-request-form { margin-top: .75rem; }
.embed-request-grid { display: grid; gap: 0 .75rem; }
.embed-request-form textarea { min-height: 5.5rem; }
.embed-consent { display: grid; grid-template-columns: auto 1fr; gap: .25rem .55rem; align-items: start; font-size: .875rem; }
.embed-consent a { grid-column: 2; }
.embed-consent input { margin-top: .13rem; }
.embed-request-form :is(input, textarea, select), [data-embed-errors] { scroll-margin-top: 5.5rem; }
@media (min-width: 640px) {
  .embed-request-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .embed-workspace { grid-template-columns: minmax(0, 1fr) minmax(15rem, .44fr); }
}

.embed-target { flex: 1 1 14rem; max-width: 21rem; }
.embed-target select { width: 100%; }
