/* ============================================================
   LaunchStack OS: the demo kit (moved from book.css unchanged).
   Shared look for every demo. Lives beside os.css; the stage is
   the .lsb-stage hook here, with the box rules in os.css.
   ============================================================ */
   DEMO KIT (lsk-) — shared parts for demos, so 18 demos read as one set.
   Demos may use these freely, and add their own lsd-<id>- classes.
   All sizes are px on purpose: the stage is a fixed-height drawing
   (380px tall, 360px on tablets and phones, roughly 280–480px wide).
   ============================================================ */
.lsb-stage {
  --lsk-ink: #0f172a; --lsk-sub: #475569; --lsk-mute: #94a3b8; --lsk-line: rgba(15, 23, 42, 0.1);
  --lsk-orange: var(--accent-orange); --lsk-orange-ink: #c2410c;
  --lsk-green: var(--accent-green); --lsk-green-ink: #047857;
  --lsk-red-ink: #b91c1c; --lsk-cust: var(--accent-violet); --lsk-blue: var(--accent-blue);
  --lsk-ease: cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--font-body); font-size: 12px; line-height: 1.4; color: var(--lsk-ink);
}
.lsk-label {
  font-family: var(--font-mono); font-size: 9px; font-weight: 600; line-height: 1.3;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--lsk-mute);
}
/* Phone */
.lsk-phone {
  position: relative; display: flex; flex-direction: column; min-height: 0;
  background: #fff; border: 1.5px solid var(--lsk-ink); border-radius: 26px; padding: 8px 8px 10px;
  box-shadow: 0 22px 40px -26px rgba(15, 23, 42, 0.55), inset 0 0 0 3px #fff, inset 0 0 0 4px rgba(15, 23, 42, 0.06);
}
.lsk-phone__notch { width: 38%; height: 13px; margin: -8px auto 4px; border-radius: 0 0 9px 9px; background: var(--lsk-ink); flex-shrink: 0; }
.lsk-phone__bar {
  display: flex; justify-content: space-between; align-items: center; flex-shrink: 0;
  padding: 0 8px 5px; font-family: var(--font-mono); font-size: 9px; font-weight: 600; color: var(--lsk-sub);
}
.lsk-phone__head {
  display: flex; align-items: center; gap: 7px; flex-shrink: 0;
  padding: 2px 6px 7px; border-bottom: 1px solid var(--lsk-line);
}
.lsk-avatar {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 10px; font-weight: 600; color: #fff; background: var(--lsk-orange);
}
.lsk-phone__who { min-width: 0; font-family: var(--font-display); font-size: 11px; font-weight: 600; line-height: 1.15; }
.lsk-phone__who small { display: block; font-family: var(--font-mono); font-size: 8px; font-weight: 500; color: var(--lsk-mute); letter-spacing: 0.06em; }
.lsk-phone__screen {
  flex: 1; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 8px 3px 2px;
}
/* SMS bubbles: --in is from the business, --out is the customer's reply */
.lsk-msg {
  max-width: 88%; padding: 7px 10px; border-radius: 13px; font-size: 11.5px; line-height: 1.38;
  animation: lskPop 0.4s var(--lsk-ease) both; overflow-wrap: anywhere;
}
.lsk-msg--in { align-self: flex-start; background: #f1f5f9; color: var(--lsk-ink); border-bottom-left-radius: 4px; }
.lsk-msg--out { align-self: flex-end; background: var(--lsk-cust); color: #fff; border-bottom-right-radius: 4px; }
.lsk-msg__meta { display: block; margin-top: 3px; font-family: var(--font-mono); font-size: 8px; opacity: 0.65; letter-spacing: 0.04em; }
.lsk-link { color: var(--lsk-blue); text-decoration: underline; text-underline-offset: 2px; font-weight: 500; }
.lsk-msg--out .lsk-link { color: #fff; }
.lsk-typing { display: inline-flex; gap: 3px; align-self: flex-start; padding: 9px 11px; border-radius: 13px; background: #f1f5f9; animation: lskPop 0.3s var(--lsk-ease) both; }
.lsk-typing--out { align-self: flex-end; background: rgba(124, 58, 237, 0.14); }
.lsk-typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--lsk-mute); animation: lskDot 1s infinite ease-in-out; }
.lsk-typing i:nth-child(2) { animation-delay: 0.15s; }
.lsk-typing i:nth-child(3) { animation-delay: 0.3s; }
.lsk-quick { display: flex; gap: 5px; justify-content: flex-end; flex-shrink: 0; padding-top: 6px; }
.lsk-quick span, .lsk-quick button {
  font: 600 10px/1 var(--font-mono); padding: 6px 9px; border-radius: 100px; cursor: pointer;
  border: 1px solid rgba(124, 58, 237, 0.35); color: var(--lsk-cust); background: #fff;
}
/* Cards, rows and chips */
.lsk-card {
  position: relative; background: #fff; border: 1px solid var(--lsk-line); border-radius: 10px;
  box-shadow: 0 10px 26px -18px rgba(15, 23, 42, 0.4); padding: 10px;
}
.lsk-card__head { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 8px; }
.lsk-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 7px; border-radius: 7px;
  transition: background 0.4s ease, opacity 0.4s ease, transform 0.5s var(--lsk-ease);
}
.lsk-row + .lsk-row { margin-top: 3px; }
.lsk-row__main { flex: 1; min-width: 0; }
.lsk-row__main b { display: block; font-weight: 600; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lsk-row__main small { display: block; font-size: 10px; color: var(--lsk-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lsk-time { flex-shrink: 0; width: 38px; font-family: var(--font-mono); font-size: 10px; font-weight: 600; color: var(--lsk-mute); }
.lsk-chip {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; white-space: nowrap;
  font-family: var(--font-mono); font-size: 8.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 100px; background: rgba(15, 23, 42, 0.06); color: var(--lsk-sub);
  transition: background 0.35s ease, color 0.35s ease;
}
.lsk-chip--wait { background: rgba(255, 107, 0, 0.12); color: var(--lsk-orange-ink); }
.lsk-chip--ok { background: rgba(16, 185, 129, 0.14); color: var(--lsk-green-ink); }
.lsk-chip--bad { background: rgba(239, 68, 68, 0.1); color: var(--lsk-red-ink); }
.lsk-chip--info { background: rgba(0, 98, 255, 0.1); color: var(--lsk-blue); }
.lsk-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  font-family: var(--font-display); font-size: 11px; font-weight: 600; color: #fff;
  background: var(--lsk-orange); border: 0; border-radius: 8px; padding: 7px 12px;
}
/* Motion helpers */
.lsk-in { animation: lskPop 0.45s var(--lsk-ease) both; }
.lsk-flash { animation: lskFlash 1.2s ease both; }
.lsk-tap {
  position: absolute; z-index: 20; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%;
  border: 2px solid var(--lsk-orange); background: rgba(255, 107, 0, 0.2); pointer-events: none;
  animation: lskTap 0.8s ease-out both;
}
@keyframes lskPop { from { opacity: 0; transform: translateY(6px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes lskDot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-3px); opacity: 1; } }
@keyframes lskFlash { 0% { box-shadow: 0 0 0 0 rgba(255, 107, 0, 0.55); } 70% { box-shadow: 0 0 0 8px rgba(255, 107, 0, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 107, 0, 0); } }
@keyframes lskTap { 0% { transform: scale(0.4); opacity: 0; } 25% { opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }

/* Engine states. Paused freezes CSS animations; instant / reduced skip motion. */
.lsb-stage.is-paused *, .lsb-stage.is-paused *::before, .lsb-stage.is-paused *::after { animation-play-state: paused !important; }
.lsb-stage.lsd-instant *, .lsb-stage.lsd-instant *::before, .lsb-stage.lsd-instant *::after,
.lsb-stage.lsd-reduced *, .lsb-stage.lsd-reduced *::before, .lsb-stage.lsd-reduced *::after {
  transition-duration: 0s !important; transition-delay: 0s !important;
  animation-duration: 0s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
}

/* NOTE: the light .lsb-stage token rule above is dead (the comment at the top swallows its selector), so the --lsk-* tokens exist only in dark mode. Demo CSS therefore gives every --lsk-* var() a light fallback. Do not "fix" the comment: it would change light mode. */
/* ===== Dark mode ===== */
:root[data-theme="dark"] .lsb-stage{
  --lsk-ink:#d5dbe6; --lsk-sub:#b0b8c5; --lsk-mute:#aab2c0; --lsk-line:rgba(190,210,255,.20); --lsk-rgb:213,219,230;
  --lsk-orange:#bf520a; --lsk-orange-ink:#f39d5e; --lsk-green:#0b7a52; --lsk-green-ink:#6bcf9d; --lsk-red-ink:#ea8885;
  --lsk-cust:#6a3fd2; --lsk-cust-ink:#b09bee; --lsk-blue:#1a5cdf; --lsk-blue-ink:#81aaf7;
  --lsk-surface:#364258; --lsk-surface-2:#44506a;
  --lsk-toast:#0d1627; --lsk-toast-a:rgba(13,22,39,.96);
  --lsk-star-off:#586784; --lsk-btn-off:#586784;
}
:root[data-theme="dark"] .lsk-phone{background:var(--lsk-surface);border-color:var(--dk-edge-hi);box-shadow:inset 0 0 0 3px var(--lsk-surface),inset 0 0 0 4px rgba(190,210,255,.14)}
:root[data-theme="dark"] .lsk-phone__notch{background:var(--stage-bot)}
:root[data-theme="dark"] .lsk-msg--in,:root[data-theme="dark"] .lsk-typing{background:var(--lsk-surface-2)}
:root[data-theme="dark"] .lsk-typing--out{background:rgba(176,155,238,.24)}
:root[data-theme="dark"] .lsk-quick span,:root[data-theme="dark"] .lsk-quick button{background:var(--lsk-surface);color:var(--lsk-cust-ink);border-color:rgba(176,155,238,.45)}
:root[data-theme="dark"] .lsk-link{color:var(--lsk-blue-ink)}
:root[data-theme="dark"] .lsk-msg--out .lsk-link{color:#fff}
:root[data-theme="dark"] .lsk-card{background:var(--lsk-surface);border-color:var(--dk-edge);box-shadow:none}
:root[data-theme="dark"] .lsk-chip{background:rgba(190,210,255,.14)}
:root[data-theme="dark"] .lsk-chip--wait{background:rgba(243,157,94,.16)}
:root[data-theme="dark"] .lsk-chip--ok{background:rgba(107,207,157,.14)}
:root[data-theme="dark"] .lsk-chip--bad{background:rgba(234,136,133,.14)}
:root[data-theme="dark"] .lsk-chip--info{background:rgba(129,170,247,.14);color:var(--lsk-blue-ink)}
/* floating notifications were near-black blocks with an outer shadow: now a named display with a visible edge */
:root[data-theme="dark"] .lsb-stage :is(.lsd-ct-note,.lsd-mc-note,.lsd-ar-push,.lsd-ar-toast,.lsd-ss-note,.lsd-wl-toast,.lsd-job-tracker-banner,.lsd-quote-request-banner){box-shadow:inset 0 0 0 1px var(--dk-line-3)}
