.demo-hero {
  padding: clamp(70px, 10vw, 130px) 0;
  background:
    radial-gradient(circle at 85% 20%, rgba(39, 95, 143, 0.18), transparent 34%),
    linear-gradient(135deg, #f4efe2, #e6f0ed);
  border-bottom: 1px solid var(--line);
}

.demo-hero [data-shell] {
  max-width: 850px;
  margin-inline: auto;
}

.demo-hero h1 {
  max-width: 760px;
  margin: 8px 0 18px;
  font-size: clamp(2.3rem, 6vw, 4.8rem);
  line-height: 1.02;
}

.demo-hero p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
}

.demo-section {
  padding-top: 70px;
}

.demo-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 28px 0;
}

.demo-filter {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.demo-filter:hover,
.demo-filter.is-active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.demo-card {
  align-self: start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(32, 39, 42, 0.08);
}

.demo-card[hidden] {
  display: none;
}

.demo-card.is-open {
  grid-column: 1 / -1;
}

.demo-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.demo-card-header h3 {
  margin: 2px 0 0;
  font-size: 1.25rem;
  line-height: 1.2;
}

.demo-code {
  margin: 0;
  color: var(--teal);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
  font-weight: 700;
}

.demo-goal {
  min-height: 78px;
  margin: 18px 0 12px;
  color: var(--muted);
}

.demo-goal strong {
  color: var(--ink);
}

.demo-price {
  margin: 0 0 16px;
  font-size: 0.88rem;
}

.demo-price span {
  color: var(--muted);
}

.demo-open {
  width: 100%;
  justify-content: center;
}

.demo-drawer {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.demo-case-panel {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding: 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(29, 107, 100, 0.1), rgba(39, 95, 143, 0.09));
}

.demo-case-panel h4 {
  margin-bottom: 0;
  font-size: 1.1rem;
}

.demo-stage-intro {
  max-width: 820px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.95rem;
}

.demo-controls-primary {
  margin: 0 0 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.demo-stage-focus {
  min-height: 180px;
  margin-bottom: 20px;
  padding: 17px;
  border: 2px solid rgba(39, 95, 143, 0.22);
  border-radius: 12px;
  background: #f7fafc;
}

.demo-stage-placeholder {
  display: grid;
  place-items: center;
  min-height: 145px;
  text-align: center;
  color: var(--muted);
}

.demo-stage-placeholder svg {
  width: 38px;
  height: 38px;
  color: var(--blue);
}

.demo-stage-placeholder p {
  max-width: 620px;
  margin: 8px auto 0;
}

.demo-stage-number {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.demo-stage-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
}

.demo-stage-party {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.demo-stage-party > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
}

.party-customer > span { background: var(--amber); }
.party-system > span { background: var(--blue); }
.party-result > span { background: var(--teal); }

.demo-stage-party strong {
  display: block;
  line-height: 1.25;
}

.demo-stage-party p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.demo-stage-arrow {
  align-self: center;
  width: 22px;
  color: var(--blue);
}

.demo-access {
  display: grid;
  gap: 5px;
  min-width: min(100%, 310px);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.demo-access select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px 10px;
  color: var(--ink);
}

.demo-sample-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 18px;
  margin-bottom: 22px;
}

.demo-sample-grid > section {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.demo-facts {
  display: grid;
  gap: 8px;
  margin: 0;
}

.demo-facts div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 6px;
}

.demo-facts dt {
  color: var(--muted);
}

.demo-facts dd {
  margin: 0;
  text-align: right;
  font-weight: 800;
}

.demo-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.demo-metric {
  min-height: 94px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  opacity: 0.36;
  transform: translateY(4px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.demo-metric.is-visible,
.demo-card.is-finished .demo-metric {
  opacity: 1;
  transform: none;
}

.demo-metric span,
.demo-metric strong {
  display: block;
}

.demo-metric span {
  min-height: 38px;
  color: var(--muted);
  font-size: 0.78rem;
}

.demo-metric strong {
  margin-top: 5px;
  font-size: 1.15rem;
}

.demo-metric.tone-good strong { color: var(--teal); }
.demo-metric.tone-warn strong { color: var(--amber); }
.demo-metric.tone-risk strong { color: var(--red); }
.demo-metric.tone-neutral strong { color: var(--blue); }

.demo-drawer-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 22px;
}

.demo-drawer h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 13px;
}

.demo-drawer h4 svg {
  width: 19px;
  color: var(--teal);
}

.demo-requirements {
  display: grid;
  gap: 9px;
}

.demo-requirements label {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--paper);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.demo-requirements input {
  flex: 0 0 22px;
  margin-top: 1px;
}

.demo-requirements label:hover {
  border-color: rgba(29, 107, 100, 0.3);
  background: #fff;
  transform: translateY(-1px);
}

.demo-requirements label:has(input:checked) {
  border-color: rgba(29, 107, 100, 0.48);
  background: #eaf6f3;
  box-shadow: 0 7px 18px rgba(29, 107, 100, 0.09);
}

.demo-requirements label:has(input:checked) span {
  color: var(--teal-strong);
  font-weight: 800;
}

.demo-readiness {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.demo-readiness.is-ready {
  color: var(--teal);
  font-weight: 700;
}

.demo-steps {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.demo-steps li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  opacity: 0.58;
  transition: opacity 160ms ease, border-color 160ms ease, background 160ms ease;
}

.demo-steps li > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--paper);
  font-weight: 800;
}

.demo-steps li p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.demo-step-type {
  display: inline-block;
  margin-left: 7px;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.demo-step-type.type-automatic {
  background: rgba(39, 95, 143, 0.12);
  color: var(--blue);
}

.demo-step-type.type-review {
  background: rgba(182, 106, 37, 0.14);
  color: var(--amber);
}

.demo-step-type.type-approval {
  background: rgba(29, 107, 100, 0.13);
  color: var(--teal);
}

.demo-steps li.is-active {
  border-color: var(--blue);
  background: rgba(39, 95, 143, 0.07);
  opacity: 1;
}

.demo-steps li.is-complete {
  border-color: var(--teal);
  background: rgba(29, 107, 100, 0.07);
  opacity: 1;
}

.demo-steps li.is-complete > span {
  background: var(--teal);
  color: #fff;
}

.demo-output {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(29, 107, 100, 0.35);
  border-radius: 10px;
  background: rgba(29, 107, 100, 0.08);
}

.demo-output p {
  margin-bottom: 8px;
}

.demo-output h5 {
  margin: 13px 0 6px;
}

.demo-output ul {
  margin: 0;
  padding-left: 20px;
}

.demo-log-panel {
  margin-top: 18px;
  padding: 15px;
  border-radius: 10px;
  background: #182124;
  color: #eaf2ef;
}

.demo-log-panel h4 {
  color: #fff;
}

.demo-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.demo-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: #59c7b9;
  transition: width 220ms ease;
}

.demo-log-panel ol {
  display: grid;
  gap: 5px;
  max-height: 180px;
  margin: 12px 0 0;
  padding-left: 22px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
}

.demo-log-panel .log-active { color: #9fd4ff; }
.demo-log-panel .log-complete { color: #8de1b8; }
.demo-log-panel .log-info { color: #f2c98f; }

.demo-complete-label {
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.demo-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.demo-controls .button {
  min-height: 42px;
}

.demo-empty {
  padding: 36px;
  border: 1px dashed var(--line);
  text-align: center;
  color: var(--muted);
}

.demo-notice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 850px) {
  .demo-grid,
  .demo-drawer-grid,
  .demo-sample-grid {
    grid-template-columns: 1fr;
  }

  .demo-goal {
    min-height: 0;
  }

  .demo-stage-flow {
    grid-template-columns: 1fr;
  }

  .demo-stage-arrow {
    justify-self: center;
    transform: rotate(90deg);
  }
}

@media (max-width: 560px) {
  .demo-card {
    padding: 17px;
  }

  .demo-case-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .demo-metrics {
    grid-template-columns: 1fr;
  }

  .demo-controls .button {
    width: 100%;
    justify-content: center;
  }

  .demo-notice {
    grid-template-columns: 1fr;
  }
}
