:root {
  --accent-color: #1769e8;
  --on-accent-color: #ffffff;
  --color-main: #172033;
  --color-back: #f5f7f9;
  --color-panel: #ffffff;
  --color-border: #d8dee8;
  --color-muted: #657185;
  --color-soft: #eaf0f7;
  --color-danger: #bd3e48;
  --editor-background: #ffffff;
  --editor-chrome: #f4f6f9;
  --editor-text: #172033;
  --font-ui: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --hosted-accent-duration: 3333ms;
}

html[data-theme="dark"],
html[data-brightness="dark"] {
  --color-main: #edf2fa;
  --color-back: #101722;
  --color-panel: #172131;
  --color-border: #334155;
  --color-muted: #a8b5c8;
  --color-soft: #1e2b3f;
  --color-danger: #ff818b;
  --editor-background: #1e2430;
  --editor-chrome: #252c39;
  --editor-text: #e8edf6;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
}

html {
  color-scheme: light;
  background: var(--color-back);
  transition: color var(--hosted-accent-duration) ease, background-color var(--hosted-accent-duration) ease;
}

html[data-theme="dark"],
html[data-brightness="dark"] {
  color-scheme: dark;
}

body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  color: var(--color-main);
  background: var(--color-back);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.45;
  transition: color var(--hosted-accent-duration) ease, background-color var(--hosted-accent-duration) ease;
}

a {
  color: inherit;
}

button,
select,
textarea {
  font: inherit;
}

button,
select {
  min-height: 2.35rem;
  padding: 0.48rem 0.72rem;
  border: 1px solid var(--color-border);
  border-radius: 0.55rem;
  color: var(--color-main);
  background: var(--color-panel);
  cursor: pointer;
  transition: color var(--hosted-accent-duration) ease, background-color var(--hosted-accent-duration) ease, border-color var(--hosted-accent-duration) ease, box-shadow 160ms ease;
}

button:hover,
select:hover {
  border-color: var(--accent-color);
}

button:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent-color) 70%, white);
  outline-offset: 2px;
}

input[type="checkbox"] {
  accent-color: var(--accent-color);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.direct-chrome {
  transition: color var(--hosted-accent-duration) ease, background-color var(--hosted-accent-duration) ease, border-color var(--hosted-accent-duration) ease;
}

#app-direct-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.8rem;
  gap: 1rem;
  padding: 0.7rem clamp(0.85rem, 3vw, 2rem);
  border-bottom: 1px solid var(--color-border);
  background: color-mix(in srgb, var(--color-panel) 94%, transparent);
}

.breadcrumb {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0.4rem;
  color: var(--color-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breadcrumb a {
  overflow: hidden;
  text-decoration: none;
  text-overflow: ellipsis;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.logo-trigger,
.icon-button {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2.35rem;
  min-height: 2.35rem;
  padding: 0;
}

.logo-trigger {
  height: 2.35rem;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.logo-trigger img {
  display: block;
  width: 2.35rem;
  height: 2.35rem;
  object-fit: contain;
}

#app-preferences-panel {
  position: fixed;
  z-index: 30;
  inset: 0 0 0 auto;
  width: min(24rem, 100vw);
  overflow: auto;
  border-left: 1px solid var(--color-border);
  background: var(--color-panel);
  box-shadow: -18px 0 36px rgb(23 32 51 / 14%);
  transform: translateX(100%);
  transition: transform 220ms ease, background-color var(--hosted-accent-duration) ease, border-color var(--hosted-accent-duration) ease;
}

#app-preferences-panel[aria-hidden="false"] {
  transform: translateX(0);
}

.preferences-panel-inner {
  display: grid;
  gap: 1rem;
  padding: 1.1rem;
}

.preferences-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.preferences-head h2,
.preference-section h3 {
  margin: 0;
}

.preference-section {
  display: grid;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.preference-section h3 {
  font-size: 0.95rem;
}

.preferences-chapters {
  display: grid;
  gap: 0.25rem;
}

.preferences-chapter-button {
  width: 100%;
  text-align: left;
}

.preferences-chapter-button[aria-current="true"] {
  border-color: var(--accent-color);
  color: var(--on-accent-color);
  background: var(--accent-color);
}

.preferences-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.88rem;
}

#app {
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.playground-app {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.playground-shell {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  background: var(--color-panel);
  box-shadow: 0 1px 3px rgb(23 32 51 / 7%);
}

.playground-shell[data-layout="horizontal"] {
  grid-template-columns: minmax(20rem, var(--preview-ratio, 70%)) minmax(18rem, 1fr);
}

.playground-shell[data-layout="vertical"] {
  grid-template-rows: minmax(15rem, var(--preview-ratio, 60%)) minmax(15rem, 1fr);
}

.playground-shell[data-layout="preview"],
.playground-shell[data-layout="configuration"] {
  grid-template-columns: minmax(0, 1fr);
}

.playground-shell[data-layout="preview"] #configuration-pane,
.playground-shell[data-layout="configuration"] #preview-pane {
  display: none;
}

.playground-pane {
  display: grid;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--color-panel);
  transition: background-color var(--hosted-accent-duration) ease, border-color var(--hosted-accent-duration) ease, transform 220ms ease;
}

.configuration-pane {
  border-left: 1px solid var(--color-border);
  background: color-mix(in srgb, var(--color-soft) 22%, var(--color-panel));
}

.playground-shell[data-layout="vertical"] .configuration-pane {
  border-top: 1px solid var(--color-border);
  border-left: 0;
}

.pane-resize-handle {
  position: absolute;
  z-index: 20;
  display: grid;
  place-items: center;
  touch-action: none;
  cursor: ew-resize;
}

.pane-resize-handle[data-orientation="horizontal"] {
  top: 0;
  bottom: 0;
  left: calc(var(--preview-ratio, 70%) - 0.45rem);
  width: 0.9rem;
}

.pane-resize-handle[data-orientation="vertical"] {
  top: calc(var(--preview-ratio, 60%) - 0.45rem);
  right: 0;
  left: 0;
  width: auto;
  height: 0.9rem;
  cursor: ns-resize;
}

.resize-grip {
  display: block;
  width: 0.2rem;
  height: 2.6rem;
  border-radius: 999px;
  background: transparent;
  transition: background-color 160ms ease;
}

.pane-resize-handle:hover .resize-grip,
.pane-resize-handle:focus-visible .resize-grip,
.pane-resize-handle.is-dragging .resize-grip {
  background: var(--accent-color);
}

.pane-resize-handle[data-orientation="vertical"] .resize-grip {
  width: 2.6rem;
  height: 0.2rem;
}

.pane-scroll {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.preview-pane .pane-scroll {
  background: var(--color-panel);
}

.widget-stage {
  position: relative;
  display: flex;
  min-height: 100%;
  background: var(--color-panel);
}

.demo-content {
  width: 100%;
  min-height: 42rem;
  padding: clamp(1.25rem, 4vw, 4.5rem);
  overflow: hidden;
}

.demo-content::selection {
  color: var(--on-accent-color);
  background: var(--accent-color);
}

.drawer-trigger {
  position: absolute;
  z-index: 8;
  top: 0.75rem;
  right: 0.75rem;
  display: none;
  border-color: var(--accent-color);
  color: var(--on-accent-color);
  background: var(--accent-color);
  box-shadow: 0 6px 18px rgb(23 32 51 / 18%);
}

.preview-runtime-message {
  position: absolute;
  z-index: 7;
  right: 1rem;
  bottom: 0.75rem;
  left: 1rem;
  min-height: 1.3rem;
  margin: 0;
  padding: 0.35rem 0.55rem;
  border-radius: 0.4rem;
  color: var(--color-muted);
  background: color-mix(in srgb, var(--color-panel) 88%, transparent);
  font-size: 0.76rem;
  pointer-events: none;
}

.preview-runtime-message:empty {
  display: none;
}

.preview-runtime-message.is-error {
  color: var(--color-danger);
}

.configuration-workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.config-pin {
  position: relative;
  z-index: 3;
  min-width: 0;
  background: color-mix(in srgb, var(--color-panel) 95%, var(--color-soft));
}

.config-pin-top {
  border-bottom: 1px solid var(--color-border);
}

.config-pin-bottom {
  border-top: 1px solid var(--color-border);
}

.config-pin-head {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 2.7rem;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
}

.config-pin-label {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--color-muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.layout-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  margin-left: auto;
}

.layout-button {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  min-height: 2rem;
  padding: 0.25rem;
  border-color: transparent;
  color: var(--color-muted);
  background: transparent;
}

.layout-button svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.45;
}

.layout-button .icon-highlight {
  fill: currentColor;
  stroke: none;
  opacity: 0.28;
}

.layout-button[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--accent-color) 45%, var(--color-border));
  color: var(--accent-color);
  background: color-mix(in srgb, var(--accent-color) 9%, var(--color-panel));
}

.collapse-button {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 1.9rem;
  min-height: 1.9rem;
  padding: 0;
  border-color: transparent;
  color: var(--color-muted);
  background: transparent;
  font-size: 1rem;
}

.chevron-icon {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 160ms ease;
}

.collapse-button[aria-expanded="true"] .chevron-icon {
  transform: rotate(180deg);
}

.collapse-button:hover {
  color: var(--color-main);
  background: var(--color-soft);
}

.drawer-close {
  display: inline-grid;
  width: 1.9rem;
  min-height: 1.9rem;
  padding: 0;
}

.config-top-body,
.config-bottom-body {
  min-width: 0;
  padding: 0 0.65rem 0.65rem;
}

.config-top-body {
  max-height: min(18rem, 34vh);
  overflow: auto;
  scrollbar-width: thin;
}

.control-section {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
  padding-top: 0.45rem;
}

.widget-section {
  padding-top: 0.8rem;
}

.control-label,
.section-label-row {
  color: var(--color-muted);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.section-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.demo-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
}

.demo-choice {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 3.3rem;
  padding: 0.45rem 0.5rem;
  text-align: left;
}

.demo-choice strong,
.demo-choice span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-choice strong {
  font-size: 0.77rem;
  line-height: 1.1;
}

.demo-choice span {
  margin-top: 0.18rem;
  color: var(--color-muted);
  font-size: 0.67rem;
}

.demo-choice[aria-pressed="true"] {
  border-color: var(--accent-color);
  color: var(--on-accent-color);
  background: var(--accent-color);
}

.demo-choice[aria-pressed="true"] span {
  color: color-mix(in srgb, var(--on-accent-color) 78%, transparent);
}

.widget-gallery-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 0.25rem;
  min-width: 0;
}

.widget-gallery {
  display: flex;
  min-width: 0;
  gap: 0.4rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

.widget-card {
  display: grid;
  flex: 0 0 9.4rem;
  align-content: space-between;
  min-height: 5.2rem;
  padding: 0.55rem;
  border-color: var(--color-border);
  text-align: left;
  scroll-snap-align: start;
}

.widget-card-visual {
  display: grid;
  grid-template-columns: repeat(4, 0.28rem);
  align-items: end;
  gap: 0.16rem;
  height: 1.25rem;
  margin-bottom: 0.35rem;
  color: var(--accent-color);
}

.widget-card-visual span {
  display: block;
  min-height: 0.35rem;
  border-radius: 0.1rem;
  background: currentColor;
}

.widget-card-visual span:nth-child(2) { min-height: 0.65rem; }
.widget-card-visual span:nth-child(3) { min-height: 0.95rem; }
.widget-card-visual span:nth-child(4) { min-height: 0.55rem; }

.widget-card[data-widget-mode="tooltip"] .widget-card-visual span:nth-child(2) { min-height: 0.4rem; }
.widget-card[data-widget-mode="tooltip"] .widget-card-visual span:nth-child(3) { min-height: 0.4rem; }
.widget-card[data-widget-mode="drawer"] .widget-card-visual { grid-template-columns: 0.35rem 0.35rem 0.35rem 0.35rem; }
.widget-card[data-widget-mode="inline"] .widget-card-visual span { min-height: 0.75rem; }

.widget-card strong,
.widget-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.widget-card strong {
  font-size: 0.78rem;
  line-height: 1.05;
}

.widget-card small {
  display: block;
  margin-top: 0.15rem;
  color: var(--color-muted);
  font-size: 0.65rem;
}

.widget-card[aria-selected="true"] {
  border-color: var(--accent-color);
  color: var(--on-accent-color);
  background: var(--accent-color);
}

.widget-card[aria-selected="true"] .widget-card-visual {
  color: var(--on-accent-color);
}

.widget-card[aria-selected="true"] small {
  color: color-mix(in srgb, var(--on-accent-color) 78%, transparent);
}

.gallery-arrow {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 1.75rem;
  min-height: 5.2rem;
  padding: 0;
  border-color: transparent;
  color: var(--color-muted);
  background: transparent;
}

.gallery-arrow:hover {
  color: var(--color-main);
  background: var(--color-soft);
}

.gallery-arrow svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.widget-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.35rem;
  min-width: 0;
  margin-top: 0.4rem;
}

.compact-button {
  min-height: 2.05rem;
  padding: 0.35rem 0.58rem;
  font-size: 0.74rem;
  white-space: nowrap;
}

.primary-button {
  border-color: var(--accent-color);
  color: var(--on-accent-color);
  background: var(--accent-color);
}

.primary-button:hover {
  border-color: color-mix(in srgb, var(--accent-color) 78%, var(--color-main));
  background: color-mix(in srgb, var(--accent-color) 88%, var(--color-main));
}

.active-widget-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  min-height: 1.7rem;
  padding-top: 0.25rem;
}

.active-widget-item {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  min-height: 1.75rem;
  padding: 0.15rem 0.25rem 0.15rem 0.45rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-muted);
  background: var(--color-panel);
  font-size: 0.72rem;
}

.active-widget-item.is-selected {
  border-color: var(--accent-color);
  color: var(--on-accent-color);
  background: var(--accent-color);
}

.active-widget-select,
.active-widget-remove {
  min-height: 1.45rem;
  padding: 0.1rem 0.35rem;
  border: 0;
  border-radius: 999px;
  color: inherit;
  background: transparent;
  font-size: 0.72rem;
}

.active-widget-remove {
  padding-right: 0.28rem;
  padding-left: 0.2rem;
  font-size: 0.95rem;
  line-height: 1;
}

.active-widget-item:not(.is-selected) .active-widget-select:hover,
.active-widget-item:not(.is-selected) .active-widget-remove:hover {
  background: var(--color-soft);
}

.checkbox-control {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-main);
  font-size: 0.75rem;
  white-space: nowrap;
}

.behavior-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  padding-top: 0.85rem;
}

.config-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.state-chip,
.stage-count {
  display: inline-flex;
  align-items: center;
  min-height: 1.65rem;
  padding: 0.18rem 0.42rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-muted);
  font-size: 0.66rem;
  white-space: nowrap;
}

.section-label-row .stage-count {
  min-height: 0;
  padding: 0;
  border: 0;
  color: var(--color-muted);
  background: transparent;
  font-size: 0.64rem;
  font-weight: 500;
}

.state-chip.is-edited {
  border-color: color-mix(in srgb, var(--accent-color) 50%, var(--color-border));
  color: var(--accent-color);
}

.invalid-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--color-danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-danger) 18%, transparent);
}

.configuration-scroll {
  background: color-mix(in srgb, var(--color-soft) 20%, var(--color-panel));
}

.configuration-view,
.implementation-view {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
  padding: 0.7rem;
}

.editor-frame {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 24rem;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 0.55rem;
  background: var(--editor-background);
}

.editor-mode {
  color: var(--color-muted);
}

.monaco-editor-container,
.recipe-editor {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 16rem;
  border: 0;
}

.recipe-editor {
  display: block;
  padding: 0.8rem;
  outline: 0;
  color: var(--editor-text);
  background: var(--editor-background);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.55;
  resize: none;
}

.config-message {
  flex: 1 1 auto;
  min-height: 1.25rem;
  margin: 0.45rem 0 0;
  color: var(--color-muted);
  font-size: 0.72rem;
}

.config-message.is-error {
  color: var(--color-danger);
}

.editor-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 2.5rem;
}

.editor-actions .config-message {
  margin-top: 0;
}

.implementation-view {
  background: color-mix(in srgb, var(--color-soft) 35%, var(--color-panel));
}

.implementation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.6rem;
}

.implementation-label {
  min-width: 0;
  overflow: hidden;
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.implementation-frame {
  flex: 1 1 auto;
  min-height: 24rem;
}

.implementation-fallback {
  min-height: 16rem;
  margin: 0;
  padding: 0.8rem;
  overflow: auto;
  color: var(--editor-text);
  background: var(--editor-background);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.action-row #github-button {
  margin-left: auto;
}

.action-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.config-pin-bottom .config-message {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-pin-bottom .config-bottom-body {
  padding-top: 0.05rem;
}

.playground-shell[data-layout="drawer"] #configuration-pane {
  position: absolute;
  z-index: 10;
  inset: 0 0 0 auto;
  width: min(31rem, calc(100% - 2rem));
  border-left: 1px solid var(--color-border);
  box-shadow: -18px 0 36px rgb(23 32 51 / 16%);
  transform: translateX(100%);
}

.playground-shell[data-layout="drawer"][data-config-open="true"] #configuration-pane {
  transform: translateX(0);
}

.playground-shell[data-layout="preview"] .drawer-trigger {
  display: inline-flex;
}

/* The three host surfaces deliberately share data-cxw-preview-anchor and data-cxw-preview-inline-target. */
.demo-content [data-cxw-preview-anchor],
.demo-content [data-cxw-preview-inline-target] {
  position: relative;
}

.demo-editorial {
  min-height: 100%;
  color: #253047;
  background: #fbfaf6;
  box-shadow: 0 14px 42px rgb(49 54 67 / 10%);
}

.demo-editorial .editorial-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.3rem;
  border-bottom: 1px solid #dedbd3;
  color: #5e665f;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.demo-editorial article {
  max-width: 56rem;
  margin: 0 auto;
  padding: clamp(2rem, 7vw, 6rem) clamp(1.3rem, 8vw, 7rem) 3rem;
}

.demo-editorial .editorial-kicker,
.demo-editorial .editorial-meta {
  color: #8c5a3c;
  font-size: 0.73rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.demo-editorial h2 {
  max-width: 13ch;
  margin: 0.8rem 0 1rem;
  color: #1f2d3e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 7vw, 5.8rem);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 0.94;
}

.demo-editorial .editorial-deck {
  max-width: 34rem;
  margin: 0;
  color: #687276;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  line-height: 1.45;
}

.demo-editorial .editorial-rule {
  width: 100%;
  height: 0.35rem;
  margin: 2rem 0;
  background: #d8a78d;
}

.demo-editorial .editorial-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(10rem, 0.38fr);
  gap: clamp(1.2rem, 4vw, 3rem);
  color: #4c5860;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1.65;
}

.demo-editorial .editorial-body p {
  margin: 0 0 1rem;
}

.demo-editorial .editorial-note {
  align-self: start;
  padding: 1rem;
  border-top: 2px solid #8c5a3c;
  color: #687276;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  line-height: 1.45;
}

.demo-editorial .editorial-note strong {
  display: block;
  margin-bottom: 0.3rem;
  color: #253047;
}

.demo-editorial .editorial-cta {
  margin-top: 1rem;
  border-color: #8c5a3c;
  color: #8c5a3c;
  background: transparent;
}

.demo-editorial .editorial-feedback-slot {
  display: grid;
  gap: 0.35rem;
  min-height: 4rem;
  margin-top: 2.5rem;
  padding: 0.95rem;
  border: 1px dashed #d8a78d;
  color: #8c5a3c;
  font-family: var(--font-ui);
  font-size: 0.78rem;
}

.demo-editorial .editorial-feedback-slot strong {
  color: #253047;
}

.demo-dashboard {
  min-height: 100%;
  padding: clamp(1.25rem, 4vw, 3.5rem);
  color: #f1f5fb;
  background: #111a2a;
}

.demo-dashboard .dashboard-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.demo-dashboard .dashboard-eyebrow {
  margin: 0 0 0.35rem;
  color: #7c9cff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.demo-dashboard h2 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.7rem, 4vw, 3.4rem);
  letter-spacing: -0.05em;
  line-height: 1;
}

.demo-dashboard .dashboard-date {
  color: #8c9bb4;
  font-size: 0.74rem;
}

.demo-dashboard .metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.demo-dashboard .metric-card {
  padding: 0.85rem;
  border: 1px solid #2b3b58;
  border-radius: 0.5rem;
  background: #17253b;
}

.demo-dashboard .metric-card span {
  color: #8c9bb4;
  font-size: 0.7rem;
}

.demo-dashboard .metric-card strong {
  display: block;
  margin-top: 0.4rem;
  color: #ffffff;
  font-size: clamp(1.2rem, 3vw, 2rem);
  letter-spacing: -0.04em;
}

.demo-dashboard .dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(12rem, 0.7fr);
  gap: 0.65rem;
  margin-top: 0.65rem;
}

.demo-dashboard .dashboard-panel {
  min-height: 13rem;
  padding: 1rem;
  border: 1px solid #2b3b58;
  border-radius: 0.5rem;
  background: #17253b;
}

.demo-dashboard .dashboard-panel h3 {
  margin: 0 0 0.85rem;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 650;
}

.demo-dashboard .dashboard-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
  height: 8.5rem;
  padding: 0.5rem 0.15rem 0;
  border-bottom: 1px solid #314563;
}

.demo-dashboard .dashboard-chart i {
  flex: 1 1 0;
  min-width: 0.6rem;
  border-radius: 0.2rem 0.2rem 0 0;
  background: linear-gradient(#7c9cff, #3e66e0);
}

.demo-dashboard .dashboard-chart i:nth-child(1) { height: 35%; }
.demo-dashboard .dashboard-chart i:nth-child(2) { height: 55%; }
.demo-dashboard .dashboard-chart i:nth-child(3) { height: 42%; }
.demo-dashboard .dashboard-chart i:nth-child(4) { height: 70%; }
.demo-dashboard .dashboard-chart i:nth-child(5) { height: 62%; }
.demo-dashboard .dashboard-chart i:nth-child(6) { height: 86%; }

.demo-dashboard .dashboard-list {
  display: grid;
  gap: 0.35rem;
  color: #a9b7cc;
  font-size: 0.74rem;
}

.demo-dashboard .dashboard-list div {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid #2b3b58;
}

.demo-dashboard .dashboard-list b {
  color: #ffffff;
  font-weight: 600;
}

.demo-dashboard .dashboard-anchor {
  margin-top: 1rem;
  border-color: #7c9cff;
  color: #c9d5ff;
  background: transparent;
}

.demo-dashboard .dashboard-feedback-slot {
  display: grid;
  gap: 0.25rem;
  min-height: 3.7rem;
  margin-top: 0.65rem;
  padding: 0.75rem;
  border: 1px dashed #48649a;
  color: #8c9bb4;
  font-size: 0.73rem;
}

.demo-dashboard .dashboard-feedback-slot strong {
  color: #dce5ff;
}

.demo-commerce {
  min-height: 100%;
  padding: clamp(1.2rem, 4vw, 3.5rem);
  color: #322719;
  background: #f1eadf;
}

.demo-commerce .commerce-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #d4c8b9;
  color: #7c6d5d;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.demo-commerce .commerce-product {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(14rem, 0.95fr);
  align-items: center;
  gap: clamp(1.2rem, 5vw, 4rem);
  max-width: 60rem;
  margin: 0 auto;
  padding: clamp(2rem, 8vw, 6rem) 0 2rem;
}

.demo-commerce .commerce-art {
  display: grid;
  place-items: center;
  min-height: 20rem;
  background: #d8b795;
  box-shadow: inset 0 0 0 1rem rgb(255 255 255 / 18%);
}

.demo-commerce .commerce-art::before {
  width: 42%;
  height: 68%;
  border-radius: 48% 48% 22% 22%;
  background: #8b5f43;
  box-shadow: 1.5rem 1.2rem 0 #b77d57;
  content: "";
}

.demo-commerce .commerce-kicker {
  color: #a26042;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.demo-commerce h2 {
  max-width: 8ch;
  margin: 0.55rem 0 0.8rem;
  color: #322719;
  font-size: clamp(2.4rem, 7vw, 5.8rem);
  letter-spacing: -0.08em;
  line-height: 0.88;
}

.demo-commerce .commerce-copy {
  max-width: 28rem;
  color: #796b5b;
  font-size: 0.95rem;
}

.demo-commerce .commerce-price {
  display: block;
  margin: 1.3rem 0;
  color: #322719;
  font-size: 1.4rem;
  font-weight: 750;
}

.demo-commerce .commerce-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.demo-commerce .commerce-anchor {
  border-color: #a26042;
  color: #ffffff;
  background: #a26042;
}

.demo-commerce .commerce-secondary {
  border-color: #c9b9a5;
  color: #796b5b;
  background: transparent;
}

.demo-commerce .commerce-feedback-slot {
  display: grid;
  gap: 0.25rem;
  min-height: 3.7rem;
  margin-top: 1.4rem;
  padding-top: 0.75rem;
  border-top: 1px dashed #c9b9a5;
  color: #8b7d6d;
  font-size: 0.73rem;
}

.demo-commerce .commerce-feedback-slot strong {
  color: #5d4936;
}

html[data-embed-context="full"] #app-direct-header,
html[data-embed-context="full"] #app-preferences-panel,
html[data-embed-context="full"] #app-direct-footer,
html[data-embed-context="inline"] #app-direct-header,
html[data-embed-context="inline"] #app-preferences-panel,
html[data-embed-context="inline"] #app-direct-footer {
  display: none;
}

html[data-embed-context="full"] #app,
html[data-embed-context="inline"] #app {
  padding: 0;
}

@media (max-width: 50rem) {
  .layout-button[data-layout-value="horizontal"] {
    display: none;
  }

  .playground-shell[data-layout="horizontal"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .playground-shell[data-layout="drawer"] #configuration-pane {
    width: min(31rem, calc(100% - 0.6rem));
  }

  .drawer-trigger {
    display: inline-flex;
  }

  .demo-content {
    min-height: 34rem;
    padding: 1rem;
  }

  .demo-editorial article,
  .demo-dashboard,
  .demo-commerce {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
}

@media (max-width: 36rem) {
  #app-direct-header {
    min-height: 3.4rem;
    padding: 0.55rem 0.7rem;
  }

  .breadcrumb {
    font-size: 0.82rem;
  }

  #app {
    padding: 0;
  }

  .playground-shell {
    border-radius: 0;
  }

  .config-pin-head {
    padding-right: 0.4rem;
    padding-left: 0.4rem;
  }

  .layout-button {
    width: 1.8rem;
  }

  .demo-picker {
    gap: 0.2rem;
  }

  .demo-choice {
    min-height: 2.9rem;
    padding-right: 0.35rem;
    padding-left: 0.35rem;
  }

  .config-status {
    width: 100%;
    margin-left: 0;
  }

  .demo-editorial .editorial-body,
  .demo-dashboard .dashboard-grid,
  .demo-commerce .commerce-product {
    grid-template-columns: minmax(0, 1fr);
  }

  .demo-dashboard .metric-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .demo-commerce .commerce-art {
    min-height: 14rem;
  }

  .editor-frame,
  .implementation-frame {
    min-height: 19rem;
  }

  .monaco-editor-container,
  .recipe-editor,
  .implementation-fallback {
    min-height: 14rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

html[data-reduced-motion="true"] *,
html[data-reduced-motion="true"] *::before,
html[data-reduced-motion="true"] *::after {
  transition-duration: 0.01ms !important;
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
}
