.district-index {
    margin: 14px 0 18px;
    overflow: hidden;
    border: 1px solid var(--portal-border, #dce5f0);
    border-radius: 12px;
    background: #fff;
}

.district-index__heading {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 16px;
    border-bottom: 1px solid var(--portal-border-subtle, #f1f5f9);
}

.district-index h2 {
    margin: 0;
    color: var(--portal-dark, #0f172a);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
}

.district-index__heading > span {
    color: #94a3b8;
    font-size: 11px;
    font-weight: 650;
}

.district-index__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    padding: 10px 12px 12px;
}

.district-index__card {
    display: flex;
    min-width: 0;
    height: 38px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 9px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #334155;
    background: #f8fafc;
    font-size: 12px;
    text-decoration: none !important;
    box-sizing: border-box;
    transition: border-color .16s ease, color .16s ease, background-color .16s ease;
}

.district-index__card-main {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
}

.district-index__marker {
    position: relative;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    border: 1px solid #e8b7c2;
    border-radius: 5px;
    background: #fff;
}

.district-index__marker::before,
.district-index__marker::after {
    position: absolute;
    content: "";
}

.district-index__marker::before {
    top: 4px;
    left: 4px;
    width: 5px;
    height: 5px;
    border: 1.5px solid var(--portal-primary, #b21b3c);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
}

.district-index__marker::after {
    top: 6px;
    left: 6px;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: var(--portal-primary, #b21b3c);
}

.district-index__name {
    overflow: hidden;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.district-index__count {
    min-width: 24px;
    flex: 0 0 auto;
    padding: 2px 5px;
    border-radius: 999px;
    color: #64748b;
    background: #e9eef5;
    font-size: 10px;
    font-weight: 750;
    line-height: 1.2;
    text-align: center;
}

.district-index__card:hover,
.district-index__card:focus-visible {
    border-color: var(--portal-border-red, #e8b7c2);
    color: var(--portal-primary, #b21b3c);
    background: var(--portal-bg-accent, #fff5f7);
    outline: none;
}

.district-index__card.is-active {
    border-color: var(--portal-primary, #b21b3c);
    color: #8f1632;
    background: var(--portal-bg-accent, #fff5f7);
}

.district-index__more {
    border-top: 1px solid var(--portal-border-subtle, #f1f5f9);
    background: #fff;
}

.district-index__more summary {
    display: flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 16px;
    cursor: pointer;
    color: #475569;
    font-size: 11px;
    font-weight: 750;
    list-style: none;
}

.district-index__more summary::-webkit-details-marker {
    display: none;
}

.district-index__more summary:hover,
.district-index__more summary:focus-visible {
    color: var(--portal-primary, #b21b3c);
    background: var(--portal-bg-accent, #fff5f7);
    outline: none;
}

.district-index__more-count {
    padding: 2px 6px;
    border-radius: 999px;
    color: #64748b;
    background: #f1f5f9;
    font-size: 9px;
}

.district-index__more-chevron {
    width: 6px;
    height: 6px;
    margin: -3px 0 0 2px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform .16s ease;
}

.district-index__more[open] .district-index__more-chevron {
    margin-top: 3px;
    transform: rotate(225deg);
}

.district-index__more .district-index__grid--all {
    border-top: 1px solid var(--portal-border-subtle, #f1f5f9);
}

.notary-card-modern__district {
    display: inline-flex;
    width: max-content;
    max-width: 100%;
    align-items: center;
    margin: 0;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    text-decoration: underline !important;
    text-decoration-color: #cbd5e1 !important;
    text-underline-offset: 3px;
    transition: color .16s ease, text-decoration-color .16s ease;
}

.notary-card-modern__location-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-top: 5px;
}

.notary-card-modern__district:hover,
.notary-card-modern__district:focus-visible {
    color: var(--portal-primary, #b21b3c);
    text-decoration-color: currentColor !important;
    outline: none;
}

.nearby-notaries {
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid var(--portal-border, #dce5f0);
}

.nearby-notaries__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: 0 4px 14px;
}

.nearby-notaries__header h2 {
    margin: 0 0 4px;
    color: var(--portal-dark, #0f172a);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.25;
}

.nearby-notaries__count {
    min-width: 26px;
    padding: 3px 8px;
    border-radius: 999px;
    color: #475569;
    background: #eef2f7;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.4;
    text-align: center;
}

.notary-card-modern--nearby {
    background: #fbfcfe;
}

@media (max-width: 900px) {
    .district-index__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 460px) {
    .district-index__heading {
        padding: 0 12px;
    }

    .district-index__grid {
        grid-template-columns: 1fr;
        padding: 8px 10px 10px;
    }

    .nearby-notaries {
        margin-top: 24px;
        padding-top: 18px;
    }

    .nearby-notaries__header h2 {
        font-size: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .district-index__card,
    .district-index__more-chevron,
    .notary-card-modern__district {
        transition: none;
    }
}
