/* Media Boxes — demo site, shared chrome (landing + lab pages).
   World: a calm, exact product site. White ground, black type, one accent (the Media Boxes coral), photos carry all the colour.
   Type: Archivo; display set wide (font-stretch 112%), body at normal width, sentence case. Everything is prefixed demo-; it never styles bare elements outside .demo-*
   scopes, so it cannot beat the engine's @layer rules inside the grids.
   Spacing scale: 4 / 8 / 16 / 24 / 32 / 48 / 64 / 96. Radius: 8px controls, 12px panels and media. */

@font-face { font-family: 'Archivo'; src: url('fonts/archivo-1.woff2') format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap; }

/* ---------- Tokens: one set, with dark overrides ---------- */

:root {
  color-scheme: light;

  --demo-bg: #ffffff;              /* ground */
  --demo-surface: #f5f6f8;         /* the one alternate surface: bands, hover fills, footer */
  --demo-line: #e3e5e9;            /* hairlines on panels and rules */
  --demo-line-strong: #b9bec7;     /* borders of controls */
  --demo-text: #111318;
  --demo-muted: #5a606b;

  /* the one accent: the Media Boxes coral (the version 3 logo colour) */
  --demo-brand: #e54e53;           /* logo, focus ring, small decorative marks; never under small text */
  --demo-accent: #e54e53;          /* primary button fill, pressed / active state: the brand coral itself (white text 3.8:1, so text on it is semibold or larger) */
  --demo-accent-hover: #d63f45;
  --demo-accent-ink: #ffffff;      /* text on the accent */
  --demo-accent-text: #c9343a;     /* accent as text: link hover (4.5:1 needs a deeper shade) */
  --demo-accent-shadow: rgb(229 78 83 / 0.5);
  --demo-tint: #fdf1f1;            /* the soft brand wash: hero frame, tinted bands */
  --demo-tint-line: #f6dcdc;
  --demo-select: rgb(229 78 83 / 0.22);

  /* code blocks are graphite in both themes */
  --demo-code-bg: #111318;
  --demo-code-line: rgb(255 255 255 / 0.1);
  --demo-code-text: #d9dde2;
  --demo-code-muted: #8b949e;
  --demo-code-tag: #8fb4ff;
  --demo-code-str: #a8d5b0;
  --demo-code-key: #f2f4f6;
  --demo-code-num: #ff9d8f;

  /* shadows exist only on floating things (menus, drawers) */
  --demo-shadow: 0 2px 6px rgb(17 19 24 / 0.06), 0 14px 36px rgb(17 19 24 / 0.14);
  --demo-scroll: #c3c7ce;

  --demo-radius: 8px;
  --demo-radius-lg: 12px;
  --demo-header-h: 64px;
  --demo-gutter: clamp(16px, 4vw, 48px);
  --demo-ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --demo-font: 'Archivo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --demo-mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;

  accent-color: var(--demo-accent);
  caret-color: var(--demo-brand);
  scrollbar-color: var(--demo-scroll) var(--demo-bg);
  text-underline-offset: 0.2em;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --demo-bg: #0f1114;
  --demo-surface: #171a1f;
  --demo-line: #2a2e35;
  --demo-line-strong: #454b55;
  --demo-text: #eceef2;
  --demo-muted: #a3a9b3;
  --demo-brand: #f06a6e;
  --demo-accent: #f06a6e;
  --demo-accent-hover: #ff7a7d;
  --demo-accent-ink: #121316;
  --demo-accent-text: #ff7a7d;
  --demo-accent-shadow: rgb(240 106 110 / 0.35);
  --demo-tint: #1d1517;
  --demo-tint-line: #33252a;
  --demo-select: rgb(240 106 110 / 0.35);
  --demo-code-bg: #0a0b0e;
  --demo-shadow: 0 2px 6px rgb(0 0 0 / 0.4), 0 14px 36px rgb(0 0 0 / 0.5);
  --demo-scroll: #3a3f48;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --demo-bg: #0f1114;
    --demo-surface: #171a1f;
    --demo-line: #2a2e35;
    --demo-line-strong: #454b55;
    --demo-text: #eceef2;
    --demo-muted: #a3a9b3;
    --demo-brand: #f06a6e;
    --demo-accent: #f06a6e;
    --demo-accent-hover: #ff7a7d;
    --demo-accent-ink: #121316;
    --demo-accent-text: #ff7a7d;
    --demo-accent-shadow: rgb(240 106 110 / 0.35);
    --demo-tint: #1d1517;
    --demo-tint-line: #33252a;
    --demo-select: rgb(240 106 110 / 0.35);
    --demo-code-bg: #0a0b0e;
    --demo-shadow: 0 2px 6px rgb(0 0 0 / 0.4), 0 14px 36px rgb(0 0 0 / 0.5);
    --demo-scroll: #3a3f48;
  }
}

/* Browser surfaces carry the palette. */
::selection { background: var(--demo-select); color: inherit; }
:where(*) { scrollbar-color: var(--demo-scroll) transparent; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: var(--demo-scroll); border-radius: 6px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* The grids on demo pages are the customer's gallery: neutral skins stay neutral. Only the focus ring follows the palette. */
media-boxes { --mb-focus: var(--demo-brand); }
/* the active filter pill takes the brand accent (tabs keep their own underline) */
media-boxes .mb-filters:not([data-ui='tabs']) .mb-filter:is(.is-active, [aria-pressed='true']) { background: var(--demo-accent); color: var(--demo-accent-ink); font-weight: 600; }
/* group labels beside the pills are sentence case on this site */
media-boxes .mb-filters-label { font-size: var(--mb-font-size-sm); }

html { scroll-padding-top: calc(var(--demo-header-h) + 16px); scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--demo-font); font-size: 17px; line-height: 1.6; font-stretch: 100%;
  color: var(--demo-text); background: var(--demo-bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body > main { flex: 1 0 auto; }
/* the header is built by demo.js: reserve its row until it exists so the page never shifts */
body:not(:has(> .demo-header)) { padding-top: var(--demo-header-h); }

.demo-sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:where(.demo-header, .demo-main, .demo-footer, .demo-skip, main) :focus-visible { outline: 2px solid var(--demo-brand); outline-offset: 2px; }
.demo-skip {
  position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: var(--demo-radius);
  background: var(--demo-text); color: var(--demo-bg); text-decoration: none; font-weight: 600;
}
.demo-skip:focus { top: 12px; }

.demo-wrap { width: 100%; max-width: calc(1240px + 2 * var(--demo-gutter)); margin-inline: auto; padding-inline: var(--demo-gutter); box-sizing: border-box; }
.demo-wrap--wide { max-width: calc(1344px + 2 * var(--demo-gutter)); }
.demo-wrap--full { max-width: none; padding-inline: 0; }

/* Display type: Archivo set wide (wdth axis), weight 800, sentence case. Body stays at normal width. */
.demo-display { font-weight: 800; font-stretch: 112%; line-height: 1.04; letter-spacing: -0.035em; text-wrap: balance; }

/* ---------- Buttons and chips ---------- */

.demo-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; box-sizing: border-box;
  font: inherit; font-size: 0.9375rem; font-weight: 600; line-height: 1; white-space: nowrap;
  color: var(--demo-text); background: var(--demo-bg);
  border: 1px solid var(--demo-line-strong); border-radius: var(--demo-radius);
  text-decoration: none; cursor: pointer;
  transition: background-color 160ms var(--demo-ease), border-color 160ms var(--demo-ease), color 160ms var(--demo-ease);
}
.demo-btn:hover { border-color: var(--demo-text); }
.demo-btn:active { background: var(--demo-surface); }
.demo-btn:disabled, .demo-btn[aria-disabled='true'] { opacity: 0.5; cursor: not-allowed; }
.demo-btn--primary { color: var(--demo-accent-ink); background: var(--demo-accent); border-color: var(--demo-accent); }
.demo-btn--primary:hover { background: var(--demo-accent-hover); border-color: var(--demo-accent-hover); }
.demo-btn--primary:active { background: var(--demo-accent-hover); }
.demo-btn--ghost { background: transparent; border-color: transparent; }
.demo-btn--ghost:hover { background: var(--demo-surface); border-color: transparent; }
.demo-btn--pill { border-radius: 999px; }
.demo-btn--lg { min-height: 48px; padding-inline: 24px; font-size: 1rem; }
.demo-btn--icon { width: 40px; padding: 0; }
.demo-btn svg { width: 18px; height: 18px; flex: none; }
.demo-btn[hidden] { display: none; }

.demo-chip {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; box-sizing: border-box;
  font-size: 0.8125rem; font-weight: 550; line-height: 1; color: var(--demo-muted);
  background: var(--demo-surface); border: 1px solid var(--demo-line); border-radius: 999px;
}

/* ---------- Header + mega menu ---------- */

.demo-header { position: sticky; top: 0; z-index: 50; background: var(--demo-bg); border-bottom: 1px solid var(--demo-line); }
.demo-header__inner { display: flex; align-items: center; gap: 8px; height: var(--demo-header-h); }

.demo-brand {
  display: inline-flex; align-items: center; gap: 10px; margin-inline-end: 24px;
  color: var(--demo-text); text-decoration: none; font-weight: 720; font-size: 1.125rem; letter-spacing: -0.02em; white-space: nowrap; line-height: 1;
}
.demo-brand__mark { width: 30px; height: 30px; flex: none; color: var(--demo-brand); }

.demo-nav { display: flex; align-items: center; gap: 4px; }
.demo-nav__link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; box-sizing: border-box;
  font: inherit; font-size: 0.9375rem; font-weight: 550; color: var(--demo-text); background: transparent; border: 0; border-radius: var(--demo-radius);
  text-decoration: none; cursor: pointer;
  transition: color 160ms var(--demo-ease), background-color 160ms var(--demo-ease);
}
.demo-nav__link:hover { color: var(--demo-accent-text); }
.demo-nav__menu[aria-expanded='true'] { background: var(--demo-surface); }
.demo-nav__link[aria-current='page'] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 8px; }
.demo-nav__link svg { width: 16px; height: 16px; flex: none; transition: transform 200ms var(--demo-ease); }
.demo-nav__menu[aria-expanded='true'] svg { transform: rotate(180deg); }
.demo-nav__menu .demo-nav__short, .demo-nav__menu .demo-nav__bars { display: none; }
.demo-header__spacer { flex: 1 1 auto; }
.demo-header__actions { display: flex; align-items: center; gap: 8px; }
.demo-btn .demo-get__short { display: none; }

.demo-mega {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 5;
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px 40px;
  margin: 8px var(--demo-gutter) 0; padding: 24px; box-sizing: border-box;
  max-height: calc(100vh - var(--demo-header-h) - 24px); overflow-y: auto;
  background: var(--demo-bg); border: 1px solid var(--demo-line); border-radius: var(--demo-radius-lg); box-shadow: var(--demo-shadow);
}
@media (min-width: 1336px) { .demo-mega { left: 50%; right: auto; width: 1240px; margin-inline: 0; transform: translateX(-50%); } }
.demo-mega[hidden] { display: none; }
.demo-mega__links { display: none; }
.demo-mega__group h3 { margin: 0 0 8px; padding-inline: 8px; }
.demo-mega__group h3 button {
  all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; justify-content: space-between; min-height: 32px;
  font: 650 0.9375rem/1.2 var(--demo-font); color: var(--demo-muted);
}
.demo-mega__group h3 svg { display: none; width: 18px; height: 18px; transition: transform 200ms var(--demo-ease); }
.demo-mega__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.demo-mega__group--sites .demo-mega__list { grid-template-columns: 1fr 1fr; gap: 2px 16px; }
.demo-mega a {
  display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: var(--demo-radius); color: var(--demo-text); text-decoration: none; min-height: 44px; box-sizing: border-box;
}
.demo-mega a:hover { background: var(--demo-surface); }
.demo-mega a[aria-current='page'] { background: var(--demo-surface); box-shadow: inset 0 0 0 1px var(--demo-line); }
.demo-mega a > span { display: block; min-width: 0; }
.demo-mega strong { display: block; font-size: 0.9375rem; line-height: 1.3; font-weight: 650; }
.demo-mega small { display: block; margin-top: 1px; font-size: 0.8125rem; line-height: 1.35; color: var(--demo-muted); }
.demo-mega__thumb { flex: none; width: 52px; height: 36px; border-radius: 6px; object-fit: cover; background: var(--demo-surface); }
.demo-mega a.demo-mega__promo {
  display: grid; align-content: end; gap: 4px; margin-top: 16px; padding: 16px; border-radius: var(--demo-radius-lg);
  background: var(--demo-surface); border: 1px solid var(--demo-line);
}
.demo-mega a.demo-mega__promo:hover { border-color: var(--demo-line-strong); background: var(--demo-surface); }
.demo-mega__promo b { font-size: 0.9375rem; }
.demo-mega__promo span { font-size: 0.8125rem; color: var(--demo-muted); line-height: 1.4; }

@media (max-width: 899px) {
  .demo-nav__extra { display: none; }
  .demo-nav__menu .demo-nav__long { display: none; }
  .demo-nav__menu .demo-nav__short { display: inline; }
  .demo-nav__menu .demo-nav__bars { display: block; }
  .demo-nav__menu .demo-nav__chev { display: none; }
  .demo-mega { grid-template-columns: minmax(0, 1fr); gap: 0; margin-inline: 8px; padding: 8px; }
  .demo-mega__links { display: grid; margin: 0; padding: 0 0 8px; list-style: none; border-bottom: 1px solid var(--demo-line); }
  .demo-mega__links a { min-height: 48px; font-weight: 600; }
  .demo-mega__group { border-bottom: 1px solid var(--demo-line); }
  .demo-mega__group:last-child { border-bottom: 0; }
  .demo-mega__group h3 { margin: 0; padding: 0; }
  .demo-mega__group h3 button { padding: 8px 8px; min-height: 48px; cursor: pointer; color: var(--demo-text); }
  .demo-mega__group h3 svg { display: block; }
  .demo-mega__group h3 button[aria-expanded='true'] svg { transform: rotate(180deg); }
  .demo-mega__group--sites .demo-mega__list { grid-template-columns: 1fr; }
  .demo-mega__list { padding-bottom: 8px; }
  .demo-mega__list[hidden] { display: none; }
  .demo-mega a.demo-mega__promo { display: none; }
}
@media (min-width: 900px) { .demo-mega__list[hidden] { display: grid; } }
@media (max-width: 520px) {
  .demo-brand { margin-inline-end: 0; }
  .demo-header__inner { gap: 4px; }
  .demo-btn .demo-get__long { display: none; }
  .demo-btn .demo-get__short { display: inline; }
}
@media (max-width: 389px) {
  .demo-brand { gap: 8px; font-size: 1rem; }
  .demo-brand__mark { width: 26px; height: 26px; }
  .demo-header__inner .demo-nav__link { padding-inline: 8px; }
  .demo-header__actions { gap: 4px; }
  .demo-header__actions .demo-btn { padding-inline: 14px; }
}

/* ---------- Page heads (lab pages) ---------- */

.demo-main { padding-block: clamp(32px, 5vw, 64px) clamp(48px, 7vw, 96px); }
.demo-pagehead { max-width: 860px; margin-bottom: clamp(24px, 4vw, 40px); }
.demo-pagehead h1 { margin: 0; font-size: clamp(2.25rem, 4.6vw, 4rem); font-weight: 800; font-stretch: 112%; line-height: 1.02; letter-spacing: -0.035em; text-wrap: balance; }
.demo-lead { margin: 16px 0 0; font-size: clamp(1.0625rem, 1.5vw, 1.1875rem); line-height: 1.6; color: var(--demo-muted); max-width: 62ch; text-wrap: pretty; }
.demo-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; padding: 0; list-style: none; }

/* ---------- Stage, controls, panels ---------- */

.demo-stage { min-width: 0; }
.demo-stage--dark { padding: clamp(16px, 3vw, 32px); border-radius: var(--demo-radius-lg); background: var(--demo-surface); border: 1px solid var(--demo-line); }

.demo-panel {
  display: flex; flex-wrap: wrap; align-items: end; gap: 16px 24px;
  margin: 0 0 32px; padding: 16px 24px; box-sizing: border-box;
  background: var(--demo-bg); border: 1px solid var(--demo-line); border-radius: var(--demo-radius-lg);
}
.demo-field { display: grid; gap: 6px; min-width: 0; font-size: 0.875rem; font-weight: 600; color: var(--demo-text); }
.demo-field select, .demo-field input[type='number'], .demo-field input[type='text'], .demo-field input[type='search'] {
  box-sizing: border-box; min-height: 40px; max-width: 100%; padding: 0 12px; font: inherit; font-size: 0.9375rem; font-weight: 500;
  color: var(--demo-text); background: var(--demo-bg); border: 1px solid var(--demo-line-strong); border-radius: var(--demo-radius);
}
.demo-field input[type='number'] { width: 5.5em; }
.demo-field input[type='range'] { width: min(220px, 100%); min-height: 40px; margin: 0; }
.demo-field output { font-size: 0.875rem; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--demo-muted); }
.demo-field__row { display: flex; justify-content: space-between; gap: 8px; }
.demo-check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-size: 0.9375rem; color: var(--demo-text); cursor: pointer; }
.demo-check input { width: 18px; height: 18px; margin: 0; }

/* segmented control: the pressed segment takes the accent */
.demo-seg { display: inline-flex; flex-wrap: wrap; padding: 3px; gap: 2px; border: 1px solid var(--demo-line); border-radius: var(--demo-radius); background: var(--demo-surface); }
.demo-seg button {
  min-height: 38px; padding: 0 16px; font: inherit; font-size: 0.9375rem; font-weight: 600; cursor: pointer;
  color: var(--demo-muted); background: transparent; border: 0; border-radius: 6px;
  transition: background-color 160ms var(--demo-ease), color 160ms var(--demo-ease);
}
.demo-seg button:hover { color: var(--demo-text); }
.demo-seg button[aria-pressed='true'], .demo-seg button[aria-selected='true'] { color: var(--demo-accent-ink); background: var(--demo-accent); }

.demo-ext { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.demo-ext__label { font: 500 0.875rem/1.3 var(--demo-font); color: var(--demo-muted); margin-inline-end: 4px; }
.demo-ext button, .demo-ext input {
  box-sizing: border-box; min-height: 40px; padding: 0 16px; font: inherit; font-size: 0.9375rem; font-weight: 600;
  color: var(--demo-text); background: var(--demo-bg); border: 1px solid var(--demo-line-strong); border-radius: 999px; cursor: pointer;
  transition: border-color 160ms var(--demo-ease), background-color 160ms var(--demo-ease);
}
.demo-ext button:hover { border-color: var(--demo-text); }
.demo-ext input { cursor: text; font-weight: 500; min-width: 0; width: 200px; max-width: 100%; }
.demo-ext button.is-active { color: var(--demo-accent-ink); background: var(--demo-accent); border-color: var(--demo-accent); }

.demo-split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.demo-aside {
  position: sticky; top: calc(var(--demo-header-h) + 24px);
  padding: 24px; box-sizing: border-box; background: var(--demo-bg); border: 1px solid var(--demo-line); border-radius: var(--demo-radius-lg);
}
.demo-aside h2 { margin: 0 0 8px; font: 700 1.0625rem/1.3 var(--demo-font); color: var(--demo-text); }
.demo-aside h2:not(:first-child) { margin-top: 24px; }
.demo-aside ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 0.9375rem; }
.demo-aside li { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.demo-aside li span { color: var(--demo-muted); font-size: 0.9375rem; text-align: end; }
.demo-aside .demo-check { min-height: 32px; }
.demo-kbd {
  display: inline-block; min-width: 1.6em; padding: 1px 7px; box-sizing: border-box; text-align: center;
  font: 600 0.8125rem/1.6 var(--demo-font); background: var(--demo-surface); border: 1px solid var(--demo-line-strong); border-bottom-width: 2px; border-radius: 6px;
}
.demo-keys { display: inline-flex; gap: 4px; }

/* ---------- Code disclosure and code blocks ---------- */

.demo-code { margin-top: clamp(40px, 6vw, 72px); background: var(--demo-bg); border: 1px solid var(--demo-line); border-radius: var(--demo-radius-lg); }
.demo-code > summary {
  display: flex; align-items: center; gap: 8px; padding: 16px 24px; min-height: 56px; box-sizing: border-box; cursor: pointer; list-style: none; font-weight: 650;
  border-radius: var(--demo-radius-lg);
}
.demo-code > summary::-webkit-details-marker { display: none; }
.demo-code > summary::before {
  content: ''; width: 8px; height: 8px; flex: none; border-inline-end: 2px solid currentColor; border-block-end: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform 200ms var(--demo-ease); margin-inline: 4px 8px;
}
.demo-code[open] > summary::before { transform: rotate(45deg); }
.demo-code > summary small { margin-inline-start: auto; font-weight: 500; color: var(--demo-muted); }
.demo-code__body { position: relative; padding: 0 16px 16px; }
.demo-copy {
  position: absolute; top: 12px; right: 12px; z-index: 1; min-height: 36px; padding: 0 14px; font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer;
  color: #f2f4f6; background: rgb(255 255 255 / 0.1); border: 1px solid rgb(255 255 255 / 0.22); border-radius: var(--demo-radius);
  transition: background-color 160ms var(--demo-ease);
}
.demo-copy:hover { background: rgb(255 255 255 / 0.2); }
.demo-copy:focus-visible { outline: 2px solid #ff7a7d; outline-offset: 2px; }
.demo-pre, .demo-code pre {
  position: relative; margin: 0; padding: 24px; max-height: 560px; overflow: auto; box-sizing: border-box;
  font: 0.875rem/1.7 var(--demo-mono); tab-size: 2; color: var(--demo-code-text); background: var(--demo-code-bg); border-radius: var(--demo-radius);
  border: 1px solid var(--demo-code-line); scrollbar-color: rgb(255 255 255 / 0.3) transparent;
}
.demo-pre code, .demo-code pre code { font: inherit; white-space: pre; }
.demo-pre:focus-visible { outline: 2px solid var(--demo-accent-text); outline-offset: 2px; }
.tk-c { color: var(--demo-code-muted); } .tk-t { color: var(--demo-code-tag); } .tk-s { color: var(--demo-code-str); } .tk-k { color: var(--demo-code-key); } .tk-n { color: var(--demo-code-num); }

/* ---------- Item bits used by demos ---------- */

/* two filter groups in one toolbar: draw a divider between them */
@media (min-width: 900px) {
  media-boxes .mb-filters + .mb-filters { margin-inline-start: 12px; padding-inline-start: 20px; border-inline-start: 1px solid var(--mb-border); }
}

/* ---------- Prev / next ---------- */

.demo-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: clamp(40px, 6vw, 72px); }
.demo-pager a {
  display: grid; gap: 4px; padding: 16px 24px; min-height: 40px; color: var(--demo-text); text-decoration: none; box-sizing: border-box;
  background: var(--demo-bg); border: 1px solid var(--demo-line); border-radius: var(--demo-radius-lg);
  transition: border-color 160ms var(--demo-ease);
}
.demo-pager a:hover { border-color: var(--demo-text); }
.demo-pager a:hover strong { color: var(--demo-accent-text); }
.demo-pager a:last-child:not(:first-child) { text-align: end; grid-column: 2; }
.demo-pager small { font: 500 0.875rem/1.3 var(--demo-font); color: var(--demo-muted); }
.demo-pager strong { font-size: 1.125rem; font-weight: 700; transition: color 160ms var(--demo-ease); }

/* ---------- Footer ---------- */

.demo-footer { margin-top: 48px; padding: 56px 0 48px; background: var(--demo-surface); border-top: 1px solid var(--demo-line); color: var(--demo-muted); font-size: 0.9375rem; }
.demo-footer__inner { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
.demo-footer p { margin: 12px 0 0; max-width: 34ch; line-height: 1.55; }
.demo-footer h2 { margin: 0 0 8px; font: 650 0.9375rem/1.3 var(--demo-font); color: var(--demo-text); }
.demo-footer ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; }
.demo-footer li a { display: inline-flex; align-items: center; min-height: 32px; color: var(--demo-muted); text-decoration: none; }
.demo-footer li a:hover { color: var(--demo-accent-text); text-decoration: underline; }
.demo-footer__legal { grid-column: 1 / -1; margin-top: 8px; padding-top: 24px; border-top: 1px solid var(--demo-line); }
.demo-footer__legal p { max-width: none; margin: 0; }
.demo-footer__legal a { color: var(--demo-text); }
.demo-footer__legal a:hover { color: var(--demo-accent-text); }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .demo-split { grid-template-columns: minmax(0, 1fr); }
  .demo-aside { position: static; }
  .demo-footer__inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .demo-panel { padding: 16px; }
  .demo-pager { grid-template-columns: 1fr; }
  .demo-pager a:last-child:not(:first-child) { grid-column: 1; }
  .demo-footer__inner { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .demo-btn, .demo-nav__link, .demo-nav__link svg, .demo-code > summary::before, .demo-pager a, .demo-pager strong, .demo-seg button, .demo-ext button, .demo-copy { transition: none; }
}

/* ---------- Page specific ---------- */

.demo-h2 { margin: 0 0 8px; font-size: clamp(1.75rem, 3.4vw, 2.5rem); line-height: 1.08; font-weight: 800; font-stretch: 112%; letter-spacing: -0.035em; text-wrap: balance; }
.demo-bleed { padding-inline: 4px; min-height: 480px; }
.demo-wrap.demo-pagehead > * { max-width: 860px; }

.demo-ext--big { display: block; margin-bottom: 0; }
.demo-ext--big input { width: 100%; min-height: 56px; padding-inline: 24px; font-size: 1.0625rem; background: var(--demo-bg); }

/* ---------- Deep links ---------- */

.dl-box { display: grid; gap: 24px; margin-bottom: 32px; padding: 24px; background: var(--demo-bg); border: 1px solid var(--demo-line); border-radius: var(--demo-radius-lg); }
.dl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.dl-bar__label { font: 500 0.875rem/1.3 var(--demo-font); color: var(--demo-muted); }
.dl-bar code { flex: 1 1 320px; min-width: 0; box-sizing: border-box; padding: 10px 16px; min-height: 40px; display: flex; align-items: center; font: 0.8125rem/1.4 var(--demo-mono); color: var(--demo-code-text); background: var(--demo-code-bg); border-radius: var(--demo-radius); overflow-wrap: anywhere; }
.dl-examples { display: grid; gap: 8px; }
.dl-examples ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }

/* ---------- API ---------- */

.api { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 32px; align-items: start; }
.api__calls { position: sticky; top: calc(var(--demo-header-h) + 16px); display: grid; gap: 24px; padding: 24px; box-sizing: border-box; background: var(--demo-bg); border: 1px solid var(--demo-line); border-radius: var(--demo-radius-lg); max-height: calc(100vh - var(--demo-header-h) - 32px); overflow: auto; }
.api-group h2 { margin: 0 0 8px; font: 700 1.0625rem/1.3 var(--demo-font); color: var(--demo-text); }
.api-group ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.api-group li { display: grid; gap: 4px; }
.api-group .demo-btn { justify-content: flex-start; }
.api-group code { font: 0.75rem/1.4 var(--demo-mono); color: var(--demo-muted); overflow-wrap: anywhere; }
.api__main { min-width: 0; display: grid; gap: 32px; }
.api-logbox { background: var(--demo-code-bg); border-radius: var(--demo-radius-lg); border: 1px solid var(--demo-code-line); overflow: hidden; }
.api-logbox__head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 24px; border-bottom: 1px solid var(--demo-code-line); color: #f2f4f6; }
.api-logbox h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 0.9375rem; }
.api-logbox .demo-btn--ghost { color: var(--demo-code-text); }
.api-logbox .demo-btn--ghost:hover { background: rgb(255 255 255 / 0.1); }
.api-logbox .demo-chip { background: transparent; border-color: rgb(255 255 255 / 0.3); color: var(--demo-code-text); }
.api-log { height: 260px; overflow: auto; padding: 16px 24px; font: 0.8125rem/1.7 var(--demo-mono); color: var(--demo-code-text); scrollbar-color: rgb(255 255 255 / 0.3) transparent; }
.api-log__line { display: flex; gap: 16px; white-space: pre; }
.api-log__line b { flex: none; min-width: 9ch; color: var(--demo-code-tag); font-weight: 600; }
.api-log__line span:last-child { color: var(--demo-code-str); }
.api-log__t { color: var(--demo-code-muted); }
.api-log:empty::before { content: 'Press a button. Events appear here.'; color: var(--demo-code-muted); }
@media (max-width: 1000px) { .api { grid-template-columns: minmax(0, 1fr); } .api__calls { position: static; max-height: none; } }

/* ---------- RTL ---------- */

.rtl-stage { font-family: var(--demo-font); }

/* ---------- Credits page ---------- */
.credits { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 24px 20px; }
.credits__item { display: grid; gap: 10px; align-content: start; }
.credits__item img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--demo-radius-lg); background: var(--demo-surface); }
.credits__item p { margin: 0; display: grid; gap: 2px; font-size: 0.9375rem; line-height: 1.4; }
.credits__item strong { color: var(--demo-text); font-weight: 650; }
.credits__item a { color: var(--demo-muted); }
.credits__item a:hover { color: var(--demo-accent-text); }

.demo-lead a { color: var(--demo-text); text-decoration-thickness: 1px; }
.demo-lead a:hover { color: var(--demo-accent-text); }
