/* ============================================
   FORMA APP - ONBOARDING SYSTEM STYLES
   Separate file to keep main styles clean
   ============================================ */

/* Onboarding Overlay */
.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(26, 32, 44, 0.95) 100%);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.onboarding-overlay.active {
    display: flex;
    opacity: 1;
}

body.light-theme .onboarding-overlay {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 252, 0.98) 100%);
}

/* Onboarding Container */
.onboarding-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    position: relative;
}

@media (max-width: 480px) {
    .onboarding-container {
        padding: var(--spacing-sm);
    }
}

/* Onboarding Screen */
.onboarding-screen {
    display: none;
    opacity: 0;
    transform: translateX(100px);
    width: 100%;
    max-width: 600px;
    animation: none;
}

.onboarding-screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 1;
    transform: translateX(0);
    animation: onboardingSlideInFromRight 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.onboarding-screen.exit-left {
    animation: onboardingSlideOutToLeft 0.4s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

.onboarding-screen.exit-right {
    animation: onboardingSlideOutToRight 0.4s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

@keyframes onboardingSlideInFromRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes onboardingSlideOutToLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-100px);
    }
}

@keyframes onboardingSlideOutToRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* Welcome Screen */
.onboarding-title {
    font-size: 1.375rem;
    font-weight: var(--font-weight-semibold);
    color: #FFFFFF;
    margin-bottom: var(--spacing-xs);
    text-align: center;
    letter-spacing: var(--tracking-tight);
}

body.light-theme .onboarding-title {
    color: #1a202c;
}

.onboarding-subtitle {
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-regular);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    margin-bottom: var(--spacing-md);
    max-width: 400px;
    padding: 0 var(--spacing-md);
}

body.light-theme .onboarding-subtitle {
    color: rgba(26, 32, 44, 0.7);
}

@media (max-width: 480px) {
    .onboarding-subtitle {
        margin-bottom: var(--spacing-md);
        padding: 0 var(--spacing-sm);
    }
}

/* Language Selection */
.language-options {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    width: 100%;
    max-width: 320px;
    margin-bottom: var(--spacing-md);
}

.language-option {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(104, 211, 145, 0.28);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
    min-height: 2.5rem;
    padding: 0.35rem 0.75rem;
}

.language-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(104, 211, 145, 0.1) 0%, rgba(72, 187, 120, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
.language-option:hover {
    border-color: rgba(104, 211, 145, 0.55);
    box-shadow: 0 2px 8px rgba(104, 211, 145, 0.16);
}
}


@media (hover: hover) and (pointer: fine) {
.language-option:hover::before {
    opacity: 1;
}
}


.language-option:active {
    opacity: 0.92;
}

body.light-theme .language-option {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(104, 211, 145, 0.3);
}

@media (hover: hover) and (pointer: fine) {
body.light-theme .language-option:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(104, 211, 145, 0.6);
}
}


.language-name {
    font-size: 0.875rem;
    font-weight: var(--font-weight-semibold);
    color: #FFFFFF;
    position: relative;
    z-index: 1;
}

body.light-theme .language-name {
    color: #1a202c;
}

/* Devices Screen */
.onboarding-device-options {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
    max-width: 320px;
    margin-bottom: var(--spacing-md);
}

.onboarding-device-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(104, 211, 145, 0.28);
    border-radius: 2px;
    padding: 0.4rem 0.65rem;
    text-align: left;
}

.onboarding-device-item--recommended {
    border-color: rgba(104, 211, 145, 0.45);
}

.onboarding-device-item i {
    font-size: 1rem;
    color: #68d391;
    width: 1.125rem;
    text-align: center;
    flex-shrink: 0;
}

.onboarding-device-text {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.onboarding-device-title {
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    color: #FFFFFF;
    min-width: 0;
}

.onboarding-device-description {
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-regular);
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.2;
    flex-shrink: 0;
    text-align: right;
    white-space: nowrap;
}

body.light-theme .onboarding-device-item {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(104, 211, 145, 0.3);
}

body.light-theme .onboarding-device-item--recommended {
    border-color: rgba(104, 211, 145, 0.55);
}

body.light-theme .onboarding-device-title {
    color: #1a202c;
}

body.light-theme .onboarding-device-description {
    color: rgba(26, 32, 44, 0.65);
}

/* Company Setup Screen */
.company-setup-options {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    width: 100%;
    max-width: 320px;
}

.setup-option {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(104, 211, 145, 0.28);
    border-radius: 2px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 2.5rem;
    padding: 0.45rem 0.75rem;
}

.setup-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(104, 211, 145, 0.15) 0%, rgba(72, 187, 120, 0.15) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
.setup-option:hover {
    border-color: rgba(104, 211, 145, 0.55);
    box-shadow: 0 2px 8px rgba(104, 211, 145, 0.16);
}
}


@media (hover: hover) and (pointer: fine) {
.setup-option:hover::before {
    opacity: 1;
}
}


body.light-theme .setup-option {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(104, 211, 145, 0.3);
}

.setup-option-title {
    font-size: 0.875rem;
    font-weight: var(--font-weight-semibold);
    color: #FFFFFF;
    margin-bottom: 0.15rem;
}

body.light-theme .setup-option-title {
    color: #1a202c;
}

.setup-option-description {
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-regular);
    color: rgba(255, 255, 255, 0.6);
}

body.light-theme .setup-option-description {
    color: rgba(26, 32, 44, 0.6);
}

/* Tutorial Carousel */
.tutorial-carousel {
    width: 100%;
    max-width: 700px;
    position: relative;
}

.carousel-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(104, 211, 145, 0.2);
    border-radius: var(--card-radius);
    padding: var(--spacing-md);
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(10px);
}

body.light-theme .carousel-content {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(104, 211, 145, 0.3);
}

@media (max-width: 480px) {
    .carousel-content {
        padding: var(--spacing-sm);
        min-height: 300px;
    }
}

.carousel-slide {
    display: none;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

.carousel-slide.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(104, 211, 145, 0.2) 0%, rgba(72, 187, 120, 0.2) 100%);
    border-radius: 50%;
    margin-bottom: var(--spacing-sm);
    font-size: 1.5rem;
}

.slide-gif {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 16px;
    margin-bottom: var(--spacing-sm);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(104, 211, 145, 0.2);
    object-fit: contain;
}

/* Tablets - keep nice size */
@media (max-width: 768px) {
    .slide-gif {
        max-width: 400px;
    }
}

/* Phones - smaller size */
@media (max-width: 480px) {
    .slide-gif {
        max-width: 300px;
    }
}

body.light-theme .slide-icon {
    background: linear-gradient(135deg, rgba(104, 211, 145, 0.15) 0%, rgba(72, 187, 120, 0.15) 100%);
}

.slide-title {
    font-size: 1.25rem;
    font-weight: var(--font-weight-semibold);
    color: #FFFFFF;
    margin-bottom: var(--spacing-xs);
    text-align: center;
    letter-spacing: var(--tracking-tight);
}

body.light-theme .slide-title {
    color: #1a202c;
}

.slide-description {
    font-size: var(--font-size-default);
    font-weight: var(--font-weight-regular);
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    line-height: 1.5;
    max-width: 500px;
}

body.light-theme .slide-description {
    color: rgba(26, 32, 44, 0.8);
}

.slide-features {
    list-style: none;
    padding: 0;
    margin: var(--spacing-md) 0 0 0;
    width: 100%;
    max-width: 500px;
}

.slide-features li {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-regular);
}

body.light-theme .slide-features li {
    color: rgba(26, 32, 44, 0.8);
}

.slide-features li i {
    color: #68d391;
    font-size: var(--font-size-default);
    flex-shrink: 0;
    margin-top: 0.125rem;
}

/* Carousel Navigation */
.carousel-navigation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
    width: 100%;
}

.carousel-buttons {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
}

/* Onboarding Buttons — match compact tutorial tip actions */
.onboarding-button {
    padding: 0 0.7rem;
    font-size: 0.6875rem;
    font-weight: var(--font-weight-semibold);
    line-height: 1;
    border-radius: 2px;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.22rem;
    position: relative;
    overflow: hidden;
    min-height: 24px;
    height: 24px;
    max-height: 24px;
    min-width: 0;
    width: auto;
    box-shadow: none;
    transform: none;
}

.onboarding-button i {
    font-size: 0.55rem;
}

.onboarding-button span {
    font-size: inherit;
    line-height: 1;
}

.onboarding-button::before {
    content: none;
    display: none;
}

.onboarding-button-primary {
    background: linear-gradient(135deg, #68d391 0%, #48bb78 100%);
    color: #000000;
    box-shadow: 0 1px 3px rgba(104, 211, 145, 0.28);
}

@media (hover: hover) and (pointer: fine) {
.onboarding-button-primary:hover {
    box-shadow: 0 2px 6px rgba(104, 211, 145, 0.35);
}
}


.onboarding-button-primary:active {
    opacity: 0.92;
}

.onboarding-button-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0 0.65rem;
}

@media (hover: hover) and (pointer: fine) {
.onboarding-button-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}
}


body.light-theme .onboarding-button-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: #1a202c;
    border-color: rgba(0, 0, 0, 0.1);
}

@media (hover: hover) and (pointer: fine) {
body.light-theme .onboarding-button-secondary:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.15);
}
}


.onboarding-button-text {
    background: none;
    color: rgba(255, 255, 255, 0.6);
    border: none;
    padding: 0 0.55rem;
    font-size: 0.6875rem;
    min-height: 24px;
    height: 24px;
    box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
.onboarding-button-text:hover {
    color: rgba(255, 255, 255, 0.9);
}
}


body.light-theme .onboarding-button-text {
    color: rgba(26, 32, 44, 0.6);
}

@media (hover: hover) and (pointer: fine) {
body.light-theme .onboarding-button-text:hover {
    color: rgba(26, 32, 44, 0.9);
}
}


@media (max-width: 480px) {
    .onboarding-button {
        min-height: 22px;
        height: 22px;
        max-height: 22px;
        padding: 0 0.55rem;
        font-size: 0.625rem;
    }

    .onboarding-button-text {
        width: auto;
        min-height: 22px;
        height: 22px;
        font-size: 0.625rem;
    }
}

/* Progress Bar */
.onboarding-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-md);
}

.progress-step {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 25%;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.progress-step.completed {
    background: #68d391;
}

.progress-step.current {
    background: #68d391;
    opacity: 0.55;
    transform: scale(1.15);
}

body.light-theme .progress-step.current {
    background: #48bb78;
    opacity: 0.5;
}

body.light-theme .progress-step {
    background: rgba(0, 0, 0, 0.1);
}

body.light-theme .progress-step.completed {
    background: #48bb78;
}

/* Skip Button - REMOVED */

/* Completion Screen */
.completion-icon {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(104, 211, 145, 0.28) 0%, rgba(72, 187, 120, 0.12) 100%);
    border: 1.5px solid rgba(104, 211, 145, 0.45);
    border-radius: 50%;
    margin-bottom: var(--spacing-sm);
    animation: scaleIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.completion-icon i {
    font-size: 1.75rem;
    color: #68d391;
    position: relative;
    z-index: 1;
}

.completion-icon-ring {
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 1.5px solid rgba(104, 211, 145, 0.35);
    opacity: 0;
    transform: scale(0.85);
    pointer-events: none;
}

.completion-icon--full .completion-icon-ring {
    animation: completionRingOut 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

.completion-icon--partial {
    background: linear-gradient(145deg, rgba(104, 211, 145, 0.16) 0%, rgba(56, 161, 105, 0.08) 100%);
    border-color: rgba(104, 211, 145, 0.32);
}

.completion-icon--partial i {
    font-size: 1.35rem;
    color: #48bb78;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes completionRingOut {
    0% {
        opacity: 0.7;
        transform: scale(0.85);
    }
    100% {
        opacity: 0;
        transform: scale(1.35);
    }
}

@keyframes completionCardIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* In-app tutorial: no dim — show real app; chip + optional SVG (e.g. calendar nav ring) */
.onboarding-overlay.active.onboarding-overlay--app-tutorial,
body.light-theme .onboarding-overlay.active.onboarding-overlay--app-tutorial {
    background: transparent;
    z-index: 30000;
    /* Let taps reach the real app (+, header, etc.); chip keeps pointer-events: auto */
    pointer-events: none;
}

/* Quick Actions sheet is z-index 100000 — raise coach marks above it for Create Estimate. */
.onboarding-overlay.active.onboarding-overlay--app-tutorial.onboarding-overlay--above-quick-actions,
body.light-theme .onboarding-overlay.active.onboarding-overlay--app-tutorial.onboarding-overlay--above-quick-actions {
    z-index: 100010;
}

.onboarding-overlay.onboarding-overlay--app-tutorial .onboarding-container {
    justify-content: flex-start;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    pointer-events: none;
}

.onboarding-overlay.onboarding-overlay--app-tutorial .onboarding-screen#tutorialSlidesScreen.active {
    max-width: none;
    width: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    transform: none;
    animation: none;
    pointer-events: none;
}

.onboarding-overlay.onboarding-overlay--app-tutorial .onboarding-progress {
    position: relative;
    z-index: 25;
    margin-top: auto;
    padding: var(--spacing-sm) var(--spacing-md);
    flex-shrink: 0;
    opacity: 0.85;
}

/* Explore-next slide only: dim overlay + block taps to dashboard (chip stays interactive) */
.onboarding-overlay.active.onboarding-overlay--app-tutorial.onboarding-overlay--app-tutorial-dim {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.72) 0%, rgba(26, 32, 44, 0.82) 100%);
    pointer-events: auto;
}

body.light-theme .onboarding-overlay.active.onboarding-overlay--app-tutorial.onboarding-overlay--app-tutorial-dim {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.86) 0%, rgba(247, 250, 252, 0.92) 100%);
    pointer-events: auto;
}

.onboarding-overlay.onboarding-overlay--app-tutorial.onboarding-overlay--app-tutorial-dim .onboarding-container {
    pointer-events: auto;
}

.onboarding-overlay.onboarding-overlay--app-tutorial.onboarding-overlay--app-tutorial-dim
    .onboarding-screen#tutorialSlidesScreen.active {
    pointer-events: auto;
}

.onboarding-overlay.onboarding-overlay--app-tutorial.onboarding-overlay--app-tutorial-dim .onboarding-progress {
    opacity: 0.75;
}

.app-tutorial-dashboard {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 28vh;
    pointer-events: none;
}

/* Legacy SVG slot kept hidden — coach pointer is HTML now. */
.app-tutorial-leader-svg {
    display: none;
}

/* Focus cue: bouncing chevron only (no hotspot circle / area cutout). */
.app-tutorial-focus-layer {
    position: fixed;
    inset: 0;
    z-index: 15;
    pointer-events: none;
}

/* Bouncing chevron that aims at the control — high-contrast by theme. */
.app-tutorial-pointer {
    position: fixed;
    width: 1.35rem;
    height: 1.35rem;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 17;
    color: #ffffff;
    filter:
        drop-shadow(0 0 0.05rem rgba(0, 0, 0, 1))
        drop-shadow(0 0 0.125rem rgba(0, 0, 0, 0.75))
        drop-shadow(0 0.1rem 0.2rem rgba(0, 0, 0, 0.45));
}

.app-tutorial-pointer::before {
    content: '';
    position: absolute;
    inset: 0.1875rem;
    border-right: 0.22rem solid currentColor;
    border-bottom: 0.22rem solid currentColor;
}

.app-tutorial-pointer--down::before {
    transform: rotate(45deg);
    inset: 0.125rem 0.3125rem 0.5rem;
}

.app-tutorial-pointer--up::before {
    transform: rotate(225deg);
    inset: 0.5rem 0.3125rem 0.125rem;
}

.app-tutorial-pointer--left::before {
    transform: rotate(135deg);
    inset: 0.3125rem 0.125rem 0.3125rem 0.5rem;
}

.app-tutorial-pointer--right::before {
    transform: rotate(-45deg);
    inset: 0.3125rem 0.5rem 0.3125rem 0.125rem;
}

body.light-theme .app-tutorial-pointer {
    color: #000000;
    filter:
        drop-shadow(0 0 0.05rem rgba(255, 255, 255, 1))
        drop-shadow(0 0 0.125rem rgba(255, 255, 255, 0.95))
        drop-shadow(0 0.1rem 0.2rem rgba(15, 23, 42, 0.35));
}

@keyframes app-tutorial-pointer-bounce-down {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(0.3125rem);
    }
}

@keyframes app-tutorial-pointer-bounce-up {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-0.3125rem);
    }
}

@keyframes app-tutorial-pointer-bounce-left {
    0%,
    100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-0.3125rem);
    }
}

@keyframes app-tutorial-pointer-bounce-right {
    0%,
    100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(0.3125rem);
    }
}

@media (prefers-reduced-motion: no-preference) {
    .app-tutorial-pointer--down {
        animation: app-tutorial-pointer-bounce-down 0.9s ease-in-out infinite;
    }

    .app-tutorial-pointer--up {
        animation: app-tutorial-pointer-bounce-up 0.9s ease-in-out infinite;
    }

    .app-tutorial-pointer--left {
        animation: app-tutorial-pointer-bounce-left 0.9s ease-in-out infinite;
    }

    .app-tutorial-pointer--right {
        animation: app-tutorial-pointer-bounce-right 0.9s ease-in-out infinite;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-tutorial-pointer--down,
    .app-tutorial-pointer--up,
    .app-tutorial-pointer--left,
    .app-tutorial-pointer--right {
        animation: none;
    }
}

/*
 * Dashboard tutorial chip: stay at entrance start state until --appear is applied.
 * Avoids “full opacity for a frame (or during switchView) → animation from opacity 0” double flash;
 * _playTutorialChipAppear removes --appear then waits 2 rAF before re-adding.
 */
@media (prefers-reduced-motion: no-preference) {
    .onboarding-overlay.onboarding-overlay--app-tutorial
        .app-tutorial-dashboard
        #appTutorialCalloutChip.app-tutorial-callout-chip:not(.app-tutorial-callout-chip--appear) {
        opacity: 0;
    }
}

.app-tutorial-callout-chip {
    position: fixed;
    z-index: 20;
    /* Tip body must not steal hits — status drop targets / app controls sit under the overlay stack. */
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: auto;
    height: auto;
    min-height: 0;
    max-height: var(--tutorial-chip-max-h, min(42dvh, calc(100dvh - 10.5rem)));
    overflow: hidden;
    padding: 0.3rem 0.5rem;
    border-radius: 0.375rem;
    background: rgba(26, 32, 44, 0.94);
    border: 1px solid rgba(104, 211, 145, 0.45);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.32),
        0 0 0 1px rgba(255, 255, 255, 0.06) inset;
    backdrop-filter: blur(12px);
}

/* Only interactive tip chrome receives taps (Back/Done, Explore tiles). */
.app-tutorial-callout-chip .app-tutorial-chip-actions,
.app-tutorial-callout-chip .app-tutorial-chip-actions .onboarding-button,
.app-tutorial-callout-chip .app-tutorial-explore-grid,
.app-tutorial-callout-chip .app-tutorial-explore-item[role='button'] {
    pointer-events: auto;
}

.app-tutorial-callout-chip > .app-tutorial-chip-body {
    flex: 0 1 auto;
    min-height: 0;
    max-height: calc(var(--tutorial-chip-max-h, min(42dvh, calc(100dvh - 10.5rem))) - 2.4rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

body.light-theme .app-tutorial-callout-chip {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(56, 161, 105, 0.4);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.12);
}

/*
 * No tip-edge caret — the bouncing coach arrow carries direction.
 * (A glued caret read as “arrow stuck to the tutorial block”.)
 */
.app-tutorial-callout-chip[data-arrow]::before {
    content: none;
    display: none;
}

@keyframes app-tutorial-chip-appear {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/*
 * forwards only (no backwards): `both` + delay made the chip apply opacity:0 during the delay,
 * which read as “flash twice” (visible → hidden → fade in).
 */
.app-tutorial-callout-chip.app-tutorial-callout-chip--appear {
    animation: app-tutorial-chip-appear 0.52s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
    .app-tutorial-callout-chip.app-tutorial-callout-chip--appear {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

.app-tutorial-chip-body {
    text-align: left;
    position: relative;
}

/* Small iPhones: tighter chip so highlighted UI stays visible */
@media (max-height: 700px), (max-width: 390px) {
    .app-tutorial-callout-chip,
    .app-tutorial-callout-chip.app-tutorial-callout-chip--compact {
        max-height: var(--tutorial-chip-max-h, min(32dvh, calc(100dvh - 9rem)));
        padding: 0.28rem 0.45rem;
        border-radius: 0.375rem;
    }

    .app-tutorial-callout-chip > .app-tutorial-chip-body {
        max-height: calc(var(--tutorial-chip-max-h, min(32dvh, calc(100dvh - 9rem))) - 2.15rem);
    }

    .app-tutorial-chip-desc,
    .app-tutorial-chip-lead,
    .app-tutorial-explore-next-copy .app-tutorial-chip-praise,
    .app-tutorial-explore-next-copy .app-tutorial-chip-lead {
        font-size: 0.75rem;
        line-height: 1.35;
    }

    .app-tutorial-chip-praise {
        font-size: 0.75rem;
        margin: 0.1rem 0 0.1rem 0;
    }

    .app-tutorial-chip-features {
        margin: 0.25rem 0 0 0;
    }

    .app-tutorial-chip-feature-item {
        font-size: 0.625rem;
        margin-top: 0.1rem;
    }

    .app-tutorial-cal-drag-quest {
        margin-top: 0.3rem;
        padding: 0.28rem 0.4rem;
        border-radius: 8px;
    }

    .app-tutorial-cal-drag-quest-label {
        font-size: 0.625rem;
    }

    .app-tutorial-cal-drag-counter {
        font-size: 0.8125rem;
    }

    /* Keep 3-column Explore grid on compact phones (2×3) for usable tap targets. */
    .app-tutorial-explore-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.22rem;
        margin-top: 0.2rem;
    }

    .app-tutorial-explore-item {
        padding: 0.28rem 0.1rem;
        gap: 0.14rem;
        border-radius: 8px;
    }

    .app-tutorial-explore-next-copy .app-tutorial-chip-lead {
        margin: 0 0 0.2rem 0;
    }

    .app-tutorial-explore-tasks-hint {
        margin: 0.25rem 0 0 0;
        font-size: 0.6875rem;
        line-height: 1.3;
    }

    .app-tutorial-explore-item i {
        font-size: 0.875rem;
    }

    .app-tutorial-explore-item span {
        font-size: 0.625rem;
    }

    .carousel-buttons.app-tutorial-chip-actions {
        margin-top: 0.18rem;
        padding-top: 0.18rem;
        gap: 0.25rem;
        justify-content: flex-end;
    }

}

.app-tutorial-callout-chip.app-tutorial-callout-chip--compact > .app-tutorial-chip-body {
    max-height: calc(var(--tutorial-chip-max-h, min(32dvh, calc(100dvh - 9rem))) - 2.15rem);
}

.app-tutorial-chip-desc {
    font-size: 0.8125rem;
    font-weight: var(--font-weight-regular);
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.35;
    margin: 0;
}

body.light-theme .app-tutorial-chip-desc {
    color: rgba(26, 32, 44, 0.85);
}

.app-tutorial-chip-helper {
    font-size: 0.6875rem;
    font-weight: var(--font-weight-regular);
    color: rgba(255, 255, 255, 0.58);
    line-height: 1.3;
    margin: 0.25rem 0 0 0;
}

body.light-theme .app-tutorial-chip-helper {
    color: rgba(26, 32, 44, 0.55);
}

.app-tutorial-chip-praise {
    font-size: 0.8125rem;
    font-weight: var(--font-weight-semibold);
    color: rgba(104, 211, 145, 0.98);
    line-height: 1.25;
    margin: 0.1rem 0 0.1rem 0;
}

body.light-theme .app-tutorial-chip-praise {
    color: #2f855a;
}

.app-tutorial-chip-lead {
    font-size: 0.8125rem;
    font-weight: var(--font-weight-regular);
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.35;
    margin: 0 0 0.25rem 0;
}

body.light-theme .app-tutorial-chip-lead {
    color: rgba(26, 32, 44, 0.85);
}

/* Explore hub: title + subtitle only; match font sizes (no kicker/icon). */
.app-tutorial-explore-next-copy .app-tutorial-chip-praise,
.app-tutorial-explore-next-copy .app-tutorial-chip-lead {
    font-size: 0.8125rem;
    line-height: 1.35;
}

.app-tutorial-explore-next-copy .app-tutorial-chip-praise {
    margin: 0 0 0.12rem 0;
}

.app-tutorial-explore-next-copy .app-tutorial-chip-lead {
    margin: 0 0 0.25rem 0;
}

.app-tutorial-explore-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.25rem;
    margin-top: 0.22rem;
}

.app-tutorial-explore-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.16rem;
    padding: 0.28rem 0.12rem;
    border-radius: 0.375rem;
    text-align: center;
    user-select: none;
    cursor: default;
}

.app-tutorial-explore-item i {
    font-size: 0.9rem;
    color: #68d391;
    line-height: 1;
}

body.light-theme .app-tutorial-explore-item i {
    color: #38a169;
}

.app-tutorial-explore-item span {
    font-size: 0.625rem;
    font-weight: var(--font-weight-medium);
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.2;
    hyphens: auto;
    overflow-wrap: anywhere;
}

body.light-theme .app-tutorial-explore-item span {
    color: rgba(26, 32, 44, 0.78);
}

.app-tutorial-explore-item--tasks,
.app-tutorial-explore-item--finances,
.app-tutorial-explore-item--employees,
.app-tutorial-explore-item--invoices,
.app-tutorial-explore-item--photos,
.app-tutorial-explore-item--dashboard {
    cursor: pointer;
}

.app-tutorial-explore-item--tasks:active,
.app-tutorial-explore-item--finances:active,
.app-tutorial-explore-item--employees:active,
.app-tutorial-explore-item--invoices:active,
.app-tutorial-explore-item--photos:active,
.app-tutorial-explore-item--dashboard:active {
    transform: scale(0.98);
}

.app-tutorial-explore-item--tasks.app-tutorial-explore-item--complete,
.app-tutorial-explore-item--finances.app-tutorial-explore-item--complete,
.app-tutorial-explore-item--employees.app-tutorial-explore-item--complete,
.app-tutorial-explore-item--invoices.app-tutorial-explore-item--complete,
.app-tutorial-explore-item--photos.app-tutorial-explore-item--complete,
.app-tutorial-explore-item--dashboard.app-tutorial-explore-item--complete {
    cursor: default;
    pointer-events: none;
}

.app-tutorial-explore-item--tasks.app-tutorial-explore-item--complete i,
.app-tutorial-explore-item--tasks.app-tutorial-explore-item--complete span,
.app-tutorial-explore-item--finances.app-tutorial-explore-item--complete i,
.app-tutorial-explore-item--finances.app-tutorial-explore-item--complete span,
.app-tutorial-explore-item--employees.app-tutorial-explore-item--complete i,
.app-tutorial-explore-item--employees.app-tutorial-explore-item--complete span,
.app-tutorial-explore-item--invoices.app-tutorial-explore-item--complete i,
.app-tutorial-explore-item--invoices.app-tutorial-explore-item--complete span,
.app-tutorial-explore-item--photos.app-tutorial-explore-item--complete i,
.app-tutorial-explore-item--photos.app-tutorial-explore-item--complete span,
.app-tutorial-explore-item--dashboard.app-tutorial-explore-item--complete i,
.app-tutorial-explore-item--dashboard.app-tutorial-explore-item--complete span {
    color: rgba(203, 213, 225, 0.9);
}

body.light-theme .app-tutorial-explore-item--tasks.app-tutorial-explore-item--complete i,
body.light-theme .app-tutorial-explore-item--tasks.app-tutorial-explore-item--complete span,
body.light-theme .app-tutorial-explore-item--finances.app-tutorial-explore-item--complete i,
body.light-theme .app-tutorial-explore-item--finances.app-tutorial-explore-item--complete span,
body.light-theme .app-tutorial-explore-item--employees.app-tutorial-explore-item--complete i,
body.light-theme .app-tutorial-explore-item--employees.app-tutorial-explore-item--complete span,
body.light-theme .app-tutorial-explore-item--invoices.app-tutorial-explore-item--complete i,
body.light-theme .app-tutorial-explore-item--invoices.app-tutorial-explore-item--complete span,
body.light-theme .app-tutorial-explore-item--photos.app-tutorial-explore-item--complete i,
body.light-theme .app-tutorial-explore-item--photos.app-tutorial-explore-item--complete span,
body.light-theme .app-tutorial-explore-item--dashboard.app-tutorial-explore-item--complete i,
body.light-theme .app-tutorial-explore-item--dashboard.app-tutorial-explore-item--complete span {
    color: rgba(100, 116, 139, 0.92);
}

.app-tutorial-explore-item.app-tutorial-explore-item--complete i {
    color: #68d391;
}

body.light-theme .app-tutorial-explore-item.app-tutorial-explore-item--complete i {
    color: #38a169;
}

.app-tutorial-explore-tasks-hint {
    margin: 0.35rem 0 0 0;
    line-height: 1.35;
    text-align: left;
}

.app-tutorial-cal-drag-quest {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    margin-top: 0.3rem;
    padding: 0.28rem 0.4rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

body.light-theme .app-tutorial-cal-drag-quest {
    background: rgba(15, 23, 42, 0.06);
    border-color: rgba(15, 23, 42, 0.1);
}

.app-tutorial-cal-drag-quest-label {
    font-size: 0.6875rem;
    font-weight: var(--font-weight-semibold);
    color: rgba(255, 255, 255, 0.88);
    letter-spacing: 0.02em;
}

body.light-theme .app-tutorial-cal-drag-quest-label {
    color: rgba(26, 32, 44, 0.88);
}

.app-tutorial-cal-drag-counter {
    font-size: 0.875rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #68d391;
    letter-spacing: 0.04em;
}

body.light-theme .app-tutorial-cal-drag-counter {
    color: #2f855a;
}

@keyframes app-tutorial-quest-counter-celebrate {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }
    40% {
        transform: scale(1.14);
        filter: brightness(1.2);
    }
    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

.app-tutorial-cal-drag-counter.app-tutorial-quest-counter-celebrate {
    display: inline-block;
    animation: app-tutorial-quest-counter-celebrate 0.65s ease-out both;
}

@media (prefers-reduced-motion: reduce) {
    .app-tutorial-cal-drag-counter.app-tutorial-quest-counter-celebrate {
        animation: none;
    }
}

.app-tutorial-chip-features {
    list-style: none;
    margin: 0.25rem 0 0 0;
    padding: 0;
}

.app-tutorial-chip-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 0.25rem;
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 0.1rem;
}

.app-tutorial-chip-feature-item i {
    color: #68d391;
    margin-top: 0.1rem;
    flex-shrink: 0;
    font-size: 0.65rem;
}

body.light-theme .app-tutorial-chip-feature-item {
    color: rgba(26, 32, 44, 0.72);
}

body.light-theme .app-tutorial-chip-feature-item i {
    color: #38a169;
}

.carousel-buttons.app-tutorial-chip-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 0.3rem;
    margin-top: 0.2rem;
    padding-top: 0.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

body.light-theme .app-tutorial-chip-actions {
    border-top-color: rgba(15, 23, 42, 0.1);
}

.app-tutorial-chip-actions .onboarding-button {
    flex: 0 0 auto;
}

.app-tutorial-highlight,
.app-tutorial-highlight-end {
    border-radius: var(--card-radius);
    /* Avoid fighting dashboard `transition: all` while pseudo ring animates. */
    transition: none !important;
}

/* ::after needs a positioned ancestor — but never override the bottom bar's fixed + z-index or it jumps / sinks under content. */
.app-tutorial-highlight:not(.floating-bottom-menu),
.app-tutorial-highlight-end {
    position: relative;
    z-index: 0;
}

/* Drag-to-status drop target: stay above sibling dashboard chrome so HTML5 / touch drops land. */
.status-card.app-tutorial-highlight-end {
    z-index: 3;
    pointer-events: auto;
}

/* Quick Actions row: keep Create Estimate above sibling buttons while highlighted. */
#quickActionCreateEstimateBtn.app-tutorial-highlight,
.quick-action-btn.app-tutorial-highlight {
    position: relative;
    z-index: 5;
    pointer-events: auto;
}

/* While dragging the demo card, tip stays visible but never intercepts the finger/cursor. */
body.onboarding-drag-status-dragging .app-tutorial-callout-chip,
body.onboarding-drag-status-dragging .app-tutorial-callout-chip .app-tutorial-chip-actions,
body.onboarding-drag-status-dragging .app-tutorial-callout-chip .onboarding-button {
    pointer-events: none !important;
}

body.onboarding-drag-status-dragging .app-tutorial-callout-chip {
    opacity: 0.55;
}

/* Keep photo viewer controls fixed while highlighted (step 5/5). */
#photoViewerEditToggle.app-tutorial-highlight,
#photoViewerDelete.app-tutorial-highlight,
#photoViewerSave.app-tutorial-highlight,
#photoViewerClose.app-tutorial-highlight {
    position: fixed;
    z-index: 10004;
}

.floating-bottom-menu.app-tutorial-highlight {
    position: fixed;
    z-index: 1000;
    border-radius: 28px;
}

/* Desktop rail: keep menu items positioned so the tutorial ring paints outside the rail clip. */
#sideMenu.app-tutorial-highlight,
.side-menu .menu-item.app-tutorial-highlight {
    overflow: visible;
    z-index: 1;
}

.side-menu .menu-item.app-tutorial-highlight {
    position: relative;
    border-radius: 14px;
}

/* Job rows use overflow:hidden — ring would clip; allow pseudo to paint outside during tutorial. */
.job-site-item.app-tutorial-highlight {
    overflow: visible;
    contain: layout style;
}

/* No outline on the control — bouncing coach arrow carries attention. */
.app-tutorial-highlight::after,
.app-tutorial-highlight-end::after {
    content: none;
    display: none;
}

/* Post-tutorial: completion card (full vs partial outcomes) */
.onboarding-completion-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex: 1;
    min-height: min(56vh, 480px);
    padding: var(--spacing-md);
    box-sizing: border-box;
    background:
        radial-gradient(ellipse 70% 55% at 50% 28%, rgba(104, 211, 145, 0.14), transparent 70%),
        radial-gradient(ellipse 50% 40% at 80% 80%, rgba(72, 187, 120, 0.06), transparent 65%);
}

.onboarding-completion-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 340px;
    padding: 1.25rem 1rem 1.05rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 1.5px solid rgba(104, 211, 145, 0.28);
    border-radius: var(--card-radius);
    text-align: center;
    box-sizing: border-box;
    overflow: hidden;
    animation: completionCardIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.onboarding-completion-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #68d391 0%, #48bb78 55%, rgba(104, 211, 145, 0.35) 100%);
}

.onboarding-completion-card--full {
    border-color: rgba(104, 211, 145, 0.45);
    box-shadow:
        0 0 0 1px rgba(104, 211, 145, 0.08),
        0 12px 28px rgba(0, 0, 0, 0.18);
}

.onboarding-completion-card--full::before {
    height: 3px;
    background: linear-gradient(90deg, #48bb78, #68d391, #9ae6b4, #68d391, #48bb78);
    background-size: 200% 100%;
    animation: completionShimmer 2.4s ease-in-out infinite;
}

.onboarding-completion-card--partial {
    border-color: rgba(104, 211, 145, 0.24);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

@keyframes completionShimmer {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.onboarding-completion-card .completion-icon {
    margin-bottom: 0.45rem;
}

.onboarding-completion-eyebrow {
    margin: 0 0 0.2rem;
    font-size: 0.6875rem;
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #68d391;
    line-height: 1.2;
}

.onboarding-completion-title {
    font-size: 1.05rem;
    font-weight: var(--font-weight-semibold);
    color: #FFFFFF;
    margin: 0 0 0.35rem;
    letter-spacing: var(--tracking-tight);
    line-height: 1.25;
}

.onboarding-completion-lead {
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-regular);
    color: rgba(255, 255, 255, 0.72);
    margin: 0 0 0.75rem;
    line-height: 1.4;
    max-width: 290px;
}

.onboarding-completion-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0 0.75rem;
    padding: 0.28rem 0.55rem;
    background: rgba(104, 211, 145, 0.12);
    border: 1px solid rgba(104, 211, 145, 0.35);
    border-radius: 2px;
    font-size: 0.6875rem;
    font-weight: var(--font-weight-semibold);
    color: #68d391;
    letter-spacing: 0.02em;
}

.onboarding-completion-badge i {
    font-size: 0.7rem;
}

.onboarding-completion-progress {
    width: 100%;
    margin: 0 0 0.75rem;
    text-align: left;
}

.onboarding-completion-progress-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    padding: 0 0.1rem;
}

.onboarding-completion-progress-count {
    font-size: 0.8125rem;
    font-weight: var(--font-weight-semibold);
    color: #68d391;
    letter-spacing: var(--tracking-tight);
}

.onboarding-completion-progress-label {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.55);
}

.onboarding-completion-progress-bar {
    height: 4px;
    width: 100%;
    margin: 0 0 0.55rem;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.onboarding-completion-progress-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, #48bb78, #68d391);
    transform-origin: left center;
    animation: completionFillIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

@keyframes completionFillIn {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.onboarding-completion-modules {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.3rem;
}

.onboarding-completion-module {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.18rem;
    padding: 0.4rem 0.2rem;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    min-width: 0;
}

.onboarding-completion-module i {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1;
}

.onboarding-completion-module span {
    font-size: 0.5625rem;
    font-weight: var(--font-weight-medium);
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.15;
    text-align: center;
    overflow-wrap: anywhere;
}

.onboarding-completion-module.is-done {
    background: rgba(104, 211, 145, 0.1);
    border-color: rgba(104, 211, 145, 0.28);
}

.onboarding-completion-module.is-done i,
.onboarding-completion-module.is-done span {
    color: #68d391;
}

button.onboarding-completion-module {
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    margin: 0;
}

.onboarding-completion-module.is-resumable {
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.onboarding-completion-module.is-resumable i {
    color: #68d391;
}

.onboarding-completion-module.is-resumable span {
    color: rgba(255, 255, 255, 0.82);
}

body.light-theme .onboarding-completion-module.is-resumable {
    background: #ffffff;
    border-color: rgba(26, 32, 44, 0.14);
}

body.light-theme .onboarding-completion-module.is-resumable i {
    color: #38a169;
}

body.light-theme .onboarding-completion-module.is-resumable span {
    color: rgba(26, 32, 44, 0.82);
}

body.light-theme .onboarding-completion-module.is-resumable:hover,
body.light-theme .onboarding-completion-module.is-resumable:focus-visible {
    border-color: rgba(56, 161, 105, 0.5);
}

.onboarding-completion-module.is-resumable:hover,
.onboarding-completion-module.is-resumable:focus-visible {
    border-color: rgba(104, 211, 145, 0.5);
    outline: none;
}

.onboarding-completion-module.is-resumable:active {
    transform: scale(0.98);
}

.onboarding-completion-path {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.45rem;
    width: 100%;
    padding: 0.45rem 0.65rem;
    margin-bottom: var(--spacing-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(104, 211, 145, 0.22);
    border-radius: var(--card-radius);
    box-sizing: border-box;
}

.onboarding-completion-path-step {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    color: #FFFFFF;
}

.onboarding-completion-path-step i {
    color: #68d391;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.onboarding-completion-path-sep {
    color: rgba(104, 211, 145, 0.75);
    font-size: 0.65rem;
    flex-shrink: 0;
}

.onboarding-completion-card .onboarding-button {
    width: auto;
    max-width: 100%;
    align-self: center;
}

body.light-theme .onboarding-completion-wrap {
    background:
        radial-gradient(ellipse 70% 55% at 50% 28%, rgba(72, 187, 120, 0.1), transparent 70%),
        radial-gradient(ellipse 50% 40% at 80% 80%, rgba(104, 211, 145, 0.05), transparent 65%);
}

body.light-theme .onboarding-completion-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 252, 0.96) 100%);
    border-color: rgba(72, 187, 120, 0.28);
    box-shadow: 0 14px 32px rgba(26, 32, 44, 0.1);
}

body.light-theme .onboarding-completion-card--full {
    border-color: rgba(56, 161, 105, 0.4);
}

body.light-theme .onboarding-completion-progress-bar {
    background: rgba(26, 32, 44, 0.08);
}

body.light-theme .onboarding-completion-eyebrow {
    color: #38a169;
}

body.light-theme .onboarding-completion-title {
    color: #1a202c;
}

body.light-theme .onboarding-completion-lead {
    color: rgba(26, 32, 44, 0.7);
}

body.light-theme .onboarding-completion-badge {
    background: rgba(72, 187, 120, 0.1);
    border-color: rgba(56, 161, 105, 0.3);
    color: #2f855a;
}

body.light-theme .onboarding-completion-progress-count {
    color: #2f855a;
}

body.light-theme .onboarding-completion-progress-label {
    color: rgba(26, 32, 44, 0.5);
}

body.light-theme .onboarding-completion-module {
    background: rgba(26, 32, 44, 0.03);
    border-color: rgba(26, 32, 44, 0.08);
}

body.light-theme .onboarding-completion-module i {
    color: rgba(26, 32, 44, 0.28);
}

body.light-theme .onboarding-completion-module span {
    color: rgba(26, 32, 44, 0.45);
}

body.light-theme .onboarding-completion-module.is-done {
    background: rgba(72, 187, 120, 0.1);
    border-color: rgba(56, 161, 105, 0.28);
}

body.light-theme .onboarding-completion-module.is-done i,
body.light-theme .onboarding-completion-module.is-done span {
    color: #2f855a;
}

body.light-theme .onboarding-completion-path {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(72, 187, 120, 0.3);
}

body.light-theme .onboarding-completion-path-step {
    color: #1a202c;
}

body.light-theme .completion-icon {
    background: linear-gradient(145deg, rgba(72, 187, 120, 0.2) 0%, rgba(56, 161, 105, 0.1) 100%);
    border-color: rgba(56, 161, 105, 0.4);
}

body.light-theme .completion-icon i {
    color: #38a169;
}

body.light-theme .completion-icon--partial i {
    color: #2f855a;
}

/*
 * Touch devices (phones / tablets): finger-sized tap targets.
 * Kept last so it wins over the compact (≤480px / ≤390px) shrink rules above.
 * Chip body max-height reserves room for the taller action row so buttons are never clipped.
 */
@media (pointer: coarse) {
    .onboarding-button,
    .onboarding-button-text {
        min-height: 40px;
        height: 40px;
        max-height: 40px;
        padding: 0 1rem;
        font-size: 0.875rem;
        border-radius: 6px;
    }

    .onboarding-button i {
        font-size: 0.75rem;
    }

    .carousel-buttons.app-tutorial-chip-actions {
        gap: 0.5rem;
        margin-top: 0.35rem;
        padding-top: 0.4rem;
    }

    .app-tutorial-callout-chip {
        padding: 0.45rem 0.6rem;
    }

    .app-tutorial-callout-chip > .app-tutorial-chip-body {
        max-height: calc(var(--tutorial-chip-max-h, min(42dvh, calc(100dvh - 10.5rem))) - 3.6rem);
    }

    .app-tutorial-callout-chip.app-tutorial-callout-chip--compact > .app-tutorial-chip-body {
        max-height: calc(var(--tutorial-chip-max-h, min(32dvh, calc(100dvh - 9rem))) - 3.6rem);
    }
}

@media (pointer: coarse) and (max-height: 700px), (pointer: coarse) and (max-width: 390px) {
    .app-tutorial-callout-chip,
    .app-tutorial-callout-chip.app-tutorial-callout-chip--compact {
        padding: 0.4rem 0.5rem;
    }

    .app-tutorial-callout-chip > .app-tutorial-chip-body {
        max-height: calc(var(--tutorial-chip-max-h, min(32dvh, calc(100dvh - 9rem))) - 3.6rem);
    }
}

