/* Early Responders — Jobs Board v3 (template-jobs-v3.php).
 *
 * Implements the "Job Board (Top Filters)" design: sticky top filter bar,
 * result/chips/sort row, two-pane list + detail, mobile filter sheet with
 * a floating pill. Markup is produced by assets/js/jobs-v3.js.
 *
 * Design tokens (from the design file):
 *   ink #0F1B2E · red #CA4445 (hover #B33C3D) · canvas #F5F5F5
 *   border #E3E3E3 · body text #555 · muted #8A94A6
 *   display font Bebas Neue · headings Barlow Semi Condensed
 * Breakpoint: 820px.
 */

.er-v3 {
    --v3-ink: #0F1B2E;
    --v3-red: #CA4445;
    --v3-red-hover: #B33C3D;
    --v3-canvas: #F5F5F5;
    --v3-border: #E3E3E3;
    --v3-text: #555;
    --v3-muted: #8A94A6;
    --v3-head: 'Barlow Semi Condensed', 'Oswald', sans-serif;
    --v3-display: 'Bebas Neue', 'Oswald', Impact, sans-serif;
    background: var(--v3-canvas);
    color: var(--v3-ink);
    line-height: 1.55;
}

.er-v3 *, .er-v3 *::before, .er-v3 *::after { box-sizing: border-box; }

/* Classes below set explicit display values, which would beat the UA
 * stylesheet's [hidden] rule — restore hidden's authority. */
.er-v3 [hidden] { display: none !important; }

.er-v3 input, .er-v3 select, .er-v3 button { font-family: inherit; }
.er-v3 input::placeholder { color: var(--v3-muted); }

.er-v3__page {
    max-width: 1440px;
    margin: 0 auto;
    padding: 28px 32px 56px;
}

.er-v3__title {
    font-family: var(--v3-display);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    font-size: 2.5rem;
    line-height: 1;
    margin: 0 0 20px;
    color: var(--v3-ink);
}

.er-v3__gate { padding: 28px 0 56px; }

.er-v3__loading {
    padding: 60px 0;
    text-align: center;
    color: var(--v3-muted);
    font-size: 0.9375rem;
}

/* ——— Top filter bar ——— */
/* Static on desktop: the board below is a fixed-height frame with its own
 * two scroll areas (list column + detail card), so the bar never needs to
 * stick — it is simply always on screen. This removes the whole sticky
 * choreography (headroom header offsets, bar-height measurement, detail
 * stacking) that made the page feel like everything was moving. */
.er-v3-bar {
    z-index: 26;
    background: var(--v3-canvas);
    padding: 10px 0 14px;
}

.er-v3-bar__card {
    background: #fff;
    border: 1px solid var(--v3-border);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.er-v3-kw {
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--v3-border);
    border-radius: 8px;
    padding: 0 12px;
    background: #fff;
    height: 44px;
    flex: 1 1 240px;
    min-width: 200px;
    max-width: 360px;
}
.er-v3-kw svg { flex-shrink: 0; }
.er-v3-kw input {
    border: 0;
    outline: 0;
    flex: 1;
    min-width: 0;
    font-size: 0.9375rem;
    color: var(--v3-ink);
    background: transparent;
}

.er-v3-selwrap { position: relative; height: 44px; }
.er-v3-selwrap > svg {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}
.er-v3-select {
    border: 1px solid var(--v3-border);
    border-radius: 8px;
    height: 44px;
    background: #fff;
    color: var(--v3-ink);
    font-size: 0.9375rem;
    padding: 0 34px 0 12px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
}
.er-v3-select--active { border-color: var(--v3-red); }

.er-v3-popwrap { position: relative; }

.er-v3-fbtn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--v3-border);
    background: #fff;
    color: var(--v3-ink);
    border-radius: 8px;
    padding: 0 14px;
    height: 44px;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 140ms ease-out;
}
.er-v3-fbtn--active, .er-v3-fbtn--open { border-color: var(--v3-red); }

.er-v3-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--v3-red);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.er-v3-pop {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 30;
    width: 340px;
    max-width: min(92vw, 380px);
    background: #fff;
    border: 1px solid var(--v3-border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 27, 46, 0.12);
    padding: 16px;
    display: none;
}
.er-v3-pop--open { display: block; }
.er-v3-pop--wide { width: 360px; }
.er-v3-pop--narrow { width: 250px; }

.er-v3-pop__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.er-v3-pop__label {
    font-family: var(--v3-head);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.9375rem;
}
.er-v3-pop__clear {
    border: 0;
    background: transparent;
    color: var(--v3-red);
    font-weight: 600;
    font-size: 0.8125rem;
    cursor: pointer;
    padding: 0;
}
.er-v3-pop__note {
    font-size: 0.75rem;
    color: var(--v3-muted);
    line-height: 1.5;
    margin: 12px 0 0;
}

.er-v3-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.er-v3-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v3-border);
    background: var(--v3-canvas);
    color: var(--v3-ink);
    border-radius: 999px;
    padding: 7px 13px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.2;
    transition: background 140ms ease-out, border-color 140ms ease-out, color 140ms ease-out;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.er-v3-chip--on {
    border-color: var(--v3-red);
    background: var(--v3-red);
    color: #fff;
}

.er-v3-reset {
    margin-left: auto;
    border: 1px solid var(--v3-border);
    background: #fff;
    color: var(--v3-muted);
    border-radius: 8px;
    padding: 0 18px;
    height: 44px;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 140ms ease-out, color 140ms ease-out;
}
.er-v3-reset--active { border-color: var(--v3-ink); color: var(--v3-ink); }

/* ——— Meta row: count + active chips + sort ——— */
.er-v3-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 2px 0;
}
.er-v3-meta__count { font-weight: 700; font-size: 1rem; }
.er-v3-meta__sep { width: 1px; height: 16px; background: var(--v3-border); }
.er-v3-achips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.er-v3-achip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--v3-border);
    background: #fff;
    color: var(--v3-ink);
    border-radius: 999px;
    padding: 5px 8px 5px 12px;
    font-size: 0.8125rem;
    cursor: pointer;
}
.er-v3-achip:hover { border-color: var(--v3-red); }

.er-v3-sort {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}
.er-v3-sort__label { font-size: 0.8125rem; color: var(--v3-muted); white-space: nowrap; }
.er-v3-sort .er-v3-select { height: auto; padding: 8px 32px 8px 12px; font-size: 0.875rem; font-weight: 600; }
.er-v3-sort .er-v3-selwrap { height: auto; }

.er-v3-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: none;
}
.er-v3-backdrop--open { display: block; }

/* ——— Two-pane: a viewport-fitted frame with two internal scroll areas ———
 * jobs-v3.js measures the frame's top edge into --er-v3-frameh so the
 * whole board (bar + meta above, list + detail inside) fits one screen;
 * the page itself only scrolls to reach the footer. */
.er-v3-grid {
    display: grid;
    grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
    /* An auto row would size to its content and blow past the frame
     * height — pin the single row to the frame so height:100% children
     * actually get the frame height and their inner scrolls engage. */
    grid-template-rows: minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
    height: max(420px, var(--er-v3-frameh, 70vh));
}

.er-v3-listcol {
    height: 100%;
    overflow-y: auto;
    padding-right: 6px;
    padding-bottom: 8px;
    scrollbar-width: thin;
}
.er-v3-listcol::-webkit-scrollbar { width: 10px; }
.er-v3-listcol::-webkit-scrollbar-thumb {
    background: #D8DCE3;
    border-radius: 999px;
    border: 3px solid var(--v3-canvas);
}

/* minmax(0,1fr) + min-width:0 everywhere: long unbreakable content (pay
 * strings, locations) must never widen a card past its 400px column — the
 * default min-width:auto floors let cards bleed under the detail pane. */
.er-v3-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }

.er-v3-card {
    display: grid;
    gap: 8px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    text-align: left;
    cursor: pointer;
    background: #fff;
    border: 1px solid var(--v3-border);
    border-left: 3px solid transparent;
    border-radius: 10px;
    padding: 16px 18px;
    font: inherit;
    color: var(--v3-ink);
    transition: border-color 150ms, box-shadow 150ms, background 150ms;
}
.er-v3-card:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06); }

/* The card is a grid, so each row is a grid item with a min-width:auto
 * floor — a long unbreakable location would set the row's min-content
 * width and shove the pay/bookmark past the card's padding box. Zero the
 * floor so the ellipsis rules inside the rows can actually engage. */
.er-v3-card > * { min-width: 0; }
.er-v3-card--active {
    background: #FEF6F6;
    border-color: var(--v3-red);
    border-left-color: var(--v3-red);
}

.er-v3-card__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}
.er-v3-card__badges { display: flex; gap: 6px; flex-wrap: wrap; }

.er-v3-tag {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--v3-text);
    background: #fff;
    border: 1px solid var(--v3-border);
    border-radius: 999px;
    padding: 3px 9px;
}
.er-v3-tag--new { color: #fff; background: var(--v3-ink); border-color: var(--v3-ink); }

.er-v3-bm {
    padding: 2px;
    cursor: pointer;
    line-height: 0;
    display: inline-flex;
    border: 0;
    background: transparent;
}

.er-v3-card__t {
    font-family: var(--v3-head);
    font-weight: 700;
    letter-spacing: -0.005em;
    font-size: 1.1875rem;
    line-height: 1.2;
    margin-top: 2px;
}
.er-v3-card--active .er-v3-card__t { color: var(--v3-red); }

.er-v3-card__row {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--v3-text);
    font-size: 0.8125rem;
    min-width: 0;
}
.er-v3-card__row svg { flex-shrink: 0; }
.er-v3-card__row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.er-v3-card__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 2px;
}
.er-v3-card__bottom .er-v3-card__row { flex: 1; }

.er-v3-card__pay {
    font-family: var(--v3-head);
    font-weight: 700;
    font-size: 1.0625rem;
    color: var(--v3-ink);
    white-space: nowrap;
    flex-shrink: 0;
}
.er-v3-card__pay--long { font-size: 0.875rem; }
.er-v3-card__pay--none {
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--v3-muted);
}

.er-v3-empty {
    background: #fff;
    border: 1px solid var(--v3-border);
    border-radius: 10px;
    padding: 48px 24px;
    text-align: center;
    color: var(--v3-text);
}
.er-v3-empty__h {
    font-family: var(--v3-head);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-size: 1.375rem;
    color: var(--v3-ink);
}
.er-v3-empty__p { margin-top: 6px; font-size: 0.9375rem; }

/* ——— Pagination ——— */
.er-v3-pager {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
}
.er-v3-pager__row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.er-v3-pgbtn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--v3-border);
    background: #fff;
    color: var(--v3-ink);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: border-color 140ms ease-out, background 140ms ease-out;
}
.er-v3-pgbtn--on { border-color: var(--v3-red); background: var(--v3-red); color: #fff; }
.er-v3-pgbtn--gap { border: 0; background: transparent; cursor: default; min-width: 24px; padding: 0; color: var(--v3-muted); }
.er-v3-pgarrow {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v3-border);
    background: #fff;
    color: var(--v3-ink);
    border-radius: 8px;
    cursor: pointer;
}
.er-v3-pgarrow:disabled { color: #C7CCD4; cursor: default; }
.er-v3-pager__range { font-size: 0.8125rem; color: var(--v3-muted); }

/* ——— Detail pane: fills the frame, scrolls internally ——— */
.er-v3-detail { height: 100%; min-width: 0; }

.er-v3-back { display: none; }

.er-v3-detail__card {
    background: #fff;
    border: 1px solid var(--v3-border);
    border-radius: 10px;
    padding: 32px;
    max-height: 100%;
    overflow-y: auto;
}
.er-v3-detail__card::-webkit-scrollbar { width: 10px; }
.er-v3-detail__card::-webkit-scrollbar-thumb { background: #D8DCE3; border-radius: 999px; border: 3px solid #fff; }

.er-v3-detail__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}
.er-v3-detail__eyebrow {
    font-size: 0.8125rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--v3-text);
    font-weight: 600;
    margin-bottom: 6px;
}
.er-v3-detail__h2 {
    font-family: var(--v3-head);
    font-weight: 700;
    letter-spacing: -0.01em;
    font-size: 1.75rem;
    line-height: 1.15;
    margin: 0 0 8px;
    color: var(--v3-ink);
}
.er-v3-detail__sub { color: var(--v3-text); font-size: 0.9375rem; }
.er-v3-detail__badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.er-v3-detail__badges .er-v3-tag { padding: 4px 10px; }

.er-v3-detail__payside { text-align: right; flex-shrink: 0; }
.er-v3-detail__paybig {
    font-family: var(--v3-head);
    font-weight: 700;
    font-size: 1.875rem;
    line-height: 1.05;
    letter-spacing: -0.01em;
    white-space: nowrap;
}
.er-v3-detail__paybig--none {
    font-family: inherit;
    font-weight: 600;
    font-size: 1.0625rem;
    line-height: 1.2;
    color: var(--v3-text);
    white-space: normal;
}
.er-v3-detail__paymeta {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--v3-muted);
    margin-top: 6px;
}

.er-v3-detail__actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 22px 0;
    flex-wrap: wrap;
}
.er-v3-apply {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--v3-red);
    background: var(--v3-red);
    color: #fff !important;
    border-radius: 8px;
    padding: 13px 26px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none !important;
}
.er-v3-apply:hover { background: var(--v3-red-hover); border-color: var(--v3-red-hover); }
.er-v3-save {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--v3-ink);
    background: #fff;
    color: var(--v3-ink);
    border-radius: 8px;
    padding: 13px 18px;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: background 140ms ease-out, color 140ms ease-out;
}
.er-v3-save:hover { background: var(--v3-ink); color: #fff; }

.er-v3-facts {
    border: 1px solid var(--v3-border);
    border-radius: 8px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    overflow: hidden;
    margin-bottom: 28px;
}
.er-v3-fact { padding: 14px 16px; }
.er-v3-fact + .er-v3-fact { border-left: 1px solid var(--v3-border); }
.er-v3-fact__l {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--v3-muted);
    margin-bottom: 4px;
}
.er-v3-fact__v { font-size: 0.875rem; font-weight: 600; color: var(--v3-ink); line-height: 1.3; }

/* "What this role needs" — entry licence + specialty tickets.
   Sits between the facts grid and the description so the credential answer
   is visible before a reader commits to reading the posting. Reuses the
   fact-label and dtag treatments rather than introducing a new visual
   language; the licence chip is the only emphasised element because it's
   the primary can-I-take-this-yet signal. */
.er-v3-needs { margin: -12px 0 28px; }
.er-v3-needs__l {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--v3-muted);
    margin-bottom: 8px;
}
.er-v3-needs__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.er-v3-need {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--v3-text);
    background: var(--v3-canvas);
    border: 1px solid var(--v3-border);
    border-radius: 6px;
    padding: 4px 10px;
    /* Cert names are short and must not wrap mid-token ("Confined Space
       Rescue" is one requirement, not three). */
    white-space: nowrap;
}
.er-v3-need--lic {
    color: #fff;
    background: var(--v3-ink);
    border-color: var(--v3-ink);
}

/* Fetched job description content */
.er-v3-detail__content { color: #333; }
.er-v3-detail__content h2,
.er-v3-detail__content h3,
.er-v3-detail__content h4 {
    font-family: var(--v3-head);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 1.1875rem;
    margin: 24px 0 10px;
    color: var(--v3-ink);
}
.er-v3-detail__content p { margin: 0 0 16px; max-width: 68ch; }
.er-v3-detail__content ul {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    display: grid;
    gap: 8px;
}
.er-v3-detail__content ul li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.er-v3-detail__content ul li::before {
    content: "\2713";
    color: var(--v3-ink);
    font-weight: 700;
    line-height: 1.55;
    flex-shrink: 0;
}
.er-v3-detail__content .frj-job-badges { display: none; }

.er-v3-detail__tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 20px;
}
.er-v3-detail__tags-label { font-size: 0.8125rem; color: var(--v3-muted); }
.er-v3-dtag {
    font-size: 0.75rem;
    color: var(--v3-text);
    background: var(--v3-canvas);
    border: 1px solid var(--v3-border);
    border-radius: 6px;
    padding: 4px 10px;
}

.er-v3-detail__foot {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--v3-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}
.er-v3-share { display: flex; align-items: center; gap: 8px; }
.er-v3-share__label { font-size: 0.8125rem; color: var(--v3-muted); }
.er-v3-share a {
    width: 34px;
    height: 34px;
    border: 1px solid var(--v3-border);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--v3-ink);
}
.er-v3-share a:hover { border-color: var(--v3-red); color: var(--v3-red); }

/* ——— Mobile sheet + FAB ——— */
@keyframes erV3Backdrop { from { opacity: 0; } to { opacity: 1; } }
@keyframes erV3Slide { from { transform: translateX(100%); } to { transform: none; } }

.er-v3-sheetwrap {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(15, 27, 46, 0.45);
    display: none;
    justify-content: flex-end;
    animation: erV3Backdrop 160ms ease-out;
}
.er-v3-sheetwrap--open { display: flex; }
.er-v3-sheet {
    background: #fff;
    width: min(420px, 90%);
    height: 100%;
    overflow-y: auto;
    padding: 20px 18px 24px;
    animation: erV3Slide 220ms ease-out;
    display: flex;
    flex-direction: column;
}
.er-v3-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.er-v3-sheet__title {
    font-family: var(--v3-head);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 1.25rem;
}
.er-v3-sheet__x {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v3-border);
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    color: var(--v3-ink);
}
.er-v3-sheet .er-v3-kw { height: 50px; max-width: none; flex: none; margin-bottom: 20px; }
.er-v3-sheet__sec { margin-bottom: 20px; }
.er-v3-sheet__h {
    font-family: var(--v3-head);
    font-weight: 700;
    font-size: 1.0625rem;
    margin-bottom: 10px;
}
.er-v3-sheet .er-v3-selwrap { height: auto; width: 100%; }
.er-v3-sheet .er-v3-select { width: 100%; height: auto; padding: 12px 34px 12px 12px; }
.er-v3-sheet__foot {
    display: flex;
    gap: 10px;
    margin-top: auto;
    position: sticky;
    bottom: 0;
    background: #fff;
    padding-top: 14px;
}
.er-v3-sheet__reset {
    flex: 1;
    border: 1px solid var(--v3-ink);
    background: #fff;
    color: var(--v3-ink);
    border-radius: 8px;
    height: 48px;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
}
.er-v3-sheet__apply {
    flex: 2;
    border: 1px solid var(--v3-red);
    background: var(--v3-red);
    color: #fff;
    border-radius: 8px;
    height: 48px;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
}

.er-v3-fab {
    position: fixed;
    right: 16px;
    bottom: 20px;
    z-index: 99999;
    display: none;
    align-items: center;
    gap: 10px;
    height: 54px;
    padding: 0 22px;
    background: var(--v3-red);
    color: #fff;
    border: 0;
    border-radius: 999px;
    box-shadow: 0 8px 22px rgba(202, 68, 69, 0.42);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
}
.er-v3-fab:active { transform: translateY(1px); }
.er-v3-fab .er-v3-badge { background: #fff; color: var(--v3-red); min-width: 20px; height: 20px; font-size: 0.75rem; }

body.er-v3-lock { overflow: hidden; }

/* ——— Mobile (< 820px) ——— */
@media (max-width: 819px) {
    .er-v3__page { padding: 16px 16px 40px; }
    .er-v3__title { font-size: 2rem; margin-bottom: 12px; }

    .er-v3-bar { position: static; padding: 0 0 4px; }
    .er-v3-bar__card { display: none; }
    .er-v3-meta { padding-top: 0; }
    .er-v3-sort { display: none; }

    .er-v3-grid { display: block; height: auto; }
    .er-v3-listcol { height: auto; overflow: visible; padding-right: 0; }

    .er-v3-fab--show { display: inline-flex; }

    /* Detail becomes a full-screen overlay, opened per card tap. */
    .er-v3-detail { display: none; position: static; }
    .er-v3-detail.er-v3-detail--open,
    body.admin-bar .er-v3-detail.er-v3-detail--open {
        display: block;
        position: fixed;
        /* Explicit edges (not inset) at higher specificity: the desktop
         * sticky rules (.er-v3-detail / body.admin-bar …) set top offsets
         * that would out-specify a bare .er-v3-detail--open. Above the
         * theme's sticky header AND the WP admin bar (99999), like the
         * filter sheet — the overlay owns the whole viewport. */
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 100000;
        background: #fff;
        overflow-y: auto;
    }
    .er-v3-detail--open .er-v3-back {
        display: flex;
        position: sticky;
        top: 0;
        z-index: 2;
        width: 100%;
        align-items: center;
        gap: 8px;
        border: 0;
        border-bottom: 1px solid var(--v3-border);
        background: #fff;
        color: var(--v3-ink);
        padding: 16px 18px;
        font-weight: 600;
        font-size: 0.9375rem;
        cursor: pointer;
    }
    .er-v3-detail__card {
        border: 0;
        border-radius: 0;
        max-height: none;
        overflow: visible;
        padding: 20px 18px 40px;
    }
    .er-v3-detail__head { flex-direction: column; gap: 14px; }
    .er-v3-detail__payside { text-align: left; }
    .er-v3-facts { grid-template-columns: 1fr 1fr; }
    .er-v3-fact:nth-child(odd) { border-left: 0; }
    .er-v3-fact:nth-child(n+3) { border-top: 1px solid var(--v3-border); }
}

@media (min-width: 820px) {
    .er-v3-fact:first-child { border-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .er-v3-sheetwrap, .er-v3-sheet { animation: none; }
}
