/**
 * Sub-Processors.com directories (/companies and /subprocessors).
 * Brings the listings in line with the homepage: same colours, heading typeface and open layout.
 * Loaded after style.css, and only on pages with body.directory-page.
 */
body.directory-page {
    --ink: #14213a;
    --ink-soft: #4a5568;
    --ink-faint: #5a6780;
    --rule: #e2e5ea;
    --hover: #f6f8fb;
    --brand: #1d5bc4;
    --brand-deep: #164a9f;
    --brand-soft: #e4eefc;
    --text-primary: var(--ink);
    --text-secondary: var(--ink-soft);
    --text-tertiary: var(--ink-faint);
    --border: var(--rule);
    --border-light: var(--rule);
    --accent: var(--brand);
    --accent-hover: var(--brand-deep);
    --accent-light: var(--brand-soft);
    /* Headings use the same typeface as the logo wordmark. */
    --display: 'Outfit', 'Inter', system-ui, sans-serif;

    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

/* Full width, lined up with the header's 24px gutters. */
body.directory-page .container {
    max-width: none;
    padding: 0 24px;
}
body.directory-page .subprocessors-listing {
    padding: 32px 0 72px;
}

body.directory-page a:focus-visible,
body.directory-page button:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* Page heading */
body.directory-page .page-header {
    margin-bottom: 28px;
}
body.directory-page .page-header h1 {
    margin-bottom: 10px;
    font-family: var(--display);
    font-size: clamp(32px, 3.6vw, 44px);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.03em;
    text-wrap: balance;
}
body.directory-page .page-header .subtitle {
    margin-bottom: 0;
    font-size: 17px;
    color: var(--ink-soft);
}
body.directory-page .page-header .subtitle strong {
    font-weight: 600;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

/* List / Visual switch */
body.directory-page .tabs {
    gap: 24px;
    margin-bottom: 28px;
    border-bottom-color: var(--rule);
}
body.directory-page .tab-btn {
    padding: 10px 0;
    font-family: inherit;
    font-size: 15px;
    color: var(--ink-faint);
    transition: color 0.15s, border-color 0.15s;
}
body.directory-page .tab-btn:hover {
    color: var(--ink);
}
body.directory-page .tab-btn.active {
    color: var(--ink);
    border-bottom-color: var(--ink);
}

/* Filter rail on the left, the listing pane on the right.
   Above 1180px the page itself never scrolls: the rail and the pane each scroll on their own,
   so the filters never slide in and out of view. Below that the rail is a drawer (further down). */
.dir-rail-head,
.dir-filters-btn {
    display: none;
}
.dir-shell--visual .dir-rail,
.dir-shell--visual .dir-rail-backdrop {
    display: none;
}
.facet--collapsed .facet-extra {
    display: none;
}
/* Long filter lists: a box above the options that narrows them as you type */
.facet-search {
    margin: 6px 0 6px;
}
body.directory-page .facet-search-input {
    width: 100%;
    padding: 7px 10px;
    font: inherit;
    font-size: 13px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #b9c0cb;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.15s;
}
body.directory-page .facet-search-input:focus {
    border-color: #7c8ba3;
}
.facet-search-input::placeholder {
    color: var(--ink-faint);
}
.facet--searching.facet--collapsed .facet-extra {
    display: list-item;
}
.category-list-item.facet-search-miss,
.facet--searching.facet--collapsed .facet-extra.facet-search-miss {
    display: none;
}
.facet-search-empty {
    margin: 4px 0 0;
    padding: 0 10px;
    font-size: 13px;
    color: var(--ink-faint);
}
.facet-search-empty[hidden] {
    display: none;
}
body.directory-page .sidebar-block {
    margin-bottom: 0;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
}
body.directory-page .sidebar-block-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    padding: 0 10px;
}
body.directory-page .sidebar-block-head .sidebar-title,
body.directory-page .sidebar-block-head .sidebar-subtitle {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-faint);
}
body.directory-page .sidebar-block-head .sidebar-subtitle {
    font-weight: 400;
}
body.directory-page .category-list-item {
    border-bottom: 0;
}
body.directory-page .category-list-link {
    padding: 7px 10px;
    color: var(--ink-soft);
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
body.directory-page .category-list-link:hover {
    color: var(--ink);
    background: var(--hover);
}
body.directory-page .category-list-item.active .category-list-link {
    font-weight: 600;
    color: var(--brand-deep);
    background: var(--brand-soft);
}
body.directory-page .category-list .category-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.directory-page .category-list .category-count {
    color: var(--ink-faint);
}
body.directory-page .category-list-item.active .category-count {
    color: var(--brand-deep);
}

/* Companies: one collapsible group per filter. Options are links that switch a value on or off. */
body.directory-page .facet + .facet {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--rule);
}
body.directory-page summary.sidebar-block-head {
    align-items: center;
    padding-top: 4px;
    padding-bottom: 4px;
    border-radius: 6px;
    list-style: none;
    cursor: pointer;
}
body.directory-page summary.sidebar-block-head::-webkit-details-marker {
    display: none;
}
body.directory-page summary.sidebar-block-head:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}
body.directory-page summary.sidebar-block-head .sidebar-title {
    flex: 1;
    font-weight: 600;
    color: var(--ink);
}
body.directory-page summary.sidebar-block-head .sidebar-subtitle {
    color: var(--brand-deep);
}
body.directory-page summary.sidebar-block-head::after {
    content: "";
    flex-shrink: 0;
    width: 7px;
    height: 7px;
    margin: 0 3px 3px 0;
    border: solid var(--ink-faint);
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
    transition: transform 0.15s;
}
body.directory-page .facet:not([open]) > summary {
    margin-bottom: 0;
}
body.directory-page .facet:not([open]) > summary::after {
    margin-bottom: 0;
    transform: rotate(-45deg);
}
.facet-check {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    background: #fff no-repeat center / 12px 12px;
    border: 1.5px solid #b9c0cb;
    border-radius: 4px;
    transition: background-color 0.15s, border-color 0.15s;
}
.category-list-link:hover .facet-check {
    border-color: #7c8ba3;
}
/* Ticked: a centred white check drawn as an SVG, so it sits evenly in the box at any zoom */
.category-list-item.active .facet-check {
    background-color: var(--brand);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6.2 5 8.6 9.5 3.6'/%3E%3C/svg%3E");
    border-color: var(--brand);
}
.category-list-item.active .category-list-link:hover .facet-check {
    background-color: var(--brand-deep);
    border-color: var(--brand-deep);
}
.facet-more-btn {
    margin-top: 4px;
    padding: 7px 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand);
    background: none;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}
.facet-more-btn:hover {
    color: var(--brand-deep);
    background: var(--hover);
}
.facet-more-btn[hidden] {
    display: none;
}
.facet-rail-note {
    margin: 8px 0 0;
    padding: 0 10px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--ink-faint);
}

/* What the listing is narrowed by, each removable */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: -4px 0 20px;
}
/* Matching results, ahead of the chips, so the total is visible without scrolling to the pagination */
.active-filters-total {
    margin-right: 4px;
    font-size: 14px;
    color: var(--ink-soft);
    white-space: nowrap;
}
.active-filters-total strong {
    font-weight: 600;
    color: var(--ink);
}
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--brand-deep);
    text-decoration: none;
    overflow-wrap: anywhere;
    background: var(--brand-soft);
    border-radius: 999px;
    transition: background 0.15s;
}
.filter-chip:hover {
    background: #d3e3fa;
}
.filter-chip span {
    font-size: 15px;
    line-height: 1;
}
body.directory-page .active-filters .companies-search-clear {
    margin-left: 4px;
    font-size: 13px;
}

/* Search */
body.directory-page .companies-search {
    gap: 16px;
    margin-bottom: 20px;
}
.dir-search {
    position: relative;
    display: flex;
    flex: 1;
    max-width: 480px;
    background: #fff;
    border: 1px solid #b9c0cb;
    border-radius: var(--control-radius);
    transition: border-color 0.15s;
}
.dir-search:focus-within {
    border-color: #7c8ba3;
}
.dir-search-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 16px;
    height: 16px;
    color: var(--ink-faint);
    transform: translateY(-50%);
    pointer-events: none;
}
body.directory-page .dir-search .filter-input {
    flex: 1;
    min-width: 0;
    max-width: none;
    padding: 10px 12px 10px 40px;
    font-size: 15px;
    color: var(--ink);
    background: transparent;
    border: 0;
    border-radius: var(--control-radius);
    outline: none;
}
.dir-search .filter-input::placeholder {
    color: var(--ink-faint);
}
.dir-search button {
    flex-shrink: 0;
    margin: -1px;
    padding: 0 20px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--ink);
    border: 0;
    border-radius: 0 var(--control-radius) var(--control-radius) 0;
    cursor: pointer;
    transition: background 0.15s;
}
.dir-search button:hover {
    background: var(--btn-hover);
}
body.directory-page .companies-search-clear {
    font-weight: 600;
    color: var(--brand);
    text-decoration: none;
}
body.directory-page .companies-search-clear:hover {
    color: var(--brand-deep);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Listing: ruled rows, no outer box */
body.directory-page .table-wrapper {
    margin-top: 0;
}
body.directory-page .table-inner {
    border-radius: 0;
    box-shadow: none;
}
.dir-company {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}
.dir-company img {
    flex-shrink: 0;
    margin-top: 2px;
    border-radius: 6px;
}
.dir-company-text {
    min-width: 0;
}
body.directory-page .sp-name-link strong {
    font-weight: 600;
    color: var(--ink);
}
body.directory-page .sp-name-link:hover strong {
    color: var(--brand);
    text-decoration: underline;
    text-underline-offset: 2px;
}
body.directory-page .dir-company-text .company-domain-muted {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    font-weight: 400;
    color: var(--ink-faint);
    overflow-wrap: anywhere;
}
body.directory-page .category-badge {
    padding: 2px 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-soft);
    background: #f1f3f6;
}
body.directory-page .companies-listing-table .about-cell {
    font-size: 14px;
    color: var(--ink-soft);
}
body.directory-page .companies-about-tooltip {
    background: var(--ink);
}
.dir-count strong {
    font-weight: 600;
    color: var(--ink);
}

/* Subprocessors: share of tracked companies, drawn like the homepage ranking */
body.directory-page .subprocessor-usage-summary {
    margin-bottom: 6px;
    font-variant-numeric: tabular-nums;
}
body.directory-page .subprocessor-usage-percent {
    font-size: 14px;
    color: var(--ink);
    text-decoration: none;
}
body.directory-page .subprocessor-usage-percent:focus-visible {
    outline-color: var(--brand);
}
body.directory-page .subprocessor-usage-tooltip {
    background: var(--ink);
}
body.directory-page .subprocessor-usage-tooltip::before {
    border-bottom-color: var(--ink);
}
body.directory-page .subprocessor-usage-track {
    height: 4px;
    background: #edf0f4;
    border-radius: 2px;
}
body.directory-page .subprocessor-usage-bar {
    min-width: 4px;
    background: var(--brand);
}

@media (min-width: 1181px) {
    body.directory-page {
        display: flex;
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }
    body.directory-page .site-header {
        flex-shrink: 0;
        margin-bottom: 0;
    }
    .dir-shell {
        display: grid;
        flex: 1;
        min-height: 0;
        grid-template-columns: 264px minmax(0, 1fr);
        grid-template-areas: "rail pane";
    }
    .dir-shell--visual {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "pane";
    }
    .dir-rail,
    .dir-pane {
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
    }
    .dir-rail {
        grid-area: rail;
        padding: 28px 14px 40px 14px;
        border-right: 1px solid var(--rule);
    }
    .dir-pane {
        grid-area: pane;
        scrollbar-gutter: stable;
    }
    body.directory-page .dir-pane .container {
        padding: 0 32px;
    }
    body.directory-page .subprocessors-listing {
        padding-top: 28px;
        padding-bottom: 8px;
    }
    body.directory-page .sidebar-categories .category-list,
    body.directory-page .facet .category-list {
        max-height: none;
        overflow: visible;
    }

    body.directory-page .subprocessors-table th,
    body.directory-page .subprocessors-table td {
        padding: 14px 16px 14px 0;
        border: 0;
        border-bottom: 1px solid var(--rule);
    }
    body.directory-page .subprocessors-table th {
        position: static;
        padding-top: 0;
        padding-bottom: 10px;
        font-size: 13px;
        font-weight: 500;
        letter-spacing: 0;
        text-transform: none;
        color: var(--ink-faint);
        background: none;
        border-bottom-color: #c9ced6;
    }
    body.directory-page .subprocessors-table tbody tr:hover {
        background: var(--hover);
    }
    body.directory-page .companies-listing-table th:nth-child(1),
    body.directory-page .companies-listing-table td:nth-child(1) { width: 27%; }
    body.directory-page .companies-listing-table th:nth-child(2),
    body.directory-page .companies-listing-table td:nth-child(2) { width: 160px; }
    body.directory-page .companies-listing-table th:nth-child(3),
    body.directory-page .companies-listing-table td:nth-child(3) { width: 14%; color: var(--ink-soft); }
    body.directory-page .companies-listing-table th:nth-child(5),
    body.directory-page .companies-listing-table td:nth-child(5) {
        width: 132px;
        padding-right: 20px;
        text-align: right;
    }
    /* The column heading already says what the number counts. */
    .dir-count-word {
        display: none;
    }
}

/* Pagination */
body.directory-page .pagination {
    padding: 20px 0 0;
    border-top: 0;
    color: var(--ink-soft);
}
body.directory-page .pagination-btn {
    background: #fff;
    border-color: #b9c0cb;
}

/* Empty and missing pages */
body.directory-page .no-results {
    padding: 72px 20px;
    border: 1px solid var(--rule);
    border-radius: 12px;
}
body.directory-page .no-results h2 {
    font-family: var(--display);
    font-size: 24px;
    font-weight: 500;
    letter-spacing: -0.02em;
}

/* Graphs tabs on /companies and /subprocessors: bar charts, one card each, side by side when there is room */
.viz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    gap: 20px;
    align-items: start;
}
/* Cards with filters need more width, so they go two across */
.viz-grid--pairs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 960px) {
    .viz-grid--pairs {
        grid-template-columns: minmax(0, 1fr);
    }
}
.viz-card--wide {
    grid-column: 1 / -1;
}
.viz-card {
    min-width: 0;
    padding: 24px 24px 14px;
    background: #fff;
    border: 1px solid var(--rule);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(20, 33, 58, 0.04);
}
.viz-head-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}
.viz-card h2 {
    margin: 0;
    font-family: var(--display);
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.02em;
}
.viz-scope {
    flex-shrink: 0;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-soft);
    background: var(--hover);
    border-radius: 999px;
}
.viz-summary {
    margin: 6px 0 0;
    min-height: 2.9em; /* Room for two lines, so the lists start level across cards */
    font-size: 14px;
    line-height: 1.45;
    color: var(--ink-soft);
}
.viz-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.viz-filters:empty {
    display: none;
}
.viz-filters .searchable-select {
    flex: 1 1 180px;
    min-width: 0;
    max-width: 280px;
}
.viz-filters .searchable-select-input {
    height: 36px;
    font-size: 13.5px;
    border-radius: 8px;
    cursor: pointer;
    caret-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}
.viz-map {
    height: 480px;
    margin-top: 18px;
    margin-bottom: 10px;
    background: var(--hover);
    border-radius: 10px;
    isolation: isolate; /* Keeps the map's own layers under the filter menus and the page header */
}
/* Each card is a horizontal bar chart: label | bar on a shared scale | value */
.viz-plot {
    --viz-label: 38%;
    --viz-value: 42px;
    --viz-gap: 10px;
    position: relative;
    margin-top: 18px;
}
.viz-card--share .viz-plot {
    --viz-value: 82px;
}
.viz-axis,
.viz-row {
    display: grid;
    grid-template-columns: var(--viz-label) minmax(0, 1fr) var(--viz-value);
    column-gap: var(--viz-gap);
    align-items: center;
}
.viz-axis {
    height: 24px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-faint);
}
.viz-ticks {
    position: relative;
    height: 100%;
    letter-spacing: 0;
    text-transform: none;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}
.viz-ticks span {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
}
.viz-ticks span:first-child {
    transform: translate(0, -50%);
}
/* Gridlines sit behind the bars, lined up with the bar column */
.viz-gridlines {
    position: absolute;
    top: 24px;
    bottom: 0;
    left: calc(var(--viz-label) + var(--viz-gap));
    right: calc(var(--viz-value) + var(--viz-gap));
    pointer-events: none;
}
.viz-gridlines span {
    position: absolute;
    top: 0;
    bottom: 0;
    border-left: 1px solid var(--rule);
}
.viz-gridlines span:first-child {
    border-left-color: #b9c0cb; /* Baseline */
}
.viz-list {
    position: relative;
    margin: 0;
    padding: 4px 0;
    list-style: none;
}
.viz-row {
    min-height: 32px;
    padding: 3px 0;
    color: var(--ink);
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.15s, box-shadow 0.15s;
}
.viz-row:hover,
.viz-row:focus-visible {
    background: rgba(238, 241, 245, 0.7);
    box-shadow: 0 0 0 4px rgba(238, 241, 245, 0.7);
}
.viz-label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.viz-logo {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    overflow: hidden;
    background: var(--hover);
    border-radius: 4px;
}
.viz-logo img {
    display: block;
    width: 100%;
    height: 100%;
}
.viz-name {
    overflow: hidden;
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.viz-row:hover .viz-name {
    color: var(--brand-deep);
}
.viz-track {
    position: relative;
    height: 20px;
}
.viz-bar {
    display: block;
    width: 0;
    height: 100%;
    background: var(--brand);
    border-radius: 0 4px 4px 0;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.viz-row:hover .viz-bar {
    background: var(--brand-deep);
}
.viz-value {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 6px;
    font-size: 13.5px;
    font-variant-numeric: tabular-nums;
}
.viz-value strong {
    font-weight: 600;
}
.viz-share {
    min-width: 30px;
    font-size: 12px;
    text-align: right;
    color: var(--ink-faint);
}
.viz-list li[hidden] {
    display: none;
}
.viz-more {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 9px;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--brand-deep);
    background: none;
    border: 0;
    border-top: 1px solid var(--rule);
    cursor: pointer;
}
.viz-more:hover {
    text-decoration: underline;
}
.viz-more[hidden] {
    display: none;
}
.viz-skeleton {
    padding: 6px 0;
}
.viz-skeleton span {
    display: block;
    height: 22px;
    background: var(--hover);
    border-radius: 6px;
    animation: viz-pulse 1.2s ease-in-out infinite alternate;
}
@keyframes viz-pulse {
    to { opacity: 0.45; }
}
@media (prefers-reduced-motion: reduce) {
    .viz-bar { transition: none; }
    .viz-skeleton span { animation: none; }
}
@media (forced-colors: active) {
    .viz-bar { background: Highlight; }
}
@media (max-width: 600px) {
    .viz-card {
        padding: 18px 12px 8px;
        border-radius: 14px;
    }
    .viz-head {
        padding: 0 4px;
    }
    .viz-filters .searchable-select {
        max-width: none;
    }
    .viz-map {
        height: 340px;
    }
}
body.directory-page .searchable-select-input {
    color: var(--ink);
    border-color: #b9c0cb;
}
body.directory-page .searchable-select-input:focus {
    border-color: #7c8ba3;
}
body.directory-page .searchable-select-option:hover,
body.directory-page .searchable-select-option.highlighted {
    background: var(--hover);
}
body.directory-page .searchable-select-option.selected {
    color: var(--brand-deep);
    background: var(--brand-soft);
}

/* Below this width the company rows are cards (see style.css) and the industries or categories sit above the listing */
@media (max-width: 1180px) {
    /* The page scrolls as normal; search and the Filters button stay pinned to the top while it does. */
    body.directory-page .companies-search {
        position: sticky;
        top: 0;
        z-index: 20;
        flex-wrap: nowrap;
        margin: 0 -24px 16px;
        padding: 10px 24px;
        background: #fff;
    }
    body.directory-page .companies-search .dir-search {
        min-width: 0;
    }
    .dir-filters-btn {
        display: inline-flex;
        flex-shrink: 0;
        align-items: center;
        gap: 8px;
        align-self: stretch;
        padding: 0 14px;
        font: inherit;
        font-size: 14px;
        font-weight: 600;
        color: var(--ink);
        background: #fff;
        border: 1px solid #b9c0cb;
        border-radius: var(--control-radius);
        cursor: pointer;
    }
    .dir-filters-btn svg {
        width: 16px;
        height: 16px;
    }
    .dir-filters-count {
        min-width: 20px;
        padding: 1px 6px;
        font-size: 12px;
        line-height: 18px;
        text-align: center;
        color: #fff;
        background: var(--brand);
        border-radius: 999px;
    }

    /* The rail slides in from the left over the page and scrolls on its own */
    .dir-rail {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 300;
        width: min(340px, 88vw);
        padding: 0 12px 32px;
        overflow-y: auto;
        overscroll-behavior: contain;
        background: #fff;
        box-shadow: 0 0 40px rgba(20, 33, 58, 0.18);
        visibility: hidden;
        transform: translateX(-100%);
        transition: transform 0.22s ease, visibility 0s linear 0.22s;
    }
    .dir-shell.filters-open .dir-rail {
        visibility: visible;
        transform: none;
        transition: transform 0.22s ease;
    }
    .dir-rail-backdrop {
        position: fixed;
        inset: 0;
        z-index: 299;
        background: rgba(20, 33, 58, 0.4);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.22s ease;
    }
    .dir-shell.filters-open .dir-rail-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
    body.dir-filters-locked {
        overflow: hidden;
    }
    .dir-rail-head {
        position: sticky;
        top: 0;
        z-index: 1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin: 0 -12px 12px;
        padding: 12px 12px 12px 22px;
        background: #fff;
        border-bottom: 1px solid var(--rule);
    }
    .dir-rail-head h2 {
        margin: 0;
        font-family: var(--display);
        font-size: 20px;
        font-weight: 500;
    }
    .dir-rail-close {
        width: 40px;
        height: 40px;
        font-size: 26px;
        line-height: 1;
        color: var(--ink-soft);
        background: none;
        border: 0;
        border-radius: 8px;
        cursor: pointer;
    }
    .dir-rail-close:hover {
        color: var(--ink);
        background: var(--hover);
    }
    body.directory-page .sidebar-categories .category-list {
        max-height: none;
        overflow: visible;
    }
    body.directory-page .category-list-link {
        padding-top: 10px;
        padding-bottom: 10px;
    }

    body.directory-page .companies-listing-table tbody tr {
        padding: 16px 0;
        border-bottom-color: var(--rule);
    }
    body.directory-page .companies-listing-table tbody tr:first-child {
        border-top: 1px solid var(--rule);
    }
    body.directory-page .companies-listing-table tbody tr:last-child {
        border-bottom: 1px solid var(--rule);
    }
    body.directory-page .subprocessors-table tbody tr:hover {
        background: none;
    }
}

/* The subprocessors table has three columns, so it stays a table down to 720px.
   Above 1180px the ruled rows come from the block further up; this covers the widths in between. */
@media (min-width: 721px) and (max-width: 1180px) {
    body.directory-page .subprocessors-listing-table th,
    body.directory-page .subprocessors-listing-table td {
        padding: 14px 16px 14px 0;
        border: 0;
        border-bottom: 1px solid var(--rule);
    }
    body.directory-page .subprocessors-listing-table th {
        position: static;
        padding-top: 0;
        padding-bottom: 10px;
        font-size: 13px;
        font-weight: 500;
        letter-spacing: 0;
        text-transform: none;
        color: var(--ink-faint);
        background: none;
        border-bottom-color: #c9ced6;
    }
    body.directory-page .subprocessors-listing-table tbody tr:hover {
        background: var(--hover);
    }
}
@media (min-width: 721px) {
    body.directory-page .subprocessors-listing-table th:nth-child(1),
    body.directory-page .subprocessors-listing-table td:nth-child(1) { width: 38%; }
    body.directory-page .subprocessors-listing-table th:nth-child(2),
    body.directory-page .subprocessors-listing-table td:nth-child(2) { width: 30%; }
    body.directory-page .subprocessors-listing-table th:nth-child(3),
    body.directory-page .subprocessors-listing-table td:nth-child(3) {
        width: 32%;
        padding-right: 20px;
        text-align: right;
    }
    /* The column heading already says what the number counts. */
    body.directory-page .subprocessors-listing-table .dir-count-word {
        display: none;
    }
}

@media (max-width: 720px) {
    body.directory-page .subprocessors-listing-table tbody tr {
        padding: 16px 0;
        border-bottom-color: var(--rule);
    }
    body.directory-page .subprocessors-listing-table tbody tr:first-child {
        border-top: 1px solid var(--rule);
    }
    body.directory-page .subprocessors-listing-table tbody tr:last-child {
        border-bottom: 1px solid var(--rule);
    }
    body.directory-page .container {
        padding-left: 16px;
        padding-right: 16px;
    }
    body.directory-page .subprocessors-listing {
        padding: 12px 0 56px;
    }
    body.directory-page .page-header {
        margin-bottom: 20px;
    }
    body.directory-page .page-header .subtitle {
        font-size: 16px;
    }
    body.directory-page .tabs {
        margin-bottom: 20px;
    }
    .dir-search {
        max-width: none;
    }
    /* Enter, or the keyboard's search key, submits; the button would crowd out Filters */
    .dir-search button {
        display: none;
    }
    body.directory-page .companies-search {
        margin-left: -16px;
        margin-right: -16px;
        padding-left: 16px;
        padding-right: 16px;
    }
    body.directory-page .dir-search .filter-input {
        padding-top: 12px;
        padding-bottom: 12px;
        font-size: 16px;
    }
    body.directory-page .pagination {
        gap: 12px;
    }
}

/* Mutual customers (/mutual-customers): two vendor fields, then a ruled list of the companies using both */
.mutual-form,
.mutual-result {
    max-width: 880px;
}
.mutual-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 36px;
}
.mutual-field {
    position: relative;
    min-width: 0;
}
.mutual-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-soft);
}
.mutual-field input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    font: inherit;
    font-size: 15px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #b9c0cb;
    border-radius: var(--control-radius);
    outline: none;
    transition: border-color 0.15s;
}
.mutual-field input::placeholder {
    color: var(--ink-faint);
}
.mutual-field input:focus {
    border-color: #7c8ba3;
}
.mutual-and {
    font-size: 14px;
    line-height: 44px;
    color: var(--ink-faint);
}
.mutual-form .btn {
    height: 44px;
    padding-top: 0;
    padding-bottom: 0;
    white-space: nowrap;
}
.mutual-suggest {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 30;
    max-height: 280px;
    padding: 4px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--rule);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(20, 33, 58, 0.12);
}
.mutual-suggest[hidden] {
    display: none;
}
.mutual-suggest-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 8px 10px;
    font: inherit;
    font-size: 14px;
    text-align: left;
    color: var(--ink);
    background: none;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}
.mutual-suggest-item:hover {
    background: var(--hover);
}
.mutual-suggest-cat {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--ink-faint);
}
.mutual-result {
    transition: opacity 0.15s;
}
.mutual-result.is-loading {
    opacity: 0.6;
}
.mutual-summary {
    margin-bottom: 24px;
    font-size: 17px;
    color: var(--ink-soft);
}
.mutual-summary strong,
.mutual-summary a {
    font-weight: 600;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.mutual-summary a {
    text-decoration: underline;
    text-decoration-color: #b9c0cb;
    text-underline-offset: 3px;
}
.mutual-summary a:hover {
    color: var(--brand);
    text-decoration-color: currentColor;
}
.mutual-error {
    padding: 12px 14px;
    font-size: 14px;
    color: #a3271c;
    background: #fdecea;
    border-radius: 8px;
}
.mutual-table {
    width: 100%;
    font-size: 14px;
    border-collapse: collapse;
}
.mutual-table th,
.mutual-table td {
    padding: 14px 16px 14px 0;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--rule);
}
.mutual-table th {
    padding-top: 0;
    padding-bottom: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-faint);
    border-bottom-color: #c9ced6;
}
.mutual-table th:last-child,
.mutual-table .mutual-count {
    width: 132px;
    padding-right: 20px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.mutual-count strong {
    font-weight: 600;
    color: var(--ink);
}
.mutual-table tbody tr:hover {
    background: var(--hover);
}
.mutual-table .dir-company {
    align-items: center;
}
.mutual-table .dir-company img {
    margin-top: 0;
}
/* Locked rows: a blurred stand-in the same height as a real row, with the reveal action over it */
.mutual-locked-cell {
    position: relative;
}
.mutual-blur {
    filter: blur(5px);
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
}
.mutual-blur strong {
    font-weight: 600;
    color: var(--ink-faint);
}
.mutual-blur-logo {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: #d5dae2;
    border-radius: 6px;
}
.mutual-locked-action {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}
.mutual-locked-action .btn {
    white-space: nowrap;
}
.mutual-locked-action .btn-secondary:not(:hover) {
    background: #fff;
}
.mutual-nocredits {
    padding: 5px 12px;
    font-size: 13px;
    color: var(--ink-soft);
    background: #fff;
    border: 1px solid var(--rule);
    border-radius: 999px;
}
@media (max-width: 720px) {
    .mutual-form {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        margin-bottom: 28px;
    }
    .mutual-and {
        display: none;
    }
    .mutual-summary {
        margin-bottom: 20px;
        font-size: 16px;
    }
    .mutual-table th:last-child,
    .mutual-table .mutual-count {
        width: 110px;
        padding-right: 0;
    }
    .mutual-table tbody tr:hover {
        background: none;
    }
}

/* My jobs: star / applied (js/job-stars.js) */
body.jobs-page .page-header .job-starred-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--brand);
    text-decoration: none;
}
body.jobs-page .page-header .job-starred-link:hover {
    color: var(--brand-deep);
    text-decoration: underline;
}
.job-starred-link .job-star-icon {
    fill: #f5b400;
    color: #d99a00;
}
.job-starred-count {
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--brand-soft);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    text-align: center;
}
.job-title-cell {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}
.job-type-badge {
    margin-left: 4px;
    vertical-align: 1px;
}
.job-status {
    flex: none;
    display: inline-flex;
    gap: 2px;
}
.job-star,
.job-applied,
.job-hide {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: -4px 0;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #9aa3b2;
    cursor: pointer;
}
.job-star svg,
.job-applied svg,
.job-hide svg {
    fill: none;
    transition: transform 0.12s ease;
}
.job-star:active svg,
.job-applied:active svg,
.job-hide:active svg {
    transform: scale(0.85);
}
.job-star:hover {
    background: var(--brand-soft);
    color: #d99a00;
}
.job-star[aria-pressed="true"] {
    color: #d99a00;
}
.job-star[aria-pressed="true"] .job-star-icon {
    fill: #f5b400;
}
.job-applied:hover {
    background: #e7f6ec;
    color: #1e8e3e;
}
.job-applied[aria-pressed="true"] {
    color: #fff;
}
.job-applied[aria-pressed="true"] circle {
    fill: #1e8e3e;
    stroke: #1e8e3e;
}
.job-hide:hover,
.job-hide[aria-pressed="true"] {
    background: #fdecea;
    color: #c5221f;
}
/* Hidden: the row dims behind an Undo button, then fades out (js/job-stars.js) */
.job-hidden-undo {
    position: relative;
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: -4px 0;
    padding: 4px 8px 6px;
    overflow: hidden;
    border-radius: 6px;
    background: #fdecea;
    color: #c5221f;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.job-hidden-undo button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--brand);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}
.job-hide-timer {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 100%;
    background: #c5221f;
    transform-origin: left;
    animation: job-hide-timer linear forwards;
}
@keyframes job-hide-timer {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}
.job-row--hiding .job-status {
    display: none;
}
.job-row--hiding td {
    color: var(--ink-faint);
}
.job-row--hiding td > *:not(.job-title-cell),
.job-row--hiding .job-title-cell > div {
    opacity: 0.45;
}
.job-row--hiding .job-title-cell strong {
    text-decoration: line-through;
}
.job-row--gone td {
    opacity: 0;
    transition: opacity 0.25s ease;
}
@media (prefers-reduced-motion: reduce) {
    .job-hide-timer {
        animation: none;
    }
}
/* A closed job that has been removed can't be saved again */
.job-status[data-job="0"][data-status=""] button {
    cursor: default;
    opacity: 0.4;
}
.job-status[data-job="0"][data-status=""] button:hover {
    background: transparent;
    color: #9aa3b2;
}
.job-applied-date {
    margin-top: 2px;
    font-size: 12px;
    color: #1e8e3e;
}
.job-starred-applied {
    font-size: 12px;
    color: var(--ink-soft);
}
body.directory-page .job-status-tabs {
    display: flex;
}
body.directory-page .job-status-tabs .tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
body.directory-page .job-status-tabs .job-starred-count {
    color: var(--ink-soft);
}
.job-row--unstarred td {
    opacity: 0.55;
}
.job-closed-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--bg-tertiary, #f1f3f4);
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 600;
    vertical-align: 1px;
    white-space: nowrap;
}

/* Profile (/profile), full width: a summary band (account + totals), the credit packs in one row,
   then purchases and activity side by side. */
.profile .alert {
    margin-bottom: 20px;
}
.profile-card {
    margin-bottom: 20px;
    background: #fff;
    border: 1px solid var(--rule);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(20, 33, 58, 0.04);
    overflow: hidden;
}
.profile-card h2 {
    margin: 0;
    font-family: var(--display);
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--ink);
}
.profile-card-head {
    padding: 20px 24px 14px;
}
.profile-desc {
    max-width: 60ch;
    margin: 8px 0 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink-soft);
}
.profile-desc strong {
    font-weight: 600;
    color: var(--ink);
}
.profile-empty {
    margin: 0;
    padding: 28px 24px 32px;
    font-size: 14px;
    color: var(--ink-faint);
    border-top: 1px solid var(--rule);
}

/* Summary band: who you are on the left, credit totals on the right */
.profile-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    align-items: stretch;
}
.profile-account {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
    padding: 28px;
}
.profile-avatar {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 56px;
    height: 56px;
    font-family: var(--display);
    font-size: 24px;
    font-weight: 500;
    color: #fff;
    background: var(--brand);
    border-radius: 50%;
}
.profile-account-text {
    min-width: 0;
}
.profile-email {
    font-family: var(--display);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ink);
    overflow-wrap: anywhere;
}
.profile-account-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    margin-top: 6px;
    font-size: 14px;
    color: var(--ink-faint);
}
.profile-badge {
    display: inline-block;
    padding: 2px 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--brand-deep);
    background: var(--brand-soft);
    border-radius: 999px;
}
.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
    border-left: 1px solid var(--rule);
}
.profile-stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px 28px;
}
.profile-stat + .profile-stat {
    border-left: 1px solid var(--rule);
}
.profile-stat-primary {
    background: var(--brand-soft);
}
.profile-stat dt {
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-faint);
}
.profile-stat-primary dt,
.profile-stat-note {
    color: var(--brand-deep);
}
.profile-stat dd {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(28px, 2.6vw, 36px);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}
.profile-stat-note {
    margin-top: 6px;
    font-size: 13px;
}

/* Buy credits: the explanation, then the packs, all in one row */
.profile-buy {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(0, 3fr);
    gap: 24px;
    align-items: stretch;
    padding: 24px;
}
.profile-buy > .alert {
    align-self: center;
    margin: 0;
}

/* Credit packs */
.credit-promo-wrap {
    margin-bottom: 20px;
}
.credit-promo-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-soft);
}
.credit-promo-input {
    width: 100%;
    max-width: 280px;
    height: 44px;
    padding: 0 12px;
    font: inherit;
    font-size: 15px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #b9c0cb;
    border-radius: var(--control-radius);
    outline: none;
    transition: border-color 0.15s;
}
.credit-promo-input::placeholder {
    color: var(--ink-faint);
}
.credit-promo-input:focus {
    border-color: #7c8ba3;
}
.credit-promo-input:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}
.credit-packs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.credit-pack {
    display: flex;
    flex-direction: column;
    padding: 20px;
    border: 1px solid var(--rule);
    border-radius: 10px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.credit-pack:hover {
    border-color: #b9c6dc;
    box-shadow: 0 4px 14px rgba(20, 33, 58, 0.06);
}
.credit-pack-credits {
    font-family: var(--display);
    font-size: 28px;
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}
.credit-pack-credits span {
    font-size: 15px;
    letter-spacing: 0;
    color: var(--ink-soft);
}
.credit-pack-price {
    margin-top: 4px;
    font-size: 15px;
    font-weight: 500;
    color: var(--ink-soft);
}
.credit-pack-price span {
    font-weight: 400;
    color: var(--ink-faint);
}
.credit-pack-expiry {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 14px 0 18px;
    padding: 6px 10px;
    border-radius: 6px;
    background: #e8f6ee;
    color: #1d7a46;
    font-size: 13px;
    font-weight: 600;
}
.credit-pack-expiry svg { flex: none; }
.credit-pack .btn {
    width: 100%;
    margin-top: auto;
}

/* Purchases and activity side by side; a lone card takes the full row */
.profile-ledgers {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 20px;
    align-items: start;
}
.profile-ledgers > .profile-ledger {
    margin-bottom: 0;
}
.profile-table-wrap {
    overflow-x: auto;
}
.profile-table {
    width: 100%;
    font-size: 14px;
    border-collapse: collapse;
}
.profile-table th,
.profile-table td {
    padding: 12px 16px;
    text-align: left;
    vertical-align: middle;
    border-top: 1px solid var(--rule);
}
.profile-table th {
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    color: var(--ink-faint);
    background: var(--hover);
}
.profile-table tbody tr:hover td {
    background: var(--hover);
}
.profile-table th:first-child,
.profile-table td:first-child {
    padding-left: 24px;
}
.profile-table th:last-child,
.profile-table td:last-child {
    padding-right: 24px;
}
.profile-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.profile-table td:first-child {
    color: var(--ink-soft);
    white-space: nowrap;
}
.profile-table .positive {
    font-weight: 600;
    color: #166534;
}
.profile-table a {
    font-weight: 500;
    color: var(--brand);
    text-decoration: none;
}
.profile-table a:hover {
    color: var(--brand-deep);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Below 1180px: account above the totals, the packs below their explanation, ledgers stacked */
@media (max-width: 1180px) {
    .profile-summary,
    .profile-buy,
    .profile-ledgers {
        grid-template-columns: minmax(0, 1fr);
    }
    .profile-stats {
        border-left: 0;
        border-top: 1px solid var(--rule);
    }
    .profile-buy {
        gap: 18px;
    }
}
@media (max-width: 720px) {
    .profile-account { padding: 20px 18px; gap: 14px; }
    .profile-avatar { width: 44px; height: 44px; font-size: 19px; }
    .profile-email { font-size: 18px; }
    .profile-stat { padding: 14px 18px; }
    .profile-stat dd { font-size: 24px; }
    .profile-buy { padding: 18px; }
    .profile-card-head { padding: 18px 18px 12px; }
    .profile-empty { padding: 20px 18px 24px; }
    .profile-table th:first-child,
    .profile-table td:first-child { padding-left: 18px; }
    .profile-table th:last-child,
    .profile-table td:last-child { padding-right: 18px; }
    .credit-packs {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }
    /* A pack is one row: name and credits on the left, price and button on the right */
    .credit-pack {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "credits price"
            "expiry expiry"
            "buy buy";
        gap: 4px 16px;
        align-items: center;
        padding: 14px 16px;
    }
    .credit-pack-expiry { grid-area: expiry; margin: 8px 0 4px; }
    .credit-pack-credits { grid-area: credits; font-size: 22px; }
    .credit-pack-price { grid-area: price; margin: 0; text-align: right; }
    .credit-pack .btn { grid-area: buy; width: 100%; margin: 0; }
    .credit-pack-credits { white-space: nowrap; }
    .credit-promo-input {
        max-width: none;
        font-size: 16px;
    }
}
@media (max-width: 520px) {
    .profile-stats {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    .profile-stat-primary {
        grid-column: 1 / -1;
    }
    .profile-stat-primary + .profile-stat {
        border-left: 0;
    }
    /* Activity: tighter cells, and the date may wrap so the amount stays in view */
    .profile-table-activity th,
    .profile-table-activity td {
        padding-left: 10px;
        padding-right: 10px;
    }
    .profile-table-activity td:first-child {
        font-size: 13px;
        white-space: normal;
    }
    .profile-stat:not(.profile-stat-primary) {
        border-top: 1px solid var(--rule);
    }
    /* Purchases: each one becomes a small block instead of a five-column row */
    .profile-table-purchases thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }
    .profile-table-purchases,
    .profile-table-purchases tbody {
        display: block;
    }
    .profile-table-purchases tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "pack paid"
            "date credits"
            "receipt receipt";
        gap: 4px 12px;
        padding: 14px 18px;
        border-top: 1px solid var(--rule);
    }
    .profile-table-purchases td,
    .profile-table-purchases td:first-child,
    .profile-table-purchases td:last-child {
        padding: 0;
        border: 0;
    }
    .profile-table-purchases td:nth-child(1) { grid-area: date; font-size: 13px; }
    .profile-table-purchases td:nth-child(2) { grid-area: pack; font-weight: 600; }
    .profile-table-purchases td:nth-child(3) { grid-area: credits; font-size: 13px; color: var(--ink-soft); }
    .profile-table-purchases td:nth-child(3)::after { content: " credits"; }
    .profile-table-purchases td:nth-child(4) { grid-area: paid; font-weight: 600; }
    .profile-table-purchases td:nth-child(5) { grid-area: receipt; font-size: 13px; }
}
.category-list[hidden] {
    display: none;
}

/* Saved searches on /jobs (js/job-searches.js) */
.job-saved-searches {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}
.job-saved-searches[hidden] {
    display: none;
}
.job-saved-searches-label {
    margin-right: 2px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-soft);
}
.job-saved-search {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    border: 1px solid var(--rule);
    border-radius: 999px;
    background: #fff;
    font-size: 13px;
}
.job-saved-search a {
    padding: 4px 4px 4px 12px;
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
    overflow-wrap: anywhere;
}
.job-saved-search a:hover {
    color: var(--brand);
}
.job-saved-search.active {
    border-color: var(--brand);
    background: var(--brand-soft);
}
.job-saved-search.active a {
    color: var(--brand-deep);
}
.job-saved-search button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--ink-faint);
    cursor: pointer;
}
.job-saved-search button:last-child {
    margin-right: 4px;
    font-size: 15px;
    line-height: 1;
}
.job-saved-search button:hover,
.job-saved-search button:focus-visible {
    background: rgba(0, 0, 0, 0.06);
    color: var(--ink);
}
/* Rename only shows on hover or focus, so the row of chips stays short */
.job-saved-search [data-rename-search] {
    display: none;
}
.job-saved-search:hover [data-rename-search],
.job-saved-search:focus-within [data-rename-search],
.job-saved-search.active [data-rename-search] {
    display: inline-flex;
}
@media (hover: none) {
    .job-saved-search [data-rename-search] {
        display: inline-flex;
    }
}
.job-save-search {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    padding: 4px 10px;
    border: 1px solid var(--rule);
    border-radius: 999px;
    background: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--brand);
    cursor: pointer;
}
.job-save-search:hover {
    border-color: var(--brand);
}
.job-save-search[aria-pressed="true"] {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand-deep);
}
.job-save-search[aria-pressed="true"] .job-save-search-icon {
    fill: currentColor;
}
.job-save-search:disabled {
    opacity: 0.6;
    cursor: default;
}
/* Jobs posted since a saved search was last opened: a count on its chip, and New on those rows */
.job-saved-search-new {
    margin-left: 4px;
    padding: 1px 6px;
    border-radius: 999px;
    background: #1e8e3e;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.job-saved-search-input {
    margin: 2px 2px 2px 6px;
    padding: 2px 6px;
    border: 1px solid var(--brand);
    border-radius: 999px;
    font: inherit;
    font-size: 13px;
    color: var(--ink);
    outline: none;
}
.job-saved-search.editing [data-rename-search] {
    display: none;
}
.category-badge.job-new-badge {
    background: #e6f4ea;
    color: #1e6b34;
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
