/* ======================================================================
   PFC Advanced Finder
   ----------------------------------------------------------------------
   Sections:
   01. Design tokens & shell
   02. Hero
   03. Search / toolbar
   04. Quick filters & query builder
   05. Results controls
   06. Result rows
   07. Expanded details
   08. Compare bar
   09. States
   10. Responsive
   ====================================================================== */

/* 01. Design tokens & shell
   ====================================================================== */
.pfc-af {
    --pfc-af-navy: #000412;
    --pfc-af-navy-2: #071126;
    --pfc-af-green: #00d6a0;
    --pfc-af-green-dark: #00a87e;
    --pfc-af-text: #101828;
    --pfc-af-muted: #667085;
    --pfc-af-border: #e4e9ef;
    --pfc-af-border-strong: #d3dbe5;
    --pfc-af-soft: #f7f9fb;
    --pfc-af-soft-green: #ecfff9;
    --pfc-af-white: #ffffff;
    --pfc-af-danger: #b42318;
    --pfc-af-radius: 14px;
    --pfc-af-shadow: 0 10px 34px rgba(0, 4, 18, .08);

    width: 100%;
    max-width: 1400px;
    margin-inline: auto;
    color: var(--pfc-af-text);
    font-family: inherit;
}

.pfc-af *,
.pfc-af *::before,
.pfc-af *::after {
    box-sizing: border-box;
}

.pfc-af button,
.pfc-af input,
.pfc-af select {
    font: inherit;
}

.pfc-af button,
.pfc-af select {
    cursor: pointer;
}

/* 02. Hero
   ====================================================================== */
.pfc-af__hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 26px 28px;
    color: #fff;
    background: linear-gradient(135deg, var(--pfc-af-navy), var(--pfc-af-navy-2));
    border-radius: 18px 18px 0 0;
}

.pfc-af__eyebrow {
    margin: 0 0 7px;
    color: var(--pfc-af-green);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.pfc-af__title {
    margin: 0;
    color: #fff;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.12;
}

.pfc-af__subtitle {
    max-width: 760px;
    margin: 10px 10px 10px 10px !important;
    color: rgba(255, 255, 255, .72);
    font-size: 15px;
    line-height: 1.55;
}

.pfc-af__data-note {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    padding: 8px 11px;
    color: rgba(255, 255, 255, .84);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.pfc-af__live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--pfc-af-green);
    box-shadow: 0 0 0 4px rgba(0, 214, 160, .12);
}

/* 03. Search / toolbar
   ====================================================================== */
.pfc-af__toolbar {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    padding: 18px 20px 12px;
    background: #fff;
    border-inline: 1px solid var(--pfc-af-border);
}

.pfc-af__search-wrap {
    position: relative;
    display: block;
}

.pfc-af__search-wrap svg {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    fill: none;
    stroke: #7b8797;
    stroke-width: 1.8;
    pointer-events: none;
}

.pfc-af__search,
.pfc-af__match-wrap select,
.pfc-af__sort-wrap select {
    height: 44px;
    margin: 0;
    color: var(--pfc-af-text);
    background: #fff;
    border: 1px solid var(--pfc-af-border-strong);
    border-radius: 10px;
    outline: none;
}

.pfc-af__search {
    width: 100%;
    padding: 0 14px 0 42px;
}

.pfc-af__search:focus,
.pfc-af select:focus,
.pfc-af button:focus-visible,
.pfc-af a:focus-visible {
    border-color: var(--pfc-af-green-dark);
    box-shadow: 0 0 0 3px rgba(0, 214, 160, .14);
    outline: none;
}

.pfc-af__match-wrap,
.pfc-af__sort-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--pfc-af-muted);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.pfc-af__match-wrap select,
.pfc-af__sort-wrap select {
    padding: 0 34px 0 12px;
    font-size: 13px;
    font-weight: 700;
}

.pfc-af__reset {
    height: 44px;
    padding: 0 15px;
    color: var(--pfc-af-muted);
    background: #fff;
    border: 1px solid var(--pfc-af-border-strong);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
}

.pfc-af__reset:hover {
    color: var(--pfc-af-text);
    background: var(--pfc-af-soft);
}

/* 04. Quick filters & query builder
   ====================================================================== */
.pfc-af__suggested {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    padding: 0 20px 14px;
    background: #fff;
    border-inline: 1px solid var(--pfc-af-border);
}

.pfc-af__suggested-label {
    margin-right: 2px;
    color: var(--pfc-af-muted);
    font-size: 12px;
    font-weight: 700;
}

.pfc-af__suggested button {
    padding: 6px 10px;
    color: #344054;
    background: var(--pfc-af-soft);
    border: 1px solid var(--pfc-af-border);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.1;
}

.pfc-af__suggested button:hover {
    color: var(--pfc-af-navy);
    background: var(--pfc-af-soft-green);
    border-color: rgba(0, 214, 160, .45);
}

.pfc-af__builder {
    padding: 4px 20px 18px;
    background: #fff;
    border-inline: 1px solid var(--pfc-af-border);
    border-bottom: 1px solid var(--pfc-af-border);
    border-radius: 0 0 18px 18px;
    box-shadow: var(--pfc-af-shadow);
}

.pfc-af__conditions {
    display: grid;
    gap: 9px;
}

.pfc-af__condition {
    display: grid;
    grid-template-columns: minmax(210px, 1.25fr) minmax(150px, .8fr) minmax(180px, 1fr) 34px;
    gap: 8px;
    align-items: center;
    padding: 8px;
    background: var(--pfc-af-soft);
    border: 1px solid var(--pfc-af-border);
    border-radius: 12px;
}

.pfc-af__condition select,
.pfc-af__condition input {
    width: 100%;
    min-width: 0;
    height: 40px;
    margin: 0;
    padding: 0 11px;
    color: var(--pfc-af-text);
    background: #fff;
    border: 1px solid var(--pfc-af-border-strong);
    border-radius: 8px;
    outline: none;
    font-size: 13px;
}

.pfc-af__condition-remove {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    padding: 0;
    color: #667085;
    background: transparent;
    border: 0;
    border-radius: 8px;
    font-size: 20px;
    line-height: 1;
}

.pfc-af__condition-remove:hover {
    color: var(--pfc-af-danger);
    background: #fff;
}

.pfc-af__add-filter {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
    padding: 9px 12px;
    color: var(--pfc-af-navy);
    background: #fff;
    border: 1px dashed #aeb8c5;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 800;
}

.pfc-af__add-filter span {
    color: var(--pfc-af-green-dark);
    font-size: 17px;
    line-height: 1;
}

.pfc-af__add-filter:hover {
    border-color: var(--pfc-af-green-dark);
    background: var(--pfc-af-soft-green);
}

/* 05. Results controls
   ====================================================================== */
.pfc-af__summary-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 24px 2px 12px;
}

.pfc-af__result-summary {
    color: var(--pfc-af-muted);
    font-size: 14px;
}

.pfc-af__result-summary strong {
    color: var(--pfc-af-text);
    font-size: 18px;
}

.pfc-af__sort-wrap select {
    background-color: #fff;
}

/* 06. Result rows
   ====================================================================== */
.pfc-af__results {
    display: grid;
    gap: 10px;
}

.pfc-af__result {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--pfc-af-border);
    border-radius: var(--pfc-af-radius);
    box-shadow: 0 3px 14px rgba(0, 4, 18, .035);
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.pfc-af__result:hover {
    border-color: #cbd5df;
    box-shadow: 0 8px 24px rgba(0, 4, 18, .07);
}

.pfc-af__result-main {
    display: grid;
    grid-template-columns: minmax(230px, 1.65fr) repeat(5, minmax(88px, .62fr)) minmax(136px, .8fr);
    gap: 0;
    align-items: stretch;
}

.pfc-af__identity,
.pfc-af__metric,
.pfc-af__actions {
    min-width: 0;
    padding: 15px 13px;
}

.pfc-af__metric,
.pfc-af__actions {
    border-left: 1px solid #edf0f4;
}

.pfc-af__identity {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 11px;
    align-items: center;
}

.pfc-af__logo,
.pfc-af__logo-fallback {
    width: 44px;
    height: 44px;
    border: 1px solid var(--pfc-af-border);
    border-radius: 10px;
    background: #fff;
    object-fit: contain;
}

.pfc-af__logo-fallback {
    display: grid;
    place-items: center;
    color: var(--pfc-af-navy);
    background: var(--pfc-af-soft);
    font-size: 13px;
    font-weight: 900;
}

.pfc-af__firm-line {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.pfc-af__firm-name {
    color: var(--pfc-af-text);
    font-size: 14px;
    font-weight: 850;
    line-height: 1.25;
}

.pfc-af__score {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 7px;
    color: #006b51;
    background: var(--pfc-af-soft-green);
    border: 1px solid rgba(0, 214, 160, .25);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
}

.pfc-af__programme-name {
    display: block;
    overflow: hidden;
    margin-top: 4px;
    color: #475467;
    font-size: 12px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pfc-af__meta-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.pfc-af__meta-badge {
    display: inline-flex;
    padding: 3px 6px;
    color: #667085;
    background: #f8fafc;
    border: 1px solid #edf1f5;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
}

.pfc-af__metric {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.pfc-af__metric-label {
    color: #98a2b3;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.pfc-af__metric-value {
    color: var(--pfc-af-text);
    font-size: 14px;
    font-weight: 850;
    line-height: 1.2;
}

.pfc-af__metric-sub {
    color: var(--pfc-af-muted);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.25;
}

.pfc-af__actions {
    display: grid;
    align-content: center;
    gap: 7px;
}

.pfc-af__visit,
.pfc-af__review,
.pfc-af__details-btn {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.1;
    text-align: center;
    text-decoration: none !important;
}

.pfc-af__visit {
    color: #001a14 !important;
    background: var(--pfc-af-green);
    border: 1px solid var(--pfc-af-green);
}

.pfc-af__visit:hover {
    background: #10e2ad;
}

.pfc-af__details-btn,
.pfc-af__review {
    color: #344054 !important;
    background: #fff;
    border: 1px solid var(--pfc-af-border-strong);
}

.pfc-af__details-btn:hover,
.pfc-af__review:hover {
    background: var(--pfc-af-soft);
}

.pfc-af__select-compare {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    color: var(--pfc-af-muted);
    font-size: 11px;
    font-weight: 750;
}

.pfc-af__select-compare input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--pfc-af-green-dark);
}

/* 07. Expanded details
   ====================================================================== */
.pfc-af__details {
    padding: 16px;
    background: #fbfcfd;
    border-top: 1px solid var(--pfc-af-border);
}

.pfc-af__details[hidden] {
    display: none;
}

.pfc-af__details-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.pfc-af__detail-card {
    padding: 13px;
    background: #fff;
    border: 1px solid var(--pfc-af-border);
    border-radius: 10px;
}

.pfc-af__detail-card h4 {
    margin: 0 0 9px;
    color: var(--pfc-af-text);
    font-size: 12px;
}

.pfc-af__detail-list {
    display: grid;
    gap: 7px;
    margin: 0;
}

.pfc-af__detail-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    color: var(--pfc-af-muted);
    font-size: 11px;
}

.pfc-af__detail-item strong {
    color: #344054;
    text-align: right;
}

.pfc-af__rule-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pfc-af__rule {
    padding: 5px 7px;
    color: #475467;
    background: var(--pfc-af-soft);
    border: 1px solid var(--pfc-af-border);
    border-radius: 7px;
    font-size: 10px;
    font-weight: 750;
}

.pfc-af__rule.is-yes {
    color: #006b51;
    background: var(--pfc-af-soft-green);
    border-color: rgba(0, 214, 160, .3);
}

.pfc-af__rule.is-no {
    color: #8a2c24;
    background: #fff7f6;
    border-color: #f0d4d1;
}

.pfc-af__phase-wrap {
    grid-column: 1 / -1;
    overflow-x: auto;
}

.pfc-af__phase-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    font-size: 11px;
}

.pfc-af__phase-table th,
.pfc-af__phase-table td {
    padding: 8px 9px;
    text-align: left;
    border-bottom: 1px solid #edf0f4;
}

.pfc-af__phase-table th {
    color: #667085;
    background: #f8fafc;
    font-weight: 800;
}

.pfc-af__verified {
    margin: 10px 0 0;
    color: #98a2b3;
    font-size: 10px;
}

/* 08. Compare bar
   ====================================================================== */
.pfc-af__compare-bar {
    position: sticky;
    z-index: 20;
    bottom: 14px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin: 18px auto 0;
    padding: 12px 14px 12px 16px;
    color: #fff;
    background: var(--pfc-af-navy);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 13px;
    box-shadow: 0 14px 38px rgba(0, 4, 18, .28);
}

.pfc-af__compare-bar[hidden] {
    display: none;
}

.pfc-af__compare-bar strong {
    display: block;
    color: #fff;
    font-size: 13px;
}

.pfc-af__compare-bar span {
    display: block;
    max-width: 720px;
    margin-top: 2px;
    overflow: hidden;
    color: rgba(255, 255, 255, .64);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pfc-af__compare-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pfc-af__compare-actions button,
.pfc-af__compare-actions a {
    display: inline-flex;
    height: 36px;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 850;
    text-decoration: none !important;
    white-space: nowrap;
}

.pfc-af__compare-actions button {
    color: rgba(255, 255, 255, .78);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .2);
}

.pfc-af__compare-actions a {
    color: #001a14 !important;
    background: var(--pfc-af-green);
    border: 1px solid var(--pfc-af-green);
}

.pfc-af__compare-actions a.is-disabled {
    pointer-events: none;
    opacity: .45;
}

/* 09. States
   ====================================================================== */
.pfc-af__status {
    min-height: 0;
    color: var(--pfc-af-muted);
    font-size: 13px;
}

.pfc-af__status.is-loading,
.pfc-af__status.is-error,
.pfc-af__empty {
    padding: 18px;
    background: #fff;
    border: 1px solid var(--pfc-af-border);
    border-radius: var(--pfc-af-radius);
}

.pfc-af__status.is-loading {
    margin-bottom: 10px;
}

.pfc-af__status.is-error {
    margin-bottom: 10px;
    color: var(--pfc-af-danger);
    border-color: #f0d4d1;
}

.pfc-af__empty {
    text-align: center;
}

.pfc-af__empty strong {
    display: block;
    margin-bottom: 5px;
    color: var(--pfc-af-text);
}

.pfc-af__pagination {
    padding: 16px 0 0;
    text-align: center;
}

.pfc-af__pagination button {
    min-height: 42px;
    padding: 9px 18px;
    color: var(--pfc-af-navy);
    background: #fff;
    border: 1px solid var(--pfc-af-border-strong);
    border-radius: 9px;
    font-size: 13px;
    font-weight: 850;
}

.pfc-af__pagination button:hover {
    background: var(--pfc-af-soft);
}

/* 10. Responsive
   ====================================================================== */
@media (max-width: 1080px) {
    .pfc-af__result-main {
        grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(82px, .6fr)) minmax(130px, .75fr);
    }

    .pfc-af__metric--target {
        display: none;
    }
}

@media (max-width: 820px) {
    .pfc-af__hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 22px;
    }

    .pfc-af__toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .pfc-af__search-wrap {
        grid-column: 1 / -1;
    }

    .pfc-af__reset {
        width: 100%;
    }

    .pfc-af__condition {
        grid-template-columns: 1fr 1fr 34px;
    }

    .pfc-af__condition-field {
        grid-column: 1 / -1;
    }

    .pfc-af__condition-remove {
        grid-column: 3;
        grid-row: 2;
    }

    .pfc-af__summary-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .pfc-af__sort-wrap {
        width: 100%;
        justify-content: space-between;
    }

    .pfc-af__sort-wrap select {
        flex: 1;
    }

    .pfc-af__result-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 14px;
        gap: 11px 14px;
    }

    .pfc-af__identity {
        grid-column: 1 / -1;
        padding: 0 0 12px;
        border-bottom: 1px solid #edf0f4;
    }

    .pfc-af__metric,
    .pfc-af__actions {
        padding: 0;
        border-left: 0;
    }

    .pfc-af__metric--target {
        display: flex;
    }

    .pfc-af__actions {
        grid-column: 1 / -1;
        grid-template-columns: 1fr 1fr;
        padding-top: 4px;
    }

    .pfc-af__select-compare {
        grid-column: 1 / -1;
    }

    .pfc-af__details-grid {
        grid-template-columns: 1fr;
    }

    .pfc-af__phase-wrap {
        grid-column: 1;
    }
}

@media (max-width: 560px) {
    .pfc-af__hero {
        border-radius: 14px 14px 0 0;
    }

    .pfc-af__toolbar,
    .pfc-af__suggested,
    .pfc-af__builder {
        padding-inline: 13px;
    }

    .pfc-af__toolbar {
        grid-template-columns: 1fr;
    }

    .pfc-af__search-wrap,
    .pfc-af__match-wrap,
    .pfc-af__reset {
        grid-column: auto;
        width: 100%;
    }

    .pfc-af__match-wrap {
        justify-content: space-between;
    }

    .pfc-af__match-wrap select {
        flex: 1;
    }

    .pfc-af__condition {
        grid-template-columns: minmax(0, 1fr) 34px;
    }

    .pfc-af__condition-field,
    .pfc-af__condition-operator,
    .pfc-af__condition-value {
        grid-column: 1;
    }

    .pfc-af__condition-remove {
        grid-column: 2;
        grid-row: 1;
    }

    .pfc-af__result-main {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .pfc-af__actions {
        grid-template-columns: 1fr;
    }

    .pfc-af__compare-bar {
        bottom: 8px;
        align-items: stretch;
        flex-direction: column;
    }

    .pfc-af__compare-actions {
        display: grid;
        grid-template-columns: auto 1fr;
    }
}


/* v1.1.0: maximum three programme selections for comparison */
.pfc-af__select-compare.is-disabled {
    opacity: .45;
    cursor: not-allowed;
}

.pfc-af__select-compare.is-disabled input {
    cursor: not-allowed;
}

.pfc-af__compare-actions [data-role="compare-link"].is-disabled {
    opacity: .48;
    pointer-events: none;
    cursor: not-allowed;
}


/* ======================================================================
   v1.2.0 Compact finder UI
   - fixes search icon overlap
   - turns results into denser table-like rows
   - moves the compare tray to the top
   - reduces hero height
   ====================================================================== */

/* Compact hero: keep the product identity but give more viewport to results. */
.pfc-af .pfc-af__hero {
    align-items: center;
    gap: 16px;
    padding: 12px 18px !important;
    border-radius: 13px 13px 0 0;
}

.pfc-af .pfc-af__eyebrow {
    margin-bottom: 3px;
    font-size: 9px;
    letter-spacing: .08em;
}

.pfc-af .pfc-af__title {
    font-size: clamp(18px, 1.65vw, 23px) !important;
    line-height: 1.08;
}

.pfc-af .pfc-af__subtitle {
    max-width: 880px;
    margin-top: 4px;
    font-size: 11.5px !important;
    line-height: 1.35;
}

.pfc-af .pfc-af__data-note {
    gap: 6px;
    padding: 6px 9px;
    font-size: 10px;
}

/* Denser toolbar. */
.pfc-af .pfc-af__toolbar {
    grid-template-columns: minmax(280px, 1fr) auto auto;
    gap: 8px;
    padding: 10px 14px 8px;
}

.pfc-af .pfc-af__search,
.pfc-af .pfc-af__match-wrap select,
.pfc-af .pfc-af__sort-wrap select {
    height: 38px;
    min-height: 38px;
    font-size: 12px;
    line-height: 1.2;
}

/*
 * WordPress/theme input rules can override the original left padding.
 * Force enough room for the search icon.
 */
.pfc-af .pfc-af__search {
    width: 100%;
    padding: 0 36px 0 43px !important;
    text-indent: 0 !important;
}

.pfc-af .pfc-af__search-wrap svg {
    left: 14px;
    width: 17px;
    height: 17px;
    z-index: 2;
}

.pfc-af .pfc-af__reset {
    min-height: 38px;
    padding-block: 6px;
    font-size: 11px;
}

/* Pull the quick filters and builder closer together. */
.pfc-af .pfc-af__suggested {
    padding-top: 8px;
    padding-bottom: 8px;
}

.pfc-af .pfc-af__suggested,
.pfc-af .pfc-af__suggested button,
.pfc-af .pfc-af__builder,
.pfc-af .pfc-af__summary-row {
    font-size: 11px;
}

.pfc-af .pfc-af__builder {
    padding-top: 8px;
    padding-bottom: 8px;
}

.pfc-af .pfc-af__summary-row {
    padding-top: 8px;
    padding-bottom: 8px;
}

/* ----------------------------------------------------------------------
   Compare tray: lives directly below the hero and sticks to the top.
   When a checkbox is selected lower down the page, the tray becomes
   visible at the top of the viewport instead of appearing below results.
   ---------------------------------------------------------------------- */
.pfc-af .pfc-af__compare-bar {
    position: sticky !important;
    top: 8px !important;
    bottom: auto !important;
    z-index: 80;
    min-height: 48px;
    margin: 8px 0 !important;
    padding: 8px 10px 8px 13px;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0, 4, 18, .20);
}

.pfc-af .pfc-af__compare-bar strong {
    font-size: 11px;
}

.pfc-af .pfc-af__compare-bar span {
    max-width: min(760px, 58vw);
    margin-top: 1px;
    font-size: 10px;
}

.pfc-af .pfc-af__compare-actions {
    gap: 6px;
}

.pfc-af .pfc-af__compare-actions button,
.pfc-af .pfc-af__compare-actions a {
    height: 32px;
    padding-inline: 10px;
    border-radius: 7px;
    font-size: 10.5px;
}

/* ----------------------------------------------------------------------
   Compact result rows: more like a SaaS data table than stacked cards.
   ---------------------------------------------------------------------- */
.pfc-af .pfc-af__results {
    gap: 6px;
}

.pfc-af .pfc-af__result {
    border-radius: 9px;
    box-shadow: 0 2px 8px rgba(0, 4, 18, .028);
}

.pfc-af .pfc-af__result:hover {
    transform: none;
    box-shadow: 0 5px 14px rgba(0, 4, 18, .055);
}

.pfc-af .pfc-af__result-main {
    grid-template-columns:
        minmax(205px, 1.45fr)
        repeat(5, minmax(76px, .55fr))
        minmax(230px, 1.28fr);
    min-height: 76px;
}

.pfc-af .pfc-af__identity,
.pfc-af .pfc-af__metric,
.pfc-af .pfc-af__actions {
    padding: 9px 9px;
}

.pfc-af .pfc-af__identity {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 9px;
}

.pfc-af .pfc-af__logo,
.pfc-af .pfc-af__logo-fallback {
    width: 38px;
    height: 38px;
    border-radius: 8px;
}

.pfc-af .pfc-af__firm-line {
    gap: 5px;
}

.pfc-af .pfc-af__firm-name {
    font-size: 12.5px;
    line-height: 1.2;
}

.pfc-af .pfc-af__score {
    height: 18px;
    padding: 0 6px;
    font-size: 9.5px;
}

.pfc-af .pfc-af__programme-name {
    margin-top: 2px;
    font-size: 10.5px;
    line-height: 1.25;
}

.pfc-af .pfc-af__meta-badges {
    gap: 3px;
    margin-top: 4px;
}

.pfc-af .pfc-af__meta-badge {
    padding: 2px 5px;
    border-radius: 5px;
    font-size: 9px;
}

/* Keep table-cell typography consistent. */
.pfc-af .pfc-af__metric {
    gap: 2px;
}

.pfc-af .pfc-af__metric-label {
    font-size: 9px;
    line-height: 1.15;
}

.pfc-af .pfc-af__metric-value {
    font-size: 12px;
    line-height: 1.15;
}

.pfc-af .pfc-af__metric-sub {
    font-size: 9px;
    line-height: 1.2;
}

/*
 * Actions side-by-side so the action cell is short rather than stacking
 * three controls vertically.
 */
.pfc-af .pfc-af__actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: center;
    align-items: center;
    gap: 5px;
}

.pfc-af .pfc-af__visit,
.pfc-af .pfc-af__review,
.pfc-af .pfc-af__details-btn,
.pfc-af .pfc-af__select-compare {
    min-height: 30px;
    height: 30px;
    margin: 0;
    padding: 5px 7px;
    border-radius: 7px;
    font-size: 10.5px !important;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.pfc-af .pfc-af__select-compare {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #344054;
    background: #fff;
    border: 1px solid var(--pfc-af-border-strong);
}

.pfc-af .pfc-af__select-compare input {
    width: 13px;
    height: 13px;
    margin: 0;
}

/* Keep expanded details visually attached to the compact row. */
.pfc-af .pfc-af__details {
    border-top-color: #edf0f4;
}

/* Mid-size desktop / tablet: hide one less-important metric before stacking. */
@media (max-width: 1180px) and (min-width: 821px) {
    .pfc-af .pfc-af__result-main {
        grid-template-columns:
            minmax(190px, 1.35fr)
            repeat(4, minmax(74px, .55fr))
            minmax(215px, 1.25fr);
    }

    .pfc-af .pfc-af__metric--target {
        display: none;
    }
}

/* Tablet keeps rows compact and actions horizontal. */
@media (max-width: 820px) {
    .pfc-af .pfc-af__hero {
        padding: 11px 14px !important;
        gap: 8px;
    }

    .pfc-af .pfc-af__subtitle {
        max-width: none;
        font-size: 10.5px !important;
    }

    .pfc-af .pfc-af__data-note {
        padding: 5px 7px;
        font-size: 9px;
    }

    .pfc-af .pfc-af__toolbar {
        padding: 9px 12px 7px;
    }

    .pfc-af .pfc-af__result-main {
        padding: 10px 12px;
        gap: 8px 12px;
    }

    .pfc-af .pfc-af__identity {
        padding-bottom: 8px;
    }

    .pfc-af .pfc-af__actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        padding-top: 2px;
    }

    .pfc-af .pfc-af__select-compare {
        grid-column: auto;
    }

    .pfc-af .pfc-af__compare-bar {
        top: 6px !important;
    }
}

/* Mobile: retain useful metrics but keep cards much shorter. */
@media (max-width: 560px) {
    .pfc-af .pfc-af__hero {
        padding: 10px 12px !important;
    }

    .pfc-af .pfc-af__title {
        font-size: 17px !important;
    }

    .pfc-af .pfc-af__subtitle {
        margin-top: 3px;
        font-size: 10px !important;
        line-height: 1.3;
    }

    .pfc-af .pfc-af__data-note {
        display: none;
    }

    .pfc-af .pfc-af__search {
        padding-left: 43px !important;
        font-size: 12px;
    }

    .pfc-af .pfc-af__result-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px 10px;
        padding: 10px 11px;
    }

    .pfc-af .pfc-af__identity {
        grid-column: 1 / -1;
        grid-template-columns: 36px minmax(0, 1fr);
    }

    .pfc-af .pfc-af__logo,
    .pfc-af .pfc-af__logo-fallback {
        width: 36px;
        height: 36px;
    }

    .pfc-af .pfc-af__metric-value {
        font-size: 11.5px;
    }

    .pfc-af .pfc-af__actions {
        grid-column: 1 / -1;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 5px;
    }

    .pfc-af .pfc-af__visit,
    .pfc-af .pfc-af__details-btn,
    .pfc-af .pfc-af__select-compare {
        min-width: 0;
        width: 100%;
        padding-inline: 4px;
        font-size: 9.5px !important;
    }

    .pfc-af .pfc-af__compare-bar {
        top: 5px !important;
        align-items: stretch;
        flex-direction: column;
        gap: 6px;
        margin-inline: 6px !important;
    }

    .pfc-af .pfc-af__compare-bar span {
        max-width: 100%;
    }

    .pfc-af .pfc-af__compare-actions {
        grid-template-columns: auto 1fr;
    }
}


/* ======================================================================
   v1.3.0 Prop Firm Match-inspired result density + floating compare popup
   ====================================================================== */

/* Result rows: larger than v1.2, but still data-dense and table-like. */
.pfc-af .pfc-af__results {
    gap: 9px;
}

.pfc-af .pfc-af__result {
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(0, 4, 18, .035);
}

.pfc-af .pfc-af__result-main {
    grid-template-columns:
        minmax(220px, 1.45fr)
        repeat(5, minmax(82px, .58fr))
        minmax(230px, 1.18fr);
    min-height: 102px;
}

.pfc-af .pfc-af__identity,
.pfc-af .pfc-af__metric,
.pfc-af .pfc-af__actions {
    padding: 13px 12px;
}

.pfc-af .pfc-af__identity {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 11px;
}

.pfc-af .pfc-af__logo,
.pfc-af .pfc-af__logo-fallback {
    width: 48px;
    height: 48px;
    border-radius: 10px;
}

.pfc-af .pfc-af__firm-line {
    gap: 6px;
}

.pfc-af .pfc-af__firm-name {
    font-size: 14px;
    line-height: 1.2;
}

.pfc-af .pfc-af__score {
    height: 20px;
    padding-inline: 7px;
    font-size: 10px;
}

.pfc-af .pfc-af__programme-name {
    margin-top: 3px;
    font-size: 11.5px;
    line-height: 1.3;
}

.pfc-af .pfc-af__meta-badges {
    gap: 4px;
    margin-top: 5px;
}

.pfc-af .pfc-af__meta-badge {
    padding: 3px 6px;
    font-size: 9.5px;
}

.pfc-af .pfc-af__metric {
    gap: 3px;
}

.pfc-af .pfc-af__metric-label {
    font-size: 9.5px;
    line-height: 1.15;
}

.pfc-af .pfc-af__metric-value {
    font-size: 13.5px;
    line-height: 1.2;
}

.pfc-af .pfc-af__metric-sub {
    font-size: 9.5px;
    line-height: 1.25;
}

/*
 * Action cell: two buttons on row one, Compare on a clean second row.
 * The checkbox row intentionally has no border or card treatment.
 */
.pfc-af .pfc-af__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: 34px auto;
    align-content: center;
    align-items: center;
    gap: 7px 6px;
}

.pfc-af .pfc-af__visit,
.pfc-af .pfc-af__review,
.pfc-af .pfc-af__details-btn {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    height: 34px;
    margin: 0;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 11px !important;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.pfc-af .pfc-af__select-compare {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 22px;
    height: auto;
    margin: 0;
    padding: 2px 0;
    color: #475467;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0;
    box-shadow: none !important;
    font-size: 11px !important;
    font-weight: 750;
    line-height: 1.2;
    cursor: pointer;
}

.pfc-af .pfc-af__select-compare:hover {
    color: var(--pfc-af-navy);
    background: transparent !important;
}

.pfc-af .pfc-af__select-compare input {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: var(--pfc-af-green);
}

/*
 * Floating comparison popup.
 * It no longer occupies space above or below the finder table.
 */
.pfc-af .pfc-af__compare-bar {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: 22px !important;
    z-index: 100000 !important;
    width: min(820px, calc(100vw - 36px));
    min-height: 64px;
    margin: 0 !important;
    padding: 11px 12px 11px 16px;
    transform: translateX(-50%);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 14px;
    box-shadow: 0 18px 54px rgba(0,4,18,.34);
    animation: pfcAfComparePopupIn .16s ease-out;
}

.pfc-af .pfc-af__compare-bar[hidden] {
    display: none !important;
}

.pfc-af .pfc-af__compare-bar strong {
    font-size: 13px;
}

.pfc-af .pfc-af__compare-bar span {
    max-width: 570px;
    margin-top: 3px;
    font-size: 10.5px;
}

.pfc-af .pfc-af__compare-actions {
    display: flex;
    grid-template-columns: none;
    flex: 0 0 auto;
    gap: 7px;
}

.pfc-af .pfc-af__compare-actions button,
.pfc-af .pfc-af__compare-actions a {
    height: 38px;
    padding-inline: 13px;
    border-radius: 8px;
    font-size: 11px;
}

@keyframes pfcAfComparePopupIn {
    from { opacity: 0; transform: translate(-50%, 8px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Preserve the compact hero/search improvements from v1.2. */
.pfc-af .pfc-af__hero {
    padding: 12px 18px !important;
}

.pfc-af .pfc-af__search {
    padding-left: 43px !important;
}

/* Medium widths: keep the row substantial while reducing one metric. */
@media (max-width: 1180px) and (min-width: 821px) {
    .pfc-af .pfc-af__result-main {
        grid-template-columns:
            minmax(205px, 1.38fr)
            repeat(4, minmax(78px, .58fr))
            minmax(220px, 1.2fr);
        min-height: 100px;
    }
}

@media (max-width: 820px) {
    .pfc-af .pfc-af__result-main {
        padding: 12px;
        gap: 10px 12px;
    }

    .pfc-af .pfc-af__identity {
        padding-bottom: 10px;
    }

    .pfc-af .pfc-af__actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: 34px auto;
        gap: 7px 6px;
        padding-top: 5px;
    }

    .pfc-af .pfc-af__select-compare {
        grid-column: 1 / -1;
    }

    .pfc-af .pfc-af__compare-bar {
        left: 50% !important;
        top: auto !important;
        bottom: 14px !important;
        width: min(720px, calc(100vw - 24px));
        margin: 0 !important;
        transform: translateX(-50%);
    }
}

@media (max-width: 560px) {
    .pfc-af .pfc-af__result-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px 10px;
        padding: 12px;
    }

    .pfc-af .pfc-af__identity {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .pfc-af .pfc-af__logo,
    .pfc-af .pfc-af__logo-fallback {
        width: 44px;
        height: 44px;
    }

    .pfc-af .pfc-af__firm-name {
        font-size: 13.5px;
    }

    .pfc-af .pfc-af__metric-value {
        font-size: 13px;
    }

    .pfc-af .pfc-af__actions {
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-rows: 36px auto;
        gap: 7px 6px;
    }

    .pfc-af .pfc-af__visit,
    .pfc-af .pfc-af__details-btn {
        height: 36px;
        min-height: 36px;
        font-size: 10.5px !important;
    }

    .pfc-af .pfc-af__select-compare {
        grid-column: 1 / -1 !important;
        min-height: 24px;
        width: 100%;
        font-size: 10.5px !important;
    }

    .pfc-af .pfc-af__compare-bar {
        left: 50% !important;
        top: auto !important;
        bottom: 10px !important;
        width: calc(100vw - 20px);
        min-height: 0;
        margin: 0 !important;
        padding: 11px;
        transform: translateX(-50%);
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .pfc-af .pfc-af__compare-bar span {
        max-width: 100%;
        white-space: nowrap;
    }

    .pfc-af .pfc-af__compare-actions {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 7px;
    }

    .pfc-af .pfc-af__compare-actions a,
    .pfc-af .pfc-af__compare-actions button {
        height: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pfc-af .pfc-af__compare-bar {
        animation: none;
    }
}


/* ======================================================================
   v1.3.1 Mobile compare-popup reliability
   ====================================================================== */

/*
 * On screens <= 820px JavaScript moves the live compare bar directly
 * under <body>. This avoids mobile clipping/containing-block issues caused
 * by WordPress, Spectra, Astra or the Compare/Finder workspace wrapper.
 */
.pfc-af__compare-bar--mobile-portal {
    --pfc-af-green: #00d6a0;
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    top: auto !important;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 2147483000 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: auto !important;
    max-width: none !important;
    min-height: 64px;
    margin: 0 !important;
    padding: 11px 12px 11px 14px;
    transform: none !important;
    color: #fff;
    background: #000412;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 14px;
    box-shadow: 0 18px 54px rgba(0,4,18,.34);
    font-family: inherit;
    box-sizing: border-box;
    animation: pfcAfComparePortalIn .16s ease-out;
}

.pfc-af__compare-bar--mobile-portal *,
.pfc-af__compare-bar--mobile-portal *::before,
.pfc-af__compare-bar--mobile-portal *::after {
    box-sizing: border-box;
}

.pfc-af__compare-bar--mobile-portal[hidden] {
    display: none !important;
}

.pfc-af__compare-bar--mobile-portal > div:first-child {
    min-width: 0;
    flex: 1 1 auto;
}

.pfc-af__compare-bar--mobile-portal strong {
    display: block;
    color: #fff;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.25;
}

.pfc-af__compare-bar--mobile-portal span {
    display: block;
    max-width: 100%;
    margin-top: 2px;
    overflow: hidden;
    color: rgba(255,255,255,.68);
    font-size: 10px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pfc-af__compare-bar--mobile-portal .pfc-af__compare-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
}

.pfc-af__compare-bar--mobile-portal .pfc-af__compare-actions button,
.pfc-af__compare-bar--mobile-portal .pfc-af__compare-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    margin: 0;
    padding: 0 12px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 850;
    line-height: 1;
    text-decoration: none !important;
    white-space: nowrap;
}

.pfc-af__compare-bar--mobile-portal .pfc-af__compare-actions button {
    color: rgba(255,255,255,.82);
    background: transparent;
    border: 1px solid rgba(255,255,255,.22);
}

.pfc-af__compare-bar--mobile-portal .pfc-af__compare-actions a {
    color: #001a14 !important;
    background: #00d6a0;
    border: 1px solid #00d6a0;
}

.pfc-af__compare-bar--mobile-portal .pfc-af__compare-actions a.is-disabled {
    pointer-events: none;
    opacity: .45;
}

@keyframes pfcAfComparePortalIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 560px) {
    .pfc-af__compare-bar--mobile-portal {
        left: 8px !important;
        right: 8px !important;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
        min-height: 0;
        padding: 10px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        border-radius: 12px;
    }

    .pfc-af__compare-bar--mobile-portal span {
        white-space: nowrap;
    }

    .pfc-af__compare-bar--mobile-portal .pfc-af__compare-actions {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 7px;
        width: 100%;
    }

    .pfc-af__compare-bar--mobile-portal .pfc-af__compare-actions button,
    .pfc-af__compare-bar--mobile-portal .pfc-af__compare-actions a {
        width: 100%;
        height: 42px;
        min-height: 42px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pfc-af__compare-bar--mobile-portal {
        animation: none;
    }
}
