/* 見本専用の標準CSS。Tailwindとアプリ側の変数には依存させない。 */
/* P34: app-owned images, stable carousel controls and frame-local lightbox. */
.ui-demo-image-view { position: relative; width: 100%; min-width: 0; aspect-ratio: 16 / 9; flex: none; overflow: hidden; background: #eef2f5; }
.ui-demo-image-view__image { display: block; width: 100%; height: 100%; object-fit: cover; }
.ui-demo-image-view--contain { height: 100%; min-height: 0; aspect-ratio: auto; flex: 1; }
.ui-demo-image-view--contain > .ui-demo-image-view__image { object-fit: contain; }
.ui-demo-image-view__status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 8px; text-align: center; overflow-wrap: anywhere; font-size: 13px; }
.ui-demo-image-example { height: 100%; min-width: 0; margin: 0; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.ui-demo-image-container, .ui-demo-image-container .ui-demo-static-content__body { height: 100%; }
.ui-demo-image-example--rounded > .ui-demo-image-view { border-radius: 16px; }
.ui-demo-image-example--contain { padding: 16px; }
.ui-demo-image-example__caption { margin: 0; flex: none; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.ui-demo-carousel { height: 100%; min-width: 0; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.ui-demo-carousel__slide { min-height: 0; flex: 1; overflow: hidden; }
.ui-demo-carousel__figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ui-demo-carousel__card { padding: 16px; border: 1px solid var(--ui-demo-border); border-radius: 8px; background: #fff; }
.ui-demo-card-text__title { margin: 0 0 8px; font-size: 18px; line-height: 1.5; overflow-wrap: anywhere; }
.ui-demo-card-text__body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ui-demo-carousel__controls { flex: none; display: flex; flex-direction: column; gap: 8px; }
.ui-demo-carousel__arrows, .ui-demo-carousel__positions { display: flex; align-items: center; justify-content: center; gap: 12px; }
.ui-demo-carousel__position { min-width: 36px; text-align: center; }
.ui-demo-carousel__position-button { width: 36px; height: 36px; padding: 4px; border: 1px solid var(--ui-demo-border); border-radius: 50%; background: #fff; cursor: pointer; }
.ui-demo-carousel__position-button[aria-pressed="true"] { background: #e0ebff; border-color: #2563eb; font-weight: 700; }
.ui-demo-carousel__position-button:focus-visible, .ui-demo-lightbox__thumbnail:focus-visible { outline: 2px solid #174da1; outline-offset: 2px; }
.ui-demo-lightbox { min-width: 0; height: 100%; padding: 12px; overflow: auto; }
.ui-demo-lightbox__thumbnails { display: flex; flex-wrap: wrap; align-items: start; gap: 12px; }
.ui-demo-lightbox__thumbnail { width: 140px; max-width: 100%; padding: 6px; border: 1px solid var(--ui-demo-border); border-radius: 6px; background: #fff; cursor: pointer; display: flex; flex-direction: column; gap: 6px; font-size: 13px; overflow-wrap: anywhere; }
.ui-demo-lightbox__thumbnail[aria-pressed="true"] { border-color: #2563eb; }
.ui-demo-lightbox__dialog { width: calc(100% - 32px); height: calc(100% - 32px); max-width: none; max-height: none; margin: auto; padding: 12px; border: 1px solid #7c8999; border-radius: 8px; background: #fff; color: var(--ui-demo-text); overflow: hidden; }
.ui-demo-lightbox__dialog[open] { display: flex; flex-direction: column; gap: 8px; }
.ui-demo-lightbox__dialog::backdrop { background: rgb(15 23 42 / .48); }
.ui-demo-lightbox__header, .ui-demo-lightbox__controls { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ui-demo-lightbox__title { margin: 0; font-size: 16px; line-height: 1.5; }
.ui-demo-lightbox__image { min-height: 0; flex: 1; }
.ui-demo-lightbox__caption { margin: 0; flex: none; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
/* P22: native controls and local draft feedback; no app/global reset. */
.ui-demo-date-example, .ui-demo-time-example, .ui-demo-color-example {
  height: 100%; width: 100%; min-width: 0; padding: 12px; overflow: auto;
  display: flex; flex-direction: column; gap: 8px;
}
.ui-demo-date__fields { display: flex; flex-wrap: wrap; gap: 12px; }
.ui-demo-date__field { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ui-demo-date__text-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.ui-demo-date__control, .ui-demo-time__control { width: 100%; min-width: 0; min-height: 36px; }
.ui-demo-date__help, .ui-demo-date__result, .ui-demo-date__error, .ui-demo-date__notice,
.ui-demo-time__result { margin: 0; overflow-wrap: anywhere; }
.ui-demo-date__help, .ui-demo-date__error, .ui-demo-date__notice { font-size: 12px; }
.ui-demo-date__error, .ui-demo-date__notice { color: #b42332; }
.ui-demo-color__label { font-size: 14px; font-weight: 700; }
.ui-demo-color__row { display: flex; align-items: center; gap: 8px; }
.ui-demo-color__row > .ui-demo-color__input { min-width: 0; width: 0; flex: 1; }
.ui-demo-color__picker { width: 64px; height: 36px; flex: none; cursor: pointer; }
.ui-demo-color__apply { flex: none; min-height: 36px; }
.ui-demo-color__palette { min-width: 0; margin: 0; padding: 0; border: 0; }
.ui-demo-color__options { display: flex; flex-wrap: wrap; gap: 6px; }
.ui-demo-color__option {
  min-width: 44px; min-height: 44px; padding: 4px; border: 2px solid transparent;
  border-radius: 5px; background: #f5f7fb; cursor: pointer;
}
.ui-demo-color__option[aria-pressed="true"] { border-color: #174da1; box-shadow: inset 0 0 0 1px #ffffff; }
.ui-demo-color__option:focus-visible { outline: 2px solid #174da1; outline-offset: 2px; }
.ui-demo-color__option-swatch { display: block; width: 20px; height: 20px; margin-inline: auto; border: 1px solid #697486; }
.ui-demo-color__result { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ui-demo-color__swatch { display: block; width: 48px; height: 24px; flex: none; border: 1px solid #697486; }
.ui-demo-color__value { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.ui-demo-color__help, .ui-demo-color__notice { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.ui-demo-color__notice { color: #b42332; }
/* P21: native input layouts remain inside each sample, including minimum sizes. */
.ui-demo-multiline-example, .ui-demo-password-example {
  height: 100%; min-width: 0; padding: 12px; overflow: auto;
  display: flex; flex-direction: column; gap: 8px;
}
.ui-demo-multiline__control {
  width: 100%; min-height: 56px; flex: 1; resize: none; overflow: auto;
  padding: 8px; border: 1px solid var(--ui-demo-border); border-radius: 5px; background: #ffffff;
}
.ui-demo-multiline__footer { flex: none; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.ui-demo-multiline__count, .ui-demo-multiline__limit, .ui-demo-password__help, .ui-demo-password__error {
  margin: 0; font-size: 12px; overflow-wrap: anywhere;
}
.ui-demo-multiline__limit, .ui-demo-password__error { color: #b42332; }
.ui-demo-password__help { color: var(--ui-demo-muted); }
.ui-demo-password__row { display: flex; align-items: center; gap: 8px; }
.ui-demo-password__row > .ui-demo-password__control { min-width: 0; width: 0; flex: 1; }
.ui-demo-password__toggle {
  flex: none; min-height: 36px; padding: 5px 8px; cursor: pointer;
  border: 1px solid var(--ui-demo-border); border-radius: 5px; background: #ffffff;
}
.ui-demo-number-example, .ui-demo-verification {
  display: flex; flex-direction: column; gap: 8px;
  width: 100%; min-width: 0; min-height: 100%; padding: 12px;
}
.ui-demo-number__row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; gap: 8px; align-items: center; }
.ui-demo-number__row > .ui-demo-button { padding-inline: 4px; font-size: 14px; }
.ui-demo-number__control { width: 100%; min-width: 0; height: 36px; }
.ui-demo-number__help, .ui-demo-number__notice, .ui-demo-verification__help {
  margin: 0; font-size: 12px; overflow-wrap: anywhere; color: var(--ui-demo-muted);
}
.ui-demo-number__notice { color: #b42332; }
.ui-demo-verification__label { font-size: 14px; font-weight: 700; }
.ui-demo-verification__field { min-width: 0; container-type: inline-size; }
.ui-demo-verification__input {
  width: 100%; min-width: 0; min-height: 36px; padding: 5px 8px;
  border: 1px solid var(--ui-demo-border); border-radius: 5px; background: #ffffff;
}
.ui-demo-verification__field--segmented .ui-demo-verification__input {
  padding: 8px 0; font-family: ui-monospace, monospace; font-size: 22px; line-height: 1.5;
  letter-spacing: calc((100cqw - 2px) / 6 - 1ch);
  background: repeating-linear-gradient(to right, transparent 0 calc((100cqw - 2px) / 6 - 1px), #cdd5df calc((100cqw - 2px) / 6 - 1px) calc((100cqw - 2px) / 6));
  color: transparent;
  caret-color: transparent;
}
.ui-demo-verification__field--segmented { position: relative; }
.ui-demo-verification__digits {
  position: absolute; inset: 1px; pointer-events: none;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: center;
  color: var(--ui-demo-text); font-family: ui-monospace, monospace;
  font-size: 22px; line-height: 1.5; text-align: center;
}
.ui-demo-verification__digits > span { position: relative; }
.ui-demo-verification__field:focus-within .ui-demo-verification__digit--caret::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 1px; height: 1em; background: var(--ui-demo-text);
  transform: translate(-50%, -50%);
  animation: ui-demo-verification-caret 1s step-end infinite;
}
@keyframes ui-demo-verification-caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .ui-demo-verification__field:focus-within .ui-demo-verification__digit--caret::after { animation: none; }
}
/* IME uses the native text and caret so the composing text remains editable. */
.ui-demo-verification__field--composing .ui-demo-verification__input {
  color: var(--ui-demo-text); caret-color: var(--ui-demo-text);
}
.ui-demo-verification__status { min-height: 18px; font-size: 12px; overflow-wrap: anywhere; }
/* E07: fixed is relative to this sample's iframe viewport, never the app. */
.ui-demo-bottom-panel-example { height: 100%; min-width: 0; }
.ui-demo-bottom-panel__scroll {
  height: 100%;
  overflow: auto;
  padding: 16px;
  overscroll-behavior: contain;
  overflow-anchor: none;
}
.ui-demo-bottom-panel__scroll:focus-visible { outline: 2px solid #2563c7; outline-offset: -3px; }
.ui-demo-bottom-panel__section { min-height: 100vh; padding-block: 16px; overflow-wrap: anywhere; }
.ui-demo-bottom-panel__heading { font-size: 20px; line-height: 1.5; }
.ui-demo-bottom-panel__intro { padding-top: 8px; }
.ui-demo-bottom-panel__paragraph { padding-top: 20px; }
.ui-demo-bottom-panel__dock {
  position: fixed;
  inset: auto 0 0;
  z-index: 2;
  max-height: calc(100% - 48px);
  overflow: auto;
  padding: 12px;
  border-top: 1px solid #cdd5df;
  background: #ffffff;
  box-shadow: 0 -3px 12px #24324412;
}
.ui-demo-bottom-panel__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ui-demo-bottom-panel__panel > .ui-demo-step-view { padding-bottom: 12px; }
.ui-demo-bottom-panel__count { overflow-wrap: anywhere; }

/* D05 / 再利用View。寸法は容器に追従し、文字やつまみの拡大縮小はしない。 */
.ui-demo-steps-example { min-width: 0; padding: 12px; }
.ui-demo-step-view .ui-demo-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  list-style: none;
}
.ui-demo-steps__item { min-width: 0; border-bottom: 3px solid #cdd5df; }
.ui-demo-steps__item[aria-current="step"] { border-color: #2563c7; font-weight: 700; }
.ui-demo-steps__select, .ui-demo-steps__static {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
  padding: 4px 6px 8px;
  text-align: center;
}
.ui-demo-steps__select {
  appearance: none;
  border: 1px solid #cdd5df;
  border-radius: 4px 4px 0 0;
  background: #f5f8fc;
  cursor: pointer;
}
.ui-demo-steps__number {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e9eef5;
  color: #243244;
  font-size: 14px;
}
.ui-demo-steps__item[aria-current="step"] .ui-demo-steps__number { background: #2563c7; color: #ffffff; }
.ui-demo-steps__label { max-width: 100%; overflow-wrap: anywhere; }
.ui-demo-steps__description { padding-top: 10px; overflow-wrap: anywhere; }
.ui-demo-steps__controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ui-demo-button:disabled, .ui-demo-steps__select:disabled { opacity: .55; cursor: default; }

/* This document class occurs only in our fixed srcDoc; not an app-wide reset. */
.ui-demo-frame-page {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.ui-demo-frame-container { position: relative; width: 100%; height: 100%; }
.ui-demo-frame { display: block; width: 100%; height: 100%; border: 0; }
.ui-demo-frame-status { position: absolute; inset: 0; }
.ui-demo-surface.ui-demo-frame-root { width: 100%; height: 100%; border: 0; border-radius: 0; }

.ui-demo-dialog-example { min-height: 100%; padding: 16px; }
.ui-demo-dialog__buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.ui-demo-dialog__button {
  min-height: 36px;
  appearance: none;
  border: 1px solid var(--ui-demo-focus);
  border-radius: 6px;
  padding: 6px 10px;
  background: #ffffff;
  color: var(--ui-demo-focus);
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}
.ui-demo-dialog__button:disabled { opacity: .55; cursor: default; }
.ui-demo-dialog__count { padding-top: 8px; font-size: 14px; }
.ui-demo-dialog__applied { padding-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ui-demo-dialog__window {
  position: fixed;
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 16px;
  border: 1px solid var(--ui-demo-border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ui-demo-text);
  font: inherit;
  overflow: auto;
  box-shadow: 0 8px 28px #24324426;
}
.ui-demo-dialog__window::backdrop { background: #16263855; }
.ui-demo-dialog__window--modeless {
  top: 108px;
  bottom: 16px;
  max-height: calc(100vh - 124px);
  margin-block: 0;
}
.ui-demo-dialog__title { font-size: 18px; line-height: 1.5; }
.ui-demo-dialog__label { display: block; margin-top: 12px; margin-bottom: 4px; font-weight: 700; }
.ui-demo-dialog__note {
  display: block;
  width: 100%;
  min-height: 80px;
  padding: 8px;
  border: 1px solid var(--ui-demo-border);
  border-radius: 4px;
  background: #ffffff;
  resize: vertical;
}
.ui-demo-dialog__help { padding-top: 4px; color: var(--ui-demo-muted); font-size: 12px; }
.ui-demo-dialog__error { padding-top: 4px; color: #b42318; font-size: 14px; }
.ui-demo-dialog__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* C11: native radioのグループとフォーム装飾は見本内だけに限定する。 */
.ui-demo-radio-example {
  min-width: 0;
  padding: 16px;
}

.ui-demo-radio-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.ui-demo-radio-legend {
  margin-bottom: 12px;
  padding: 0;
  font-weight: 700;
}

.ui-demo-radio-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ui-demo-radio-options--horizontal {
  flex-flow: row wrap;
  column-gap: 16px;
}

.ui-demo-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  cursor: pointer;
}

.ui-demo-radio-control {
  width: 18px;
  height: 18px;
  flex: none;
  margin: 0;
  accent-color: #2563eb;
}

.ui-demo-radio-control:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
}

.ui-demo-file-example {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-width: 0;
  padding: 12px;
  overflow: hidden;
}
.ui-demo-file__actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 8px; }
.ui-demo-file__actions > .ui-demo-button { padding-inline: 12px; font-size: 14px; }
.ui-demo-file__drop {
  flex: 0 0 auto;
  padding: 8px;
  border: 2px dashed #8896a8;
  border-radius: 6px;
  background: #f5f8fc;
  font-size: 14px;
  text-align: center;
  overflow-wrap: anywhere;
}
.ui-demo-file__drop[data-dragging="true"] { border-style: solid; border-color: #2563c7; background: #e7f0ff; }
.ui-demo-file__status { flex: 0 0 auto; font-size: 14px; }
.ui-demo-file__results { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 3px; }
.ui-demo-file__results:focus-visible { outline: 2px solid var(--ui-demo-focus); outline-offset: -2px; }
ul.ui-demo-file__list { list-style: none; padding: 0; }
.ui-demo-file__list > li { display: flex; flex-direction: column; padding-block: 6px; border-bottom: 1px solid #dce2ea; }
.ui-demo-file__name { overflow-wrap: anywhere; font-size: 14px; }
.ui-demo-file__size { font-size: 12px; color: #526176; }

.ui-demo-surface {
  --ui-demo-focus: #2563c7;
  --ui-demo-text: #243244;
  --ui-demo-muted: #697789;
  --ui-demo-border: #cdd5df;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  box-sizing: border-box;
  border: 1px solid var(--ui-demo-border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ui-demo-text);
  font-family: "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.ui-demo-surface :where(*, *::before, *::after) {
  box-sizing: border-box;
}

.ui-demo-surface :where(h1, h2, h3, h4, h5, h6, p, blockquote, figure, dl, dd) {
  margin: 0;
}

.ui-demo-surface :where(ol, ul) {
  margin: 0;
  padding-inline-start: 1.5rem;
}

.ui-demo-surface :where(button, input, select, textarea) {
  color: inherit;
  font: inherit;
}

.ui-demo-surface :where(button, input, select, textarea):focus-visible {
  outline: 2px solid var(--ui-demo-focus);
  outline-offset: 2px;
}

.ui-demo-body {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
}

.ui-demo-overlay-root {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ui-demo-overlay-root > * {
  pointer-events: auto;
}

/* P20: popups belong to a single sample's non-blocking overlay, never the app. */
.ui-demo-local-overlay {
  position: absolute;
  box-sizing: border-box;
  overflow: auto;
  overscroll-behavior: contain;
  pointer-events: auto;
  color: #172033;
  font: inherit;
}

.ui-demo-popover-example {
  box-sizing: border-box;
  width: 100%; height: 100%; padding: 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; overflow: auto; overscroll-behavior: contain;
}
.ui-demo-popover-example--right { align-items: flex-start; }
.ui-demo-popover-example--left { align-items: flex-end; }
.ui-demo-popover-example--bottom { justify-content: flex-start; }
.ui-demo-popover-example--top { justify-content: flex-end; }
.ui-demo-popover {
  width: 220px; padding: 12px; display: flex; flex-direction: column;
  align-items: flex-start; gap: 12px; border: 1px solid #94a3b8; border-radius: 8px;
  background: #fff; box-shadow: 0 4px 12px #0f172a26;
}
.ui-demo-popover__heading { margin: 0; font-size: 16px; line-height: 1.5; }
.ui-demo-popover__check { display: flex; align-items: center; gap: 8px; line-height: 1.5; }
.ui-demo-popover__body, .ui-demo-popover__hint { margin: 0; max-width: 290px; line-height: 1.65; overflow-wrap: anywhere; }
.ui-demo-popover__hint { font-size: 14px; color: #334155; }

.ui-demo-tooltip-example {
  box-sizing: border-box; display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; padding: 16px; overflow: auto;
}
.ui-demo-tooltip__trigger {
  min-height: 36px; padding: 6px 16px; border: 1px solid #71839b; border-radius: 5px;
  background: #fff; color: #243244; font: inherit; cursor: pointer;
}
.ui-demo-tooltip__trigger:focus-visible { outline: 2px solid #2563c7; outline-offset: 2px; }
.ui-demo-tooltip {
  width: 220px; padding: 10px 12px; border: 1px solid #43546b; border-radius: 6px;
  background: #243244; color: #fff; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere;
}

.ui-demo-operation-menu-example, .ui-demo-menubar-example {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  height: 100%; min-width: 0; padding: 12px; overflow: auto; overscroll-behavior: contain;
}
.ui-demo-context-target {
  width: 100%; min-height: 80px; display: flex; align-items: center; justify-content: center;
  border: 1px dashed #8295ad; border-radius: 6px; padding: 12px;
  background: #f3f6fa; color: #33445b; font-size: 14px; line-height: 1.5;
}
.ui-demo-context-target:focus-visible, .ui-demo-menubar__trigger:focus-visible {
  outline: 2px solid #2563c7; outline-offset: 2px;
}
.ui-demo-menu {
  width: 196px; padding: 4px; border: 1px solid #aebed2; border-radius: 6px;
  background: #fff; color: #243244; box-shadow: 0 3px 10px #24324422;
}
.ui-demo-menu__items { display: flex; flex-direction: column; gap: 2px; }
.ui-demo-menu__item {
  width: 100%; min-height: 36px; border: 0; border-radius: 3px; padding: 6px 10px;
  background: #fff; color: inherit; text-align: left; font: inherit;
  font-size: 14px; line-height: 1.5; cursor: pointer;
}
.ui-demo-menu__item:hover { background: #eef3fb; }
.ui-demo-menu__item:focus { outline: 2px solid #2563c7; outline-offset: -2px; background: #e8f0ff; }
.ui-demo-menu-result { margin: 0; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.ui-demo-menubar {
  display: flex; flex-wrap: nowrap; gap: 4px; width: 100%; padding: 4px;
  border: 1px solid #c7d3e1; border-radius: 6px; background: #f3f6fa;
}
.ui-demo-menubar__trigger {
  flex: none; min-height: 36px; border: 1px solid transparent; border-radius: 4px;
  padding: 5px 10px; background: transparent; color: #243244; font: inherit;
  font-size: 14px; line-height: 1.5; white-space: nowrap; cursor: pointer;
}
.ui-demo-menubar__trigger[aria-expanded="true"] { border-color: #8ca8d0; background: #e8f0ff; }

.ui-demo-system-message {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 72px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  color: var(--ui-demo-muted);
  text-align: center;
}

.ui-demo-system-button {
  min-height: 36px;
  appearance: none;
  border: 1px solid var(--ui-demo-focus);
  border-radius: 6px;
  background: #ffffff;
  padding: 6px 14px;
  color: var(--ui-demo-focus);
  cursor: pointer;
}

.ui-demo-button-example {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: flex-start;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 16px;
}

.ui-demo-button {
  display: inline-flex;
  min-height: 36px;
  appearance: none;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 6px 16px;
  background: #ffffff;
  color: var(--ui-demo-text);
  cursor: pointer;
  font-weight: 700;
  line-height: 1.4;
}

.ui-demo-button--primary {
  border-color: #2563c7;
  background: #2563c7;
  color: #ffffff;
}

.ui-demo-button--primary:hover {
  border-color: #1d4f9e;
  background: #1d4f9e;
}

.ui-demo-button--secondary {
  border-color: #7a8798;
  background: #ffffff;
  color: #243244;
}

.ui-demo-button--secondary:hover {
  background: #f2f4f7;
}

.ui-demo-button--danger {
  border-color: #c63838;
  background: #c63838;
  color: #ffffff;
}

.ui-demo-button--danger:hover {
  border-color: #9f2d2d;
  background: #9f2d2d;
}

.ui-demo-button--icon,
.ui-demo-button--floating {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  border-color: #2563c7;
  background: #2563c7;
  color: #ffffff;
}

.ui-demo-button--icon {
  border-radius: 6px;
}

.ui-demo-button__icon {
  display: block;
  flex: none;
}

.ui-demo-button__result {
  color: var(--ui-demo-muted);
  font-size: 14px;
  line-height: 1.5;
}

.ui-demo-button-example--icon {
  gap: 12px;
}

.ui-demo-button-example--floating {
  position: relative;
  display: block;
  padding: 16px;
}

.ui-demo-button__floating-content {
  padding: 2px 0 64px;
}

.ui-demo-button__floating-content .ui-demo-button__result {
  margin-top: 12px;
}

.ui-demo-button--floating {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgb(36 50 68 / 22%);
}

.ui-demo-input-example {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  min-height: 100%;
  padding: 12px;
}

.ui-demo-input__label {
  font-size: 14px;
  font-weight: 700;
}

.ui-demo-input__control {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  flex: none;
  border: 1px solid var(--ui-demo-border);
  border-radius: 5px;
  background: #ffffff;
  padding: 5px 8px;
}

.ui-demo-input__control[aria-invalid="true"] {
  border-color: #b42332;
}

.ui-demo-input__help {
  color: var(--ui-demo-muted);
  font-size: 12px;
}

.ui-demo-input__error {
  color: #b42332;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.ui-demo-input__footer {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 4px;
}

.ui-demo-input__confirm {
  min-height: 36px;
  flex: none;
  appearance: none;
  border: 1px solid var(--ui-demo-focus);
  border-radius: 5px;
  background: #ffffff;
  padding: 5px 12px;
  color: var(--ui-demo-focus);
  cursor: pointer;
}

.ui-demo-input__result {
  min-width: 0;
  padding-top: 6px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.ui-demo-checkbox-example {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
  padding: 16px;
}

.ui-demo-checkbox-example--single {
  justify-content: center;
}

.ui-demo-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ui-demo-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.ui-demo-checkbox-control {
  width: 18px;
  height: 18px;
  flex: none;
  margin: 0;
  accent-color: var(--ui-demo-focus);
}

.ui-demo-checkbox-result {
  color: var(--ui-demo-muted);
  font-size: 14px;
}

.ui-demo-tabs {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 12px;
}

.ui-demo-tabs__list {
  display: flex;
  flex: none;
  gap: 4px;
  padding: 2px 2px 6px;
  border-bottom: 1px solid var(--ui-demo-border);
}

.ui-demo-tabs__tab {
  min-height: 36px;
  appearance: none;
  border: 1px solid transparent;
  border-radius: 5px;
  background: #f2f4f7;
  padding: 5px 12px;
  cursor: pointer;
}

.ui-demo-tabs__tab[aria-selected="true"] {
  border-color: var(--ui-demo-focus);
  background: #edf3ff;
  color: #1d4f9e;
  font-weight: 700;
}

.ui-demo-tabs__panel {
  min-width: 0;
  min-height: 0;
  flex: 1;
  overflow: auto;
  overflow-wrap: anywhere;
  padding: 14px 4px;
}

.ui-demo-tabs__panel:focus-visible {
  outline: 2px solid var(--ui-demo-focus);
  outline-offset: -2px;
}

.ui-demo-tabs--side {
  flex-direction: row;
  gap: 12px;
}

.ui-demo-tabs--side .ui-demo-tabs__list {
  width: 112px;
  flex-direction: column;
  border-bottom: 0;
  border-right: 1px solid var(--ui-demo-border);
  padding: 2px 8px 2px 2px;
}

.ui-demo-tabs--side .ui-demo-tabs__panel {
  padding: 6px 4px;
}

/* A01: local text layout only; no app/Tailwind styles or HTML interpretation. */
.ui-demo-text-example {
  width: 100%;
  height: 100%;
  padding: 6px 12px;
  font-size: 16px;
  line-height: 1.5;
}

.ui-demo-text-example--heading {
  font-size: 24px;
  font-weight: 700;
}

.ui-demo-text-example--label {
  font-size: 14px;
  padding: 4px 8px;
}

.ui-demo-edit-hint {
  margin: 0;
  color: #526176;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

/* A01/A06: explicit touch/keyboard editing, separate from the stored text. */
.ui-demo-edit-entry,
.ui-demo-edit-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
}

.ui-demo-edit-button {
  flex: none;
  min-height: 44px;
  max-width: 100%;
  padding: 6px 8px;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  background: #fff;
  color: #243244;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  cursor: pointer;
}

.ui-demo-edit-button:focus-visible {
  outline: 3px solid var(--ui-demo-focus);
  outline-offset: -3px;
}

@media (pointer: coarse) {
  .ui-demo-text__editor,
  .ui-demo-card__editor {
    font-size: 16px;
  }
}

.ui-demo-text__reading {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  gap: 2px;
}

.ui-demo-text__reading > .ui-demo-text__display {
  min-height: 1.5em;
}

.ui-demo-text__display {
  width: 100%;
  min-height: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  cursor: text;
}

.ui-demo-text__display:focus-visible {
  outline: 2px solid var(--ui-demo-focus);
  outline-offset: -2px;
}

.ui-demo-text__editing {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  gap: 4px;
}

.ui-demo-text__editor {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  flex: none;
  appearance: none;
  border: 1px solid var(--ui-demo-border);
  border-radius: 4px;
  background: #ffffff;
  padding: 4px 6px;
  resize: none;
}

.ui-demo-text-example--body .ui-demo-text__editor {
  min-height: 64px;
  flex: 1;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ui-demo-text__help,
.ui-demo-text__status {
  color: var(--ui-demo-muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.ui-demo-text__editor[aria-invalid="true"] {
  border-color: #b42332;
}

/* C17: fixed-size thumbs on a shared 0..100 rail, independent of app controls. */
.ui-demo-slider-example {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 12px;
}

.ui-demo-slider__result {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.ui-demo-slider__control {
  padding: 12px 12px 0;
}

.ui-demo-slider__rail {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: #d8dfe8;
}

.ui-demo-slider__selection {
  position: absolute;
  height: 100%;
  border-radius: inherit;
  background: var(--ui-demo-focus);
  pointer-events: none;
}

.ui-demo-slider__thumb {
  position: absolute;
  z-index: 1;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  border: 2px solid var(--ui-demo-focus);
  border-radius: 50%;
  background: #ffffff;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.ui-demo-slider__thumb:focus-visible {
  z-index: 2;
  outline: 2px solid var(--ui-demo-focus);
  outline-offset: 3px;
}

.ui-demo-slider__thumb:active {
  cursor: grabbing;
}

.ui-demo-slider__limits {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  color: var(--ui-demo-muted);
  font-size: 12px;
}

.ui-demo-slider__help {
  color: var(--ui-demo-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* P15: static views own their geometry; none of these selectors reset other samples. */
.ui-demo-symbol { display: block; width: 32px; height: 32px; flex: none; }
.ui-demo-icon-example {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  height: 100%;
  padding: 8px;
  color: #254e83;
}
.ui-demo-icon-example--check { color: #197047; }
.ui-demo-icon-example--warning { color: #92621b; }

.ui-demo-avatar-example {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 8px;
  container-type: size;
}
.ui-demo-avatar-circle {
  display: grid;
  place-items: center;
  width: min(64px, 100cqw, 100cqh);
  height: auto;
  aspect-ratio: 1;
  flex: none;
  border-radius: 50%;
  background: #dce8f6;
  color: #254e83;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}
.ui-demo-avatar-circle--image { object-fit: cover; }
.ui-demo-avatar-group { display: flex; align-items: center; }
.ui-demo-avatar-group > .ui-demo-avatar-circle {
  width: min(64px, 100cqh, calc((100cqw + 24px) / 4));
  border: 2px solid #ffffff;
  font-size: 16px;
}
.ui-demo-avatar-group > .ui-demo-avatar-circle + .ui-demo-avatar-circle { margin-left: -8px; }
.ui-demo-avatar-group > .ui-demo-avatar-circle:nth-child(2) { color: #196244; background: #d9efdf; }
.ui-demo-avatar-group > .ui-demo-avatar-circle:nth-child(3) { color: #79561e; background: #f7e9c9; }
.ui-demo-avatar-circle--extra { color: #4a5565; background: #e9edf2; }

.ui-demo-badge-example { display: grid; place-items: center; height: 100%; padding: 8px; }
.ui-demo-badge {
  display: inline-block;
  max-width: 100%;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.ui-demo-badge--success { color: #145c38; background: #def2e7; border-color: #a8d6bc; }
.ui-demo-badge--neutral { color: #455366; background: #eef1f5; border-color: #cbd4df; }
.ui-demo-badge__notification { display: inline-flex; align-items: center; gap: 6px; color: #455366; }
.ui-demo-badge__count {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding-inline: 5px;
  border-radius: 999px;
  background: #aa3042;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.ui-demo-list-example {
  height: 100%;
  padding: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.ui-demo-list-example:focus-visible { outline: 2px solid #2563c7; outline-offset: -3px; }
.ui-demo-list-example > .ui-demo-list { margin: 0; padding-left: 24px; }
.ui-demo-list--bulleted, .ui-demo-list--described { list-style: disc outside; }
.ui-demo-list--numbered { list-style: decimal outside; }
.ui-demo-list__item { padding-left: 2px; line-height: 1.5; overflow-wrap: anywhere; }
.ui-demo-list__item + .ui-demo-list__item { margin-top: 12px; }
.ui-demo-list__text { min-width: 0; }
.ui-demo-list__description { display: block; margin-top: 3px; font-size: 14px; color: #546175; }
.ui-demo-list-example > .ui-demo-list--icon { padding: 0; list-style: none; }
.ui-demo-list--icon > .ui-demo-list__item { display: flex; align-items: flex-start; gap: 8px; padding: 0; }
.ui-demo-symbol.ui-demo-list__icon { width: 20px; height: 20px; margin-top: 2px; color: #197047; }

/* P16: semantic, static text views; these selectors never reset other samples. */
.ui-demo-static-content {
  height: 100%;
  min-width: 0;
  padding: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.ui-demo-static-content:focus-visible { outline: 2px solid #2563c7; outline-offset: -3px; }
.ui-demo-static-content__body { min-width: 0; overflow-wrap: anywhere; }
.ui-demo-description-list { margin: 0; padding: 0; }
.ui-demo-description-list__pair + .ui-demo-description-list__pair { margin-top: 8px; }
.ui-demo-description-list--rows > .ui-demo-description-list__pair {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  column-gap: 8px;
}
.ui-demo-description-list__term { margin: 0; color: #546175; font-size: 14px; line-height: 24px; }
.ui-demo-description-list__value { min-width: 0; margin: 0; font-size: 16px; line-height: 24px; }
.ui-demo-description-list--stacked .ui-demo-description-list__term { font-weight: 700; }
.ui-demo-quote { margin: 0; padding: 12px; border-radius: 4px; background: #f3f6fa; }
.ui-demo-quote--line { border-left: 4px solid #577cad; border-radius: 0; background: #ffffff; }
.ui-demo-quote__text { margin: 0; padding: 0; font-size: 16px; line-height: 1.6; }
.ui-demo-quote__text > p { margin: 0; }
.ui-demo-quote__source { margin-top: 10px; color: #546175; font-size: 13px; line-height: 1.5; }
.ui-demo-quote__source > cite { font-style: normal; }
.ui-demo-callout { display: flex; align-items: flex-start; gap: 8px; padding: 10px; border: 1px solid transparent; border-radius: 6px; }
.ui-demo-callout--memo { color: #234e7c; background: #edf5ff; border-color: #c3d8f0; }
.ui-demo-callout--note { color: #455366; background: #f0f2f5; border-color: #d1d8e1; }
.ui-demo-callout--point { color: #70531e; background: #fff8df; border-color: #e4d391; }
.ui-demo-callout__icon { display: block; width: 20px; height: 20px; flex: none; margin-top: 2px; }
.ui-demo-callout__content { min-width: 0; }
.ui-demo-callout__heading { margin: 0; font-size: 15px; line-height: 24px; }
.ui-demo-callout__text { margin: 4px 0 0; font-size: 14px; line-height: 1.5; }
.ui-demo-key-display { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.ui-demo-key {
  display: inline-block;
  flex: none;
  border: 1px solid #b8c4d3;
  border-bottom-width: 3px;
  border-radius: 4px;
  padding: 3px;
  background: #f6f8fb;
  color: #243244;
  font-family: ui-monospace, "Cascadia Code", "Segoe UI", monospace;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
}
.ui-demo-key-display__join { color: #546175; font-size: 12px; line-height: 18px; }

/* P17 / A11: user-invoked plain-text copying; only the code area scrolls. */
.ui-demo-code {
  display: grid;
  grid-template-rows: 36px minmax(0, 1fr) 18px;
  gap: 4px;
  height: 100%;
  min-width: 0;
  padding: 8px;
}
.ui-demo-code__toolbar { display: flex; justify-content: flex-end; }
.ui-demo-code__copy {
  appearance: none;
  min-height: 36px;
  border: 1px solid #2563c7;
  border-radius: 5px;
  padding: 5px 12px;
  background: #ffffff;
  color: #245da7;
  font-size: 14px;
  line-height: 24px;
  cursor: pointer;
}
.ui-demo-code__copy:focus-visible, .ui-demo-code__scroll:focus-visible {
  outline: 2px solid #2563c7;
  outline-offset: -3px;
}
.ui-demo-code__scroll { min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; background: #f3f6fa; }
.ui-demo-code__lines { display: flex; width: max-content; min-width: 100%; padding: 4px 8px; }
.ui-demo-code__text, .ui-demo-code__text > code, .ui-demo-code__numbers {
  margin: 0;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  line-height: 20px;
  white-space: pre;
}
.ui-demo-code__numbers { flex: none; padding-right: 12px; color: #65758b; user-select: none; }
.ui-demo-code__status { margin: 0; font-size: 12px; line-height: 18px; color: #455366; }

/* P17: fixed sample numbers and non-interactive separators. */
.ui-demo-summary { margin: 0; padding: 0; }
.ui-demo-summary__label { margin: 0; color: #546175; font-size: 15px; line-height: 24px; }
.ui-demo-summary__value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 8px 0 0; }
.ui-demo-summary__number { font-size: 36px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ui-demo-summary__unit { font-size: 16px; line-height: 24px; white-space: nowrap; }
.ui-demo-summary__trend { margin: 8px 0 0; color: #197047; font-size: 14px; line-height: 24px; }
.ui-demo-divider-example { display: flex; align-items: center; justify-content: center; height: 100%; padding: 8px; }
.ui-demo-divider-horizontal { width: 100%; height: 1px; flex: none; margin: 0; border: 0; background: #9eacbd; }
.ui-demo-divider-vertical { width: 1px; height: 100%; flex: none; background: #9eacbd; }
.ui-demo-divider-labelled { display: flex; align-items: center; gap: 12px; width: 100%; color: #546175; font-size: 14px; line-height: 20px; }
.ui-demo-divider-labelled::before,
.ui-demo-divider-labelled::after { content: ""; height: 1px; min-width: 0; flex: 1; background: #9eacbd; }
.ui-demo-divider-labelled > span { flex: none; white-space: nowrap; }

/* P18 / A05: bounded tag operations, independent of notebook item controls. */
.ui-demo-tags-example { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.ui-demo-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ui-demo-tags__item { margin: 0; padding: 0; }
.ui-demo-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  margin: 0;
  border: 1px solid #c7d3e1;
  border-radius: 18px;
  padding: 4px 10px;
  background: #f1f5fa;
  color: #33445b;
  font-size: 14px;
  line-height: 24px;
  white-space: nowrap;
}
.ui-demo-tag--selectable { appearance: none; cursor: pointer; }
.ui-demo-tag--selectable[aria-pressed="true"] { border-color: #2563c7; background: #e7f0ff; color: #174f9f; box-shadow: inset 0 0 0 1px #2563c7; }
.ui-demo-tag__remove { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 0; border-radius: 50%; padding: 0; background: transparent; color: #33445b; font-size: 20px; line-height: 24px; cursor: pointer; }
.ui-demo-tags__restore { min-height: 36px; border: 1px solid #8fa5bf; border-radius: 5px; padding: 5px 12px; background: #ffffff; color: #245da7; font-size: 14px; line-height: 24px; cursor: pointer; }
.ui-demo-tag--selectable:focus-visible, .ui-demo-tag__remove:focus-visible, .ui-demo-tags__restore:focus-visible { outline: 2px solid #2563c7; outline-offset: 2px; }

/* P18 / A06: card content scrolls independently; images keep their own ratio. */
.ui-demo-card { width: 100%; height: 100%; padding: 8px; overflow: auto; overscroll-behavior: contain; }
.ui-demo-card__content { min-height: 100%; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; overflow: hidden; }
.ui-demo-card__image { display: block; width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; }
.ui-demo-card__text { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; min-width: 0; }
.ui-demo-card__field { width: 100%; min-width: 0; }
.ui-demo-card__display { width: 100%; min-height: 24px; white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; }
.ui-demo-card__display--title { font-size: 18px; font-weight: 700; line-height: 1.4; }
.ui-demo-card__display--body { font-size: 14px; line-height: 1.6; }
.ui-demo-card__display:focus-visible, .ui-demo-card__editor:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.ui-demo-card__editing { width: 100%; min-width: 0; }
.ui-demo-card__editor { box-sizing: border-box; display: block; width: 100%; min-width: 0; min-height: 36px; border: 1px solid #64748b; border-radius: 4px; padding: 6px 8px; background: #fff; color: #243244; font: inherit; line-height: 1.5; }
.ui-demo-card__editor--body { min-height: 84px; resize: vertical; }
.ui-demo-card__editor[aria-invalid="true"] { border-color: #b91c1c; }
.ui-demo-card__help { margin: 4px 0 0; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.ui-demo-card__details, .ui-demo-card__price, .ui-demo-card__result { margin: 0; font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.ui-demo-card__price { font-weight: 700; }
.ui-demo-toggle-example { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.ui-demo-toggle { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 40px; min-height: 36px; max-width: 100%; padding: 6px 12px; border: 1px solid #71839b; border-radius: 6px; background: #fff; color: #243244; font: inherit; line-height: 1.4; cursor: pointer; }
.ui-demo-toggle[aria-pressed="true"] { border-color: #2563c7; background: #e8f0ff; color: #174c9d; box-shadow: inset 0 0 0 1px #2563c7; }
.ui-demo-toggle:focus-visible { outline: 2px solid #2563c7; outline-offset: 2px; }
.ui-demo-toggle__star { flex: none; }
.ui-demo-toggle__bold { font-size: 18px; font-weight: 700; }
.ui-demo-toggle__sample { margin: 0; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; font-weight: 400; }
.ui-demo-toggle__sample--bold { font-weight: 700; }
.ui-demo-toggle__result { margin: 0; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.ui-demo-button-group-example { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ui-demo-button-group { display: flex; gap: 8px; min-width: 0; }
.ui-demo-button-group--horizontal { flex-wrap: wrap; }
.ui-demo-button-group--vertical { flex-direction: column; align-items: stretch; }
.ui-demo-button-group--vertical .ui-demo-button { width: 100%; }
.ui-demo-button-group__result { margin: 0; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }

.ui-demo-links { width: 100%; height: 100%; min-width: 0; min-height: 0; position: relative; }
.ui-demo-links__scroll { width: 100%; height: 100%; padding: 12px; overflow: auto; overscroll-behavior: contain; overflow-anchor: none; overflow-wrap: anywhere; }
.ui-demo-link { color: #1857a4; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.ui-demo-link:focus-visible, .ui-demo-links__heading:focus, .ui-demo-links__scroll:focus-visible { outline: 2px solid #2563c7; outline-offset: 2px; }
.ui-demo-links__heading { margin: 0 0 12px; font-size: 18px; line-height: 1.5; }
.ui-demo-links__paragraph { margin: 0 0 12px; line-height: 1.65; }
.ui-demo-links__chapter { min-height: 100%; padding: 12px 0; }
.ui-demo-links__chapter-heading { margin: 0 0 12px; font-size: 16px; line-height: 1.5; }
.ui-demo-links__menu { margin-bottom: 16px; padding: 8px; border: 1px solid #cbd5e1; border-radius: 4px; }
.ui-demo-links__menu-items { margin: 4px 0 0; padding-left: 24px; line-height: 1.6; }
.ui-demo-links__position { margin: 0 0 12px; }
.ui-demo-links__paging { display: flex; justify-content: space-between; gap: 16px; }
.ui-demo-links__unavailable { color: #5b6472; }
.ui-demo-link--skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ui-demo-link--skip:focus { display: block; position: sticky; top: 0; z-index: 1; padding: 8px; background: #fff; border: 1px solid #2563c7; margin-bottom: 8px; }

.ui-demo-toolbar-example { width: 100%; height: 100%; padding: 12px; overflow: auto; overscroll-behavior: contain; }
.ui-demo-toolbar { display: flex; gap: 6px; width: 100%; overflow-x: auto; overflow-y: hidden; overscroll-behavior: contain; padding: 5px 4px 9px; border: 1px solid #cbd5e1; border-radius: 6px; background: #f8fafc; }
.ui-demo-toolbar__button { flex: 0 0 auto; min-width: 36px; min-height: 36px; padding: 6px 10px; border: 1px solid #94a3b8; border-radius: 4px; background: #fff; color: #243244; font: inherit; font-size: 14px; line-height: 1.4; white-space: nowrap; cursor: pointer; }
.ui-demo-toolbar__button[aria-pressed="true"] { background: #dbeafe; border-color: #2563eb; color: #173f7a; box-shadow: inset 0 -2px #2563eb; }
.ui-demo-toolbar__button:focus-visible { outline: 3px solid #2563eb; outline-offset: 1px; }
.ui-demo-toolbar__button--bold { font-weight: 700; }
.ui-demo-toolbar__button--italic { font-style: italic; }
.ui-demo-toolbar-example--compact .ui-demo-toolbar__button { padding-inline: 8px; }
.ui-demo-toolbar__sample { margin: 16px 0 0; padding: 12px; border: 1px solid #d7dfe9; border-radius: 4px; font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.ui-demo-switch-example, .ui-demo-segment-example {
  box-sizing: border-box; width: 100%; height: 100%; padding: 16px; overflow: auto;
}
.ui-demo-switch__label { display: flex; align-items: center; gap: 12px; overflow-wrap: anywhere; cursor: pointer; }
.ui-demo-switch__control {
  appearance: none; box-sizing: border-box; flex: none; width: 44px; height: 26px; margin: 0;
  border: 2px solid #64748b; border-radius: 999px; background: #e2e8f0; position: relative; cursor: pointer;
}
.ui-demo-switch__control::before {
  content: ""; position: absolute; width: 18px; height: 18px; top: 2px; left: 2px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #33415580;
}
.ui-demo-switch__control:checked { background: #2563eb; border-color: #2563eb; }
.ui-demo-switch__control:checked::before { left: 20px; }
.ui-demo-switch__control:focus-visible { outline: 3px solid #2563eb; outline-offset: 3px; }
.ui-demo-switch__result { margin: 12px 0 0; }
.ui-demo-segment-example { display: flex; flex-direction: column; gap: 8px; padding: 12px; overflow: hidden; }
.ui-demo-segment__fieldset { min-width: 0; margin: 0; padding: 0; border: 0; flex: none; }
.ui-demo-segment__legend { padding: 0; margin-bottom: 4px; }
.ui-demo-segment__options { display: flex; }
.ui-demo-segment__option { position: relative; min-width: 0; flex: 1; }
.ui-demo-segment__input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ui-demo-segment__label { display: block; text-align: center; padding: 7px 4px; border: 1px solid #64748b; background: white; overflow-wrap: anywhere; }
.ui-demo-segment__option + .ui-demo-segment__option .ui-demo-segment__label { border-left: 0; }
.ui-demo-segment__input:checked + .ui-demo-segment__label { background: #1d4ed8; color: white; }
.ui-demo-segment__input:focus-visible + .ui-demo-segment__label { outline: 3px solid #0f172a; outline-offset: 2px; position: relative; z-index: 1; }
.ui-demo-segment__result { margin: 0; }
.ui-demo-segment__results { min-height: 0; overflow: auto; flex: 1; }
.ui-demo-segment__results:focus-visible { outline: 3px solid #2563eb; outline-offset: -3px; }
.ui-demo-segment__cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ui-demo-segment__cards--grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ui-demo-segment__card { min-width: 0; padding: 8px; border: 1px solid #cbd5e1; border-radius: 6px; overflow-wrap: anywhere; }
.ui-demo-segment__card h3 { font-size: 14px; line-height: 1.4; margin: 0 0 4px; }
.ui-demo-segment__card p { font-size: 12px; line-height: 1.5; margin: 0; }

.ui-demo-select-example { height: 100%; min-width: 0; padding: 12px; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.ui-demo-select__label { font-size: 14px; font-weight: 700; }
.ui-demo-select__control { flex: none; width: 100%; min-width: 0; min-height: 36px; padding: 6px 10px; border: 1px solid var(--ui-demo-border); border-radius: 5px; background: #fff; }
.ui-demo-select__control:focus-visible { outline: 2px solid var(--ui-demo-focus); outline-offset: 2px; }
.ui-demo-select__trigger { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer; }
.ui-demo-select__result { margin: 0; overflow-wrap: anywhere; font-size: 14px; }
.ui-demo-select__popup { width: 280px; padding: 4px; background: #fff; border: 1px solid #aebed2; border-radius: 6px; box-shadow: 0 3px 10px #24324422; }
.ui-demo-select__option { display: flex; justify-content: space-between; gap: 8px; min-height: 36px; padding: 6px 10px; border: 2px solid transparent; border-radius: 3px; overflow-wrap: anywhere; cursor: pointer; }
.ui-demo-select__option[aria-selected="true"] { background: #e7f0ff; font-weight: 700; }
.ui-demo-select__option[data-active="true"] { border-color: var(--ui-demo-focus); }

.ui-demo-listbox-example { width: 100%; height: 100%; min-width: 0; min-height: 0; padding: 16px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.ui-demo-listbox__list { position: relative; flex: 1; min-height: 36px; min-width: 0; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--ui-demo-border); border-radius: 5px; background: #fff; }
.ui-demo-listbox__list:focus-visible { outline: 2px solid #174da1; outline-offset: 2px; }
.ui-demo-listbox__option { height: 36px; padding: 6px 10px; display: flex; align-items: center; gap: 8px; color: var(--ui-demo-text); cursor: pointer; }
.ui-demo-listbox__option[aria-selected="true"] { background: #e5efff; color: #174da1; font-weight: 700; }
.ui-demo-listbox__list:focus .ui-demo-listbox__option[data-focused="true"] { outline: 2px solid #174da1; outline-offset: -3px; }
.ui-demo-listbox__mark { width: 16px; flex: none; }
.ui-demo-listbox__clear { flex: none; align-self: flex-start; }

.ui-demo-combo-example { width: 100%; height: 100%; padding: 16px; overflow: auto; }
.ui-demo-combo__label { display: block; font-weight: 600; margin-bottom: 8px; }
.ui-demo-combo__input { width: 100%; min-height: 36px; border: 1px solid #94a3b8; border-radius: 6px; padding: 7px 10px; background: #fff; }
ul.ui-demo-combo__chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 12px 0; }
.ui-demo-combo__chip { display: inline-flex; gap: 6px; align-items: center; border: 1px solid #bfdbfe; background: #eff6ff; border-radius: 16px; padding: 3px 6px 3px 10px; max-width: 100%; overflow-wrap: anywhere; }
.ui-demo-combo__remove { width: 28px; height: 28px; min-width: 28px; border: 0; background: transparent; border-radius: 50%; cursor: pointer; }
.ui-demo-combo__clear { min-height: 36px; padding: 6px 10px; border: 1px solid #94a3b8; border-radius: 6px; background: #fff; cursor: pointer; }
.ui-demo-combo__selection { margin: 12px 0 0; overflow-wrap: anywhere; }
.ui-demo-combo__popup { width: 320px; padding: 4px; overflow: auto; background: #fff; border: 1px solid #aebed2; border-radius: 6px; box-shadow: 0 3px 10px #24324422; }
.ui-demo-combo__option { min-height: 36px; padding: 8px 10px; overflow-wrap: anywhere; cursor: pointer; border-radius: 3px; }
.ui-demo-combo__option[data-active="true"] { background: #dbeafe; outline: 2px solid #2563eb; outline-offset: -2px; }
.ui-demo-combo__empty { margin: 0; padding: 8px; }
.ui-demo-combo__input:focus-visible, .ui-demo-combo__remove:focus-visible, .ui-demo-combo__clear:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }

.ui-demo-search-example { display: flex; flex-direction: column; gap: 10px; height: 100%; padding: 12px; overflow: hidden; }
.ui-demo-search__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 0 0 auto; }
.ui-demo-search__control { flex: 1 1 180px; min-width: 0; width: auto; }
.ui-demo-search__results { flex: 1 1 auto; min-height: 0; overflow: auto; border: 1px solid #cbd5e1; border-radius: 6px; padding: 4px 12px; overscroll-behavior: contain; }
.ui-demo-search__results:focus-visible { outline: 3px solid #2563eb; outline-offset: -3px; }
ul.ui-demo-search__list { list-style: none; margin: 0; padding: 0; }
.ui-demo-search__list > li { min-height: 36px; padding: 7px 0; overflow-wrap: anywhere; border-bottom: 1px solid #e2e8f0; }
.ui-demo-search__list > li:last-child { border-bottom: 0; }
.ui-demo-search__empty { margin: 8px 0; overflow-wrap: anywhere; }
/* P26: the rating and fieldset styles are local to their samples. */
.ui-demo-rating-example {
  height: 100%; padding: 10px 12px; overflow: auto;
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
}
.ui-demo-rating__fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.ui-demo-rating__legend { padding: 0; margin-bottom: 4px; font-weight: 600; font-size: 13px; }
.ui-demo-rating__stars { display: flex; flex-wrap: nowrap; gap: 6px; align-items: center; }
.ui-demo-rating__option { position: relative; display: inline-flex; cursor: pointer; border-radius: 5px; }
.ui-demo-rating__input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ui-demo-rating__star { display: block; width: 32px; height: 32px; flex: 0 0 32px; fill: #fff; stroke: #64748b; stroke-width: 1.6; }
.ui-demo-rating__star[data-filled="true"] { fill: #fbbf24; stroke: #92400e; }
.ui-demo-rating__star[data-preview="true"] { stroke-dasharray: 3 2; }
.ui-demo-rating__input:focus-visible + .ui-demo-rating__star { outline: 3px solid #2563eb; outline-offset: 2px; border-radius: 4px; }
.ui-demo-rating__footer { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.ui-demo-rating__messages { min-width: 0; font-size: 12px; }
.ui-demo-rating__messages p { margin: 0; overflow-wrap: anywhere; }
.ui-demo-fieldset-example { height: 100%; padding: 12px; overflow: auto; }
.ui-demo-fieldset__group { min-width: 0; margin: 0; padding: 12px; border: 1px solid #94a3b8; border-radius: 6px; }
.ui-demo-fieldset__group--plain { border: 0; padding: 8px 0; }
.ui-demo-fieldset__legend { padding: 0 6px; font-weight: 600; overflow-wrap: anywhere; }
.ui-demo-fieldset__field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; min-width: 0; }
.ui-demo-fieldset__field:last-child { margin-bottom: 0; }
.ui-demo-fieldset__field label { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.ui-demo-fieldset__help { margin: 0; font-size: 12px; color: #475569; overflow-wrap: anywhere; }
.ui-demo-fieldset__switch { margin-bottom: 12px; }
.ui-demo-fieldset__group:disabled { background: #f8fafc; color: #64748b; }
.ui-demo-fieldset__group:disabled input, .ui-demo-fieldset__group:disabled select { color: #64748b; background: #f1f5f9; cursor: not-allowed; }

/* P27 D01: navigation stays inside its own sample. */
.ui-demo-navigation { width: 100%; height: 100%; min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; overflow: hidden; background: #ffffff; }
.ui-demo-navigation__nav { display: flex; flex-wrap: wrap; flex: none; gap: 4px; padding: 8px; border-bottom: 1px solid var(--ui-demo-border); background: #f5f7fb; }
.ui-demo-navigation__link { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 6px 12px; border: 1px solid transparent; border-radius: 5px; color: #174da1; text-decoration: underline; font-weight: 600; overflow-wrap: anywhere; }
.ui-demo-navigation__link[aria-current="page"] { border-color: #174da1; background: #e9f0ff; color: #123d80; text-decoration-thickness: 2px; }
.ui-demo-navigation__link:focus-visible, .ui-demo-navigation__scroll:focus-visible, .ui-demo-navigation__heading:focus-visible { outline: 2px solid #174da1; outline-offset: -2px; }
.ui-demo-navigation__scroll { min-width: 0; min-height: 0; flex: 1; overflow: auto; overscroll-behavior: contain; padding: 16px; }
.ui-demo-navigation__heading { margin: 0 0 12px; font-size: 20px; line-height: 1.5; overflow-wrap: anywhere; }
.ui-demo-navigation__content { margin: 0; overflow-wrap: anywhere; }
.ui-demo-navigation__icon { width: 24px; height: 24px; flex: none; }
.ui-demo-navigation--sidebar { flex-direction: row; }
.ui-demo-navigation--sidebar .ui-demo-navigation__nav { box-sizing: border-box; flex: 0 0 120px; width: 120px; align-content: start; flex-direction: column; flex-wrap: nowrap; border-bottom: 0; border-right: 1px solid var(--ui-demo-border); overflow: auto; }
.ui-demo-navigation--sidebar .ui-demo-navigation__link { justify-content: flex-start; }
.ui-demo-navigation--bottom .ui-demo-navigation__nav { position: absolute; inset-inline: 0; bottom: 0; z-index: 1; border-top: 1px solid var(--ui-demo-border); border-bottom: 0; justify-content: center; }
.ui-demo-navigation--bottom .ui-demo-navigation__scroll { height: 100%; flex: none; }
.ui-demo-navigation--icon .ui-demo-navigation__link { flex-direction: column; }

/* P27: breadcrumb and pagination, scoped to their own sample. */
.ui-demo-breadcrumb { box-sizing: border-box; width: 100%; height: 100%; padding: 16px; overflow: auto; overscroll-behavior: contain; color: #334155; }
.ui-demo-breadcrumb__list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ui-demo-breadcrumb__item { display: flex; align-items: baseline; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.ui-demo-breadcrumb__separator { color: #64748b; }
.ui-demo-breadcrumb__body { margin-top: 20px; }
.ui-demo-breadcrumb__heading { margin: 0 0 12px; font-size: 18px; line-height: 1.5; overflow-wrap: anywhere; }
.ui-demo-breadcrumb:focus-visible, .ui-demo-breadcrumb__heading:focus-visible, .ui-demo-pagination__results:focus-visible { outline: 3px solid #2563eb; outline-offset: -3px; }
.ui-demo-pagination { display: flex; flex-direction: column; gap: 12px; box-sizing: border-box; width: 100%; height: 100%; padding: 16px; overflow: hidden; color: #334155; }
.ui-demo-pagination__results { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.ui-demo-pagination__items { margin: 0; padding: 0; list-style: none; }
.ui-demo-pagination__item { padding: 12px; border-bottom: 1px solid #e2e8f0; line-height: 1.5; overflow-wrap: anywhere; }
.ui-demo-pagination__controls { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.ui-demo-pagination__numbers { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.ui-demo-pagination__number { min-width: 36px; padding: 6px 8px; }
.ui-demo-pagination__position { padding: 4px 8px; white-space: nowrap; }

/* D04: independent table-of-contents/body scrollports; no global link reset. */
.ui-demo-toc {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  color: #253246;
  background: #fff;
  font: 14px/1.6 system-ui, sans-serif;
}
.ui-demo-toc--top { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
.ui-demo-toc__nav { min-width: 0; min-height: 0; overflow: auto; border-right: 1px solid #dbe3ec; padding: 8px; }
.ui-demo-toc--top .ui-demo-toc__nav { border-right: 0; border-bottom: 1px solid #dbe3ec; }
.ui-demo-toc__list { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.ui-demo-toc--top .ui-demo-toc__list { flex-direction: row; flex-wrap: wrap; }
.ui-demo-toc__link { display: block; box-sizing: border-box; min-height: 36px; padding: 6px 8px; color: #1d4ed8; border-radius: 4px; overflow-wrap: anywhere; text-underline-offset: 3px; }
.ui-demo-toc__link[aria-current="location"] { background: #e8efff; color: #143890; font-weight: 700; }
.ui-demo-toc__body { min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; scroll-behavior: auto; }
.ui-demo-toc__chapter { box-sizing: border-box; min-height: var(--ui-demo-toc-viewport, 100%); padding: 16px; overflow-wrap: anywhere; }
.ui-demo-toc__chapter + .ui-demo-toc__chapter { border-top: 1px solid #dbe3ec; }
.ui-demo-toc__heading { margin: 0 0 12px; color: #172438; font: 700 18px/1.4 system-ui, sans-serif; }
.ui-demo-toc__description { margin: 0 0 16px; }
.ui-demo-toc__paragraph { margin: 0 0 16px; }
.ui-demo-toc__paragraph:last-child { margin-bottom: 0; }
.ui-demo-toc__link:focus-visible, .ui-demo-toc__body:focus-visible, .ui-demo-toc__heading:focus {
  outline: 2px solid #2563eb; outline-offset: -2px;
}

/* P28 E01: expansion never changes the outside placement size. */
.ui-demo-accordion { width: 100%; height: 100%; min-width: 0; padding: 12px; overflow: auto; overscroll-behavior: contain; }
.ui-demo-accordion__section { margin: 0 0 8px; border: 1px solid var(--ui-demo-border); border-radius: 5px; background: #ffffff; }
.ui-demo-accordion__section:last-child { margin-bottom: 0; }
.ui-demo-accordion__heading { margin: 0; font-size: 16px; }
.ui-demo-accordion__trigger { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 4px; background: #f5f7fb; color: #243244; text-align: left; font: inherit; font-weight: 600; cursor: pointer; overflow-wrap: anywhere; }
.ui-demo-accordion__trigger[aria-expanded="true"] { color: #174da1; background: #e9f0ff; }
.ui-demo-accordion__trigger:focus-visible, .ui-demo-accordion:focus-visible { outline: 2px solid #174da1; outline-offset: -2px; }
.ui-demo-accordion__chevron { flex: none; }
.ui-demo-accordion__panel { padding: 12px; border-top: 1px solid var(--ui-demo-border); }
.ui-demo-accordion__panel[hidden] { display: none; }
.ui-demo-accordion__text { margin: 0; overflow-wrap: anywhere; }


/* P28 drawer: all positions and backdrop are inside the frame document. */
.ui-demo-drawer-example { width: 100%; height: 100%; position: relative; color: #253246; background: #ffffff; }
.ui-demo-drawer__background { width: 100%; height: 100%; min-width: 0; min-height: 0; overflow: auto; padding: 16px; overscroll-behavior: contain; }
.ui-demo-drawer-example[data-drawer-open="true"][data-drawer-variant="right-modeless"] > .ui-demo-drawer__background { width: calc(100% - min(320px, 85vw)); padding: 8px; }
.ui-demo-drawer-example[data-drawer-open="true"][data-drawer-variant="bottom-modeless"] > .ui-demo-drawer__background { height: calc(100% - min(280px, 70vh)); }
.ui-demo-drawer__buttons { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.ui-demo-drawer__button { min-width: 0; max-width: 100%; min-height: 36px; padding: 6px 12px; border: 1px solid #71839b; border-radius: 5px; background: #ffffff; color: #253246; cursor: pointer; font: inherit; line-height: 1.4; white-space: normal; overflow-wrap: anywhere; }
.ui-demo-drawer-example[data-drawer-open="true"][data-drawer-variant="right-modeless"] .ui-demo-drawer__background .ui-demo-drawer__button { padding-inline: 4px; }
.ui-demo-drawer__button:disabled { opacity: 0.5; cursor: default; }
.ui-demo-drawer__count, .ui-demo-drawer__supplement { margin: 12px 0 0; overflow-wrap: anywhere; }
.ui-demo-drawer__supplement { padding: 12px; border-left: 3px solid #2563eb; background: #eff6ff; }
.ui-demo-drawer__window { position: fixed; inset: auto; max-width: none; max-height: none; margin: 0; padding: 16px; border: 1px solid #71839b; background: #ffffff; color: #253246; overflow: auto; overscroll-behavior: contain; box-shadow: 0 0 16px #0f172a26; z-index: 2; }
.ui-demo-drawer__window::backdrop { background: #0f172a59; }
.ui-demo-drawer__window--right { right: 0; top: 0; width: min(320px, 85vw); height: 100vh; }
.ui-demo-drawer__window--left { left: 0; top: 0; width: min(320px, 85vw); height: 100vh; }
.ui-demo-drawer__window--top { left: 0; top: 0; width: 100vw; height: min(280px, 70vh); }
.ui-demo-drawer__window--bottom { left: 0; bottom: 0; width: 100vw; height: min(280px, 70vh); }
.ui-demo-drawer__header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.ui-demo-drawer__title { margin: 0; font-size: 18px; line-height: 1.5; }
.ui-demo-drawer__switch-label { display: flex; align-items: center; gap: 10px; overflow-wrap: anywhere; cursor: pointer; }
.ui-demo-drawer__switch { appearance: none; position: relative; flex: none; width: 44px; height: 26px; margin: 0; border: 1px solid #64748b; border-radius: 13px; background: #cbd5e1; cursor: pointer; }
.ui-demo-drawer__switch::before { content: ""; display: block; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #ffffff; }
.ui-demo-drawer__switch:checked { background: #2563eb; border-color: #2563eb; }
.ui-demo-drawer__switch:checked::before { left: 21px; }
.ui-demo-drawer__button:focus-visible, .ui-demo-drawer__switch:focus-visible { outline: 2px solid #174da1; outline-offset: 2px; }
.ui-demo-drawer__background:focus-visible { outline: 2px solid #174da1; outline-offset: -3px; }

/* P29 F01/F06: scoped inline panels; no global live alerts or app styles. */
.ui-demo-notice-example, .ui-demo-result-example { width: 100%; height: 100%; min-width: 0; }
.ui-demo-notice-example__content { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ui-demo-notice { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 12px; border: 1px solid; border-radius: 6px; }
.ui-demo-notice--success { color: #166534; border-color: #86b69b; background: #effaf3; }
.ui-demo-notice--warning { color: #784b00; border-color: #d5b555; background: #fff9e5; }
.ui-demo-notice--error { color: #a32131; border-color: #d6a0a7; background: #fff0f1; }
.ui-demo-notice--banner { color: #174b87; border-color: #99b5d7; background: #eef5ff; border-radius: 0; }
.ui-demo-notice__icon { width: 24px; height: 24px; flex: none; }
.ui-demo-notice__text { min-width: 0; flex: 1; margin: 0; overflow-wrap: anywhere; }
.ui-demo-notice__close, .ui-demo-notice__restore, .ui-demo-result__action { min-height: 36px; border: 1px solid #71839b; border-radius: 5px; padding: 6px 10px; background: #ffffff; color: #253246; font: inherit; line-height: 1.4; cursor: pointer; }
.ui-demo-notice__close { flex: none; font-size: 14px; }
.ui-demo-notice__restore { align-self: flex-start; }
.ui-demo-notice__close:focus-visible, .ui-demo-notice__restore:focus-visible, .ui-demo-result__action:focus-visible, .ui-demo-result__heading:focus-visible { outline: 2px solid #174da1; outline-offset: 2px; }
.ui-demo-result-example .ui-demo-static-content__body { display: flex; min-height: 100%; }
.ui-demo-result__panel { min-width: 0; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; margin-block: auto; text-align: center; }
.ui-demo-result__message, .ui-demo-result__card { min-width: 0; width: 100%; }
.ui-demo-result__card { border: 1px solid var(--ui-demo-border); border-radius: 6px; padding: 12px; background: #ffffff; }
.ui-demo-result__icon { display: block; margin: 0 auto 10px; color: #315e95; }
.ui-demo-result__heading { margin: 0 0 8px; font-size: 18px; line-height: 1.5; overflow-wrap: anywhere; }
.ui-demo-result__description { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.ui-demo-result__action { max-width: 100%; flex: none; overflow-wrap: anywhere; }

/* P29 toast: its whole lifetime and hit area belong to a single local overlay. */
.ui-demo-toast-example { width: 100%; height: 100%; padding: 16px; overflow: auto; overscroll-behavior: contain; }
.ui-demo-toast__trigger, .ui-demo-toast__close { min-height: 36px; max-width: 100%; padding: 6px 12px; border: 1px solid #71839b; border-radius: 5px; background: #ffffff; color: #253246; font: inherit; line-height: 1.4; cursor: pointer; overflow-wrap: anywhere; }
.ui-demo-toast__count { margin: 12px 0 0; overflow-wrap: anywhere; }
.ui-demo-toast { position: absolute; right: 12px; bottom: 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 0; width: max-content; max-width: calc(100% - 24px); max-height: calc(100% - 24px); padding: 0; overflow: auto; overscroll-behavior: contain; border: 0; pointer-events: none; color: #253246; }
.ui-demo-toast[data-toast-open="true"] { gap: 12px; padding: 12px; border: 1px solid #8ca1bd; border-radius: 6px; background: #f0f6ff; box-shadow: 0 4px 12px #0f172a1a; pointer-events: auto; }
.ui-demo-toast__status { min-width: 0; margin: 0; align-self: center; line-height: 1.6; overflow-wrap: anywhere; }
.ui-demo-toast__trigger:focus-visible, .ui-demo-toast__close:focus-visible { outline: 2px solid #174da1; outline-offset: 2px; }

/* P30: retained progress/spinner state is separate from decorative CSS motion. */
.ui-demo-progress, .ui-demo-spinner { width: 100%; height: 100%; min-width: 0; }
.ui-demo-progress .ui-demo-static-content__body,
.ui-demo-spinner .ui-demo-static-content__body { display: flex; min-height: 100%; }
.ui-demo-progress__content {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 12px; width: 100%; min-width: 0;
}
.ui-demo-progress__bar { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.ui-demo-progress__percentage { font-size: 18px; font-weight: 700; line-height: 1.4; text-align: center; }
.ui-demo-progress__track { position: relative; width: 100%; height: 14px; flex: 0 0 14px; overflow: hidden; border-radius: 7px; background: #e3e9f0; }
.ui-demo-progress__bar-fill { display: block; height: 100%; border-radius: inherit; background: #2563c7; }
.ui-demo-progress__ring { position: relative; display: grid; place-items: center; width: 112px; height: 112px; flex: 0 0 112px; }
.ui-demo-progress__ring-svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.ui-demo-progress__ring-track, .ui-demo-progress__ring-value { fill: none; stroke-width: 8; }
.ui-demo-progress__ring-track { stroke: #e3e9f0; }
.ui-demo-progress__ring-value { stroke: #2563c7; transform: rotate(-90deg); transform-origin: 50% 50%; }
.ui-demo-progress__status { margin: 0; font-size: 16px; line-height: 1.5; }
.ui-demo-progress__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ui-demo-progress__indeterminate-fill { display: block; width: 38%; height: 100%; border-radius: inherit; background: #2563c7; transform: translateX(80%); animation: none; }
.ui-demo-progress[data-animating="true"] .ui-demo-progress__indeterminate-fill { animation: ui-demo-progress-travel 1.4s ease-in-out infinite; }
@keyframes ui-demo-progress-travel { from { transform: translateX(-100%); } to { transform: translateX(270%); } }
.ui-demo-spinner__content {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; min-width: 0; gap: 4px;
}
.ui-demo-spinner__symbol { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px; }
.ui-demo-spinner__ring { display: block; width: 48px; height: 48px; border: 5px solid #dce4ee; border-top-color: #2563c7; border-radius: 50%; animation: none; }
.ui-demo-spinner__dots { display: flex; align-items: center; gap: 6px; }
.ui-demo-spinner__dot { display: block; width: 10px; height: 10px; border-radius: 50%; background: #2563c7; animation: none; }
.ui-demo-spinner__status { margin: 0; font-size: 14px; line-height: 20px; }
.ui-demo-spinner[data-animating="true"] .ui-demo-spinner__ring { animation: ui-demo-spinner-turn .9s linear infinite; }
.ui-demo-spinner[data-animating="true"] .ui-demo-spinner__dot { animation: ui-demo-spinner-pulse 1.2s ease-in-out infinite; }
.ui-demo-spinner[data-animating="true"] .ui-demo-spinner__dot:nth-child(2) { animation-delay: .16s; }
.ui-demo-spinner[data-animating="true"] .ui-demo-spinner__dot:nth-child(3) { animation-delay: .32s; }
@keyframes ui-demo-spinner-turn { to { transform: rotate(360deg); } }
@keyframes ui-demo-spinner-pulse { 0%, 70%, 100% { opacity: .35; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) {
  .ui-demo-progress[data-animating="true"] .ui-demo-progress__indeterminate-fill,
  .ui-demo-spinner[data-animating="true"] .ui-demo-spinner__ring,
  .ui-demo-spinner[data-animating="true"] .ui-demo-spinner__dot { animation: none; }
}


/* P30 F05: decorative motion follows visibility, never the retained loading value. */
.ui-demo-skeleton-example {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}
.ui-demo-skeleton__region { min-width: 0; }
.ui-demo-skeleton__controls { padding: 0 12px 12px; }
.ui-demo-skeleton__status { margin: 0 0 6px; color: #455366; font-size: 14px; line-height: 20px; }
.ui-demo-skeleton__lines { display: grid; gap: 12px; min-width: 0; width: 100%; }
.ui-demo-skeleton__shape {
  display: block;
  background-color: #dce2e9;
  background-image: linear-gradient(100deg, transparent 25%, #f4f6f9 50%, transparent 75%);
  background-size: 200% 100%;
  animation: ui-demo-skeleton-shimmer 1.5s linear infinite;
  animation-play-state: paused;
}
.ui-demo-skeleton-example[data-animation-active="true"] .ui-demo-skeleton__shape { animation-play-state: running; }
.ui-demo-skeleton__line { height: 16px; border-radius: 4px; }
.ui-demo-skeleton__line--short { width: 68%; }
.ui-demo-skeleton__card { overflow: hidden; border: 1px solid #d1d8e1; border-radius: 8px; background: #fff; }
.ui-demo-skeleton__image-placeholder, .ui-demo-skeleton__image { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.ui-demo-skeleton__card-text { padding: 12px; }
.ui-demo-skeleton__paragraphs { display: grid; gap: 12px; }
.ui-demo-skeleton__paragraph { margin: 0; font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.ui-demo-skeleton__heading { margin: 0; font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.ui-demo-skeleton__description { margin: 6px 0 0; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.ui-demo-skeleton__list, .ui-demo-skeleton__list-placeholder { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.ui-demo-skeleton__row { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.ui-demo-skeleton__row-text { min-width: 0; }
.ui-demo-skeleton__avatar { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; }
.ui-demo-skeleton__avatar--content { display: grid; place-items: center; color: #285791; background: #e2edfb; font-size: 14px; font-weight: 700; }
@keyframes ui-demo-skeleton-shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }
@media (prefers-reduced-motion: reduce) {
  .ui-demo-skeleton__shape { animation: none; background-image: none; }
}

/* P31 G01: the real table keeps its content width inside this sample's scrollport. */
.ui-demo-table { width: 100%; height: 100%; min-width: 0; }
.ui-demo-table .ui-demo-static-content { overflow-x: auto; }
.ui-demo-table__grid { width: 100%; min-width: 480px; border-collapse: separate; border-spacing: 0; font-size: 14px; line-height: 1.5; }
.ui-demo-table[data-table-variant="selectable"] .ui-demo-table__grid { min-width: 560px; }
.ui-demo-table__cell { height: 38px; padding: 7px 12px; border-bottom: 1px solid var(--ui-demo-border); text-align: left; white-space: nowrap; }
.ui-demo-table__heading { background: #edf2f8; font-weight: 700; }
.ui-demo-table__row-heading { font-weight: 500; }
.ui-demo-table__row--selected { background: #eaf2ff; }
.ui-demo-table__sort { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; margin: -6px 0; padding: 4px 0; border: 0; border-radius: 3px; background: transparent; color: inherit; font: inherit; font-weight: 700; cursor: pointer; }
.ui-demo-table__sort-mark { font-size: 11px; }
.ui-demo-table__sort:focus-visible, .ui-demo-table__checkbox:focus-visible { outline: 2px solid var(--ui-demo-focus); outline-offset: 3px; }
.ui-demo-table__checkbox { display: block; width: 18px; height: 18px; margin: 0; accent-color: var(--ui-demo-focus); cursor: pointer; }
.ui-demo-table__check-cell { width: 42px; }
.ui-demo-table__result { margin: 0 0 8px; color: var(--ui-demo-muted); font-size: 14px; }

.ui-demo-tree {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 12px;
  overflow: auto;
  color: #243247;
  font: 15px/1.5 system-ui, sans-serif;
}
.ui-demo-tree__root,
.ui-demo-tree__group {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ui-demo-tree__root { min-width: 210px; }
.ui-demo-tree__group { padding-left: 24px; }
.ui-demo-tree__group[hidden] { display: none; }
.ui-demo-tree__item { margin: 0; padding: 0; outline: none; }
.ui-demo-tree__row {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  min-height: 38px;
  margin: 2px 0;
  border: 1px solid transparent;
  border-radius: 5px;
}
.ui-demo-tree__item[aria-selected="true"] > .ui-demo-tree__row {
  color: #143a80;
  background: #eaf1ff;
  border-color: #97b8f3;
}
.ui-demo-tree__item:focus-visible > .ui-demo-tree__row {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}
.ui-demo-tree__toggle,
.ui-demo-tree__leaf {
  box-sizing: border-box;
  flex: 0 0 30px;
  width: 30px;
  height: 32px;
}
.ui-demo-tree__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}
.ui-demo-tree__toggle:hover { background: #dbe7f4; }
.ui-demo-tree__toggle:focus-visible { outline: 2px solid #2563eb; outline-offset: -2px; }
.ui-demo-tree__label {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 8px 6px 0;
  overflow-wrap: anywhere;
  cursor: pointer;
}
/* P31: fixed-data timelines; only this sample opts into horizontal scrolling. */
.ui-demo-timeline { height: 100%; min-width: 0; }
.ui-demo-timeline > .ui-demo-static-content { overflow-x: auto; }
.ui-demo-timeline__list { list-style: none; margin: 0; padding: 0; }
.ui-demo-timeline__item { position: relative; display: flex; gap: 12px; padding: 0 0 20px; min-height: 86px; }
.ui-demo-timeline__item:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: 0; width: 1px; background: #abbace; }
.ui-demo-timeline__marker { position: relative; flex: 0 0 12px; width: 12px; height: 12px; margin-top: 5px; border-radius: 50%; background: #356da6; }
.ui-demo-timeline__content { min-width: 0; overflow-wrap: anywhere; }
.ui-demo-timeline__content time { color: #57657a; font-size: 13px; font-variant-numeric: tabular-nums; }
.ui-demo-timeline__label { margin: 3px 0 0; font-weight: 700; }
.ui-demo-timeline__description { margin: 4px 0 0; font-size: 14px; }
.ui-demo-timeline__list--horizontal { display: flex; min-width: 540px; padding-top: 6px; }
.ui-demo-timeline__list--horizontal .ui-demo-timeline__item { flex: 1 0 180px; flex-direction: column; gap: 10px; padding-right: 16px; }
.ui-demo-timeline__list--horizontal .ui-demo-timeline__item:not(:last-child)::before { left: 6px; right: -6px; top: 10px; bottom: auto; width: auto; height: 1px; }
.ui-demo-timeline__list--horizontal .ui-demo-timeline__marker { flex: 0 0 12px; }
.ui-demo-timeline__list--activity .ui-demo-timeline__item { min-height: 96px; }
.ui-demo-timeline__list--activity .ui-demo-timeline__marker { display: grid; place-items: center; flex-basis: 36px; width: 36px; height: 36px; margin-top: 0; color: #285791; background: #e2edfb; font-size: 13px; font-weight: 700; }
.ui-demo-timeline__list--activity .ui-demo-timeline__item:not(:last-child)::before { left: 17px; top: 36px; }

/* P32: seven real columns, a local event scrollport, and no app-level selectors. */
.ui-demo-calendar { display: flex; flex-direction: column; gap: 8px; width: 100%; height: 100%; padding: 12px; min-width: 0; min-height: 0; color: #243247; }
.ui-demo-calendar__navigation { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 12px; }
.ui-demo-calendar__heading { margin: 0; font-size: 18px; line-height: 1.5; }
.ui-demo-calendar__button { min-height: 34px; padding: 5px 12px; border: 1px solid #b2bfd0; border-radius: 5px; background: #fff; color: #243247; font: inherit; font-size: 14px; line-height: 1.5; cursor: pointer; }
.ui-demo-calendar__button:hover:not(:disabled) { background: #edf3ff; }
.ui-demo-calendar__button:disabled { color: #68788c; background: #f2f4f7; cursor: default; }
.ui-demo-calendar__button:focus-visible, .ui-demo-calendar__date:focus-visible, .ui-demo-calendar__events:focus-visible { outline: 2px solid var(--ui-demo-focus); outline-offset: -2px; }
.ui-demo-calendar__grid { flex: 0 0 auto; table-layout: fixed; width: 100%; border-collapse: separate; border-spacing: 2px; font-size: 14px; line-height: 1.25; }
.ui-demo-calendar__grid th { height: 22px; padding: 0; text-align: center; font-weight: 600; color: #546176; }
.ui-demo-calendar__grid td { padding: 0; text-align: center; }
.ui-demo-calendar__date { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 38px; padding: 1px; border: 1px solid #e1e6ed; border-radius: 4px; background: #fff; color: #243247; font: inherit; cursor: pointer; }
.ui-demo-calendar__date:hover { background: #edf3ff; }
.ui-demo-calendar__grid td[aria-selected="true"] .ui-demo-calendar__date { border: 2px solid #3264b3; background: #eaf2ff; font-weight: 700; }
.ui-demo-calendar__count { font-size: 10px; line-height: 13px; white-space: nowrap; color: #345b88; }
.ui-demo-calendar__events { flex: 1 1 auto; min-height: 0; padding: 4px; overflow: auto; overflow-wrap: anywhere; border-top: 1px solid #d6dde7; }
.ui-demo-calendar__selection { margin: 0 0 8px; font-size: 14px; line-height: 1.5; font-weight: 600; }
.ui-demo-calendar__list { margin: 0; padding: 0; list-style: none; }
.ui-demo-calendar__event { display: flex; flex-wrap: wrap; gap: 4px 12px; width: 100%; text-align: left; }
.ui-demo-calendar__event[aria-pressed="true"] { border-color: #3264b3; background: #eaf2ff; }
.ui-demo-calendar__empty { margin: 0; font-size: 14px; color: #546176; }
.ui-demo-calendar__detail { margin-top: 8px; padding: 8px 12px; border-left: 3px solid #7e9bbd; background: #f4f7fb; font-size: 14px; line-height: 1.5; }
.ui-demo-calendar__detail h4 { margin: 0; font-size: 14px; }
.ui-demo-calendar__detail p { margin: 4px 0 0; }

/* P33: measured SVG geometry; labels stay in CSS pixels. */
.ui-demo-chart { display: flex; flex-direction: column; gap: 8px; width: 100%; height: 100%; min-width: 0; min-height: 0; padding: 12px; }
.ui-demo-chart__plot { position: relative; flex: 1 1 auto; min-width: 0; min-height: 100px; }
.ui-demo-chart__plot > svg { display: block; }
.ui-demo-chart__inspection, .ui-demo-chart__result { flex: 0 0 auto; margin: 0; font-size: 13px; line-height: 20px; overflow-wrap: anywhere; }
.ui-demo-chart__inspection { color: #48566a; }
.ui-demo-chart__result { color: #223149; font-weight: 600; }
.ui-demo-chart__grid-line { stroke: #dce3eb; stroke-width: 1; }
.ui-demo-chart__label { font-size: 12px; fill: #3c4b60; }
.ui-demo-chart__value { font-weight: 700; }
.ui-demo-chart__bar { stroke: #fff; stroke-width: 1; }
.ui-demo-chart__item { cursor: pointer; outline: none; }
.ui-demo-chart__item[aria-pressed="true"] .ui-demo-chart__bar,
.ui-demo-chart__item[data-inspected="true"] .ui-demo-chart__bar,
.ui-demo-chart__item:focus-visible .ui-demo-chart__bar,
.ui-demo-chart__item[aria-pressed="true"] .ui-demo-chart__point,
.ui-demo-chart__item[data-inspected="true"] .ui-demo-chart__point,
.ui-demo-chart__item:focus-visible .ui-demo-chart__point { stroke: #152743; stroke-width: 3; }
.ui-demo-chart__item:focus-visible .ui-demo-chart__point-hit { stroke: #152743; stroke-width: 2; }
.ui-demo-chart__legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.ui-demo-chart__legend li { display: flex; align-items: center; gap: 6px; }
.ui-demo-chart__swatch { display: inline-block; width: 12px; height: 12px; }
.ui-demo-chart__swatch--draft { background: #5574b8; }
.ui-demo-chart__swatch--complete { background: #23775d; }
.ui-demo-chart__legend-button { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; border: 1px solid #8291a5; border-radius: 5px; background: #fff; color: #25344a; padding: 4px 10px; font: inherit; cursor: pointer; }
.ui-demo-chart__legend-button[aria-pressed="true"] { background: #edf3ff; border-color: #4268ac; }
.ui-demo-chart__legend-button:focus-visible { outline: 3px solid #275dcc; outline-offset: 2px; }
.ui-demo-chart__series-symbol { margin-right: 6px; white-space: nowrap; }
.ui-demo-chart__series-symbol--a { color: #4268ac; }
.ui-demo-chart__series-symbol--b { color: #a65022; }
.ui-demo-chart__empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; color: #354257; pointer-events: none; }

.ui-demo-pie__plot {
  min-height: 120px;
}

.ui-demo-pie__plot svg,
.ui-demo-gauge__plot svg {
  display: block;
}

.ui-demo-pie__slice {
  cursor: pointer;
  outline: none;
}

.ui-demo-pie__slice path {
  stroke: #fff;
  stroke-width: 2px;
}

.ui-demo-pie__slice[aria-pressed="true"] path,
.ui-demo-pie__slice[data-highlighted="true"] path {
  stroke: #172136;
  stroke-width: 3px;
}

.ui-demo-pie__slice:focus-visible path {
  stroke: #172136;
  stroke-width: 5px;
  stroke-dasharray: 5 3;
}

.ui-demo-pie__percentage {
  font-size: 12px;
  font-weight: 700;
  fill: #fff;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
}

.ui-demo-pie__total {
  font-size: 16px;
  font-weight: 700;
  fill: #1f2937;
  pointer-events: none;
}

.ui-demo-pie__total-label {
  font-size: 12px;
  fill: #1f2937;
  pointer-events: none;
}

.ui-demo-pie__legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 10px;
  flex: none;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  line-height: 1.5;
}

.ui-demo-pie__legend li {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ui-demo-pie__swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex: none;
}

.ui-demo-gauge__value {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  flex: none;
}

.ui-demo-gauge__plot {
  min-height: 36px;
}

.ui-demo-gauge__track {
  fill: #e1e6ef;
}

.ui-demo-gauge__fill {
  fill: #2563eb;
}

.ui-demo-gauge__arc-track,
.ui-demo-gauge__arc-value {
  fill: none;
  stroke-width: 16px;
  stroke-linecap: butt;
}

.ui-demo-gauge__arc-track {
  stroke: #e1e6ef;
}

.ui-demo-gauge__arc-value {
  stroke: #2563eb;
}

.ui-demo-gauge__number {
  font-size: 24px;
  fill: #1f2937;
  font-weight: 700;
}

.ui-demo-gauge__control {
  flex: none;
}

.ui-demo-gauge__help {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  flex: none;
  overflow-wrap: anywhere;
}
.ui-demo-video { box-sizing: border-box; width: 100%; height: 100%; padding: 16px; display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.ui-demo-video__element { display: block; width: 100%; min-height: 0; flex: 0 1 auto; aspect-ratio: 16 / 9; object-fit: contain; background: #111827; }
.ui-demo-video__element:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.ui-demo-video__description { margin: 0; flex: 0 0 auto; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.ui-demo-audio { box-sizing: border-box; display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 8px; overflow: auto; color: #243247; }
.ui-demo-audio__element { display: block; width: 100%; min-height: 54px; flex: 0 0 auto; }
.ui-demo-audio__element:focus-visible, .ui-demo-audio__seek-label input:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.ui-demo-audio__waveform { flex: 0 0 auto; }
.ui-demo-audio__peaks { display: block; width: 100%; height: 40px; background: #edf3fa; cursor: pointer; }
.ui-demo-audio__peak { stroke: #507397; stroke-width: 5; }
.ui-demo-audio__position { stroke: #175ed5; stroke-width: 2; }
.ui-demo-audio__hover { stroke: #63738a; stroke-width: 1; stroke-dasharray: 3 3; }
.ui-demo-audio__seek-label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.ui-demo-audio__seek-label input { box-sizing: border-box; width: 100%; margin: 0; min-height: 24px; }
.ui-demo-audio__time, .ui-demo-audio__description { margin: 0; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }

/* Finger-sized targets only for the widgets reviewed in mobile stage 4.
   Keep desktop geometry and unrelated examples unchanged. */
@media (pointer: coarse) {
  .ui-demo-operation-menu-example > .ui-demo-button,
  .ui-demo-menu__item,
  .ui-demo-menubar__trigger,
  .ui-demo-combo__input,
  .ui-demo-combo__clear,
  .ui-demo-combo__remove,
  .ui-demo-combo__option,
  .ui-demo-tooltip__trigger,
  .ui-demo-popover-example > .ui-demo-button,
  .ui-demo-popover > .ui-demo-button,
  .ui-demo-search__row > .ui-demo-button,
  .ui-demo-dialog__button,
  .ui-demo-drawer__button,
  .ui-demo-lightbox__header > .ui-demo-button,
  .ui-demo-lightbox__controls > .ui-demo-button {
    min-width: 44px;
    min-height: 44px;
  }
  .ui-demo-combo__remove { flex: none; }
  .ui-demo-popover__check,
  .ui-demo-drawer__switch-label { min-height: 44px; }
  .ui-demo-combo__input,
  .ui-demo-search__control,
  .ui-demo-dialog__note { font-size: 16px; }

  /* Reserve half a thumb on both rail ends, also at 0 and 100. */
  .ui-demo-slider__control { padding: 22px 22px 0; }
  .ui-demo-slider__thumb { width: 44px; height: 44px; }
  .ui-demo-slider__limits { margin-top: 22px; }

  .ui-demo-audio__peaks { height: 64px; }
  .ui-demo-audio__seek-label input { min-height: 44px; }
  .ui-demo-audio__hover { display: none; }
}
