* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f5f5f2;
    color: #171717;
    font-family:
        Arial,
        Helvetica,
        sans-serif;
}

a {
    color: inherit;
}

.site-header {
    background: #ffffff;
    border-bottom: 1px solid #deded9;
}

.header-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.brand {
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
}

.main-nav {
    display: flex;
    gap: 24px;
}

.main-nav a {
    font-size: 14px;
    text-decoration: none;
}

.main-nav .active {
    font-weight: 700;
}

.page-shell {
    max-width: 1180px;
    margin: 30px auto 70px;
    padding: 0 20px;
}

.directory-hero,
.notice,
.directory-note {
    background: #ffffff;
    border: 1px solid #ddddda;
    border-radius: 8px;
}

.directory-hero {
    padding: 24px 20px;
    margin-bottom: 20px;
}

.eyebrow,
.small-label,
.meta-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    color: #777772;
}

.directory-hero h1 {
    margin: 6px 0 8px;
    font-size: 32px;
}

.directory-hero p {
    max-width: 760px;
    margin: 0;
    color: #5f5f5a;
    line-height: 1.55;
}

.agency-search {
    display: flex;
    gap: 10px;
    max-width: 700px;
    margin-top: 22px;
}

.agency-search input {
    flex: 1;
    min-width: 0;
    padding: 11px 13px;
    border: 1px solid #cfcfca;
    border-radius: 6px;
    font: inherit;
}

.agency-search button {
    padding: 11px 18px;
    border: 1px solid #171717;
    border-radius: 6px;
    background: #171717;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.search-context {
    margin-top: 13px;
    color: #666662;
    font-size: 13px;
}

.notice {
    padding: 20px;
}

.directory-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 15px 0;
    color: #62625e;
    font-size: 13px;
}

.agency-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.agency-card {
    display: flex;
    flex-direction: column;

    min-width: 0;
    background: #ffffff;
    border: 1px solid #ddddda;
    border-radius: 8px;
    overflow: hidden;
}

.agency-card-main {
    flex: 1 1 auto;
    padding: 20px;
}

.agency-card h2 {
    margin: 6px 0 5px;
    font-size: 19px;
    line-height: 1.3;
}

.agency-card h2 a {
    text-decoration: none;
}

.agency-card h2 a:hover {
    text-decoration: underline;
}

.legal-name {
    margin-top: 5px;
    color: #6a6a65;
    font-size: 12px;
}

.agency-location {
    margin-top: 12px;
    color: #555550;
    font-size: 14px;
}

.agency-card-meta {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    border-top: 1px solid #ecece8;
}

.agency-card-meta > div {
    padding: 13px 20px;
}

.agency-card-meta > div + div {
    border-left: 1px solid #ecece8;
}

.meta-label {
    display: block;
    margin-bottom: 4px;
}

.agency-card-footer {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    align-items: center;

    padding: 14px 20px;
    border-top: 1px solid #ecece8;
    background: #fafaf8;
}

.profile-link {
    font-size: 13px;
    font-weight: 700;
}

.verified-site {
    font-size: 11px;
    color: #666662;
}

.pagination {
    display: grid;
    grid-template-columns:
        1fr auto 1fr;

    gap: 20px;
    align-items: center;

    margin-top: 22px;
    padding: 16px 20px;

    background: #ffffff;
    border: 1px solid #ddddda;
    border-radius: 8px;

    font-size: 13px;
}

.pagination > :last-child {
    text-align: right;
}

.directory-note {
    margin-top: 20px;
    padding: 20px;
    color: #5f5f5a;
    font-size: 13px;
    line-height: 1.55;
}

.directory-note p:last-child {
    margin-bottom: 0;
}


@media (max-width: 760px) {

    .agency-grid {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 650px) {

    .header-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .agency-search {
        display: block;
    }

    .agency-search button {
        width: 100%;
        margin-top: 8px;
    }

    .agency-card-meta {
        grid-template-columns: 1fr;
    }

    .agency-card-meta > div + div {
        border-left: 0;
        border-top: 1px solid #ecece8;
    }

    .agency-card-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}
/* Phase 3: opt-in directory filters and directory-fact comparison. */
.agency-search { display: grid; grid-template-columns: minmax(0,1fr) auto; max-width: 100%; align-items: start; }
.agency-search > input[type="search"] { min-height: 44px; }
.directory-search-action button { min-height: 44px; }
.directory-advanced { grid-column: 1 / -1; border: 1px solid #d8d3c4; border-radius: 9px; background: #fffdfa; padding: 12px 15px; }
.directory-advanced summary { cursor: pointer; font-weight: 700; }
.directory-filter-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-top: 15px; }
.directory-filter-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; }
.directory-filter-grid input, .directory-filter-grid select { width: 100%; min-width: 0; background: #fff; border: 1px solid #c7c4b9; border-radius: 6px; padding: 10px 8px; font: inherit; font-weight: 400; }
.directory-filter-hint { color: #5a554b; font-size: 13px; line-height: 1.5; margin: 11px 0; }
.directory-clear { font-weight: 700; font-size: 13px; }
.agency-distance { margin-top: 7px; font-size: 12px; color: #585b56; }
.agency-compare-row { padding: 0 20px 14px; background: #fafaf8; }
.directory-compare-button { padding: 9px 13px; border: 1px solid #2e5e6c; border-radius: 6px; color: #274f5a; background: #fff; cursor: pointer; font-weight: 700; }
.directory-compare-button[aria-pressed="true"] { background: #274f5a; color: #fff; }
.directory-comparison { margin: 24px 0; padding: 20px; background: #fff; border: 1px solid #d9d8cc; border-radius: 9px; }
.directory-comparison[hidden] { display: none; }
.comparison-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.comparison-heading h2 { font-size: 22px; margin: 0; }
.comparison-heading button { border: 1px solid #888; border-radius: 5px; padding: 8px 10px; background: #fff; cursor: pointer; }
.comparison-note,.comparison-status { font-size: 13px; line-height: 1.5; color: #514e48; }
.directory-comparison-table { overflow-x: auto; max-width: 100%; }
.directory-comparison-table table { min-width: 620px; border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 13px; }
.directory-comparison-table th, .directory-comparison-table td { padding: 12px; border: 1px solid #e1dfd5; vertical-align: top; overflow-wrap: anywhere; }
.directory-comparison-table th { background: #f5f2e8; text-align: left; }
.directory-comparison-table a { font-weight: 700; }
@media(max-width: 850px) { .directory-filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width: 650px) { .agency-search { display: grid; grid-template-columns: 1fr; } .directory-search-action button { width: 100%; margin-top: 0; } .directory-filter-grid { grid-template-columns: 1fr; } .directory-advanced { grid-column: 1; } }
