/* Guidance (#1007): the New! badge, the What's New button and the inside of the What's New modal,
   lifted from mockups/1007-whats-new.html as Felix approved it. Tokens only; the badge gradient
   mixes the theme's tuscan yellow with a warm orange. Loaded by hub/base.html on every hub page.
   Part 2 ships the button and the modal; the badge classes wait here for part 3's tag. Every
   animation runs once per 10 s at most and is off under prefers-reduced-motion. The shots
   stepper (#1050) fills the media slot: a 16:10 picture that slides between steps, the captions
   listed beside it, and a lightbox kept inside the modal. */

:root {
    --pl-new-from: #ffd36a;
    --pl-new-mid: var(--color-tuscan-yellow);
    --pl-new-to: #f08a3e;
    --pl-new-text: var(--color-navy);
    --pl-new-ring: color-mix(in srgb, var(--color-tuscan-yellow) 55%, transparent);
}

/* ---- The New! badge: rides after any label (tab, card title, sidebar link, page title) ---- */
.pl-new {
    display: inline-flex;
    align-items: center;
    gap: 0.18em;
    margin-left: 0.45em;
    padding: 0.14em 0.55em 0.12em 0.45em;
    font-family: var(--font-heading);
    font-size: 0.62rem;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--pl-new-text);
    background: linear-gradient(135deg, var(--pl-new-from) 0%, var(--pl-new-mid) 55%, var(--pl-new-to) 100%);
    border-radius: 999px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.22), inset 0 0 0 1px rgba(255, 255, 255, 0.28);
    transform: rotate(4deg) translateY(-0.12em);
    opacity: 0.88;
    vertical-align: middle;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 0; /* a flex item with overflow hidden would shrink and clip its own text */
    animation: pl-new-pop 0.55s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
/* The sparkle is decoration: the second `content` gives it empty alternative text so it stays out of
   the accessible name ("Reservations New!", not "Reservations ✦ New!"); a browser without the
   slash syntax keeps the first line and draws it anyway. */
.pl-new::before { content: "\2726"; content: "\2726" / ""; font-size: 0.95em; line-height: 1; }
.pl-new::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.6) 50%, transparent 70%);
    transform: translateX(-130%);
    animation: pl-new-shine 10s ease-in-out 1s infinite; /* one sweep, then still for the rest of the 10 s */
}
@keyframes pl-new-pop {
    from { transform: rotate(4deg) translateY(-0.12em) scale(0.4); opacity: 0; }
    to { transform: rotate(4deg) translateY(-0.12em) scale(1); opacity: 0.88; }
}
@keyframes pl-new-shine { 0% { transform: translateX(-130%); } 12% { transform: translateX(130%); } 100% { transform: translateX(130%); } }
.vote-tab .pl-new { margin-left: 0.4em; }
.hub-page-title .pl-new { font-size: 0.72rem; margin-left: 0.6em; }
.pl-tool-card__title .pl-new { margin-left: 0.4em; }
.hub-sidebar__link .pl-new { margin-left: auto; transform: rotate(4deg); }

/* The phone section picker carries the badge: a dot on the summary, the badge in the list */
.pl-tab-picker__summary .pl-new-dot {
    width: 0.55rem; height: 0.55rem; border-radius: 50%;
    background: linear-gradient(135deg, var(--pl-new-from), var(--pl-new-to));
    box-shadow: 0 0 0 2px var(--hub-card-bg);
    margin-left: 0.4rem; flex: 0 0 auto;
}
.pl-tab-picker__item .pl-new { margin-left: 0.5em; }

/* ---- The What's New button: labelled on Home, an icon on feature pages ---- */
.pl-whats-new-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    height: 2.4rem;
    min-width: 2.4rem;
    padding: 0 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--hub-border-strong);
    background: var(--hub-elevated);
    color: var(--hub-text);
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.pl-whats-new-btn:hover { border-color: var(--color-tuscan-yellow); color: var(--hub-link); }
.pl-whats-new-btn:focus-visible { outline: 2px solid var(--hub-blue); outline-offset: 2px; }
.pl-whats-new-btn--icon { width: 2.4rem; padding: 0; }
.pl-whats-new-btn svg { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; }
.pl-whats-new-btn__dot {
    position: absolute; top: -3px; right: -2px;
    width: 0.65rem; height: 0.65rem; border-radius: 50%;
    background: linear-gradient(135deg, var(--pl-new-from), var(--pl-new-to));
    box-shadow: 0 0 0 2px var(--hub-bg);
}
.pl-whats-new-btn--unseen { animation: pl-wn-pulse 10s ease-out infinite; } /* one pulse every 10 s */
.pl-whats-new-btn--unseen svg { animation: pl-wn-wiggle 10s ease-in-out infinite; }
@keyframes pl-wn-pulse {
    0% { box-shadow: 0 0 0 0 var(--pl-new-ring); }
    12% { box-shadow: 0 0 0 10px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}
@keyframes pl-wn-wiggle {
    0%, 9%, 100% { transform: rotate(0); }
    2% { transform: rotate(-14deg) scale(1.08); }
    4.5% { transform: rotate(12deg) scale(1.08); }
    7% { transform: rotate(-6deg); }
}
@media (prefers-reduced-motion: reduce) {
    .pl-new, .pl-new::after, .pl-whats-new-btn--unseen, .pl-whats-new-btn--unseen svg { animation: none; }
}
/* ---- Inside the What's New modal ---- */
.pl-wn-tabs { margin: -0.25rem 0 0.25rem; }
.pl-modal .pl-tabs { --pl-tabs-bg: var(--hub-card-bg); } /* the edge fade matches the modal, as .hub-card .pl-tabs does */
.pl-wn-date {
    font-family: var(--font-heading); font-size: 0.72rem; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase; color: var(--hub-text-muted);
    margin: 1.1rem 0 0.25rem;
}
.pl-wn-entry { padding: 0.85rem 0; border-top: 1px solid var(--hub-border); }
.pl-wn-entry:first-of-type { border-top: 0; }
.pl-wn-entry__title {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    font-family: var(--font-heading); font-size: 1rem; font-weight: 700; margin: 0 0 0.3rem;
}
.pl-wn-chip {
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.03em;
    padding: 0.12em 0.6em; border-radius: 999px;
    background: var(--hub-blue-soft); color: var(--hub-blue);
}
.pl-wn-entry__changes { margin: 0.2rem 0 0.7rem 1.15rem; padding: 0; font-size: 0.92rem; line-height: 1.5; }
.pl-wn-entry__changes li + li { margin-top: 0.2rem; }
.pl-wn-clip { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1rem; margin: 0.4rem 0 0.8rem; }
.pl-wn-clip--steps { grid-template-columns: 1fr; } /* a frozen entry's How it works lines alone, with no shots beside them */
.pl-wn-clip__video {
    aspect-ratio: 16 / 9; border-radius: 0.6rem; overflow: hidden; position: relative;
    background: var(--hub-surface); border: 1px solid var(--hub-border);
}
.pl-wn-clip__video video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pl-wn-clip__length {
    position: absolute; right: 0.5rem; bottom: 0.5rem; font-size: 0.68rem; font-weight: 700;
    padding: 0.1em 0.5em; border-radius: 999px; background: rgba(0, 0, 0, 0.55); color: #fff;
}
.pl-wn-steps { margin: 0; padding-left: 1.2rem; font-size: 0.9rem; line-height: 1.5; }
.pl-wn-steps li + li { margin-top: 0.3rem; }
.pl-wn-steps__eyebrow {
    display: block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--hub-text-muted); margin: 0 0 0.35rem;
}
/* ---- The shots stepper (#1050): the picture, Step N of M and its caption, the captions listed beside it ---- */
.pl-wn-shots { align-items: start; border-radius: 0.6rem; }
.pl-wn-shots:focus-visible { outline: 2px solid var(--hub-blue); outline-offset: 4px; }
.pl-wn-shots__media { margin: 0; min-width: 0; }
.pl-wn-shots__frame {
    aspect-ratio: 16 / 10; border-radius: 0.6rem; overflow: hidden; position: relative;
    background: var(--hub-surface); border: 1px solid var(--hub-border);
}
.pl-wn-shots__track { display: flex; height: 100%; transition: transform 0.3s ease; }
.pl-wn-shots__slide {
    flex: 0 0 100%; width: 100%; height: 100%; display: block;
    padding: 0; margin: 0; border: 0; background: transparent; cursor: zoom-in;
}
.pl-wn-shots__slide:focus-visible { outline: 2px solid var(--hub-blue); outline-offset: -2px; }
.pl-wn-shots__img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pl-wn-shots__caption { margin: 0.6rem 0 0; }
.pl-wn-shots__count {
    display: block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--hub-text-muted);
}
.pl-wn-shots__text { margin: 0.25rem 0 0; font-size: 0.9rem; line-height: 1.5; }
.pl-wn-shots__nav { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.pl-wn-shots__list { list-style: none; margin: 0; padding: 0; counter-reset: pl-wn-step; }
.pl-wn-shots__list li { counter-increment: pl-wn-step; }
.pl-wn-shots__list li + li { margin-top: 0.35rem; }
.pl-wn-shots__step {
    display: flex; gap: 0.6rem; align-items: flex-start; width: 100%; text-align: left;
    padding: 0.4rem 0.6rem; border-radius: 0.5rem; border: 1px solid transparent;
    background: transparent; color: var(--hub-text); font: inherit; font-size: 0.9rem; line-height: 1.45; cursor: pointer;
}
.pl-wn-shots__step::before {
    content: counter(pl-wn-step); flex: 0 0 1.5rem; height: 1.5rem; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-heading); font-size: 0.72rem; font-weight: 700;
    background: var(--hub-surface); color: var(--hub-text-muted);
}
.pl-wn-shots__step:hover { border-color: var(--hub-border-strong); }
.pl-wn-shots__step:focus-visible { outline: 2px solid var(--hub-blue); outline-offset: 2px; }
.pl-wn-shots__list .is-current .pl-wn-shots__step { background: var(--hub-surface); border-color: var(--hub-border-strong); }
.pl-wn-shots__list .is-current .pl-wn-shots__step::before {
    background: linear-gradient(135deg, var(--pl-new-from), var(--pl-new-to)); color: var(--pl-new-text);
}
/* The lightbox: full screen inside the modal's stacking context, in the class gallery's shape */
.pl-wn-lightbox {
    position: fixed; inset: 0; z-index: 600; display: flex; align-items: center; justify-content: center;
    padding: 2rem; background: rgba(4, 16, 28, 0.92);
}
.pl-wn-lightbox__img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 6px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6); }
.pl-wn-lightbox__close, .pl-wn-lightbox__nav {
    position: absolute; width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(7, 30, 50, 0.85); color: var(--color-cream, #f4efdd); border: 1px solid rgba(238, 180, 75, 0.3);
    font-size: 28px; line-height: 1; cursor: pointer; transition: background 0.15s ease;
}
.pl-wn-lightbox__close { top: 18px; right: 18px; font-size: 22px; }
.pl-wn-lightbox__nav--prev { left: 24px; top: 50%; transform: translateY(-50%); }
.pl-wn-lightbox__nav--next { right: 24px; top: 50%; transform: translateY(-50%); }
.pl-wn-lightbox__close:hover, .pl-wn-lightbox__nav:hover:not(:disabled) {
    background: var(--color-tuscan-yellow); color: var(--color-navy); border-color: var(--color-tuscan-yellow);
}
.pl-wn-lightbox__nav:disabled { opacity: 0.35; cursor: default; }
.pl-wn-lightbox__counter {
    position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
    color: var(--hub-text-muted); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
}
.pl-wn-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.pl-wn-older { display: block; margin: 0.75rem auto 0.25rem; } /* Show older, centred under the last entry of the page */
.pl-wn-empty { padding: 2rem 0; text-align: center; color: var(--hub-text-muted); font-size: 0.92rem; }
@media (max-width: 639.98px) {
    .pl-wn-clip { grid-template-columns: 1fr; } /* the picture above the list */
    .pl-wn-tabs { margin-top: 0; }
    .pl-wn-lightbox { padding: 1rem; }
    .pl-wn-lightbox__nav--prev { left: 8px; }
    .pl-wn-lightbox__nav--next { right: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    .pl-wn-shots__track { transition: none; } /* the next step appears; nothing slides */
}

/* ---- The walkthrough button (#1076): components/walkthrough_button.html ---- */
.pl-walkthrough { display: inline-flex; align-items: center; gap: 0.5rem; }
.pl-walkthrough-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    height: 2.4rem;
    padding: 0 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--hub-border-strong);
    background: var(--hub-elevated);
    color: var(--hub-text);
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.pl-walkthrough-btn:hover { border-color: var(--color-tuscan-yellow); color: var(--hub-link); }
.pl-walkthrough-btn:focus-visible { outline: 2px solid var(--hub-blue); outline-offset: 2px; }
.pl-walkthrough-btn svg { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; }
/* The onboarding offer glows in the New! gold until they take the tour or exit. */
.pl-walkthrough-btn--glow {
    border-color: transparent;
    background: linear-gradient(135deg, var(--pl-new-from), var(--pl-new-to));
    color: #092E4C;
    animation: pl-walkthrough-glow 2.4s ease-in-out infinite;
}
.pl-walkthrough-btn--glow:hover { color: #092E4C; }
@keyframes pl-walkthrough-glow {
    0%, 100% { box-shadow: 0 0 0 0 var(--pl-new-ring), 0 0 10px 2px rgba(255, 211, 106, 0.35); }
    50% { box-shadow: 0 0 0 6px transparent, 0 0 22px 6px rgba(255, 211, 106, 0.55); }
}
.pl-walkthrough-dock {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    max-width: 22rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--hub-border-strong);
    background: var(--hub-card-bg);
    color: var(--hub-text);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.pl-walkthrough-dock__text { margin: 0; font-size: 0.9rem; line-height: 1.45; }
@media (max-width: 640px) {
    .pl-walkthrough-dock { left: 1rem; right: 1rem; bottom: 5rem; max-width: none; }
}
/* The guild staff rules popup's body: a badge per rule, the rule itself in a warning callout. */
.pl-staff-rules__lead { margin: 0 0 1rem; }
.pl-staff-rules__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.pl-staff-rules__rule { display: grid; grid-template-columns: 7.5rem 1fr; align-items: baseline; gap: 0.75rem; line-height: 1.5; }
.pl-staff-rules__badge { justify-self: start; white-space: nowrap; }
[data-theme="light"] .pl-staff-rules__badge { background: rgba(180, 120, 10, 0.12); color: #8a5a00; }
.pl-staff-rules__callout {
    --pl-callout-ink: #fbbf24;
    --pl-callout-wash: rgba(251, 191, 36, 0.12);
    display: flex; gap: 0.75rem; align-items: flex-start;
    margin-top: 1.5rem; padding: 0.875rem 1rem;
    border-left: 4px solid var(--pl-callout-ink); border-radius: 8px;
    background: var(--pl-callout-wash);
}
[data-theme="light"] .pl-staff-rules__callout { --pl-callout-ink: #a16207; --pl-callout-wash: rgba(180, 120, 10, 0.1); }
.pl-staff-rules__callout svg { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; margin-top: 0.1rem; color: var(--pl-callout-ink); }
.pl-staff-rules__callout p { margin: 0; line-height: 1.5; }
.pl-staff-rules__callout strong { color: var(--pl-callout-ink); }
.pl-staff-rules__more { margin: 1rem 0 0; }
.pl-staff-rules__form { margin-top: 1.5rem; }
.pl-staff-rules__form .pl-modal__actions { margin-top: 1.5rem; }
.pl-staff-rules__form .pl-btn[disabled] { opacity: 0.45; cursor: not-allowed; }
@media (max-width: 480px) {
    .pl-staff-rules__rule { grid-template-columns: 1fr; gap: 0.25rem; }
}
@media (prefers-reduced-motion: reduce) { .pl-walkthrough-btn--glow { animation: none; } }
/* A tab's walkthrough button sits on its own row at the top of the tab, right aligned. */
.pl-walkthrough-row { display: flex; justify-content: flex-end; margin: 0 0 1rem; }

/* ---- The one step highlight (#1051): Open <feature> lands on ?show=<key> and Show me stays put; both ring
   the one control carrying data-guidance-target="<key>" through the tour's Driver.js stage and popover
   (pl_tour.js show). The ring is the brand gold on the ringed element itself, inside Driver's stage padding,
   with one soft pulse per 10 s like the badge; the popover drops its footer (one stop, nothing to walk).
   Still under prefers-reduced-motion, and pl_tour.js scrolls without animation there. ---- */
.pl-guidance-showing .driver-active-element {
    box-shadow: 0 0 0 3px var(--color-tuscan-yellow), 0 0 0 7px var(--pl-new-ring); /* follows the control's own corners */
    animation: pl-show-ring 10s ease-out infinite;
}
@keyframes pl-show-ring {
    0% { box-shadow: 0 0 0 3px var(--color-tuscan-yellow), 0 0 0 3px var(--pl-new-ring); }
    12% { box-shadow: 0 0 0 3px var(--color-tuscan-yellow), 0 0 0 12px transparent; }
    100% { box-shadow: 0 0 0 3px var(--color-tuscan-yellow), 0 0 0 7px var(--pl-new-ring); }
}
.driver-popover.pl-tour--show .driver-popover-footer { display: none; }
@media (prefers-reduced-motion: reduce) {
    .pl-guidance-showing .driver-active-element { animation: none; }
}
