/* ============================================================
   Live tour · 1:1 clone of the YTMP window + guided coach marks
   The app itself is styled by tour-app.css (generated from the
   real app). This file only adds the window chrome, scaling,
   the compact phone layout and the tour overlay.
   ============================================================ */

.tour-stage { position: relative; max-width: 1280px; margin: 0 auto; }
.tour-scaler { position: relative; width: 100%; height: var(--stage-h, 780px); }

/* The desktop window, rendered at its real size and scaled to fit */
.ytmp-window {
  position: absolute; left: 0; top: 0;
  width: 1280px; height: 780px;
  transform: scale(var(--s, 1)); transform-origin: 0 0;
  border-radius: 8px; overflow: hidden;
  background: #202020;
  outline: 1px solid rgba(255, 255, 255, .09); outline-offset: -1px;
  color-scheme: dark;
}
.ytmp-titlebar {
  position: relative; z-index: 70;
  height: 32px; display: flex; align-items: center; gap: 10px; padding-left: 12px;
  background: #202020; color: #d6d6d6;
  font: 12px/1 "Segoe UI", Inter, system-ui, sans-serif; letter-spacing: 0;
  user-select: none;
}
.ytmp-titlebar .tb-icon { width: 16px; height: 16px; fill: none; stroke: #7fe0cf; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ytmp-titlebar .tb-icon path { fill: #7fe0cf; stroke: none; }
.ytmp-titlebar .tb-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ytmp-titlebar .tb-ctl { display: flex; height: 100%; }
.ytmp-titlebar .tb-ctl span { width: 46px; height: 100%; display: grid; place-items: center; }
.ytmp-titlebar .tb-ctl svg { width: 10px; height: 10px; fill: none; stroke: #d6d6d6; stroke-width: 1; }

/* The app root (stands in for the app's <html>/<body>) */
.ytmp {
  --ytmp-vw: 1280px; --ytmp-vh: 748px;
  position: relative; width: 1280px; height: 748px; overflow: hidden;
  text-align: left;
}
.ytmp .video-frame video { width: 100%; aspect-ratio: 16 / 9; max-height: 100%; border: 0; border-radius: 4px; background: #000; object-fit: cover; display: block; }
.ytmp .msg.tour-force .msg-actions { display: flex; }
.ytmp .tooltip { display: block; z-index: 80; }
/* In-window dialog layer (the app uses a modal <dialog>; inside the tour it must stay in the window) */
.ytmp .ytmp-layer { position: absolute; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .7); }
.ytmp .ytmp-layer[hidden] { display: none; }
.ytmp .ytmp-layer > dialog { position: relative; inset: auto; margin: 0; }
.ytmp .tour-static { opacity: .85; }

/* ---------- Compact layout for narrow screens (no scaling, stacked columns) ---------- */
.tour-stage.compact .tour-scaler { height: auto; }
.tour-stage.compact .ytmp-window { position: relative; width: 100%; height: auto; transform: scale(1); }
.tour-stage.compact .ytmp { width: 100%; height: auto; min-height: 0; --ytmp-vw: 100%; --ytmp-vh: 640px; }
.tour-stage.compact .ytmp .app { height: auto; padding: 14px 12px 16px; }
.tour-stage.compact .ytmp .top { margin: 0 0 14px; flex-wrap: wrap; gap: 10px; }
.tour-stage.compact .ytmp .brand-icon { width: 38px; height: 38px; padding: 8px; }
.tour-stage.compact .ytmp .stats { gap: 12px; font-size: 12px; }
.tour-stage.compact .ytmp .row { flex-wrap: wrap; }
.tour-stage.compact .ytmp .url-wrap { flex: 1 1 100%; }
.tour-stage.compact .ytmp .row > button { flex: 1 1 auto; }
.tour-stage.compact .ytmp input, .tour-stage.compact .ytmp .chat-input-wrap { min-width: 0; }
.tour-stage.compact .ytmp .chat-input { gap: 6px; }
.tour-stage.compact .ytmp .char-count { display: none; }
.tour-stage.compact .ytmp .toolbar-sep { display: none; }
.tour-stage.compact .ytmp .greet-mode { margin-left: 0; }
.tour-stage.compact .ytmp .grid,
.tour-stage.compact .ytmp.show-video .grid,
.tour-stage.compact .ytmp.no-chat .grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; gap: 12px; margin-top: 12px; }
.tour-stage.compact .ytmp .app > .grid { min-height: 0; }
.tour-stage.compact .ytmp #newCard, .tour-stage.compact .ytmp #knownCard { height: 240px; }
.tour-stage.compact .ytmp #chatCard { height: 470px; }
.tour-stage.compact .ytmp .side-toggle[aria-controls] { display: none; }
.tour-stage.compact .ytmp .chat-search input { width: 60px; }
.tour-stage.compact .ytmp .chat-search input:focus { width: 110px; }
.tour-stage.compact .ytmp #chatCount { display: none; }
.tour-stage.compact .ytmp .footer-log { max-width: 46vw; }
.tour-stage.compact .ytmp .settings-dialog { width: calc(100% - 16px); }
.tour-stage.compact .ytmp .settings-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
.tour-stage.compact .ytmp .settings-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--n-2b); }
.tour-stage.compact .ytmp .settings-tab { width: auto; white-space: nowrap; }
.tour-stage.compact .ytmp .theme-grid { grid-template-columns: 1fr; }
.tour-stage.compact .ytmp-titlebar .tb-title { font-size: 11px; }

/* ---------- Tour overlay: shade with a hole, ring, popover ---------- */
.tour-layer { position: absolute; inset: 0; z-index: 20; pointer-events: none; border-radius: 8px; overflow: hidden; }
.tour-layer[hidden] { display: none; }
.tour-shade {
  position: absolute; background: rgba(4, 8, 12, .6); pointer-events: auto;
  transition: left .35s var(--ease), top .35s var(--ease), width .35s var(--ease), height .35s var(--ease), background-color .3s;
}
.tour-layer.waiting .tour-shade { background: rgba(4, 8, 12, .22); }
.tour-ring {
  position: absolute; border-radius: 6px; pointer-events: none;
  outline: 2px solid var(--accent); outline-offset: 0;
  transition: left .35s var(--ease), top .35s var(--ease), width .35s var(--ease), height .35s var(--ease), opacity .2s;
}
.tour-ring::after {
  content: ""; position: absolute; inset: -2px; border-radius: 8px;
  border: 2px solid var(--accent); opacity: 0;
  animation: tourRing 1.6s var(--ease) infinite;
}
.tour-ring.info::after { display: none; }
.tour-ring.info { outline-color: rgba(127, 224, 207, .55); }
.tour-layer.waiting .tour-ring, .tour-ring.off { opacity: 0; }
@keyframes tourRing { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.18); } }
.tour-layer.nudge .tour-ring { animation: tourShake .38s ease; }

.tour-pop {
  position: absolute; z-index: 30; left: 0; top: 0;
  width: min(340px, calc(100% - 24px));
  padding: 16px 18px 16px;
  background: #f2f5f7; color: #131a21;
  border-radius: 6px;
  font-size: 15px; line-height: 1.5; text-align: left;
  opacity: 0; transform: translateY(6px);
  transition: opacity .22s ease, transform .22s var(--ease), left .35s var(--ease), top .35s var(--ease);
  pointer-events: auto;
}
.tour-pop[hidden] { display: none; }
.tour-pop.show { opacity: 1; transform: none; }
.tour-pop.nudge { animation: tourShake .38s ease; }
@keyframes tourShake { 20% { translate: -5px 0; } 40% { translate: 5px 0; } 60% { translate: -3px 0; } 80% { translate: 3px 0; } }
.tour-pop .tp-arrow {
  position: absolute; width: 12px; height: 12px; background: inherit;
  transform: rotate(45deg); border-radius: 2px;
}
.tour-pop[data-side="bottom"] .tp-arrow { top: -5px; }
.tour-pop[data-side="top"] .tp-arrow { bottom: -5px; }
.tour-pop[data-side="right"] .tp-arrow { left: -5px; }
.tour-pop[data-side="left"] .tp-arrow { right: -5px; }
.tour-pop[data-side="center"] .tp-arrow, .tour-pop[data-side="inside"] .tp-arrow { display: none; }
.tp-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tp-step { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #1d7f71; font-variant-numeric: tabular-nums; }
.tp-bar { flex: 1; height: 3px; border-radius: 2px; background: #d9e1e6; overflow: hidden; }
.tp-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s var(--ease); }
.tp-x {
  width: 26px; height: 26px; margin: -4px -6px -4px 0; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 4px;
  background: transparent; color: #56616c; cursor: pointer;
}
.tp-x:hover { background: #e1e7eb; color: #131a21; }
.tp-x svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.tp-title { font-size: 18px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; margin: 0 0 6px; color: #0d1318; }
.tp-body { margin: 0; color: #3b4651; font-size: 15px; }
.tp-body b { color: #131a21; font-weight: 650; }
.tp-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.tp-foot:empty { display: none; }
.tp-do {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 11px 6px 9px; border-radius: 4px;
  background: #dff3ef; color: #0f5b51; font-size: 13.5px; font-weight: 650;
}
.tp-do svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; animation: tpTap 1.4s ease-in-out infinite; }
@keyframes tpTap { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.tp-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 0; border-radius: 4px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: background-color .15s;
}
.tp-btn:hover { background: var(--accent-2); }
.tp-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tp-ghost {
  padding: 8px 6px; border: 0; background: transparent; color: #3b4651;
  font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #b5c0c8;
}
.tp-ghost:hover { color: #131a21; text-decoration-color: currentColor; }
.tp-key { margin-left: auto; font-size: 12px; color: #6a7680; }
.tp-key kbd { font: 11px ui-monospace, monospace; padding: 1px 5px; border: 1px solid #c5cfd6; border-bottom-width: 2px; border-radius: 3px; background: #fff; }
.tour-pop:focus-visible, .tp-btn:focus-visible, .tp-ghost:focus-visible, .tp-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Row under the window */
.tour-foot { max-width: 1280px; margin: 16px auto 0; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.tour-note { flex: 1 1 260px; margin: 0; color: var(--ink-3); font-size: 14px; }
.tour-foot .tlink { font-size: 15px; }
.tour-noscript { display: block; width: 100%; height: auto; border-radius: 8px; }

@media (prefers-reduced-motion: reduce) {
  .tour-shade, .tour-ring, .tour-pop { transition: none; }
  .tour-ring::after, .tp-do svg, .tour-pop.nudge, .tour-layer.nudge .tour-ring { animation: none; }
}
.tour-foot .tlink { background: none; border: 0; padding: 0; font: inherit; font-size: 15px; cursor: pointer; }
