:root {
    --fhm-tour-bg: #171717;
    --fhm-tour-surface: #1f1f1f;
    --fhm-tour-border: #343434;
    --fhm-tour-text: #e5e7eb;
    --fhm-tour-muted: #b6bcc6;
    --fhm-tour-accent: #b91c1c;
    --fhm-tour-accent-hover: #dc2626;
}

.fhm-tour-active::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 9998;
    pointer-events: none;
}

.shepherd-element.fhm-tour-step {
    z-index: 10000 !important;
    max-width: min(440px, calc(100vw - 24px)) !important;
}

.shepherd-element.fhm-tour-step.fhm-tour-step--content,
.shepherd-element.fhm-tour-step.fhm-tour-step--sidebar {
    max-width: min(440px, calc(100vw - 24px)) !important;
}

.shepherd-element.fhm-tour-step .shepherd-content {
    background: linear-gradient(160deg, var(--fhm-tour-bg) 0%, var(--fhm-tour-surface) 100%);
    color: var(--fhm-tour-text);
    border: 1px solid var(--fhm-tour-border);
    border-radius: 0;
    box-shadow:
        0 18px 34px rgba(0, 0, 0, 0.45);
    width: min(440px, calc(100vw - 24px));
    min-width: 0;
    max-width: 440px;
    min-height: 205px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.shepherd-element.fhm-tour-step .shepherd-header {
    background: linear-gradient(180deg, #232323 0%, #1b1b1b 100%) !important;
    border-bottom: 1px solid #343434 !important;
    padding: 14px 16px 10px;
}

.shepherd-element.fhm-tour-step .shepherd-title {
    color: #e5e7eb !important;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.015em;
}

.shepherd-element.fhm-tour-step .shepherd-text {
    color: var(--fhm-tour-muted);
    line-height: 1.55;
    font-size: 0.9rem;
    padding: 12px 16px;
    flex: 1;
}

.shepherd-element.fhm-tour-step .shepherd-text small {
    color: #7f8997;
    display: inline-block;
    margin-top: 2px;
}

.shepherd-element.fhm-tour-step .shepherd-footer {
    border-top: 1px solid #343434;
    padding: 12px 16px 14px;
    gap: 10px;
    justify-content: space-between;
    background: #1a1a1a;
}

.shepherd-element.fhm-tour-step .shepherd-button {
    border-radius: 0;
    font-weight: 700;
    letter-spacing: 0.01em;
    min-height: 38px;
    padding: 9px 14px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    box-shadow: none;
}

.shepherd-element.fhm-tour-step .fhm-tour-btn {
    margin-left: auto;
    background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%);
    color: #ffffff;
    border-color: #7f1d1d;
}

.shepherd-element.fhm-tour-step .fhm-tour-btn:hover {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    transform: translateY(-1px);
}

.shepherd-element.fhm-tour-step .fhm-tour-btn--secondary {
    background: #2a2a2a;
    color: #d1d5db;
    border-color: #4a4a4a;
}

.shepherd-element.fhm-tour-step .fhm-tour-btn--secondary:hover {
    background: #333333;
    color: #ffffff;
}

.shepherd-element.fhm-tour-step .shepherd-cancel-icon {
    color: #9ca3af;
    font-size: 1.05rem;
    transition: color 0.2s ease;
}

.shepherd-element.fhm-tour-step .shepherd-cancel-icon:hover {
    color: #f9fafb;
}

.shepherd-element.fhm-tour-step.shepherd-has-title .shepherd-content .shepherd-arrow:before {
    background: var(--fhm-tour-bg);
    border: 1px solid var(--fhm-tour-border);
}

.shepherd-element.fhm-tour-step .shepherd-arrow,
.shepherd-element.fhm-tour-step .shepherd-arrow::before {
    display: none !important;
}

.fhm-tour-target-highlight {
    position: relative;
    z-index: 9999 !important;
    border-radius: 12px;
    box-shadow:
        0 0 0 2px rgba(239, 68, 68, 0.9),
        0 0 0 8px rgba(239, 68, 68, 0.2),
        0 12px 30px rgba(0, 0, 0, 0.45);
    transition: box-shadow 0.2s ease;
}

.fhm-tour-avatar {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: clamp(150px, 16vw, 210px);
    height: clamp(150px, 16vw, 210px);
    z-index: 10001;
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px) scale(0.98);
    transition: opacity 0.2s ease, transform 0.2s ease;
    border-radius: 9999px;
    border: none;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
}

.fhm-tour-avatar::before {
    content: "";
    position: absolute;
    width: 40px;
    height: 40px;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 9999px;
    background: radial-gradient(circle at 40% 34%, #f5cfae 0%, #e4b58f 62%, #cf9b76 100%);
    box-shadow:
        0 -7px 0 4px #1f2937,
        inset 0 -3px 0 rgba(0, 0, 0, 0.08);
}

.fhm-tour-avatar::after {
    content: "";
    position: absolute;
    width: 76px;
    height: 52px;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    border-radius: 42px 42px 24px 24px;
    background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
    box-shadow:
        inset 0 3px 0 rgba(255, 255, 255, 0.08),
        0 6px 12px rgba(0, 0, 0, 0.25);
}

.fhm-tour-avatar-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 9999px;
    opacity: 0.96;
}

.fhm-tour-avatar .fhm-tour-avatar-image {
    display: block;
}

.fhm-tour-avatar svg {
    width: 100%;
    height: 100%;
}

.fhm-tour-avatar dotlottie-wc {
    display: block;
    width: 100%;
    height: 100%;
    transform: scale(1.65);
    transform-origin: center center;
}

.fhm-tour-avatar.fhm-tour-avatar--ready {
    display: block;
}

.fhm-tour-avatar.fhm-tour-avatar--ready::before,
.fhm-tour-avatar.fhm-tour-avatar--ready::after {
    display: none;
}

.fhm-tour-avatar.fhm-tour-avatar--ready .fhm-tour-avatar-image {
    /* Keep fallback visible even if the remote animation fails in production. */
    display: block;
}

.fhm-tour-avatar.is-active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Extra resilience: if JS fails to toggle `is-active`, still show avatar while tour is active. */
body.fhm-tour-active #tour-avatar {
    opacity: 1;
    transform: translateY(0) scale(1);
}
