/* ==========================================================================
   Emergency WordPress support (/emergency-wordpress-support/)
   Loaded via `page_css: ewp`.
   Hero: the night city sending up the signal. Then "is this what you're
   seeing?" (real error screens that fix themselves on hover), the superhero
   with the deal, proof, the form and the FAQ.
   The colours, buttons, payment badges, promise strip, final call and the
   fixed quote and no fix, no fee cards are shared with the knowledgebase, so they live in style.css ("Emergency
   support kit").
   ========================================================================== */

/* ---------- Hero ---------- */

.ewp-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: clamp(560px, calc(100svh - 84px), 820px);
    padding-top: calc(var(--header-top) + var(--header-height));
    background: var(--ewp-sky-gradient);
    color: #fff;
    overflow: hidden;
}

.ewp-hero__bg {
    position: absolute;
    inset: calc(var(--header-top) + var(--header-height)) 0 0; /* keep the signal clear of the nav */
    pointer-events: none;

    & img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: 50% 100%;
        display: block;
    }
}

.ewp-hero__inner {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding-block: var(--space-lg) var(--space-xl);
}

.ewp-hero .hero-badge {
    margin: 0 0 var(--space-lg);
    background: rgba(42, 26, 74, 0.5);
}

.ewp-hero__title {
    max-width: 64rem;
    margin: 0 0 var(--space-lg);
    font-size: clamp(2.75rem, 1.5rem + 3.8vw, 5rem);
    line-height: 0.98;
    letter-spacing: -0.035em;
    color: #fff;
    text-wrap: balance;

    & span { color: var(--ewp-lit); }
}

.ewp-hero__desc {
    max-width: 48rem;
    margin: 0 0 calc((var(--space-lg) + var(--space-xl)) / 2);
    font-size: var(--text-lg);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.88);
    text-shadow: 0 1px 12px rgba(42, 26, 74, 0.35);
}

@media (width < 769px) {
    .ewp-hero {
        display: block;
        min-height: 0;
        padding-bottom: 170px; /* the art rises up beside the buttons */
    }

    .ewp-hero__bg {
        top: auto;
        height: 330px;

        & img { object-position: 52% 100%; }
    }

    .ewp-hero__inner { padding-block: var(--space-xl); }

    .ewp-hero .hero-badge__extra { display: none; }

}

/* ---------- Find your problem: the error carousel ----------
   Cards snap to the centre and every card stays fully visible; the arrows
   and counter sit underneath. ewp-errors.js handles the loop, chips and drag. */

.ewp-seen {
    overflow-x: clip;
    --card-w: clamp(300px, 27vw, 380px);
}

.ewp-seen__head {
    & .section-subtitle { margin-bottom: 0; max-width: 46rem; }
}

/* Problem index: jump the rail to a card; the one in focus lights up */
.ewp-seen__index {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-lg);

    @media (width < 700px) {
        flex-wrap: nowrap;
        margin-inline: calc(var(--container-padding) * -1);
        padding: 2px var(--container-padding);
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
        mask-image: linear-gradient(90deg, #000 85%, transparent);

        &::-webkit-scrollbar { display: none; }
    }
}

.ewp-chip {
    flex: none;
    padding: 0.45em 0.95em;
    border: 1px solid #dcd8e8;
    border-radius: 99px;
    background: #fff;
    font: inherit;
    font-size: var(--text-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    white-space: nowrap;
    cursor: pointer;
    transition: background 180ms ease, border-color 180ms ease, color 180ms ease;

    &:hover { border-color: var(--color-primary); color: var(--color-primary); }
    &:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

    &[aria-current="true"] {
        background: var(--color-primary);
        border-color: var(--color-primary);
        color: #fff;
    }
}

.ewp-chip--else {
    border-style: dashed;
    border-color: color-mix(in srgb, var(--color-primary) 45%, #fff);
    color: var(--color-primary);
}

/* Stage: holds the rail and the arrows that flank the centred card */
.ewp-seen__stage {
    position: relative;
    margin-top: var(--space-xl);
}

.ewp-seen__controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: -6px;
}

.ewp-rail-btn {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid #dcd8e8;
    border-radius: 50%;
    background: #fff;
    color: var(--color-text);
    cursor: pointer;
    transition: background 180ms ease, border-color 180ms ease, color 180ms ease;

    & svg { width: 1.4rem; height: 1.4rem; }
    &:hover { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
    &:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }
}

/* Full-bleed rail that loops forever (copies of the set either side) */
.ewp-seen__grid {
    position: relative; /* card offsetLeft is measured from the track */
    display: flex;
    align-items: stretch;
    gap: var(--space-md);
    margin-inline: calc(50% - 50vw);
    padding: var(--space-sm) 0 52px; /* room for the active card's shadow (the scroller clips overflow) */
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);

    &::-webkit-scrollbar { display: none; }
    &:focus-visible { outline: none; }

    & > .ewp-err {
        flex: 0 0 var(--card-w);
        scroll-snap-align: center;
    }

    @media (width < 700px) {
        gap: var(--space-sm);
        & > .ewp-err { flex-basis: 78vw; }
    }
}

/* The centred card (the one the arrows move from) gets a gentle outline */
.ewp-seen__grid.is-ready > .ewp-err {
    transition: box-shadow 300ms ease, border-color 300ms ease, translate 300ms ease;

    &.is-active {
        border-color: color-mix(in srgb, var(--color-primary) 45%, #fff);
        box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 45%, #fff), 0 22px 44px -26px rgba(79, 49, 131, 0.5);
        translate: 0 -4px;
    }
}

.ewp-seen__grid:focus-visible > .ewp-err.is-active { border-color: var(--color-primary); }

/* Mouse users can drag the rail */
@media (pointer: fine) {
    .ewp-seen__grid { cursor: grab; }
    .ewp-seen__grid.is-dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
    .ewp-seen__grid.is-dragging .ewp-err { pointer-events: none; }
}

/* Brief highlight when a chip jumps to a card */
.ewp-err.is-found { animation: ewp-found 1.4s ease-out; }

@keyframes ewp-found {
    0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-primary) 55%, transparent); }
    100% { box-shadow: 0 0 0 16px transparent; }
}

@media (prefers-reduced-motion: reduce) {
    .ewp-seen__grid.is-ready > .ewp-err { transition: none; }
    .ewp-err.is-found { animation: none; }
}

/* The card */
.ewp-err {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 12px 12px 20px;
    background: #fff;
    border: 1px solid #e6e8ee;
    border-radius: 16px;
    color: var(--color-text);

    & h3 {
        margin: 20px 10px 6px;
        font-size: var(--text-lg);
        line-height: 1.25;
    }

    & > p {
        margin: 0 10px 20px;
        font-size: var(--text-sm);
        line-height: 1.55;
        color: var(--color-text-secondary);
    }
}

.ewp-err__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    margin: auto 10px 0;
    white-space: nowrap;
}

/* The whole card is the "Get this fixed" button; the guide link sits above it */
.ewp-err__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.45em;
    padding: 0.6em 1.15em;
    border: 0;
    border-radius: 99px;
    background: var(--color-primary);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);
    color: #fff;
    cursor: pointer;
    transition: background 200ms ease;

    &::after {
        content: "";
        width: 1.05em;
        height: 1.05em;
        background: currentColor;
        -webkit-mask: var(--ewp-arrow) center / contain no-repeat;
        mask: var(--ewp-arrow) center / contain no-repeat;
        transition: translate 200ms ease;
    }
    &::before { content: ""; position: absolute; inset: 0; border-radius: 16px; }
    &:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }
}

.ewp-err:hover .ewp-err__cta { background: var(--color-primary-hover); }
.ewp-err:hover .ewp-err__cta::after { translate: 3px 0; }

.ewp-err__guide {
    position: relative;
    z-index: 1;
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
    text-decoration: underline;
    text-decoration-color: #c9cdd6;
    text-underline-offset: 3px;

    &:hover { color: var(--color-primary); text-decoration-color: currentColor; }
}

/* The error screens are SVG images (tools/ewp-art/build-error-screens.py), so
   their text isn't read as page content */
.ewp-shot {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 320 / 210;
    border-radius: 8px;
    box-shadow: 0 0 0 1px #e1e4ea;
}

/* The "Something else?" card at the end of the loop */
.ewp-err--else {
    justify-content: center;
    padding: var(--space-xl) var(--space-lg);
    border-style: dashed;
    border-color: color-mix(in srgb, var(--color-primary) 35%, #fff);
    background: color-mix(in srgb, var(--color-primary) 4%, #fff);
    text-align: center;

    & h3 { margin: var(--space-md) 0 var(--space-sm); }
    & .ewp-err__foot { justify-content: center; margin-top: calc(var(--space-xs) - 3px); }
}

.ewp-err__q {
    display: grid;
    place-items: center;
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto;
    border-radius: 50%;
    background: color-mix(in srgb, var(--color-primary) 12%, #fff);
    font-size: 2.25rem;
    font-weight: var(--font-weight-extrabold);
    line-height: 1;
    color: var(--color-primary);
}

/* ---------- The deal, with the superhero ---------- */

.ewp-eyebrow {
    margin: 0 0 var(--space-xs);
    font-size: var(--text-xs);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-primary);
}

.ewp-deal__top {
    display: grid;
    grid-template-columns: minmax(0, 4.4fr) minmax(0, 7.6fr);
    gap: var(--space-2xl);
    align-items: start;

    @media (width < 1024px) {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
}

.ewp-deal__art {
    display: flex;
    justify-content: center;

    & img {
        width: 100%;
        max-width: 520px;
        height: auto;
        animation: ewp-float 7s ease-in-out infinite;
    }

    @media (width < 1024px) {
        & img { max-width: 340px; }
    }
}

@keyframes ewp-float {
    0%, 100% { translate: 0 0; }
    50%      { translate: 0 -12px; }
}

@media (prefers-reduced-motion: reduce) {
    .ewp-deal__art img { animation: none; }
}

.ewp-deal__title {
    margin: 0 0 var(--space-sm);
    font-size: clamp(2.25rem, 1.5rem + 3vw, 3.75rem);
    line-height: 1.02;
    letter-spacing: -0.03em;
}

.ewp-deal__lead {
    margin: 0;
    font-size: var(--text-lg);
    line-height: 1.6;
    color: var(--color-text-secondary);
}

.ewp-deal__cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin-top: var(--space-xl);

    @media (width < 700px) { grid-template-columns: 1fr; }

    & > div {
        border-radius: 14px;
        padding: var(--space-xl) var(--space-lg);
    }
}

/* How it works: a horizontal timeline */
.ewp-process {
    margin-top: var(--space-3xl);
}

.ewp-process__title {
    margin: 0 0 var(--space-xl);
    font-size: var(--text-2xl);
    line-height: 1.2;
}

.ewp-steps {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-xl);
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: ewp-step;

    /* the line joining the numbers */
    &::before {
        content: "";
        position: absolute;
        top: 1.25rem;
        left: 1.25rem;
        right: 0;
        height: 2px;
        background: linear-gradient(90deg, var(--color-primary), rgba(79, 49, 131, 0.15));
    }

    & li {
        position: relative;
        padding-top: 3.75rem;
        font-size: var(--text-sm);
        line-height: 1.6;
        color: var(--color-text-secondary);
        counter-increment: ewp-step;
    }

    & li::before {
        content: counter(ewp-step);
        position: absolute;
        left: 0;
        top: 0;
        display: grid;
        place-items: center;
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 50%;
        background: var(--color-primary);
        box-shadow: 0 0 0 6px var(--color-surface-alt);
        font-weight: var(--font-weight-bold);
        color: #fff;
    }

    & span {
        display: block;
        font-size: var(--text-xs);
        font-weight: var(--font-weight-bold);
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--color-primary);
    }

    & strong {
        display: block;
        margin: 2px 0 4px;
        font-size: var(--text-base);
        color: var(--color-text);
    }

    @media (width < 960px) {
        grid-template-columns: 1fr 1fr;
        &::before { display: none; }
    }

    @media (width < 600px) {
        grid-template-columns: 1fr;
        gap: var(--space-lg);

        & li { padding: 0 0 0 3.5rem; }
    }
}

.ewp-deal__stack {
    margin: var(--space-2xl) 0 0;
    padding-top: var(--space-lg);
    border-top: 1px solid #dde1e8;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

/* ---------- Emergency WordPress repair (long form) ---------- */

.ewp-fix__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl) var(--space-2xl);
    margin-top: var(--space-xl);

    @media (width < 1100px) { grid-template-columns: repeat(2, 1fr); }
    @media (width < 700px)  { grid-template-columns: 1fr; }

    & article {
        padding-top: var(--space-md);
        border-top: 2px solid var(--color-primary);
    }

    & h3 {
        margin: 0 0 var(--space-xs);
        font-size: var(--text-lg);
        line-height: 1.3;
    }

    & p {
        margin: 0;
        font-size: var(--text-sm);
        line-height: 1.7;
        color: var(--color-text-secondary);
    }

    & a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px; }
}

.ewp-fix__who {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    margin-top: var(--space-2xl);
    padding: var(--space-xl);
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 0 #e3e6ec;

    @media (width < 960px) { grid-template-columns: 1fr; }

    & h3 { margin: 0 0 var(--space-xs); font-size: var(--text-base); }
    & p { margin: 0; font-size: var(--text-sm); line-height: 1.7; color: var(--color-text-secondary); }
    & a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px; }
}

/* ---------- Answer-first definition + what affects the price ----------
   One white card, two columns split by a hairline */

.ewp-answer {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    margin-top: var(--space-xl);
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 0 #e3e6ec, 0 18px 40px -28px rgba(31, 22, 56, 0.35);

    @media (width < 900px) { grid-template-columns: 1fr; }

    & > div { padding: var(--space-lg); }

    & h3 {
        margin: 0 0 var(--space-sm);
        font-size: var(--text-lg);
        line-height: 1.3;
    }

    & p { margin: 0; line-height: 1.7; }
}

.ewp-answer__main p {
    font-size: var(--text-base);
    color: var(--color-text);
}

.ewp-answer__facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    margin: var(--space-lg) 0 0;
    padding: 0;
    list-style: none;

    @media (width < 600px) { grid-template-columns: 1fr; }

    & li {
        padding: var(--space-sm) var(--space-md);
        border-radius: 12px;
        background: #f6f5fa;
        font-size: var(--text-xs);
        line-height: 1.4;
        color: var(--color-text-secondary);
    }

    & strong {
        display: block;
        margin-bottom: 2px;
        font-size: var(--text-base);
        color: var(--color-primary);
    }
}

.ewp-answer__side {
    border-left: 1px solid #ebedf1;

    @media (width < 900px) {
        border-left: 0;
        border-top: 1px solid #ebedf1;
    }

    & ul {
        display: grid;
        gap: 8px;
        margin: 0 0 var(--space-md);
        padding: 0;
        list-style: none;
    }

    & li {
        position: relative;
        padding-left: 1.25rem;
        font-size: var(--text-sm);
        line-height: 1.55;
        color: var(--color-text-secondary);
    }

    & li::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0.6em;
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: var(--color-primary);
    }

    & p {
        padding-top: var(--space-sm);
        border-top: 1px dashed #dcd8e8;
        font-size: var(--text-sm);
        font-weight: var(--font-weight-semibold);
        color: var(--color-text);
    }
}

/* ---------- Who should you call? ---------- */

.ewp-compare__wrap {
    margin-top: var(--space-xl);
    overflow-x: auto;
    padding: 2px; /* room for the highlighted column's outline */

    & table { border-radius: 14px; box-shadow: 0 0 0 1px #e3e6ec, 0 18px 40px -30px rgba(31, 22, 56, 0.4); }
}

.ewp-compare__table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: var(--text-sm);
    line-height: 1.55;

    & th, & td {
        padding: var(--space-md) var(--space-lg);
        border-bottom: 1px solid #e9ebf0;
        background: #fff;
        text-align: left;
        vertical-align: top;
    }

    & thead th {
        padding-block: var(--space-sm);
        background: #f3f4f8;
        font-size: var(--text-xs);
        font-weight: var(--font-weight-bold);
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--color-text-secondary);
    }

    & thead th:first-child { width: 22%; border-top-left-radius: 14px; }
    & thead th:last-child { border-top-right-radius: 14px; }
    & tbody tr:last-child > :first-child { border-bottom-left-radius: 14px; }
    & tbody tr:last-child > :last-child { border-bottom-right-radius: 14px; }
    & tbody tr:last-child > * { border-bottom: 0; }

    & tbody th {
        font-weight: var(--font-weight-semibold);
        color: var(--color-text);
    }

    & td { color: var(--color-text-secondary); }

    /* My column: outlined like a highlighted pricing column */
    & .is-me {
        background: color-mix(in srgb, var(--color-primary) 4%, #fff);
        box-shadow: inset 2px 0 0 var(--color-primary), inset -2px 0 0 var(--color-primary);
    }
    & thead .is-me {
        background: var(--color-primary);
        color: #fff;
        border-radius: 14px 14px 0 0;
    }
    & tbody tr:last-child .is-me {
        box-shadow: inset 2px 0 0 var(--color-primary), inset -2px 0 0 var(--color-primary), inset 0 -2px 0 var(--color-primary);
        border-radius: 0 0 14px 14px;
    }

    /* Verdict tag on its own line, then the detail */
    & b {
        display: flex;
        align-items: center;
        gap: 5px;
        width: fit-content;
        margin-bottom: 6px;
        padding: 2px 10px 2px 7px;
        border-radius: 99px;
        font-size: var(--text-xs);
        font-weight: var(--font-weight-bold);
        line-height: 1.5;
    }
    & b::before { font-size: 0.9em; line-height: 1; }
    & b.yes  { background: #dcfce7; color: #166534; }
    & b.yes::before  { content: "\2713"; }
    & b.part { background: #fef3c7; color: #92400e; }
    & b.part::before { content: "~"; font-weight: 800; }
    & b.no   { background: #fee2e2; color: #991b1b; }
    & b.no::before   { content: "\2715"; }

    /* The bottom line */
    & tbody tr:last-child > * { padding-block: var(--space-lg); font-weight: var(--font-weight-semibold); color: var(--color-text); }

    & a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px; }
}

/* ---------- First aid ---------- */

.ewp-aid__steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin: var(--space-xl) 0 0;
    padding: 0;
    list-style: none;
    counter-reset: ewp-aid;

    @media (width < 1100px) { grid-template-columns: repeat(2, 1fr); }
    @media (width < 600px)  { grid-template-columns: 1fr; }

    & li {
        position: relative;
        padding: var(--space-lg) var(--space-md) var(--space-md);
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 1px 0 #e3e6ec;
        counter-increment: ewp-aid;
    }

    & li:not(.ewp-aid__cta)::before {
        content: counter(ewp-aid);
        display: grid;
        place-items: center;
        width: 2rem;
        height: 2rem;
        margin-bottom: var(--space-sm);
        border-radius: 50%;
        background: color-mix(in srgb, var(--color-primary) 12%, #fff);
        font-weight: var(--font-weight-bold);
        color: var(--color-primary);
    }

    & h3 { margin: 0 0 var(--space-2xs); font-size: var(--text-base); line-height: 1.3; }
    & p { margin: 0; font-size: var(--text-sm); line-height: 1.6; color: var(--color-text-secondary); }
}

.ewp-aid__steps .ewp-aid__cta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--color-primary);
    box-shadow: none;

    & h3 { color: #fff; font-size: var(--text-lg); }
    & p { color: rgba(255, 255, 255, 0.85); }
    & .btn {
        align-self: flex-start;
        gap: 0.5em;
        margin-top: var(--space-md);
        border-radius: 99px;
        background: var(--ewp-lit);
        color: var(--ewp-ink);
        font-weight: var(--font-weight-bold);
    }
}

/* ---------- Free guides directory ---------- */

.ewp-guides__grid {
    columns: 3 300px;
    column-gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.ewp-guides__group {
    break-inside: avoid;
    margin-bottom: var(--space-lg);
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 0 #e3e6ec, 0 14px 32px -26px rgba(31, 22, 56, 0.35);

    & h3 {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-sm);
        margin: 0;
        padding: var(--space-md) var(--space-lg);
        border-bottom: 1px solid #ebedf1;
        font-size: var(--text-base);
    }

    & h3 span {
        padding: 1px 9px;
        border-radius: 99px;
        background: color-mix(in srgb, var(--color-primary) 10%, #fff);
        font-size: var(--text-xs);
        font-weight: var(--font-weight-bold);
        color: var(--color-primary);
    }

    & ul { margin: 0; padding: var(--space-2xs) 0; list-style: none; }

    & li + li { border-top: 1px solid #f1f2f5; }

    & a {
        display: block;
        padding: 10px var(--space-lg);
        font-size: var(--text-sm);
        line-height: 1.45;
        color: var(--color-text);
        text-decoration: none;
        transition: background 160ms ease, color 160ms ease;

        &:hover,
        &:focus-visible {
            background: color-mix(in srgb, var(--color-primary) 6%, #fff);
            color: var(--color-primary);
        }
    }
}

/* Phones: the comparison table becomes one card per problem */
@media (width < 700px) {
    .ewp-compare__wrap { overflow: visible; box-shadow: none; border-radius: 0; }

    .ewp-compare__table {
        min-width: 0;
        background: none;

        & thead { display: none; }
        & tbody, & tr, & th, & td { display: block; width: auto; }

        & tr {
            margin-bottom: var(--space-sm);
            overflow: hidden;
            border-radius: 14px;
            background: #fff;
            box-shadow: 0 0 0 1px #e3e6ec;
        }

        & tbody th { width: auto; padding-bottom: var(--space-2xs); font-size: var(--text-base); border-bottom: 0; }
        & td { padding-top: var(--space-xs); padding-bottom: var(--space-xs); }

        & td::before {
            content: attr(data-label);
            display: block;
            margin-bottom: 2px;
            font-size: var(--text-xxs);
            font-weight: var(--font-weight-bold);
            letter-spacing: 0.04em;
            text-transform: uppercase;
            color: var(--color-text-secondary);
        }

        & td.is-me::before { color: var(--color-primary); }
        & td.is-me,
        & tbody tr:last-child td.is-me { box-shadow: inset 3px 0 0 var(--color-primary); border-radius: 0; }
        & tbody tr:last-child > * { padding-block: var(--space-xs); }
        & tbody tr > * { border-radius: 0 !important; }
        & tr:last-child > * { border-bottom: 1px solid #edf0f4; }
        & tr > :last-child { border-bottom: 0; }
    }
}

/* About block (shared component): give the copy more room on this page so the
   heading sits on one line */
@media (width >= 1100px) {
    .theme-purple .home-about .about-grid { grid-template-columns: 3fr 2fr; }
    .theme-purple .home-about .about-grid__content h2 { white-space: nowrap; }
}

/* ---------- Handy to include (next to the form) ---------- */

.ewp-chat-section .ewp-include {
    margin-top: var(--space-lg);
    padding: var(--space-lg);
    border: 0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 0 #e3e6ec, 0 14px 32px -24px rgba(31, 22, 56, 0.35);

    & h3 {
        display: flex;
        align-items: center;
        gap: var(--space-xs);
        margin: 0 0 var(--space-md);
        font-size: var(--text-base);
        font-weight: var(--font-weight-bold);
    }

    & h3 svg { width: 1.35rem; height: 1.35rem; }

    & svg {
        flex: none;
        fill: none;
        stroke: var(--color-primary);
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    & ul {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-xs);
        margin: 0;
        padding: 0;
        list-style: none;

        @media (width < 340px) { grid-template-columns: 1fr; }
    }

    & li {
        display: flex;
        align-items: flex-start;
        gap: var(--space-sm);
        padding: var(--space-sm);
        border-radius: 12px;
        background: #f6f5fa;
        font-size: var(--text-xs);
        line-height: 1.35;
        color: var(--color-text-secondary);
    }

    & li svg {
        width: 1.25rem;
        height: 1.25rem;
        margin-top: 1px;
    }

    & li::before { content: none; display: none; }

    & li strong {
        display: block;
        margin-bottom: 1px;
        font-size: var(--text-sm);
        font-weight: var(--font-weight-semibold);
        color: var(--color-text);
    }

    & p {
        margin: var(--space-md) 0 0;
        font-size: var(--text-sm);
        color: var(--color-text-secondary);
        text-wrap: pretty;
    }
}

/* ---------- Pill buttons and closing CTA rows ---------- */

.ewp-pill {
    gap: 0.5em;
    border-radius: 99px;
    font-weight: var(--font-weight-bold);
}

.ewp-pill--outline {
    background: #fff;
    color: var(--color-primary);
    box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--color-primary) 40%, #fff);

    &:hover { color: var(--color-primary); box-shadow: inset 0 0 0 1.5px var(--color-primary); }
}

.ewp-answer__side .ewp-pill { margin-top: var(--space-md); }

.ewp-cta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md) var(--space-xl);
    margin-top: var(--space-xl);
    padding: var(--space-lg) var(--space-xl);
    border-radius: 16px;
    background: color-mix(in srgb, var(--color-primary) 6%, #fff);

    & p {
        flex: 1 1 22rem;
        margin: 0;
        font-size: var(--text-base);
        line-height: 1.5;
        color: var(--color-text-secondary);
    }

    & strong { color: var(--color-text); }

    @media (width < 600px) { padding: var(--space-lg); }
}

.ewp-cta-row__btns {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

/* FAQ: a proper heading on this page (the shared component uses a small label) */
.home-faq .ewp-faq-title { margin-bottom: var(--space-xl); }
.home-faq .ewp-eyebrow { margin-bottom: var(--space-xs); }

/* "Handy to include" tiles on small phones: tighter so two columns fit */
@media (width < 480px) {
    .ewp-chat-section .ewp-include li { gap: var(--space-xs); padding: var(--space-xs) var(--space-sm); }
    .ewp-chat-section .ewp-include li svg { display: none; }
}

.ewp-pay--form {
    margin-top: var(--space-md);

    & .ewp-pay__stripe { flex-basis: 100%; }
}

/* ---------- How to stop it happening again (top of the guides section) ---------- */

.ewp-prevent { margin-bottom: var(--space-3xl); }

.ewp-prevent__list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin: var(--space-xl) 0 0;
    padding: 0;
    list-style: none;
    counter-reset: ewp-prevent;

    @media (width < 1000px) { grid-template-columns: repeat(2, 1fr); }
    @media (width < 600px)  { grid-template-columns: 1fr; }

    & li {
        position: relative;
        padding: var(--space-lg);
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 1px 0 #e3e6ec;
        font-size: var(--text-sm);
        line-height: 1.6;
        color: var(--color-text-secondary);
        counter-increment: ewp-prevent;
    }

    /* number sits above the title (like the first-aid cards), so it can't overlap */
    & li::before {
        content: counter(ewp-prevent);
        display: grid;
        margin-bottom: var(--space-sm);
        place-items: center;
        width: 2rem;
        height: 2rem;
        border-radius: 50%;
        background: #dcfce7;
        font-weight: var(--font-weight-bold);
        color: #15803d;
    }

    & strong {
        display: block;
        margin-bottom: 2px;
        font-size: var(--text-base);
        color: var(--color-text);
    }
}

.ewp-prevent__more {
    margin: var(--space-lg) 0 0;
    font-size: var(--text-base);
    color: var(--color-text-secondary);

    & a { font-weight: var(--font-weight-semibold); color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px; }
}

/* ---------- Author byline (long-form section) ---------- */

.ewp-byline {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin: var(--space-md) 0 0;
    font-size: var(--text-xs);
    color: var(--color-text-secondary);

    & img { width: 28px; height: 28px; border-radius: 50%; }
    & a { font-weight: var(--font-weight-semibold); color: var(--color-text); text-decoration: underline; text-underline-offset: 2px; }
}

.ewp-fix__who a { color: var(--color-primary); }

.home-about .ewp-byline--dark {
    font-size: var(--text-xs);
    margin-top: var(--space-lg);
    padding-top: var(--space-sm);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.65);
}

/* The shared FAQ component paints itself white; on this page it takes the
   alternate band so it separates from the form and guides either side */
.theme-purple .home-faq { background: var(--color-surface-alt); }
