.lab-tour-start { justify-self: start; }
.lab-header-actions { display: flex; flex: none; align-items: center; gap: .4rem; }
.lab-guide { display: inline-flex; align-items: center; gap: .35rem; min-height: 40px; padding: .35rem .45rem; border: 0; border-radius: 8px; background: transparent; color: #d4bea4; font: inherit; font-size: .75rem; cursor: pointer; }
.lab-guide > span:first-child { display: grid; place-items: center; width: 17px; height: 17px; border: 1px solid currentColor; border-radius: 50%; font-size: .7rem; }
.lab-guide:hover { color: #e2b376; background: rgba(226, 179, 118, .06); }
.lab-guide:focus-visible, .lab-tour button:focus-visible { outline: 2px solid #e2b376; outline-offset: 3px; }
.lab-melody-header { grid-template-columns: minmax(0, 1fr) auto; }
body.lab-tour-active { overflow: hidden; }
body.lab-tour-active dialog:not(.lab-tour):not(.lab-tour-panel) { visibility: hidden; }
body.lab-tour-active dialog:not(.lab-tour)::backdrop { background: transparent; }
.lab-tour { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: #f1e5d5; overflow: hidden; }
.lab-tour::backdrop { background: transparent; }
.lab-tour-spotlight { position: absolute; border: 2px solid #e2b376; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(12, 9, 7, .76); pointer-events: none; }
.lab-tour-spotlight.is-unavailable { border-color: transparent; }
.lab-tour-popup { position: absolute; z-index: 1; box-sizing: border-box; display: flex; flex-direction: column; width: min(360px, calc(100% - 24px)); padding: 1.1rem; border: 1px solid #8c6f50; border-radius: 14px; background: #2b241e; box-shadow: 0 12px 35px rgba(0, 0, 0, .35); font-family: inherit; overflow: hidden; overflow-wrap: anywhere; animation: lab-tour-enter .16s ease-out; }
.lab-tour-copy { min-height: 0; overflow-y: auto; color-scheme: dark; scrollbar-width: thin; }
.lab-tour-progress, .lab-tour-notice, .lab-tour-actions { flex-shrink: 0; }
.lab-tour-popup h2 { margin: .65rem 1.2rem .65rem 0; font-size: 1.1rem; line-height: 1.3; }
.lab-tour-popup p { line-height: 1.5; }
#lab-tour-description { margin: 0; color: #ead8c2; font-size: .88rem; }
.lab-tour-book-reference { margin: .65rem 0 0; color: #d4bea4; font-size: .75rem; }
.lab-tour-progress { margin: 0 1.4rem 0 0; color: #e2b376; font-size: .72rem; }
.lab-tour-notice { margin: .8rem 0; color: #bbab99; font-size: .72rem; }
.lab-tour-close { position: absolute; right: .4rem; top: .3rem; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: #ead8c2; font-size: 1.6rem; cursor: pointer; }
.lab-tour-actions { display: flex; justify-content: space-between; gap: .6rem; }
.lab-tour-actions .lab-button { min-height: 42px; min-width: 80px; }
.lab-tour-arrow { position: absolute; width: 9px; height: 9px; background: #e2b376; transform: rotate(45deg); pointer-events: none; }
/* Keep the pointer inside the card so overflow scrolling cannot clip it. */
[data-side="top"] .lab-tour-arrow { top: 0; left: var(--tour-arrow); }
[data-side="bottom"] .lab-tour-arrow { bottom: 0; left: var(--tour-arrow); }
[data-side="left"] .lab-tour-arrow { left: 0; top: var(--tour-arrow); }
[data-side="right"] .lab-tour-arrow { right: 0; top: var(--tour-arrow); }
@keyframes lab-tour-enter { from { opacity: 0; } to { opacity: 1; } }
@media (max-height: 599px) {
  .lab-tour-notice { display: none; }
  .lab-tour-popup { padding: .75rem; }
  .lab-tour-actions { margin-top: .5rem; }
}
@media (max-width: 540px) {
  .lab-panel-header { flex-wrap: wrap; }
  .lab-tool-header { gap: .45rem; }
  .lab-tool-heading { gap: .5rem; }
  .lab-guide { padding-inline: .25rem; }
  .lab-header-actions { gap: .15rem; }
}
@media (prefers-reduced-motion: reduce) {
  .lab-tour-popup { animation: none; }
  body.lab-tour-active, body.lab-tour-active * { scroll-behavior: auto !important; }
}
