:root {
    --aff-primary: #0161fd;
    --aff-primary-hover: #0057e5;
    --aff-primary-dark: #004bbf;

    --aff-primary-soft: #ddf4ff;
    --aff-primary-soft-2: #f6f8fa;

    --aff-text: #1f2328;
    --aff-text-secondary: #424a53;
    --aff-muted: #656d76;
    --aff-soft-text: #8c959f;

    --aff-border: #d0d7de;
    --aff-border-dark: #afb8c1;
    --aff-border-soft: #d8dee4;

    --aff-background: #f6f8fa;
    --aff-surface: #ffffff;

    --aff-dark: #0d1117;

    --aff-success: #1a7f37;
    --aff-success-soft: #dafbe1;

    --aff-warning: #9a6700;
    --aff-warning-soft: #fff8c5;

    --aff-danger: #cf222e;
    --aff-danger-soft: #ffebe9;

    --container: 1240px;

    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 10px;

    --control-height: 38px;

    --ease-smooth: cubic-bezier(.22, 1, .36, 1);

    --shadow-card:
            0 1px 0 rgba(31, 35, 40, .04);

    --shadow-card-hover:
            0 3px 12px rgba(31, 35, 40, .07);

    --shadow-popover:
            0 8px 24px rgba(140, 149, 159, .20);
}


/* ============================================================
   RESET
   ============================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;

    -webkit-tap-highlight-color: transparent !important;
}

html {
    scroll-behavior: smooth;

    -webkit-tap-highlight-color: transparent;
}

html,
body {
    width: 100%;

    margin: 0;
    padding: 0;
}

body {
    background: var(--aff-surface);

    color: var(--aff-text);

    font-family:
            Inter,
            -apple-system,
            BlinkMacSystemFont,
            "Segoe UI",
            Roboto,
            Helvetica,
            Arial,
            sans-serif;

    font-size: 15px;
    font-weight: 400;
    line-height: 1.55;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.menu-open {
    overflow: hidden;
}

body,
body * {
    -webkit-tap-highlight-color: transparent !important;
}


/* ============================================================
   LINKS
   ============================================================ */

a {
    color: inherit;

    text-decoration: none;
}


/* ============================================================
   FORM ELEMENTS
   ============================================================ */

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;

    -webkit-appearance: none;
    appearance: none;
}


/* ============================================================
   IMAGES
   ============================================================ */

img {
    max-width: 100%;
}


/* ============================================================
   CONTAINER
   ============================================================ */

.container {
    width: min(
            calc(100% - 40px),
            var(--container)
    );

    margin: 0 auto;
}


/* ============================================================
   TYPOGRAPHY
   ============================================================ */

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

h1,
h2,
h3,
h4 {
    color: var(--aff-text);
}

h1 {
    font-weight: 650;
}

h2,
h3,
h4 {
    font-weight: 600;
}

p,
li {
    font-weight: 400;
}

.section-title {
    margin: 0 0 8px;

    font-size: clamp(24px, 3vw, 32px);
    font-weight: 600;
    line-height: 1.2;

    letter-spacing: -.025em;
}

.section-description {
    max-width: 700px;

    margin: 0;

    color: var(--aff-muted);

    font-size: 13px;
    line-height: 1.65;
}

.section-head {
    margin-bottom: 24px;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 24px;
}

.section-head-content {
    max-width: 720px;
}

.text-primary {
    color: var(--aff-primary);
}

.text-link {
    color: var(--aff-primary);

    display: inline-flex;
    align-items: center;

    gap: 6px;

    font-size: 12px;
    font-weight: 600;

    transition:
            color .12s ease;
}

.text-link:hover {
    color: var(--aff-primary-hover);

    text-decoration: underline;
}


/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    min-height: var(--control-height);
    height: var(--control-height);

    padding: 0 14px;

    border: 1px solid transparent;
    border-radius: var(--radius-sm);

    background: transparent;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    font-size: 12px;
    font-weight: 600;
    line-height: 1;

    white-space: nowrap;

    box-shadow: var(--shadow-card);

    transition:
            background-color .12s ease,
            border-color .12s ease,
            color .12s ease,
            box-shadow .12s ease;
}

.btn:hover {
    transform: none;
}

.btn-primary {
    border-color: var(--aff-primary);

    background: var(--aff-primary);

    color: #ffffff;
}

.btn-primary:hover {
    border-color: var(--aff-primary-hover);

    background: var(--aff-primary-hover);

    color: #ffffff;
}

.btn-secondary {
    border-color: var(--aff-border);

    background: #ffffff;

    color: var(--aff-text-secondary);
}

.btn-secondary:hover {
    border-color: var(--aff-border-dark);

    background: var(--aff-background);

    color: var(--aff-text);
}

.btn-soft {
    border-color: var(--aff-border);

    background: var(--aff-background);

    color: var(--aff-text-secondary);
}

.btn-soft:hover {
    border-color: var(--aff-border-dark);

    background: #eef1f4;

    color: var(--aff-text);
}

.btn-white {
    border-color: #ffffff;

    background: #ffffff;

    color: var(--aff-primary);
}

.btn-white:hover {
    background: #f6f8fa;

    color: var(--aff-primary-hover);
}

.btn-white-outline {
    border-color: rgba(255, 255, 255, .55);

    background: transparent;

    color: #ffffff;
}

.btn-white-outline:hover {
    border-color: rgba(255, 255, 255, .85);

    background: rgba(255, 255, 255, .08);

    color: #ffffff;
}


/* ============================================================
   HEADER
   ============================================================ */

.site-header {
    position: sticky;
    top: 0;

    z-index: 500;

    border-bottom: 1px solid var(--aff-border);

    background: rgba(255, 255, 255, .97);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.nav-wrap {
    min-height: 68px;

    display: flex;
    align-items: center;

    gap: 32px;
}


/* ============================================================
   BRAND
   ============================================================ */

.brand {
    display: flex;
    align-items: center;

    flex: 0 0 auto;
}

.brand img {
    width: 132px;
    height: auto;

    display: block;
}


/* ============================================================
   DESKTOP NAVIGATION
   ============================================================ */

.nav-main {
    margin-right: auto;

    display: flex;
    align-items: center;

    gap: 26px;
}

.nav-link {
    position: relative;

    padding: 25px 0 23px;

    color: var(--aff-text-secondary);

    font-size: 13px;
    font-weight: 500;
    line-height: 1;

    transition:
            color .12s ease;
}

.nav-link:hover {
    color: var(--aff-text);
}

.nav-link.active {
    color: var(--aff-primary);
}

.nav-link.active::after {
    content: "";

    position: absolute;

    left: 0;
    right: 0;
    bottom: -1px;

    height: 2px;

    border-radius: 2px 2px 0 0;

    background: var(--aff-primary);
}


/* ============================================================
   NAV ACTIONS
   ============================================================ */

.nav-actions {
    display: flex;
    align-items: center;

    gap: 10px;

    flex: 0 0 auto;
}

.signin-link {
    padding: 9px 7px;

    color: var(--aff-text-secondary);

    font-size: 13px;
    font-weight: 500;

    transition:
            color .12s ease;
}

.signin-link:hover {
    color: var(--aff-text);
}

.nav-join {
    min-height: 38px;
    height: 38px;

    padding-left: 14px;
    padding-right: 14px;

    border-radius: 6px;

    font-size: 12px;
    font-weight: 600;
}


/* ============================================================
   ACCOUNT MENU
   ============================================================ */

.account-menu {
    position: relative;

    flex: 0 0 auto;
}

.account-menu-trigger {
    min-height: 38px;
    height: 38px;

    padding: 3px 10px 3px 3px;

    border: 1px solid var(--aff-border);
    border-radius: 6px;

    outline: none;

    background: #ffffff;

    color: var(--aff-text-secondary);

    display: flex;
    align-items: center;

    gap: 7px;

    font-size: 12px;
    font-weight: 500;

    appearance: none;
    -webkit-appearance: none;

    transition:
            background-color .12s ease,
            border-color .12s ease,
            color .12s ease,
            box-shadow .12s ease;
}

.account-menu-trigger:hover {
    border-color: var(--aff-border-dark);

    background: var(--aff-background);

    color: var(--aff-text);
}

.account-menu-trigger:focus {
    outline: none;
}

.account-menu-trigger:focus-visible {
    border-color: var(--aff-primary);

    box-shadow:
            0 0 0 3px rgba(1, 97, 253, .10);
}

.account-menu-trigger:active {
    background: var(--aff-background);
}

.account-menu.open .account-menu-trigger {
    border-color: #b6e3ff;

    background: var(--aff-primary-soft);

    color: #0969da;
}


/* ============================================================
   ACCOUNT AVATAR
   ============================================================ */

.account-avatar {
    width: 30px;
    height: 30px;

    flex: 0 0 30px;

    border: 1px solid #b6e3ff;
    border-radius: 6px;

    background: var(--aff-primary-soft);

    color: #0969da;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-size: 12px;
    font-weight: 600;
}

.account-menu-name {
    max-width: 140px;

    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-menu-trigger svg {
    width: 15px;
    height: 15px;

    flex: 0 0 auto;

    color: var(--aff-muted);

    transition:
            transform .2s ease;
}

.account-menu.open .account-menu-trigger svg {
    transform: rotate(180deg);
}


/* ============================================================
   ACCOUNT DROPDOWN
   ============================================================ */

.account-menu-dropdown {
    width: 250px;

    position: absolute;

    top: calc(100% + 7px);
    right: 0;

    z-index: 900;

    padding: 8px;

    border: 1px solid var(--aff-border);
    border-radius: 8px;

    background: #ffffff;

    box-shadow: var(--shadow-popover);

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    transform: translateY(-4px);

    transform-origin: top right;

    transition:
            opacity .15s ease,
            transform .15s ease,
            visibility 0s linear .15s;
}

.account-menu.open .account-menu-dropdown {
    opacity: 1;

    visibility: visible;

    pointer-events: auto;

    transform: translateY(0);

    transition:
            opacity .15s ease,
            transform .15s ease,
            visibility 0s linear 0s;
}

.account-menu-info {
    padding: 10px 10px 12px;
}

.account-menu-info strong {
    display: block;

    margin-bottom: 2px;

    overflow: hidden;

    color: var(--aff-text);

    font-size: 13px;
    font-weight: 600;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-menu-info span {
    display: block;

    overflow: hidden;

    color: var(--aff-muted);

    font-size: 11px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-menu-separator {
    height: 1px;

    margin: 6px 0;

    background: var(--aff-border-soft);
}

.account-menu-item {
    width: 100%;
    min-height: 36px;

    padding: 0 10px;

    border: 0;
    border-radius: 6px;

    outline: 0;

    background: transparent;

    color: var(--aff-text-secondary);

    display: flex;
    align-items: center;

    font-size: 12px;
    font-weight: 500;

    text-align: left;

    appearance: none;
    -webkit-appearance: none;

    transition:
            background-color .12s ease,
            color .12s ease;
}

.account-menu-item:hover {
    background: var(--aff-background);

    color: var(--aff-text);
}

.account-menu-dropdown form {
    margin: 0;
}

.account-menu-logout {
    cursor: pointer;

    color: var(--aff-danger);
}

.account-menu-logout:hover {
    background: var(--aff-danger-soft);

    color: var(--aff-danger);
}


/* ============================================================
   MOBILE HEADER ACTIONS
   ============================================================ */

.mobile-header-actions {
    margin-left: auto;

    display: none;
    align-items: center;

    gap: 6px;
}

.mobile-account-menu {
    position: relative;
}

.mobile-profile-trigger {
    min-height: 38px;
    height: 38px;

    padding: 3px 8px 3px 3px;

    gap: 6px;

    background: #ffffff;
}

.mobile-profile-trigger:hover {
    background: var(--aff-background);
}

.mobile-profile-trigger .account-avatar {
    width: 30px;
    height: 30px;

    flex-basis: 30px;
}

.mobile-profile-trigger svg {
    width: 14px;
    height: 14px;
}

.mobile-profile-text {
    font-size: 12px;
    font-weight: 500;

    white-space: nowrap;
}

.mobile-account-dropdown {
    top: calc(100% + 7px);
    right: 0;

    width: min(280px, calc(100vw - 28px));

    max-width: calc(100vw - 28px);
}


/* ============================================================
   HAMBURGER
   ============================================================ */

.mobile-menu-button {
    width: 38px;
    height: 38px;

    margin: 0;
    padding: 0;

    border: 1px solid transparent;
    border-radius: 6px;

    outline: none;

    background: transparent;

    display: none;
    align-items: center;
    justify-content: center;

    position: relative;

    transition:
            background-color .12s ease;
}

.mobile-menu-button:hover {
    background: var(--aff-background);
}

.mobile-menu-button:focus,
.mobile-menu-button:active {
    outline: none;
}

.mobile-menu-button span {
    width: 18px;
    height: 2px;

    position: relative;

    display: block;

    border-radius: 2px;

    background: var(--aff-text-secondary);
}

.mobile-menu-button span::before,
.mobile-menu-button span::after {
    content: "";

    width: 18px;
    height: 2px;

    position: absolute;
    left: 0;

    display: block;

    border-radius: 2px;

    background: var(--aff-text-secondary);

    transition:
            top .2s ease,
            transform .2s ease;
}

.mobile-menu-button span::before {
    top: -6px;
}

.mobile-menu-button span::after {
    top: 6px;
}

.mobile-menu-button.active span {
    background: transparent;
}

.mobile-menu-button.active span::before {
    top: 0;

    transform: rotate(45deg);
}

.mobile-menu-button.active span::after {
    top: 0;

    transform: rotate(-45deg);
}


/* ============================================================
   MOBILE MENU
   ============================================================ */

.mobile-menu {
    display: grid;

    grid-template-rows: 0fr;

    background: #ffffff;

    border-top: 1px solid transparent;

    opacity: 0;

    transform: translateY(-5px);

    visibility: hidden;

    pointer-events: none;

    transition:
            grid-template-rows .25s ease,
            opacity .18s ease,
            transform .25s ease,
            border-color .18s ease,
            visibility 0s linear .25s;
}

.mobile-menu.active {
    grid-template-rows: 1fr;

    border-top-color: var(--aff-border);

    opacity: 1;

    transform: translateY(0);

    visibility: visible;

    pointer-events: auto;

    transition:
            grid-template-rows .25s ease,
            opacity .18s ease,
            transform .25s ease,
            border-color .18s ease,
            visibility 0s;
}

.mobile-menu-clip {
    min-height: 0;

    overflow: hidden;
}

.mobile-menu-inner {
    width: min(
            calc(100% - 28px),
            var(--container)
    );

    margin: 0 auto;

    padding-top: 0;
    padding-bottom: 0;

    opacity: 0;

    transform: translateY(-4px);

    transition:
            padding .25s ease,
            opacity .18s ease,
            transform .25s ease;
}

.mobile-menu.active .mobile-menu-inner {
    padding-top: 12px;
    padding-bottom: 18px;

    opacity: 1;

    transform: translateY(0);
}

.mobile-menu .nav-link {
    width: 100%;

    padding: 13px 3px;

    border-bottom: 1px solid var(--aff-border-soft);

    display: block;

    color: var(--aff-text-secondary);

    font-size: 13px;
    font-weight: 500;
}

.mobile-menu .nav-link:last-of-type {
    border-bottom: 0;
}

.mobile-menu .nav-link:hover {
    color: var(--aff-text);
}

.mobile-menu .nav-link.active {
    color: var(--aff-primary);
}

.mobile-menu .nav-link.active::after {
    display: none;
}

.mobile-actions {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 10px;

    margin-top: 16px;
}


/* ============================================================
   TAGS
   ============================================================ */

.tag-row {
    display: flex;

    gap: 6px;

    flex-wrap: wrap;
}

.tag {
    min-height: 28px;

    padding: 0 9px;

    border: 1px solid var(--aff-border);
    border-radius: 6px;

    background: var(--aff-background);

    color: var(--aff-text-secondary);

    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-size: 11px;
    font-weight: 500;
    line-height: 1;

    white-space: nowrap;
}

.tag-primary {
    border-color: #b6e3ff;

    background: var(--aff-primary-soft);

    color: #0969da;
}

.tag-success {
    border-color: #aceebb;

    background: var(--aff-success-soft);

    color: var(--aff-success);
}

.tag-warning {
    border-color: #eac54f;

    background: var(--aff-warning-soft);

    color: var(--aff-warning);
}

.verified {
    min-height: 26px;

    padding: 0 9px;

    border: 1px solid #b6e3ff;
    border-radius: 6px;

    background: var(--aff-primary-soft);

    color: #0969da;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-size: 11px;
    font-weight: 600;

    white-space: nowrap;
}


/* ============================================================
   FILTER SHARED
   ============================================================ */

.filter-control,
.filter-popover {
    width: 100%;

    min-width: 0;
}

.filter-control-label {
    margin: 0 0 8px;

    display: block;

    color: var(--aff-text);

    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}


/* ============================================================
   FILTER CHIPS
   ============================================================ */

.filter-chip-list {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 8px;

    flex-wrap: wrap;
}

.filter-chip {
    min-height: 34px;
    height: 34px;

    padding: 0 12px;

    border: 1px solid var(--aff-border);
    border-radius: 6px;

    background: #ffffff;

    color: var(--aff-text-secondary);

    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-size: 11px;
    font-weight: 500;
    line-height: 1;

    white-space: nowrap;

    appearance: none;
    -webkit-appearance: none;

    transition:
            border-color .12s ease,
            background-color .12s ease,
            color .12s ease;
}

.filter-chip:hover {
    border-color: var(--aff-border-dark);
}

.filter-chip.active {
    border-color: #b6e3ff;

    background: var(--aff-primary-soft);

    color: #0969da;
}


/* ============================================================
   FILTER PANEL
   ============================================================ */

.filter-panel {
    display: grid;

    grid-template-rows: 0fr;

    margin-bottom: 0;

    opacity: 0;

    transform: translateY(-5px);

    visibility: hidden;

    pointer-events: none;

    transition:
            grid-template-rows .25s ease,
            margin-bottom .25s ease,
            opacity .18s ease,
            transform .25s ease,
            visibility 0s linear .25s;
}

.filter-panel.open {
    grid-template-rows: 1fr;

    margin-bottom: 20px;

    opacity: 1;

    transform: translateY(0);

    visibility: visible;

    pointer-events: auto;

    transition:
            grid-template-rows .25s ease,
            margin-bottom .25s ease,
            opacity .18s ease,
            transform .25s ease,
            visibility 0s;
}
.directory-section,
.directory-section > .container,
.filter-panel,
.filter-card {
    overflow: visible;
}

.filter-panel-clip {
    min-height: 0;

    overflow: hidden;
}

.filter-panel.open .filter-panel-clip {
    overflow: visible;
}

.filter-card {
    padding: 24px;

    border: 1px solid var(--aff-border);
    border-radius: 8px;

    background: #ffffff;

    opacity: 0;

    transform: translateY(-4px);

    box-shadow: var(--shadow-card);

    transition:
            opacity .18s ease,
            transform .22s ease;
}

.filter-panel.open .filter-card {
    opacity: 1;

    transform: translateY(0);
}


/* ============================================================
   FILTER LAYOUT
   ============================================================ */

.filter-layout {
    width: 100%;

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 22px 26px;
}

.filter-wide {
    grid-column: 1 / -1;
}

/* All public directories share the same compact three-column filter grid. */
.directory-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 28px;
    row-gap: 26px;
    align-items: start;
}
.directory-filter-grid > .filter-wide {
    display: contents;
}
.directory-filter-grid > .filter-wide:has([data-filter-name="conditions"]) {
    grid-column: 1 / -1;
}

/* Content-aware spans keep the panel airy without changing filter behavior. */
.directory-filter-grid [data-filter-name="geo"],
.directory-filter-grid [data-filter-name="language"] {
    grid-column: span 2;
}
.directory-filter-grid [data-filter-name="type"],
.directory-filter-grid [data-filter-name="vertical"],
.directory-filter-grid [data-filter-name="models"] {
    grid-column: span 1;
}
.directory-filter-grid [data-filter-name="conditions"] {
    grid-column: span 2;
}
.directory-filter-grid [data-filter-name="sources"],
.directory-filter-grid [data-filter-name="traffic_sources"] {
    grid-column: span 2;
}
.directory-filter-grid [data-filter-name="traffic"] {
    grid-column: 1 / -1;
}

.directory-filter-grid--offers [data-filter-name="geo"] {
    grid-column: span 2;
}
.directory-filter-grid--offers [data-filter-name="vertical"] {
    grid-column: span 1;
}
.directory-filter-grid--offers [data-filter-name="models"] {
    grid-column: span 1;
}

/* Keep an opened menu above directory content and outside clipping contexts. */
.filter-panel.open {
    position: relative;
    z-index: 100;
    overflow: visible !important;
}
.filter-panel.open .filter-panel-clip,
.filter-panel.open .filter-card,
.filter-panel.open .filter-layout {
    overflow: visible !important;
}
.filter-layout > * {
    position: relative;
    z-index: 1;
}
.filter-layout > *.filter-popover.open {
    z-index: 10000;
}
.filter-layout > .filter-wide:has(.filter-popover.open) {
    position: relative;
    z-index: 10000;
}
.filter-popover.open .filter-popover-menu {
    z-index: 10001;
}
.directory-section .results-head,
.directory-section [id$="Grid"],
.directory-section .casino-grid,
.directory-section .affiliate-grid {
    position: relative;
    z-index: 1;
}

.filter-actions {
    margin-top: 24px;

    padding-top: 16px;

    border-top: 1px solid var(--aff-border-soft);

    display: flex;
    align-items: center;

    gap: 10px;
}


/* ============================================================
   FILTER POPOVER
   ============================================================ */

.filter-popover {
    position: relative;

    z-index: 20;
}

.filter-popover.open {
    z-index: 600;
}

.filter-popover-trigger {
    width: 100%;

    height: 38px;
    min-height: 38px;

    padding: 0 12px;

    border: 1px solid var(--aff-border);
    border-radius: 6px;

    background: #ffffff;

    color: var(--aff-text-secondary);

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    font-size: 12px;
    font-weight: 500;
    line-height: 1;

    text-align: left;

    appearance: none;
    -webkit-appearance: none;

    transition:
            border-color .12s ease,
            box-shadow .12s ease;
}

.filter-popover-trigger:hover {
    border-color: var(--aff-border-dark);
}

.filter-popover.open .filter-popover-trigger {
    border-color: var(--aff-primary);

    box-shadow:
            0 0 0 3px rgba(1, 97, 253, .10);
}

.filter-popover-trigger-text {
    min-width: 0;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}

.filter-popover-trigger svg {
    width: 16px;
    height: 16px;

    flex: 0 0 auto;

    color: var(--aff-muted);

    transition:
            transform .18s ease;
}

.filter-popover.open .filter-popover-trigger svg {
    transform: rotate(180deg);
}


/* ============================================================
   FILTER MENU
   ============================================================ */

.filter-popover-menu {
    width: 100%;

    min-width: 300px;
    width: max(100%, 340px);
    max-width: min(420px, calc(100vw - 28px));
    max-height: 330px;

    position: absolute;

    top: calc(100% + 5px);
    left: 0;

    z-index: 700;

    padding: 8px;

    border: 1px solid var(--aff-border);
    border-radius: 8px;

    background: #ffffff;

    box-shadow: var(--shadow-popover);

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    transform: translateY(-4px);

    transform-origin: top center;

    transition:
            opacity .15s ease,
            transform .15s ease,
            visibility 0s linear .15s;
}

@media (min-width: 851px) {
    .directory-filter-grid .filter-popover-menu {
        left: 50%;
        transform: translate(-50%, -4px);
    }

    .directory-filter-grid .filter-popover.open .filter-popover-menu {
        transform: translate(-50%, 0);
    }
}

.filter-popover.open .filter-popover-menu {
    opacity: 1;

    visibility: visible;

    pointer-events: auto;

    transform: translateY(0);

    transition:
            opacity .15s ease,
            transform .15s ease,
            visibility 0s;
}


/* ============================================================
   FILTER SEARCH
   ============================================================ */

.filter-popover-search {
    width: 100%;

    height: 36px;

    margin-bottom: 7px;

    padding: 0 10px;

    border: 1px solid var(--aff-border);
    border-radius: 6px;

    background: #ffffff;

    display: flex;
    align-items: center;

    gap: 7px;
}

.filter-popover-search svg {
    width: 15px;
    height: 15px;

    flex: 0 0 auto;

    color: var(--aff-soft-text);
}

.filter-popover-search input {
    min-width: 0;

    flex: 1;

    border: 0;
    outline: 0;

    background: transparent;

    color: var(--aff-text);

    font-size: 12px;
}

.filter-popover-search input::placeholder {
    color: var(--aff-soft-text);
}


/* ============================================================
   FILTER OPTIONS
   ============================================================ */

.filter-popover-options {
    max-height: 250px;

    overflow-y: auto;

    overscroll-behavior: contain;
}

.filter-popover-option {
    width: 100%;
    min-height: 36px;

    padding: 0 10px;

    border: 0;
    border-radius: 6px;

    background: transparent;

    color: var(--aff-text-secondary);

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    font-size: 12px;
    font-weight: 500;

    text-align: left;

    appearance: none;
    -webkit-appearance: none;

    transition:
            background-color .12s ease,
            color .12s ease;
}

.filter-popover-option:hover {
    background: var(--aff-background);
}

.filter-popover-option.selected {
    background: var(--aff-primary-soft);

    color: #0969da;
}

.filter-option-check {
    display: none;

    color: var(--aff-primary);

    font-size: 11px;
    font-weight: 600;
}

.filter-popover-option.selected .filter-option-check {
    display: inline-block;
}


/* ============================================================
   MEMBER SIDEBAR
   ============================================================ */

.member-sidebar {
    position: sticky;
    top: 100px;
}

.member-sidebar-card {
    overflow: hidden;

    border: 1px solid var(--aff-border);
    border-radius: 8px;

    background: #ffffff;

    box-shadow: var(--shadow-card);
}


/* ============================================================
   SIDEBAR ACCOUNT
   ============================================================ */

.member-sidebar-account {
    padding: 17px;

    border-bottom: 1px solid var(--aff-border-soft);

    display: flex;
    align-items: center;

    gap: 11px;
}

.member-sidebar-avatar {
    width: 36px;
    height: 36px;

    flex: 0 0 36px;

    border: 1px solid #b6e3ff;
    border-radius: 6px;

    background: var(--aff-primary-soft);

    color: #0969da;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 12px;
    font-weight: 600;
}

.member-sidebar-account-info {
    min-width: 0;
}

.member-sidebar-email {
    overflow: hidden;

    color: var(--aff-text);

    font-size: 12px;
    font-weight: 600;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-sidebar-type {
    margin-top: 2px;

    color: var(--aff-muted);

    font-size: 11px;
}


/* ============================================================
   SIDEBAR NAV
   ============================================================ */

.member-sidebar-nav {
    padding: 8px;
}

.member-sidebar-link {
    width: 100%;

    min-height: 38px;

    padding: 0 10px;

    border: 1px solid transparent;
    border-radius: 6px;

    color: var(--aff-text-secondary);

    display: flex;
    align-items: center;

    gap: 10px;

    font-size: 12px;
    font-weight: 500;

    transition:
            background-color .12s ease,
            border-color .12s ease,
            color .12s ease;
}

.member-sidebar-link svg {
    width: 18px;
    height: 18px;

    flex: 0 0 18px;

    color: var(--aff-muted);

    transition:
            color .12s ease;
}

.member-sidebar-link:hover {
    background: var(--aff-background);

    color: var(--aff-text);
}

.member-sidebar-link:hover svg {
    color: var(--aff-text-secondary);
}

.member-sidebar-link.active {
    border-color: #b6e3ff;

    background: var(--aff-primary-soft);

    color: #0969da;

    font-weight: 600;
}

.member-sidebar-link.active svg {
    color: #0969da;
}

.member-sidebar-divider {
    height: 1px;

    margin: 8px 5px;

    background: var(--aff-border-soft);
}


/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
    padding: 58px 0 26px;

    background: var(--aff-dark);

    color: #ffffff;
}

.footer-grid {
    display: grid;

    grid-template-columns:
        1.6fr repeat(4, 1fr);

    gap: 40px;
}

.footer-brand img {
    width: 132px;
}

.footer-brand p {
    max-width: 310px;

    margin: 16px 0 0;

    color: #8c959f;

    font-size: 12px;
    line-height: 1.65;
}

.footer-column h4 {
    margin: 0 0 14px;

    color: var(--aff-text);

    font-size: 11px;
    font-weight: 600;

    letter-spacing: .07em;

    text-transform: uppercase;
}

.footer-column a {
    display: block;

    margin: 9px 0;

    color: #8c959f;

    font-size: 12px;
    font-weight: 500;

    transition:
            color .12s ease;
}

.footer-column a:hover {
    color: #ffffff;
}

.footer-bottom {
    margin-top: 42px;

    padding-top: 18px;

    border-top: 1px solid rgba(255, 255, 255, .10);

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 22px;

    color: #656d76;

    font-size: 11px;
    line-height: 1.55;
}


/* ============================================================
   TABLET
   ============================================================ */

@media (max-width: 1050px) {

    .footer-grid {
        grid-template-columns:
            1.4fr repeat(2, 1fr);

        gap: 34px;
    }

    .footer-brand {
        grid-row: span 2;
    }

}


/* ============================================================
   MOBILE HEADER
   ============================================================ */

@media (max-width: 900px) {

    .nav-wrap {
        min-height: 64px;

        gap: 10px;
    }

    .nav-main,
    .nav-actions {
        display: none;
    }

    .mobile-header-actions {
        display: flex;
    }

    .mobile-menu-button {
        display: flex;
    }

    .brand {
        margin-right: auto;
    }

    .brand img {
        width: 124px;
    }

    .footer-brand img {
        width: 124px;
    }

    .member-sidebar {
        display: none;
    }

}


/* ============================================================
   TABLET FILTERS
   ============================================================ */

@media (max-width: 850px) {

    .filter-layout {
        grid-template-columns: 1fr;
    }

    .filter-wide {
        grid-column: auto;
    }

    .directory-filter-grid {
        grid-template-columns: 1fr;
        row-gap: 20px;
    }

    .directory-filter-grid [data-filter-name],
    .directory-filter-grid--offers [data-filter-name] {
        grid-column: 1 / -1;
    }

    .directory-filter-grid > .filter-wide:has([data-filter-name="conditions"]) {
        grid-column: auto;
    }

}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 650px) {

    .container {
        width: min(
                calc(100% - 28px),
                var(--container)
        );
    }

    .section-head {
        margin-bottom: 22px;

        align-items: flex-start;

        flex-direction: column;

        gap: 10px;
    }

    .section-description {
        font-size: 13px;
    }

    .filter-chip-list {
        gap: 7px;
    }

    .filter-chip {
        min-height: 36px;
        height: 36px;

        padding: 0 11px;

        font-size: 11px;
    }

    .filter-card {
        padding: 20px;
    }

    .filter-actions {
        align-items: stretch;

        flex-direction: column;
    }

    .filter-actions .btn {
        width: 100%;

        min-height: 40px;
        height: 40px;
    }


    /* ---------------------------------------------------------
       MOBILE FILTER MENU
       --------------------------------------------------------- */

    .filter-popover-menu {
        position: fixed;

        top: auto;

        left: 14px;
        right: 14px;
        bottom: 14px;

        width: auto;
        min-width: 0;
        max-width: none;

        max-height: 64vh;

        border-radius: 10px;

        z-index: 1000;

        transform: translateY(20px);

        transform-origin: bottom center;
    }

    .filter-popover.open .filter-popover-menu {
        transform: translateY(0);
    }

    .filter-popover-options {
        max-height: calc(64vh - 68px);
    }

    .filter-popover-trigger {
        min-height: 40px;
        height: 40px;

        font-size: 12px;
    }


    /* ---------------------------------------------------------
       FOOTER
       --------------------------------------------------------- */

    .site-footer {
        padding: 48px 0 24px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;

        gap: 32px 22px;
    }

    .footer-brand {
        grid-column: 1 / -1;

        grid-row: auto;
    }

    .footer-brand p {
        max-width: 380px;

        font-size: 12px;
    }

    .footer-column h4 {
        font-size: 11px;
    }

    .footer-column a {
        font-size: 12px;
    }

    .footer-bottom {
        margin-top: 34px;

        flex-direction: column;
        align-items: flex-start;

        gap: 9px;

        font-size: 11px;
    }

}


/* ============================================================
   SMALL PHONES
   ============================================================ */

@media (max-width: 470px) {

    .nav-wrap {
        gap: 6px;
    }

    .brand img {
        width: 116px;
    }

    .footer-brand img {
        width: 116px;
    }

    .mobile-header-actions {
        gap: 5px;
    }

    .mobile-profile-trigger {
        padding: 3px 6px 3px 3px;
    }

    .mobile-menu-button {
        width: 38px;
        height: 38px;
    }

}


/* ============================================================
   VERY SMALL PHONES
   ============================================================ */

@media (max-width: 380px) {

    .mobile-profile-text {
        display: none;
    }

    .mobile-profile-trigger {
        padding: 3px;

        border-radius: 6px;
    }

    .mobile-profile-trigger svg {
        display: none;
    }

}


/* ============================================================
   GUEST MOBILE ACTIONS
   ============================================================ */

@media (max-width: 520px) {

    .mobile-actions {
        grid-template-columns: 1fr;
    }

}


/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;

        transition-duration: .01ms !important;

        scroll-behavior: auto !important;
    }

}

/* ============================================================
   DIRECTORY FILTER COMPOSITION
   ============================================================ */

/* Use natural content widths for reference controls and full rows for chips. */
.directory-filter-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    column-gap: 28px;
    row-gap: 24px;
}

.directory-filter-grid > .filter-wide {
    display: contents;
}

.directory-filter-grid .filter-popover {
    flex: 1 1 300px;
    min-width: min(300px, 100%);
}

.directory-filter-grid [data-filter-name="geo"] {
    flex: 1.2 1 360px;
}

.directory-filter-grid [data-filter-name="language"] {
    flex: 1 1 300px;
}

.directory-filter-grid [data-filter-name="sources"],
.directory-filter-grid [data-filter-name="traffic_sources"] {
    flex: 1.35 1 390px;
}

.directory-filter-grid .filter-control {
    flex: 1 0 100%;
    min-width: 0;
}

.directory-filter-grid .filter-control-label {
    margin-bottom: 9px;
}

.directory-filter-grid .filter-chip-list {
    align-items: center;
    column-gap: 8px;
    row-gap: 8px;
}

.directory-filter-grid .filter-chip {
    flex: 0 0 auto;
}

.directory-filter-grid .filter-popover-menu {
    width: max(100%, 360px);
    max-width: min(440px, calc(100vw - 32px));
}

@media (min-width: 851px) {
    .directory-filter-grid .filter-popover-menu {
        left: 0;
        transform: translateY(-4px);
    }

    .directory-filter-grid .filter-popover.open .filter-popover-menu {
        transform: translateY(0);
    }
}

@media (max-width: 850px) {
    .directory-filter-grid {
        display: flex;
        flex-direction: column;
        row-gap: 20px;
    }

    .directory-filter-grid .filter-popover,
    .directory-filter-grid [data-filter-name="geo"],
    .directory-filter-grid [data-filter-name="language"],
    .directory-filter-grid [data-filter-name="sources"],
    .directory-filter-grid [data-filter-name="traffic_sources"] {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
    }

    .directory-filter-grid .filter-popover-menu {
        width: auto;
        max-width: none;
    }
}

/* Keep desktop dropdown triggers proportionate; mobile remains full width. */
@media (min-width: 851px) {
    .directory-filter-grid .filter-popover {
        flex: 0 1 320px;
        width: 320px;
        max-width: 100%;
    }

    .directory-filter-grid [data-filter-name="geo"] {
        flex-basis: 340px;
        width: 340px;
    }

    .directory-filter-grid [data-filter-name="language"] {
        flex-basis: 320px;
        width: 320px;
    }

    .directory-filter-grid [data-filter-name="sources"],
    .directory-filter-grid [data-filter-name="traffic_sources"] {
        flex-basis: 360px;
        width: 360px;
    }

    /* The options surface follows its own trigger exactly. */
    .directory-filter-grid .filter-popover-menu {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
}

@media (max-width: 850px) {
    /* Full-width mobile triggers keep an identically sized options surface. */
    .directory-filter-grid .filter-popover-menu {
        position: absolute;
        top: calc(100% + 5px);
        right: auto;
        bottom: auto;
        left: 0;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        max-height: min(64vh, 420px);
        transform: translateY(-4px);
    }

    .directory-filter-grid .filter-popover.open .filter-popover-menu {
        transform: translateY(0);
    }
}

.directory-filter-grid .filter-popover-option {
    min-width: 0;
}

.directory-filter-grid .filter-popover-option > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
