/* TERP - guided demo tour styles (office pages only show the launcher button; the walkthrough
   itself can still lead into the handheld, design-mockup brief). Self-contained: no selector
   here reaches into app.css's own classes, so nothing here can conflict with reviewer A's work.
   Every animation is short, never blocks a click, and is switched off under
   prefers-reduced-motion: reduce. */

.tp-tour-btn
{
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 1150;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 44px;
    padding: 0 1rem;
    border: 0;
    border-radius: 999px;
    background: var(--tp-ink, #0e1a26);
    color: #fff;
    font-size: .85rem;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .22);
    cursor: pointer;
    animation: tpTourBtnIn .4s ease-out .2s both;
}

.tp-tour-btn:hover,
.tp-tour-btn:focus-visible
{
    background: var(--tp-ink-2, #31465a);
}

.tp-tour-btn i
{
    font-size: 1rem;
}

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

body.tp-tour-active .tp-tour-btn
{
    display: none;
}

/* ---- overlay: a dim backdrop plus either a spotlight cutout or a plain full dim ------------- */

.tp-tour-overlay
{
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    pointer-events: none;
}

.tp-tour-dim
{
    position: fixed;
    inset: 0;
    background: rgba(8, 14, 28, .6);
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: auto;
}

.tp-tour-spot
{
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-radius: 14px;
    box-shadow: 0 0 0 9999px rgba(8, 14, 28, .6);
    outline: 2px solid rgba(255, 255, 255, .9);
    opacity: 0;
    pointer-events: none;
    transition: top .45s cubic-bezier(.4, 0, .2, 1), left .45s cubic-bezier(.4, 0, .2, 1),
                width .45s cubic-bezier(.4, 0, .2, 1), height .45s cubic-bezier(.4, 0, .2, 1),
                opacity .25s ease;
}

/* ---- the instructional card: bottom-anchored on every size, so it never has to be clamped
   against the viewport or hunt for room next to a target it may not even be able to reach ----- */

.tp-tour-card
{
    position: fixed;
    left: 50%;
    bottom: 14px;
    transform: translate(-50%, 0);
    width: calc(100% - 28px);
    max-width: 500px;
    background: #fff;
    color: var(--tp-ink, #0e1a26);
    border-radius: 16px;
    padding: 1rem 1.1rem;
    box-shadow: 0 10px 34px rgba(0, 0, 0, .3);
    pointer-events: auto;
    animation: tpTourCardIn .35s cubic-bezier(.2, .7, .3, 1) both;
}

@keyframes tpTourCardIn
{
    from { opacity: 0; transform: translate(-50%, 16px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

.tp-tour-x
{
    position: absolute;
    top: .6rem;
    right: .6rem;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--tp-ink-3, #6a8199);
    border-radius: 999px;
    cursor: pointer;
}

.tp-tour-x:hover,
.tp-tour-x:focus-visible
{
    background: var(--tp-line-2, #eef2f7);
    color: var(--tp-ink, #0e1a26);
}

.tp-tour-chap-btn
{
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    max-width: calc(100% - 2.4rem);
    min-height: 32px;
    padding: .2rem .7rem;
    margin-bottom: .55rem;
    border: 1px solid var(--tp-line, #dde5ee);
    border-radius: 999px;
    background: var(--tp-line-2, #eef2f7);
    color: var(--tp-ink-2, #31465a);
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
}

.tp-tour-chap-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-tour-chap-btn small { font-weight: 600; color: var(--tp-ink-3, #6a8199); }
.tp-tour-chap-btn .tp-tour-caret { font-size: .7rem; transition: transform .2s ease; }
.tp-tour-chap-btn[aria-expanded="true"] .tp-tour-caret { transform: rotate(180deg); }
.tp-tour-chap-btn:hover, .tp-tour-chap-btn:focus-visible { background: #fff; }

.tp-tour-menu
{
    margin: 0 0 .7rem;
    border: 1px solid var(--tp-line, #dde5ee);
    border-radius: 12px;
    overflow: hidden;
}

.tp-tour-menu[hidden] { display: none; }

.tp-tour-chapters
{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .25rem;
    max-height: 40vh;
    overflow-y: auto;
    padding: .35rem;
}

.tp-tour-chapter small
{
    margin-left: auto;
    font-size: .72rem;
    font-weight: 600;
    opacity: .7;
}

/* The route switch at the bottom of the chapter panel. */
.tp-tour-routes
{
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem;
    padding: .45rem .5rem;
    border-top: 1px solid var(--tp-line, #dde5ee);
    background: var(--tp-line-2, #eef2f7);
    font-size: .78rem;
}

.tp-tour-routes > span
{
    font-weight: 700;
    color: var(--tp-ink-3, #6a8199);
    margin-right: .15rem;
}

.tp-tour-route
{
    min-height: 36px;
    padding: .2rem .65rem;
    border: 1px solid var(--tp-line, #dde5ee);
    border-radius: 999px;
    background: #fff;
    color: var(--tp-ink-2, #31465a);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
}

.tp-tour-route small { font-weight: 600; opacity: .65; }
.tp-tour-route:hover, .tp-tour-route:focus-visible { border-color: var(--tp-ink-3, #6a8199); }
.tp-tour-route.active { background: var(--tp-ink, #0e1a26); border-color: var(--tp-ink, #0e1a26); color: #fff; cursor: default; }

/* The first card: which route. */
.tp-tour-picks
{
    display: grid;
    gap: .5rem;
}

.tp-tour-pick
{
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    min-height: 44px;
    padding: .7rem .8rem;
    border: 1px solid var(--tp-line, #dde5ee);
    border-radius: 12px;
    background: #fff;
    color: var(--tp-ink, #0e1a26);
    text-align: left;
    cursor: pointer;
}

.tp-tour-pick > i { font-size: 1.25rem; margin-top: .1rem; color: var(--tp-ink-2, #31465a); }
.tp-tour-pick:hover, .tp-tour-pick:focus-visible { background: var(--tp-line-2, #eef2f7); border-color: var(--tp-ink-3, #6a8199); }
.tp-tour-pick-text { display: flex; flex-direction: column; gap: .1rem; }
.tp-tour-pick-text strong { font-size: .98rem; }
.tp-tour-pick-text small { font-size: .78rem; font-weight: 600; color: var(--tp-ink-3, #6a8199); }
.tp-tour-pick-text span { font-size: .86rem; color: var(--tp-ink-2, #31465a); line-height: 1.35; }

.tp-tour-chapter
{
    display: flex;
    align-items: center;
    gap: .45rem;
    min-height: 40px;
    padding: .3rem .5rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--tp-ink-2, #31465a);
    font-size: .82rem;
    text-align: left;
    cursor: pointer;
}

.tp-tour-chapter:hover, .tp-tour-chapter:focus-visible { background: var(--tp-line-2, #eef2f7); }
.tp-tour-chapter.active { background: var(--tp-ink, #0e1a26); color: #fff; }

.tp-tour-progress
{
    height: 3px;
    border-radius: 3px;
    background: var(--tp-line-2, #eef2f7);
    margin-bottom: .7rem;
    overflow: hidden;
}

.tp-tour-progress span
{
    display: block;
    height: 100%;
    background: var(--tp-ink, #0e1a26);
    transition: width .35s ease;
}

.tp-tour-title
{
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 1.6rem .4rem 0;
}

.tp-tour-text
{
    max-height: 38vh;
    overflow-y: auto;
    margin-bottom: .9rem;
}

.tp-tour-body
{
    margin: 0 0 .55rem 0;
    color: var(--tp-ink-2, #31465a);
    font-size: .92rem;
    line-height: 1.4;
}

.tp-tour-body:last-child { margin-bottom: 0; }

.tp-tour-actions
{
    display: flex;
    align-items: center;
    gap: .5rem;
}

.tp-tour-count
{
    flex: 1 1 auto;
    text-align: center;
    font-size: .76rem;
    color: var(--tp-ink-3, #6a8199);
    white-space: nowrap;
}

.tp-tour-card-top
{
    top: 14px;
    bottom: auto;
}

/* Docked in a free side column (wide screens only, decided in tour.js). */
.tp-tour-card-right,
.tp-tour-card-left
{
    width: 380px;
    left: auto;
    animation: none;
    transform: none;
}

.tp-tour-card-right { right: 12px; }
.tp-tour-card-left { left: 12px; right: auto; }

.tp-tour-actions .btn
{
    min-height: 44px;
    cursor: pointer;
}

.tp-tour-actions .btn:first-child
{
    flex: 0 0 auto;
}

.tp-tour-actions .btn:first-child
{
    min-width: 44px;
}

.tp-tour-actions .btn:last-child
{
    flex: 0 0 auto;
    min-width: 120px;
}

@media (max-width: 420px)
{
    .tp-tour-card { bottom: 8px; width: calc(100% - 16px); }
    .tp-tour-card-top { top: 8px; }
    .tp-tour-chapters { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce)
{
    .tp-tour-btn,
    .tp-tour-card
    {
        animation: none !important;
    }

    .tp-tour-spot,
    .tp-tour-dim
    {
        transition: none !important;
    }
}

/* On the phone the launcher would sit on top of the content: it shrinks to its icon. The
   presentation itself is meant for a computer or a tablet. */
@media (max-width: 575.98px)
{
    .tp-tour-btn span { display: none; }
    .tp-tour-btn { opacity: .85; }
}
