/* ============================================================
   Apollo — interactive service demos (shared chrome + per-demo styles)
   Per-demo CSS is appended below, each rule scoped to .svc-demo[data-demo="<id>"].
   ============================================================ */

/* Bigger modal box for the interactive demo */
.modal__box--demo { width: min(1140px, 96vw); max-width: 96vw; max-height: 92vh; padding: clamp(1.25rem, 3vw, 2.1rem); }
.svc-modal-head { margin-bottom: 1rem; padding-right: 2.4rem; }
.svc-modal-head .kicker { display: inline-flex; flex-wrap: wrap; max-width: 100%; margin-bottom: 0.55rem; line-height: 1.35; }
.svc-modal-head h2 { font-size: clamp(1.5rem, 2.4vw, 2.1rem); }
.svc-modal-head p { color: var(--muted); max-width: 72ch; margin-top: 0.5rem; }
.svc-demo-wrap { margin: 1.1rem 0; }
.svc-modal-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; justify-content: space-between; margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.svc-modal-foot .svc-modal-case { flex: 1 1 280px; min-width: 0; }
.svc-modal-foot .svc-modal-case b { color: var(--accent); font-size: 0.78rem; display: block; margin-bottom: 0.15rem; }
.svc-modal-foot .svc-modal-case p { color: var(--muted); font-size: 0.9rem; }
.svc-modal-foot .btn { flex: 0 0 auto; }

/* Servicios call-out + per-row badge */
.svc-demos-callout { display: inline-flex; align-items: center; gap: 0.6rem; margin-bottom: clamp(1.5rem, 3vw, 2.5rem); padding: 0.8rem 1.2rem; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent); font-weight: 600; max-width: 100%; }
.svc-demos-callout .play { width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 0.7rem; }
.svc-demos-callout b { color: var(--accent); }
.svc-demo-badge { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.02em; color: var(--accent); background: var(--accent-soft); padding: 0.28rem 0.6rem; border-radius: var(--r-pill); margin-bottom: 0.6rem; }
.svc-demo-badge::before { content: "▶"; font-size: 0.6rem; }

/* ---- Shared demo shell + primitives demos can reuse for consistency ---- */
.svc-demo { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; color: var(--text); font-family: var(--font-body); }
.svc-demo *, .svc-demo *::before, .svc-demo *::after { box-sizing: border-box; }
.svc-demo-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; padding: 0.85rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.svc-demo-bar .label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--muted); margin-right: 0.25rem; }
.svc-demo-chip { font: 600 0.82rem/1 var(--font-body); padding: 0.5rem 0.85rem; border-radius: var(--r-pill); border: 1px solid var(--line-strong); color: var(--muted); background: var(--surface); cursor: pointer; transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s ease; }
.svc-demo-chip:hover { color: var(--ink); border-color: var(--accent); }
.svc-demo-chip.is-active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.svc-demo-body { padding: clamp(1rem, 2.5vw, 1.5rem); }
.svc-demo-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.7rem; }
.svc-demo-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 0.85rem 0.95rem; }
.svc-demo-kpi b { display: block; font-family: var(--font-display); font-size: 1.5rem; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1; }
.svc-demo-kpi span { font-size: 0.72rem; color: var(--muted); }
.svc-demo-kpi em { font-style: normal; font-size: 0.72rem; color: var(--accent); }

/* Interaction hint: on phones the demos read like static screenshots, so cue that
   the controls are live. Hidden on desktop (hover/cursor already signals it). */
.svc-demo-hint { display: none; margin: 0; }

@media (max-width: 720px) {
  .modal__box--demo { width: 100%; max-height: 94vh; padding: 1rem; }
  .svc-modal-head { padding-right: 2.25rem; }
  .svc-modal-head .kicker { max-width: calc(100% - 3rem); font-size: 0.68rem; }

  /* Interaction hint pill above each demo, auto-dismissed on first tap (demos.js). */
  .svc-demo-hint {
    display: flex; align-items: center; gap: 0.5rem;
    margin: 0 0 0.7rem; padding: 0.55rem 0.8rem;
    border-radius: var(--r-sm);
    background: var(--accent-soft); color: var(--accent);
    font-family: var(--font-mono); font-size: 0.72rem; line-height: 1.3; letter-spacing: 0.01em;
  }
  .svc-demo-hint::before {
    content: ""; flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%;
    background: var(--accent); animation: demoHintPulse 1.5s var(--ease-out) infinite;
  }
  .svc-demo-hint.is-dismissed { display: none; }

  /* Bigger, clearly tappable shared controls on touch. */
  .svc-demo-bar { padding: 0.8rem; gap: 0.45rem; }
  .svc-demo-chip { min-height: 40px; padding: 0.55rem 0.95rem; font-size: 0.85rem; }
  .svc-demo-chip:active { transform: scale(0.96); }

  /* Footer: stack the case study above a full-width CTA, in normal flow. */
  .svc-modal-foot { flex-direction: column; align-items: stretch; gap: 0.85rem; }
  .svc-modal-foot .btn { width: 100%; }
}

@keyframes demoHintPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.7); } }

/* ============================================================
   Per-demo styles appended below by the build.
   ============================================================ */


/* ===================== demo: bi ===================== */
.svc-demo[data-demo="bi"] { --bi-c2: color-mix(in srgb, var(--accent) 62%, #19c3e0); --bi-c3: color-mix(in srgb, var(--accent) 48%, #ff7ac2); opacity: 0; }
.svc-demo[data-demo="bi"].is-ready { opacity: 1; }

.svc-demo[data-demo="bi"] .bi-sep { width: 1px; align-self: stretch; margin: 0.15rem 0.3rem; background: var(--line-strong); }

.svc-demo[data-demo="bi"] .bi-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.95rem; }
.svc-demo[data-demo="bi"] .bi-title { display: inline-flex; align-items: center; gap: 0.5rem; min-width: 0; }
.svc-demo[data-demo="bi"] .bi-title b { font-family: var(--font-display); font-size: 0.95rem; color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc-demo[data-demo="bi"] .bi-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: var(--r-pill); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.svc-demo[data-demo="bi"] .bi-live { display: inline-flex; align-items: center; gap: 0.4rem; flex: 0 0 auto; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.svc-demo[data-demo="bi"] .bi-live i { width: 7px; height: 7px; border-radius: var(--r-pill); background: var(--ok); animation: bi-pulse 1.8s var(--ease-out) infinite; }
@keyframes bi-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.78); } }

.svc-demo[data-demo="bi"] .svc-demo-kpis { margin-bottom: 0.95rem; }
.svc-demo[data-demo="bi"] .svc-demo-kpi { position: relative; overflow: hidden; transition: border-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
.svc-demo[data-demo="bi"] .svc-demo-kpi::after { content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%; background: linear-gradient(90deg, var(--accent), var(--bi-c2)); transform: scaleX(0); transform-origin: left; transition: transform var(--dur) var(--ease-out); }
.svc-demo[data-demo="bi"] .svc-demo-kpi.is-bump::after { transform: scaleX(1); }
.svc-demo[data-demo="bi"] .svc-demo-kpi b { font-size: clamp(1.2rem, 2.1vw, 1.55rem); }
.svc-demo[data-demo="bi"] .bi-kpi-flavor b { font-size: clamp(0.98rem, 1.7vw, 1.2rem); }
.svc-demo[data-demo="bi"] .bi-kpi-flavor em { position: absolute; top: 0.7rem; right: 0.8rem; font-size: 1.25rem; line-height: 1; }

.svc-demo[data-demo="bi"] .bi-panels { display: grid; grid-template-columns: 1.55fr 1fr; gap: 0.85rem; }
.svc-demo[data-demo="bi"] .bi-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 0.9rem 1rem 1rem; min-width: 0; }
.svc-demo[data-demo="bi"] .bi-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.85rem; }
.svc-demo[data-demo="bi"] .bi-card-head b { font-family: var(--font-display); font-size: 0.9rem; color: var(--ink); font-weight: 600; }
.svc-demo[data-demo="bi"] .bi-card-sub { font-family: var(--font-mono); font-size: 0.66rem; color: var(--muted); letter-spacing: 0.02em; }

/* ---- bar chart ---- */
.svc-demo[data-demo="bi"] .bi-chart { position: relative; display: flex; align-items: flex-end; gap: clamp(3px, 1vw, 9px); height: 188px; padding-top: 6px; }
.svc-demo[data-demo="bi"] .bi-bar { position: relative; flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 0.35rem; cursor: pointer; }
.svc-demo[data-demo="bi"] .bi-bar .bi-fill { width: 100%; max-width: 28px; height: 0; border-radius: var(--r-sm) var(--r-sm) 3px 3px; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--bi-c2))); transition: height 0.62s var(--ease-out), filter var(--dur-micro) var(--ease-out), background var(--dur-micro) var(--ease-out); transform-origin: bottom; }
.svc-demo[data-demo="bi"] .bi-bar:hover .bi-fill, .svc-demo[data-demo="bi"] .bi-bar:focus-visible .bi-fill { filter: brightness(1.12) saturate(1.1); background: linear-gradient(180deg, var(--bi-c2), var(--accent)); }
.svc-demo[data-demo="bi"] .bi-bar .bi-mlabel { font-family: var(--font-mono); font-size: 0.6rem; color: var(--muted); letter-spacing: 0.01em; white-space: nowrap; }
.svc-demo[data-demo="bi"] .bi-bar.is-peak .bi-fill { background: linear-gradient(180deg, var(--bi-c2), var(--accent)); box-shadow: 0 0 0 1px var(--accent-soft), 0 8px 18px -10px var(--accent-glow); }

.svc-demo[data-demo="bi"] .bi-tooltip { position: absolute; pointer-events: none; z-index: 3; transform: translate(-50%, -8px); background: var(--ink); color: var(--bg); border-radius: var(--r-sm); padding: 0.3rem 0.55rem; font: 600 0.72rem/1.2 var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; opacity: 0; transition: opacity var(--dur-micro) var(--ease-out); box-shadow: var(--shadow); }
.svc-demo[data-demo="bi"] .bi-tooltip.is-on { opacity: 1; }
.svc-demo[data-demo="bi"] .bi-tooltip::after { content: ""; position: absolute; left: 50%; bottom: -4px; width: 8px; height: 8px; background: var(--ink); transform: translateX(-50%) rotate(45deg); }
.svc-demo[data-demo="bi"] .bi-tooltip i { font-style: normal; display: block; font-size: 0.6rem; opacity: 0.7; font-weight: 500; }

/* ---- flavor ranking ---- */
.svc-demo[data-demo="bi"] .bi-rank { display: flex; flex-direction: column; gap: 0.85rem; }
.svc-demo[data-demo="bi"] .bi-rank li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.55rem; }
.svc-demo[data-demo="bi"] .bi-rank .bi-emoji { font-size: 1.05rem; line-height: 1; }
.svc-demo[data-demo="bi"] .bi-rank .bi-rrow { min-width: 0; }
.svc-demo[data-demo="bi"] .bi-rank .bi-rname { display: block; font-size: 0.78rem; color: var(--ink); font-weight: 600; margin-bottom: 0.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc-demo[data-demo="bi"] .bi-rank .bi-track { height: 7px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.svc-demo[data-demo="bi"] .bi-rank .bi-prog { display: block; height: 100%; width: 0; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--accent), var(--bi-c2)); transition: width 0.7s var(--ease-out); }
.svc-demo[data-demo="bi"] .bi-rank li:nth-child(2) .bi-prog { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 80%, var(--bi-c2)), var(--bi-c2)); }
.svc-demo[data-demo="bi"] .bi-rank li:nth-child(3) .bi-prog { background: linear-gradient(90deg, var(--bi-c2), var(--bi-c3)); }
.svc-demo[data-demo="bi"] .bi-rank li:nth-child(4) .bi-prog { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 40%, var(--muted)), var(--bi-c3)); }
.svc-demo[data-demo="bi"] .bi-rank .bi-pct { font-family: var(--font-mono); font-size: 0.74rem; color: var(--text); font-variant-numeric: tabular-nums; min-width: 2.4ch; text-align: right; }

.svc-demo[data-demo="bi"] [data-bi="kpi-ventas"], .svc-demo[data-demo="bi"] [data-bi="kpi-ticket"], .svc-demo[data-demo="bi"] [data-bi="kpi-unidades"] { font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .svc-demo[data-demo="bi"] .bi-panels { grid-template-columns: 1fr; }
  .svc-demo[data-demo="bi"] .bi-chart { height: 150px; }
  .svc-demo[data-demo="bi"] .bi-live { display: none; }
  .svc-demo[data-demo="bi"] .bi-bar:nth-child(even) .bi-mlabel { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .svc-demo[data-demo="bi"] { opacity: 1; }
  .svc-demo[data-demo="bi"] .bi-live i { animation: none; }
  .svc-demo[data-demo="bi"] .bi-bar .bi-fill, .svc-demo[data-demo="bi"] .bi-rank .bi-prog, .svc-demo[data-demo="bi"] .svc-demo-kpi::after { transition: none; }
}

/* ===================== demo: stats ===================== */
.svc-demo[data-demo="stats"] { --s-hist: var(--accent); --s-fc: color-mix(in srgb, var(--accent) 62%, #14b8a6); --s-band: color-mix(in srgb, var(--accent) 24%, transparent); opacity: 0; transform: translateY(10px); }
.svc-demo[data-demo="stats"].is-in { opacity: 1; transform: none; transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out); }

.svc-demo[data-demo="stats"] .stats-slider { display: flex; align-items: center; gap: 0.55rem; margin-left: auto; }
.svc-demo[data-demo="stats"] .stats-slider .label { margin: 0; }
.svc-demo[data-demo="stats"] .stats-range { -webkit-appearance: none; appearance: none; width: clamp(110px, 16vw, 190px); height: 5px; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--accent) var(--pct, 50%), var(--line-strong) var(--pct, 50%)); cursor: pointer; }
.svc-demo[data-demo="stats"] .stats-range::-webkit-slider-thumb { -webkit-appearance: none; width: 17px; height: 17px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); box-shadow: var(--shadow-sm); transition: transform 0.15s var(--ease-out); }
.svc-demo[data-demo="stats"] .stats-range::-webkit-slider-thumb:hover { transform: scale(1.18); }
.svc-demo[data-demo="stats"] .stats-range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); box-shadow: var(--shadow-sm); }
.svc-demo[data-demo="stats"] .stats-hval { font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.svc-demo[data-demo="stats"] .stats-hval b { color: var(--ink); }

.svc-demo[data-demo="stats"] .stats-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: clamp(0.9rem, 2.2vw, 1.4rem); align-items: stretch; }
@media (max-width: 720px) { .svc-demo[data-demo="stats"] .stats-grid { grid-template-columns: 1fr; } }

.svc-demo[data-demo="stats"] .stats-chart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 0.9rem 0.95rem 0.7rem; margin: 0; display: flex; flex-direction: column; }
.svc-demo[data-demo="stats"] .stats-chart__cap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.9rem; font-size: 0.72rem; color: var(--muted); margin-bottom: 0.5rem; }
.svc-demo[data-demo="stats"] .stats-dot { width: 18px; height: 3px; border-radius: var(--r-pill); display: inline-block; }
.svc-demo[data-demo="stats"] .stats-dot--hist { background: var(--s-hist); }
.svc-demo[data-demo="stats"] .stats-dot--fc { background: var(--s-fc); }
.svc-demo[data-demo="stats"] .stats-dot--band { height: 10px; width: 14px; border-radius: var(--r-sm); background: var(--s-band); }

.svc-demo[data-demo="stats"] .stats-svg { width: 100%; height: clamp(190px, 30vw, 240px); overflow: visible; }
.svc-demo[data-demo="stats"] .stats-grid-lines line { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.svc-demo[data-demo="stats"] .stats-fill-a { stop-color: var(--accent); stop-opacity: 0.20; }
.svc-demo[data-demo="stats"] .stats-fill-b { stop-color: var(--accent); stop-opacity: 0; }
.svc-demo[data-demo="stats"] .stats-band { fill: var(--s-band); stroke: none; transition: d 0.6s var(--ease-out); }
.svc-demo[data-demo="stats"] .stats-area { stroke: none; transition: d 0.6s var(--ease-out); }
.svc-demo[data-demo="stats"] .stats-line { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; transition: d 0.6s var(--ease-out); }
.svc-demo[data-demo="stats"] .stats-line--hist { stroke: var(--s-hist); }
.svc-demo[data-demo="stats"] .stats-line--fc { stroke: var(--s-fc); stroke-dasharray: 5 5; }
.svc-demo[data-demo="stats"] .stats-pt { fill: var(--surface); stroke-width: 2.5; vector-effect: non-scaling-stroke; transition: cx 0.6s var(--ease-out), cy 0.6s var(--ease-out); }
.svc-demo[data-demo="stats"] .stats-pt--hist { stroke: var(--s-hist); }
.svc-demo[data-demo="stats"] .stats-pt--fc { stroke: var(--s-fc); }
.svc-demo[data-demo="stats"] .stats-pt--goal { fill: var(--s-fc); stroke: var(--surface); }
.svc-demo[data-demo="stats"] .stats-xlabels text { fill: var(--muted); font-family: var(--font-mono); font-size: 11px; text-anchor: middle; }

.svc-demo[data-demo="stats"] .stats-side { display: flex; flex-direction: column; gap: 0.7rem; }
.svc-demo[data-demo="stats"] .stats-kpis { grid-template-columns: 1fr 1fr; }
.svc-demo[data-demo="stats"] .stats-kpis .svc-demo-kpi b { font-size: 1.35rem; transition: color 0.2s var(--ease-out); }

.svc-demo[data-demo="stats"] .stats-gauge { position: relative; align-self: center; width: clamp(118px, 30vw, 140px); aspect-ratio: 1; }
.svc-demo[data-demo="stats"] .stats-gauge__svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.svc-demo[data-demo="stats"] .stats-gauge__track { fill: none; stroke: var(--line-strong); stroke-width: 9; }
.svc-demo[data-demo="stats"] .stats-gauge__bar { fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 314.159; stroke-dashoffset: 314.159; transition: stroke-dashoffset 0.7s var(--ease-out), stroke 0.3s var(--ease-out); }
.svc-demo[data-demo="stats"] .stats-gauge__center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 0.1rem; }
.svc-demo[data-demo="stats"] .stats-gauge__center b { font-family: var(--font-display); font-size: 1.5rem; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1; }
.svc-demo[data-demo="stats"] .stats-gauge__center span { font-size: 0.66rem; color: var(--muted); }
.svc-demo[data-demo="stats"] .stats-note { font-size: 0.72rem; color: var(--muted); text-align: center; }
.svc-demo[data-demo="stats"] .stats-note b { color: var(--ink); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .svc-demo[data-demo="stats"] { opacity: 1; transform: none; transition: none; }
  .svc-demo[data-demo="stats"] .stats-band,
  .svc-demo[data-demo="stats"] .stats-area,
  .svc-demo[data-demo="stats"] .stats-line,
  .svc-demo[data-demo="stats"] .stats-pt,
  .svc-demo[data-demo="stats"] .stats-gauge__bar { transition: none; }
  .svc-demo[data-demo="stats"] .stats-range::-webkit-slider-thumb { transition: none; }
}

/* ===================== demo: db ===================== */
.svc-demo[data-demo="db"] { display: flex; flex-direction: column; }

.svc-demo[data-demo="db"] .db-bar { row-gap: 0.55rem; }
.svc-demo[data-demo="db"] .db-chipset { display: inline-flex; flex-wrap: wrap; gap: 0.4rem; }
.svc-demo[data-demo="db"] .db-sep { margin-left: 0.6rem; }
.svc-demo[data-demo="db"] .svc-demo-chip { font-size: 0.78rem; padding: 0.42rem 0.78rem; }
.svc-demo[data-demo="db"] .svc-demo-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* search + order row */
.svc-demo[data-demo="db"] .db-tools {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.9rem;
  padding: 0.7rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line);
}
.svc-demo[data-demo="db"] .db-search {
  display: inline-flex; align-items: center; gap: 0.5rem; flex: 1 1 220px; min-width: 160px;
  padding: 0.5rem 0.8rem; border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--muted);
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.svc-demo[data-demo="db"] .db-search:focus-within {
  border-color: var(--accent); color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.svc-demo[data-demo="db"] .db-search svg { flex: 0 0 auto; }
.svc-demo[data-demo="db"] .db-search-input {
  flex: 1 1 auto; min-width: 0; border: 0; background: transparent; outline: none;
  color: var(--ink); font: 500 0.85rem/1 var(--font-body);
}
.svc-demo[data-demo="db"] .db-search-input::placeholder { color: var(--muted); }
.svc-demo[data-demo="db"] .db-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.svc-demo[data-demo="db"] .db-order { display: inline-flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }

/* SQL line */
.svc-demo[data-demo="db"] .db-sqlbar {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 1rem;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface-2));
  border-bottom: 1px solid var(--line); overflow: hidden;
}
.svc-demo[data-demo="db"] .db-sql-dot {
  width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-soft);
}
.svc-demo[data-demo="db"] .db-sql-dot.is-run { animation: db-pulse 0.6s var(--ease-out); }
@keyframes db-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  100% { box-shadow: 0 0 0 9px transparent; }
}
.svc-demo[data-demo="db"] .db-sql {
  flex: 1 1 auto; min-width: 0; font: 500 0.74rem/1.4 var(--font-mono); color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.svc-demo[data-demo="db"] .db-sql .kw { color: var(--accent); font-weight: 600; }
.svc-demo[data-demo="db"] .db-sql .val { color: var(--ink); }
.svc-demo[data-demo="db"] .db-count {
  flex: 0 0 auto; font: 500 0.74rem/1 var(--font-mono); color: var(--muted); white-space: nowrap;
}
.svc-demo[data-demo="db"] .db-count b { color: var(--ink); font-weight: 700; }

/* table area */
.svc-demo[data-demo="db"] .db-body { padding: 0; max-height: 358px; display: flex; flex-direction: column; }
.svc-demo[data-demo="db"] .db-tablehead {
  display: grid; grid-template-columns: 2.3fr 1.1fr 1.1fr 0.95fr 0.95fr; gap: 0.5rem;
  padding: 0.6rem 1.1rem; font: 600 0.66rem/1 var(--font-mono); letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line); background: var(--surface);
  position: sticky; top: 0; z-index: 2;
}
.svc-demo[data-demo="db"] .db-col-num { text-align: right; }
.svc-demo[data-demo="db"] .db-rows { overflow-y: auto; overflow-x: hidden; flex: 1 1 auto; }
.svc-demo[data-demo="db"] .db-rows::-webkit-scrollbar { width: 8px; }
.svc-demo[data-demo="db"] .db-rows::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: var(--r-pill); }

.svc-demo[data-demo="db"] .db-row {
  border-bottom: 1px solid var(--line); cursor: pointer;
  transition: background 0.18s var(--ease-out);
}
.svc-demo[data-demo="db"] .db-row:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.svc-demo[data-demo="db"] .db-row.is-open { background: var(--accent-soft); }
.svc-demo[data-demo="db"] .db-row-main {
  display: grid; grid-template-columns: 2.3fr 1.1fr 1.1fr 0.95fr 0.95fr; gap: 0.5rem;
  align-items: center; width: 100%; text-align: left; padding: 0.62rem 1.1rem;
}
.svc-demo[data-demo="db"] .db-row-main:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.svc-demo[data-demo="db"] .db-name { display: inline-flex; align-items: center; gap: 0.55rem; min-width: 0; }
.svc-demo[data-demo="db"] .db-emoji {
  width: 24px; height: 24px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line);
  font-size: 0.95rem; transition: transform 0.18s var(--ease-out);
}
.svc-demo[data-demo="db"] .db-row:hover .db-emoji { transform: rotate(-8deg) scale(1.12); }
.svc-demo[data-demo="db"] .db-name b {
  font: 600 0.88rem/1.15 var(--font-display); color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.svc-demo[data-demo="db"] .db-period { font: 500 0.78rem/1 var(--font-body); color: var(--text); }
.svc-demo[data-demo="db"] .db-tag {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font: 600 0.68rem/1 var(--font-mono); padding: 0.26rem 0.5rem;
  border-radius: var(--r-pill); border: 1px solid var(--line);
}
.svc-demo[data-demo="db"] .db-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.svc-demo[data-demo="db"] .db-tag.diet-Herbívoro { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.svc-demo[data-demo="db"] .db-tag.diet-Carnívoro { color: var(--err); background: color-mix(in srgb, var(--err) 12%, transparent); }
.svc-demo[data-demo="db"] .db-tag.diet-Omnívoro { color: var(--accent); background: var(--accent-soft); }
.svc-demo[data-demo="db"] .db-num {
  text-align: right; font: 600 0.82rem/1 var(--font-mono); color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.svc-demo[data-demo="db"] .db-num small { color: var(--muted); font-weight: 500; font-size: 0.72rem; }

/* expanded detail */
.svc-demo[data-demo="db"] .db-detail {
  display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.32s var(--ease-out);
}
.svc-demo[data-demo="db"] .db-row.is-open .db-detail { grid-template-rows: 1fr; }
.svc-demo[data-demo="db"] .db-detail-inner { overflow: hidden; min-height: 0; }
.svc-demo[data-demo="db"] .db-detail-pad {
  padding: 0.2rem 1.1rem 1rem calc(1.1rem + 24px + 0.55rem);
  display: flex; flex-wrap: wrap; gap: 0.8rem 1.4rem; align-items: flex-start;
}
.svc-demo[data-demo="db"] .db-fact {
  flex: 1 1 240px; font: 400 0.82rem/1.5 var(--font-body); color: var(--text);
}
.svc-demo[data-demo="db"] .db-fact b { color: var(--accent); font: 600 0.68rem/1 var(--font-mono); display: block; margin-bottom: 0.3rem; letter-spacing: 0.04em; }
.svc-demo[data-demo="db"] .db-meta { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.svc-demo[data-demo="db"] .db-pill {
  font: 600 0.66rem/1 var(--font-mono); color: var(--muted);
  padding: 0.34rem 0.6rem; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.svc-demo[data-demo="db"] .db-pill strong { color: var(--ink); }

/* bar visual inside numeric for length */
.svc-demo[data-demo="db"] .db-bar-track {
  margin-top: 0.32rem; height: 3px; border-radius: var(--r-pill);
  background: var(--line); overflow: hidden;
}
.svc-demo[data-demo="db"] .db-bar-fill {
  display: block; height: 100%; width: 0%; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 50%, var(--surface-2)));
  transition: width 0.5s var(--ease-out);
}

.svc-demo[data-demo="db"] .db-empty {
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem; justify-content: center;
  padding: 2.4rem 1rem; color: var(--muted); text-align: center; flex: 1 1 auto;
}
.svc-demo[data-demo="db"] .db-empty p { font: 500 0.85rem/1.4 var(--font-body); }

/* enter animation */
.svc-demo[data-demo="db"] .db-row { will-change: transform, opacity; }
.svc-demo[data-demo="db"].is-ready .db-bar,
.svc-demo[data-demo="db"].is-ready .db-tools,
.svc-demo[data-demo="db"].is-ready .db-sqlbar { animation: db-slidein 0.45s var(--ease-out) both; }
.svc-demo[data-demo="db"].is-ready .db-tools { animation-delay: 0.06s; }
.svc-demo[data-demo="db"].is-ready .db-sqlbar { animation-delay: 0.12s; }
@keyframes db-slidein { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

@media (max-width: 720px) {
  .svc-demo[data-demo="db"] .db-tablehead,
  .svc-demo[data-demo="db"] .db-row-main { grid-template-columns: 1.6fr 0.9fr 0.95fr; }
  .svc-demo[data-demo="db"] .db-col-num:last-child,
  .svc-demo[data-demo="db"] .db-num.db-weight { display: none; }
  .svc-demo[data-demo="db"] .db-detail-pad { padding-left: 1.1rem; }
  .svc-demo[data-demo="db"] .db-body { max-height: 280px; }
  .svc-demo[data-demo="db"] .db-count { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .svc-demo[data-demo="db"] .db-bar,
  .svc-demo[data-demo="db"] .db-tools,
  .svc-demo[data-demo="db"] .db-sqlbar,
  .svc-demo[data-demo="db"] .db-row { animation: none !important; }
  .svc-demo[data-demo="db"] .db-sql-dot.is-run { animation: none; }
  .svc-demo[data-demo="db"] .db-detail { transition: none; }
  .svc-demo[data-demo="db"] .db-bar-fill { transition: none; }
  .svc-demo[data-demo="db"] .db-row:hover .db-emoji { transform: none; }
}

/* ===================== demo: software ===================== */
.svc-demo[data-demo="software"] { --sw-todo: var(--accent); --sw-doing: color-mix(in srgb, var(--accent) 55%, #d98a00); --sw-done: var(--ok); }

.svc-demo[data-demo="software"] .sw-spacer { flex: 1 1 auto; }
.svc-demo[data-demo="software"] .sw-clock { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.03em; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 0.3rem 0.7rem; white-space: nowrap; }

.svc-demo[data-demo="software"] .sw-body { display: flex; flex-direction: column; gap: clamp(0.85rem, 2vw, 1.2rem); }

/* KPIs */
.svc-demo[data-demo="software"] .sw-kpis { grid-template-columns: repeat(3, 1fr); }
.svc-demo[data-demo="software"] .svc-demo-kpi b { font-variant-numeric: tabular-nums; transition: color .2s var(--ease-out); }
/* Stack number / label / delta so the secondary stat doesn't run into the label. */
.svc-demo[data-demo="software"] .svc-demo-kpi span { display: block; margin-top: 0.2rem; }
.svc-demo[data-demo="software"] .svc-demo-kpi em[data-kpi="done-delta"],
.svc-demo[data-demo="software"] .svc-demo-kpi em[data-kpi="low-tag"] { display: block; margin-top: 0.25rem; }
.svc-demo[data-demo="software"] .svc-demo-kpi em[data-kpi="bar"] { display: block; margin-top: 0.5rem; height: 6px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.svc-demo[data-demo="software"] .svc-demo-kpi em[data-kpi="bar"] i { display: block; height: 100%; width: 0%; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--sw-todo), var(--sw-done)); transition: width .5s var(--ease-out); }
.svc-demo[data-demo="software"] .svc-demo-kpi em[data-kpi="low-tag"].is-alert { color: var(--err); font-weight: 600; }

/* Panes */
.svc-demo[data-demo="software"] .sw-pane { display: none; }
.svc-demo[data-demo="software"] .sw-pane.is-active { display: block; animation: sw-pane-in .34s var(--ease-out) both; }
@keyframes sw-pane-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Add form */
.svc-demo[data-demo="software"] .sw-add { display: flex; align-items: center; gap: 0.5rem; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: 0.3rem 0.4rem 0.3rem 0.85rem; margin-bottom: clamp(0.8rem, 2vw, 1.1rem); transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out); }
.svc-demo[data-demo="software"] .sw-add:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.svc-demo[data-demo="software"] .sw-add-ico { color: var(--muted); display: grid; place-items: center; flex: 0 0 auto; }
.svc-demo[data-demo="software"] .sw-add-input { flex: 1 1 auto; min-width: 0; background: transparent; border: none; outline: none; color: var(--ink); font: 500 0.9rem/1.2 var(--font-body); padding: 0.45rem 0; }
.svc-demo[data-demo="software"] .sw-add-input::placeholder { color: var(--muted); }
.svc-demo[data-demo="software"] .sw-add-btn { flex: 0 0 auto; font: 600 0.82rem/1 var(--font-body); color: var(--accent-ink); background: var(--accent); border-radius: var(--r-pill); padding: 0.55rem 1.05rem; transition: background .18s var(--ease-out), transform .12s var(--ease-out); }
.svc-demo[data-demo="software"] .sw-add-btn:hover { background: var(--accent-press); }
.svc-demo[data-demo="software"] .sw-add-btn:active { transform: scale(0.96); }

/* Board */
.svc-demo[data-demo="software"] .sw-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; align-items: start; }
.svc-demo[data-demo="software"] .sw-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 0.7rem; min-height: 132px; }
.svc-demo[data-demo="software"] .sw-col-head { display: flex; align-items: center; gap: 0.45rem; margin-bottom: 0.65rem; }
.svc-demo[data-demo="software"] .sw-col-head h4 { font: 600 0.82rem/1 var(--font-display); color: var(--ink); flex: 1 1 auto; }
.svc-demo[data-demo="software"] .sw-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.svc-demo[data-demo="software"] .sw-dot--todo { background: var(--sw-todo); }
.svc-demo[data-demo="software"] .sw-dot--doing { background: var(--sw-doing); }
.svc-demo[data-demo="software"] .sw-dot--done { background: var(--sw-done); }
.svc-demo[data-demo="software"] .sw-count { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 0.72rem; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); min-width: 22px; text-align: center; padding: 0.12rem 0.35rem; transition: transform .25s var(--ease-out), color .25s var(--ease-out); }
.svc-demo[data-demo="software"] .sw-count.is-bump { transform: scale(1.28); color: var(--accent); }
.svc-demo[data-demo="software"] .sw-stack { display: flex; flex-direction: column; gap: 0.5rem; min-height: 28px; }

/* Cards */
.svc-demo[data-demo="software"] .sw-card { display: flex; align-items: center; gap: 0.5rem; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0.6rem 0.65rem; color: var(--text); box-shadow: var(--shadow-sm); transition: transform .14s var(--ease-out), border-color .18s var(--ease-out), box-shadow .18s var(--ease-out); }
.svc-demo[data-demo="software"] .sw-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.svc-demo[data-demo="software"] .sw-card:active { transform: translateY(0) scale(0.98); }
.svc-demo[data-demo="software"] .sw-card-emoji { font-size: 1.05rem; flex: 0 0 auto; line-height: 1; filter: saturate(1.05); }
.svc-demo[data-demo="software"] .sw-card-txt { flex: 1 1 auto; min-width: 0; font: 600 0.82rem/1.25 var(--font-body); color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.svc-demo[data-demo="software"] .sw-card-arrow { flex: 0 0 auto; color: var(--muted); opacity: 0; transform: translateX(-3px); transition: opacity .18s var(--ease-out), transform .18s var(--ease-out); }
.svc-demo[data-demo="software"] .sw-card:hover .sw-card-arrow { opacity: 1; transform: none; }
.svc-demo[data-demo="software"] .sw-card[data-state="2"] .sw-card-txt { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.svc-demo[data-demo="software"] .sw-card[data-state="2"] { background: color-mix(in srgb, var(--ok) 8%, var(--surface)); }
.svc-demo[data-demo="software"] .sw-card.is-enter { animation: sw-card-pop .32s var(--ease-out) both; }
@keyframes sw-card-pop { from { opacity: 0; transform: translateY(-6px) scale(0.96); } to { opacity: 1; transform: none; } }

/* Inventory */
.svc-demo[data-demo="software"] .sw-inv { display: flex; flex-direction: column; gap: 0.5rem; }
.svc-demo[data-demo="software"] .sw-inv-row { display: flex; align-items: center; gap: 0.7rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 0.6rem 0.75rem; transition: border-color .2s var(--ease-out); }
.svc-demo[data-demo="software"] .sw-inv-row.is-low { border-color: color-mix(in srgb, var(--err) 45%, var(--line)); }
.svc-demo[data-demo="software"] .sw-inv-emoji { font-size: 1.2rem; flex: 0 0 auto; line-height: 1; }
.svc-demo[data-demo="software"] .sw-inv-main { flex: 1 1 auto; min-width: 0; }
.svc-demo[data-demo="software"] .sw-inv-name { font: 600 0.86rem/1.2 var(--font-body); color: var(--ink); display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.svc-demo[data-demo="software"] .sw-badge { font-family: var(--font-mono); font-size: 0.6rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--err); background: color-mix(in srgb, var(--err) 14%, transparent); border-radius: var(--r-pill); padding: 0.12rem 0.45rem; opacity: 0; transform: scale(0.8); transition: opacity .2s var(--ease-out), transform .2s var(--ease-out); pointer-events: none; }
.svc-demo[data-demo="software"] .sw-inv-row.is-low .sw-badge { opacity: 1; transform: none; pointer-events: auto; }
.svc-demo[data-demo="software"] .sw-inv-sku { font-family: var(--font-mono); font-size: 0.68rem; color: var(--muted); }
.svc-demo[data-demo="software"] .sw-stepper { display: flex; align-items: center; gap: 0.35rem; flex: 0 0 auto; }
.svc-demo[data-demo="software"] .sw-step { width: 28px; height: 28px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); font: 700 1rem/1 var(--font-mono); display: grid; place-items: center; transition: background .15s var(--ease-out), border-color .15s var(--ease-out), transform .1s var(--ease-out); }
.svc-demo[data-demo="software"] .sw-step:hover { border-color: var(--accent); color: var(--accent); }
.svc-demo[data-demo="software"] .sw-step:active { transform: scale(0.9); }
.svc-demo[data-demo="software"] .sw-step:disabled { opacity: 0.4; cursor: not-allowed; }
.svc-demo[data-demo="software"] .sw-stock { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 0.95rem; font-weight: 700; color: var(--ink); min-width: 34px; text-align: center; transition: color .2s var(--ease-out), transform .2s var(--ease-out); }
.svc-demo[data-demo="software"] .sw-stock.is-flash { color: var(--accent); transform: scale(1.18); }
.svc-demo[data-demo="software"] .sw-inv-row.is-low .sw-stock { color: var(--err); }

.svc-demo[data-demo="software"] .sw-hint { margin-top: 0.7rem; font-size: 0.72rem; color: var(--muted); }
.svc-demo[data-demo="software"] .sw-hint b { color: var(--err); }

@media (max-width: 640px) {
  .svc-demo[data-demo="software"] .sw-kpis { grid-template-columns: 1fr; }
  .svc-demo[data-demo="software"] .sw-board { grid-template-columns: 1fr; }
  .svc-demo[data-demo="software"] .sw-clock { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .svc-demo[data-demo="software"] .sw-pane.is-active,
  .svc-demo[data-demo="software"] .sw-card.is-enter { animation: none; }
  .svc-demo[data-demo="software"] .svc-demo-kpi b,
  .svc-demo[data-demo="software"] .svc-demo-kpi em[data-kpi="bar"] i,
  .svc-demo[data-demo="software"] .sw-card,
  .svc-demo[data-demo="software"] .sw-count,
  .svc-demo[data-demo="software"] .sw-stock,
  .svc-demo[data-demo="software"] .sw-step,
  .svc-demo[data-demo="software"] .sw-badge { transition: none; }
}

/* ===================== demo: ai ===================== */
.svc-demo[data-demo="ai"] { --ai-c1: var(--accent); --ai-c2: color-mix(in srgb, var(--accent) 62%, #14C9A6); --ai-c3: color-mix(in srgb, var(--accent) 55%, #B36BFF); }
.svc-demo[data-demo="ai"] .svc-demo-bar { gap: 0.6rem; }
.svc-demo[data-demo="ai"] .ai-status { display: inline-flex; align-items: center; gap: 0.45rem; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.02em; color: var(--muted); }
.svc-demo[data-demo="ai"] .ai-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: ai-pulse 2.4s var(--ease-out) infinite; }
.svc-demo[data-demo="ai"] .ai-reset { margin-left: auto; font: 600 0.72rem/1 var(--font-body); color: var(--muted); padding: 0.4rem 0.7rem; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); transition: color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
.svc-demo[data-demo="ai"] .ai-reset:hover { color: var(--ink); border-color: var(--accent); }
.svc-demo[data-demo="ai"] .ai-reset:active { transform: scale(0.96); }

.svc-demo[data-demo="ai"] .svc-demo-body { padding: clamp(0.85rem, 2vw, 1.15rem); }
.svc-demo[data-demo="ai"] .ai-shell { display: flex; flex-direction: column; gap: 0.75rem; opacity: 0; transform: translateY(10px); }
.svc-demo[data-demo="ai"] .ai-shell.is-in { opacity: 1; transform: none; transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out); }

.svc-demo[data-demo="ai"] .ai-thread { height: clamp(300px, 42vh, 360px); overflow-y: auto; padding: 0.4rem 0.55rem 0.2rem; display: flex; flex-direction: column; gap: 0.85rem; scroll-behavior: smooth; }
.svc-demo[data-demo="ai"] .ai-thread::-webkit-scrollbar { width: 8px; }
.svc-demo[data-demo="ai"] .ai-thread::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: var(--r-pill); }

.svc-demo[data-demo="ai"] .ai-row { display: flex; gap: 0.55rem; max-width: 92%; }
.svc-demo[data-demo="ai"] .ai-row--bot { align-self: flex-start; }
.svc-demo[data-demo="ai"] .ai-row--user { align-self: flex-end; flex-direction: row-reverse; }
.svc-demo[data-demo="ai"] .ai-ava { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--accent-ink); background: linear-gradient(135deg, var(--ai-c1), var(--ai-c3)); box-shadow: 0 4px 12px -4px var(--accent-glow); }

.svc-demo[data-demo="ai"] .ai-bubble { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r) var(--r) var(--r) var(--r-sm); padding: 0.7rem 0.85rem; box-shadow: var(--shadow-sm); }
.svc-demo[data-demo="ai"] .ai-row--user .ai-bubble { background: var(--accent); color: var(--accent-ink); border-color: transparent; border-radius: var(--r) var(--r) var(--r-sm) var(--r); }
.svc-demo[data-demo="ai"] .ai-bubble p { font-size: 0.9rem; line-height: 1.5; }
.svc-demo[data-demo="ai"] .ai-bubble p + p { margin-top: 0.5rem; }
.svc-demo[data-demo="ai"] .ai-bubble b { color: var(--ink); font-weight: 700; }
.svc-demo[data-demo="ai"] .ai-row--user .ai-bubble b { color: var(--accent-ink); }
.svc-demo[data-demo="ai"] .ai-bubble .ai-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 600; }
.svc-demo[data-demo="ai"] .ai-row--user .ai-bubble .ai-num { color: var(--accent-ink); }

/* enter animation per message */
.svc-demo[data-demo="ai"] .ai-row.ai-enter { opacity: 0; transform: translateY(8px) scale(0.99); }
.svc-demo[data-demo="ai"] .ai-row.ai-enter.ai-shown { opacity: 1; transform: none; transition: opacity 0.34s var(--ease-out), transform 0.34s var(--ease-out); }

/* typing dots */
.svc-demo[data-demo="ai"] .ai-typing { display: inline-flex; gap: 5px; padding: 0.55rem 0.2rem; }
.svc-demo[data-demo="ai"] .ai-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: 0.45; animation: ai-bounce 1.1s var(--ease-out) infinite; }
.svc-demo[data-demo="ai"] .ai-typing i:nth-child(2) { animation-delay: 0.16s; }
.svc-demo[data-demo="ai"] .ai-typing i:nth-child(3) { animation-delay: 0.32s; }

/* inline mini table */
.svc-demo[data-demo="ai"] .ai-table { margin-top: 0.6rem; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.svc-demo[data-demo="ai"] .ai-trow { display: grid; grid-template-columns: 1fr auto; gap: 0.6rem; align-items: center; padding: 0.4rem 0.6rem; font-size: 0.82rem; }
.svc-demo[data-demo="ai"] .ai-trow + .ai-trow { border-top: 1px solid var(--line); }
.svc-demo[data-demo="ai"] .ai-trow span:first-child { color: var(--text); }
.svc-demo[data-demo="ai"] .ai-trow .ai-tv { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }

/* inline bar chart */
.svc-demo[data-demo="ai"] .ai-bars { margin-top: 0.65rem; display: flex; flex-direction: column; gap: 0.4rem; }
.svc-demo[data-demo="ai"] .ai-barrow { display: grid; grid-template-columns: 36px 1fr auto; gap: 0.55rem; align-items: center; font-size: 0.78rem; }
.svc-demo[data-demo="ai"] .ai-barrow .ai-bl { color: var(--muted); font-family: var(--font-mono); }
.svc-demo[data-demo="ai"] .ai-track { height: 9px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.svc-demo[data-demo="ai"] .ai-fill { height: 100%; width: 0; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--ai-c1), var(--ai-c2)); transition: width 0.7s var(--ease-out); }
.svc-demo[data-demo="ai"] .ai-barrow.is-top .ai-fill { background: linear-gradient(90deg, var(--ai-c1), var(--ai-c3)); }
.svc-demo[data-demo="ai"] .ai-barrow .ai-bv { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; min-width: 3.4em; text-align: right; }

.svc-demo[data-demo="ai"] .ai-suggest { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.svc-demo[data-demo="ai"] .ai-suggest .svc-demo-chip { font-size: 0.78rem; padding: 0.42rem 0.75rem; }
.svc-demo[data-demo="ai"] .ai-suggest .svc-demo-chip:active { transform: scale(0.97); }

.svc-demo[data-demo="ai"] .ai-input { display: flex; gap: 0.5rem; align-items: center; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: 0.3rem 0.3rem 0.3rem 0.95rem; transition: border-color var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out); }
.svc-demo[data-demo="ai"] .ai-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.svc-demo[data-demo="ai"] .ai-input input { flex: 1 1 auto; min-width: 0; border: none; background: transparent; font-size: 0.9rem; color: var(--ink); outline: none; padding: 0.45rem 0; }
.svc-demo[data-demo="ai"] .ai-input input::placeholder { color: var(--muted); }
.svc-demo[data-demo="ai"] .ai-send { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--accent-ink); background: var(--accent); transition: background var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
.svc-demo[data-demo="ai"] .ai-send:hover { background: var(--accent-press); }
.svc-demo[data-demo="ai"] .ai-send:active { transform: scale(0.92); }

@keyframes ai-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes ai-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-4px); opacity: 0.95; } }

@media (max-width: 720px) {
  .svc-demo[data-demo="ai"] .ai-row { max-width: 96%; }
  .svc-demo[data-demo="ai"] .ai-thread { height: clamp(240px, 50vh, 320px); }
}

@media (prefers-reduced-motion: reduce) {
  .svc-demo[data-demo="ai"] .ai-shell, .svc-demo[data-demo="ai"] .ai-shell.is-in { opacity: 1; transform: none; transition: none; }
  .svc-demo[data-demo="ai"] .ai-row.ai-enter, .svc-demo[data-demo="ai"] .ai-row.ai-enter.ai-shown { opacity: 1; transform: none; transition: none; }
  .svc-demo[data-demo="ai"] .ai-status i { animation: none; }
  .svc-demo[data-demo="ai"] .ai-typing i { animation: none; opacity: 0.6; }
  .svc-demo[data-demo="ai"] .ai-fill { transition: none; }
  .svc-demo[data-demo="ai"] .ai-thread { scroll-behavior: auto; }
}

/* ===================== demo: api ===================== */
.svc-demo[data-demo="api"] .dot { width: 7px; height: 7px; border-radius: var(--r-pill); background: currentColor; display: inline-block; margin-right: 0.5rem; opacity: 0.55; transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out); vertical-align: middle; }
.svc-demo[data-demo="api"] .svc-demo-chip.is-active .dot { opacity: 1; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-ink) 22%, transparent); }

.svc-demo[data-demo="api"] .api-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: clamp(0.8rem, 2vw, 1.25rem); align-items: stretch; }

.svc-demo[data-demo="api"] .api-stage { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0.6rem 0.6rem 0.2rem; overflow: hidden; }
.svc-demo[data-demo="api"] .api-stage::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%);
  pointer-events: none; }
.svc-demo[data-demo="api"] .api-stage-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.35rem 0.5rem 0; }
.svc-demo[data-demo="api"] .api-live { display: inline-flex; align-items: center; gap: 0.45rem; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.svc-demo[data-demo="api"] .api-live-dot { width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--accent); box-shadow: 0 0 0 0 var(--accent-glow); animation: api-pulse 2.2s var(--ease-out) infinite; }
.svc-demo[data-demo="api"] .api-stage-sub { font-family: var(--font-mono); font-size: 0.68rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.svc-demo[data-demo="api"] .api-graph { width: 100%; height: auto; display: block; }

.svc-demo[data-demo="api"] .api-link { stroke: var(--line-strong); stroke-width: 1.4; fill: none; transition: stroke 0.35s var(--ease-out), stroke-opacity 0.35s var(--ease-out), stroke-width 0.35s var(--ease-out); stroke-linecap: round; }
.svc-demo[data-demo="api"] .api-link.is-on { stroke: color-mix(in srgb, var(--accent) 62%, var(--line-strong)); stroke-opacity: 0.9; stroke-width: 1.8; }
.svc-demo[data-demo="api"] .api-link.is-off { stroke-opacity: 0.28; stroke-dasharray: 3 5; }

.svc-demo[data-demo="api"] .api-packet { fill: var(--accent); filter: drop-shadow(0 0 4px var(--accent-glow)); }

.svc-demo[data-demo="api"] .api-node-hit { fill: transparent; cursor: pointer; }
.svc-demo[data-demo="api"] .api-node-disc { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.4; transition: stroke 0.3s var(--ease-out), fill 0.3s var(--ease-out), transform 0.3s var(--ease-out); transform-box: fill-box; transform-origin: center; }
.svc-demo[data-demo="api"] .api-node.is-on .api-node-disc { stroke: var(--accent); fill: var(--accent-soft); }
.svc-demo[data-demo="api"] .api-node.is-off { opacity: 0.45; }
.svc-demo[data-demo="api"] .api-node:hover .api-node-disc { stroke: var(--accent); }
.svc-demo[data-demo="api"] .api-node-glyph { fill: var(--muted); transition: fill 0.3s var(--ease-out); }
.svc-demo[data-demo="api"] .api-node.is-on .api-node-glyph { fill: var(--accent); }
.svc-demo[data-demo="api"] .api-node-name { fill: var(--text); font-family: var(--font-body); font-size: 11px; font-weight: 600; text-anchor: middle; }
.svc-demo[data-demo="api"] .api-node.is-off .api-node-name { fill: var(--muted); }
.svc-demo[data-demo="api"] .api-node-ping { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: center; }

.svc-demo[data-demo="api"] .api-hub-aura { animation: api-aura 3.6s var(--ease-out) infinite; transform-box: fill-box; transform-origin: center; }
.svc-demo[data-demo="api"] .api-hub-core { fill: var(--accent); }
.svc-demo[data-demo="api"] .api-hub-ring { fill: none; stroke: var(--accent-ink); stroke-opacity: 0.35; stroke-width: 1.4; }
.svc-demo[data-demo="api"] .api-hub-label { fill: var(--accent-ink); font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: 0.04em; text-anchor: middle; }
.svc-demo[data-demo="api"] .api-hub-tag { fill: var(--accent-ink); fill-opacity: 0.7; font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 0.18em; text-anchor: middle; }

.svc-demo[data-demo="api"] .api-side { display: flex; flex-direction: column; gap: 0.7rem; min-width: 0; }
.svc-demo[data-demo="api"] .api-kpis { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.svc-demo[data-demo="api"] .api-kpis .svc-demo-kpi b { font-size: clamp(1.25rem, 2.4vw, 1.7rem); }
.svc-demo[data-demo="api"] .api-kpis em { display: inline-block; margin-top: 0.2rem; }

.svc-demo[data-demo="api"] .api-log { flex: 1 1 auto; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 0.7rem 0.8rem; display: flex; flex-direction: column; }
.svc-demo[data-demo="api"] .api-log-head { display: flex; align-items: center; justify-content: space-between; font-size: 0.74rem; font-weight: 600; color: var(--ink); margin-bottom: 0.55rem; }
.svc-demo[data-demo="api"] .api-log-tag { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.04em; color: var(--muted); padding: 0.18rem 0.45rem; border: 1px solid var(--line); border-radius: var(--r-pill); }
.svc-demo[data-demo="api"] .api-log-list { display: flex; flex-direction: column; gap: 0.38rem; overflow: hidden; max-height: 178px; }
.svc-demo[data-demo="api"] .api-log-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.5rem; font-size: 0.74rem; color: var(--text); padding: 0.4rem 0.5rem; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
.svc-demo[data-demo="api"] .api-log-item .pip { width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--accent); flex: 0 0 auto; }
.svc-demo[data-demo="api"] .api-log-item .txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-demo[data-demo="api"] .api-log-item .txt b { color: var(--ink); font-weight: 600; }
.svc-demo[data-demo="api"] .api-log-item .ts { font-family: var(--font-mono); font-size: 0.64rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.svc-demo[data-demo="api"] .api-log-item.is-new { animation: api-logIn 0.42s var(--ease-out) both; }

.svc-demo[data-demo="api"] .api-intro { opacity: 0; transform: translateY(10px); }
.svc-demo[data-demo="api"] .api-intro.is-ready { opacity: 1; transform: none; transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out); }

@keyframes api-pulse { 0% { box-shadow: 0 0 0 0 var(--accent-glow); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes api-aura { 0%, 100% { opacity: 0.55; transform: scale(0.9); } 50% { opacity: 0.95; transform: scale(1.08); } }
@keyframes api-logIn { from { opacity: 0; transform: translateY(-8px) scale(0.98); } to { opacity: 1; transform: none; } }

@media (max-width: 760px) {
  .svc-demo[data-demo="api"] .api-grid { grid-template-columns: 1fr; }
  .svc-demo[data-demo="api"] .api-log-list { max-height: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  .svc-demo[data-demo="api"] .api-live-dot,
  .svc-demo[data-demo="api"] .api-hub-aura { animation: none; }
  .svc-demo[data-demo="api"] .api-log-item.is-new { animation: none; }
  .svc-demo[data-demo="api"] .api-intro.is-ready { transition: none; }
}

/* ===================== demo: web ===================== */
.svc-demo[data-demo="web"] { --web-c1: var(--accent); --web-c2: color-mix(in srgb, var(--accent) 62%, #16C2A3); --web-c3: color-mix(in srgb, var(--accent) 55%, #FF8A3D); }

.svc-demo[data-demo="web"] .web-live { margin-left: auto; display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.03em; color: var(--muted); }
.svc-demo[data-demo="web"] .web-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--web-c2); box-shadow: 0 0 0 0 color-mix(in srgb, var(--web-c2) 60%, transparent); animation: web-pulse 1.8s var(--ease-out) infinite; }
@keyframes web-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--web-c2) 55%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.svc-demo[data-demo="web"] .web-promo { gap: 0.5rem; }
.svc-demo[data-demo="web"] .web-promo-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--web-c3); transition: transform 0.2s var(--ease-out); }
.svc-demo[data-demo="web"] .web-promo.is-active .web-promo-dot { background: var(--accent-ink); transform: scale(1.25); }

.svc-demo[data-demo="web"] .web-grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 1rem; align-items: start; }
.svc-demo[data-demo="web"] .web-shop { min-width: 0; display: flex; flex-direction: column; gap: 0.9rem; }

.svc-demo[data-demo="web"] .web-kpis { grid-template-columns: repeat(3, 1fr); gap: 0.55rem; }
.svc-demo[data-demo="web"] .web-kpis .svc-demo-kpi { padding: 0.7rem 0.8rem; transition: border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out); }
.svc-demo[data-demo="web"] .web-kpis .svc-demo-kpi b { font-size: 1.3rem; transition: color 0.25s var(--ease-out); }
.svc-demo[data-demo="web"] .web-kpis .svc-demo-kpi.is-bump { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 0 0 3px var(--accent-soft); }
.svc-demo[data-demo="web"] .web-kpis em { transition: opacity 0.3s ease, transform 0.3s var(--ease-out); }
.svc-demo[data-demo="web"] .web-kpis em.is-flash { opacity: 1; }

.svc-demo[data-demo="web"] .web-products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.svc-demo[data-demo="web"] .web-card { display: flex; flex-direction: column; gap: 0.45rem; padding: 0.75rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); transition: transform 0.22s var(--ease-out), border-color 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out); }
.svc-demo[data-demo="web"] .web-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); box-shadow: var(--shadow); }
.svc-demo[data-demo="web"] .web-card-art { font-size: 1.9rem; line-height: 1; display: grid; place-items: center; height: 46px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--accent-soft) 70%, transparent); transition: transform 0.25s var(--ease-out); }
.svc-demo[data-demo="web"] .web-card:hover .web-card-art { transform: scale(1.08) rotate(-4deg); }
.svc-demo[data-demo="web"] .web-card-name { font-weight: 600; font-size: 0.82rem; color: var(--ink); line-height: 1.2; }
.svc-demo[data-demo="web"] .web-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; margin-top: auto; }
.svc-demo[data-demo="web"] .web-price { font-variant-numeric: tabular-nums; }
.svc-demo[data-demo="web"] .web-price b { font-family: var(--font-display); font-size: 0.96rem; color: var(--ink); }
.svc-demo[data-demo="web"] .web-price s { display: block; font-size: 0.66rem; color: var(--muted); }
.svc-demo[data-demo="web"] .web-add { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: 0 0 auto; border-radius: var(--r-pill); border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font-size: 1.05rem; font-weight: 700; cursor: pointer; line-height: 1; transition: transform 0.16s var(--ease-out), background 0.16s ease; }
.svc-demo[data-demo="web"] .web-add:hover { background: var(--accent-press); transform: scale(1.1); }
.svc-demo[data-demo="web"] .web-add:active { transform: scale(0.92); }
.svc-demo[data-demo="web"] .web-add.is-pop { animation: web-pop 0.36s var(--ease-out); }
@keyframes web-pop { 0% { transform: scale(1); } 45% { transform: scale(1.32); } 100% { transform: scale(1); } }

.svc-demo[data-demo="web"] .web-fly { position: fixed; z-index: 60; pointer-events: none; font-size: 1.4rem; line-height: 1; will-change: transform, opacity; }

.svc-demo[data-demo="web"] .web-cart { position: relative; min-width: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.svc-demo[data-demo="web"] .web-cart-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 0.85rem; border-bottom: 1px solid var(--line); }
.svc-demo[data-demo="web"] .web-cart-ico { color: var(--accent); display: inline-flex; }
.svc-demo[data-demo="web"] .web-cart-title { font-weight: 600; font-size: 0.86rem; color: var(--ink); }
.svc-demo[data-demo="web"] .web-cart-count { margin-left: auto; min-width: 24px; height: 24px; padding: 0 0.45rem; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent); font-family: var(--font-mono); font-size: 0.74rem; font-weight: 600; font-variant-numeric: tabular-nums; transition: transform 0.22s var(--ease-out); }
.svc-demo[data-demo="web"] .web-cart-count.is-bump { transform: scale(1.28); }

.svc-demo[data-demo="web"] .web-cart-items { flex: 1; min-height: 132px; max-height: 232px; overflow-y: auto; padding: 0.6rem 0.7rem; display: flex; flex-direction: column; gap: 0.5rem; }
.svc-demo[data-demo="web"] .web-cart-empty { margin: auto; text-align: center; font-size: 0.8rem; color: var(--text); }
.svc-demo[data-demo="web"] .web-cart-empty span { font-size: 0.72rem; color: var(--muted); }

.svc-demo[data-demo="web"] .web-line { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.55rem; padding: 0.45rem 0.5rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.svc-demo[data-demo="web"] .web-line.is-enter { animation: web-line-in 0.34s var(--ease-out); }
@keyframes web-line-in { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: translateX(0); } }
.svc-demo[data-demo="web"] .web-line-art { font-size: 1.1rem; line-height: 1; }
.svc-demo[data-demo="web"] .web-line-mid { min-width: 0; }
.svc-demo[data-demo="web"] .web-line-name { font-size: 0.76rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc-demo[data-demo="web"] .web-line-sub { font-size: 0.68rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.svc-demo[data-demo="web"] .web-qty { display: inline-flex; align-items: center; gap: 0.18rem; }
.svc-demo[data-demo="web"] .web-qty button { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: 0.9rem; font-weight: 700; line-height: 1; cursor: pointer; transition: border-color 0.15s ease, color 0.15s ease, transform 0.12s var(--ease-out); }
.svc-demo[data-demo="web"] .web-qty button:hover { border-color: var(--accent); color: var(--accent); }
.svc-demo[data-demo="web"] .web-qty button:active { transform: scale(0.88); }
.svc-demo[data-demo="web"] .web-qty b { min-width: 18px; text-align: center; font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink); font-variant-numeric: tabular-nums; }

.svc-demo[data-demo="web"] .web-cart-foot { border-top: 1px solid var(--line); padding: 0.7rem 0.85rem; display: flex; flex-direction: column; gap: 0.35rem; }
.svc-demo[data-demo="web"] .web-cart-row { display: flex; align-items: baseline; justify-content: space-between; font-size: 0.78rem; color: var(--muted); }
.svc-demo[data-demo="web"] .web-cart-row b { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.svc-demo[data-demo="web"] .web-cart-row--save b { color: var(--web-c3); }
.svc-demo[data-demo="web"] .web-cart-row--total { margin-top: 0.15rem; padding-top: 0.4rem; border-top: 1px dashed var(--line); }
.svc-demo[data-demo="web"] .web-cart-row--total span { color: var(--ink); font-size: 0.82rem; font-weight: 600; }
.svc-demo[data-demo="web"] .web-cart-row--total b { color: var(--ink); font-family: var(--font-display); font-size: 1.15rem; }

.svc-demo[data-demo="web"] .web-checkout { position: relative; margin-top: 0.45rem; height: 42px; border-radius: var(--r-pill); border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font: 600 0.88rem/1 var(--font-body); cursor: pointer; overflow: hidden; transition: background 0.18s ease, transform 0.16s var(--ease-out), opacity 0.18s ease, border-color 0.18s ease; }
.svc-demo[data-demo="web"] .web-checkout:hover:not(:disabled) { background: var(--accent-press); }
.svc-demo[data-demo="web"] .web-checkout:active:not(:disabled) { transform: scale(0.98); }
.svc-demo[data-demo="web"] .web-checkout:disabled { background: var(--surface-2); color: var(--muted); border-color: var(--line); cursor: not-allowed; }
.svc-demo[data-demo="web"] .web-checkout-label, .svc-demo[data-demo="web"] .web-checkout-check { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; transition: opacity 0.2s ease, transform 0.3s var(--ease-out); }
.svc-demo[data-demo="web"] .web-checkout-check { opacity: 0; transform: scale(0.6); }
.svc-demo[data-demo="web"] .web-checkout.is-done .web-checkout-label { opacity: 0; transform: scale(0.8); }
.svc-demo[data-demo="web"] .web-checkout.is-done .web-checkout-check { opacity: 1; transform: scale(1); }
.svc-demo[data-demo="web"] .web-check-path { stroke-dasharray: 26; stroke-dashoffset: 26; }
.svc-demo[data-demo="web"] .web-checkout.is-done .web-check-path { animation: web-draw 0.4s var(--ease-out) 0.05s forwards; }
@keyframes web-draw { to { stroke-dashoffset: 0; } }

.svc-demo[data-demo="web"] .web-success { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem; padding: 1rem; text-align: center; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(3px); }
.svc-demo[data-demo="web"] .web-success[hidden] { display: none; }
.svc-demo[data-demo="web"] .web-success.is-in { animation: web-fade 0.3s var(--ease-out); }
@keyframes web-fade { from { opacity: 0; } to { opacity: 1; } }
.svc-demo[data-demo="web"] .web-success-check { position: relative; color: var(--web-c2); display: inline-flex; }
.svc-demo[data-demo="web"] .web-succ-ring { stroke-dasharray: 64; stroke-dashoffset: 64; }
.svc-demo[data-demo="web"] .web-succ-path { stroke-dasharray: 22; stroke-dashoffset: 22; }
.svc-demo[data-demo="web"] .web-success.is-in .web-succ-ring { animation: web-draw 0.5s var(--ease-out) forwards; }
.svc-demo[data-demo="web"] .web-success.is-in .web-succ-path { animation: web-draw 0.4s var(--ease-out) 0.4s forwards; }
.svc-demo[data-demo="web"] .web-success-burst { position: absolute; top: 38%; left: 50%; width: 4px; height: 4px; }
.svc-demo[data-demo="web"] .web-success-title { font-family: var(--font-display); font-size: 1.05rem; color: var(--ink); margin-top: 0.2rem; }
.svc-demo[data-demo="web"] .web-success-sub { font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.svc-demo[data-demo="web"] .web-success-again { margin-top: 0.5rem; padding: 0.5rem 1rem; border-radius: var(--r-pill); border: 1px solid var(--accent); background: transparent; color: var(--accent); font: 600 0.8rem/1 var(--font-body); cursor: pointer; transition: background 0.16s ease, color 0.16s ease; }
.svc-demo[data-demo="web"] .web-success-again:hover { background: var(--accent); color: var(--accent-ink); }

.svc-demo[data-demo="web"] .web-confetti { position: absolute; top: 0; left: 0; width: 7px; height: 9px; border-radius: 2px; pointer-events: none; z-index: 5; will-change: transform, opacity; }

.svc-demo[data-demo="web"] .web-intro { opacity: 0; transform: translateY(8px); }
.svc-demo[data-demo="web"] .web-intro.is-in { opacity: 1; transform: none; transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out); }

@media (max-width: 720px) {
  .svc-demo[data-demo="web"] .web-grid { grid-template-columns: 1fr; }
  .svc-demo[data-demo="web"] .web-products { grid-template-columns: repeat(2, 1fr); }
  .svc-demo[data-demo="web"] .web-cart-items { max-height: 170px; }
}

@media (prefers-reduced-motion: reduce) {
  .svc-demo[data-demo="web"] .web-live i { animation: none; }
  .svc-demo[data-demo="web"] .web-add.is-pop { animation: none; }
  .svc-demo[data-demo="web"] .web-line.is-enter { animation: none; }
  .svc-demo[data-demo="web"] .web-card:hover { transform: none; }
  .svc-demo[data-demo="web"] .web-card:hover .web-card-art { transform: none; }
  .svc-demo[data-demo="web"] .web-check-path, .svc-demo[data-demo="web"] .web-succ-ring, .svc-demo[data-demo="web"] .web-succ-path { animation: none !important; stroke-dashoffset: 0; }
  .svc-demo[data-demo="web"] .web-success.is-in { animation: none; }
  .svc-demo[data-demo="web"] .web-intro, .svc-demo[data-demo="web"] .web-intro.is-in { transition: none; transform: none; opacity: 1; }
}

/* ===================== demo: training ===================== */
.svc-demo[data-demo="training"] { display: flex; flex-direction: column; }

.svc-demo[data-demo="training"] .tr-bar { align-items: center; }
.svc-demo[data-demo="training"] .tr-title { font: 600 0.86rem/1.2 var(--font-display); color: var(--ink); }
.svc-demo[data-demo="training"] .tr-spacer { flex: 1 1 auto; }
.svc-demo[data-demo="training"] .tr-counter { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.03em; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- Barra de progreso ---- */
.svc-demo[data-demo="training"] .tr-progress { position: relative; height: 5px; background: var(--surface); border-bottom: 1px solid var(--line); overflow: hidden; }
.svc-demo[data-demo="training"] .tr-progress-fill { position: absolute; inset: 0 auto 0 0; width: 0%; border-radius: 0 var(--r-pill) var(--r-pill) 0; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 78%, #7ea2ff), var(--accent)); box-shadow: 0 0 14px var(--accent-glow); transition: width 0.6s var(--ease-out); }

/* ---- Cuerpo / escenarios ---- */
.svc-demo[data-demo="training"] .tr-body { position: relative; min-height: 408px; display: flex; }
.svc-demo[data-demo="training"] .tr-stage { width: 100%; }
.svc-demo[data-demo="training"] .tr-stage[hidden] { display: none; }

/* ---- Aparicion inicial ---- */
.svc-demo[data-demo="training"] .tr-enter { opacity: 0; transform: translateY(10px); }
.svc-demo[data-demo="training"] .tr-in { opacity: 1; transform: none; transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out); }

/* ---- Pregunta ---- */
.svc-demo[data-demo="training"] .tr-q-kicker { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.45rem; }
.svc-demo[data-demo="training"] .tr-question { font: 600 clamp(1.05rem, 2.1vw, 1.4rem)/1.3 var(--font-display); color: var(--ink); margin-bottom: 1rem; max-width: 60ch; }

/* ---- Opciones ---- */
.svc-demo[data-demo="training"] .tr-options { display: grid; gap: 0.6rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .svc-demo[data-demo="training"] .tr-options { grid-template-columns: 1fr; } }
.svc-demo[data-demo="training"] .tr-opt {
  display: flex; align-items: center; gap: 0.7rem; width: 100%; text-align: left;
  padding: 0.85rem 0.95rem; border-radius: var(--r); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font: 500 0.92rem/1.3 var(--font-body);
  cursor: pointer; transition: transform 0.16s var(--ease-out), border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}
.svc-demo[data-demo="training"] .tr-opt:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.svc-demo[data-demo="training"] .tr-opt:disabled { cursor: default; }
.svc-demo[data-demo="training"] .tr-opt-key {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  font: 700 0.78rem/1 var(--font-mono); color: var(--muted); background: var(--surface-2); border: 1px solid var(--line);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.svc-demo[data-demo="training"] .tr-opt-label { flex: 1 1 auto; }
.svc-demo[data-demo="training"] .tr-opt-mark { flex: 0 0 auto; width: 18px; height: 18px; opacity: 0; transform: scale(0.5); transition: opacity 0.22s var(--ease-out), transform 0.22s var(--ease-out); }
.svc-demo[data-demo="training"] .tr-opt-mark svg { width: 18px; height: 18px; }

/* Estados de respuesta */
.svc-demo[data-demo="training"] .tr-opt.is-correct {
  border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, var(--surface)); color: var(--ink);
}
.svc-demo[data-demo="training"] .tr-opt.is-correct .tr-opt-key { background: var(--ok); color: #fff; border-color: var(--ok); }
.svc-demo[data-demo="training"] .tr-opt.is-correct .tr-opt-mark { opacity: 1; transform: scale(1); color: var(--ok); }
.svc-demo[data-demo="training"] .tr-opt.is-wrong {
  border-color: var(--err); background: color-mix(in srgb, var(--err) 12%, var(--surface)); color: var(--ink);
  animation: tr-shake 0.4s var(--ease-out);
}
.svc-demo[data-demo="training"] .tr-opt.is-wrong .tr-opt-key { background: var(--err); color: #fff; border-color: var(--err); }
.svc-demo[data-demo="training"] .tr-opt.is-wrong .tr-opt-mark { opacity: 1; transform: scale(1); color: var(--err); }
.svc-demo[data-demo="training"] .tr-opt.is-dim { opacity: 0.5; }

@keyframes tr-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* ---- Feedback / explicacion ---- */
.svc-demo[data-demo="training"] .tr-feedback {
  display: flex; gap: 0.7rem; align-items: flex-start; margin-top: 1rem;
  padding: 0.85rem 1rem; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--surface); overflow: hidden;
}
.svc-demo[data-demo="training"] .tr-feedback[hidden] { display: none; }
.svc-demo[data-demo="training"] .tr-feedback.is-ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); background: color-mix(in srgb, var(--ok) 9%, var(--surface)); }
.svc-demo[data-demo="training"] .tr-feedback.is-bad { border-color: color-mix(in srgb, var(--err) 45%, var(--line)); background: color-mix(in srgb, var(--err) 9%, var(--surface)); }
.svc-demo[data-demo="training"] .tr-fb-icon { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.svc-demo[data-demo="training"] .tr-feedback.is-ok .tr-fb-icon { background: var(--ok); }
.svc-demo[data-demo="training"] .tr-feedback.is-bad .tr-fb-icon { background: var(--err); }
.svc-demo[data-demo="training"] .tr-fb-icon svg { width: 17px; height: 17px; }
.svc-demo[data-demo="training"] .tr-fb-text b { display: block; font: 700 0.9rem/1.2 var(--font-display); color: var(--ink); margin-bottom: 0.15rem; }
.svc-demo[data-demo="training"] .tr-fb-text p { font-size: 0.85rem; line-height: 1.45; color: var(--muted); margin: 0; }

/* ---- Acciones quiz ---- */
.svc-demo[data-demo="training"] .tr-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; margin-top: 1.1rem; }
.svc-demo[data-demo="training"] .tr-score-live { font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.svc-demo[data-demo="training"] .tr-next {
  display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.6rem 1.1rem; border-radius: var(--r-pill);
  font: 600 0.86rem/1 var(--font-body); color: var(--accent-ink); background: var(--accent);
  border: 1px solid var(--accent); transition: background 0.18s ease, transform 0.16s var(--ease-out), opacity 0.18s ease, filter 0.18s ease;
}
.svc-demo[data-demo="training"] .tr-next:hover:not(:disabled) { background: var(--accent-press); transform: translateY(-2px); }
.svc-demo[data-demo="training"] .tr-next:active:not(:disabled) { transform: translateY(0); }
.svc-demo[data-demo="training"] .tr-next:disabled { opacity: 0.4; cursor: not-allowed; filter: grayscale(0.3); }
.svc-demo[data-demo="training"] .tr-next svg { transition: transform 0.18s var(--ease-out); }
.svc-demo[data-demo="training"] .tr-next:hover:not(:disabled) svg { transform: translateX(3px); }

/* ---- Resultado ---- */
.svc-demo[data-demo="training"] .tr-result { display: flex; gap: clamp(1.2rem, 4vw, 2.4rem); align-items: center; flex-wrap: wrap; justify-content: center; }
.svc-demo[data-demo="training"] .tr-ring-wrap { position: relative; flex: 0 0 auto; width: 132px; height: 132px; display: grid; place-items: center; }
.svc-demo[data-demo="training"] .tr-ring { transform: rotate(0deg); }
.svc-demo[data-demo="training"] .tr-ring-track { stroke: var(--line-strong); }
.svc-demo[data-demo="training"] .tr-ring-bar { stroke: var(--accent); stroke-dasharray: 326.7; stroke-dashoffset: 326.7; filter: drop-shadow(0 0 6px var(--accent-glow)); transition: stroke-dashoffset 1.1s var(--ease-out); }
.svc-demo[data-demo="training"] .tr-ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.svc-demo[data-demo="training"] .tr-ring-center b { font: 700 1.7rem/1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.svc-demo[data-demo="training"] .tr-ring-center span { display: block; font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); margin-top: 0.2rem; font-variant-numeric: tabular-nums; }
.svc-demo[data-demo="training"] .tr-result-copy { flex: 1 1 320px; min-width: 0; }
.svc-demo[data-demo="training"] .tr-result-kicker { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.3rem; }
.svc-demo[data-demo="training"] .tr-result-title { font: 700 clamp(1.3rem, 2.6vw, 1.7rem)/1.15 var(--font-display); color: var(--ink); }
.svc-demo[data-demo="training"] .tr-result-sub { font-size: 0.92rem; line-height: 1.5; color: var(--muted); margin: 0.4rem 0 1rem; max-width: 48ch; }
.svc-demo[data-demo="training"] .tr-result-kpis { margin-bottom: 1.1rem; }
.svc-demo[data-demo="training"] .tr-result-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.svc-demo[data-demo="training"] .tr-cta-primary { padding: 0.7rem 1.25rem; }
.svc-demo[data-demo="training"] .tr-restart {
  display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.7rem 1.1rem; border-radius: var(--r-pill);
  font: 600 0.86rem/1 var(--font-body); color: var(--text); background: var(--surface); border: 1px solid var(--line-strong);
  transition: border-color 0.18s ease, color 0.18s ease, transform 0.16s var(--ease-out);
}
.svc-demo[data-demo="training"] .tr-restart:hover { border-color: var(--accent); color: var(--ink); transform: translateY(-2px); }
.svc-demo[data-demo="training"] .tr-restart svg { transition: transform 0.4s var(--ease-out); }
.svc-demo[data-demo="training"] .tr-restart:hover svg { transform: rotate(-180deg); }

/* ---- KPI delta colorways ---- */
.svc-demo[data-demo="training"] .tr-result-kpis .svc-demo-kpi em.is-ok { color: var(--ok); }

@media (max-width: 720px) {
  .svc-demo[data-demo="training"] .tr-title { display: none; }
  .svc-demo[data-demo="training"] .tr-body { min-height: 0; }
  .svc-demo[data-demo="training"] .tr-result { flex-direction: column; text-align: center; }
  .svc-demo[data-demo="training"] .tr-result-actions { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .svc-demo[data-demo="training"] .tr-progress-fill,
  .svc-demo[data-demo="training"] .tr-opt,
  .svc-demo[data-demo="training"] .tr-opt-mark,
  .svc-demo[data-demo="training"] .tr-next,
  .svc-demo[data-demo="training"] .tr-next svg,
  .svc-demo[data-demo="training"] .tr-restart svg,
  .svc-demo[data-demo="training"] .tr-ring-bar,
  .svc-demo[data-demo="training"] .tr-in { transition: none; }
  .svc-demo[data-demo="training"] .tr-opt.is-wrong { animation: none; }
  .svc-demo[data-demo="training"] .tr-enter { opacity: 1; transform: none; }
}
