:root {
    --color-primary: #0f4c81;
    --color-secondary: #1b998b;
    --color-accent: #f97316;
    --color-background: #f7f9fc;
    --color-surface: #ffffff;
    --color-surface-soft: #eef4fb;
    --color-border: #d7e0ec;
    --color-border-strong: #bfd1e3;
    --color-text: #1f2937;
    --color-muted: #5b677a;
    --shadow-soft: 0 16px 34px rgba(15, 76, 129, 0.08);
    --shadow-card: 0 20px 55px rgba(16, 42, 67, 0.1);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 26px;
    --header-height: 84px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    background:
        linear-gradient(rgba(15, 76, 129, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 76, 129, 0.035) 1px, transparent 1px),
        linear-gradient(180deg, #fcfdff 0%, var(--color-background) 42%, #f5f8fb 100%);
    background-size: 72px 72px, 72px 72px, auto;
    color: var(--color-text);
    min-height: 100vh;
    line-height: 1.6;
}

a {
    color: var(--color-primary);
}

a:hover {
    color: #0b3b66;
}

button,
input,
select {
    font: inherit;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 1000;
    border-radius: var(--radius-sm);
    background: var(--color-primary);
    color: #fff;
    padding: 0.75rem 1rem;
    text-decoration: none;
    transition: top 160ms ease;
}

.skip-link:focus {
    top: 1rem;
    color: #fff;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: var(--header-height);
    backdrop-filter: blur(16px);
    background: rgba(247, 249, 252, 0.9);
    border-bottom: 1px solid rgba(191, 209, 227, 0.85);
}

.header-inner {
    min-height: var(--header-height);
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(260px, auto) minmax(130px, 1fr);
    gap: 1rem;
    align-items: center;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--color-text);
    text-decoration: none;
    justify-self: start;
}

.brand img {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    object-fit: contain;
    box-shadow: 0 10px 24px rgba(15, 76, 129, 0.18);
}

.brand-text {
    display: inline-flex;
    align-items: baseline;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1;
}

.brand-gis {
    color: #1463a5;
}

.brand-it {
    color: var(--color-accent);
}

.brand-tools {
    color: #243044;
}

.product-heading {
    text-align: center;
    min-width: 0;
}

.product-heading h1,
.product-heading .product-title {
    margin: 0;
    color: var(--color-text);
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.2;
}

.product-heading p {
    margin: 0.2rem 0 0;
    color: var(--color-muted);
    font-size: 0.86rem;
    line-height: 1.35;
}

.tools-menu {
    position: relative;
    justify-self: end;
}

.tools-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 42px;
    border: 1px solid rgba(191, 209, 227, 0.95);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--color-text);
    padding: 0.55rem 0.8rem;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(15, 76, 129, 0.06);
}

.tools-menu-button:hover,
.tools-menu-button:focus {
    border-color: rgba(27, 153, 139, 0.6);
    box-shadow: 0 0 0 0.2rem rgba(27, 153, 139, 0.12);
    outline: none;
}


.tools-menu-list a,
.tools-menu-list a:visited,
.tools-menu-list a:hover,
.tools-menu-list a:focus {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
}

.tools-menu-list .tools-menu-item a,
.tools-menu-list .tools-menu-item a:visited,
.tools-menu-list .tools-menu-item a:hover,
.tools-menu-list .tools-menu-item a:focus {
    text-decoration: none !important;
    color: inherit;
    display: block;
    width: 100%;
}


.brand,
.brand:visited,
.brand:hover,
.brand:focus {
    text-decoration: none !important;
    color: var(--color-text);
}

.tools-menu-list {
    position: absolute;
    right: 0;
    top: calc(100% + 0.55rem);
    width: 280px;
    padding: 0.45rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: #fff;
    box-shadow: var(--shadow-card);
}

.tools-menu-item {
    width: 100%;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--color-text);
    padding: 0.65rem 0.75rem;
    text-align: left;
}

.tools-menu-item:hover,
.tools-menu-item:focus {
    background: rgba(27, 153, 139, 0.1);
    color: #0a5f56;
    outline: none;
}

.app-shell {
    padding-top: 2rem;
    padding-bottom: 2.8rem;
}

.intro-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.15rem 1.25rem;
    border: 1px solid rgba(191, 209, 227, 0.8);
    border-radius: var(--radius-md);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(238, 244, 251, 0.94));
    box-shadow: var(--shadow-soft);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.35rem;
    color: #0b7068;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.intro-panel h2 {
    max-width: 760px;
    margin: 0;
    color: var(--color-text);
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.3;
}

.term-title-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.25rem;
}

.term-title-copy {
    min-width: 0;
}

.term-title-card h1 {
    margin: 0;
    color: var(--color-text);
    font-size: clamp(1.45rem, 3vw, 2.15rem);
    font-weight: 800;
    line-height: 1.18;
}

.term-summary {
    max-width: 760px;
    margin: 0.55rem 0 0;
    color: var(--color-muted);
}

.term-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
}

.term-badge-row .badge-geo,
.term-slug-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.term-slug-badge {
    border: 1px solid rgba(15, 76, 129, 0.12);
    border-radius: 999px;
    background: rgba(15, 76, 129, 0.07);
    color: #334155;
    padding: 0.5rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 800;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

.surface-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(191, 209, 227, 0.8);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.section-card {
    padding: 1.25rem;
}

.section-label {
    margin-bottom: 0.3rem;
    color: var(--color-muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.section-title {
    margin: 0;
    color: var(--color-text);
    font-size: 1.12rem;
    font-weight: 800;
}

.btn-geo-primary {
    border: 0;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: #fff;
    font-weight: 700;
    box-shadow: 0 10px 18px rgba(15, 76, 129, 0.16);
}

.btn-geo-primary:hover,
.btn-geo-primary:focus {
    background: linear-gradient(135deg, #0b3b66, #13796f);
    color: #fff;
}

.btn-geo-outline,
.btn-geo-neutral {
    border-radius: var(--radius-sm);
    font-weight: 700;
}

.btn-geo-outline {
    border: 1px solid rgba(15, 76, 129, 0.22);
    background: rgba(255, 255, 255, 0.9);
    color: var(--color-primary);
}

.btn-geo-outline:hover,
.btn-geo-outline:focus {
    border-color: rgba(15, 76, 129, 0.42);
    background: rgba(15, 76, 129, 0.08);
    color: #0b3b66;
}

.btn-geo-neutral {
    border: 1px solid rgba(31, 41, 55, 0.1);
    background: rgba(255, 255, 255, 0.9);
    color: #334155;
}

.btn-geo-neutral:hover,
.btn-geo-neutral:focus {
    background: rgba(31, 41, 55, 0.08);
    color: #172033;
}

.filter-grid {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    gap: 1rem;
    align-items: end;
}

.form-label {
    margin-bottom: 0.5rem;
    color: #304653;
    font-weight: 700;
}

.form-select,
.form-control,
.input-group-text {
    min-height: 50px;
    border-color: var(--color-border);
    border-radius: 14px;
}

.input-group-text {
    border-right: 0;
    background: #fff;
    color: #53707c;
    padding-left: 1rem;
}

.search-input {
    border-left: 0;
    padding-left: 0;
}

.form-select:focus,
.form-control:focus {
    border-color: rgba(27, 153, 139, 0.62);
    box-shadow: 0 0 0 0.2rem rgba(27, 153, 139, 0.14);
}

.az-heading {
    margin: 0 0 0.65rem;
    color: #304653;
    font-size: 0.95rem;
    font-weight: 800;
}

.alpha-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.alpha-btn,
.az-nav-btn {
    min-width: 42px;
    height: 42px;
    border: 1px solid rgba(15, 76, 129, 0.14);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.96);
    color: #35505c;
    font-weight: 800;
    transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.alpha-btn:hover,
.alpha-btn:focus,
.az-nav-btn:hover,
.az-nav-btn:focus {
    transform: translateY(-1px);
    border-color: rgba(27, 153, 139, 0.46);
    background: rgba(27, 153, 139, 0.1);
    color: #0a5f56;
}

.alpha-btn.btn-dark,
.az-nav-btn.active {
    border-color: transparent;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: #fff;
    box-shadow: 0 10px 18px rgba(15, 76, 129, 0.16);
}

.all-btn {
    min-width: 58px;
}

.table-wrap {
    overflow: hidden;
}

.table-geo {
    margin-bottom: 0;
}

.table-geo thead th {
    padding: 1rem;
    border-bottom: 1px solid #dde6e9;
    background: #f5f8f9;
    color: #49626d;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.table-geo tbody td {
    padding: 1rem;
    border-color: #edf2f4;
    vertical-align: middle;
}

.table-geo tbody tr:hover {
    background: rgba(27, 153, 139, 0.05);
}

.term-name {
    color: var(--color-text);
    font-weight: 800;
}

.badge-geo {
    border-radius: 999px;
    background: rgba(27, 153, 139, 0.12);
    color: #0a5f56;
    padding: 0.5rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 800;
}

.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
}

.empty-state-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 1rem;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(15, 76, 129, 0.12), rgba(27, 153, 139, 0.13));
    color: var(--color-secondary);
    font-size: 1.8rem;
}

.empty-state h3 {
    margin-bottom: 0.45rem;
    color: var(--color-text);
    font-size: 1.1rem;
    font-weight: 800;
}

.empty-state p {
    max-width: 620px;
    margin: 0 auto;
    color: var(--color-muted);
}

.empty-state-compact {
    padding: 2.5rem 1.5rem;
}

.results-meta {
    color: #55707d;
    font-size: 0.92rem;
    font-weight: 700;
}

.pagination-shell {
    display: flex;
    justify-content: center;
}

.pagination-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.page-btn {
    min-width: 42px;
    height: 42px;
    border: 1px solid rgba(15, 76, 129, 0.14);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.96);
    color: #35505c;
    font-weight: 800;
}

.page-btn:hover,
.page-btn:focus {
    border-color: rgba(27, 153, 139, 0.46);
    background: rgba(27, 153, 139, 0.1);
    color: #0a5f56;
}

.page-btn.active {
    border-color: transparent;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: #fff;
    box-shadow: 0 10px 18px rgba(15, 76, 129, 0.16);
}

.page-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.live-results {
    overflow: hidden;
    border: 1px solid rgba(191, 209, 227, 0.8);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.live-results .list-group-item {
    padding: 1rem 1.1rem;
    border-color: #edf2f4;
}

.site-footer {
    margin-top: 1rem;
    border-top: 1px solid rgba(191, 209, 227, 0.8);
    background: rgba(255, 255, 255, 0.78);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
    color: var(--color-muted);
    font-size: 0.92rem;
}

.footer-inner a {
    color: var(--color-primary);
    font-weight: 800;
    text-decoration: none;
}

.footer-inner a:hover {
    text-decoration: underline;
}

.nav-actions {
    margin-bottom: 1.25rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-grid {
    display: grid;
    gap: 1rem;
}

.detail-card {
    padding: 1.25rem;
}

.detail-card h2 {
    margin-bottom: 0.8rem;
    color: var(--color-text);
    font-size: 1.02rem;
    font-weight: 800;
}

.detail-card p:last-child {
    margin-bottom: 0;
}

.az-section {
    display: none;
}

.az-section.active {
    display: block;
}

.az-letter-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.az-letter-badge {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(15, 76, 129, 0.12), rgba(27, 153, 139, 0.13));
    color: var(--color-secondary);
    font-size: 1.35rem;
    font-weight: 800;
}

.term-list-item {
    padding: 1rem 1.1rem;
    border-color: #edf2f4;
}

.term-list-item:hover {
    background: rgba(27, 153, 139, 0.05);
}

@media (max-width: 991.98px) {
    .header-inner {
        grid-template-columns: 1fr auto;
        gap: 0.8rem;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .product-heading {
        grid-column: 1 / -1;
        grid-row: 2;
        text-align: left;
    }

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

    .intro-panel {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 575.98px) {
    .app-shell {
        padding-top: 1.25rem;
    }

    .brand-text {
        font-size: 19px;
    }

    .brand img {
        width: 36px;
        height: 36px;
        border-radius: 12px;
    }

    .product-heading h1 {
        font-size: 1.14rem;
    }

    .product-heading .product-title {
        font-size: 1.14rem;
    }

    .product-heading p {
        font-size: 0.82rem;
    }

    .tools-menu-list {
        right: 0;
    }

    .intro-panel,
    .term-title-card,
    .section-card,
    .detail-card {
        padding: 1rem;
    }

    .intro-panel h2 {
        font-size: 1.16rem;
    }

    .table-geo thead th,
    .table-geo tbody td {
        padding: 0.85rem 0.75rem;
    }

    .footer-inner {
        text-align: center;
    }

    .term-title-card {
        flex-direction: column;
    }
}
