/* Interactive examples share the light site's palette and typography. */
.demo-lab { min-width: 0; background: var(--paper); border: 1px solid #cfdee7; border-radius: 18px; padding: 24px; box-shadow: 0 18px 50px #2e51620a; }
.demo-heading { display: flex; align-items: center; gap: 9px; }
.demo-heading strong { font-size: 14px; font-weight: 600; line-height: 1.5; }
.demo-heading-mark { color: var(--accent); font-size: 24px; line-height: 1; }
.demo-badge { flex: none; margin-left: auto; padding: 2px 7px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 10px; }
.demo-intro { font-size: 12px; color: var(--muted); margin: 9px 0 18px; }
.demo-tabs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); background: var(--soft); padding: 4px; gap: 3px; border-radius: 9px; }
.demo-tabs button { border: 0; background: transparent; border-radius: 6px; min-height: 44px; padding: 7px 3px; font-size: 12px; color: var(--muted); }
.demo-tabs button[aria-selected="true"] { background: white; color: var(--accent); font-weight: 600; box-shadow: 0 1px 5px #203b4d14; }
.demo-tabs button:hover { color: var(--accent); }
.demo-tabs button:focus-visible { outline-offset: 0; }
.demo-source { padding: 15px 17px; margin: 18px 0; background: #f6f9fb; border: 1px solid var(--line); border-left: 3px solid #93b6ca; border-radius: 3px 9px 9px 3px; }
.demo-source > div { display: flex; justify-content: space-between; gap: 9px; color: var(--muted); font-size: 10px; margin-bottom: 7px; }
.demo-source > div > span:first-child { color: var(--accent); font-weight: 600; }
.demo-source > p { font-size: 13px; line-height: 1.9; min-height: 50px; }
.demo-workspace { display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.2fr); gap: 17px; align-items: stretch; }
.demo-steps { list-style: none; margin: 0; padding: 0; }
.demo-steps li { position: relative; padding-bottom: 15px; }
.demo-steps li:last-child { padding-bottom: 0; }
.demo-steps li:not(:last-child)::after { content: ''; position: absolute; width: 2px; left: 17px; top: 45px; bottom: 0; background: var(--line); transition: background-color .25s; }
.demo-steps li[data-state="complete"]::after { background: #6c9e9b; }
.demo-steps button { position: relative; display: flex; align-items: center; width: 100%; gap: 10px; padding: 6px 3px 6px 0; min-height: 58px; background: transparent; border: 0; border-radius: 8px; text-align: left; }
.demo-step-number { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: 1px solid #cadbe5; border-radius: 50%; background: #f4f8fa; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; transition: background-color .25s, color .25s, box-shadow .25s; }
.demo-step-copy { min-width: 0; }
.demo-step-copy strong { display: block; font-weight: 550; font-size: 12px; line-height: 1.6; }
.demo-step-copy small { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }
.demo-steps button[aria-pressed="true"] .demo-step-number { color: white; border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px #eaf1f6; }
.demo-steps button[aria-pressed="true"] strong { color: var(--accent); }
.demo-steps li[data-state="complete"] .demo-step-number { background: #e8f2ef; color: var(--teal); border-color: #b9d4cf; }
.demo-steps li[data-state="active"] button .demo-step-number { background: var(--accent); color: white; border-color: var(--accent); }
.demo-lab[data-phase="running"] li[data-state="active"] .demo-step-number { animation: demo-pulse 1.25s ease-out infinite; }
.demo-steps button:hover { background: #f3f7fa; }
.demo-inspector { border: 1px solid var(--line); border-radius: 10px; background: #fbfdfe; padding: 16px; min-height: 286px; align-self: stretch; }
.demo-detail-kicker { display: block; font-size: 10px; color: var(--accent); letter-spacing: .4px; }
.demo-inspector h2 { font-family: var(--body); font-weight: 600; font-size: 16px; line-height: 1.5; margin: 7px 0 9px; }
.demo-inspector > p:not(.demo-detail-note) { font-size: 11px; color: var(--muted); line-height: 1.8; }
.demo-inspector ul { margin: 13px 0; padding: 0; list-style: none; }
.demo-inspector li { position: relative; padding: 6px 0 6px 12px; border-bottom: 1px solid #e6edf2; font-size: 11px; line-height: 1.8; }
.demo-inspector li::before { content: ''; position: absolute; top: 14px; left: 0; width: 4px; height: 4px; border-radius: 50%; background: #7399af; }
.demo-detail-note { font-size: 10px; line-height: 1.8; color: var(--muted); }
.demo-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; border-bottom: 1px solid var(--line); margin-bottom: 18px; padding-bottom: 16px; }
.demo-run, .demo-download { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 15px; border-radius: 7px; font-size: 12px; font-weight: 550; }
.demo-run { background: var(--accent); color: #fff; border: 1px solid var(--accent); gap: 24px; }
.demo-run:hover { background: #204c67; }
.demo-download { border: 1px solid var(--teal); background: #edf5f2; color: #285b59; }
.demo-download:hover { background: #dfede7; }
.demo-download[hidden] { display: none; }
.demo-status { flex: 1 1 160px; font-size: 11px; line-height: 1.7; color: var(--muted); }
.demo-disclosure { font-size: 10px; color: var(--muted); line-height: 1.8; margin-top: 12px; }
.demo-fallback { padding-top: 12px; font-size: 13px; }
.demo-lab:not(.is-ready) .demo-tabs, .demo-lab:not(.is-ready) .demo-controls, .demo-lab:not(.is-ready) .demo-workspace { display: none; }

.lifecycle-visual { min-width: 0; background: #edf3f6; padding: 27px; }
.lifecycle-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 7px; border-bottom: 1px solid #d3e0e7; padding-bottom: 14px; }
.lifecycle-heading > span { font-size: 14px; font-weight: 550; }
.lifecycle-heading small { font-size: 10px; color: var(--muted); }
.lifecycle-intro { font-size: 11px; color: var(--muted); margin: 12px 0 17px; }
.lifecycle-workspace { display: grid; grid-template-columns: 94px minmax(0,1fr); gap: 20px; }
.lifecycle-tabs { align-self: start; position: relative; display: flex; flex-direction: column; gap: 5px; }
.lifecycle-tabs::before { content: ''; position: absolute; width: 1px; top: 24px; bottom: 24px; left: 18px; background: #b5ccd9; }
.lifecycle-tabs button { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 0; min-height: 44px; border: 0; border-radius: 6px; background: transparent; font-size: 12px; text-align: left; }
.lifecycle-tabs button > span { display: grid; place-items: center; width: 37px; height: 32px; border: 1px solid #c7dae5; border-radius: 6px; background: #f8fbfd; font-size: 10px; color: var(--muted); }
.lifecycle-tabs button[aria-selected="true"] { background: #dfebf2; color: var(--accent); font-weight: 600; }
.lifecycle-tabs button[aria-selected="true"] > span { color: #fff; background: var(--accent); border-color: var(--accent); }
.lifecycle-tabs button:hover { background: #e0ebf2; }
.lifecycle-panel { min-width: 0; background: #fff; border: 1px solid #d3e0e7; border-radius: 10px; padding: 20px; }
.lifecycle-record { font-size: 10px; letter-spacing: .3px; color: var(--accent); }
.lifecycle-panel h4 { margin: 8px 0; font-size: 18px; line-height: 1.55; font-weight: 550; text-wrap: balance; }
.lifecycle-panel > p { font-size: 11px; line-height: 1.9; color: var(--muted); }
.lifecycle-panel dl { margin: 15px 0; }
.lifecycle-panel dl > div { padding: 8px 0; border-bottom: 1px solid #e6edf2; }
.lifecycle-panel dt { font-size: 10px; color: var(--muted); }
.lifecycle-panel dd { margin: 3px 0 0; font-size: 12px; }
.life-connection { font-size: 10px; line-height: 1.9; }
.life-connection > span { display: block; color: var(--teal); font-weight: 550; margin-top: 10px; }
.life-connection > p { color: var(--muted); }
.lifecycle-footer { border-top: 1px solid #d3e0e7; margin-top: 18px; padding-top: 14px; font-size: 10px; color: var(--muted); }
.life-fallback { margin-block: 20px; font-size: 13px; }
@keyframes demo-pulse { 0% { box-shadow: 0 0 0 0 #285f8038; } 100% { box-shadow: 0 0 0 8px #285f8000; } }
@media (min-width: 901px) { .hero { grid-template-columns: .86fr 1.14fr; gap: 46px; } }
@media (min-width: 901px) and (max-width: 1150px) {
  .hero { gap: 27px; }.demo-lab { padding: 19px; }.demo-workspace { gap: 12px; }
  .demo-steps button { gap: 8px; }.demo-step-copy strong { font-size: 11px; }
  .demo-inspector { padding: 13px; }.lifecycle-visual { padding: 23px; }
  .lifecycle-workspace { grid-template-columns: 80px minmax(0,1fr); gap: 12px; }.lifecycle-panel { padding: 16px; }
}
@media (max-width: 900px) {
  .demo-lab { max-width: 680px; width: 100%; justify-self: center; }
  .lifecycle-visual { padding: 23px 19px; }.lifecycle-workspace { grid-template-columns: 73px minmax(0,1fr); gap: 10px; }
  .lifecycle-tabs button { gap: 5px; font-size: 11px; }.lifecycle-tabs button > span { width: 30px; }
  .lifecycle-tabs::before { left: 15px; }.lifecycle-panel { padding: 15px; }.lifecycle-panel h4 { font-size: 16px; }
}
@media (max-width: 600px) {
  .demo-lab { padding: 19px 17px; }.demo-heading { gap: 7px; }.demo-heading strong { font-size: 13px; }
  .demo-heading-mark { display: none; }.demo-badge { font-size: 9px; padding-inline: 5px; }
  .demo-intro { font-size: 11px; margin-bottom: 15px; }.demo-tabs { gap: 1px; padding: 3px; }.demo-tabs button { font-size: 11px; }
  .demo-source { padding: 12px 14px; margin-block: 15px; }.demo-source > p { font-size: 12px; }
  .demo-workspace { grid-template-columns: 1fr; gap: 15px; }
  .demo-steps li { padding-bottom: 9px; }.demo-steps button { min-height: 49px; }
  .demo-step-copy { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .demo-step-copy strong { font-size: 12px; }.demo-step-copy small { margin: 0; font-size: 10px; }
  .demo-inspector { min-height: 245px; padding: 16px; }
  .demo-inspector h2 { font-size: 16px; }.demo-inspector li { font-size: 12px; }
  .demo-status { flex-basis: 100%; }.demo-controls { margin-bottom: 15px; padding-bottom: 14px; }
  .demo-disclosure { font-size: 10px; }.lifecycle-visual { padding: 23px; }
  .lifecycle-workspace { grid-template-columns: 73px minmax(0,1fr); gap: 11px; }
  .lifecycle-tabs button { min-height: 48px; }.lifecycle-panel { padding: 16px 13px; }
  .lifecycle-panel h4 { font-size: 17px; }.lifecycle-panel dd { font-size: 11px; }
}
@media (max-width: 359px) {
  .demo-lab { padding-inline: 13px; }.demo-heading strong { font-size: 12px; }.demo-badge { font-size: 8px; }
  .demo-tabs button { font-size: 10px; }.demo-step-copy { gap: 5px; }.demo-step-copy small { font-size: 9px; }
  .lifecycle-visual { padding-inline: 16px; }.lifecycle-workspace { grid-template-columns: 67px minmax(0,1fr); gap: 8px; }
  .lifecycle-tabs button > span { width: 26px; }.lifecycle-tabs::before { left: 13px; }.lifecycle-panel { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
 .demo-lab *, .lifecycle-visual * { animation: none !important; transition: none !important; }
}

/* Final deliverables are readable documents, retained after automatic completion. */
.demo-artifact { margin: 14px 0; }
.demo-artifact[hidden], #demo-detail-output[hidden] { display: none; }
.demo-artifact section + section { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.demo-artifact h3 { font-family: var(--body); font-size: 12px; line-height: 1.7; font-weight: 600; color: var(--ink); }
.demo-artifact p { margin-top: 4px; font-size: 12px; line-height: 1.9; color: var(--ink); overflow-wrap: anywhere; }
.demo-lab[data-phase="done"] .demo-inspector { border-color: #a8c6bf; background: #f7fbf9; }
.demo-lab[data-phase="done"] .demo-detail-kicker { color: var(--teal); }
@media (min-width: 901px) { .demo-workspace { grid-template-columns: minmax(0,.75fr) minmax(0,1.35fr); } }

/* Keep the introduction stationary as the example document changes height. */
.hero-copy { align-self: start; }
@media (min-width: 901px) { .hero-copy { padding-top: 48px; } }
.demo-result-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.demo-result-actions[hidden] { display: none; }
.demo-artifact h3, .demo-artifact p { font-size: 13px; }
.demo-inspector > p:not(.demo-detail-note), .demo-inspector li { font-size: 12px; }
.demo-detail-note { font-size: 11px; }

/* Complete deliverables keep their source and a clearly simulated delivery receipt. */
.demo-source > p { white-space: pre-line; }
.demo-delivery { margin-top: 16px; padding: 12px; border: 1px solid #bed7d0; border-radius: 8px; background: #edf6f2; }
.demo-delivery[hidden] { display: none; }
.demo-delivery strong { display: block; color: var(--teal); font-size: 12px; }
.demo-delivery p { white-space: pre-line; font-size: 11px; line-height: 1.9; color: var(--ink); margin-top: 6px; overflow-wrap: anywhere; }
.demo-download:disabled { opacity: .5; cursor: not-allowed; }
