/*
File: index.css
*/

:root {
    --bg-color: #f7f4ed;
    --panel-bg: #ffffff;
    --border-color: #dddddd;
    --text-color: #333333;
    --hover-bg: #eef2f5;
    --topic-accent: #0078d7;
    --curtain-footer-tint: color-mix(in srgb, var(--topic-accent) 74%, #000 26%);
    --banner-gap: 16px;
    --banner-side-gap: 16px;
}

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

body {
    margin: 0; padding: 0; font-family: 'PeydaFaNumWeb', Tahoma, sans-serif !important;
    display: flex; flex-direction: column; height: 100vh; height: var(--vvh, 100dvh);
    background-color: var(--bg-color); color: var(--text-color); overflow: hidden;
}

/* Requirement 1: Map lives behind the banner natively */
#main-content { 
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
    overflow: hidden; 
    position: relative;
    margin-top: 0;
    gap: 12px;
    padding: calc(var(--banner-gap) + 75px + 12px) 16px 16px;
    box-sizing: border-box;
    background-color: #f7f4ed;
}

#atlas-stage {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: row-reverse;
    align-items: stretch;
    gap: 12px;
}

#map-frame {
    position: relative;
    /* Keep SDK branding and controls below the curtain, within the map frame. */
    isolation: isolate;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(27, 36, 46, 0.08);
}

#top-banner {
    position: absolute;
    top: var(--banner-gap);
    left: var(--banner-side-gap);
    right: var(--banner-side-gap);
    width: calc(100% - 2 * var(--banner-side-gap));
    margin: 0;
    height: 75px;
    flex-shrink: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    color: #515811;
    z-index: 2000;
    box-shadow: none;
    transition: top 0.9s cubic-bezier(0.22, 1, 0.36, 1), left 0.9s cubic-bezier(0.22, 1, 0.36, 1), right 0.9s cubic-bezier(0.22, 1, 0.36, 1), width 0.9s cubic-bezier(0.22, 1, 0.36, 1), border-radius 0.9s cubic-bezier(0.22, 1, 0.36, 1), background 0.6s ease;
    border-radius: 12px;
}

#top-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: #ffffff;
    z-index: -1;
    box-shadow: 0 4px 18px rgba(81, 88, 17, 0.08);
    transition: background 0.6s ease, box-shadow 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

#top-banner .project-main,
#top-banner .project-sub {
    color: #515811;
}

#top-banner .banner-divider {
    width: 2px;
    height: 42px;
    background: #a18447;
    margin: 0 14px;
}

#entry-view-curtain {
    position: absolute; top: 0; left: 0; width: 100%; height: 100vh; height: var(--vvh, 100dvh);
    background-color: #e8d9b8;
    z-index: 1500;
    transform: translate3d(0, 0, 0);
    will-change: transform;
    backface-visibility: hidden;
    transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
    overflow: hidden;
    padding: 0; border-radius: 0;
    --curtain-banner-h: 75px;
    --curtain-dock-h: 96px;
}

#entry-view-curtain::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-color: #e8d9b8;
    background-image: var(--curtain-image);
    background-size: cover;
    background-position: var(--curtain-position, center center);
    background-repeat: no-repeat;
    pointer-events: none;
}

html.atlas-view .entry-launch,
html.atlas-view .entry-dock {
    view-transition-name: none;
}

html.atlas-view #entry-view-curtain,
#entry-view-curtain.curtain-up { 
    transform: translate3d(0, -100%, 0);
    pointer-events: none;
    /* This timing is used when the curtain comes back down. */
    transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
    transition-duration: 0.9s;
}

html.curtain-auth #entry-view-curtain,
html.curtain-auth #entry-view-curtain.curtain-up {
    transform: none !important;
    pointer-events: auto !important;
    transition: none !important;
}
html.curtain-auth #main-content,
html.curtain-auth .page-nav {
    visibility: hidden;
    pointer-events: none;
}

.entry-scroll {
    position: absolute;
    top: var(--curtain-banner-h, 75px);
    right: 0;
    bottom: var(--curtain-dock-h, 64px);
    left: 0;
    z-index: 2;
    width: 100%;
    margin-top: 0;
    color: #2a2550;
    pointer-events: auto;
    overflow: hidden;
    overscroll-behavior: none;
    transition: bottom 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
html:not(.atlas-view) #top-banner .top-nav {
    display: none;
}

.entry-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--curtain-dock-h, 96px);
    z-index: 1600;
    display: flex;
    align-items: stretch;
    background: transparent;
    pointer-events: auto;
    padding: 0 12px env(safe-area-inset-bottom, 0px);
    overflow: visible;
    view-transition-name: entry-dock;
}

.entry-dock::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 220px;
    background: linear-gradient(to top, #a18447 0%, rgba(161, 132, 71, 0.82) 28%, rgba(161, 132, 71, 0.4) 62%, transparent 100%);
    pointer-events: none;
    z-index: -1;
}

.entry-dock-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0;
    padding: 8px 12px;
    border: 0;
    background: transparent;
    color: #ffffff;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.entry-dock-item + .entry-dock-item {
    border-inline-start: 1px solid #ffffff;
}

.entry-dock-item.is-current {
    color: #ffffff;
}

.entry-dock-item:hover {
    background: #515811;
    color: #ffffff;
}

span.entry-dock-item {
    cursor: default;
}

.entry-dock-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: right;
    line-height: 1.35;
}

.entry-dock-title {
    font-size: 1rem;
    font-weight: 700;
}

.entry-dock-sub {
    font-size: 0.72rem;
    font-weight: 400;
    opacity: 0.92;
}

.entry-dock-icon {
    width: 38px;
    height: 38px;
    object-fit: contain;
    flex-shrink: 0;
}

.entry-hero {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px 40px;
    box-sizing: border-box;
    pointer-events: none;
    text-align: center;
}
.entry-hero-stack {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: relative;
    right: auto;
    width: min(420px, calc(100% - 40px));
    transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.entry-launch {
    width: 100%;
    box-sizing: border-box;
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    background: rgba(232, 217, 185, 0.38);
    backdrop-filter: blur(18px) saturate(1.15);
    -webkit-backdrop-filter: blur(18px) saturate(1.15);
    border: none;
    border-radius: 28px;
    padding: 16px;
    box-shadow: 0 12px 32px rgba(81, 88, 17, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.55);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: padding 0.55s cubic-bezier(0.22, 1, 0.36, 1), border-radius 0.55s ease, min-height 0.65s cubic-bezier(0.22, 1, 0.36, 1), gap 0.55s ease, background 0.55s ease, border-color 0.55s ease;
    view-transition-name: account-card;
}
.entry-launch-home {
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.entry-auth-stage {
    display: none;
    opacity: 0;
    transform: scale(0.96);
}
.entry-auth-stage .register-card {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    width: 100%;
    text-align: center;
    position: relative;
}
.entry-auth-stage .register-card[hidden] { display: none; }

.entry-dock.is-away,
html.curtain-auth .entry-dock,
html.curtain-to-profile .entry-dock,
html.atlas-view .entry-dock,
#entry-view-curtain.curtain-up ~ .entry-dock {
    transform: translate3d(0, 120%, 0);
    pointer-events: none;
    opacity: 0;
}
html.curtain-auth .entry-dock::before,
html.curtain-to-profile .entry-dock::before { opacity: 0; }
.entry-dock,
.entry-dock::before {
    transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease;
}

html.curtain-auth .entry-launch {
    padding: 28px 26px 24px;
    gap: 0;
}
html.curtain-auth .entry-hero-stack {
    width: min(26rem, calc(100% - 40px));
}
html.curtain-auth-wide .entry-hero-stack {
    width: min(34rem, calc(100% - 40px));
}
html.curtain-auth .entry-launch-home {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(0.94);
    pointer-events: none;
    visibility: hidden;
}
html.curtain-auth .entry-auth-stage {
    display: block;
    opacity: 1;
    transform: none;
    animation: auth-stage-in 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
html.curtain-auth .entry-auth-stage.is-swap {
    opacity: 0;
    transform: translateY(10px);
    animation: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

html.curtain-to-profile .entry-scroll {
    bottom: 0;
}
html.curtain-to-profile .entry-hero-stack {
    width: min(28rem, calc(100% - 40px));
}
html.curtain-to-profile .entry-launch {
    padding: 28px 26px 24px;
    gap: 0;
    min-height: min(36rem, calc(var(--vvh, 100dvh) - 8rem));
    background: rgba(232, 217, 185, 0.18);
    backdrop-filter: blur(28px) saturate(1.4);
    -webkit-backdrop-filter: blur(28px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.38);
}
html.curtain-to-profile .entry-launch-home {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(0.94);
    pointer-events: none;
    visibility: hidden;
}
html.curtain-to-profile-instant .entry-dock,
html.curtain-to-profile-instant .entry-dock::before,
html.curtain-to-profile-instant .entry-scroll,
html.curtain-to-profile-instant .entry-hero-stack,
html.curtain-to-profile-instant .entry-launch,
html.curtain-to-profile-instant .entry-launch-home {
    transition: none !important;
    animation: none !important;
}
@keyframes auth-stage-in {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: none; }
}

.entry-auth-stage .register-kicker {
    margin: 0 0 4px;
    font-size: 1.05rem;
    font-weight: 500;
    color: #a18447;
}
.entry-auth-stage .register-card h1 {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 700;
    color: #515811;
}
.entry-auth-stage .register-lead {
    margin: 8px 0 0;
    font-size: 0.88rem;
    color: #a18447;
}
.entry-auth-stage form {
    margin-top: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.entry-auth-stage .register-pair {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.entry-auth-stage .register-pair .register-field {
    flex: 1 1 11rem;
    min-width: 0;
}
#auth-register .register-field {
    position: relative;
    display: block;
}
#auth-register .register-field > span {
    position: absolute;
    top: 26px;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #a18447;
    font-size: 0.95rem;
    font-weight: 500;
    pointer-events: none;
    white-space: nowrap;
    transition: top 0.28s cubic-bezier(0.22, 1, 0.36, 1),
                left 0.28s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
                font-size 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
#auth-register .register-field input:focus ~ span,
#auth-register .register-field input:not(:placeholder-shown) ~ span {
    left: calc(100% - 16px);
    transform: translate(-100%, -50%);
    font-size: 0.72rem;
    font-weight: 600;
}
#auth-register .register-field input {
    transition: padding 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
#auth-register .register-field input:focus,
#auth-register .register-field input:not(:placeholder-shown) {
    text-align: start;
    padding-inline-start: 8rem;
    padding-inline-end: 16px;
}
#auth-register .register-field input[dir="ltr"]:focus,
#auth-register .register-field input[dir="ltr"]:not(:placeholder-shown) {
    text-align: left;
    padding-inline-start: 16px;
    padding-inline-end: 8rem;
}
#auth-register .register-field input::placeholder {
    color: transparent;
}
.entry-auth-stage .register-field input {
    width: 100%;
    height: 52px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #515811;
    text-align: center;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 500;
}
.entry-auth-stage .register-field input::placeholder {
    color: #a18447;
    opacity: 0.9;
}
.entry-auth-stage .register-field input[readonly] {
    opacity: 0.85;
}
.entry-auth-stage .register-field input:focus-visible,
.entry-auth-stage .register-submit:focus-visible {
    outline: 2px solid #515811;
    outline-offset: 2px;
}
.entry-auth-stage .register-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 999px;
    background: #515811;
    color: #ffffff;
    font: inherit;
    font-size: 0.98rem;
    font-weight: 600;
    cursor: pointer;
}
.entry-auth-stage .register-submit:hover:not(:disabled) { background: #3f460d; }
.entry-auth-stage .register-submit:disabled { opacity: 0.55; cursor: not-allowed; }
.entry-auth-stage .register-hint {
    margin: 14px 0 0;
    text-align: center;
    font-size: 0.8rem;
    color: #a18447;
}
.entry-auth-stage .auth-back {
    border: 0;
    padding: 0;
    background: none;
    color: #a18447;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}
.entry-auth-stage .auth-back:hover { text-decoration: underline; }
.entry-auth-stage .auth-back-fab {
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #a18447;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}
.entry-auth-stage .register-error {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    font-style: normal;
    color: #b91c1c;
    text-align: center;
}
.entry-auth-stage .register-error[hidden] { display: none; }

.otp-sending {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 8.5rem;
    color: #515811;
    font-size: 0.95rem;
    font-weight: 600;
}
.otp-sending[hidden] { display: none; }
.otp-sending p { margin: 0; }
.otp-spinner {
    width: 38px;
    height: 38px;
    border: 3px solid rgba(81, 88, 17, 0.18);
    border-top-color: #515811;
    border-radius: 50%;
    animation: otp-spin 0.75s linear infinite;
}
@keyframes otp-spin {
    to { transform: rotate(360deg); }
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.entry-login-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 52px;
    padding: 0 52px 1px;
    border: 0;
    border-radius: 999px;
    background: #515811;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}
.entry-login-btn:hover { filter: brightness(0.96); }
.entry-login-btn[hidden] { display: none; }
.entry-login-btn:focus-visible,
.entry-ghost-btn:focus-visible {
    outline: 2px solid #515811;
    outline-offset: 2px;
}
.entry-login-arrow {
    position: absolute;
    inset-inline-start: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    color: #a18447;
    display: flex;
    align-items: center;
    justify-content: center;
}
.entry-launch-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.entry-ghost-btn {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 12px 1px;
    border-radius: 999px;
    background: #fff;
    color: #a18447;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: default;
}
a.entry-ghost-btn {
    cursor: pointer;
    text-decoration: none;
}
.entry-ghost-btn {
    border: 0;
    text-decoration: none;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.entry-ghost-btn:not([aria-disabled="true"]) { cursor: pointer; }
.entry-ghost-btn:not([aria-disabled="true"]):hover {
    transform: translateY(-2px);
    background: #515811;
    color: #ffffff;
    box-shadow: 0 8px 16px rgba(81, 88, 17, 0.2);
}
.entry-ghost-btn:not([aria-disabled="true"]):active { transform: translateY(0); }
.entry-contact-popover {
    display: grid;
    justify-items: center;
    gap: 12px;
    max-height: 0;
    margin-top: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: max-height 0.25s ease, margin-top 0.25s ease, opacity 0.2s ease, transform 0.25s ease;
}
.entry-contact-popover.is-open { max-height: 10rem; margin-top: 14px; opacity: 1; transform: translateY(0); }
.entry-contact-actions { display: flex; align-items: center; justify-content: center; gap: 10px; }
.entry-contact-icon {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(81, 88, 17, 0.16);
    border-radius: 50%;
    padding: 0;
    background: #ffffff;
    color: #515811;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(81, 88, 17, 0.1);
    transition: transform 0.18s ease, color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}
.entry-contact-icon:hover,
.entry-contact-icon:focus-visible,
.entry-contact-icon.is-selected { background: #515811; color: #ffffff; box-shadow: 0 7px 14px rgba(81, 88, 17, 0.2); }
.entry-contact-icon:hover { transform: translateY(-2px); }
.entry-contact-icon:focus-visible { outline: 2px solid #515811; outline-offset: 2px; }
.entry-contact-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.entry-contact-detail { min-height: 1.55rem; margin: 0; color: #515811; font-size: 0.78rem; font-weight: 600; line-height: 1.85; text-align: center; }
.entry-contact-detail a[href^="tel:"] { color: inherit; text-underline-offset: 3px; }
.entry-contact-detail:empty { display: none; }
.entry-contact-detail[dir="ltr"] { direction: ltr; unicode-bidi: plaintext; }
.entry-launch-split {
    flex: 0 0 1px;
    width: 1px;
    height: 22px;
    background: #515811;
    opacity: 0.55;
}
.entry-reveal {
    opacity: 0;
    transform: translate3d(0, 42px, 0);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}
.entry-reveal.is-inview {
    opacity: 1;
    transform: none;
}
.entry-reveal.is-leave {
    opacity: 0;
    transform: translate3d(0, -28px, 0);
}
.entry-contact p,
.entry-contact a {
    margin: 0 0 6px;
    color: rgba(255,255,255,0.92);
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.7;
}
.entry-contact{ pointer-events: auto; }

.lazy-bg { background-size: cover; background-position: center; background-repeat: no-repeat; }
.bg-placeholder { background-color: #f3f4f6; }

.leaflet-tile-pane {
    transition: opacity 2.2s ease, filter 2.2s ease;
    filter: none; opacity: 0.30;
}
path.leaflet-interactive { transform-box: fill-box; transform-origin: center center; transition: transform 2.2s cubic-bezier(0.25, 1, 0.5, 1), opacity 2.2s ease, fill-opacity 2.2s ease !important; }
path.leaflet-interactive,
path.leaflet-interactive:focus,
path.leaflet-interactive:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
}

#left-popup-panel, #map-legend, #right-panel { transition: all 0.5s ease; }

.leaflet-control-zoom { display: none !important; }

#right-panel { 
    display: none; 
    position: absolute;
    /* Sit below the floating banner (75px) and hanging nav buttons (~38px) */
    top: calc(var(--banner-gap) + 75px + 46px); 
    right: 0; 
    bottom: 0;
    width: 400px; 
    background: transparent; 
    z-index: 1000; 
    flex-direction: column; 
    gap: 10px; 
    pointer-events: none;
}

#right-panel.show-panel { 
    display: flex; 
    animation: fadeSlideIn 0.8s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; 
}

.right-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-left: 15px solid var(--topic-accent, #0078d7);
    border-radius: 16px;
    padding: 15px;
    box-shadow: -4px 4px 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 320px;
    pointer-events: auto;
}

.right-card-top { flex-shrink: 0; margin-top: 0; text-align: center; padding-bottom: 0; }
.right-card-bottom { flex-grow: 1; overflow-y: auto; overflow-x: hidden; padding-bottom: 20px; margin-bottom: 130px; }

.panel-title { font-size: 0.8rem; margin-top: 0; margin-bottom: 15px; text-align: center; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; width: 100%; font-weight: 700; color: var(--text-color); }
.instruction { font-size: 0.90rem; color: #666; text-align: center; margin-top: 30px; line-height: 1.5; }
#province-pick-hint { margin: auto; padding: 12px 16px; }
#province-pick-hint[hidden] { display: none; }
.index-kicker { margin-top: 0; font-size: 0.75rem; color: #666; font-weight: bold; }
.index-description-text { font-size: 0.70rem; line-height: 1.7; color: #444; text-align: justify; margin: 10px 0; padding: 10px; background: #f8fbff; border-radius: 8px; border: 1px solid #e0efff; }
.prov-head-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}
.prov-head-row h3 { margin: 0; color: #333; font-size: 0.75rem; font-weight: bold; }
.prov-pop-pill {
    display: inline-flex;
    align-items: center;
    background: #f4f7f6;
    border: 1px solid #c1d5e0;
    padding: 4px 10px;
    border-radius: 15px;
    color: #0078d7;
    font-size: 0.75rem;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.prov-pop-pill svg { width: 14px; height: 14px; margin-left: 4px; fill: #0078d7; }

@keyframes fadeSlideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }

#center-column { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; min-height: 0; position: relative; }
.atlas-page-nav { display: none; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; background: #e8f4fc; transition: background 2.2s; }

.leaflet-bottom.leaflet-right { margin-bottom: 25px !important; margin-right: 25px !important; z-index: 1001; }

/* Requirement 8: Move Map title behind icons */
.leaflet-control-attribution { z-index: 0 !important; pointer-events: none; }

.chart-switcher { display: flex; background: #f0f4f8; padding: 4px; border-radius: 8px; margin-bottom: 12px; flex-shrink: 0; }

#left-popup-panel { position: absolute; left: 0; top: calc(var(--banner-gap) + 75px + 46px); bottom: 200px; width: 280px; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(5px); border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.15); display: none; flex-direction: column; padding: 15px 10px; z-index: 1000; border: 1px solid var(--border-color); border-right: 15px solid var(--topic-accent, #0078d7); }
#left-popup-panel h3 { font-size: 0.95rem; text-align: center; margin: 0 0 15px 0; color: #333; }
#left-chart-container { position: relative; flex-grow: 1; margin: 10px 0; }
.left-chart-scale {
    position: absolute;
    inset: 12px 0;
}
#left-chart-container::before { content: ''; position: absolute; left: 50%; top: 12px; bottom: 12px; width: 2px; background: #ccc; transform: translateX(-50%); }

.y-tick { position: absolute; left: 50%; transform: translateX(-50%); width: 10px; height: 2px; background: #888; }
.y-tick span { position: absolute; left: 15px; top: -10px; font-size: 0.8rem; font-weight: bold; color: #555; }
#left-chart-markers { position: absolute; inset: 0; }

.topic-marker { position: absolute; transform: translateY(50%); display: flex; align-items: center; gap: 8px; transition: bottom 1.5s cubic-bezier(0.25, 1, 0.5, 1); }
.topic-marker:hover { z-index: 99999 !important; }
.topic-marker.left-side { right: 50%; flex-direction: row-reverse; margin-right: -8px; }
.topic-marker.right-side { left: 50%; flex-direction: row; margin-left: -8px; }
.topic-marker.right-side .topic-marker-content { flex-direction: row-reverse; }

.topic-marker-dot { width: 16px; height: 16px; border-radius: 50%; background: #0078d7; border: 2px solid #fff; box-shadow: 0 0 4px rgba(0,0,0,0.4); flex-shrink: 0; }
.topic-marker-content { display: flex; align-items: center; gap: 6px; background: #fff; padding: 3px 6px; border-radius: 20px; border: 1px solid #ddd; box-shadow: 0 2px 5px rgba(0,0,0,0.1); position: relative; cursor: pointer; }
.topic-marker-content img { width: 29px; height: 29px; border-radius: 50%; object-fit: cover; }
.topic-marker-content span { font-size: 0.85rem; font-weight: bold; color: #333; margin: 0 4px; }
.topic-marker-content::after { content: attr(data-topic-name); position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0, 0, 0, 0.85); color: #fff; padding: 5px 10px; border-radius: 6px; font-size: 0.85rem; font-weight: normal; white-space: nowrap; opacity: 0; visibility: hidden; transition: all 0.3s ease; box-shadow: 0 2px 8px rgba(0,0,0,0.2); pointer-events: none; z-index: 10000; }
.topic-marker.left-side .topic-marker-content::after, .topic-marker.right-side .topic-marker-content::after { left: 110%; right: auto; }
.topic-marker-content:hover::after { opacity: 1; visibility: visible; }

#map-legend {
    position: absolute; bottom: 145px; left: 50%; transform: translateX(-50%);
    padding: 4px 15px 8px 15px;
    z-index: 1000; display: flex; flex-direction: column; align-items: space-between;
}

/* Requirement 9: Center title */
.legend-title { font-size: 0.8rem; font-weight: 800; margin-bottom: 5px; color: #444; text-align: center; width: 100%; }
.legend-scale-wrapper { direction: ltr; width: 60vw; max-width: 600px; }
.legend-scale-bar { display: flex; flex-direction: row; height: 16px; width: 100%; overflow: visible; border: 1px solid #bbb; position: relative; }
.legend-segment { flex-grow: 1; height: 100%; cursor: pointer; transition: transform 0.2s, filter 0.2s; }
.legend-segment:hover { transform: scaleY(1.3); filter: brightness(1.2); }
.legend-labels { display: flex; flex-direction: row; justify-content: space-between; width: 100%; font-size: 0.8rem; font-weight: 700; color: #555; margin-top: 4px; padding: 0 2px; }

/* Requirement 10: Change line to circular score marker */
#score-pointer { 
    display: none; 
    position: absolute; 
    top: 50%; 
    transform: translate(-50%, -50%); 
    width: 26px; 
    height: 26px; 
    background: #fff; 
    border: 2px solid #222; 
    z-index: 10; 
    transition: left 0.4s ease-out; 
    border-radius: 50%; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.4); 
    align-items: center; 
    justify-content: center; 
}
#pointer-label { 
    position: static; 
    transform: none; 
    margin-top: 0; 
    background: transparent; 
    color: #222; 
    font-size: 11px; 
    padding: 0; 
    border-radius: 0; 
    font-weight: bold; 
}

#bottom-panel {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    height: 92px;
    flex: 0 0 92px;
    width: 100%;
    border-radius: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0 4px;
    background: transparent;
    box-shadow: none;
    z-index: 1;
}

.index-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: row;
    overflow: visible;
    flex-grow: 1;
    align-items: center;
    height: 100%;
    width: 100%;
    justify-content: center;
    gap: 16px;
}
.index-list::-webkit-scrollbar { height: 8px; }
.index-list::-webkit-scrollbar-track { background: transparent; }
.index-list::-webkit-scrollbar-thumb { background: #bbb; border-radius: 10px; }

.index-divider {
    flex: 0 0 1px;
    width: 1px;
    align-self: center;
    height: calc(84px * 0.6);
    margin: 0;
    padding: 0;
    list-style: none;
    background: #868686;
    pointer-events: none;
}

.index-item {
    flex: 1 1 calc(100% / var(--topic-count, 9));
    width: auto;
    min-width: 0;
    height: 84px;
    flex-shrink: 1;
    border-radius: 16px;
    cursor: pointer;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-inline: 10px;
    box-shadow: none;
    border: 0;
    position: relative;
    overflow: visible;
    gap: 12px;
    transform: none;
    transform-origin: center;
}

.index-item::after {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline: 10px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(27, 36, 46, 0.06);
    z-index: 0;
    pointer-events: none;
}

.index-item .index-item-img {
    width: 40px; height: 40px; border-radius: 8px; background-size: contain;
    background-repeat: no-repeat; background-position: center; flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.index-item .index-item-text {
    font-weight: 700;
    text-align: center;
    font-size: 0.70rem;
    color: #868686;
    line-height: 1.3;
    z-index: 1;
    position: relative;
}
.index-item:hover { transform: none; box-shadow: none; }
.index-item:hover::after { box-shadow: 0 8px 20px rgba(27, 36, 46, 0.1); }
.index-item.active {
    height: 84px;
    transform: none;
    border: 0;
    box-shadow: none;
    background: transparent;
}
.index-item.active::after {
    background: var(--topic-accent, #0078d7);
    box-shadow: 0 8px 20px rgba(27, 36, 46, 0.12);
}
.index-item.active .index-item-text { color: #ffffff; }

.leaflet-tooltip.custom-tooltip { background-color: rgba(255, 255, 255, 0.95); border: 1px solid #ccc; color: #333; border-radius: 6px; font-family: 'PeydaFaNumWeb', Tahoma, sans-serif !important; font-size: 14px; text-align: center; line-height: 1.6;}

#map-panel-dock { display: none; }
.atlas-page-nav[hidden] { display: none !important; }

@media (max-width: 767px) {
    html, body {
        height: 100dvh;
        height: 100svh;
        max-height: 100dvh;
        max-height: 100svh;
        overflow: hidden;
    }
    #entry-view-curtain {
        --curtain-banner-h: 84px;
        --curtain-dock-h: 92px;
        height: var(--vvh, 100svh);
        max-height: var(--vvh, 100svh);
        overflow: hidden;
    }
    .entry-scroll {
        bottom: calc(var(--curtain-dock-h, 92px) + 20px);
    }
    html.curtain-auth .entry-scroll {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        bottom: 0;
        overscroll-behavior: contain;
    }
    html.curtain-auth .entry-hero {
        min-height: 100%;
        justify-content: flex-start;
        padding: 12px 12px 28px;
    }
    html.curtain-auth .entry-launch {
        overflow: visible;
        max-height: none;
    }
    html.curtain-auth .entry-auth-stage {
        max-height: none;
        overflow: visible;
    }
    html.curtain-auth .entry-hero-stack,
    html.curtain-auth-wide .entry-hero-stack {
        width: min(420px, calc(100% - 24px));
    }
    .entry-hero-stack { left: 0; right: 0; width: min(420px, calc(100% - 24px)); }
    .entry-launch { padding: 12px; border-radius: 22px; }
    .entry-dock {
        left: 12px;
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom, 0px));
        height: 76px;
        min-height: 76px;
        padding: 8px 4px;
        border-radius: 28px;
        background: #ffffff;
        box-shadow: 0 10px 28px rgba(81, 88, 17, 0.14);
        overflow: visible;
        z-index: 1600;
        view-transition-name: none;
    }
    .entry-dock::before { display: none; }
    .entry-dock-item {
        flex-direction: column;
        gap: 6px;
        padding: 6px 4px;
        color: #515811;
    }
    .entry-dock-item:hover,
    .entry-dock-item.is-current {
        background: transparent;
        color: #515811;
    }
    .entry-dock-item + .entry-dock-item {
        border-inline-start: 1px solid rgba(81, 88, 17, 0.16);
    }
    .entry-dock-copy {
        align-items: center;
        text-align: center;
    }
    .entry-dock-title {
        font-size: 0.72rem;
        font-weight: 700;
        color: #515811;
    }
    .entry-dock-sub { display: none; }
    .entry-dock-icon {
        width: 28px;
        height: 28px;
        filter: brightness(0) saturate(100%) invert(24%) sepia(28%) saturate(700%) hue-rotate(28deg) brightness(0.92);
    }

    #bottom-panel {
        height: 88px;
        flex-basis: 88px;
        padding: 0 6px env(safe-area-inset-bottom);
    }
    .index-item {
        height: 84px;
        padding-inline: 6px;
        gap: 6px;
    }
    .index-item .index-item-img { width: 26px; height: 26px; }
    .index-item .index-item-text { font-size: 0.6rem; }

    .map-dock-btn {
        flex: 1;
        border: none;
        background: transparent;
        font-family: inherit;
        font-weight: 700;
        font-size: clamp(0.72rem, 3.2vw, 0.88rem);
        padding: 0 4px;
        height: clamp(36px, 5.6vw, 42px);
        border-radius: 999px;
        color: #515811;
        cursor: pointer;
        white-space: nowrap;
    }
    .map-dock-btn.is-active {
        background: var(--topic-accent, #515811);
        color: #ffffff;
    }
}

html.atlas-view,
html.atlas-view body {
    background-color: #f7f4ed;
}

html.atlas-view #main-content {
    background-color: #f7f4ed;
}

html.atlas-view #right-panel,
html.atlas-view #right-panel.show-panel {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    display: flex;
    width: 280px;
    flex: 0 0 280px;
    height: auto;
    min-height: 0;
    gap: 12px;
    pointer-events: auto;
    overflow: hidden;
}

html.atlas-view .right-card {
    width: 100%;
    max-width: none;
    border-left-width: 0;
    box-shadow: none;
    border: 1px solid rgba(27, 36, 46, 0.08);
}

html.atlas-view .right-card-bottom {
    margin-bottom: 0;
    min-height: 0;
}

html.atlas-view #left-popup-panel {
    position: relative;
    top: auto;
    left: auto;
    bottom: auto;
    display: flex;
    width: 230px;
    flex: 0 0 230px;
    height: auto;
    min-height: 0;
    border-right-width: 1px;
}

html.atlas-view #left-popup-panel:not(.is-open) #left-chart-container {
    display: none;
}

#left-province-hint[hidden] {
    display: none;
}

html.atlas-view #center-column {
    position: relative;
}

html.atlas-view #map-legend {
    bottom: 18px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(27, 36, 46, 0.08);
    padding: 8px 22px 10px;
    pointer-events: auto;
}

html.atlas-view #bottom-panel {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    height: 92px;
    flex: 0 0 92px;
    width: 100%;
    padding: 0 4px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    align-items: center;
    z-index: 1;
}

html.atlas-view .index-list {
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    gap: 16px;
    overflow: visible;
}

html.atlas-view .index-divider {
    flex: 0 0 1px;
    width: 1px;
    align-self: center;
    height: calc(84px * 0.6);
    margin: 0;
    padding: 0;
    list-style: none;
    background: #868686;
    pointer-events: none;
}

html.atlas-view .index-item {
    flex: 1 1 calc(100% / var(--topic-count, 9));
    width: auto;
    min-width: 0;
    height: 84px;
    border-radius: 16px;
    border: 0;
    box-shadow: none;
    transform: none;
    transform-origin: center;
    background: transparent;
    padding-inline: 10px;
    overflow: visible;
}

html.atlas-view .index-item::after {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline: 10px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(27, 36, 46, 0.06);
    z-index: 0;
    pointer-events: none;
}

html.atlas-view .index-item .index-item-img,
html.atlas-view .index-item .index-item-text {
    position: relative;
    z-index: 1;
}

html.atlas-view .index-item .index-item-text {
    color: #868686;
}

html.atlas-view .index-item:hover {
    transform: none;
    box-shadow: none;
}

html.atlas-view .index-item:hover::after {
    box-shadow: 0 8px 20px rgba(27, 36, 46, 0.1);
}

html.atlas-view .index-item.active {
    height: 84px;
    transform: none;
    border: 0;
    box-shadow: none;
    background: transparent;
}

html.atlas-view .index-item.active::after {
    background: var(--topic-accent, #0078d7);
    box-shadow: 0 8px 20px rgba(27, 36, 46, 0.12);
}

html.atlas-view .index-item.active .index-item-text {
    color: #ffffff;
}

@media (max-width: 767px) {
    html.atlas-view #main-content {
        padding: calc(env(safe-area-inset-top, 0px) + var(--banner-gap) + 56px + 10px) 10px calc(8px + env(safe-area-inset-bottom, 0px));
        gap: clamp(8px, 1.8vw, 12px);
    }
    html.atlas-view #atlas-page-nav:not([hidden]) {
        display: flex;
        position: relative;
        z-index: 4;
        flex: 0 0 auto;
        flex-shrink: 0;
        width: 100%;
        padding: 4px;
        border-radius: 999px;
        background: #ffffff;
        box-shadow: 0 6px 18px rgba(81, 88, 17, 0.08);
    }
    html.atlas-view #atlas-page-nav .banner-seg {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        direction: rtl;
        width: 100%;
        margin: 0;
        padding: 0;
        background: transparent;
        gap: 0;
    }
    html.atlas-view #atlas-page-nav .banner-seg-btn {
        flex: 1 1 0;
        height: clamp(34px, 5.4vw, 40px);
        padding: 0 6px 1px;
        border-radius: 999px;
        font-size: clamp(0.72rem, 3.2vw, 0.88rem);
        font-weight: 700;
        min-width: 0;
    }
    html.atlas-view #atlas-page-nav .banner-seg-btn[data-nav="atlas"] { grid-column: 1; }
    html.atlas-view #atlas-page-nav .banner-seg-btn[data-nav="explorer"] { grid-column: 2; }
    html.atlas-view #atlas-page-nav .banner-seg-btn[data-nav="index"] { grid-column: 3; }
    html.atlas-view #atlas-page-nav .banner-seg-btn[data-nav="types"] { grid-column: 4; }

    html.atlas-view #atlas-stage {
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        gap: clamp(8px, 1.8vw, 12px);
        position: relative;
    }
    html.atlas-view #center-column {
        display: contents;
    }
    html.atlas-view #map-frame {
        flex: 1 1 auto;
        min-height: 0;
        order: 1;
        border-radius: 22px;
        box-shadow: 0 10px 28px rgba(27, 36, 46, 0.08);
    }
    html.atlas-view #map-legend {
        position: static;
        transform: none;
        left: auto;
        bottom: auto;
        width: 100%;
        margin: 0;
        padding: 3px 12px 4px;
        background: #ffffff;
        border-radius: 999px;
        box-shadow: none;
        flex: 0 0 auto;
        flex-shrink: 0;
        order: 2;
        box-sizing: border-box;
    }
    html.atlas-view .legend-scale-wrapper { width: 100%; max-width: none; }
    html.atlas-view .legend-scale-bar { height: 6px; border: 0; border-radius: 999px; overflow: hidden; }
    html.atlas-view .legend-title { font-size: 0.62rem; margin-bottom: 1px; color: #515811; line-height: 1.3; }
    html.atlas-view .legend-labels { font-size: 0.58rem; color: #515811; margin-top: 1px; }

    html.atlas-view #left-popup-panel,
    html.atlas-view #right-panel,
    html.atlas-view #right-panel.show-panel,
    html.treat-v1.atlas-view #left-popup-panel,
    html.treat-v1.atlas-view #right-panel,
    html.treat-v1.atlas-view #right-panel.show-panel {
        display: none !important;
        width: auto;
        flex: none;
        position: relative;
        top: auto;
        right: auto;
        bottom: auto;
        left: auto;
        height: auto;
        max-height: none;
        pointer-events: auto;
    }

    html.atlas-view body.map-sheet-details #map-frame,
    html.atlas-view body.map-sheet-topics #map-frame,
    html.atlas-view body.map-sheet-charts #map-frame {
        display: none !important;
    }
    html.atlas-view body.map-sheet-details #right-panel,
    html.atlas-view body.map-sheet-details #right-panel.show-panel,
    html.atlas-view body.map-sheet-charts #right-panel,
    html.atlas-view body.map-sheet-charts #right-panel.show-panel,
    html.atlas-view body.map-sheet-topics #left-popup-panel,
    html.treat-v1.atlas-view body.map-sheet-details #right-panel,
    html.treat-v1.atlas-view body.map-sheet-details #right-panel.show-panel,
    html.treat-v1.atlas-view body.map-sheet-charts #right-panel,
    html.treat-v1.atlas-view body.map-sheet-charts #right-panel.show-panel,
    html.treat-v1.atlas-view body.map-sheet-topics #left-popup-panel {
        display: flex !important;
        position: relative !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        z-index: 1 !important;
        flex: 1 1 auto;
        min-height: 0;
        order: 1;
        width: 100%;
        margin: 0;
        padding: 12px;
        border-radius: 22px;
        background: #ffffff;
        box-shadow: 0 10px 28px rgba(27, 36, 46, 0.08);
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        animation: none !important;
    }
    html.atlas-view body.map-sheet-details .right-card-bottom,
    html.atlas-view body.map-sheet-charts .right-card-top {
        display: none !important;
    }
    html.atlas-view body.map-sheet-details .right-card-top,
    html.atlas-view body.map-sheet-charts .right-card-bottom {
        display: flex !important;
        flex-direction: column;
        min-height: 0;
        flex: 1 1 auto;
    }
    .atlas-chart-switch {
        display: none;
    }
    html.atlas-view body.map-sheet-charts .atlas-chart-switch {
        display: flex;
        flex-shrink: 0;
        gap: 6px;
        margin-top: 8px;
        padding: 3px;
        border-radius: 999px;
        background: #eef1e4;
    }
    .atlas-chart-switch-btn {
        flex: 1;
        height: 28px;
        border: 0;
        border-radius: 999px;
        background: transparent;
        color: #515811;
        font: inherit;
        font-size: 0.72rem;
        font-weight: 700;
        cursor: pointer;
    }
    .atlas-chart-switch-btn.is-active {
        background: #515811;
        color: #fff;
    }
    html.atlas-view body.map-sheet-charts-rank #trend-wrapper {
        display: none !important;
    }
    html.atlas-view body.map-sheet-charts-trend #chart-wrapper {
        display: none !important;
    }
    html.atlas-view body.map-sheet-charts-rank #chart-wrapper,
    html.atlas-view body.map-sheet-charts-trend #trend-wrapper,
    html.treat-v1.atlas-view body.map-sheet-charts-rank #chart-wrapper,
    html.treat-v1.atlas-view body.map-sheet-charts-trend #trend-wrapper {
        display: block !important;
        flex: 1 1 auto !important;
        height: auto !important;
        min-height: 220px !important;
        margin-bottom: 0 !important;
    }
    html.treat-v1.atlas-view body.map-sheet-charts-rank #trend-wrapper,
    html.treat-v1.atlas-view body.map-sheet-charts-trend #chart-wrapper {
        display: none !important;
    }
    html.atlas-view body.map-sheet-details #right-panel,
    html.atlas-view body.map-sheet-details #right-panel.show-panel,
    html.treat-v1.atlas-view body.map-sheet-details #right-panel,
    html.treat-v1.atlas-view body.map-sheet-details #right-panel.show-panel {
        display: flex !important;
        position: relative !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        z-index: 1 !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        flex: 1 1 0 !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: auto;
        animation: none !important;
    }
    html.atlas-view body.map-sheet-details .right-card,
    html.atlas-view body.map-sheet-charts .right-card {
        width: 100%;
        max-width: none;
        min-height: 0;
        margin: 0;
        padding: 4px 2px;
        border: 0;
        box-shadow: none;
        background: transparent;
    }
    html.atlas-view body.map-sheet-details .right-card-top {
        flex: 0 0 auto !important;
        width: 100%;
        margin-block: auto;
        justify-content: center;
        align-items: center;
        text-align: center;
        max-height: none !important;
    }
    html.atlas-view body.map-sheet-details #province-details {
        width: 100%;
        margin: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
        gap: 8px;
    }
    html.atlas-view body.map-sheet-details .index-kicker {
        text-align: center;
        margin: 0;
    }
    html.atlas-view body.map-sheet-details .index-description-text {
        margin: 0;
    }
    html.atlas-view body.map-sheet-charts .right-card-bottom {
        flex: 1 1 auto;
    }
    html.atlas-view body.map-sheet-charts #chart-wrapper,
    html.treat-v1.atlas-view body.map-sheet-charts #chart-wrapper {
        height: min(52dvh, 460px) !important;
        min-height: 240px !important;
        flex: 1.6 1 auto !important;
        margin-bottom: 8px !important;
    }
    html.atlas-view body.map-sheet-charts #trend-wrapper,
    html.treat-v1.atlas-view body.map-sheet-charts #trend-wrapper {
        height: min(22dvh, 180px) !important;
        min-height: 120px !important;
        flex: 0.9 1 auto !important;
        margin-bottom: 8px !important;
    }
    html.atlas-view body.map-sheet-topics #left-popup-panel h3 {
        font-size: 0.9rem;
        margin: 0 0 10px;
        flex-shrink: 0;
    }
    html.atlas-view body.map-sheet-topics #left-chart-container {
        position: relative;
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
        margin: 4px 0 0;
    }
    html.atlas-view body.map-sheet-topics .left-chart-scale {
        inset: 18px 0;
    }
    html.atlas-view body.map-sheet-topics #left-chart-container::before {
        display: block;
        top: 18px;
        bottom: 18px;
        width: 2px;
        background: rgba(81, 88, 17, 0.22);
    }
    html.atlas-view body.map-sheet-topics .y-tick {
        display: block;
        background: rgba(81, 88, 17, 0.35);
    }
    html.atlas-view body.map-sheet-topics .y-tick span {
        font-size: 0.72rem;
        color: #515811;
        top: -8px;
    }
    html.atlas-view body.map-sheet-topics #left-chart-markers {
        position: absolute;
        inset: 0;
        display: block;
        overflow: visible;
    }
    html.atlas-view body.map-sheet-topics .topic-marker,
    html.atlas-view body.map-sheet-topics .topic-marker.left-side,
    html.atlas-view body.map-sheet-topics .topic-marker.right-side {
        position: absolute;
        transform: translateY(50%);
    }
    html.atlas-view body.map-sheet-topics .topic-marker-dot {
        width: 12px;
        height: 12px;
    }
    html.atlas-view body.map-sheet-topics .topic-marker-content {
        padding: 2px 5px;
        gap: 4px;
    }
    html.atlas-view body.map-sheet-topics .topic-marker-content span { font-size: 0.72rem; }
    html.atlas-view body.map-sheet-topics .topic-marker-content img { width: 20px; height: 20px; }
    html.atlas-view body.map-sheet-topics .topic-marker-content::after {
        display: none;
    }

    html.atlas-view #bottom-panel {
        height: auto;
        flex: 0 0 auto;
        flex-basis: auto;
        padding: 0;
        overflow: hidden;
        flex-shrink: 0;
    }
    html.atlas-view .index-list {
        justify-content: flex-start;
        gap: 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        height: auto;
        padding: 2px 2px 4px;
    }
    html.atlas-view .index-list::-webkit-scrollbar { display: none; }
    html.atlas-view .index-item,
    html.treat-v1.atlas-view .index-item {
        flex: 0 0 auto;
        width: clamp(4.6rem, 22vw, 6.2rem);
        height: clamp(5.2rem, 22vw, 6.6rem);
        padding-inline: 6px;
        gap: 8px;
    }
    html.atlas-view .index-item::after {
        inset-inline: 4px;
        border-radius: 16px;
    }
    html.atlas-view .index-item .index-item-img { width: 28px; height: 28px; }
    html.atlas-view .index-item .index-item-text {
        font-size: clamp(0.58rem, 2.6vw, 0.7rem);
        color: #515811;
        font-weight: 600;
    }
    html.atlas-view .index-item.active .index-item-text { color: #ffffff; }
    html.atlas-view .index-divider {
        height: 2.4rem;
        background: rgba(81, 88, 17, 0.18);
        flex: 0 0 1px;
    }

    html.atlas-view #map-panel-dock,
    html.atlas-view #map-panel-dock[hidden] {
        display: flex !important;
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        z-index: 2;
        gap: 0;
        padding: 4px;
        background: #ffffff;
        border: 0;
        border-radius: 999px;
        box-shadow: 0 6px 18px rgba(81, 88, 17, 0.08);
        width: 100%;
        flex: 0 0 auto;
        flex-shrink: 0;
    }

    html.atlas-view .panel-title { font-size: 0.78rem; margin-bottom: 8px; padding-bottom: 6px; }
    html.atlas-view .index-description-text { font-size: 0.72rem; margin: 6px 0; padding: 8px; }
    html.atlas-view .instruction { margin-top: 12px; font-size: 0.82rem; }
}


.entry-auth-stage .register-field.password-field {
    position: relative;
}
.entry-auth-stage .register-field.password-field input {
    padding-inline-end: 3.6rem;
}
#auth-register .register-field.password-field input:focus,
#auth-register .register-field.password-field input:not(:placeholder-shown) {
    padding-inline-end: 3.6rem;
}
.entry-auth-stage .password-toggle {
    position: absolute;
    inset-inline-end: 12px;
    top: 26px;
    transform: translateY(-50%);
    z-index: 1;
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    padding: 0;
    background: transparent;
    color: #727a2a;
    cursor: pointer;
}
.entry-auth-stage .password-toggle:hover { background: rgba(81, 88, 17, 0.09); }
.entry-auth-stage .password-toggle:focus-visible {
    outline: 2px solid #515811;
    outline-offset: 1px;
}
.entry-auth-stage .password-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.entry-auth-stage .password-toggle[aria-pressed="true"] { color: #515811; }

@media (max-width: 767px) {
    html.curtain-auth.auth-keyboard-open .entry-scroll {
        scroll-padding-block: 20px max(28px, env(safe-area-inset-bottom, 0px));
    }
    html.curtain-auth.auth-keyboard-open .entry-hero {
        padding-bottom: max(28px, env(safe-area-inset-bottom, 0px));
    }
}
/* Compact six-cell OTP control for the authentication curtain. */
.entry-auth-stage .otp-code {
    display: flex;
    justify-content: center;
    width: 100%;
}

.entry-auth-stage .otp-code input[type="hidden"] { display: none; }

.entry-auth-stage .otp-digits {
    display: grid;
    grid-template-columns: repeat(6, 40px);
    gap: 8px;
    width: max-content;
    direction: ltr;
}

.entry-auth-stage .register-field .otp-digits .otp-digit {
    width: 40px;
    height: 40px;
    min-width: 0;
    padding: 0;
    border: 1px solid rgba(81, 88, 17, 0.48);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.92);
    color: #515811;
    font: 600 1.1rem/1 Arial, sans-serif;
    text-align: center;
    caret-color: #515811;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.entry-auth-stage .register-field .otp-digits .otp-digit:hover {
    border-color: rgba(81, 88, 17, 0.72);
}

.entry-auth-stage .register-field .otp-digits .otp-digit:focus-visible {
    outline: 0;
    border-color: #515811;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(81, 88, 17, 0.16);
}

.entry-auth-stage .otp-code.is-invalid .otp-digit {
    border-color: color-mix(in srgb, var(--rg-danger) 65%, var(--rg-line));
}

@media (max-width: 359px) {
    .entry-auth-stage .otp-digits {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 6px;
        width: 100%;
    }

    .entry-auth-stage .register-field .otp-digits .otp-digit { width: 100%; }
}
/* Keep the desktop curtain untouched. Mobile slides avoid live backdrop repainting. */
@media (max-width:767px) {
    html.mobile-curtain-moving #entry-view-curtain {
        height:var(--curtain-motion-height) !important;
        max-height:var(--curtain-motion-height) !important;
    }
    html.mobile-curtain-moving:not(.curtain-auth) .entry-launch {
        backdrop-filter:none;
        -webkit-backdrop-filter:none;
        background:rgba(232,217,185,.65);
    }
    html.mobile-curtain-moving .entry-scroll { transition:none; }
}

/* Mobile account motion changes opacity/transform, not card geometry each frame. */
@media (max-width:767px) {
    .entry-hero-stack,.entry-launch,.entry-scroll { transition:none; }
    .entry-launch { backdrop-filter:blur(8px) saturate(1.1); -webkit-backdrop-filter:blur(8px) saturate(1.1); }
    html.curtain-to-profile .entry-launch { backdrop-filter:blur(8px) saturate(1.1); -webkit-backdrop-filter:blur(8px) saturate(1.1); }
    html.curtain-auth .entry-auth-stage { animation:mobile-auth-stage-in .18s ease-out; }
    html.curtain-auth .entry-scroll { scroll-behavior:auto; }
    #auth-register .register-field>span,#auth-register .register-field input { transition:none; }
    html.mobile-curtain-moving .leaflet-tile-pane,
    html.mobile-curtain-moving path.leaflet-interactive,
    html.mobile-curtain-moving #map,
    html.mobile-curtain-moving #left-popup-panel,
    html.mobile-curtain-moving #right-panel,
    html.mobile-curtain-moving #map-legend { transition:none !important; }
    html.treat-v1.mobile-curtain-moving .right-card,
    html.treat-v1.mobile-curtain-moving #left-popup-panel { backdrop-filter:none; -webkit-backdrop-filter:none; }
}
@keyframes mobile-auth-stage-in {
    from { opacity:0; transform:translate3d(0,8px,0); }
    to { opacity:1; transform:translate3d(0,0,0); }
}
