:root {
  --demo-ink: #102033;
  --demo-muted: #65758a;
  --demo-mint: #0b7f74;
  --demo-mint-strong: #08655d;
  --demo-mint-light: #75e1d0;
  --demo-mint-soft: #e9f8f5;
  --demo-line: #d9e2ec;
  --demo-panel: #ffffff;
  --demo-canvas: #f4f7fa;
  --demo-warning: #b45309;
}

* { box-sizing: border-box; }

.demo-sandbox-body {
  margin: 0;
  overflow: hidden;
  background: #e8edf2;
  color: var(--demo-ink);
}

.demo-app { height: 100vh; min-height: 620px; }

.demo-app-header {
  display: grid;
  height: 64px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 22px;
  border-bottom: 1px solid #273549;
  background: #111827;
  color: #fff;
}

.demo-app-brand { display: flex; align-items: center; gap: 10px; }
.demo-app-brand > span,
.rail-logo {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 9px;
  background: var(--demo-mint-light);
  color: #073b34;
  font-weight: 900;
}
.demo-app-brand strong { font-size: 1.05rem; }
.demo-app-brand em {
  padding: .28rem .48rem;
  border: 1px solid rgba(117, 225, 208, .35);
  border-radius: 999px;
  color: var(--demo-mint-light);
  font-size: .62rem;
  font-style: normal;
  font-weight: 800;
}
.demo-app-context { text-align: center; }
.demo-app-context small,
.demo-app-context b { display: block; }
.demo-app-context small { color: #8998aa; font-size: .58rem; letter-spacing: .12em; }
.demo-app-context b { margin-top: .2rem; font-size: .78rem; }
.demo-exit {
  justify-self: end;
  padding: .5rem .7rem;
  border: 1px solid #435166;
  border-radius: 8px;
  color: #e7edf4;
  font-size: .72rem;
  font-weight: 700;
  text-decoration: none;
}
.demo-exit:hover { border-color: var(--demo-mint-light); color: var(--demo-mint-light); }

.demo-app-layout { display: grid; height: calc(100vh - 64px); grid-template-columns: 76px 1fr; }
.demo-app-rail {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 27px;
  padding: 16px 7px;
  background: #172033;
  color: #91a0b2;
}
.rail-logo { margin-bottom: 5px; }
.rail-item { font-size: .58rem; font-weight: 800; writing-mode: vertical-rl; rotate: 180deg; }
.rail-item.active { color: var(--demo-mint-light); }
.demo-app-main { min-width: 0; overflow: hidden; }

.demo-flow {
  display: grid;
  height: 70px;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  padding: 0 3vw;
  border-bottom: 1px solid var(--demo-line);
  background: #fff;
}
.demo-flow button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border: 0;
  background: transparent;
  color: #8190a2;
  font: inherit;
  font-size: .65rem;
  font-weight: 760;
}
.demo-flow button::after {
  content: "";
  position: absolute;
  left: 68%;
  width: 64%;
  height: 1px;
  background: #dae2e9;
}
.demo-flow button:last-child::after { display: none; }
.demo-flow i {
  position: relative;
  z-index: 1;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #e6ebf0;
  color: #64748b;
  font-style: normal;
  font-weight: 850;
}
.demo-flow button.active { color: var(--demo-mint); }
.demo-flow button.active i,
.demo-flow button.done i { background: var(--demo-mint-light); color: #073b34; }
.demo-flow button.done::after { background: var(--demo-mint-light); }
.demo-flow button span { white-space: nowrap; }

.demo-scenes {
  height: calc(100% - 70px);
  overflow: auto;
  padding: clamp(16px, 2vw, 28px) clamp(16px, 3vw, 42px) 170px;
  background: linear-gradient(145deg, #f8fafc, #edf2f6);
  scroll-behavior: smooth;
}
.demo-scene { display: none; max-width: 1320px; margin: 0 auto; }
.demo-scene.active { display: block; animation: demo-in .24s ease; }
@keyframes demo-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.demo-card,
.demo-release-card,
.demo-callout,
.demo-open-checks,
.demo-success-banner,
.demo-finished,
.demo-wizard-shell {
  border: 1px solid var(--demo-line);
  border-radius: 10px;
  background: var(--demo-panel);
  box-shadow: 0 14px 34px rgba(16, 32, 51, .075);
}

.demo-hero,
.demo-compact-hero,
.demo-builder-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1.05rem 1.15rem;
  border: 1px solid var(--demo-line);
  border-radius: 10px;
  background: linear-gradient(110deg, rgba(11, 127, 116, .09), rgba(117, 225, 208, .025) 52%, #fff), #fff;
  box-shadow: 0 14px 34px rgba(16, 32, 51, .075);
}
.demo-hero p,
.demo-compact-hero p,
.demo-builder-title p,
.demo-eyebrow { margin: 0; color: var(--demo-mint); font-size: .68rem; font-weight: 850; letter-spacing: .085em; }
.demo-hero h1,
.demo-compact-hero h1,
.demo-builder-title h1 { margin: .2rem 0; color: #0b1728; font-size: clamp(1.35rem, 2.2vw, 1.9rem); }
.demo-hero span,
.demo-compact-hero span,
.demo-builder-title span { color: var(--demo-muted); font-size: .85rem; }
.demo-hero > b,
.demo-compact-hero > b,
.demo-builder-title > b {
  flex: 0 0 auto;
  padding: .42rem .62rem;
  border-radius: 999px;
  background: var(--demo-mint-soft);
  color: var(--demo-mint);
  font-size: .65rem;
  letter-spacing: .04em;
}

.demo-entry-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; }
.demo-entry-card,
.demo-safety-note,
.demo-spec-card,
.demo-split-card,
.demo-finalize-card,
.demo-test-summary { padding: 1.15rem; }
.demo-field-label { display: flex; justify-content: space-between; margin-bottom: .5rem; font-size: .8rem; font-weight: 800; }
.demo-field-label span { color: var(--demo-mint); }
.demo-entry-card textarea {
  width: 100%;
  min-height: 190px;
  resize: none;
  padding: 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fbfdff;
  color: #243449;
  font: inherit;
  line-height: 1.6;
}
.demo-context { display: flex; align-items: center; gap: .75rem; margin: .9rem 0; padding: .7rem .8rem; border-radius: 8px; background: #f1f5f9; font-size: .75rem; }
.demo-context span { color: #68778a; }
.demo-context small { margin-left: auto; color: var(--demo-mint); }
.demo-safety-note { align-self: start; }
.demo-safety-note h2 { margin: .35rem 0; font-size: 1rem; }
.demo-safety-note p,
.demo-safety-note li { color: var(--demo-muted); font-size: .76rem; line-height: 1.55; }
.demo-safety-note ul { padding-left: 1.1rem; }
.demo-path-preview { display: grid; gap: .55rem; margin: .85rem 0; padding: 0; list-style: none; }
.demo-path-preview li { display: flex; align-items: center; gap: .65rem; color: #42556a; }
.demo-path-preview li b { display: grid; width: 34px; height: 28px; flex: 0 0 auto; place-items: center; border-radius: 7px; background: var(--demo-mint-soft); color: var(--demo-mint); font-size: .68rem; }
.demo-path-preview li span { font-size: .74rem; font-weight: 720; }
.demo-safe-caption { display: block; padding-top: .7rem; border-top: 1px solid #e5ebf0; color: var(--demo-muted); font-size: .66rem; }

.demo-target { position: relative; }
.demo-target::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 2px solid #14b8a6;
  border-radius: inherit;
  pointer-events: none;
  animation: demo-pulse 1.7s ease-out infinite;
}
@keyframes demo-pulse { 0%, 30% { opacity: 1; box-shadow: 0 0 0 0 rgba(20, 184, 166, .3); } 100% { opacity: 0; box-shadow: 0 0 0 13px rgba(20, 184, 166, 0); } }

.demo-wizard-shell { display: grid; grid-template-columns: 245px minmax(0, 1fr); min-height: 520px; overflow: hidden; }
.demo-wizard-intro { padding: 1.2rem; background: linear-gradient(155deg, #112031, #172c3f); color: #fff; }
.demo-wizard-intro span { color: var(--demo-mint-light); font-size: .63rem; font-weight: 850; letter-spacing: .1em; }
.demo-wizard-intro strong { display: block; margin-top: .6rem; font-size: 1rem; }
.demo-wizard-intro p { color: #b7c4d2; font-size: .76rem; line-height: 1.55; }
.demo-chat { display: flex; min-width: 0; flex-direction: column; gap: .8rem; padding: 1.2rem; background: #f7fafc; }
.demo-message { max-width: 82%; padding: .75rem .85rem; border-radius: 10px; font-size: .79rem; line-height: 1.5; }
.demo-message.assistant { align-self: flex-start; border: 1px solid #d8e2eb; border-top-left-radius: 3px; background: #fff; color: #35465a; }
.demo-message.user { align-self: flex-end; border-top-right-radius: 3px; background: #dff6f1; color: #164f49; }
.demo-question { margin-top: auto; padding-top: .8rem; border-top: 1px solid #dbe5ed; }
.demo-question > strong { display: block; margin-bottom: .65rem; font-size: .88rem; }
.demo-options { display: grid; gap: .48rem; }
.demo-option {
  display: flex;
  width: 100%;
  align-items: center;
  gap: .65rem;
  padding: .65rem .72rem;
  border: 1px solid #cfdbe5;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: .76rem;
  text-align: left;
}
.demo-option i { display: grid; width: 20px; height: 20px; flex: 0 0 auto; place-items: center; border: 1px solid #aebdca; border-radius: 5px; color: transparent; font-style: normal; }
.demo-option.is-selected { border-color: #60cabb; background: var(--demo-mint-soft); color: #155e56; }
.demo-option.is-selected i { border-color: var(--demo-mint); background: var(--demo-mint); color: #fff; }
.demo-question-actions { display: flex; justify-content: flex-end; margin-top: .7rem; }
.demo-custom-answer { display: flex; align-items: center; gap: .6rem; padding: .7rem; border: 1px solid #60cabb; border-radius: 8px; background: var(--demo-mint-soft); }
.demo-custom-answer span { color: var(--demo-muted); font-size: .72rem; }
.demo-custom-answer strong { color: #155e56; }

.demo-wizard-original { overflow: hidden; border: 1px solid var(--demo-line); border-radius: 10px; background: #f8fafb; box-shadow: 0 14px 34px rgba(16, 32, 51, .075); }
.demo-wizard-modebar { display: grid; grid-template-columns: minmax(170px, .65fr) repeat(2, minmax(240px, 1fr)); gap: .55rem; align-items: stretch; padding: .75rem; border-bottom: 1px solid #dce5eb; background: #fff; }
.demo-wizard-modebar > div,
.demo-wizard-modebar > button { display: flex; min-width: 0; justify-content: center; flex-direction: column; padding: .65rem .75rem; border: 1px solid #dce5eb; border-radius: 8px; background: #fbfdff; color: #32465a; text-align: left; }
.demo-wizard-modebar > div { border: 0; background: transparent; }
.demo-wizard-modebar > div small { color: var(--demo-mint); font-size: .56rem; font-weight: 850; letter-spacing: .08em; }
.demo-wizard-modebar > div strong { margin-top: .15rem; font-size: .78rem; }
.demo-wizard-modebar button span { font-size: .72rem; font-weight: 820; }
.demo-wizard-modebar button small { margin-top: .15rem; color: var(--demo-muted); font-size: .6rem; line-height: 1.35; }
.demo-wizard-modebar button.is-active { border-color: #8bd9ce; background: #effaf7; box-shadow: inset 0 0 0 1px rgba(11, 127, 116, .08); }
.demo-wizard-toolbar,
.demo-wizard-context { display: flex; align-items: center; gap: .65rem; margin: .7rem .75rem 0; padding: .65rem .75rem; border: 1px solid #dce5eb; border-radius: 8px; background: #fff; }
.demo-wizard-toolbar > span,
.demo-wizard-context > span { display: grid; width: 28px; height: 28px; flex: 0 0 auto; place-items: center; border-radius: 7px; background: var(--demo-mint); color: #fff; font-weight: 900; }
.demo-wizard-toolbar > div,
.demo-wizard-context > div { flex: 1; }
.demo-wizard-toolbar strong,
.demo-wizard-toolbar small,
.demo-wizard-context strong,
.demo-wizard-context small { display: block; }
.demo-wizard-toolbar strong,
.demo-wizard-context strong { color: #30465a; font-size: .72rem; }
.demo-wizard-toolbar small,
.demo-wizard-context small { margin-top: .12rem; color: var(--demo-muted); font-size: .6rem; }
.demo-wizard-toolbar button,
.demo-wizard-context button { padding: .42rem .55rem; border: 1px solid #d4dfe7; border-radius: 7px; background: #fff; color: #496074; font: inherit; font-size: .6rem; font-weight: 750; }
.demo-wizard-toolbar button:nth-last-child(2) { border-color: #78cfc2; background: var(--demo-mint); color: #fff; }
.demo-wizard-original .demo-chat { display: block; min-height: 205px; margin: .7rem .75rem 0; padding: .75rem; border: 1px solid #dce5eb; border-radius: 8px; background: #fff; }
.demo-wizard-original .demo-question { margin: 0; padding: 0; border: 0; }
.demo-wizard-original .demo-question > strong { color: #354a5f; font-size: .72rem; }
.demo-wizard-original .demo-options { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: .6rem; }
.demo-wizard-original .demo-option { min-height: 54px; padding: .55rem; font-size: .65rem; line-height: 1.3; }
.demo-wizard-original .demo-option > span { flex: 1; }
.demo-wizard-original .demo-option > b { margin-left: auto; color: #94a3b8; font-size: .9rem; }
.demo-wizard-original .demo-custom-option { grid-column: 1 / -1; min-height: 38px; }
.demo-wizard-original .demo-question-actions { align-items: center; justify-content: flex-start; padding-top: .6rem; border-top: 1px solid #e7edf2; }
.demo-selected-count { color: var(--demo-muted); font-size: .63rem; }
.demo-clear-selection { padding: .42rem .55rem; border: 1px solid #dce5eb; border-radius: 6px; background: #fff; color: #64748b; font: inherit; font-size: .6rem; }
.demo-wizard-original .demo-custom-answer { margin-top: .55rem; padding: .55rem .65rem; }
.demo-wizard-composer-head { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; margin: .7rem .75rem 0; }
.demo-wizard-composer-head > div { padding: .55rem .65rem; border: 1px solid #dce5eb; border-radius: 7px; background: #fff; }
.demo-wizard-composer-head strong,
.demo-wizard-composer-head small { display: block; }
.demo-wizard-composer-head strong { color: #40566a; font-size: .63rem; }
.demo-wizard-composer-head small { margin-top: .12rem; color: var(--demo-muted); font-size: .56rem; line-height: 1.35; }
.demo-wizard-composer { margin: .55rem .75rem 0; padding: .65rem; border: 1px solid #dce5eb; border-radius: 8px; background: #fff; }
.demo-wizard-composer textarea { width: 100%; min-height: 80px; resize: none; border: 0; background: transparent; color: #607184; font: inherit; font-size: .68rem; outline: 0; }
.demo-wizard-composer small { display: block; color: #6b7e8f; font-size: .56rem; text-align: right; }
.demo-wizard-bottom { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto auto; gap: .45rem; align-items: center; margin-top: .65rem; padding: .6rem .75rem; border-top: 1px solid #dce5eb; background: #fff; }
.demo-wizard-bottom button { padding: .55rem .65rem; border: 1px solid #d9e3ea; border-radius: 7px; background: #fff; color: #506579; font: inherit; font-size: .6rem; font-weight: 750; }
.demo-wizard-bottom button:first-child { border-color: var(--demo-mint); background: var(--demo-mint); color: #fff; }

.demo-summary-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 1rem; }
.demo-spec-card h2,
.demo-split-card h2 { margin: .32rem 0 1rem; font-size: 1.1rem; }
.demo-spec-card p,
.demo-split-card p { color: #526276; line-height: 1.6; }
.demo-recommendation { display: flex; align-items: center; gap: .65rem; margin: 1rem 0; padding: .7rem; border: 1px solid #a7e2d6; border-radius: 8px; background: #effaf7; }
.demo-recommendation > span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--demo-mint); color: #fff; }
.demo-recommendation strong,
.demo-recommendation small { display: block; }
.demo-recommendation small { margin-top: .1rem; color: var(--demo-muted); }

.demo-kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.demo-kpi { padding: 1rem; border: 1px solid var(--demo-line); border-radius: 9px; background: #fff; box-shadow: 0 10px 26px rgba(16, 32, 51, .06); }
.demo-kpi span,
.demo-kpi strong,
.demo-kpi small { display: block; }
.demo-kpi span { color: var(--demo-muted); font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.demo-kpi strong { margin: .35rem 0; color: #19344e; font-size: 1.7rem; }
.demo-kpi small { color: #71849a; font-size: .72rem; }
.demo-callout,
.demo-success-banner,
.demo-finished { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; padding: 1rem; }
.demo-callout div,
.demo-success-banner div,
.demo-finished div { flex: 1; }
.demo-callout strong,
.demo-callout p,
.demo-success-banner strong,
.demo-success-banner p,
.demo-finished strong,
.demo-finished p { display: block; margin: 0; }
.demo-callout p,
.demo-success-banner p,
.demo-finished p { margin-top: .2rem; color: var(--demo-muted); font-size: .76rem; }

.demo-release-card { display: grid; grid-template-columns: 145px minmax(260px, .9fr) minmax(420px, 1.4fr); gap: 1rem; align-items: center; padding: 1.1rem; }
.demo-release-card.is-open { border-left: 4px solid #f59e0b; }
.demo-release-card.is-ready { border-left: 4px solid var(--demo-mint); background: linear-gradient(110deg, #f0fdf9, #fff 48%); }
.demo-release-score { display: grid; place-items: center; align-content: center; width: 116px; height: 116px; border: 10px solid #e4eaf0; border-radius: 50%; background: #fff; }
.is-open .demo-release-score { border-color: #fde7b5; }
.is-ready .demo-release-score { border-color: #a7e2d6; }
.demo-release-score span { color: #17324d; font-size: 2rem; font-weight: 900; line-height: 1; }
.demo-release-score span::after { content: "%"; font-size: .8rem; }
.demo-release-score small { margin-top: .3rem; color: var(--demo-muted); font-size: .65rem; }
.demo-release-copy h2 { margin: .35rem 0; font-size: 1.05rem; }
.demo-release-copy p { margin: 0; color: var(--demo-muted); font-size: .76rem; line-height: 1.5; }
.demo-status { display: inline-flex; padding: .28rem .52rem; border-radius: 999px; font-size: .65rem; font-weight: 850; }
.demo-status.warning { background: #fff7ed; color: #9a3412; }
.demo-status.success { background: #dcfce7; color: #166534; }
.demo-release-components { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.demo-release-components > div { padding: .7rem; border: 1px solid #dce6f0; border-radius: 8px; background: rgba(255, 255, 255, .85); }
.demo-release-components span,
.demo-release-components strong,
.demo-release-components small { display: block; }
.demo-release-components span { color: var(--demo-muted); font-size: .61rem; font-weight: 830; text-transform: uppercase; }
.demo-release-components strong { margin: .22rem 0; color: #18334f; font-size: .98rem; }
.demo-release-components small { color: #71849a; font-size: .68rem; }
.demo-open-checks { margin-top: .8rem; overflow: hidden; }
.demo-open-checks summary { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; color: #334155; font-size: .78rem; font-weight: 800; cursor: pointer; }
.demo-open-checks summary b { padding: .25rem .45rem; border-radius: 999px; background: #fff7ed; color: #9a3412; font-size: .63rem; }
.demo-open-checks ul { margin: 0; padding: 0 2rem 1rem; color: var(--demo-muted); font-size: .75rem; line-height: 1.6; }
.demo-scene-action,
.demo-builder-footer { display: flex; align-items: center; justify-content: flex-end; gap: 1rem; margin-top: 1rem; color: var(--demo-muted); font-size: .76rem; }

.demo-builder { min-height: 550px; border: 1px solid #cdd8e2; border-radius: 9px; background: #fff; box-shadow: 0 14px 34px rgba(16, 32, 51, .08); }
.demo-builder header { position: relative; }
.demo-builder button:disabled,
.demo-builder input:disabled,
.demo-builder .block { cursor: default !important; opacity: .48; pointer-events: none; }
.demo-builder [data-builder-toggle] { opacity: 1 !important; pointer-events: auto !important; }
.demo-builder .xcontainer { height: 470px; }
.demo-builder .canvas-wrapper,
.demo-builder .tree-wrapper { height: 100%; }
.demo-builder .canvas-content { min-height: 100%; padding: 2rem; }
.demo-builder .condition-block,
.demo-builder .item { pointer-events: none; }
.demo-builder .tree-container { height: 100%; background-color: #f8fafc; background-image: radial-gradient(#d6dee7 1px, transparent 1px); background-size: 20px 20px; }
.demo-builder svg { width: 100%; height: 100%; }
.demo-builder .quality-warning-empty-branch { background: rgba(254, 226, 226, .42); }
.demo-builder .demo-unclear { border-color: #ef9a45 !important; background: #fff7ed !important; }
.demo-builder .demo-new-node { outline: 3px solid rgba(20, 184, 166, .24); outline-offset: 2px; }
.demo-builder-tree-link { fill: none; stroke: #94a3b8; stroke-width: 2; }
.demo-builder-tree-branch { font-size: 11px; font-weight: 800; fill: #64748b; }
.demo-builder-tree-node rect { stroke-width: 1.5; }
.demo-builder-tree-node.condition rect { fill: #fff8eb; stroke: #e3a33c; }
.demo-builder-tree-node.action rect { fill: #eaf8f4; stroke: #2e806b; }
.demo-builder-tree-node text { font-size: 12px; font-weight: 700; fill: #263548; }
.hidden { display: none !important; }

.demo-modal-backdrop { position: fixed; z-index: 900; inset: 0; display: grid; place-items: center; padding: 1rem; background: rgba(5, 14, 25, .62); backdrop-filter: blur(3px); }
.demo-modal-backdrop[hidden] { display: none; }
.demo-modal { width: min(520px, 100%); padding: 1.25rem; border: 1px solid #a7e2d6; border-radius: 12px; background: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
.demo-modal h2 { margin: .35rem 0; font-size: 1.2rem; }
.demo-modal p { color: var(--demo-muted); font-size: .8rem; line-height: 1.55; }
.demo-modal-example { margin: .8rem 0 1rem; padding: .75rem; border: 1px solid #fed7aa; border-radius: 8px; background: #fff7ed; color: #7c2d12; font-size: .8rem; }

.demo-success-banner { border-color: #a7e2d6; background: #effaf7; }
.demo-success-banner > span,
.demo-finished > span { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--demo-mint); color: #fff; }

.demo-derivation-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr) auto) minmax(0, 1fr);
  align-items: stretch;
  gap: .55rem;
}
.demo-derivation-flow > article {
  display: flex;
  min-width: 0;
  gap: .7rem;
  padding: .9rem;
  border: 1px solid var(--demo-line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(16, 32, 51, .06);
}
.demo-derivation-flow > article > span {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--demo-mint-soft);
  color: var(--demo-mint);
  font-size: .65rem;
  font-weight: 900;
}
.demo-derivation-flow article small,
.demo-derivation-flow article strong,
.demo-derivation-flow article p { display: block; }
.demo-derivation-flow article small { color: var(--demo-mint); font-size: .57rem; font-weight: 850; letter-spacing: .065em; }
.demo-derivation-flow article strong { margin-top: .2rem; color: #20384f; font-size: .78rem; }
.demo-derivation-flow article p { margin: .28rem 0 0; color: var(--demo-muted); font-size: .68rem; line-height: 1.45; }
.demo-derivation-flow > i { display: grid; place-items: center; color: #78a9a2; font-size: 1.1rem; font-style: normal; }
.demo-derivation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin-top: .8rem; }
.demo-mapping-card,
.demo-proof-card { padding: 1rem; }
.demo-mapping-card h2,
.demo-proof-card h2 { margin: .3rem 0 .75rem; font-size: 1rem; }
.demo-mapping-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) minmax(120px, .65fr); gap: .65rem; align-items: center; padding: .58rem 0; border-top: 1px solid #e6edf2; font-size: .73rem; }
.demo-mapping-row > b { display: grid; width: 28px; height: 26px; place-items: center; border-radius: 6px; background: #e9f8f5; color: var(--demo-mint); }
.demo-mapping-row > span { color: var(--demo-muted); }
.demo-mapping-row > strong { color: #29445c; text-align: right; }
.demo-proof-card ol { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.demo-proof-card li { display: flex; gap: .6rem; padding: .6rem; border: 1px solid #dfe8ee; border-radius: 8px; background: #fbfdff; }
.demo-proof-card li > span { display: grid; width: 24px; height: 24px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--demo-mint-soft); color: var(--demo-mint); font-weight: 900; }
.demo-proof-card li strong,
.demo-proof-card li small { display: block; }
.demo-proof-card li strong { color: #29445c; font-size: .75rem; }
.demo-proof-card li small { margin-top: .18rem; color: var(--demo-muted); font-size: .67rem; line-height: 1.4; }
.demo-algorithm-note { display: flex; align-items: center; gap: .75rem; margin-top: .8rem; padding: .8rem .9rem; border: 1px solid #a7e2d6; border-radius: 9px; background: #effaf7; }
.demo-algorithm-note > span { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: var(--demo-mint); color: #fff; font-size: .67rem; font-weight: 900; }
.demo-algorithm-note strong,
.demo-algorithm-note p { display: block; margin: 0; }
.demo-algorithm-note p { margin-top: .2rem; color: #557068; font-size: .72rem; line-height: 1.45; }

.demo-finalize-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 1rem; }
.demo-finalize-card h2,
.demo-test-summary h2 { margin: .35rem 0 .8rem; font-size: 1.05rem; }
.demo-choice { display: grid; grid-template-columns: auto 1fr auto; gap: .7rem; align-items: center; margin-top: .55rem; padding: .7rem; border: 1px solid #cfe0e6; border-radius: 8px; background: #fbfdff; }
.demo-choice input { accent-color: var(--demo-mint); }
.demo-choice strong,
.demo-choice small { display: block; }
.demo-choice small { margin-top: .15rem; color: var(--demo-muted); font-size: .7rem; }
.demo-choice > b { padding: .25rem .4rem; border-radius: 999px; background: var(--demo-mint-soft); color: var(--demo-mint); font-size: .6rem; }
.demo-test-summary ul { padding-left: 1.1rem; color: var(--demo-muted); font-size: .75rem; line-height: 1.7; }
.demo-token-note { display: grid; gap: .2rem; margin-top: 1rem; padding: .75rem; border-radius: 8px; background: #f1f5f9; }
.demo-token-note strong { color: var(--demo-muted); font-size: .66rem; text-transform: uppercase; }
.demo-token-note span { color: var(--demo-mint); font-weight: 850; }
.demo-token-note small { color: var(--demo-muted); }

.demo-artifact-status-grid { display: grid; gap: .75rem; }
.demo-artifact-status-grid > article { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: .8rem; padding: 1rem; }
.demo-artifact-status-grid article > span { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; background: var(--demo-mint-soft); color: var(--demo-mint); font-weight: 900; }
.demo-artifact-status-grid strong,
.demo-artifact-status-grid p { display: block; margin: 0; }
.demo-artifact-status-grid p { margin-top: .25rem; color: var(--demo-muted); font-size: .75rem; line-height: 1.45; }
.demo-artifact-status-grid article > b { padding: .28rem .48rem; border-radius: 999px; background: #dcfce7; color: #166534; font-size: .62rem; }
.demo-artifact-status-grid .artifact-preparing > b { background: #eff6ff; color: #1d4ed8; }
.demo-spinner { border: 3px solid #cfe4e1; border-top-color: var(--demo-mint); animation: demo-spin 1s linear infinite; }
@keyframes demo-spin { to { rotate: 360deg; } }

.demo-story-detail,
.demo-test-detail { padding: 1.1rem; }
.demo-story-head,
.demo-test-head { display: flex; align-items: center; gap: .85rem; padding-bottom: .9rem; border-bottom: 1px solid #e4eaf0; }
.demo-story-head > span,
.demo-test-head > span { display: grid; min-width: 48px; height: 48px; place-items: center; border-radius: 9px; background: var(--demo-mint-soft); color: var(--demo-mint); font-size: .72rem; font-weight: 900; }
.demo-story-head > div,
.demo-test-head > div { flex: 1; }
.demo-story-head small,
.demo-test-head small { color: var(--demo-mint); font-size: .62rem; font-weight: 850; letter-spacing: .08em; }
.demo-story-head h2,
.demo-test-head h2 { margin: .18rem 0 0; font-size: 1rem; }
.demo-test-head p { margin: .18rem 0 0; color: var(--demo-muted); font-size: .65rem; }
.demo-story-head > b,
.demo-test-head > b { padding: .3rem .48rem; border-radius: 999px; background: #dcfce7; color: #166534; font-size: .62rem; }
.demo-story-statement { display: grid; grid-template-columns: 60px 1fr; gap: .38rem .7rem; margin: 1rem 0; padding: .9rem; border-radius: 9px; background: #f6f9fb; }
.demo-story-statement span { color: var(--demo-muted); font-size: .72rem; font-weight: 750; }
.demo-story-statement strong { color: #294056; font-size: .8rem; }
.demo-story-detail ol { display: grid; gap: .5rem; padding: 0; list-style: none; }
.demo-story-detail li { display: flex; gap: .55rem; padding: .65rem; border: 1px solid #dce6ee; border-radius: 8px; color: #435468; font-size: .77rem; }
.demo-story-detail li span { color: var(--demo-mint); font-weight: 900; }
.demo-test-definition,
.demo-test-flow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin-top: .8rem; }
.demo-test-meta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; margin-top: .8rem; }
.demo-test-meta-grid section { padding: .7rem; border: 1px solid #e0e8ef; border-radius: 8px; background: #fbfdff; }
.demo-test-meta-grid span,
.demo-test-meta-grid strong,
.demo-test-meta-grid small { display: block; }
.demo-test-meta-grid span { color: #74869a; font-size: .58rem; font-weight: 830; letter-spacing: .055em; text-transform: uppercase; }
.demo-test-meta-grid strong { margin-top: .25rem; color: #2b4359; font-size: .72rem; }
.demo-test-meta-grid small { margin-top: .2rem; color: var(--demo-muted); font-size: .62rem; }
.demo-test-section-title { margin: .95rem 0 0; color: #456075; font-size: .62rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.demo-test-definition section,
.demo-test-flow section { padding: .85rem; border: 1px solid #dce6ee; border-radius: 8px; background: #fbfdff; }
.demo-test-flow section:first-child { border-top: 3px solid #4f8dd8; }
.demo-test-flow section:last-child { border-top: 3px solid var(--demo-mint); }
.demo-test-detail ul,
.demo-test-detail ol { margin: .55rem 0 0; padding-left: 1.15rem; color: #46576b; font-size: .76rem; line-height: 1.6; }
.demo-test-evidence-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin-top: .8rem; }
.demo-test-evidence-grid section { min-height: 125px; padding: .85rem; border: 1px solid #d9e7f4; border-radius: 8px; background: #eff7ff; }
.demo-test-evidence-grid section:last-child { border-color: #f3e3a9; background: #fffbea; }
.demo-test-evidence-grid p { color: var(--demo-muted); font-size: .68rem; line-height: 1.45; }
.demo-test-evidence-grid section > div { display: flex; gap: .45rem; margin-top: .7rem; }
.demo-test-evidence-grid button,
.demo-test-evidence-grid input { min-height: 32px; border: 1px solid #d8dfdf; border-radius: 6px; background: #fff; color: #64748b; font: inherit; font-size: .62rem; }
.demo-test-evidence-grid button { width: 85px; }
.demo-test-evidence-grid input { flex: 1; padding: 0 .55rem; }
.demo-test-remaining { margin-top: .85rem; border: 1px solid var(--demo-line); border-radius: 9px; background: #fff; box-shadow: 0 10px 25px rgba(16, 32, 51, .06); overflow: hidden; }
.demo-test-remaining > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; cursor: pointer; list-style: none; }
.demo-test-remaining > summary::-webkit-details-marker { display: none; }
.demo-test-remaining summary strong,
.demo-test-remaining summary small { display: block; }
.demo-test-remaining summary strong { color: #2f465c; font-size: .78rem; }
.demo-test-remaining summary small { margin-top: .15rem; color: var(--demo-muted); font-size: .66rem; }
.demo-test-remaining summary > b { padding: .34rem .5rem; border-radius: 7px; background: var(--demo-mint-soft); color: var(--demo-mint); font-size: .62rem; }
.demo-test-index { display: grid; border-top: 1px solid #e4ebf0; }
.demo-test-index article { display: grid; grid-template-columns: 42px 1fr auto; gap: .7rem; align-items: center; padding: .65rem .85rem; border-bottom: 1px solid #edf2f5; }
.demo-test-index article:last-child { border-bottom: 0; }
.demo-test-index article > span { display: grid; width: 36px; height: 30px; place-items: center; border-radius: 7px; background: var(--demo-mint-soft); color: var(--demo-mint); font-size: .62rem; font-weight: 900; }
.demo-test-index article strong,
.demo-test-index article small { display: block; }
.demo-test-index article strong { color: #334b61; font-size: .7rem; }
.demo-test-index article small { margin-top: .12rem; color: var(--demo-muted); font-size: .6rem; }
.demo-test-index article > b { color: #718397; font-size: .6rem; }
.demo-empty-artifact { padding: 1.2rem; color: var(--demo-muted); }
.demo-finished { border-color: #a7e2d6; background: #effaf7; }

.demo-guide {
  position: absolute;
  z-index: 500;
  right: 24px;
  bottom: 22px;
  width: min(370px, calc(100% - 120px));
  padding: .9rem 1rem;
  border: 1px solid rgba(117, 225, 208, .52);
  border-radius: 10px;
  background: rgba(12, 20, 29, .97);
  color: #fff;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .4);
}
.demo-guide[data-position="left"] { right: auto; left: 100px; }
.demo-guide > span { color: var(--demo-mint-light); font-size: .62rem; font-weight: 850; letter-spacing: .1em; }
.demo-guide h2 { margin: .3rem 0; font-size: .92rem; }
.demo-guide p { margin: 0; color: #bdc8d5; font-size: .73rem; line-height: 1.45; }
.demo-guide small { display: block; margin-top: .5rem; color: var(--demo-mint-light); font-size: .64rem; }
.demo-app.is-complete .demo-guide { border-color: var(--demo-mint-light); background: #0b302b; }

@media (max-width: 1050px) {
  .demo-release-card { grid-template-columns: 125px 1fr; }
  .demo-release-components { grid-column: 1 / -1; }
  .demo-derivation-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-derivation-flow > i { display: none; }
}

@media (max-width: 900px) {
  .demo-app-context { display: none; }
  .demo-app-header { grid-template-columns: 1fr auto; }
  .demo-app-rail { display: none; }
  .demo-app-layout { grid-template-columns: 1fr; }
  .demo-flow span { display: none; }
  .demo-entry-grid,
  .demo-summary-grid,
  .demo-finalize-grid,
  .demo-derivation-grid { grid-template-columns: 1fr; }
  .demo-safety-note { display: none; }
  .demo-wizard-shell { grid-template-columns: 1fr; }
  .demo-wizard-intro { display: none; }
  .demo-wizard-modebar { grid-template-columns: 1fr 1fr; }
  .demo-wizard-modebar > div { grid-column: 1 / -1; }
  .demo-wizard-original .demo-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-wizard-toolbar button:not(:nth-last-child(2)),
  .demo-wizard-context button { display: none; }
  .demo-guide[data-position="left"] { left: 24px; }
  .demo-builder .block { display: none; }
}

@media (max-width: 640px) {
  .demo-app-header { height: 56px; padding: 0 10px; }
  .demo-app-layout { height: calc(100vh - 56px); }
  .demo-app-brand em { display: none; }
  .demo-flow { height: 56px; padding: 0; }
  .demo-flow button::after { display: none; }
  .demo-flow i { width: 24px; height: 24px; }
  .demo-scenes { height: calc(100% - 56px); padding: 9px 8px 165px; }
  .demo-hero,
  .demo-compact-hero,
  .demo-builder-title { align-items: flex-start; padding: .8rem; }
  .demo-hero h1,
  .demo-compact-hero h1,
  .demo-builder-title h1 { font-size: 1.08rem; }
  .demo-hero span,
  .demo-compact-hero span,
  .demo-builder-title span { display: none; }
  .demo-entry-card { padding: .8rem; }
  .demo-release-card { grid-template-columns: 1fr; }
  .demo-release-score { width: 90px; height: 90px; border-width: 8px; }
  .demo-release-components,
  .demo-kpi-grid,
  .demo-test-definition,
  .demo-test-flow,
  .demo-derivation-flow { grid-template-columns: 1fr; }
  .demo-test-meta-grid,
  .demo-test-evidence-grid,
  .demo-wizard-composer-head { grid-template-columns: 1fr; }
  .demo-wizard-original .demo-options { grid-template-columns: 1fr; }
  .demo-wizard-bottom { grid-template-columns: 1fr 1fr; }
  .demo-wizard-bottom > span { display: none; }
  .demo-mapping-row { grid-template-columns: 30px 1fr; }
  .demo-mapping-row > strong { grid-column: 2; text-align: left; }
  .demo-builder .xcontainer { height: 440px; }
  .demo-builder-footer,
  .demo-scene-action,
  .demo-callout,
  .demo-success-banner,
  .demo-finished { align-items: stretch; flex-direction: column; }
  .demo-builder-footer button,
  .demo-scene-action button,
  .demo-callout button,
  .demo-success-banner button,
  .demo-finished button { width: 100%; }
  .demo-artifact-status-grid > article { grid-template-columns: 34px 1fr; }
  .demo-artifact-status-grid article > b { grid-column: 2; justify-self: start; }
  .demo-guide,
  .demo-guide[data-position="left"] { right: 10px; left: 10px; bottom: 10px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .demo-scene { animation: none; }
  .demo-target::after,
  .demo-spinner { animation: none; }
  .demo-scenes { scroll-behavior: auto; }
}
