:root {
  --tour-accent: #7777ff;
  --tour-accent-strong: #5a5aff;
  --tour-cyan: #67e8f9;
  --tour-warm: #ffd36a;
  --tour-panel: rgba(11, 14, 23, 0.96);
  --tour-panel-soft: rgba(255, 255, 255, 0.065);
  --tour-line: rgba(255, 255, 255, 0.12);
  --tour-text: #f8fafc;
  --tour-muted: #aeb8cc;
}

[data-theme="light"] {
  --tour-panel: rgba(255, 255, 255, 0.97);
  --tour-panel-soft: rgba(15, 23, 42, 0.055);
  --tour-line: rgba(15, 23, 42, 0.11);
  --tour-text: #101525;
  --tour-muted: #586276;
}

.feature-guide-menu-section {
  margin-top: 0;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

[data-theme="light"] .feature-guide-menu-section {
  border-bottom-color: rgba(15, 23, 42, 0.09);
}

.feature-guide-menu-btn {
  border-color: rgba(119, 119, 255, 0.34);
  background:
    linear-gradient(135deg, rgba(90, 90, 255, 0.2), rgba(103, 232, 249, 0.08)),
    rgba(255, 255, 255, 0.035);
}

.feature-guide-menu-btn:hover {
  border-color: rgba(119, 119, 255, 0.58);
  background:
    linear-gradient(135deg, rgba(90, 90, 255, 0.3), rgba(103, 232, 249, 0.13)),
    rgba(255, 255, 255, 0.055);
}

.feature-guide-menu-icon {
  width: 21px;
  height: 21px;
  display: inline-grid;
  place-items: center;
  color: #a7a7ff;
}

.feature-guide-menu-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-guide-menu-btn:focus-visible,
.feature-tour button:focus-visible {
  outline: 3px solid rgba(103, 232, 249, 0.72);
  outline-offset: 3px;
}

.feature-tour {
  position: fixed;
  inset: 0;
  z-index: 40000;
  display: block;
  color: var(--tour-text);
  font-family: 'Segoe UI', sans-serif;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.feature-tour.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.feature-tour::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(90, 90, 255, 0.13), transparent 46%),
    rgba(2, 5, 12, 0.78);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 220ms ease;
}

.feature-tour.is-centered::before {
  opacity: 1;
}

.feature-tour-spotlight {
  position: fixed;
  left: 0;
  top: 0;
  width: 10px;
  height: 10px;
  border: 2px solid rgba(155, 155, 255, 0.92);
  border-radius: 18px;
  box-shadow:
    0 0 0 9999px rgba(2, 5, 12, 0.78),
    0 0 0 7px rgba(90, 90, 255, 0.16),
    0 0 34px rgba(90, 90, 255, 0.55);
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-30px, -30px, 0);
  transition:
    transform 320ms cubic-bezier(0.16, 1, 0.3, 1),
    width 320ms cubic-bezier(0.16, 1, 0.3, 1),
    height 320ms cubic-bezier(0.16, 1, 0.3, 1),
    border-radius 220ms ease,
    opacity 160ms ease;
}

.feature-tour.has-target .feature-tour-spotlight {
  opacity: 1;
}

.feature-tour-spotlight::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(103, 232, 249, 0.46);
  border-radius: inherit;
  animation: tourSpotPulse 1.8s ease-in-out infinite;
}

.feature-tour-card {
  position: fixed;
  width: min(410px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--tour-line);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.065), transparent 42%),
    var(--tour-panel);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  opacity: 0;
  transform: translateY(8px) scale(0.985);
  transition:
    left 300ms cubic-bezier(0.16, 1, 0.3, 1),
    top 300ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 180ms ease,
    transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-tour.is-open .feature-tour-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.feature-tour-card.is-changing .feature-tour-card-body {
  animation: tourContentIn 300ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.feature-tour-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 18px 10px;
}

.feature-tour-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tour-muted);
}

.feature-tour-brand-mark {
  position: relative;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(119, 119, 255, 0.42);
  border-radius: 9px;
  color: #d9d9ff;
  background: rgba(90, 90, 255, 0.16);
  font-size: 0.77rem;
  letter-spacing: 0;
}

[data-theme="light"] .feature-tour-brand-mark {
  color: #4040c9;
}

.feature-tour-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--tour-line);
  border-radius: 11px;
  color: var(--tour-muted);
  background: var(--tour-panel-soft);
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.feature-tour-close:hover {
  color: var(--tour-text);
  background: rgba(119, 119, 255, 0.17);
  transform: rotate(4deg);
}

.feature-tour-close svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.feature-tour-card-body {
  min-height: 0;
  padding: 0 18px 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.feature-tour-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 3px 0 6px;
  color: #a7a7ff;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.feature-tour-kicker::before {
  content: "";
  width: 17px;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--tour-accent), var(--tour-cyan));
}

.feature-tour-title {
  margin: 0;
  font-size: clamp(1.38rem, 4vw, 1.88rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.feature-tour-copy {
  margin: 9px 0 0;
  color: var(--tour-muted);
  font-size: 0.92rem;
  line-height: 1.52;
}

.feature-tour-copy strong {
  color: var(--tour-text);
}

.feature-tour-visual {
  position: relative;
  min-height: 142px;
  margin: 16px 0 13px;
  overflow: hidden;
  border: 1px solid var(--tour-line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 78% 12%, rgba(103, 232, 249, 0.1), transparent 36%),
    linear-gradient(135deg, rgba(90, 90, 255, 0.12), transparent 56%),
    rgba(1, 5, 12, 0.3);
}

[data-theme="light"] .feature-tour-visual {
  background:
    radial-gradient(circle at 78% 12%, rgba(6, 182, 212, 0.1), transparent 36%),
    linear-gradient(135deg, rgba(90, 90, 255, 0.1), transparent 56%),
    rgba(241, 245, 249, 0.72);
}

.tour-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0 0 12px;
}

.tour-feature-pill {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid var(--tour-line);
  border-radius: 11px;
  color: var(--tour-muted);
  background: var(--tour-panel-soft);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.2;
}

.tour-feature-pill svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: #a7a7ff;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-tour-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 7px;
  padding: 9px 10px;
  border-radius: 11px;
  color: var(--tour-muted);
  background: rgba(119, 119, 255, 0.09);
  font-size: 0.75rem;
  line-height: 1.38;
}

.feature-tour-hint::before {
  content: "i";
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #e5e7ff;
  background: rgba(119, 119, 255, 0.36);
  font-size: 0.68rem;
  font-weight: 900;
}

[data-theme="light"] .feature-tour-hint::before {
  color: #3434a7;
}

.feature-tour-footer {
  padding: 11px 18px 17px;
}

.feature-tour-progress {
  display: grid;
  grid-template-columns: repeat(var(--tour-steps, 9), minmax(8px, 1fr));
  gap: 5px;
  margin-bottom: 12px;
}

.feature-tour-progress-btn {
  position: relative;
  height: 17px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.feature-tour-progress-btn::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 7px;
  height: 3px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.23);
  transition: height 160ms ease, top 160ms ease, background 160ms ease;
}

.feature-tour-progress-btn.is-seen::before {
  background: rgba(119, 119, 255, 0.47);
}

.feature-tour-progress-btn.is-active::before {
  top: 6px;
  height: 5px;
  background: linear-gradient(90deg, var(--tour-accent-strong), var(--tour-cyan));
  box-shadow: 0 0 12px rgba(90, 90, 255, 0.46);
}

.feature-tour-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.feature-tour-step-count {
  margin-right: auto;
  color: var(--tour-muted);
  font-size: 0.74rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.feature-tour-btn {
  min-height: 39px;
  padding: 0 14px;
  border: 1px solid var(--tour-line);
  border-radius: 12px;
  color: var(--tour-text);
  background: var(--tour-panel-soft);
  font: inherit;
  font-size: 0.79rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.feature-tour-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(119, 119, 255, 0.4);
  background: rgba(119, 119, 255, 0.14);
}

.feature-tour-btn[hidden] {
  display: none;
}

.feature-tour-next {
  min-width: 92px;
  border-color: rgba(119, 119, 255, 0.56);
  color: white;
  background: linear-gradient(135deg, #6565f5, #4c4cd5);
  box-shadow: 0 9px 24px rgba(76, 76, 213, 0.26);
}

.feature-tour-next:hover {
  border-color: rgba(167, 167, 255, 0.8);
  background: linear-gradient(135deg, #7373ff, #5555e8);
}

.feature-tour-next-arrow {
  display: inline-block;
  margin-left: 5px;
  transition: transform 160ms ease;
}

.feature-tour-next:hover .feature-tour-next-arrow {
  transform: translateX(2px);
}

body.feature-tour-open .menu-overlay {
  pointer-events: none;
}

/* Welcome visual */
.tour-welcome-visual {
  display: grid;
  place-items: center;
}

.tour-welcome-board {
  position: relative;
  width: 72%;
  height: 88px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background:
    radial-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px),
    rgba(7, 11, 19, 0.7);
  background-size: 14px 14px;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .tour-welcome-board {
  border-color: rgba(15, 23, 42, 0.12);
  background:
    radial-gradient(rgba(15, 23, 42, 0.14) 1px, transparent 1px),
    rgba(255, 255, 255, 0.82);
  background-size: 14px 14px;
}

.tour-welcome-board svg {
  position: absolute;
  inset: 18px 12px 8px;
  width: calc(100% - 24px);
  height: calc(100% - 26px);
  overflow: visible;
}

.tour-welcome-stroke {
  fill: none;
  stroke: url(#tourWelcomeGradient);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 240;
  animation: tourDrawLine 2.8s ease-in-out infinite;
}

.tour-welcome-toolrail {
  position: absolute;
  left: 50%;
  top: 15px;
  display: flex;
  gap: 5px;
  padding: 5px 7px;
  border: 1px solid var(--tour-line);
  border-radius: 9px;
  background: var(--tour-panel);
  transform: translateX(-50%);
}

.tour-welcome-toolrail span {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.45);
}

.tour-welcome-toolrail span:first-child {
  width: 20px;
  background: var(--tour-accent);
}

.tour-welcome-badge {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--tour-line);
  border-radius: 10px;
  color: var(--tour-muted);
  background: var(--tour-panel);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  font-size: 0.65rem;
  font-weight: 800;
}

.tour-welcome-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #56e39f;
  box-shadow: 0 0 9px rgba(86, 227, 159, 0.62);
}

.tour-welcome-badge.local {
  left: 12px;
  bottom: 14px;
}

.tour-welcome-badge.free {
  right: 12px;
  top: 14px;
}

/* Canvas visual */
.tour-canvas-visual {
  min-height: 150px;
}

.tour-canvas-sheet {
  position: absolute;
  inset: 17px 72px 17px 18px;
  border: 1px solid var(--tour-line);
  border-radius: 13px;
  background:
    linear-gradient(rgba(148, 163, 184, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
}

.tour-canvas-sheet svg {
  position: absolute;
  inset: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
}

.tour-canvas-sheet path {
  fill: none;
  stroke: #9fa8ff;
  stroke-width: 5;
  stroke-linecap: round;
}

.tour-canvas-sheet path:last-child {
  stroke: rgba(250, 204, 21, 0.75);
  stroke-width: 10;
}

.tour-canvas-gestures {
  position: absolute;
  right: 13px;
  top: 18px;
  bottom: 18px;
  width: 48px;
  display: grid;
  gap: 7px;
}

.tour-canvas-gesture {
  display: grid;
  place-items: center;
  border: 1px solid var(--tour-line);
  border-radius: 12px;
  color: var(--tour-muted);
  background: var(--tour-panel-soft);
}

.tour-canvas-gesture svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Tool visual */
.tour-tools-visual,
.tour-controls-visual {
  display: grid;
  align-content: center;
  gap: 13px;
  padding: 16px;
  box-sizing: border-box;
}

.tour-tools-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
}

.tour-tool-chip {
  min-width: 0;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--tour-line);
  border-radius: 11px;
  color: var(--tour-muted);
  background: var(--tour-panel-soft);
}

.tour-tool-chip.is-active {
  color: #f7f7ff;
  border-color: rgba(119, 119, 255, 0.74);
  background: rgba(90, 90, 255, 0.28);
  box-shadow: 0 0 0 2px rgba(90, 90, 255, 0.13);
}

[data-theme="light"] .tour-tool-chip.is-active {
  color: #3434a7;
}

.tour-tool-chip svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tour-tools-caption {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.tour-tools-caption span {
  padding: 6px;
  border-radius: 8px;
  color: var(--tour-muted);
  background: rgba(148, 163, 184, 0.08);
  text-align: center;
  font-size: 0.62rem;
  font-weight: 750;
}

/* Controls visual */
.tour-control-swatches {
  display: flex;
  align-items: center;
  gap: 7px;
}

.tour-control-swatches span {
  width: 19px;
  height: 19px;
  border: 3px solid rgba(255, 255, 255, 0.17);
  border-radius: 50%;
  background: var(--swatch, white);
  box-shadow: 0 0 0 1px var(--tour-line);
}

.tour-control-swatches span:last-child {
  width: 29px;
  border-radius: 8px;
  background: conic-gradient(#ff5f6d, #ffd36a, #56e39f, #67e8f9, #7777ff, #ff5f6d);
}

.tour-control-slider {
  position: relative;
  height: 5px;
  border-radius: 99px;
  background: linear-gradient(90deg, #7777ff 0 62%, rgba(148, 163, 184, 0.22) 62%);
}

.tour-control-slider::after {
  content: "";
  position: absolute;
  left: 62%;
  top: 50%;
  width: 16px;
  height: 16px;
  border: 3px solid var(--tour-panel);
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 0 1px rgba(119, 119, 255, 0.65);
  transform: translate(-50%, -50%);
}

.tour-stroke-styles {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.tour-stroke-styles span {
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--tour-line);
  border-radius: 8px;
}

.tour-stroke-styles i {
  display: block;
  width: 68%;
  height: var(--stroke, 2px);
  border-radius: 99px;
  background: currentColor;
  transform: rotate(-8deg);
}

/* Library visual */
.tour-library-visual {
  min-height: 154px;
  padding: 16px;
  box-sizing: border-box;
}

.tour-notebook-stack {
  position: absolute;
  left: 20px;
  top: 20px;
  width: 112px;
  height: 105px;
}

.tour-notebook {
  position: absolute;
  inset: 0;
  border: 1px solid var(--tour-line);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(119, 119, 255, 0.28), rgba(16, 23, 38, 0.94));
  box-shadow: 0 13px 23px rgba(0, 0, 0, 0.23);
}

[data-theme="light"] .tour-notebook {
  background: linear-gradient(135deg, rgba(119, 119, 255, 0.2), rgba(255, 255, 255, 0.96));
}

.tour-notebook:nth-child(1) { transform: translate(14px, -8px) rotate(7deg); opacity: 0.54; }
.tour-notebook:nth-child(2) { transform: translate(7px, -4px) rotate(3deg); opacity: 0.76; }
.tour-notebook:nth-child(3) { padding: 14px; box-sizing: border-box; }

.tour-notebook::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.15);
}

.tour-notebook strong,
.tour-notebook small {
  display: block;
  margin-left: 8px;
}

.tour-notebook strong { font-size: 0.76rem; }
.tour-notebook small { margin-top: 5px; color: var(--tour-muted); font-size: 0.58rem; }

.tour-library-list {
  position: absolute;
  left: 158px;
  right: 16px;
  top: 18px;
  display: grid;
  gap: 7px;
}

.tour-library-item {
  display: grid;
  grid-template-columns: 31px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--tour-line);
  border-radius: 10px;
  color: var(--tour-muted);
  background: var(--tour-panel-soft);
  font-size: 0.64rem;
  font-weight: 750;
}

.tour-library-item span:first-child {
  width: 31px;
  height: 24px;
  border-radius: 6px;
  background: var(--book, #7777ff);
  opacity: 0.78;
}

.tour-library-item em {
  font-style: normal;
  font-size: 0.54rem;
  opacity: 0.66;
}

/* Files visual */
.tour-files-visual {
  min-height: 154px;
  display: grid;
  grid-template-columns: 1fr 38px 1fr 38px 1fr;
  align-items: center;
  gap: 5px;
  padding: 16px;
  box-sizing: border-box;
}

.tour-file-card {
  height: 94px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  border: 1px solid var(--tour-line);
  border-radius: 13px;
  background: var(--tour-panel-soft);
  text-align: center;
  font-size: 0.61rem;
  font-weight: 800;
}

.tour-file-card svg {
  width: 30px;
  height: 30px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tour-file-card.import { color: #ff9a9e; }
.tour-file-card.markup { color: #a7a7ff; }
.tour-file-card.export { color: #56e39f; }

.tour-file-arrow {
  color: var(--tour-muted);
  text-align: center;
  font-size: 1.1rem;
}

/* Focus visual */
.tour-focus-visual {
  min-height: 158px;
  padding: 15px;
  box-sizing: border-box;
}

.tour-focus-window {
  position: absolute;
  left: 14px;
  right: 90px;
  top: 15px;
  bottom: 15px;
  display: grid;
  grid-template-columns: 47% 53%;
  overflow: hidden;
  border: 1px solid var(--tour-line);
  border-radius: 13px;
  background: rgba(3, 7, 14, 0.62);
}

.tour-focus-video {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, rgba(255, 82, 82, 0.3), transparent 45%),
    linear-gradient(145deg, #24283a, #0d1018);
}

.tour-focus-play {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: #ff4b55;
  box-shadow: 0 0 22px rgba(255, 75, 85, 0.36);
}

.tour-focus-play::before {
  content: "";
  margin-left: 3px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid currentColor;
}

.tour-focus-notes {
  position: relative;
  background:
    linear-gradient(rgba(148, 163, 184, 0.1) 1px, transparent 1px),
    rgba(255, 255, 255, 0.03);
  background-size: 100% 19px;
}

.tour-focus-notes::before,
.tour-focus-notes::after {
  content: "";
  position: absolute;
  left: 18%;
  width: 62%;
  height: 4px;
  border-radius: 99px;
  background: #9fa8ff;
  transform: rotate(-5deg);
}

.tour-focus-notes::before { top: 38%; }
.tour-focus-notes::after { top: 62%; width: 46%; background: rgba(250, 204, 21, 0.72); }

.tour-pomo-clock {
  position: absolute;
  right: 13px;
  top: 22px;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 4px solid rgba(119, 119, 255, 0.24);
  border-top-color: #7777ff;
  border-radius: 50%;
  color: var(--tour-text);
  font-size: 0.65rem;
  font-weight: 900;
  transform: rotate(10deg);
}

.tour-pomo-clock span { transform: rotate(-10deg); }

.tour-capture-chip {
  position: absolute;
  right: 11px;
  bottom: 23px;
  width: 68px;
  padding: 7px 4px;
  border: 1px solid rgba(103, 232, 249, 0.25);
  border-radius: 9px;
  color: var(--tour-cyan);
  background: rgba(103, 232, 249, 0.08);
  text-align: center;
  font-size: 0.54rem;
  font-weight: 850;
}

/* Planner visual */
.tour-planner-visual {
  min-height: 158px;
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 11px;
  box-sizing: border-box;
  padding: 14px;
}

.tour-planner-calendar,
.tour-planner-tasks {
  min-width: 0;
  border: 1px solid var(--tour-line);
  border-radius: 13px;
  background: var(--tour-panel-soft);
}

.tour-planner-calendar {
  padding: 10px;
}

.tour-planner-calendar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: var(--tour-muted);
  font-size: 0.58rem;
}

.tour-planner-calendar-head strong {
  color: #a7a7ff;
  font-size: 0.69rem;
}

.tour-planner-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 13px;
}

.tour-planner-days i {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: rgba(148, 163, 184, 0.08);
  color: white;
  font-size: 0.46rem;
  font-style: normal;
  font-weight: 900;
}

.tour-planner-days i.has-task::after {
  content: "";
  position: absolute;
  bottom: 2px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #67e8f9;
}

.tour-planner-days i.is-selected {
  background: linear-gradient(145deg, #7777ff, #555bdc);
  box-shadow: 0 5px 12px rgba(85, 91, 220, 0.3);
}

.tour-planner-tasks {
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 11px;
}

.tour-planner-progress {
  position: relative;
  height: 6px;
  margin: 0 28px 3px 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
}

.tour-planner-progress span {
  width: 67%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #7777ff, #56e39f);
}

.tour-planner-progress em {
  position: absolute;
  left: calc(100% + 6px);
  top: -4px;
  color: #a7a7ff;
  font-size: 0.54rem;
  font-style: normal;
  font-weight: 900;
}

.tour-planner-task {
  min-height: 28px;
  display: grid;
  grid-template-columns: 19px 1fr;
  align-items: center;
  gap: 7px;
  padding: 4px 7px;
  border: 1px solid var(--tour-line);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.055);
}

.tour-planner-task i {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 5px;
  color: white;
  font-size: 0.55rem;
  font-style: normal;
}

.tour-planner-task span {
  width: 72%;
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.3);
}

.tour-planner-task:nth-child(3) span { width: 88%; }
.tour-planner-task:nth-child(4) span { width: 58%; }

.tour-planner-task.is-done i {
  border-color: #56e39f;
  background: #36b982;
}

.tour-planner-task.is-done span {
  opacity: 0.45;
}

/* AR visual */
.tour-ar-visual {
  min-height: 154px;
}

.tour-ar-camera {
  position: absolute;
  inset: 15px 118px 15px 15px;
  overflow: hidden;
  border: 1px solid var(--tour-line);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 112%, rgba(119, 119, 255, 0.35), transparent 52%),
    linear-gradient(145deg, #232a3c, #0c111c);
}

.tour-ar-hand {
  position: absolute;
  left: 50%;
  top: 51%;
  width: 85px;
  height: 94px;
  transform: translate(-50%, -50%);
}

.tour-ar-hand svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.tour-ar-hand path {
  fill: none;
  stroke: rgba(103, 232, 249, 0.54);
  stroke-width: 1.6;
}

.tour-ar-hand circle {
  fill: #67e8f9;
  filter: drop-shadow(0 0 4px rgba(103, 232, 249, 0.8));
}

.tour-ar-airline {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 25px;
  height: 37px;
  border-top: 4px solid #a7a7ff;
  border-radius: 50%;
  transform: rotate(-6deg);
  opacity: 0.8;
}

.tour-location-switch {
  position: absolute;
  right: 15px;
  top: 17px;
  width: 86px;
  display: grid;
  gap: 8px;
}

.tour-location-switch div {
  padding: 9px 8px;
  border: 1px solid var(--tour-line);
  border-radius: 10px;
  color: var(--tour-muted);
  background: var(--tour-panel-soft);
  text-align: center;
  font-size: 0.61rem;
  font-weight: 800;
}

.tour-location-switch div:first-child {
  color: #dedeff;
  border-color: rgba(119, 119, 255, 0.5);
  background: rgba(119, 119, 255, 0.18);
}

[data-theme="light"] .tour-location-switch div:first-child { color: #4040b8; }

/* Finish visual */
.tour-ready-visual {
  min-height: 158px;
  display: grid;
  place-items: center;
}

.tour-ready-orbit {
  position: relative;
  width: 120px;
  height: 120px;
  border: 1px dashed rgba(119, 119, 255, 0.38);
  border-radius: 50%;
  animation: tourOrbit 16s linear infinite;
}

.tour-ready-core {
  position: absolute;
  inset: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(119, 119, 255, 0.5);
  border-radius: 18px;
  color: white;
  background: linear-gradient(145deg, #7777ff, #4a4ac9);
  box-shadow: 0 0 30px rgba(90, 90, 255, 0.33);
  font-size: 1.35rem;
  font-weight: 900;
  transform: rotate(0deg);
}

.tour-ready-dot {
  position: absolute;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--tour-line);
  border-radius: 9px;
  color: var(--tour-muted);
  background: var(--tour-panel);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  font-size: 0.65rem;
  font-weight: 900;
}

.tour-ready-dot:nth-child(2) { left: -10px; top: 13px; }
.tour-ready-dot:nth-child(3) { right: -10px; top: 13px; }
.tour-ready-dot:nth-child(4) { left: -10px; bottom: 13px; }
.tour-ready-dot:nth-child(5) { right: -10px; bottom: 13px; }

@keyframes tourSpotPulse {
  0%, 100% { opacity: 0.28; transform: scale(0.985); }
  50% { opacity: 0.8; transform: scale(1.018); }
}

@keyframes tourContentIn {
  from { opacity: 0.2; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes tourDrawLine {
  0% { stroke-dashoffset: 240; }
  55%, 78% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -240; }
}

@keyframes tourOrbit {
  to { transform: rotate(360deg); }
}

@media (max-width: 720px) {
  .feature-tour-card {
    width: calc(100vw - 20px);
    max-height: min(68vh, 610px);
    border-radius: 20px;
  }

  .feature-tour-card-top {
    padding: 13px 14px 8px;
  }

  .feature-tour-card-body {
    padding: 0 14px 3px;
  }

  .feature-tour-footer {
    padding: 8px 14px 13px;
  }

  .feature-tour-visual {
    min-height: 124px;
    margin: 12px 0 10px;
  }

  .feature-tour-copy {
    font-size: 0.84rem;
  }

  .tour-feature-grid {
    gap: 5px;
    margin-bottom: 9px;
  }

  .tour-feature-pill {
    padding: 7px 8px;
    font-size: 0.68rem;
  }

  .feature-tour-hint {
    padding: 7px 8px;
    font-size: 0.69rem;
  }

  .tour-library-list {
    left: 148px;
  }

  .tour-files-visual {
    min-height: 132px;
  }

  .tour-file-card {
    height: 78px;
  }

  .tour-focus-visual,
  .tour-planner-visual,
  .tour-library-visual,
  .tour-ar-visual,
  .tour-ready-visual {
    min-height: 132px;
  }

  .tour-location-switch {
    top: 10px;
    gap: 5px;
  }

  .tour-location-switch div {
    padding: 7px 5px;
  }
}

@media (max-width: 420px) {
  .feature-tour-card {
    width: calc(100vw - 14px);
    max-height: calc(100vh - 14px);
  }

  .feature-tour-title {
    font-size: 1.28rem;
  }

  .feature-tour-step-count {
    display: none;
  }

  .feature-tour-actions {
    justify-content: flex-end;
  }

  .feature-tour-btn {
    padding: 0 12px;
  }

  .tour-feature-grid {
    grid-template-columns: 1fr 1fr;
  }

  .tour-tools-row {
    gap: 5px;
  }

  .tour-tool-chip {
    border-radius: 9px;
  }

  .tour-library-list {
    left: 139px;
    right: 10px;
  }

  .tour-notebook-stack {
    left: 12px;
    width: 104px;
  }

  .tour-library-item {
    grid-template-columns: 24px 1fr;
  }

  .tour-library-item span:first-child {
    width: 24px;
  }

  .tour-library-item em {
    display: none;
  }

  .tour-file-card {
    font-size: 0.54rem;
  }
}

@media (max-height: 650px) and (orientation: landscape) {
  .feature-tour-card {
    width: min(760px, calc(100vw - 20px));
    max-height: calc(100vh - 16px);
  }

  .feature-tour-card-top {
    padding: 10px 14px 6px;
  }

  .feature-tour-card-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto 1fr auto;
    column-gap: 15px;
    padding: 0 14px 2px;
  }

  .feature-tour-kicker {
    grid-column: 1;
    grid-row: 1;
    margin-top: 0;
    font-size: 0.65rem;
  }

  .feature-tour-title {
    grid-column: 1;
    grid-row: 2;
    font-size: 1.24rem;
  }

  .feature-tour-copy {
    grid-column: 1;
    grid-row: 3;
    margin-top: 6px;
    font-size: 0.75rem;
    line-height: 1.38;
  }

  .feature-tour-visual-slot {
    grid-column: 2;
    grid-row: 1 / span 3;
    min-width: 0;
  }

  .feature-tour-visual {
    min-height: 105px;
    margin: 0 0 7px;
  }

  .tour-feature-grid {
    grid-column: 2;
    grid-row: 4;
    margin-bottom: 0;
  }

  .feature-tour-hint {
    grid-column: 1;
    grid-row: 4;
    align-self: stretch;
    margin: 0;
  }

  .feature-tour-footer {
    padding: 7px 14px 10px;
  }

  .feature-tour-progress {
    margin-bottom: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .feature-tour,
  .feature-tour *,
  .feature-tour *::before,
  .feature-tour *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
