/* A quiet guide that leaves the real workspace available to use. */
.tour-launch,
.tour-resume-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid #ddd0f2;
  border-radius: 11px;
  background: #f5f0fd;
  color: #6243a7;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease;
}

.tour-launch:hover,
.tour-resume-chip:hover {
  background: #ece2fb;
  border-color: #c5ade8;
}

.tour-launch .icon,
.tour-resume-chip .icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.tour-resume-chip {
  border-radius: 999px;
  box-shadow: 0 3px 14px #44305c0c;
}

.tour-welcome[hidden],
.tour-panel[hidden],
.tour-modal-guide[hidden],
.tour-resume-chip[hidden] {
  display: none !important;
}

body.tour-welcome-open {
  overflow: hidden;
}

.tour-welcome {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 20px;
  background: rgba(37, 35, 57, .42);
  backdrop-filter: blur(5px);
}

.tour-welcome-card {
  width: 540px;
  max-width: 100%;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 30px;
  border: 1px solid #e5dbf1;
  border-radius: 24px;
  background: #fff;
  color: #252339;
  box-shadow: 0 22px 80px #29203530;
  scrollbar-gutter: stable;
}

.tour-kicker {
  display: block;
  margin: 0;
  color: #7553ae;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: .01em;
  text-transform: none;
}

.tour-welcome-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 20px;
  border: 1px solid #e4d9f5;
  border-radius: 17px;
  background: #f2ebfc;
  color: #7457df;
}

.tour-welcome-icon .icon {
  width: 28px;
  height: 28px;
}

.tour-welcome-card h2,
#tour-welcome-title {
  margin: 10px 0 12px;
  color: #30263f;
  font-size: 22px;
  font-weight: 740;
  line-height: 1.28;
  letter-spacing: -.55px;
}

#tour-welcome-copy,
.tour-welcome-card > p {
  margin: 0;
  color: #655d73;
  font-size: 15px;
  line-height: 1.75;
}

.tour-welcome-points {
  display: flex;
  flex-direction: column;
  gap: 14px;
  list-style: none;
  margin: 24px 0;
  padding: 0;
}

.tour-welcome-points li {
  position: relative;
  min-height: 25px;
  padding-left: 35px;
  color: #554b64;
  font-size: 15px;
  line-height: 1.65;
}

.tour-welcome-points li::before {
  content: "✓";
  position: absolute;
  top: 1px;
  left: 0;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: #ede5f9;
  color: #7654ad;
  font-size: 14px;
  font-weight: 750;
}

.tour-welcome-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  margin-top: 24px;
}

.tour-welcome-actions > button,
.tour-welcome-actions > .btn {
  min-height: 46px;
  padding: 11px 16px;
  font-size: 14px;
  line-height: 1.5;
  white-space: normal;
}

.tour-welcome-actions > :first-child {
  flex: 1;
}

/* The guide is a nonmodal card; there is no screen-covering tour backdrop. */
.tour-panel {
  display: flex;
  flex-direction: column;
  position: fixed;
  z-index: 90;
  right: 24px;
  bottom: 24px;
  width: 380px;
  max-width: calc(100vw - 286px);
  max-height: calc(100vh - 110px);
  max-height: calc(100dvh - 110px);
  overflow: hidden;
  padding: 20px;
  border: 1px solid #cbb5e7;
  border-radius: 20px;
  background: #fff;
  color: #252339;
  box-shadow: 0 12px 45px #3f2a5a26, 0 2px 7px #3f2a5a0a;
}

.tour-panel[data-side="left"] {
  right: auto;
  left: calc(238px + 24px);
}

.tour-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: -5px -7px 10px 0;
}

.tour-header > div {
  flex: 1;
  min-width: 0;
}

.tour-header .tour-kicker {
  min-width: 0;
}

.tour-header,
.tour-progress,
.tour-footer,
.tour-keyboard {
  flex-shrink: 0;
}

.tour-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

#tour-count {
  flex-shrink: 0;
  color: #75677f;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.4;
  white-space: nowrap;
}

.tour-close {
  display: grid;
  place-items: center;
  width: auto;
  min-width: 64px;
  height: 44px;
  padding: 11px;
  font-size: 14px;
  font-weight: 650;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #6b5b7b;
  cursor: pointer;
}

.tour-close:hover {
  background: #f1eaf9;
  color: #6846a0;
}

.tour-close .icon {
  width: 20px;
  height: 20px;
}

#tour-title {
  margin: 0 0 10px;
  color: #352642;
  font-size: 22px;
  font-weight: 720;
  line-height: 1.3;
  letter-spacing: -.5px;
  overflow-wrap: anywhere;
}

#tour-copy {
  margin: 0;
  color: #61566e;
  font-size: 15px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.tour-tip {
  padding: 12px 13px;
  margin-top: 15px;
  border: 1px solid #e7daf5;
  border-left: 3px solid #aa86d2;
  border-radius: 10px;
  background: #f7f2fd;
  color: #6b517e;
  font-size: 14px;
  line-height: 1.65;
}

.tour-tip:empty {
  display: none;
}

.tour-tip p {
  margin: 0;
}

.tour-progress {
  height: 5px;
  margin: 19px 0 16px;
  overflow: hidden;
  border-radius: 8px;
  background: #eae1f4;
}

.tour-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #7457df;
  transition: width .2s ease;
}

.tour-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tour-actions:empty {
  display: none;
}

.tour-try {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
  white-space: normal;
}

.tour-footer {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  margin-top: 13px;
}

.tour-footer button {
  min-width: 98px;
  min-height: 44px;
  padding: 10px 15px;
  font-size: 14px;
  line-height: 1.5;
  white-space: normal;
}

.tour-footer button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.tour-keyboard {
  margin: 13px 0 0;
  color: #74687f;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.tour-keyboard kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid #dfd5e8;
  border-radius: 5px;
  background: #faf7fd;
  color: #63566f;
  font: inherit;
  font-size: 13px;
}

.tour-target {
  outline: 3px solid #7457df !important;
  outline-offset: 5px;
  box-shadow: 0 0 0 8px #7457df17;
  scroll-margin-top: 110px;
  scroll-margin-bottom: var(--tour-space, 340px);
}

body.tour-active .app-main {
  padding-bottom: var(--tour-space, 340px);
}

.tour-welcome button:focus-visible,
.tour-panel button:focus-visible,
.tour-launch:focus-visible,
.tour-resume-chip:focus-visible,
.tour-settings-entry button:focus-visible {
  outline: 3px solid #9272d2;
  outline-offset: 3px;
}

/* Inline help remains visible while a lesson or toolkit dialog is open. */
.tour-modal-guide {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 20px;
  padding: 15px 16px;
  border: 1px solid #d8c3ee;
  border-radius: 12px;
  background: #f5effc;
  color: #65477b;
  font-size: 14px;
  line-height: 1.65;
}

.tour-modal-guide .icon {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex: 0 0 auto;
  color: #8061b1;
}

.tour-modal-guide p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
}

.tour-modal-guide strong {
  color: #57356f;
  font-weight: 700;
}

.tour-settings-entry {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  padding: 21px;
  border: 1px solid #e4d6f1;
  border-radius: 16px;
  background: #fbf8ff;
  color: #483751;
}

.tour-settings-entry > .icon {
  width: 42px;
  height: 42px;
  padding: 10px;
  border-radius: 12px;
  background: #eee4f9;
  color: #7a55ac;
}

.tour-settings-entry h2,
.tour-settings-entry h3 {
  margin: 0 0 6px;
  color: #513a62;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: -.25px;
}

.tour-settings-entry p {
  margin: 0;
  color: #706078;
  font-size: 14px;
  line-height: 1.65;
}

.tour-settings-entry button {
  min-height: 44px;
  padding: 10px 15px;
  font-size: 14px;
  line-height: 1.5;
  white-space: normal;
}

@media (max-width: 1100px) and (min-width: 761px) {
  .tour-panel {
    width: 350px;
  }

  .tour-settings-entry {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .tour-settings-entry > button {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .tour-panel,
  .tour-panel[data-side="left"] {
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    max-height: 55vh;
    max-height: min(55dvh, 440px);
    padding: 17px 18px;
    border-radius: 18px;
    overflow: hidden;
  }

  .tour-keyboard {
    display: none;
  }

  .tour-header {
    margin-bottom: 8px;
  }

  #tour-title {
    font-size: 21px;
    margin-bottom: 8px;
  }

  #tour-copy {
    font-size: 15px;
    line-height: 1.65;
  }

  .tour-tip {
    margin-top: 13px;
    font-size: 14px;
  }

  .tour-progress {
    margin-top: 16px;
    margin-bottom: 14px;
  }

  .tour-footer {
    gap: 10px;
  }

  .tour-footer button {
    flex: 1;
  }

  .tour-target {
    outline-offset: 4px;
    scroll-margin-top: 90px;
  }

  .tour-welcome {
    padding: 16px;
  }

  .tour-welcome-card {
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    padding: 25px;
    border-radius: 21px;
  }

  .tour-settings-entry {
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: start;
    padding: 19px;
  }

  .tour-settings-entry > button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 500px) {
  .tour-launch {
    width: auto;
    min-width: 96px;
    padding: 10px 11px;
    font-size: 14px;
  }

  .tour-launch > span,
  .tour-launch .tour-launch-label {
    display: inline;
  }

  .topbar .preview-pill {
    display: none;
  }

  .tour-welcome-card {
    padding: 23px;
  }

  .tour-welcome-card h2,
  #tour-welcome-title {
    font-size: 22px;
  }

  .tour-welcome-actions {
    flex-direction: column;
  }

  .tour-welcome-actions > button {
    width: 100%;
  }

  .tour-panel,
  .tour-panel[data-side="left"] {
    padding: 15px 16px;
  }

  #tour-title {
    font-size: 20px;
  }

  .tour-header {
    gap: 7px;
  }

  .tour-kicker {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tour-launch,
  .tour-resume-chip,
  .tour-progress > span {
    transition: none;
  }

  .tour-target {
    scroll-behavior: auto;
  }
}

@media print {
  .tour-welcome,
  .tour-panel,
  .tour-launch,
  .tour-resume-chip,
  .tour-modal-guide,
  .tour-settings-entry {
    display: none !important;
  }

  .tour-target {
    outline: none !important;
    box-shadow: none !important;
  }

  body.tour-active .app-main {
    padding-bottom: 0;
  }
}

#welcome-profile { margin: 18px 0; padding: 16px; background: #f8f5fc; border-radius: 12px; }
#welcome-profile input { font-size: 16px; }
#welcome-profile p { margin: 8px 0 0; }
