/* U111 embed builder + widget (scoped) */
.embed-builder__grid {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 900px) {
  .embed-builder__grid {
    /* minmax(0, …): the area map / preview must not push the columns around when the mode changes */
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}
.embed-form fieldset {
  border: 1px solid var(--v2-border, #e2e8f0);
  border-radius: 8px;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
}
.embed-radio {
  display: block;
  margin: 0.35rem 0;
}
.embed-area-map {
  width: 100%;
  height: 260px;
  border-radius: 8px;
  overflow: hidden;
}
.embed-map {
  width: 100%;
}
/* Real widget size (width/height attributes from the size choice), shrunk only when the column is narrower. */
.embed-preview-wrap iframe.embed-preview {
  display: block;
  max-width: 100%;
  background: #f8fafc;
  border: 1px solid var(--v2-border, #e2e8f0) !important;
  border-radius: 8px;
}
.embed-snippet-label {
  display: block;
  margin-top: 1rem;
}
.embed-snippet {
  width: 100%;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
}
.embed-search-results {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  max-height: 12rem;
  overflow: auto;
}
.embed-search-results button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.4rem 0.6rem;
  border: 0;
  background: #fff;
  cursor: pointer;
}
/* The widget fills exactly its iframe: the map/card takes what the footer leaves, so the credit line is never cut
   off (fixed min-heights pushed the footer below the 300 px medium frame). */

.embed-root {
  margin: 0;
  font-family: system-ui, sans-serif;
  font-size: 14px;
  color: #0f172a;
  background: #fff;
}
.embed-root[data-theme="dark"] {
  color: #e2e8f0;
  background: #0f172a;
}
@media (prefers-color-scheme: dark) {
  .embed-root[data-theme="auto"] {
    color: #e2e8f0;
    background: #0f172a;
  }
}
html.embed-root,
.embed-root body {
  height: 100%;
}
.embed-widget {
  display: flex;
  flex-direction: column;
  height: 100vh;
  margin: 0;
  overflow: hidden;
  box-sizing: border-box;
}
.embed-card {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0.75rem 1rem;
}
.embed-card__title {
  font-size: 1rem;
  margin: 0 0 0.5rem;
}
.embed-card__status {
  margin: 0 0 0.75rem;
  line-height: 1.4;
}
.embed-card__connectors {
  margin: 0 0 0.75rem;
  padding-left: 1.1rem;
  font-size: 0.85rem;
}
.embed-footer {
  flex: 0 0 auto;
  padding: 0.35rem 0.75rem;
  font-size: 0.72rem;
  line-height: 1.3;
  border-top: 1px solid #e2e8f0;
}
.embed-root[data-theme="dark"] .embed-footer,
.embed-root[data-theme="auto"] .embed-footer {
  border-color: #334155;
}
.embed-footer a,
.embed-card__open {
  color: #0f766e;
}
/* Dark widget: brand teal lightened for contrast (default link blue was unreadable on #0f172a). */
.embed-root[data-theme="dark"] .embed-footer a,
.embed-root[data-theme="dark"] .embed-card__open {
  color: #5eead4;
}
@media (prefers-color-scheme: dark) {
  .embed-root[data-theme="auto"] .embed-footer a,
  .embed-root[data-theme="auto"] .embed-card__open {
    color: #5eead4;
  }
}
.embed-footer p {
  margin: 0;
}
.embed-footer__attr {
  margin: 0.1rem 0 0;
  opacity: 0.85;
}
.embed-map {
  flex: 1 1 auto;
  min-height: 0;
}
.embed-popup {
  position: absolute;
  z-index: 2;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  max-width: 220px;
  box-shadow: 0 4px 12px rgb(0 0 0 / 12%);
}
