.guide {
  max-width: 940px;
  margin-inline: auto;
  margin-block: clamp(48px, 7vw, 80px);
  scroll-margin-top: 24px;
}

.guide [hidden] { display: none; }

.guide-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}

.guide-heading h2 {
  font-size: clamp(1.7rem, 3.1vw, 2.45rem);
  line-height: 1.15;
  letter-spacing: -0.045em;
}

.guide-heading select {
  appearance: none;
  min-height: 44px;
  max-width: 100%;
  padding: 8px 36px 8px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background-color: var(--surface);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-repeat: no-repeat;
  background-size: 5px 5px;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}

.guide-player {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
}

.tour-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 4vw, 46px);
  padding: clamp(14px, 3.6vw, 35px);
}

.guide-player:not(.is-ready) .tour-step + .tour-step { border-top: 1px solid var(--border); }

.tour-copy h3 {
  margin: 10px 0 12px;
  font-size: clamp(1.55rem, 3.1vw, 2.45rem);
  line-height: 1.12;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.tour-copy p:not(.tour-label) { max-width: 45ch; color: var(--muted); }
.tour-label { color: var(--accent); font-size: 0.88rem; font-weight: 750; }

.tour-demo {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  min-height: 316px;
  padding: 11px;
  overflow: hidden;
  border: 1px solid #3a5549;
  border-radius: 17px;
  background: #101d18;
  font-size: 0.88rem;
  line-height: 1.33;
}

.demo-header, .demo-row, .demo-composer {
  display: flex;
  align-items: center;
  gap: 9px;
}

.demo-header {
  min-height: 51px;
  padding: 8px;
  border-radius: 12px;
  background: #233b31;
}

.demo-header small, .demo-card small, .demo-message small { display: block; color: var(--muted); font-size: 0.76rem; }
.demo-header strong { font-size: 0.94rem; }

.demo-avatar {
  display: grid;
  flex: 0 0 33px;
  place-items: center;
  width: 33px;
  height: 33px;
  overflow: hidden;
  border-radius: 50%;
  background: #305446;
  color: #a4eccf;
  font-weight: 800;
}

.demo-logo { border-radius: 9px; }
.demo-note { align-self: center; padding: 5px 9px; border: 1px solid var(--border); border-radius: 20px; color: var(--muted); font-size: 0.73rem; }
.demo-chat-stream { display: grid; align-content: end; justify-items: start; gap: 9px; flex: 1; }
.demo-bubble { display: inline-block; padding: 8px 10px; border-radius: 11px; background: #273b33; }
.demo-message.mine { justify-self: end; text-align: right; }
.demo-message.mine .demo-bubble { background: #1c5848; }
.demo-message small { margin-top: 3px; }
.demo-composer { justify-content: space-between; margin-top: auto; padding: 7px 10px; border: 1px solid var(--border); border-radius: 20px; color: var(--muted); }
.demo-composer b, .reply-glyph { color: var(--accent); font-size: 1.15rem; }
.demo-send { color: var(--accent); }
.demo-card { padding: 11px; border: 1px solid #314b40; border-radius: 12px; background: #1a2c25; }
.demo-card > strong, .demo-header strong { display: block; }
.demo-row > :first-child { min-width: 0; }
.demo-row > :last-child { margin-left: auto; }
.demo-row > .demo-avatar { margin-inline-end: 0; }
.demo-row:has(> .demo-avatar) > :last-child { margin-left: 0; }
.demo-tag { padding: 4px 7px; border-radius: 9px; background: #2f5748; color: #b6f0d7; white-space: nowrap; font-size: 0.73rem; }
.demo-muted { margin-top: 4px; color: var(--muted); }
.demo-input { display: flex; justify-content: space-between; gap: 8px; margin-top: 7px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; }
.demo-input span:last-child, .selected-demo b { color: var(--accent); }
.selected-demo { border-color: #609482; }
.demo-member-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.demo-member-list span { padding: 4px 8px; border-radius: 20px; background: #2b463a; color: #d7eee4; font-size: 0.76rem; }
.demo-code { color: var(--accent); white-space: nowrap; }
.demo-action-row { display: flex; gap: 7px; margin-top: 12px; }
.demo-action-row > * { flex: 1; padding: 7px; border: 1px solid #416054; border-radius: 9px; text-align: center; }
.demo-action-row strong { background: var(--accent); color: var(--on-accent); }
.demo-swipe { display: flex; align-items: center; gap: 10px; }
.tour-step.is-playing .demo-swipe > .demo-bubble { animation: swipe-message 650ms 550ms ease both; }
.poll-demo > .demo-row { margin-top: 9px; }
.vote-track { height: 4px; margin-block: 4px 9px; overflow: hidden; border-radius: 4px; background: #2e463b; }
.vote-fill { display: block; width: 72%; height: 100%; background: var(--accent); transform-origin: left center; }
.shorter .vote-fill { width: 28%; }
.tour-step.is-playing .vote-fill { animation: fill-track 600ms 1300ms ease-out both; }
.status-track { height: 4px; margin-block: 1px; border-radius: 4px; background: #3a564a; }
.status-track span { display: block; width: 65%; height: 100%; margin-inline: auto; border-radius: 4px; background: #baf1d9; }
.tour-step.is-playing .status-track span { animation: fill-track 3.6s linear both; }
.status-picture { position: relative; display: grid; align-content: center; flex: 1; min-height: 139px; padding: 15px; border-radius: 11px; background: radial-gradient(ellipse at 86% 74%, #b7764e, #583e38 42%, #254437 85%); }
.status-picture strong { max-width: 10ch; font-size: 1.5rem; line-height: 1.1; }
.demo-time { font-variant-numeric: tabular-nums; color: #ddf5e9; }
.status-badge { position: absolute; right: 9px; bottom: 9px; padding: 4px 7px; border-radius: 6px; background: #713e2d; color: #fff2dd; font-size: 0.74rem; transform: rotate(-8deg); }
.reaction-strip { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 4px; border-radius: 18px; background: #2b463a; }
.reaction-strip img { width: 34px; height: 34px; object-fit: contain; }
.tour-step.is-playing .demo-love { animation: reaction-pop 720ms 1660ms ease-out both; }
.demo-wallpapers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.wallpaper-tile { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: #22352d; }
.wallpaper-tile img { width: 100%; height: 122px; object-fit: cover; }
.wallpaper-tile span { display: block; padding: 5px; font-size: 0.74rem; }
.wallpaper-tile .demo-tag { position: absolute; top: 4px; right: 4px; }

.tour-step.is-playing .reveal { animation: demo-reveal 470ms cubic-bezier(.22,.74,.31,1) var(--delay, 120ms) both; }
.reveal[data-at="1"] { --delay: 700ms; }
.reveal[data-at="2"] { --delay: 1340ms; }
.reveal[data-at="3"] { --delay: 2030ms; }

@keyframes demo-reveal { from { opacity: 0; translate: 0 9px; } to { opacity: 1; translate: 0 0; } }
@keyframes swipe-message { from { translate: 0; } 55% { translate: 27px; } to { translate: 7px; } }
@keyframes fill-track { from { scale: 0 1; } to { scale: 1 1; } }
@keyframes reaction-pop { from, to { scale: 1; } 40% { scale: 1.48; rotate: -13deg; } }

.tour-controls {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding: 11px clamp(14px, 3.6vw, 35px);
  border-top: 1px solid var(--border);
}

.tour-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 0 11px; }
#tour-step-count { color: var(--muted); white-space: nowrap; font-size: 0.9rem; }
.tour-dots, .tour-buttons { display: flex; align-items: center; }
.tour-buttons { gap: 7px; }
.tour-dot { display: grid; width: 25px; height: 42px; place-items: center; border: 0; border-radius: 7px; background: transparent; cursor: pointer; }
.tour-dot::after { width: 7px; height: 7px; border-radius: 50%; background: #587568; content: ""; }
.tour-dot[aria-current="step"]::after { width: 16px; height: 7px; border-radius: 5px; background: var(--accent); }
.tour-controls button { font-family: inherit; cursor: pointer; }
.tour-controls button:focus-visible, .guide select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.tour-controls button:disabled { opacity: .46; cursor: default; }

@media (max-width: 700px) {
  .tour-step { grid-template-columns: 1fr; }
  .tour-copy { padding: 0 3px 4px; }
  .tour-copy h3 { margin-block: 6px 8px; }
  .tour-demo { min-height: 292px; }
}

@media (max-width: 420px) {
  .tour-buttons { width: 100%; }
  .tour-buttons button { flex: 1; padding-inline: 8px; }
  .tour-progress { justify-content: space-between; width: 100%; }
  .tour-dot { width: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .tour-step.is-playing *, .tour-step.is-playing *::before, .tour-step.is-playing *::after { animation: none; }
  #tour-replay { display: none; }
}
