.aff-hero {
    padding: 2rem 0 1rem;
}

.aff-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.aff-stat {
    background: #f6f7f9;
    border-radius: 8px;
    padding: 1rem;
    min-width: 0;
}

a.aff-stat--link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s, box-shadow 0.15s;
}

a.aff-stat--link:hover {
    background: #eef2ff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

a.aff-stat--link strong {
    color: #1d4ed8;
}

.aff-stat strong {
    display: block;
    font-size: 1.25rem;
}

.aff-band {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Colour-blind–friendly band palette (blue / amber / green — not red→green only) */
.aff-band--difficult {
    background: #fff4e6;
    color: #9a3412;
    border: 1px solid #fdba74;
}

.aff-band--manageable {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.aff-band--comfortable {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.aff-band--quite-comfortable {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.aff-band--very-comfortable {
    background: #14532d;
    color: #f0fdf4;
    border: 1px solid #14532d;
}

.aff-band--unknown {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #d1d5db;
}

.aff-faq dt { font-weight: 600; margin-top: 1rem; }
.aff-faq dd { margin: 0.35rem 0 0; color: #444; }

.aff-calc {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1.5rem 0;
    max-width: 100%;
}

.aff-calc-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
}

.aff-calc-form label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.aff-calc-form input[type="number"] {
    width: 100%;
    max-width: 160px;
    padding: 0.5rem 0.65rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.aff-calc-form .button {
    margin: 0;
    white-space: nowrap;
}

.aff-calc-note {
    margin: 0.75rem 0 0;
    font-size: 0.9rem;
    color: #4b5563;
}

.aff-disclaimer {
    font-size: 0.85rem;
    color: #666;
    margin-top: 2rem;
}

.aff-inline-card {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.aff-inline-card--with-widget .aff-inline-card__layout {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem 1.5rem;
}

.aff-inline-card__main {
    flex: 1 1 220px;
    min-width: 0;
}

.aff-inline-card__grant {
    margin: 0 0 0.5rem;
    font-weight: 600;
    color: #334155;
}

/* —— Score widget (institute card) —— */
.aff-score-widget-wrap {
    flex: 0 0 auto;
    margin-left: auto;
}

.aff-score-widget__frame {
    position: relative;
    padding: 2px;
    border-radius: 14px;
    background: #cbd5e1;
    box-shadow:
        0 0 0 1px #94a3b8,
        0 1px 4px rgba(15, 23, 42, 0.03);
    transition:
        background 0.28s ease,
        box-shadow 0.28s ease,
        transform 0.28s ease;
}

.aff-score-widget__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    min-width: 10.5rem;
    padding: 1.1rem 1.25rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.aff-score-widget__frame:has(.aff-score-widget__score-block:hover),
.aff-score-widget__frame:has(.aff-score-widget__score-block:focus-visible) {
    background: linear-gradient(135deg, #93c5fd 0%, #1d4ed8 100%);
    box-shadow:
        0 0 0 1px #3b82f6,
        0 0 0 2px rgba(59, 130, 246, 0.09),
        0 4px 10px rgba(29, 78, 216, 0.07);
    transform: translateY(-1px);
}

.aff-score-widget__frame:has(.aff-score-widget__band-block:hover .aff-band--difficult),
.aff-score-widget__frame:has(.aff-score-widget__band-block:focus-visible .aff-band--difficult) {
    background: linear-gradient(135deg, #fdba74 0%, #9a3412 100%);
    box-shadow:
        0 0 0 1px #ea580c,
        0 0 0 2px rgba(234, 88, 12, 0.08),
        0 4px 10px rgba(154, 52, 18, 0.06);
    transform: translateY(-1px);
}

.aff-score-widget__frame:has(.aff-score-widget__band-block:hover .aff-band--manageable),
.aff-score-widget__frame:has(.aff-score-widget__band-block:focus-visible .aff-band--manageable) {
    background: linear-gradient(135deg, #cbd5e1 0%, #475569 100%);
    box-shadow:
        0 0 0 1px #64748b,
        0 0 0 2px rgba(100, 116, 139, 0.08),
        0 4px 10px rgba(71, 85, 105, 0.06);
    transform: translateY(-1px);
}

.aff-score-widget__frame:has(.aff-score-widget__band-block:hover .aff-band--comfortable),
.aff-score-widget__frame:has(.aff-score-widget__band-block:focus-visible .aff-band--comfortable) {
    background: linear-gradient(135deg, #93c5fd 0%, #1e40af 100%);
    box-shadow:
        0 0 0 1px #2563eb,
        0 0 0 2px rgba(37, 99, 235, 0.08),
        0 4px 10px rgba(30, 64, 175, 0.06);
    transform: translateY(-1px);
}

.aff-score-widget__frame:has(.aff-score-widget__band-block:hover .aff-band--quite-comfortable),
.aff-score-widget__frame:has(.aff-score-widget__band-block:focus-visible .aff-band--quite-comfortable) {
    background: linear-gradient(135deg, #86efac 0%, #166534 100%);
    box-shadow:
        0 0 0 1px #22c55e,
        0 0 0 2px rgba(34, 197, 94, 0.08),
        0 4px 10px rgba(22, 101, 52, 0.06);
    transform: translateY(-1px);
}

.aff-score-widget__frame:has(.aff-score-widget__band-block:hover .aff-band--very-comfortable),
.aff-score-widget__frame:has(.aff-score-widget__band-block:focus-visible .aff-band--very-comfortable) {
    background: linear-gradient(135deg, #4ade80 0%, #14532d 100%);
    box-shadow:
        0 0 0 1px #15803d,
        0 0 0 2px rgba(21, 128, 61, 0.09),
        0 4px 10px rgba(20, 83, 45, 0.07);
    transform: translateY(-1px);
}

.aff-score-widget__frame:has(.aff-score-widget__band-block:hover .aff-band--unknown),
.aff-score-widget__frame:has(.aff-score-widget__band-block:focus-visible .aff-band--unknown) {
    background: linear-gradient(135deg, #e5e7eb 0%, #6b7280 100%);
    box-shadow:
        0 0 0 1px #9ca3af,
        0 0 0 2px rgba(107, 114, 128, 0.07),
        0 4px 10px rgba(75, 85, 99, 0.05);
    transform: translateY(-1px);
}

.aff-score-widget__score-block,
.aff-score-widget__band-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-radius: 8px;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.aff-score-widget__score-block {
    padding: 0.35rem 0.5rem;
    cursor: default;
}

.aff-score-widget__band-block {
    padding: 0.15rem 0.25rem;
    cursor: default;
}

.aff-score-widget__score {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.04em;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    transition: color 0.2s ease, transform 0.2s ease;
}

.aff-score-widget__caption {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #64748b;
    transition: color 0.2s ease;
}

.aff-score-widget__band {
    margin: 0;
    padding: 0.5rem 1rem;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
    border-radius: 999px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.aff-score-widget__score-block:hover,
.aff-score-widget__score-block:focus-visible {
    background: #f8fafc;
}

.aff-score-widget__score-block:hover .aff-score-widget__score,
.aff-score-widget__score-block:focus-visible .aff-score-widget__score {
    color: #1d4ed8;
    transform: scale(1.03);
}

.aff-score-widget__score-block:hover .aff-score-widget__caption,
.aff-score-widget__score-block:focus-visible .aff-score-widget__caption {
    color: #475569;
}

.aff-score-widget__band-block:hover .aff-score-widget__band,
.aff-score-widget__band-block:focus-visible .aff-score-widget__band {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.aff-score-widget__score-block:focus-visible,
.aff-score-widget__band-block:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .aff-score-widget__frame {
        transition: box-shadow 0.2s ease;
    }

    .aff-score-widget__frame:has(.aff-score-widget__score-block:hover),
    .aff-score-widget__frame:has(.aff-score-widget__score-block:focus-visible),
    .aff-score-widget__frame:has(.aff-score-widget__band-block:hover),
    .aff-score-widget__frame:has(.aff-score-widget__band-block:focus-visible) {
        transform: none;
    }

    .aff-score-widget__score-block,
    .aff-score-widget__band-block,
    .aff-score-widget__score,
    .aff-score-widget__caption,
    .aff-score-widget__band {
        transition: none;
    }

    .aff-score-widget__score-block:hover .aff-score-widget__score,
    .aff-score-widget__score-block:focus-visible .aff-score-widget__score,
    .aff-score-widget__band-block:hover .aff-score-widget__band,
    .aff-score-widget__band-block:focus-visible .aff-score-widget__band {
        transform: none;
    }
}

@media (max-width: 640px) {
    .aff-inline-card--with-widget .aff-inline-card__layout {
        flex-direction: column;
        align-items: stretch;
    }

    .aff-score-widget-wrap {
        margin-left: 0;
        display: flex;
        justify-content: center;
    }
}

.aff-inline-card__links {
    margin: 0.75rem 0 0;
    padding-left: 1.25rem;
}

.aff-inline-card__meta {
    color: #64748b;
    font-size: 0.9rem;
    margin-left: 0.35rem;
}

.aff-hub-table-wrap {
    overflow-x: auto;
    margin: 1rem 0 2rem;
}

.aff-hub-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.aff-hub-table th,
.aff-hub-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.aff-hub-table th {
    background: #f9fafb;
    font-weight: 600;
}

.aff-hub-table__factor,
.aff-hub-table__score {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.aff-hub-legend {
    margin: 0 0 1.25rem;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    color: #334155;
}

.aff-hub-legend__title {
    margin: 0 0 0.75rem;
    text-align: center;
}

.aff-hub-legend__bands {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    justify-content: space-between;
    align-items: stretch;
}

.aff-hub-legend__item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    text-align: center;
    padding: 0.35rem 0.25rem;
}

.aff-hub-legend__item .aff-band {
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aff-hub-legend__range {
    font-size: 0.75rem;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
    .aff-hub-legend__bands {
        flex-wrap: wrap;
        justify-content: center;
    }

    .aff-hub-legend__item {
        flex: 1 1 calc(33.333% - 0.5rem);
        min-width: 7rem;
    }
}

@media (max-width: 520px) {
    .aff-hub-legend__item {
        flex: 1 1 calc(50% - 0.5rem);
    }
}

.aff-hub-cities {
    margin: 2rem 0;
    padding: 1.25rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.aff-hub-cities__lead {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0.35rem 0 1rem;
}

.aff-hub-cities__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem 1rem;
}

.aff-hub-cities__list a {
    font-weight: 600;
}

.aff-hub-cities__country,
.aff-hub-cities__factor {
    color: #64748b;
    font-size: 0.85rem;
    margin-left: 0.25rem;
}

.aff-category-banner {
    margin: 0 auto 1.25rem;
}

.aff-category-banner__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1.1rem;
    padding: 0.7rem 1rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 100%);
    border: 1px solid #bae6fd;
    border-radius: 10px;
}

.aff-category-banner__headline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.65rem;
    flex: 1 1 12rem;
    min-width: 0;
}

.aff-category-banner__kicker {
    margin: 0;
    flex-shrink: 0;
    padding: 0.2rem 0.5rem;
    font-size: 0.68rem;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #0369a1;
    font-weight: 700;
    background: rgba(3, 105, 161, 0.08);
    border-radius: 4px;
    white-space: nowrap;
}

.aff-category-banner__title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.3;
    color: #0f172a;
}

.aff-category-banner__stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.5rem;
    flex-shrink: 0;
}

.aff-category-banner__stats .aff-band {
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
}

.aff-category-banner__stat {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.25;
    color: #475569;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    white-space: nowrap;
}

.aff-category-banner__stat--score {
    color: #1e40af;
    border-color: #bfdbfe;
    background: #eff6ff;
    font-variant-numeric: tabular-nums;
}

.aff-category-banner__actions {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.65rem;
    flex-shrink: 0;
}

.aff-category-banner__cta.button {
    margin: 0;
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
    line-height: 1.3;
    white-space: nowrap;
}

.aff-category-banner__link {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.aff-category-banner--open-positions .aff-category-banner__inner {
    background: linear-gradient(135deg, #fff7ed 0%, #f8fafc 100%);
    border-color: #fed7aa;
}

.aff-category-banner--open-positions .aff-category-banner__kicker {
    color: #c2410c;
    background: rgba(194, 65, 12, 0.08);
}

.aff-category-banner__subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
    color: #64748b;
    max-width: 36rem;
}

.aff-category-banner__subtitle--compact {
    margin: 0.4rem 0 0;
    padding: 0 0.15rem;
    font-size: 0.82rem;
    line-height: 1.35;
    max-width: none;
}

@media (max-width: 768px) {
    .aff-category-banner__inner {
        gap: 0.55rem 0.75rem;
        padding: 0.65rem 0.85rem;
    }

    .aff-category-banner__headline {
        flex: 1 1 100%;
    }

    .aff-category-banner__stats {
        flex: 1 1 auto;
    }

    .aff-category-banner__actions {
        flex: 1 1 100%;
    }

    .aff-category-banner__title {
        font-size: 0.92rem;
    }
}

.aff-op-banner__chips-label {
    margin: 0.75rem 0 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.aff-op-banner__chips {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.aff-op-banner__chips li {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    font-size: 0.85rem;
}

.aff-op-banner__chips li > a:first-child {
    padding: 0.35rem 0.75rem;
    font-weight: 600;
    color: #0f172a;
    text-decoration: none;
}

.aff-op-banner__chips li > a:first-child:hover {
    background: #f1f5f9;
}

.aff-op-banner__chip-filter {
    padding: 0.35rem 0.5rem;
    border-left: 1px solid #e5e7eb;
    color: #64748b;
    text-decoration: none;
    line-height: 1;
}

.aff-op-banner__chip-filter:hover {
    background: #fff7ed;
    color: #c2410c;
}

.aff-lead {
    font-size: 1.05rem;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .aff-calc-form {
        flex-direction: column;
        align-items: stretch;
    }

    .aff-calc-form input[type="number"] {
        max-width: 100%;
    }
}
