:root {
    color-scheme: light;
    --page: #f7fbff;
    --panel: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --line: #dbe5f2;
    --blue: #2563eb;
    --blue-soft: #eff6ff;
    --indigo: #4f46e5;
    --emerald: #059669;
    --emerald-soft: #d1fae5;
    --purple: #7c3aed;
    --purple-soft: #f3e8ff;
    --amber: #d97706;
    --amber-soft: #fef3c7;
    --shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body.directory-light-page {
    margin: 0;
    background: var(--page);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
}

.top-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 26px;
    min-height: 64px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.brand-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--blue), var(--indigo));
    color: #fff;
    font-size: 21px;
    font-weight: 950;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.22);
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    color: var(--text);
    font-size: 20px;
    line-height: 1.1;
}

.brand small {
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    color: #475569;
    font-size: 14px;
    font-weight: 800;
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--blue);
}

.nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.nav-dot.blue {
    background: var(--blue);
}

.nav-dot.green {
    background: var(--emerald);
}

.nav-dot.purple {
    background: var(--purple);
}

.nav-dot.amber {
    background: var(--amber);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.signin {
    color: #334155;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 800;
}

.claim {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--blue), var(--indigo));
    color: #fff;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 14px 34px rgba(37, 99, 235, 0.22);
}

.mobile-link-row {
    display: none;
}

.directory-main {
    padding: 32px 0 64px;
}

.directory-banner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 30px;
}

.directory-banner h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.15;
    letter-spacing: 0;
}

.directory-banner p {
    margin: 8px 0 0;
    color: var(--muted);
}

.banner-stats {
    min-width: 170px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    padding: 18px;
    box-shadow: var(--shadow);
}

.banner-stats strong {
    display: block;
    color: var(--blue);
    font-size: 28px;
}

.banner-stats span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.directory-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 32px;
}

.filter-card {
    position: sticky;
    top: 94px;
    display: grid;
    gap: 24px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    padding: 20px;
    box-shadow: var(--shadow);
}

.filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.filter-head h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 14px;
}

.filter-head h3 span {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 11px;
}

.filter-head a {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.filter-card section {
    display: grid;
    gap: 10px;
}

.filter-card label {
    color: #334155;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.check-list {
    display: grid;
    gap: 9px;
    color: #475569;
    font-size: 13px;
}

.check-list strong {
    display: block;
    margin-top: 4px;
    color: var(--text);
    font-size: 12px;
    font-weight: 950;
}

.check-list span,
.check-list button {
    display: flex;
    align-items: center;
    gap: 8px;
}

.check-list button {
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #475569;
    padding: 0;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.check-list button:hover {
    color: var(--blue);
}

.filter-note {
    margin-top: -4px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.location-select-grid {
    display: grid;
    gap: 12px;
}

.location-select-grid strong {
    display: block;
    margin-bottom: 6px;
    color: var(--text);
    font-size: 12px;
    font-weight: 950;
}

.checkbox-dropdown {
    position: relative;
}

.checkbox-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbff;
    color: #334155;
    padding: 0 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
}

.checkbox-dropdown-toggle em {
    color: var(--blue);
    font-size: 12px;
    font-style: normal;
    font-weight: 950;
}

.checkbox-dropdown.open .checkbox-dropdown-toggle {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.checkbox-dropdown-menu {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 20;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.16);
    overflow: hidden;
}

.checkbox-dropdown.open .checkbox-dropdown-menu {
    display: block;
}

.dropdown-options {
    max-height: 270px;
    overflow: auto;
    padding: 6px;
}

.dropdown-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #334155;
    padding: 8px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
    cursor: pointer;
}

.dropdown-option:hover {
    border-radius: 8px;
    background: var(--blue-soft);
    color: var(--blue);
}

.all-option {
    border-bottom: 1px solid var(--line);
    background: #f8fbff;
    font-weight: 950;
}

input[type="checkbox"] {
    accent-color: var(--blue);
}

.filter-input,
.filter-card select,
.results-bar select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbff;
    color: #334155;
    padding: 10px;
    font: inherit;
    font-size: 13px;
    outline: none;
}

.filter-input:focus,
.filter-card select:focus,
.results-bar select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.filter-submit {
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    background: var(--blue);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.listing-area {
    display: grid;
    gap: 16px;
}

.results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    font-size: 13px;
}

.results-bar strong {
    color: var(--text);
}

.results-bar label {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.results-bar select {
    width: auto;
    padding: 7px 10px;
}

.agent-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.agent-card:hover {
    border-color: #bfdbfe;
    transform: translateY(-1px);
}

.empty-listing {
    display: grid;
    justify-items: start;
    gap: 10px;
}

.empty-listing h2 {
    margin: 0;
}

.empty-listing p {
    margin: 0 0 8px;
    color: var(--muted);
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    padding: 12px;
    box-shadow: var(--shadow);
}

.pagination-bar div {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}

.pagination-bar button,
.pagination-bar span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 36px;
    border-radius: 8px;
    color: #334155;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 900;
}

.pagination-bar form {
    margin: 0;
}

.pagination-bar button {
    border: 1px solid var(--line);
    background: #f8fbff;
    cursor: pointer;
    font-family: inherit;
}

.pagination-bar button.active {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}

.pagination-bar button.disabled,
.pagination-bar button:disabled {
    pointer-events: none;
    opacity: 0.44;
    cursor: not-allowed;
}

.agent-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.agent-identity {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.agent-logo {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    color: #fff;
    font-size: 18px;
    font-weight: 950;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.16);
}

.logo-1 {
    background: linear-gradient(135deg, var(--blue), var(--indigo));
}

.logo-2 {
    background: linear-gradient(135deg, var(--emerald), #0d9488);
}

.logo-3 {
    background: linear-gradient(135deg, var(--purple), var(--blue));
}

.logo-4 {
    background: linear-gradient(135deg, var(--amber), var(--orange, #f97316));
}

.agent-identity h2 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    color: var(--text);
    font-size: 19px;
    letter-spacing: 0;
}

.agent-identity h2 em {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 10px;
    font-style: normal;
}

.agent-identity p,
.rating-row {
    color: var(--muted);
    font-size: 12px;
}

.agent-identity p {
    margin: 5px 0 0;
}

.agent-identity p b,
.rating-row b {
    color: #cbd5e1;
}

.rating-row {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 8px;
}

.rating-row span:first-child {
    color: var(--amber);
    font-weight: 900;
}

.verified-badge {
    flex: 0 0 auto;
    border: 1px solid #fde68a;
    border-radius: 999px;
    background: var(--amber-soft);
    color: var(--amber);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 900;
}

.ports-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fbff;
    padding: 12px;
}

.ports-row span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.ports-row em {
    border-radius: 6px;
    background: #eef2f7;
    color: #334155;
    padding: 4px 10px;
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
}

.capability-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.capability-row span {
    border-radius: 8px;
    background: var(--blue-soft);
    color: var(--blue);
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 850;
}

.capability-row span:nth-child(2) {
    background: var(--emerald-soft);
    color: var(--emerald);
}

.capability-row span:nth-child(3) {
    background: var(--purple-soft);
    color: var(--purple);
}

.capability-row span:nth-child(4) {
    background: var(--amber-soft);
    color: var(--amber);
}

.agent-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.online {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.online i {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--emerald);
}

.agent-actions {
    display: flex;
    gap: 8px;
}

.profile-button,
.rfq-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-radius: 12px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 900;
}

.profile-button {
    background: #eef2f7;
    color: #334155;
}

.rfq-button {
    background: var(--blue);
    color: #fff;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.18);
}

.directory-footer {
    border-top: 1px solid var(--line);
    background: #ffffff;
    padding: 34px 0;
}

.directory-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.directory-footer strong {
    display: block;
    color: var(--text);
    font-size: 18px;
}

.directory-footer p {
    max-width: 520px;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.directory-footer div:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
}

.directory-footer a:hover {
    color: var(--blue);
}

@media (max-width: 1040px) {
    .nav-links {
        display: none;
    }

    .mobile-link-row {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding: 0 0 12px;
    }

    .mobile-link-row a {
        flex: 0 0 auto;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.78);
        color: #334155;
        padding: 8px 12px;
        font-size: 13px;
        font-weight: 900;
    }

    .mobile-link-row a.active {
        border-color: #bfdbfe;
        background: var(--blue-soft);
        color: var(--blue);
    }

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

    .filter-card {
        position: static;
    }
}

@media (max-width: 760px) {
    .nav-inner,
    .directory-banner,
    .agent-top,
    .agent-bottom,
    .results-bar,
    .directory-footer-inner {
        align-items: stretch;
        flex-direction: column;
    }

    .nav-actions {
        width: 100%;
    }

    .signin,
    .claim {
        flex: 1;
    }

    .mobile-link-row {
        width: calc(100% - 32px);
    }

    .agent-actions {
        flex-direction: column;
    }

    .profile-button,
    .rfq-button {
        width: 100%;
    }

    .pagination-bar {
        align-items: stretch;
        flex-direction: column;
    }
}
