/* SecuredSlots interactive demo. Every selector is scoped to .ss-demo. */
.ss-demo {
  --ss-ground: #0a0a0f;
  --ss-frame: #111118;
  --ss-panel: rgba(255, 255, 255, 0.03);
  --ss-line: rgba(255, 255, 255, 0.07);
  --ss-line-2: rgba(255, 255, 255, 0.1);
  --ss-text: #f2f2f7;
  --ss-muted: #a8a8bd;
  --ss-indigo: #818cf8;
  --ss-indigo-soft: #c7cbff;
  --ss-blurple: #5865f2;
  --ss-ok: #2ecc71;
  --ss-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ss-r: 16px;
  --ss-h: 520px;
  --ss-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  position: relative;
  width: 100%;
  max-width: 560px;
  height: var(--ss-h);
  container-type: inline-size;
  color: var(--ss-text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  text-align: left;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}
.ss-demo *,
.ss-demo *::before,
.ss-demo *::after { box-sizing: border-box; }
.ss-demo ::selection { background: rgba(129, 140, 248, 0.35); color: #fff; }
:where(.ss-demo) p,
:where(.ss-demo) dl,
:where(.ss-demo) dd { margin: 0; }

@media (max-width: 480px) {
  .ss-demo { --ss-h: 480px; }
}

/* Frame */
.ss-demo__frame {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--ss-frame);
  border: 1px solid var(--ss-line);
  border-radius: var(--ss-r);
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.85), 0 2px 8px -2px rgba(0, 0, 0, 0.4);
}
.ss-demo__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 14px;
  border-bottom: 1px solid var(--ss-line);
}
.ss-demo__who {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.ss-demo__tag {
  flex: none;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--ss-blurple);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.5;
}
.ss-demo__av {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ss-blurple);
  color: #fff;
}
.ss-demo__av svg { width: 56%; height: 56%; }
.ss-demo__head .ss-demo__av { width: 26px; height: 26px; }

/* Buttons */
.ss-demo :where(button) {
  font: inherit;
  color: inherit;
  margin: 0;
  -webkit-tap-highlight-color: transparent;
}
.ss-demo button:focus-visible {
  outline: 2px solid var(--ss-indigo);
  outline-offset: 2px;
}
.ss-demo__replay {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 32px;
  padding: 0 12px 0 10px;
  border: 1px solid var(--ss-line-2);
  border-radius: 8px;
  background: transparent;
  color: var(--ss-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.ss-demo__replay svg { transition: transform 0.5s var(--ss-ease); }
.ss-demo__replay:hover { color: var(--ss-text); background: rgba(255, 255, 255, 0.05); }
.ss-demo__replay:hover svg { transform: rotate(-60deg); }
.ss-demo__replay:active { transform: translateY(1px); }

.ss-demo__steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--ss-line);
  background: rgba(255, 255, 255, 0.015);
}
.ss-demo__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  min-width: 0;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ss-muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.ss-demo__step:hover { color: var(--ss-text); background: rgba(255, 255, 255, 0.04); }
.ss-demo__step i {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}
.ss-demo__step.is-done i { background: var(--ss-ok); }
.ss-demo__step[aria-current="step"] {
  color: var(--ss-text);
  background: rgba(129, 140, 248, 0.12);
  border-color: rgba(129, 140, 248, 0.38);
}
.ss-demo__step[aria-current="step"] i {
  background: var(--ss-indigo);
}
.ss-demo__step.is-done[aria-current="step"] i { background: var(--ss-ok); }

/* Thread */
.ss-demo__thread {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 14px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--ss-panel);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 12px);
}
.ss-demo__thread:focus-visible { outline: 2px solid var(--ss-indigo); outline-offset: -4px; border-radius: 0 0 var(--ss-r) var(--ss-r); }
.ss-demo__thread::-webkit-scrollbar { width: 8px; }
.ss-demo__thread::-webkit-scrollbar-track { background: transparent; }
.ss-demo__thread::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border: 2px solid transparent;
  border-radius: 8px;
  background-clip: padding-box;
}
.ss-demo__thread::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.24); }

.ss-demo__intro {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ss-line);
}
.ss-demo__intro .ss-demo__av { width: 44px; height: 44px; }
.ss-demo__intro strong { display: block; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.ss-demo__intro span:not(.ss-demo__av) { font-size: 12.5px; color: var(--ss-muted); }

/* Hidden until revealed by the timeline */
.ss-demo__x:not(.is-in) { display: none !important; }

.ss-demo__msg { display: flex; }
.ss-demo__msg--user { justify-content: flex-end; }
.ss-demo__msg--bot { gap: 10px; align-items: flex-start; }
.ss-demo__body { flex: 1; min-width: 0; }
.ss-demo__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 5px;
  font-size: 12px;
  color: var(--ss-muted);
}
.ss-demo__meta b { color: var(--ss-text); font-size: 13.5px; font-weight: 600; }

.ss-demo__bubble {
  display: inline-flex;
  padding: 5px;
  border-radius: 12px 12px 4px 12px;
  background: rgba(88, 101, 242, 0.14);
  border: 1px solid rgba(88, 101, 242, 0.3);
}
.ss-demo__chip {
  display: inline-flex;
  align-items: center;
  min-width: 20px;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--ss-blurple);
  color: #fff;
  font-family: var(--ss-mono);
  font-size: 13px;
  font-weight: 600;
}
.ss-demo__caret {
  display: inline-block;
  width: 1.5px;
  height: 15px;
  margin-left: 2px;
  background: #fff;
  animation: ss-demo-blink 1s steps(1) infinite;
}
.ss-demo__msg.is-sent .ss-demo__caret { display: none; }

/* Preferences card */
.ss-demo__card {
  padding: 10px 12px 6px;
  border-radius: 12px;
  background: var(--ss-panel);
  border: 1px solid var(--ss-line);
}
.ss-demo__card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 600;
}
.ss-demo__saved {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(46, 204, 113, 0.1);
  border: 1px solid rgba(46, 204, 113, 0.3);
  color: var(--ss-ok);
  font-size: 11.5px;
  font-weight: 600;
}
.ss-demo__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding: 5px 0;
  border-top: 1px solid var(--ss-line);
  font-size: 13px;
}
.ss-demo__row dt { flex: none; color: var(--ss-muted); }
.ss-demo__row dd {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
  text-align: right;
  font-weight: 500;
}
.ss-demo__pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(129, 140, 248, 0.12);
  border: 1px solid rgba(129, 140, 248, 0.32);
  color: var(--ss-indigo-soft);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

/* Monitoring state */
.ss-demo__state {
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--ss-panel);
  border: 1px solid var(--ss-line);
}
.ss-demo__state-t {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}
.ss-demo__state-t svg { color: var(--ss-ok); }
.ss-demo__live {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--ss-muted);
}
.ss-demo__live i {
  position: relative;
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ss-ok);
}
.ss-demo__live i::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--ss-ok);
  animation: ss-demo-pulse 2.2s var(--ss-ease) infinite;
}

/* Time-skip divider */
.ss-demo__divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 -2px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ss-muted);
}
.ss-demo__divider::before,
.ss-demo__divider::after { content: ""; flex: 1; height: 1px; background: var(--ss-line-2); }

/* Booking embed */
.ss-demo__emb {
  max-width: 440px;
  padding: 14px 16px 13px;
  border: 1px solid var(--ss-line);
  border-left: 4px solid var(--ss-ok);
  border-radius: 4px;
  background: #1a1a22;
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.7);
}
.ss-demo__emb-a { margin-bottom: 8px; font-size: 12.5px; font-weight: 600; color: var(--ss-text); }
.ss-demo__msg--land + .ss-demo__msg--land { margin-top: 2px; }
.ss-demo__emb-t {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.ss-demo__ok { flex: none; color: var(--ss-ok); }
.ss-demo__ok path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.ss-demo__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 14px 20px;
}
.ss-demo__f { min-width: 0; }
.ss-demo__f--w { grid-column: 1 / -1; }
.ss-demo__f dt { margin-bottom: 4px; font-size: 12px; font-weight: 600; line-height: 1.2; color: var(--ss-muted); }
.ss-demo__f dd { font-size: 14px; font-weight: 500; line-height: 1.35; font-variant-numeric: tabular-nums; }
.ss-demo__foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--ss-muted);
}
.ss-demo__foot .ss-demo__av { width: 18px; height: 18px; }

/* Reduced-motion step emphasis */
.ss-demo__thread[data-focus] [data-s] { opacity: 0.4; transition: opacity 0.3s var(--ss-ease); }
.ss-demo__thread[data-focus="0"] [data-s="0"],
.ss-demo__thread[data-focus="1"] [data-s="1"],
.ss-demo__thread[data-focus="2"] [data-s="2"] { opacity: 1; }

.ss-demo__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Entrances */
.ss-demo__msg.is-in { animation: ss-demo-rise 0.5s var(--ss-ease) both; }
.ss-demo__msg--user.is-in { transform-origin: 100% 100%; animation-name: ss-demo-send; }
.ss-demo__row.is-in { animation: ss-demo-fill 0.45s var(--ss-ease) both; }
.ss-demo__pill.is-in,
.ss-demo__saved.is-in { animation: ss-demo-pop 0.45s var(--ss-ease) both; }
.ss-demo__saved.is-in path { animation: ss-demo-draw 0.4s var(--ss-ease) 0.15s backwards; }
.ss-demo__saved path { stroke-dasharray: 1; }
.ss-demo__live.is-in { animation: ss-demo-fill 0.5s var(--ss-ease) both; }
.ss-demo__divider.is-in { animation: ss-demo-wipe 0.7s var(--ss-ease) both; }
.ss-demo__divider.is-in span { display: inline-block; animation: ss-demo-rise 0.5s var(--ss-ease) 0.15s backwards; }

/* The climax: the booking lands */
.ss-demo__msg--land.is-in { animation: ss-demo-fade 0.3s var(--ss-ease) both; }
.ss-demo__msg--land.is-in .ss-demo__emb { animation: ss-demo-land 0.7s var(--ss-ease) 0.12s backwards; }
.ss-demo__msg--land.is-in .ss-demo__ok path { animation: ss-demo-draw 0.55s var(--ss-ease) 0.6s backwards; }
.ss-demo__msg--land.is-in .ss-demo__f,
.ss-demo__msg--land.is-in .ss-demo__foot {
  animation: ss-demo-rise 0.6s var(--ss-ease) backwards;
  animation-delay: calc(0.5s + var(--i, 0) * 80ms);
}

/* Revealed instantly (jumps, reduced motion) */
.ss-demo .is-now,
.ss-demo .is-now * { animation: none !important; }

@keyframes ss-demo-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes ss-demo-send { from { opacity: 0; transform: translateY(6px) scale(0.96); } }
@keyframes ss-demo-fill { from { opacity: 0; transform: translateY(4px); } }
@keyframes ss-demo-fade { from { opacity: 0; } }
@keyframes ss-demo-pop {
  0% { opacity: 0; transform: scale(0.6); }
  60% { opacity: 1; transform: scale(1.06); }
  100% { transform: scale(1); }
}
@keyframes ss-demo-draw { from { stroke-dashoffset: 1; } }
@keyframes ss-demo-wipe { from { opacity: 0; clip-path: inset(0 50% 0 50%); } to { clip-path: inset(0 0 0 0); } }
@keyframes ss-demo-land {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
    filter: blur(8px);
    clip-path: inset(0 0 100% 0 round 4px 12px 12px 4px);
  }
  55% { opacity: 1; }
  100% {
    opacity: 1;
    transform: none;
    filter: blur(0);
    clip-path: inset(0 0 0 0 round 4px 12px 12px 4px);
  }
}
@keyframes ss-demo-pulse {
  0% { opacity: 0.55; transform: scale(1); }
  100% { opacity: 0; transform: scale(2.8); }
}
@keyframes ss-demo-blink { 50% { opacity: 0; } }

/* Narrow containers (360px phones) */
@container (max-width: 400px) {
  .ss-demo__thread { padding: 14px 12px 18px; gap: 12px; }
  .ss-demo__msg--bot { gap: 8px; }
  .ss-demo__av { width: 28px; height: 28px; }
  .ss-demo__steps { padding: 8px; gap: 3px; }
  .ss-demo__step { gap: 5px; font-size: 12.5px; }
  .ss-demo__card { padding: 9px 10px 5px; }
  .ss-demo__emb { padding: 12px 13px 11px; }
  .ss-demo__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 14px; }
  .ss-demo__grid .ss-demo__f:nth-child(n+3) { grid-column: 1 / -1; }
  .ss-demo__f dd { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .ss-demo *,
  .ss-demo *::before,
  .ss-demo *::after { animation: none !important; transition: none !important; }
}
