.tss-demo-scrim {
  position: fixed;
  inset: 0;
  z-index: 9988;
  pointer-events: none;
  background: rgba(4, 8, 10, 0.34);
}

.tss-demo-highlight {
  position: relative;
  z-index: 9990 !important;
  border-radius: 10px;
  outline: 3px solid rgba(43, 214, 123, 0.95) !important;
  outline-offset: 7px !important;
  box-shadow:
    0 0 0 7px rgba(43, 214, 123, 0.14),
    0 18px 50px rgba(0, 0, 0, 0.28) !important;
  scroll-margin-top: 90px;
  scroll-margin-bottom: 46vh;
}

.tss-demo-panel {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 10000;
  width: min(380px, calc(100vw - 28px));
  max-height: min(560px, calc(100vh - 34px));
  display: grid;
  gap: 10px;
  overflow: auto;
  border: 1px solid rgba(43, 214, 123, 0.34);
  border-radius: 8px;
  padding: 14px;
  background: rgba(10, 17, 20, 0.96);
  color: #f8fbfa;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
  font-family: Aptos, Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tss-demo-panel * {
  box-sizing: border-box;
}

.tss-demo-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tss-demo-kicker {
  color: #77f2aa;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tss-demo-counter {
  min-width: fit-content;
  color: #b9d8ce;
  font-size: 0.78rem;
  font-weight: 900;
}

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

.tss-demo-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2bd67b, #35b9ff);
  transition: width 180ms ease;
}

.tss-demo-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.tss-demo-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(43, 214, 123, 0.26);
  border-radius: 8px;
  background: rgba(43, 214, 123, 0.1);
  color: #8ff4b8;
}

.tss-demo-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tss-demo-title {
  margin: 0;
  color: #ffffff;
  font-size: 1.05rem;
  line-height: 1.18;
  letter-spacing: 0;
}

.tss-demo-description,
.tss-demo-benefit,
.tss-demo-detail,
.tss-demo-next,
.tss-demo-target-note,
.tss-demo-paused {
  margin: 0;
  color: #d3e4e1;
  font-size: 0.9rem;
  line-height: 1.35;
}

.tss-demo-benefit {
  border-left: 3px solid #2bd67b;
  padding-left: 9px;
  color: #ecfff5;
  font-weight: 850;
}

.tss-demo-detail,
.tss-demo-next,
.tss-demo-target-note,
.tss-demo-paused,
.tss-demo-route-note,
.tss-demo-simulation {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.06);
}

.tss-demo-detail {
  color: #b9d8ce;
}

.tss-demo-route-note {
  display: grid;
  gap: 8px;
  color: #d3e4e1;
  font-size: 0.88rem;
  line-height: 1.3;
}

.tss-demo-next strong {
  color: #ffffff;
}

.tss-demo-simulation {
  display: grid;
  gap: 8px;
  border-color: rgba(43, 214, 123, 0.24);
  background: rgba(43, 214, 123, 0.08);
}

.tss-demo-sim-title {
  margin: 0;
  color: #8ff4b8;
  font-size: 0.86rem;
  font-weight: 900;
}

.tss-demo-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tss-demo-chip,
.tss-demo-sim-action {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(43, 214, 123, 0.26);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(43, 214, 123, 0.1);
  color: #dcffe9;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
}

.tss-demo-sim-action {
  cursor: pointer;
}

.tss-demo-sim-note {
  min-height: 18px;
  margin: 0;
  color: #bdeaff;
  font-size: 0.82rem;
  font-weight: 800;
}

.tss-demo-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 7px;
}

.tss-demo-button,
.tss-demo-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fbfa;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.tss-demo-button.primary,
.tss-demo-link.primary {
  border-color: rgba(43, 214, 123, 0.45);
  background: #2bd67b;
  color: #06110d;
}

.tss-demo-button.ghost {
  color: #d4e2df;
}

.tss-demo-button.compact {
  min-height: 34px;
  font-size: 0.78rem;
}

.tss-demo-button.is-active {
  border-color: rgba(53, 185, 255, 0.5);
  background: rgba(53, 185, 255, 0.16);
  color: #dff5ff;
}

.tss-demo-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.tss-demo-sim-action:focus-visible,
.tss-demo-button:focus-visible,
.tss-demo-link:focus-visible {
  outline: 3px solid rgba(53, 185, 255, 0.42);
  outline-offset: 2px;
}

.tss-demo-hidden {
  display: none !important;
}

@media (max-width: 760px) {
  .tss-demo-scrim {
    background: rgba(4, 8, 10, 0.22);
  }

  .tss-demo-highlight {
    outline-offset: 5px !important;
  }

  .tss-demo-panel {
    top: auto !important;
    right: max(10px, env(safe-area-inset-right)) !important;
    bottom: max(10px, env(safe-area-inset-bottom)) !important;
    left: max(10px, env(safe-area-inset-left)) !important;
    width: auto;
    max-height: min(45vh, 390px);
    gap: 8px;
    padding: 12px;
    border-radius: 8px;
  }

  .tss-demo-head {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 9px;
  }

  .tss-demo-icon {
    width: 36px;
    height: 36px;
  }

  .tss-demo-icon svg {
    width: 22px;
    height: 22px;
  }

  .tss-demo-title {
    font-size: 0.98rem;
  }

  .tss-demo-description,
  .tss-demo-benefit,
  .tss-demo-next,
  .tss-demo-target-note,
  .tss-demo-route-note {
    font-size: 0.82rem;
  }

  .tss-demo-detail,
  .tss-demo-paused {
    display: none;
  }

  .tss-demo-next {
    padding: 0;
    border: 0;
    background: transparent;
    color: #b9d8ce;
  }

  .tss-demo-actions {
    grid-template-columns: 0.8fr 1fr 0.8fr;
    gap: 6px;
  }

  .tss-demo-button {
    min-height: 40px;
    padding-inline: 8px;
    font-size: 0.82rem;
  }

  .tss-demo-button.compact {
    min-height: 32px;
  }
}

@media (max-width: 420px) {
  .tss-demo-panel {
    max-height: min(43vh, 360px);
  }

  .tss-demo-simulation,
  .tss-demo-route-note,
  .tss-demo-target-note {
    padding: 8px;
  }

  .tss-demo-chip,
  .tss-demo-sim-action {
    min-height: 28px;
    padding: 4px 8px;
    font-size: 0.74rem;
  }
}
