/* Shade's welcome, help and passwords. First the guided tours (js/shade-tour.js): the flying eclipse, the ring of light round what
   it is showing and the card that talks — above everything (the assistant is 1040, its menu 1060), because a stop can be inside
   a dialog, and taking no pointer but the card's, so the page under the ring stays usable. Then the welcome dialog, the suggested
   servers, the password boxes, the Help tab and the admin list. */

.sh-tour { position: fixed; inset: 0; z-index: 2000; pointer-events: none; opacity: 0; transition: opacity .25s ease; }
.sh-tour.is-on { opacity: 1; }
.sh-tour.is-leaving { opacity: 0; }

/* A stop in the middle of the screen dims everything; a stop on a thing dims everything but it. */
.sh-tour__shade { position: fixed; inset: 0; background: rgba(8, 4, 20, 0.5); }
.sh-tour__ring {
    position: fixed;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(8, 4, 20, 0.5), 0 0 0 2px rgba(196, 181, 253, 0.95), 0 0 26px 6px rgba(168, 85, 247, 0.6);
    transition: left .3s var(--rl-ease, ease), top .3s var(--rl-ease, ease), width .3s var(--rl-ease, ease), height .3s var(--rl-ease, ease);
    animation: sh-tour-breathe 2.4s ease-in-out infinite;
}
.sh-tour__ring[hidden], .sh-tour__shade[hidden] { display: none; }

@keyframes sh-tour-breathe {
    50% { box-shadow: 0 0 0 9999px rgba(8, 4, 20, 0.5), 0 0 0 2px rgba(221, 214, 254, 1), 0 0 38px 10px rgba(168, 85, 247, 0.75); }
}

/* The eclipse, the assistant's own look (app.css .eclipse), with a trail of light while it flies. */
.sh-tour__guide { position: fixed; left: 0; top: 0; width: 64px; height: 64px; will-change: transform; filter: drop-shadow(0 0 18px rgba(168, 85, 247, 0.7)); }
.sh-tour__eclipse { --eclipse-size: 64px; animation: sh-tour-bob 3.2s ease-in-out infinite; }
.sh-tour__guide.is-flying { filter: drop-shadow(0 0 26px rgba(196, 181, 253, 0.95)) drop-shadow(-18px 10px 24px rgba(168, 85, 247, 0.55)); }
.sh-tour__guide.is-flying .sh-tour__eclipse { animation: none; }

@keyframes sh-tour-bob { 50% { transform: translateY(-5px); } }

.sh-tour__card {
    position: fixed;
    left: 0;
    top: 0;
    width: min(320px, calc(100vw - 24px));
    padding: 0.85rem 1rem 0.8rem;
    border-radius: 14px;
    border: 1px solid rgba(196, 181, 253, 0.45);
    background: linear-gradient(160deg, rgba(36, 20, 70, 0.97), rgba(16, 10, 34, 0.97));
    color: #ede9fe;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    pointer-events: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility 0s linear .2s;
}
.sh-tour__card.is-shown { opacity: 1; visibility: visible; transition: opacity .2s ease; }
.sh-tour__count { margin: 0 0 0.15rem; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: #c4b5fd; }
.sh-tour__title { margin: 0 0 0.35rem; font-size: 1.05rem; font-weight: 650; color: #fff; }
.sh-tour__text { margin: 0 0 0.75rem; font-size: 0.92rem; line-height: 1.45; color: #ddd6fe; }
.sh-tour__row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; justify-content: flex-end; }
.sh-tour__row > * { white-space: nowrap; }
.sh-tour__end { margin-right: auto; padding: 0.25rem 0; border: 0; background: none; color: #c4b5fd; font: inherit; font-size: 0.85rem; text-decoration: underline; cursor: pointer; }
.sh-tour__end:hover, .sh-tour__end:focus-visible { color: #fff; }
.sh-tour__row .btn[hidden] { display: none; }

/* The assistant's eclipse steps aside while its double flies the tour. */
[data-rl-assist][data-touring] { visibility: hidden; }

/* A new account is offered a pet on its first page too (js/pet-ui.js). Over the welcome the two fight for the screen, so the offer waits
   out of sight, still open, until the welcome and its tour are gone. */
body:has(.sw) .rl-pet-modal, body:has(.sh-tour) .rl-pet-modal { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
    .sh-tour__ring, .sh-tour__eclipse { animation: none; }
}

/* ── the Shade welcome (Components/Layout/ShadeWelcomeDialog.razor) ─────────────────────────────────────────────────────────────── */
.sw {
    position: fixed;
    inset: 0;
    z-index: 1990;
    display: grid;
    place-items: center;
    padding: 16px;
    background: radial-gradient(circle at 50% 30%, rgba(76, 29, 149, 0.45), rgba(8, 4, 20, 0.72) 70%);
    animation: sw-in .3s var(--rl-ease, ease) both;
}
.sw__box {
    position: relative;
    width: min(36rem, 100%);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 2.6rem 1.75rem 1.5rem;
    border-radius: 20px;
    border: 1px solid rgba(196, 181, 253, 0.35);
    background: var(--rl-surface);
    color: var(--rl-text);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(168, 85, 247, 0.15);
    text-align: center;
}
.sw__box--wide { width: min(46rem, 100%); }
.sw__eclipse { --eclipse-size: 4.5rem; margin: 0 auto 0.75rem; filter: drop-shadow(0 0 22px rgba(168, 85, 247, 0.6)); }
.sw__eyebrow { margin: 0 0 0.25rem; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: #8b5cf6; font-weight: 650; }
.sw__title { margin: 0 0 0.6rem; font-size: 1.45rem; line-height: 1.25; }
.sw__lede { margin: 0 auto 1rem; max-width: 32rem; color: var(--rl-text-muted); line-height: 1.5; }
.sw__essentials { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: 0.5rem; text-align: left; }
.sw__essentials li { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.6rem 0.8rem; border-radius: 12px; background: var(--rl-surface-raised); line-height: 1.4; }
.sw__emoji { flex: none; width: 1.6rem; font-size: 1.25rem; text-align: center; }
.sw__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin-top: 0.75rem; }
.sw__go { padding-inline: 1.4rem; font-size: 1rem; }
.sw__skip { margin: 1rem 0 0; font-size: 0.85rem; color: var(--rl-text-muted); }
.sw__link { padding: 0; border: 0; background: none; color: var(--rl-text-muted); font: inherit; text-decoration: underline; cursor: pointer; }
.sw__link:hover, .sw__link:focus-visible { color: var(--rl-text); }
.sw__note { margin: 0.9rem 0 0; font-size: 0.85rem; color: var(--rl-text-muted); }
.sw__chips { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin: 0.25rem 0 0.5rem; }
.sw__chip {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.45rem 0.85rem; border-radius: 999px; border: 1px solid var(--rl-border);
    background: var(--rl-surface-raised); color: var(--rl-text); font: inherit; font-size: 0.92rem; cursor: pointer;
    transition: background var(--rl-dur, .16s) ease, border-color var(--rl-dur, .16s) ease;
}
.sw__chip:hover { border-color: #a78bfa; }
.sw__chip.is-on { border-color: #8b5cf6; background: rgba(139, 92, 246, 0.16); box-shadow: inset 0 0 0 1px #8b5cf6; }
.sw__chip--small { padding: 0.25rem 0.6rem; font-size: 0.8rem; }
.sw .xp-suggest { text-align: left; margin-top: 0.5rem; }

@keyframes sw-in { from { opacity: 0; } }

/* ── suggested servers (Pages/Servers/SuggestedServers.razor) ─────────────────────────────────────────────────────────────── */
.xp-suggest__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.xp-suggest__item {
    display: grid; grid-template-columns: auto 1fr auto; gap: 0.8rem; align-items: start;
    padding: 0.75rem 0.85rem; border-radius: 14px; border: 1px solid var(--rl-border);
    background: linear-gradient(90deg, color-mix(in srgb, var(--srv, #5865f2) 12%, transparent), transparent 55%), var(--rl-surface);
}
.xp-suggest__item--testers { border-color: #8b5cf6; box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.35); }
.xp-suggest__icon {
    display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; overflow: hidden;
    color: #fff; font-weight: 700; font-size: 1.05rem;
}
.xp-suggest__icon img { width: 100%; height: 100%; object-fit: cover; }
.xp-suggest__text { min-width: 0; }
.xp-suggest__name { margin: 0; font-size: 1rem; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.xp-suggest__badge { padding: 0.1rem 0.45rem; border-radius: 999px; background: rgba(139, 92, 246, 0.16); color: #7c3aed; font-size: 0.72rem; font-weight: 650; }
.xp-suggest__badge--key { background: rgba(217, 119, 6, 0.14); color: #b45309; }
.xp-suggest__meta { margin: 0.15rem 0 0; font-size: 0.82rem; color: var(--rl-text-muted); }
.xp-suggest__desc { margin: 0.35rem 0 0; font-size: 0.9rem; line-height: 1.4; }
.xp-suggest__act { align-self: center; }
.xp-suggest .cs-gate--compact { margin-top: 0.5rem; }
@media (max-width: 560px) {
    .xp-suggest__item { grid-template-columns: auto 1fr; }
    .xp-suggest__act { grid-column: 1 / -1; }
}

/* ── passwords (Pages/Servers/GatePrompt.razor and its hosts) ─────────────────────────────────────────────────────────────── */
.cs-gate { display: grid; gap: 0.6rem; justify-items: center; text-align: center; }
.cs-gate--compact { justify-items: stretch; text-align: left; }
.cs-gate__glyph { font-size: 2.4rem; line-height: 1; }
.cs-gate__title { margin: 0; font-size: 1.25rem; }
.cs-gate__lede { margin: 0; max-width: 28rem; color: var(--rl-text-muted); line-height: 1.45; }
.cs-gate__row { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; width: min(26rem, 100%); }
.cs-gate--compact .cs-gate__row { justify-content: flex-start; width: 100%; }
.cs-gate__row input { flex: 1 1 12rem; min-width: 0; }
.cs-gate__error { margin: 0; }
.cs-locked { min-height: 60vh; display: grid; place-content: center; gap: 1rem; padding: 2rem 1rem; }
.cs-locked__away { margin: 0; text-align: center; font-size: 0.9rem; color: var(--rl-text-muted); }
.cs-join--locked { max-width: 32rem; }
.cs-chan__key { flex: none; font-size: 0.8rem; opacity: 0.85; }
.cs-chan__key--shut { opacity: 1; }
.cs-ok { margin: 0.5rem 0 0; color: var(--rl-ok); font-size: 0.9rem; }
.cs-joingate__choices { display: grid; gap: 0.4rem; margin-bottom: 0.6rem; }
.cs-joingate__choice.is-on { border-radius: 10px; background: rgba(139, 92, 246, 0.08); }
.cs-chanlock { margin-top: 1rem; }
.invite__pwlabel { display: block; margin: 0 0 0.35rem; font-size: 0.9rem; font-weight: 600; }
.invite__pw { width: 100%; margin-bottom: 0.6rem; padding: 0.55rem 0.75rem; border-radius: 10px; border: 1px solid var(--rl-border); background: var(--rl-surface); color: var(--rl-text); font: inherit; }

/* ── the Help tab (Components/Layout/HelpPane.razor) ──────────────────────────────────────────────────────────────────────── */
.sh-help { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.sh-help__body { flex: 1; min-height: 0; overflow-y: auto; padding: 0.75rem 0.9rem 0.9rem; display: flex; flex-direction: column; gap: 0.6rem; }
.sh-help__ask { display: flex; gap: 0.4rem; }
.sh-help__ask input { flex: 1; min-width: 0; padding: 0.5rem 0.7rem; border-radius: 10px; border: 1px solid var(--rl-border); background: var(--rl-surface); color: var(--rl-text); font: inherit; }
.sh-help__hint { margin: 0.25rem 0 0; font-size: 0.82rem; color: var(--rl-text-muted); }
.sh-help__answer { margin: 0.25rem 0 0; line-height: 1.4; }
.sh-help__starters { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.sh-help__chip { padding: 0.3rem 0.65rem; border-radius: 999px; border: 1px solid var(--rl-border); background: var(--rl-surface-raised); color: var(--rl-text); font: inherit; font-size: 0.82rem; cursor: pointer; text-align: left; }
.sh-help__chip:hover, .sh-help__guide:hover { border-color: #a78bfa; }
.sh-help__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.sh-help__guide {
    display: grid; gap: 0.1rem; width: 100%; padding: 0.5rem 0.65rem; border-radius: 10px; border: 1px solid var(--rl-border);
    background: var(--rl-surface-raised); color: var(--rl-text); font: inherit; text-align: left; cursor: pointer;
}
.sh-help__guide small { color: var(--rl-text-muted); font-size: 0.8rem; }
.sh-help__more { align-self: flex-start; padding: 0; border: 0; background: none; color: var(--rl-accent); font: inherit; font-size: 0.85rem; cursor: pointer; text-decoration: underline; }
.sh-help__foot { margin-top: auto; padding-top: 0.5rem; border-top: 1px solid var(--rl-border); }
/* Where a walkthrough is about, beside its name: two answers called "Voice" are told apart by "Admin › Settings" and "Shade". */
.sh-help__area {
    display: inline-block; margin-left: 0.35rem; padding: 0.05rem 0.45rem; border-radius: 999px; vertical-align: 0.1em;
    background: color-mix(in srgb, var(--rl-accent) 14%, transparent); color: var(--rl-text-muted); font-size: 0.72rem; font-weight: 500; white-space: nowrap;
}
.sh-help__row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.sh-help__all { display: grid; gap: 0.3rem; }
.sh-help__fold > summary {
    display: flex; align-items: center; gap: 0.45rem; padding: 0.35rem 0.2rem; cursor: pointer; font-size: 0.88rem; font-weight: 600; list-style: none;
}
.sh-help__fold > summary::-webkit-details-marker { display: none; }
/* A flex summary loses the browser's own triangle, so the fold draws its own chevron. */
.sh-help__fold > summary::before {
    content: ""; flex: none; width: 0.4rem; height: 0.4rem; margin: 0 0.15rem 0 0.1rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    opacity: 0.7; transform: rotate(-45deg); transition: transform 0.15s ease;
}
.sh-help__fold[open] > summary::before { transform: rotate(45deg); }
.sh-help__fold[open] > summary { margin-bottom: 0.3rem; }
.sh-help__count { color: var(--rl-text-muted); font-weight: 400; font-size: 0.78rem; }
/* Inside a fold the fold says where; the tag would only say it again. */
.sh-help__fold .sh-help__area { display: none; }

/* ── Admin → Shade welcome (Pages/Admin/ShadeWelcomeAdmin.razor) ───────────────────────────────────────────────────────────── */
.shwadmin__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.shwadmin__row { display: grid; gap: 0.5rem; padding: 0.7rem 0.8rem; border-radius: 12px; border: 1px solid var(--rl-border); }
.shwadmin__row.is-on { border-color: #8b5cf6; background: rgba(139, 92, 246, 0.06); }
.shwadmin__who { display: flex; gap: 0.7rem; align-items: center; }
.shwadmin__who small { display: block; color: var(--rl-text-muted); }
.shwadmin__icon { display: grid; place-items: center; flex: none; width: 2.4rem; height: 2.4rem; border-radius: 50%; overflow: hidden; color: #fff; font-weight: 700; }
.shwadmin__icon img { width: 100%; height: 100%; object-fit: cover; }
.shwadmin__tags { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
