/**
 * Against Stones — guided tour overlay (spotlight + panel)
 * z-index above header (10051) and megaphone (10050)
 */
:root {
    --as-tour-overlay: rgba(12, 15, 22, 0.80);
    --as-tour-gold: #c9a227;
    --as-tour-gold-soft: rgba(201, 162, 39, 0.35);
    --as-tour-panel-bg: #1a1f2e;
    --as-tour-panel-bg-inner: rgba(22, 27, 40, 0.98);
    --as-tour-z-shade: 10100;
    --as-tour-z-ring: 10101;
    --as-tour-z-panel: 10102;
    --as-tour-scrollbar-track: rgba(12, 15, 22, 0.65);
    --as-tour-scrollbar-thumb: rgba(201, 162, 39, 0.55);
}

html.as-tour-active,
body.as-tour-active {
    overflow: hidden;
    overflow-x: hidden;
    touch-action: none;
}

/* Functional page framing — scale/pan for panel room, not decorative effects */
.as-tour-page-wrap {
    position: relative;
    width: 100%;
    min-height: 100%;
    will-change: transform;
}

.as-tour-page-wrap--framed,
.as-tour-page-wrap--zoomed {
    transform-origin: var(--as-tour-frame-origin-x, 50%) var(--as-tour-frame-origin-y, 40%);
}

html.as-tour-frame-active .as-tour-page-wrap--framed,
html.as-tour-zoom-active .as-tour-page-wrap--zoomed {
    backface-visibility: hidden;
}

.as-guided-tour {
    position: fixed;
    inset: 0;
    z-index: var(--as-tour-z-shade);
    pointer-events: auto;
}

.as-guided-tour[hidden] {
    display: none !important;
}

.as-guided-tour__overlay {
    position: fixed;
    inset: 0;
    z-index: var(--as-tour-z-shade);
    pointer-events: auto;
}

.as-guided-tour__overlay-svg {
    display: block;
    width: 100%;
    height: 100%;
}

.as-guided-tour__overlay-fill {
    fill: var(--as-tour-overlay);
    transition: fill 0.2s ease;
}

.as-guided-tour__ring {
    position: fixed;
    z-index: var(--as-tour-z-ring);
    pointer-events: none;
    border: 2px solid var(--as-tour-gold);
    border-radius: 12px;
    box-shadow:
        0 0 0 1px rgba(201, 162, 39, 0.4),
        0 0 28px rgba(201, 162, 39, 0.28);
    transition:
        top 0.3s ease,
        left 0.3s ease,
        width 0.3s ease,
        height 0.3s ease;
}

.as-guided-tour__ring[hidden] {
    display: none !important;
}

.as-guided-tour--centered .as-guided-tour__overlay {
    inset: 0;
}

/* Deadlock recovery — panel always above overlay with visible controls */
.as-guided-tour--panel-fallback .as-guided-tour__panel {
    z-index: calc(var(--as-tour-z-panel) + 2);
    bottom: clamp(16px, 4vw, 28px);
    top: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(640px, calc(100dvw - 32px));
    max-width: min(640px, calc(100dvw - 32px));
    max-height: min(72vh, calc(100dvh - 48px));
}

.as-guided-tour--panel-fallback .as-guided-tour__header,
.as-guided-tour--panel-fallback .as-guided-tour__footer,
.as-guided-tour--panel-fallback .as-guided-tour__nav,
.as-guided-tour--panel-fallback .as-guided-tour__skip,
.as-guided-tour--panel-fallback .as-guided-tour__btn {
    position: relative;
    z-index: 1;
}

/* Panel shell — metadata/help chrome, not site cards */
.as-guided-tour__panel {
    position: fixed;
    z-index: var(--as-tour-z-panel);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: min(640px, calc(100dvw - 32px));
    max-width: min(640px, calc(100dvw - 32px));
    max-height: min(90vh, calc(100dvh - 32px));
    min-width: 280px;
    min-height: 200px;
    overflow: hidden;
    overflow-x: hidden;
    background:
        linear-gradient(135deg, rgba(201, 162, 39, 0.04) 0%, transparent 42%),
        var(--as-tour-panel-bg-inner);
    border: 2px dashed rgba(201, 162, 39, 0.42);
    border-radius: 14px;
    padding: clamp(14px, 3vw, 22px);
    box-shadow:
        0 18px 52px rgba(0, 0, 0, 0.52),
        0 0 0 1px rgba(201, 162, 39, 0.12),
        inset 4px 0 0 var(--as-tour-gold);
    pointer-events: auto;
}

.as-guided-tour__panel--free,
.as-guided-tour__panel--resized {
    max-width: 90vw;
    max-height: 85vh;
}

.as-guided-tour__panel--top {
    top: clamp(72px, 10vh, 96px);
    max-height: min(90vh, calc(100dvh - clamp(72px, 10vh, 96px) - 16px));
}

.as-guided-tour__panel--bottom {
    bottom: clamp(16px, 4vw, 28px);
}

.as-guided-tour__header {
    flex: 0 0 auto;
    min-width: 0;
    max-width: 100%;
    padding-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    border-bottom: 1px dashed rgba(201, 162, 39, 0.22);
    margin-bottom: 2px;
}

.as-guided-tour__header-brand {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.as-guided-tour__guide-icon {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    stroke: var(--as-tour-gold);
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.92;
}

.as-guided-tour__header-identity {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.as-guided-tour__guide-chip {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #0a0c12;
    background: linear-gradient(135deg, #d4ad2f 0%, #a8841e 100%);
    border-radius: 4px;
    padding: 3px 7px;
    line-height: 1.2;
}

.as-guided-tour__meta-label {
    display: block;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: #94a3b8;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.as-guided-tour__header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.as-guided-tour__panel--draggable .as-guided-tour__header {
    cursor: grab;
    touch-action: none;
}

.as-guided-tour__panel--dragging .as-guided-tour__header {
    cursor: grabbing;
}

.as-guided-tour__step-label {
    flex: 1 1 auto;
    min-width: 0;
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--as-tour-gold);
    margin: 0;
    font-weight: 600;
}

.as-guided-tour__reset {
    flex: 0 0 auto;
    appearance: none;
    border: 1px solid rgba(201, 162, 39, 0.35);
    background: rgba(201, 162, 39, 0.08);
    color: var(--as-tour-gold);
    border-radius: 8px;
    width: 28px;
    height: 28px;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.as-guided-tour__reset:hover,
.as-guided-tour__reset:focus-visible {
    background: rgba(201, 162, 39, 0.18);
    border-color: rgba(201, 162, 39, 0.55);
    outline: 2px solid rgba(201, 162, 39, 0.35);
    outline-offset: 1px;
}

.as-guided-tour__reset-icon {
    font-size: 1rem;
    line-height: 1;
}

.as-guided-tour__panel--exploring,
.as-guided-tour__panel--free {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(201, 162, 39, 0.2);
}

.as-guided-tour__resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 44px;
    height: 44px;
    cursor: nwse-resize;
    touch-action: none;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 0 6px 6px 0;
    border: none;
    background: transparent;
    border-radius: 0 0 16px 0;
}

.as-guided-tour__resize-handle::before {
    content: '';
    width: 14px;
    height: 14px;
    background:
        radial-gradient(circle at 100% 100%, var(--as-tour-gold) 1.5px, transparent 1.6px),
        radial-gradient(circle at 66% 100%, rgba(201, 162, 39, 0.75) 1.5px, transparent 1.6px),
        radial-gradient(circle at 100% 66%, rgba(201, 162, 39, 0.75) 1.5px, transparent 1.6px),
        radial-gradient(circle at 33% 100%, rgba(201, 162, 39, 0.45) 1.5px, transparent 1.6px),
        radial-gradient(circle at 100% 33%, rgba(201, 162, 39, 0.45) 1.5px, transparent 1.6px);
    opacity: 0.85;
    transition: opacity 0.15s ease;
}

.as-guided-tour__resize-handle:hover::before,
.as-guided-tour__resize-handle:focus-visible::before,
.as-guided-tour__panel--resizing .as-guided-tour__resize-handle::before {
    opacity: 1;
}

.as-guided-tour__resize-handle:focus-visible {
    outline: 2px solid rgba(201, 162, 39, 0.45);
    outline-offset: -4px;
}

.as-guided-tour__panel--resizing .as-guided-tour__resize-handle {
    cursor: nwse-resize;
}

html.as-tour-exploring .as-guided-tour__overlay,
.as-guided-tour--exploring .as-guided-tour__overlay {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden;
}

html.as-tour-exploring .as-guided-tour__ring,
.as-guided-tour--exploring .as-guided-tour__ring {
    opacity: 0 !important;
    visibility: hidden;
}

html.as-tour-exploring,
body.as-tour-exploring {
    touch-action: auto;
}

.as-guided-tour__scroll {
    flex: 1 1 auto;
    min-height: 72px;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--as-tour-scrollbar-thumb) var(--as-tour-scrollbar-track);
}

.as-guided-tour__scroll::-webkit-scrollbar {
    width: 6px;
}

.as-guided-tour__scroll::-webkit-scrollbar-track {
    background: var(--as-tour-scrollbar-track);
    border-radius: 3px;
}

.as-guided-tour__scroll::-webkit-scrollbar-thumb {
    background: var(--as-tour-scrollbar-thumb);
    border-radius: 3px;
}

.as-guided-tour__scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 162, 39, 0.75);
}

.as-guided-tour__interaction-hint {
    flex: 0 0 auto;
    margin: 10px 0 0;
    padding: 8px 10px;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 0.68rem;
    line-height: 1.45;
    letter-spacing: 0.02em;
    color: #64748b;
    text-align: center;
    background: rgba(12, 15, 22, 0.55);
    border: 1px dashed rgba(201, 162, 39, 0.18);
    border-radius: 8px;
    overflow-wrap: anywhere;
}

.as-guided-tour__footer {
    flex: 0 0 auto;
    min-width: 0;
    max-width: 100%;
    padding-top: 12px;
    border-top: 1px dashed rgba(201, 162, 39, 0.16);
    margin-top: 8px;
}

.as-guided-tour__title {
    margin: 0 0 10px;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.15rem, 3.5vw, 1.45rem);
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.3;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-wrap: break-word;
}

.as-guided-tour__body {
    margin: 0;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: clamp(0.9rem, 2.8vw, 1rem);
    line-height: 1.6;
    color: #cbd5e1;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    overflow-wrap: anywhere;
    word-wrap: break-word;
}

.as-guided-tour__body p {
    margin: 0 0 10px;
}

.as-guided-tour__body p:last-child {
    margin-bottom: 0;
}

.as-guided-tour__body img,
.as-guided-tour__body video,
.as-guided-tour__body table,
.as-guided-tour__body pre {
    max-width: 100%;
}

.as-guided-tour__body strong {
    color: #e2e8f0;
    font-weight: 600;
}

.as-guided-tour__dev-warn {
    margin: 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px dashed rgba(239, 68, 68, 0.45);
    color: #fecaca;
    font-size: 0.85rem;
}

.as-guided-tour__dev-warn code {
    color: #fca5a5;
}

.as-guided-tour--panel-fallback:not(.as-guided-tour--centered) .as-guided-tour__ring {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.as-guided-tour__panel--image {
    min-height: 320px;
}

.as-guided-tour__image-strip {
    flex: 0 0 auto;
    flex-shrink: 0;
    min-height: 120px;
    max-width: 100%;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(201, 162, 39, 0.25);
}

.as-guided-tour__image-strip[hidden] {
    display: none !important;
}

.as-guided-tour__image-fallback {
    margin: 0;
    padding: 16px;
    text-align: center;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 0.85rem;
    line-height: 1.45;
    color: #94a3b8;
    font-style: italic;
}

.as-guided-tour__image-strip--error .as-guided-tour__image {
    display: none;
}

.as-guided-tour__image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: min(28vh, 260px);
    object-fit: contain;
    border-radius: 12px;
    margin: 0;
    border: none;
    background: transparent;
}

.as-guided-tour__image[hidden] {
    display: none !important;
}

.as-guided-tour__nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    min-width: 0;
    max-width: 100%;
}

.as-guided-tour__btn {
    appearance: none;
    border: none;
    cursor: pointer;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 10px 20px;
    min-width: 0;
    transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.as-guided-tour__btn--primary {
    background: linear-gradient(135deg, #c9a227 0%, #a8841e 100%);
    color: #0a0c12;
    margin-left: auto;
}

.as-guided-tour__btn--primary:hover,
.as-guided-tour__btn--primary:focus-visible {
    background: linear-gradient(135deg, #d4ad2f 0%, #b89222 100%);
    outline: 2px solid rgba(201, 162, 39, 0.5);
    outline-offset: 2px;
}

.as-guided-tour__btn--ghost {
    background: transparent;
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.as-guided-tour__btn--ghost:hover,
.as-guided-tour__btn--ghost:focus-visible {
    color: #e2e8f0;
    border-color: rgba(201, 162, 39, 0.4);
}

.as-guided-tour__btn--ghost:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.as-guided-tour__skip {
    width: 100%;
    margin-top: 8px;
    text-align: center;
    font-size: 0.78rem;
    color: #64748b;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 4px;
}

.as-guided-tour__skip:hover,
.as-guided-tour__skip:focus-visible {
    color: #94a3b8;
}

/* Wider panel for 5-step journey schema */
.as-guided-tour__panel--journey {
    width: min(680px, calc(100dvw - 32px));
    max-width: min(680px, calc(100dvw - 32px));
    max-height: min(90vh, calc(100dvh - 24px));
}

@media (max-width: 768px) {
    .as-guided-tour__panel {
        width: calc(100dvw - 24px);
        max-width: calc(100dvw - 24px);
        min-height: 260px;
        max-height: min(72vh, calc(100dvh - 96px));
        padding: clamp(14px, 4vw, 20px);
    }

    .as-guided-tour__btn {
        min-height: 44px;
        padding: 12px 20px;
    }

    .as-guided-tour__reset {
        width: 44px;
        height: 44px;
    }

    .as-guided-tour__panel--dock-bottom,
    .as-guided-tour__panel--below-target,
    .as-guided-tour__panel--dock-top,
    .as-guided-tour__panel--above-target {
        min-height: 240px;
        max-height: min(62vh, calc(100dvh - 120px));
    }

    .as-guided-tour__scroll {
        flex: 1 1 auto;
        min-height: 96px;
    }

    .as-guided-tour__footer {
        flex: 0 0 auto;
    }

    .as-guided-tour__title {
        font-size: clamp(1.05rem, 4.5vw, 1.35rem);
    }

    .as-guided-tour__body {
        font-size: clamp(0.88rem, 3.6vw, 0.98rem);
        line-height: 1.55;
    }

    .as-guided-tour__panel--top {
        max-height: min(85vh, calc(100dvh - clamp(72px, 10vh, 96px) - 12px));
    }

    .as-guided-tour__panel--journey {
        width: calc(100dvw - 24px);
        max-width: calc(100dvw - 24px);
    }

    .as-guided-tour__panel--bottom {
        bottom: max(12px, env(safe-area-inset-bottom, 12px));
    }

    .as-guided-tour__panel--image {
        min-height: 280px;
    }

    .as-guided-tour__image-strip {
        min-height: 120px;
    }

    .as-guided-tour__image {
        max-height: min(24vh, 200px);
    }

    .as-guided-tour__nav {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .as-guided-tour__btn--primary {
        margin-left: 0;
        width: 100%;
        text-align: center;
    }

    .as-guided-tour__btn--ghost {
        width: 100%;
        text-align: center;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .as-guided-tour__panel {
        width: min(640px, calc(100dvw - 32px));
        max-width: min(640px, calc(100dvw - 32px));
        min-height: 280px;
        max-height: min(68vh, calc(100dvh - 80px));
    }

    .as-guided-tour__panel--dock-bottom,
    .as-guided-tour__panel--below-target,
    .as-guided-tour__panel--dock-top,
    .as-guided-tour__panel--above-target {
        min-height: 260px;
        max-height: min(62vh, calc(100dvh - 110px));
    }

    .as-guided-tour__scroll {
        flex: 1 1 auto;
        min-height: 100px;
    }

    .as-guided-tour__footer {
        flex: 0 0 auto;
    }

    .as-guided-tour__btn {
        min-height: 44px;
        padding: 12px 20px;
    }

    .as-guided-tour__reset {
        width: 44px;
        height: 44px;
    }

    .as-tour-help-fab {
        width: 44px;
        height: 44px;
    }

    .as-guided-tour__panel--journey {
        width: min(680px, calc(100dvw - 32px));
        max-width: min(680px, calc(100dvw - 32px));
    }
}

/* Desktop side-dock — keeps centered spotlight (e.g. autonomy gauge) visible */
@media (min-width: 769px) {
    .as-guided-tour__panel--image {
        min-height: 360px;
    }

    .as-guided-tour__image-strip {
        min-height: 160px;
    }

    .as-guided-tour__panel--dock-left,
    .as-guided-tour__panel--dock-right {
        left: auto;
        right: auto;
        bottom: auto;
        transform: none;
        width: min(400px, calc(100dvw - 32px));
        max-width: 400px;
    }

    .as-guided-tour__panel--dock-left .as-guided-tour__scroll,
    .as-guided-tour__panel--dock-right .as-guided-tour__scroll,
    .as-guided-tour__panel--dock-bottom .as-guided-tour__scroll,
    .as-guided-tour__panel--below-target .as-guided-tour__scroll {
        flex: 1 1 72px;
        min-height: 72px;
    }

    .as-guided-tour__panel--dock-left.as-guided-tour__panel--top,
    .as-guided-tour__panel--dock-right.as-guided-tour__panel--top,
    .as-guided-tour__panel--dock-left.as-guided-tour__panel--bottom,
    .as-guided-tour__panel--dock-right.as-guided-tour__panel--bottom {
        bottom: auto;
    }

    .as-guided-tour__panel--dock-left.as-guided-tour__panel--journey,
    .as-guided-tour__panel--dock-right.as-guided-tour__panel--journey {
        width: min(400px, calc(100dvw - 32px));
        max-width: 400px;
    }

    /* Below-target dock — wide horizontal spotlights (e.g. search bar) */
    .as-guided-tour__panel--dock-bottom,
    .as-guided-tour__panel--below-target,
    .as-guided-tour__panel--dock-top,
    .as-guided-tour__panel--above-target {
        left: auto;
        right: auto;
        bottom: auto;
        transform: none;
    }

    .as-guided-tour__panel--dock-bottom.as-guided-tour__panel--top,
    .as-guided-tour__panel--dock-bottom.as-guided-tour__panel--bottom,
    .as-guided-tour__panel--below-target.as-guided-tour__panel--top,
    .as-guided-tour__panel--below-target.as-guided-tour__panel--bottom,
    .as-guided-tour__panel--dock-top.as-guided-tour__panel--top,
    .as-guided-tour__panel--dock-top.as-guided-tour__panel--bottom,
    .as-guided-tour__panel--above-target.as-guided-tour__panel--top,
    .as-guided-tour__panel--above-target.as-guided-tour__panel--bottom {
        top: auto;
        bottom: auto;
    }
}

/* Mobile — panel anchored below spotlight, not viewport bottom */
.as-guided-tour__panel--dock-bottom,
.as-guided-tour__panel--below-target {
    transform: none;
}

/* 5-step journey schema (index tour step only) */
.as-tour-journey-schema {
    margin: 14px 0 0;
    padding-top: 14px;
    border-top: 1px solid rgba(201, 162, 39, 0.22);
    overflow-x: hidden;
    max-width: 100%;
}

.as-tour-journey-schema__steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
    gap: 6px 2px;
    overflow-x: hidden;
    max-width: 100%;
}

.as-tour-journey-schema__step {
    position: relative;
    flex: 1 1 88px;
    max-width: 108px;
    min-width: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.as-tour-journey-schema__connector {
    display: none;
}

.as-tour-journey-schema__ring {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid rgba(201, 162, 39, 0.42);
    background: rgba(15, 23, 42, 0.55);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.as-tour-journey-schema__step--exchange .as-tour-journey-schema__ring {
    width: 60px;
    height: 60px;
    border-width: 2px;
    border-color: var(--as-tour-gold);
    background: rgba(201, 162, 39, 0.16);
    box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.2), 0 4px 14px rgba(0, 0, 0, 0.28);
}

.as-tour-journey-schema__icon svg {
    width: 22px !important;
    height: 22px !important;
    stroke: var(--as-tour-gold);
}

.as-tour-journey-schema__step--exchange .as-tour-journey-schema__icon svg {
    width: 26px !important;
    height: 26px !important;
}

.as-tour-journey-schema__label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #e2e8f0;
    line-height: 1.2;
    overflow-wrap: anywhere;
    word-wrap: break-word;
    max-width: 100%;
}

.as-tour-journey-schema__step--exchange .as-tour-journey-schema__label {
    color: var(--as-tour-gold);
}

.as-tour-journey-schema__tagline {
    display: none;
    font-size: 0.68rem;
    line-height: 1.35;
    color: #94a3b8;
}

.as-guided-tour__panel--journey .as-tour-journey-schema__tagline {
    display: block;
    max-width: 100px;
    margin: 0 auto;
    overflow-wrap: anywhere;
    word-wrap: break-word;
}

/* Narrow mobile: horizontal strip for 5 icons (no extra vertical scroll) */
@media (max-width: 559px) {
    .as-tour-journey-schema {
        margin-left: -4px;
        margin-right: -4px;
    }

    .as-tour-journey-schema__steps {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scrollbar-width: thin;
        scrollbar-color: var(--as-tour-scrollbar-thumb) transparent;
        padding-bottom: 6px;
    }

    .as-tour-journey-schema__steps::-webkit-scrollbar {
        height: 4px;
    }

    .as-tour-journey-schema__steps::-webkit-scrollbar-track {
        background: transparent;
    }

    .as-tour-journey-schema__steps::-webkit-scrollbar-thumb {
        background: var(--as-tour-scrollbar-thumb);
        border-radius: 2px;
    }

    .as-tour-journey-schema__step {
        flex: 0 0 auto;
        min-width: 76px;
        max-width: 88px;
        padding: 0 4px;
    }

    .as-guided-tour__panel--journey .as-tour-journey-schema__tagline {
        max-width: 84px;
        font-size: 0.64rem;
    }
}

@media (min-width: 560px) {
    .as-tour-journey-schema__connector {
        display: block;
        position: absolute;
        top: 26px;
        left: 0;
        width: 12px;
        height: 2px;
        background: linear-gradient(90deg, rgba(201, 162, 39, 0.15), rgba(201, 162, 39, 0.55));
        border-radius: 2px;
        transform: translateX(-100%);
        pointer-events: none;
    }

    .as-tour-journey-schema__step--exchange .as-tour-journey-schema__connector {
        top: 30px;
    }

    .as-tour-journey-schema__steps {
        flex-wrap: nowrap;
        gap: 0;
        overflow-x: hidden;
    }

    .as-tour-journey-schema__step {
        flex: 1 1 0;
        max-width: none;
        min-width: 0;
        overflow: hidden;
    }
}

/* Staff console — relaunch tour links in sidebars */
.employe-tour-launcher,
.ingenieur-tour-launcher {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.employe-tour-link,
.ingenieur-tour-link {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-decoration: none;
    font-size: 0.9rem;
}

.testeur-tour-launcher {
    margin-top: 12px;
}

.testeur-tour-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

/* ============================================================
   Aide contextuelle non intrusive (clic droit, bouton flottant, clavier)
   ============================================================ */
:root {
    --as-tour-help-z: 10095;
}

/* Header cluster — left of megaphone, gray like lang/site selectors */
.as-tour-help-fab {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: #b0b0b0;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    z-index: 1;
    transition: border-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.as-tour-help-fab:hover,
.as-tour-help-fab:focus-visible,
.as-tour-help-fab--open {
    border-color: #FFD700;
    color: #FFD700;
    outline: none;
    transform: scale(1.05);
}

html.as-tour-active .as-tour-help-fab,
body.as-tour-active .as-tour-help-fab {
    display: none !important;
}

@media (max-width: 768px) {
    .as-tour-help-fab {
        width: 44px;
        height: 44px;
        font-size: 0.95rem;
    }
}

.as-tour-help-menu {
    position: fixed;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: 300px;
    max-width: calc(100vw - 36px);
    max-height: 70vh;
    overflow-y: auto;
    background: var(--as-tour-panel-bg);
    color: #e7ebf3;
    border: 1px solid var(--as-tour-gold-soft);
    border-radius: 14px;
    padding: 14px;
    z-index: var(--as-tour-help-z);
    box-shadow: 0 12px 40px rgba(12, 15, 22, 0.5);
    scrollbar-width: thin;
    scrollbar-color: var(--as-tour-scrollbar-thumb) transparent;
}

.as-tour-help-menu[hidden] {
    display: none !important;
}

.as-tour-help-menu__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.as-tour-help-menu__title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--as-tour-gold);
}

.as-tour-help-menu__close,
.as-tour-help-pop__close {
    background: none;
    border: none;
    color: #9aa3b2;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.as-tour-help-menu__close:hover,
.as-tour-help-pop__close:hover {
    color: #fff;
}

.as-tour-help-menu__restart {
    display: block;
    width: 100%;
    text-align: left;
    background: rgba(201, 162, 39, 0.14);
    border: 1px solid var(--as-tour-gold-soft);
    color: var(--as-tour-gold);
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 12px;
}

.as-tour-help-menu__restart:hover {
    background: rgba(201, 162, 39, 0.22);
}

.as-tour-help-menu__intro {
    margin: 0 0 8px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #8b94a5;
}

.as-tour-help-menu__steps {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.as-tour-help-menu__step {
    display: block;
    width: 100%;
    text-align: left;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.16);
    color: #d9dee8;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.as-tour-help-menu__step:hover {
    background: rgba(201, 162, 39, 0.12);
    border-color: var(--as-tour-gold-soft);
    color: #fff;
}

.as-tour-help-menu__hint {
    margin: 0;
    font-size: 0.74rem;
    color: #7c8497;
    line-height: 1.4;
}

.as-tour-ctx-menu {
    position: fixed;
    z-index: calc(var(--as-tour-help-z) + 5);
    background: var(--as-tour-panel-bg);
    border: 1px solid var(--as-tour-gold-soft);
    border-radius: 10px;
    padding: 4px;
    box-shadow: 0 10px 30px rgba(12, 15, 22, 0.5);
    min-width: 200px;
}

.as-tour-ctx-menu__item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: #e7ebf3;
    border-radius: 7px;
    padding: 9px 10px;
    font-size: 0.88rem;
    cursor: pointer;
}

.as-tour-ctx-menu__item:hover {
    background: rgba(201, 162, 39, 0.16);
    color: #fff;
}

.as-tour-ctx-menu__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(201, 162, 39, 0.18);
    color: var(--as-tour-gold);
    font-weight: 700;
    font-size: 0.8rem;
    flex: 0 0 auto;
}

.as-tour-help-pop {
    position: fixed;
    z-index: calc(var(--as-tour-help-z) + 8);
    width: 360px;
    max-width: calc(100vw - 24px);
    max-height: 70vh;
    overflow-y: auto;
    background: var(--as-tour-panel-bg);
    color: #e7ebf3;
    border: 1px solid var(--as-tour-gold-soft);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 16px 48px rgba(12, 15, 22, 0.55);
    scrollbar-width: thin;
    scrollbar-color: var(--as-tour-scrollbar-thumb) transparent;
}

.as-tour-help-pop__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.as-tour-help-pop__chip {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--as-tour-gold);
    background: rgba(201, 162, 39, 0.14);
    border-radius: 6px;
    padding: 3px 8px;
}

.as-tour-help-pop__title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    color: #fff;
}

.as-tour-help-pop__body {
    font-size: 0.9rem;
    line-height: 1.55;
    color: #d3d9e4;
}

.as-tour-help-pop__body p {
    margin: 0 0 8px;
}

.as-tour-help-pop__foot {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.as-tour-help-pop__full {
    background: rgba(201, 162, 39, 0.16);
    border: 1px solid var(--as-tour-gold-soft);
    color: var(--as-tour-gold);
    border-radius: 9px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.as-tour-help-pop__full:hover {
    background: rgba(201, 162, 39, 0.26);
}

/* Opt-in prompt — first visit, non intrusive */
.as-tour-opt-in {
    position: fixed;
    inset: 0;
    z-index: calc(var(--as-tour-help-z) + 2);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: rgba(12, 15, 22, 0.55);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.as-tour-opt-in__card {
    width: min(420px, calc(100vw - 32px));
    background: var(--as-tour-panel-bg);
    color: #e7ebf3;
    border: 1px solid var(--as-tour-gold-soft);
    border-radius: 16px;
    padding: 22px 20px;
    box-shadow: 0 18px 48px rgba(12, 15, 22, 0.55);
}

.as-tour-opt-in__title {
    margin: 0 0 10px;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.25rem;
    color: #fff;
}

.as-tour-opt-in__question {
    margin: 0 0 18px;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #cbd5e1;
}

.as-tour-opt-in__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.as-tour-opt-in__btn {
    appearance: none;
    border-radius: 999px;
    padding: 10px 18px;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
}

.as-tour-opt-in__btn--yes {
    background: linear-gradient(135deg, #c9a227 0%, #a8841e 100%);
    color: #0a0c12;
}

.as-tour-opt-in__btn--no {
    background: transparent;
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.35);
}

.as-tour-opt-in__btn--yes:hover,
.as-tour-opt-in__btn--yes:focus-visible,
.as-tour-opt-in__btn--no:hover,
.as-tour-opt-in__btn--no:focus-visible {
    outline: 2px solid rgba(201, 162, 39, 0.35);
    outline-offset: 2px;
}
