/* Guided tour (2026-11-14): the quick tour, page guides, and the Get set up card.

   Global, not scoped: the layer is rendered by TourHost in the layout and positioned by
   js/tour.js, and the menu and masthead pieces sit in MainLayout's own markup.

   Rules this file keeps:
   - colour tokens only, so light and dark both come from the theme;
   - the card is FLAT (solid paper, no backdrop-filter): it can sit over the glass
     masthead or the phone bar, and glass never stacks on glass;
   - the dimming is a plain scrim, never a blur;
   - every box here is position:fixed, in the overlay band above ordinary dialogs (1100)
     and below the session-expired screen (1200), which must be able to cover a tour. */

.tour-layer {
    position: fixed;
    inset: 0;
    z-index: 1150;
    pointer-events: none;
}

/* The locked tour's guarantee: this takes every click meant for the page. */
.tour-block {
    position: fixed;
    inset: 0;
    pointer-events: auto;
}

/* A centred step dims the whole page; an anchored one dims everything but its target
   (the spot's shadow), so the scrim is never painted twice. */
.tour-layer--locked:not([data-anchored="yes"]) .tour-block {
    background: var(--glass-scrim);
}

.tour-spot {
    position: fixed;
    display: none;
    border-radius: 12px;
    pointer-events: none;
    transition: left 0.18s ease-out, top 0.18s ease-out, width 0.18s ease-out, height 0.18s ease-out;
}

.tour-layer[data-anchored="yes"] .tour-spot {
    display: block;
}

.tour-layer--locked .tour-spot {
    box-shadow: 0 0 0 200vmax var(--glass-scrim);
    outline: 2px solid var(--color-accent-light);
}

.tour-layer--guide .tour-spot {
    outline: 3px solid var(--color-accent);
    outline-offset: 1px;
}

.tour-card {
    position: fixed;
    /* Before tour.js places it: centred, so a failed script still shows a readable card. */
    left: max(12px, calc(50vw - 12rem));
    top: 22vh;
    width: min(24rem, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    pointer-events: auto;
    background: var(--color-surface-solid);
    color: var(--ed-ink);
    border: 1px solid var(--ed-hairline-strong);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    padding: 1.05rem 1.2rem 0.9rem;
    font-family: var(--ed-ui);
}

.tour-card:focus {
    outline: none;
}

.tour-count {
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    color: var(--ed-mute);
    margin-bottom: 0.25rem;
}

.tour-title {
    font-family: var(--ed-display);
    font-size: 1.3rem;
    line-height: 1.2;
    margin: 0 0 0.45rem;
    color: var(--ed-eucalypt);
}

.tour-body {
    font-size: 0.97rem;
    line-height: 1.5;
}

.tour-example {
    margin-top: 0.7rem;
    padding: 0.6rem 0.75rem;
    border: 1px dashed var(--ed-hairline-strong);
    border-radius: var(--radius-md);
    background: var(--ed-paper-deep);
    color: var(--ed-ink);
    font-size: 0.9rem;
    line-height: 1.45;
}

.tour-example-tag {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ed-ink-soft);
}

.tour-example-head {
    font-weight: 600;
    margin: 0.15rem 0 0.2rem;
}

.tour-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.tour-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.9rem;
}

.tour-actions-gap {
    flex: 1 1 auto;
}

.tour-actions .tour-skip {
    padding-left: 0;
    color: var(--ed-mute);
}

/* ── Masthead and menu ─────────────────────────────────────────────────────── */

/* The "this page has a guide you have not opened" dot, and the menu's New mark. */
.tour-guide-btn {
    position: relative;
}

.tour-guide-dot {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--color-accent);
}

.tour-new {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0 0.4rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-accent);
    color: var(--color-accent-dark);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.35;
}

[data-theme="dark"] .tour-new {
    color: var(--ed-ink);
}

/* ── Get set up card (Cases page) ──────────────────────────────────────────── */

.setup-card {
    background: var(--color-surface-solid);
    color: var(--ed-ink);
    border: 1px solid var(--ed-hairline-strong);
    border-radius: var(--radius-xl);
    padding: 1rem 1.15rem;
    margin: 0 0 1rem;
    font-family: var(--ed-ui);
}

.setup-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.setup-head-text {
    flex: 1 1 auto;
    min-width: 0;
}

.setup-title {
    font-family: var(--ed-display);
    font-size: 1.25rem;
    margin: 0;
    color: var(--ed-eucalypt);
}

.setup-sub {
    margin: 0.15rem 0 0;
    font-size: 0.93rem;
    color: var(--ed-ink-soft);
}

.setup-offer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.7rem;
}

.setup-list {
    list-style: none;
    margin: 0.8rem 0 0;
    padding: 0;
}

.setup-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.7rem;
    padding: 0.45rem 0;
    border-top: 1px solid var(--ed-hairline);
}

.setup-mark {
    flex: 0 0 auto;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--ed-hairline-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ed-ink-soft);
}

.setup-item--done .setup-mark {
    border-color: var(--ed-mint);
    color: var(--ed-mint);
}

.setup-label {
    flex: 1 1 12rem;
    min-width: 0;
}

.setup-item--done .setup-label {
    color: var(--ed-ink-soft);
}

.setup-why {
    display: block;
    font-size: 0.85rem;
    color: var(--ed-ink-soft);
}

.setup-name {
    display: flex;
    gap: 0.4rem;
    flex: 1 1 100%;
}

.setup-name .form-control {
    max-width: 16rem;
}

.setup-foot {
    margin: 0.6rem 0 0;
    padding-top: 0.6rem;
    border-top: 1px solid var(--ed-hairline);
    font-size: 0.88rem;
    color: var(--ed-ink-soft);
}

/* ── Help page: search and tours ───────────────────────────────────────────── */

.help-search {
    margin: 0 0 1rem;
}

.help-tours {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin: 0 0 1rem;
}

.help-none {
    color: var(--ed-ink-soft);
    margin: 0 0 1rem;
}

/* ── Phone layout ──────────────────────────────────────────────────────────── */

:root[data-phone="on"] .tour-card {
    border-radius: 16px;
    padding: 0.9rem 1rem 0.8rem;
}

:root[data-phone="on"] .tour-actions .btn {
    min-height: 44px;
}

:root[data-phone="on"] .setup-name .form-control {
    max-width: none;
}

@media (prefers-reduced-motion: reduce) {
    .tour-spot {
        transition: none;
    }
}
