/* 1. Use a more-intuitive box-sizing model */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 2. Remove default margin */
*:not(dialog) {
  margin: 0;
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  /* 4. Add accessible line-height */
  line-height: 1.5;
  /* 5. Improve text rendering */
  -webkit-font-smoothing: antialiased;
}

/* 6. Improve media defaults */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/* 7. Inherit fonts for form controls */
input, button, textarea, select {
  font: inherit;
}

/* 8. Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* 9. Improve line wrapping */
p {
  text-wrap: pretty;
}
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

/*
  10. Create a root stacking context
*/
#root, #__next {
  isolation: isolate;
}



/* ----------------------------------- */


:root {
    --nav-bg:     #1d3045;
    --nav-hover:  #28415e;
    --nav-border: rgba(255, 255, 255, 0.09);
    --accent:     #4f8ef7;
    --bg:         #f7f8fa;
    --surface:    #ffffff;
    --border:     #e4e8f0;
    --text:       #111827;
    --muted:      #6b7280;
    --radius:     0.375rem;
    --font:       'Plus Jakarta Sans', sans-serif;
}



body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;

}

main {
    flex: 1;
}

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

.container {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 0.5rem;
}



/* ----------------------------------- */


.site-header {
    background: var(--nav-bg);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1rem 0.75rem rgba(0, 0, 0, 0.2);
}

.header-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 3rem;
}

.header-search {
    margin-left: auto;
    max-width: 15rem;
    min-width: 6rem;
}

.header-search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 1rem;
    color: #fff;
    font-family: var(--font);
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    outline: none;
    transition: background 0.15s, border-color 0.15;
}

.header-search input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.header-search input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #93c5fd;
}



.logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    flex-shrink: 0;
    white-space: nowrap;
}


.logo span {
    color: #93c5fd;
}

/* ----------------------------------- */



.site-footer {
    background: var(--nav-bg);
    padding: 1.2rem 0;
    border-top: 1px solid var(--nav-border);
}

.footer-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.footer-left p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);

}


.footer-left p a {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: underline;
    text-underline-offset: 0.1rem;    
}


.footer-left p a:hover {
    color: #93c5fd;    
}

.footer-logo {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}


.footer-logo span {
    color: #93c5fd;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    transition: background 0.15s, border-color 0.15;

}


.footer-btn:hover {
    background: var(--nav-hover);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
}


.footer-btn svg {
    width: 0.8rem;
    height: 0.8rem;
    flex-shrink: 0;
}




/* ----------------------------------- */


#HeaderContinents {
    overflow: hidden;
    max-height: 40px;
    opacity: 1;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

#HeaderContinents.show-continents-header {
    max-height: 0;
    opacity: 0;
}

.header-continents {
    border-top: 1px solid var(--nav-border);

}


.continent-row {
    display: flex;
    align-items: center;
    gap: 0.1rem;
    height: 2rem;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.continent-row::-webkit-scrollbar{
    display: none;
}

.continent {
    position: relative;
    flex-shrink: 0;
}


.continent-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}

.continent-btn:hover,
.continent-btn.active {
    background: var(--nav-hover);
    color: #fff;
}

.continent-menu {
    display: none;
    position: fixed;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 0.5rem 1.75rem rgba(0, 0, 0, 0.13);
    z-index: 300;
    width: 20rem;
    padding: 0.6rem;
}

.continent-menu.open {
    display: block;
}

.continent-name {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    padding: 0.12rem 0.37rem 0.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.37rem;
}

.continent-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.15rem;
}

.continent-list a {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.2rem 0.32rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
    transition: background 0.12s;
    min-width: 0;
    overflow: hidden;
}

.continent-list a:hover {
    background: var(--bg);
}

.continent-list span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.continent-list img {
    width: 1.2rem;
    height: 0.8rem;
    object-fit: cover;
    border-radius: 0.12rem;
    border: 1px solid var(--border);
    flex-shrink: 0;
}



/* ----------------------------------- */

.home-title {
    margin-bottom: 2rem;
    margin-top: 3rem;
}

.home-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.home-title p {
    font-size: 0.9rem;
    color: var(--muted);
}



.continent-section {
    margin-bottom: 3rem;
}

.continent-heading {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.continent-heading span {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    white-space: nowrap;
}

.continent-heading::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}



.countries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}


.country-grid {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0.7rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    transition: border-color 0.15s, boxshadow 0.15s;
    min-width: 0;
    overflow: hidden;
    gap: 0.5rem;
}

.country-grid img {
    width: 2rem;
    height: 1.5rem;
    object-fit: cover;
    border-radius: 0.2rem;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.country-grid .country-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}



/* ----------------------------------- */

.location-page {
    margin-top: 3rem;
    margin-bottom: 3rem;
    display: grid;
    grid-template-columns: 1fr 21rem;
    gap: 3rem;
    align-items: start;
}


.location-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.country-flag {
    width: 3rem;
    height: 2rem;
    object-fit: cover;
    border-radius: 0.25rem;
    border: 1px solid var(--border);
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.location-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.country-intro {
    font-size: 0.9rem;
    color:  var(--muted);
    max-width: 40rem;
    line-height: 1.6;
}

.location-states {
    margin-top: 3rem;
}

.location-states h2{
    margin-bottom: 0.6rem;
}

.state-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.state-grid .state {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s, color 0.15s;
}

.state-grid .state:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.08);
    color: var(--accent);
}

.state-grid .state svg {
    width: 0.75rem;
    height: 0.75rem;
    opacity: 0.4;
    flex-shrink: 0;
    transition: opcatity 0.15s;

}


.state-grid .state:hover svg {
    opacity: 0.8;

}




.postcodes-no-state {
    margin-top: 2.5rem;
}

.postcodes-no-state h2 {
    margin-bottom: 0.6rem;
}


.az-group {
    margin-bottom: 2rem;
}

.az-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}


.az-letter {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--surface);
    background: var(--nav-bg);
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    flex-shrink: 0;
}

.az-divider {
    flex: 1;
    height: 1px;
    background: var(--border);
}


.places-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.place-row {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    font-size: 0.8rem;
    line-height: 1.5;
}

.place-row:nth-child(3n) {
    border-right: none;
}

.place-row:nth-last-child(-n+3) {
    border-bottom: none;
}


.place-name {
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: break-word;
}


.place-postcodes {
    color: var(--muted);
    word-break: break-word;
}

.place-postcodes a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.8;
}

.place-postcodes a:hover {
    color: var(--accent);
    text-decoration: underline;
}




.map-location {
    margin-top: 2rem;
    margin-bottom: 2rem;

}


.map-container {
    height: 20rem;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.8rem;
    gap: 0.5rem;
}


.map-container svg {
    width: 1.2rem;
    height: 1.2rem;
    opacity: 0.4;
}


.location-sidebar {
    position: sticky;
    top: 7rem;
}

.location-sidebar-inner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;

}

.location-sidebar-inner .sidebar-heading {
    padding: 0.8rem 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.location-sidebar-inner .stat-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}
.location-sidebar-inner .stat-row:last-child {
    border-bottom: none;
}

.location-sidebar-inner .stat-label {
    font-size: 0.8rem;
    color: var(--muted);
    flex-shrink: 0;
}

.location-sidebar-inner .stat-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    text-align: right;
}


@media (max-width: 768px) {
    .location-page {
        grid-template-columns: 1fr;
    }

    .location-sidebar {
        position: static;
    }

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

@media (max-width: 576px) {
    .places-grid {
        grid-template-columns: 1fr;
    }

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

    .location-header h1 { font-size: 1.4rem; }
}


/* ----------------------------------- */

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.3rem;
    margin-bottom: 1.2rem;
}

.breadcrumbs a {
    color: var(--muted);
    transition: color 0.15s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.breadcrumbs a:hover {
    color: var(--accent);
}

.breadcrumbs a svg {
    width: 0.85rem;
    height: 0.85rem;
    flex-shrink: 0;
    color: var(--text);
}

.breadcrumbs-sep svg {
    width: 0.55rem;
    height: 0.55rem;
    flex-shrink: 0;
    color: var(--muted);
}

.breadcrumbs-current {
    color: var(--text);
    font-weight: 500;
}





/* ----------------------------------- */

.postcode-page {
    margin-top: 3rem;
    display: grid;
    grid-template-columns: 1fr 21rem;
    gap: 3rem;
    align-items: start;
}


.postcode-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.postcode-country-flag {
    width: 3rem;
    height: 2rem;
    object-fit: cover;
    border-radius: 0.25rem;
    border: 1px solid var(--border);
    flex-shrink: 0;
    margin-top: 0.35rem;
}

.postcode-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em; 
    color: var(--text);
    line-height: 1.2;
}
.postcode-header h1 span {
    color: var(--accent);
}


.postcode-header .postcode-intro {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.65;
    margin-bottom: 2rem;
}

.postcode-header .postcode-intro strong {
    color: var(--text);
}

.postcode-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 2rem;
    padding: 0.15rem 0.6rem;
    cursor: pointer;
    transition: all 0.15s;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.postcode-copy-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.postcode-copy-btn svg {
    width: 0.7rem;
    height: 0.7rem;
}


.section-block {
    margin-bottom: 2.5rem;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
    margin-bottom: 0.87rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}


.section-title-count {    
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 2rem;
    padding: 0.1rem 0.55rem;
}










.muni-table {
    width: 100%;
    border: 1px solid var(--border);
    border-radius:  var(--radius);
    overflow: hidden;
    background: var(--surface);
    border-collapse: collapse;
    font-size: 0.85rem;
}

.muni-table thead {
    background: var(--bg);
    border-bottom: 2px solid var(--border);

}

.muni-table th {
    padding: 0.625rem 1rem; 
    font-size: 0.72rem; 
    font-weight: 700;
    text-transform: uppercase; 
    letter-spacing: 0.07em; 
    color: var(--muted);
    text-align: left; 
    white-space: nowrap;
}

.muni-table th.align-right { 
    text-align: right;
}

.muni-table td { 
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

.muni-table td.align-right { 
    text-align: right;
    font-size: 0.82rem;
}

.muni-table tr:last-child td { 
    border-bottom: none;

}
.muni-table tbody tr:hover td { 
    background: var(--bg);
}

.muni-name { 
    font-weight: 500;
    color: var(--text);
}

.muni-path {
    display: flex;
    align-items: center;    
    gap: 0.2rem;
    font-size: 0.73rem;
    color: var(--muted);
    font-weight: 400;
    margin-top: 0.15rem;    
}

.muni-path svg {
    width: 0.5rem;
    height: 0.5rem;
    opacity: 0.4;
    flex-shrink: 0;
    transition: opcatity 0.15s;

}

.muni-path a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.pop-bar-wrap { 
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
}

.pop-bar { 
    width: 4rem;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.pop-bar-fill { 
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    opacity: 0.65;
}

.no-data { 
    color: var(--border);
}

.coord-text {
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 1px dashed var(--border);
    transition: color 0.15s, border-color 0.15s;
}
.coord-text:hover { 
    color: var(--accent);
    border-color: var(--accent);
}

.coord-copied {
    color: var(--accent) !important;
    border-color: transparent !important;
}

.pop-info {
    position:relative;
    display:inline-flex;
    align-items:center;
    gap:0.3rem;
    cursor:default;
}

.pop-info-icon {
    width: 0.8rem;
    height: 0.8rem;
    color: var(--muted);
    opacity: 0.4;
    flex-shrink: 0;
}








.postcode-page .map-container {
    height: 24rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    z-index: 0;
}








.postcode-page .sidebar {
    position: sticky;
    top: 7rem;
}

.postcode-page .sidebar-inner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1rem;
}


.postcode-page .sidebar-inner .sidebar-heading {
    padding: 0.8rem 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.postcode-page .sidebar-inner .stat-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
}

.postcode-page .sidebar-inner .stat-row:last-child {
    border-bottom: none;
}

.postcode-page .sidebar-inner .stat-label {
    font-size: 0.8rem;
    color: var(--muted);
    flex-shrink: 0;
}

.postcode-page .sidebar-inner .stat-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    text-align: right;
}

.postcode-page .sidebar-inner .stat-value.muted {
    font-weight: 400;
    color: var(--muted);
}






.postcode-page .nearby-label {
    font-weight:400;
    text-transform:none;
    letter-spacing:0;
    opacity:0.6;
    padding-left: 1rem;
}

.nearby-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: 0.5rem;
}

.nearby-grid .nearby-atag {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    text-decoration: none;
}

.nearby-grid .nearby-atag:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--bg);
}


.nearby-grid .nearby-atag:hover .nearby-place {
    color: var(--accent);
    opacity: 0.8;
}


.nearby-grid .nearby-postcode {
    font-weight: 600;
}

.nearby-grid .nearby-place {
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.nearby-filter {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.nearby-filter input {
    flex: 1;
    min-width: 8rem;
    max-width: 14rem;
    font-size: 0.8rem;
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s;
}



.nearby-filter input:focus {
    border-color: var(--accent);
}

.nearby-filter input::placeholder {
    color: var(--muted);
}

.nearby-count {
    font-size: 0.75rem;
    color: var(--muted);
    display: flex;
    align-items: center;
}

.nearby-atag[data-hidden="true"] {
    display: none;
}


.nearby-more-btn {
    margin-top: 0.65rem;
    font-size: 0.8rem;
    color: var(--accent);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}


.nearby-no-results {
    font-size: 0.8rem;
    color: var(--muted);
    padding: 0.5rem 0;
    display: none;
}











@media (max-width: 768px) {
    .postcode-page {
        grid-template-columns: 1fr;
    }

    .postcode-page .sidebar {
        position: static;
    }
    .hide-md {
        display: none;
    }

}

@media (max-width: 576px) {
    .postcode-header h1 {
        font-size: 1.4rem;
    }
    .hide-sm {
        display: none;
    }

}









.admin-hierarchy {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-hierarchy li {
    --indent: calc(1rem + var(--depth) * 1rem);

    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem 0.6rem var(--indent);
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
    position: relative;
}

.admin-hierarchy li:last-child {
    border-bottom: none;
}


.admin-hierarchy li::before {
    content: "";
    position: absolute;
    top: 50%;
    left: calc(var(--indent) - 0.8rem);
    width: 0.6rem;
    height: 1px;
    background: var(--border);
}

.admin-hierarchy li::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(var(--indent) - 0.8rem);
    width: 1px;
    background: var(--border);
}

.admin-hierarchy li.postcode::after {
    bottom: 50%;
}

.admin-hierarchy li[style*="--depth: 0"]::before,
.admin-hierarchy li[style*="--depth: 0"]::after {
    display: none;
}

.admin-hierarchy .admin-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.2rem;
    padding: 0.1rem 0.35rem;
    flex-shrink: 0;
    white-space: nowrap;

}


.admin-hierarchy .admin-label.postcode {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    opacity: 0.9;
}

.admin-hierarchy a {
    color: var(--text);
    font-weight: 500;
    transition: color 0.15s;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-hierarchy a:hover {
    color: var(--accent);
}

.admin-hierarchy .postcode {
    color: var(--accent);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}








/* ----------------------------------- */


.search-page {
    max-width: 900px;
    margin: 2.5rem auto;
    padding: 0 0.5rem;
}

.search-hero {
    text-align: center;
    margin-bottom: 2.5rem;
}

.search-hero h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 0.3rem;
}


.search-hero p {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 1.2rem;
}

.search-form {
    display: flex;
    gap: 0;
    max-width: 540px;
    margin: 0 auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;

}

.search-form:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.1);
}

.search-form-icon {
    display: flex;
    align-items: center;
    padding: 0 0.75rem 0 1rem;
    color: var(--muted);
    flex-shrink: 0;
}

.search-form-icon svg {
    width: 1rem;
    height: 1rem;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.95rem;
    color: var(--text);
    background: transparent;
    padding: 0.75rem 0;
}

.search-input::placeholder {
    color: var(--muted);
}

.search-submit {
    padding: 0 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--accent);
    color: #fff;
    border: none;
    border-left:  1px solid var(--border);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

.search-submit:hover {
    opacity: 0.85;
}







.search-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 4rem 2rem;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.search-state svg {
    width: 2rem;
    height: 2rem;
    opacity: 0.3;
    margin-bottom: 0.3rem;
}

.search-state strong {
    color: var(--text);
    font-size: 0.95rem;
}








.search-page .results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);

}

.search-page .results-header-label {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
}

.search-page .results-header-count {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 2rem;
    padding: 0.1rem 0.6rem;
}



.search-page .results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 0.6rem;
}


.search-page .result-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.search-page .result-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.08);
    background: var(--bg);
}



.search-page .result-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}


.search-page .result-card-top .result-code {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--accent);
}

.search-page .result-card-top .result-country-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.2rem;
    padding: 0.1rem 0.35rem;
    flex-shrink: 0;
}


.search-page .result-place {
    font-size: 0.8.5rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.3rem;
}



.search-page .result-location {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
    line-height: 1.4;
    white-space: normal;
    letter-spacing: 0.01em;
    word-spacing: 0.05rem;
}




.search-page .result-coords {
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.search-page .result-coords svg {
    width: 0.7rem;
    height: 0.7rem;
    opacity: 0.4;
    flex-shrink: 0;
}

















/* ----------------------------------- */

.interactive-map-container {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.interactive-map-container .interactive-map-header {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
    margin-bottom: 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}


.interactive-map-container .interactive-map-hint {
    font-size: 0.7rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--muted);
}





#interactiveLocationMap {
    height: 22rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    z-index: 0;
    background: var(--surface);
    cursor: crosshair;    
}


.interactive-map-popup .leaflet-popup-content-wrapper {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    padding: 0;
    overflow: hidden;
}


.interactive-map-popup .leaflet-popup-content {
    margin: 0;
    min-width: 10rem;
}

.interactive-map-popup .leaflet-popup-tip-container {
    margin-top: -1px;
}




.interactive-map-popup .interactive-map-popup-inner {
    padding: 0.75rem 1rem;
}

.interactive-map-popup .interactive-map-popup-code {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.interactive-map-popup .interactive-map-popup-place {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.15rem;
    margin-bottom: 0.6rem;
}


.interactive-map-popup .interactive-map-popup-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    padding: 0.35rem 0.7rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: background 0.15s, border-color 0.15s;
}
.interactive-map-popup .interactive-map-popup-link:hover {
    background: var(--border);
    border-color: var(--accent);
}

.interactive-map-popup .interactive-map-popup-link svg {
    width: 0.7rem;
    height: 0.7rem;
    flex-shrink: 0;
}




.interactive-map-popup .interactive-map-popup-loading {
    font-size: 0.8rem;
    color: var(--muted);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}


.interactive-map-popup .interactive-map-popup-loading::before {
    content: '';
    width: 0.75rem;
    height: 0.75rem;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    flex-shrink: 0;
    animation: spin 0.6s linear infinite
}
@keyframes spin { to {transform: rotate(360deg);}}


.interactive-map-popup .interactive-map-popup-error {
    font-size: 0.8rem;
    color: var(--muted);
    padding: 0.75rem 1rem;
    font-style: italic;
}












/* ----------------------------------- */


main:has(.error-page) {
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
    width: 100%;
    overflow: hidden;
    max-width: none;
}


.error-page {
    flex: 1;
    position: relative;
    overflow: hidden;    
}

.error-page .interactive-map-container {
    position: absolute;
    inset: 0;
    margin: 0;
}


.error-page .interactive-map-container .interactive-map-header{
    display: none;
}

.error-page #interactiveLocationMap {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
}




.error-page .error-card {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    width: min(360px, calc(100vw - 3rem));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    padding: 1.5rem 1.75rem;
}

.error-page .error-card-code {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    background: rgba(79, 142, 247, 0.08);
    border: 1px solid rgba(79, 142, 247, 0.2) ;
    border-radius: 2rem;
    padding: 0.15rem 0.6rem;
    margin-bottom: 0.75rem;
}


.error-page .error-title {
    font-size:  1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.error-page .error-message {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}



.error-page .error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.error-page .error-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.15s, background 0.15s, border-color 0.15s, color 0.15s;

}


.error-page .error-btn svg {
    width: 0.85rem;
    height: 0.85rem;
    flex-shrink: 0;
}

.error-page .error-btn-primary svg {
    transform: translateY(2px);
}

.error-page .error-btn-primary {
    background: var(--accent);
    color: #fff;
    border: 1px solid transparent;
}

.error-page .error-btn-primary:hover {
    opacity: 0.85;
}

.error-page .error-btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}


.error-page .error-btn-secondary:hover {
    background: var(--bg);
    border-color: var(--accent);
    color:  var(--accent);
}


.error-page .error-map-hint {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 1000;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    padding: 0.4rem 0.7rem;
    font-size: 0.7rem;
    color: var(--muted);
    display: flex;
    gap: 0.35rem;
    align-items: center;
    max-width: min(220px, calc(100vw -3rem));
}


.error-page .error-map-hint::before {
    content: '';
    display: block;
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    animation: hint-pulse 2s ease-in-out infinite;
}

@keyframes hint-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(0.75);
    }
}




@media (max-width: 576px) {
    .error-page .error-card {
        top: 0.8rem;
        right: 0.8rem;
        left: auto;
        width: min(300px, calc(100vw - 1.5rem));
        padding: 0.8rem 0.8rem;
    }

}