/* Chrome for docs/demos/demo.html — the one demo page every component shares.
   The dock is only ever seen here when a demo is opened on its own: embedded
   in a docs page, demo-viewport.js lifts its controls into the page toolbar,
   where extra.css restyles them to match the docs theme. */

body {
  margin: 0;
  color: var(--theme-color-ink, var(--bs-body-color));
  background: var(--theme-color-surface, var(--bs-body-bg));
  font-family: var(--theme-font-body, var(--bs-body-font-family));
}

/* What a site theme does globally; unset tokens keep Bootstrap's headings. */
:is(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) {
  font-family: var(--theme-font-heading, inherit);
  font-weight: var(--theme-heading-weight, 500);
  letter-spacing: var(--theme-tracking-tight, normal);
}

/* Room around a component that sits inside a page's content column; a
   full-bleed component (Hero Banner) opts out via body[data-full-bleed]. */
#demo-root {
  padding: 1.5rem;
}

/* The dark section a dark color_scheme is placed on, as a site would. */
#demo-root:has([data-color-scheme="dark"]) {
  background-color: var(--theme-color-surface-inverse, #212529);
}

body[data-full-bleed] #demo-root {
  padding: 0;
}

.demo-dock {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  padding: 0.6rem 1rem;
  font: 0.7rem system-ui, sans-serif;
  color: #212529;
  background: #f8f9fa;
  border-top: 1px solid #dee2e6;
  box-shadow: 0 -0.25rem 0.75rem rgb(0 0 0 / 8%);
}

/* Preview actions (Statistic's Replay) when the demo is opened on its own. */
.demo-dock .demo-icon-btn {
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
  font: inherit;
}

.demo-dock .demo-icon-btn svg {
  width: 0.9rem;
  height: 0.9rem;
}

/* An empty dock (controls not built yet, or already lifted into the docs
   page) shouldn't leave a bar behind. */
.demo-dock:empty {
  display: none;
}

.demo-dock label {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  white-space: nowrap;
  cursor: pointer;
}

.demo-dock label[hidden] {
  display: none;
}

.demo-dock__group {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding-left: 1.25rem;
  border-left: 1px solid #dee2e6;
}

.demo-dock__group:first-child {
  padding-left: 0;
  border-left: 0;
}

/* An author display rule beats the UA [hidden] default regardless of
   specificity, so display: flex above would otherwise always win. */
.demo-dock__group[hidden] {
  display: none;
}

.demo-dock input[type="checkbox"] {
  accent-color: #3f0da8;
}

.demo-select {
  padding: 0.15rem 0.35rem;
  color: inherit;
  border: 1px solid #ced4da;
  border-radius: 0.35rem;
  background: #fff;
  font: inherit;
}

.demo-options {
  position: relative;
}

.demo-options__trigger {
  padding: 0.15rem 0.35rem;
  color: inherit;
  cursor: pointer;
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.35rem;
  font: inherit;
}

.demo-options__panel {
  position: absolute;
  bottom: calc(100% + 0.35rem);
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 9rem;
  padding: 0.6rem 0.75rem;
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.5rem;
  box-shadow: 0 0.25rem 0.75rem rgb(0 0 0 / 15%);
}

.demo-options__panel[hidden] {
  display: none;
}
