/* Welcome tour (web/static/js/tour-view.js) — the app and Studio share it.
   One background tone, a hairline frame round each screenshot, orange only on the
   button and the current dot. Motion is a short slide-and-fade; none when reduced. */

.tour {
  position: fixed; inset: 0; z-index: 90;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto;
  padding: calc(var(--safe-top) + 12px) 24px calc(var(--safe-bottom) + 20px);
  background: var(--bg); color: var(--text);
  animation: fade var(--t-base) var(--spring-soft);
}
.tour-top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; width: 100%; max-width: 480px; margin: 0 auto; }
.tour-laptop .tour-top, .tour-laptop .tour-foot { max-width: 880px; }
.tour-brand { display: inline-flex; align-items: baseline; gap: 8px; }
.tour-mark { font-size: 26px; }
.tour-studio { font-family: var(--num); font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.tour-skip {
  border: 0; background: none; padding: 10px 2px; cursor: pointer;
  font: inherit; font-size: 15px; color: var(--muted);
}
.tour-skip:hover { color: var(--text); }

.tour-stage {
  min-height: 0; display: grid; place-items: center; padding: 12px 0 20px;
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.tour-frame {
  margin: 0; height: 100%; max-height: 600px; aspect-ratio: 520 / 1126; max-width: 100%;
  border-radius: 30px; overflow: hidden; background: var(--surface2);
  box-shadow: 0 0 0 1px var(--hairline), 0 18px 48px rgba(18, 18, 23, .08);
  animation: tour-in var(--t-slow) var(--spring-soft) both;
}
.tour-frame.back { animation-name: tour-back; }
.tour-frame img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; pointer-events: none; }
.tour-blank { display: grid; place-items: center; }
.tour-blank .wordmark { font-size: 44px; }

.tour-copy { width: 100%; max-width: 380px; margin: 0 auto; text-align: center; animation: rise-in var(--t-slow) var(--spring-soft) .05s both; }
.tour-title { margin: 0; font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.15; letter-spacing: -.005em; }
.tour-body { margin: 8px 0 0; color: var(--muted); font-size: 16px; line-height: 1.45; }

.tour-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; max-width: 480px; margin: 22px auto 0; }
.tour-dots { display: flex; align-items: center; }
.tour-dots > * {
  position: relative; width: 18px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer;
  transition: width var(--t-base) var(--spring);
}
.tour-dots > *::before {
  content: ''; position: absolute; left: 6px; right: 6px; top: 50%; height: 6px; margin-top: -3px;
  border-radius: 6px; background: var(--line2); transition: background var(--t-base) var(--spring-soft);
}
.tour-dots > .on { width: 34px; }
.tour-dots > .on::before { background: var(--accent-fill); }
.tour-next { width: auto; min-width: 132px; flex: none; }

@keyframes tour-in { from { opacity: 0; transform: translateX(16px) scale(.985); } }
@keyframes tour-back { from { opacity: 0; transform: translateX(-16px) scale(.985); } }

/* Short phones: the frame gives way first. */
@media (max-height: 640px) {
  .tour-title { font-size: 26px; }
  .tour-stage { padding: 6px 0 14px; }
}

/* Studio: laptop screenshots, shown as a sheet over the console on wide screens. */
.tour-laptop .tour-frame { height: auto; width: min(100%, 880px); max-height: 100%; aspect-ratio: 1280 / 800; border-radius: 14px; }
.tour-scrim { position: fixed; inset: 0; z-index: 89; background: var(--scrim); animation: fade var(--t-base) var(--spring-soft); }
@media (min-width: 960px) {
  .tour.tour-laptop {
    inset: 32px max(32px, calc((100vw - 1080px) / 2)); border-radius: 24px; padding: 20px 32px 26px;
    box-shadow: 0 0 0 1px var(--hairline), 0 30px 80px rgba(18, 18, 23, .16);
  }
}

/* The editor's preview in Studio: the same pieces, not fixed. */
.tour-preview {
  display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: 0;
  padding: 18px 18px 16px; border-radius: var(--r-lg); background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.tour-preview.tour-phone { height: 560px; }
.tour-preview.tour-laptop .tour-stage { padding-top: 4px; }
.tour-preview .tour-title { font-size: 24px; }
.tour-preview .tour-body { font-size: 14px; }
.tour-preview .tour-foot { margin-top: 16px; }
.tour-preview .tour-dots > * { cursor: default; }
.tour-preview .tour-next { pointer-events: none; height: 40px; min-width: 100px; font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  .tour, .tour-frame, .tour-copy, .tour-scrim { animation: none; }
  .tour-dots > *, .tour-dots > *::before { transition: none; }
}

/* ── Studio · Settings → Welcome tour (screens/tour-admin.js) ── */
.tset-actions { display: flex; align-items: center; gap: 12px; }
.tset-actions .btn { width: auto; height: 40px; padding: 0 16px; font-size: 14px; }
.tset-version { color: var(--muted); white-space: nowrap; }
.tset-note { margin-bottom: 18px; }
.tset-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.tset-grid:has(.tour-laptop) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.tset-list h2, .tset-edit h2 { font-family: var(--display); font-weight: 400; font-size: 21px; }
.tset-add, .tset-hide { width: auto; height: 36px; padding: 0 14px; font-size: 13px; }
.tset-steps { list-style: none; margin: 10px 0 0; padding: 0; }
.tset-step { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--hairline); }
.tset-step:first-child { border-top: 0; }
.tset-pick {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 8px; margin: 2px 0;
  border: 0; border-radius: var(--r-sm); background: none; text-align: left; font: inherit; color: inherit; cursor: pointer;
}
.tset-pick:hover { background: var(--surface2); }
.tset-step.on .tset-pick { background: var(--accent-soft); }
.tset-pick .t { display: block; font-weight: 550; }
.tset-pick .s { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tset-step.off .t, .tset-step.off .tset-thumb { opacity: .55; }
.tset-thumb { flex: none; overflow: hidden; background: var(--surface2); box-shadow: 0 0 0 1px var(--hairline); }
.tset-thumb.phone { width: 30px; height: 64px; border-radius: 7px; }
.tset-thumb.laptop { width: 64px; height: 40px; border-radius: 5px; }
.tset-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.tset-move { display: flex; flex-direction: column; }
.tset-move .icon-btn { width: 28px; height: 24px; box-shadow: none; background: transparent; color: var(--muted); }
.tset-move .icon-btn:hover { color: var(--text); }
.tset-move .icon-btn.is-off { opacity: .25; pointer-events: none; }
.tset-shot { margin-top: 14px; }
.tset-shot-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.tset-upload { width: auto; height: 38px; padding: 0 14px; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.tset-save { display: flex; justify-content: flex-end; margin-top: 16px; }
.tset-save .btn { width: auto; height: 42px; padding: 0 22px; }
.tset-preview { position: sticky; top: 24px; display: grid; gap: 8px; }
@media (max-width: 1100px) {
  .tset-grid, .tset-grid:has(.tour-laptop) { grid-template-columns: minmax(0, 1fr); }
  .tset-preview { position: static; }
  .tour-preview.tour-phone { height: 520px; max-width: 380px; }
}
@media (max-width: 720px) {
  .tset .set-bar { flex-direction: column; align-items: stretch; }
  .tset .set-bar > .ops-tabs { align-self: flex-start; }
  .tset-actions { justify-content: space-between; }
}
