html[data-site-theme="cloud"] {
    --site-bg: #eef2f5;
    --site-surface: #ffffff;
    --site-surface-soft: #f6f8fa;
    --site-text: #20252b;
    --site-muted: #66717d;
    --site-border: #dce2e7;
    --site-accent: #1261a0;
    --site-accent-strong: #0b477b;
    --site-accent-soft: #e6f1f8;
    --site-shadow: 0 5px 18px rgba(25, 43, 58, 0.08);
    --site-shadow-hover: 0 10px 26px rgba(25, 43, 58, 0.13);
    --site-radius: 8px;
}

html[data-site-theme="jade"] {
    --site-bg: #edf3f0;
    --site-surface: #ffffff;
    --site-surface-soft: #f3f8f5;
    --site-text: #24332e;
    --site-muted: #62716b;
    --site-border: #d6e2dc;
    --site-accent: #147d64;
    --site-accent-strong: #0c5e4a;
    --site-accent-soft: #def1e9;
    --site-shadow: 0 5px 18px rgba(31, 68, 55, 0.08);
    --site-shadow-hover: 0 10px 26px rgba(31, 68, 55, 0.14);
    --site-radius: 8px;
}

html[data-site-theme="ocean"] {
    --site-bg: #edf3f8;
    --site-surface: #ffffff;
    --site-surface-soft: #f3f7fa;
    --site-text: #21303b;
    --site-muted: #61717e;
    --site-border: #d5e0e8;
    --site-accent: #176ea6;
    --site-accent-strong: #0d527f;
    --site-accent-soft: #e0eff7;
    --site-shadow: 0 5px 18px rgba(28, 63, 87, 0.09);
    --site-shadow-hover: 0 10px 26px rgba(28, 63, 87, 0.15);
    --site-radius: 7px;
}

html[data-site-theme="coral"] {
    --site-bg: #f4f1f2;
    --site-surface: #ffffff;
    --site-surface-soft: #faf5f6;
    --site-text: #30272a;
    --site-muted: #74666a;
    --site-border: #e6dadd;
    --site-accent: #b14455;
    --site-accent-strong: #873442;
    --site-accent-soft: #fae6e9;
    --site-shadow: 0 5px 18px rgba(84, 43, 51, 0.09);
    --site-shadow-hover: 0 10px 26px rgba(84, 43, 51, 0.15);
    --site-radius: 8px;
}

html[data-site-theme="midnight"] {
    color-scheme: dark;
    --site-bg: #171a1f;
    --site-surface: #22262d;
    --site-surface-soft: #292e36;
    --site-text: #edf1f5;
    --site-muted: #aab3bd;
    --site-border: #3b424c;
    --site-accent: #47b3a6;
    --site-accent-strong: #75d2c7;
    --site-accent-soft: #183d3a;
    --site-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
    --site-shadow-hover: 0 10px 28px rgba(0, 0, 0, 0.4);
    --site-radius: 8px;
}

html[data-site-theme] {
    background: var(--site-bg);
}

html[data-site-theme] body {
    background: var(--site-bg) !important;
    color: var(--site-text) !important;
}

html[data-site-theme] body,
html[data-site-theme] input,
html[data-site-theme] select,
html[data-site-theme] textarea,
html[data-site-theme] button {
    letter-spacing: 0;
}

html[data-site-theme] .header h1,
html[data-site-theme] .header h2,
html[data-site-theme] h2,
html[data-site-theme] .card-title,
html[data-site-theme] .station-name,
html[data-site-theme] .province-title,
html[data-site-theme] .modal-title,
html[data-site-theme] .panel-title,
html[data-site-theme] .merge-title,
html[data-site-theme] .merge-card-title,
html[data-site-theme] .rule-primary,
html[data-site-theme] .country-name,
html[data-site-theme] .continent-legend-name,
html[data-site-theme] .overseas-breadcrumb strong {
    color: var(--site-text) !important;
}

html[data-site-theme] .header p,
html[data-site-theme] .overseas-summary,
html[data-site-theme] .continent-legend-metrics,
html[data-site-theme] .country-metrics,
html[data-site-theme] .airport-primary small,
html[data-site-theme] .airport-lounges small,
html[data-site-theme] .disclaimer,
html[data-site-theme] .merge-tip,
html[data-site-theme] .rule-aliases,
html[data-site-theme] .merge-field label,
html[data-site-theme] .merge-auth-status {
    color: var(--site-muted) !important;
}

html[data-site-theme] .lounge-detail-body,
html[data-site-theme] .lc-location,
html[data-site-theme] .detail-section,
html[data-site-theme] .overseas-airport-table td,
html[data-site-theme] .overseas-airport-table td strong,
html[data-site-theme] .overseas-airport-table td small {
    color: var(--site-text) !important;
}

html[data-site-theme] .detail-title {
    color: var(--site-text) !important;
}

html[data-site-theme] .merge-auth-status {
    background: var(--site-surface) !important;
    border-color: var(--site-border) !important;
}

html[data-site-theme] input,
html[data-site-theme] select,
html[data-site-theme] textarea,
html[data-site-theme] .controls input,
html[data-site-theme] .controls select,
html[data-site-theme] .overseas-toolbar input,
html[data-site-theme] .merge-field input,
html[data-site-theme] .merge-field select,
html[data-site-theme] .form-group input,
html[data-site-theme] .form-group textarea {
    background: var(--site-surface) !important;
    color: var(--site-text) !important;
    border-color: var(--site-border) !important;
}

html[data-site-theme] input:focus,
html[data-site-theme] select:focus,
html[data-site-theme] textarea:focus {
    border-color: var(--site-accent) !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--site-accent) 20%, transparent) !important;
}

html[data-site-theme] input::placeholder,
html[data-site-theme] textarea::placeholder {
    color: var(--site-muted);
    opacity: 0.8;
}

html[data-site-theme] .nav-card,
html[data-site-theme] .province-section,
html[data-site-theme] .log-section,
html[data-site-theme] .station-card,
html[data-site-theme] .modal-box,
html[data-site-theme] .lounge-card,
html[data-site-theme] .overseas-table-wrap,
html[data-site-theme] .continent-map-legend,
html[data-site-theme] .country-list,
html[data-site-theme] .country-airports,
html[data-site-theme] .container,
html[data-site-theme] .merge-card,
html[data-site-theme] .modal-content,
html[data-site-theme] .theme-panel {
    background: var(--site-surface) !important;
    border-color: var(--site-border) !important;
    box-shadow: var(--site-shadow);
}

html[data-site-theme] .province-title,
html[data-site-theme] .log-title,
html[data-site-theme] .modal-header,
html[data-site-theme] .lounge-card-header,
html[data-site-theme] .continent-map-panel,
html[data-site-theme] .overseas-state,
html[data-site-theme] .panel,
html[data-site-theme] .merge-panel,
html[data-site-theme] .log-card,
html[data-site-theme] .rule-item,
html[data-site-theme] .merge-alias-box,
html[data-site-theme] .merge-alias-list,
html[data-site-theme] .rules-wrap {
    background: var(--site-surface-soft) !important;
    border-color: var(--site-border) !important;
}

html[data-site-theme] .modal-body,
html[data-site-theme] .lc-location,
html[data-site-theme] .overseas-airport-table .letter-row th {
    background: var(--site-surface-soft) !important;
    border-color: var(--site-border) !important;
}

html[data-site-theme] .tab-btn:not([class*="active-"]),
html[data-site-theme] .continent-legend-item,
html[data-site-theme] .country-option,
html[data-site-theme] .country-airport,
html[data-site-theme] .overseas-back-btn,
html[data-site-theme] .merge-small-btn,
html[data-site-theme] .btn-cancel {
    background: var(--site-surface) !important;
    color: var(--site-text) !important;
    border-color: var(--site-border) !important;
}

html[data-site-theme] .tab-btn.active-all,
html[data-site-theme] .btn-update,
html[data-site-theme] .btn-config,
html[data-site-theme] .btn-save,
html[data-site-theme] .btn-admin-login,
html[data-site-theme] .btn-merge-save {
    background: var(--site-accent) !important;
    color: #fff !important;
}

html[data-site-theme] .nav-card,
html[data-site-theme] .station-card,
html[data-site-theme] .province-section,
html[data-site-theme] .log-section,
html[data-site-theme] .modal-box,
html[data-site-theme] .lounge-card,
html[data-site-theme] .panel,
html[data-site-theme] .merge-panel,
html[data-site-theme] .merge-card,
html[data-site-theme] .theme-panel {
    border-radius: var(--site-radius) !important;
}

html[data-site-theme] .nav-card.active:hover,
html[data-site-theme] .station-card:hover {
    box-shadow: var(--site-shadow-hover);
}

html[data-site-theme] .continent-legend-item:hover,
html[data-site-theme] .country-option:hover,
html[data-site-theme] .country-airport:hover,
html[data-site-theme] .tab-btn:not([class*="active-"]):hover {
    background: var(--site-accent-soft) !important;
}

html[data-site-theme] .overseas-breadcrumb button,
html[data-site-theme] .airport-lounges b,
html[data-site-theme] a:not(.nav-card):not(.btn-update) {
    color: var(--site-accent);
}

html[data-site-theme] .progress-wrap {
    background: var(--site-border) !important;
}

html[data-site-theme] .continent-map .jvm-zoom-btn {
    background: var(--site-surface) !important;
    color: var(--site-text) !important;
    border-color: var(--site-border) !important;
}

.theme-panel {
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid var(--site-border);
}

.theme-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.theme-panel-title {
    color: var(--site-text);
    font-size: 15px;
    font-weight: 700;
}

.theme-panel-note {
    color: var(--site-muted);
    font-size: 12px;
}

.theme-options {
    display: grid;
    grid-template-columns: repeat(5, minmax(130px, 1fr));
    gap: 8px;
}

.theme-option {
    position: relative;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 7px 8px;
    min-height: 78px;
    padding: 10px;
    border: 1px solid var(--site-border);
    border-radius: 7px;
    background: var(--site-surface);
    color: var(--site-text);
    cursor: pointer;
    box-sizing: border-box;
}

.theme-option:has(input:checked) {
    border-color: var(--site-accent);
    box-shadow: 0 0 0 2px var(--site-accent-soft);
}

.theme-option input {
    width: 16px !important;
    height: 16px;
    margin: 2px 0 0;
    accent-color: var(--site-accent);
}

.theme-option-name {
    font-size: 14px;
    font-weight: 700;
}

.theme-option-desc {
    grid-column: 2;
    color: var(--site-muted);
    font-size: 11px;
    line-height: 1.4;
}

.theme-swatches {
    grid-column: 2;
    display: flex;
    height: 10px;
    overflow: hidden;
    border: 1px solid rgba(127, 127, 127, 0.2);
    border-radius: 3px;
}

.theme-swatch {
    flex: 1;
}

.theme-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

.theme-save-status {
    color: var(--site-muted);
    font-size: 12px;
}

.btn-theme-save {
    background: var(--site-accent) !important;
    color: #fff !important;
}

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

@media (max-width: 520px) {
    .theme-panel-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .theme-options {
        grid-template-columns: 1fr;
    }
}

/* Shared theme motion system */
.site-loader {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 24px;
    background: var(--site-bg);
    color: var(--site-text);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.42s ease, visibility 0.42s ease;
    animation: site-loader-failsafe 0.4s ease 4s forwards;
    box-sizing: border-box;
}

.site-loader.is-leaving,
.image-preview-overlay.is-closing {
    opacity: 0;
    visibility: hidden;
}

.site-loader-visual {
    position: relative;
    display: block;
    width: 96px;
    height: 78px;
    margin-bottom: 14px;
    color: var(--site-accent);
}

.site-loader-visual > span {
    position: absolute;
    display: block;
    box-sizing: border-box;
}

.site-loader-brand {
    font-size: 17px;
    font-weight: 750;
    line-height: 1.4;
}

.site-loader-copy {
    margin-top: 5px;
    color: var(--site-muted);
    font-size: 12px;
}

.site-loader-track {
    width: min(190px, 56vw);
    height: 3px;
    margin-top: 17px;
    overflow: hidden;
    border-radius: 3px;
    background: var(--site-border);
}

.site-loader-track i {
    display: block;
    width: 42%;
    height: 100%;
    border-radius: inherit;
    background: var(--site-accent);
    animation: site-loader-track 1.15s cubic-bezier(0.45, 0, 0.2, 1) infinite;
}

.priority-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    min-height: 126px;
    padding: 14px;
    color: var(--site-muted);
    text-align: center;
    box-sizing: border-box;
}

.priority-loading .site-loader-visual {
    margin: -17px -18px -15px;
    transform: scale(0.56);
}

.priority-loading-label {
    font-size: 12px;
    line-height: 1.5;
}

.theme-motion-preview {
    grid-column: 1 / -1;
    display: grid;
    place-items: center;
    min-height: 48px;
    overflow: hidden;
    border: 1px solid var(--site-border);
    border-radius: 5px;
    background: var(--site-surface-soft);
}

.theme-motion-preview .site-loader-visual {
    margin: -18px 0;
    transform: scale(0.52);
}

[data-motion-theme="cloud"] { color: #1261a0; --site-accent-soft: #e6f1f8; --site-surface: #ffffff; }
[data-motion-theme="jade"] { color: #147d64; --site-accent-soft: #def1e9; --site-surface: #ffffff; }
[data-motion-theme="ocean"] { color: #176ea6; --site-accent-soft: #e0eff7; --site-surface: #ffffff; }
[data-motion-theme="coral"] { color: #b14455; --site-accent-soft: #fae6e9; --site-surface: #ffffff; }
[data-motion-theme="midnight"] { color: #47b3a6; --site-accent-soft: #183d3a; --site-surface: #22262d; }

/* Cloud: a route marker glides across a quiet flight path. */
:is(html[data-site-theme="cloud"], [data-motion-theme="cloud"]) .site-loader-visual::before {
    content: "";
    position: absolute;
    top: 38px;
    left: 8px;
    width: 80px;
    border-top: 2px dashed currentColor;
    opacity: 0.28;
}

:is(html[data-site-theme="cloud"], [data-motion-theme="cloud"]) .motion-core {
    top: 31px;
    left: 8px;
    width: 14px;
    height: 14px;
    border: 4px solid currentColor;
    background: var(--site-surface);
    transform: rotate(45deg);
    animation: motion-cloud-route 1.55s cubic-bezier(0.55, 0, 0.2, 1) infinite;
}

:is(html[data-site-theme="cloud"], [data-motion-theme="cloud"]) .motion-ring {
    display: none;
}

:is(html[data-site-theme="cloud"], [data-motion-theme="cloud"]) .motion-pulse {
    top: 35px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.24;
    animation: motion-cloud-point 1.55s ease infinite;
}

:is(html[data-site-theme="cloud"], [data-motion-theme="cloud"]) .motion-pulse-a { left: 12px; }
:is(html[data-site-theme="cloud"], [data-motion-theme="cloud"]) .motion-pulse-b { left: 45px; animation-delay: 0.18s; }
:is(html[data-site-theme="cloud"], [data-motion-theme="cloud"]) .motion-pulse-c { right: 8px; animation-delay: 0.36s; }

/* Jade: radar rings and a scanning arc. */
:is(html[data-site-theme="jade"], [data-motion-theme="jade"]) .motion-core {
    top: 32px;
    left: 41px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 5px var(--site-accent-soft);
}

:is(html[data-site-theme="jade"], [data-motion-theme="jade"]) .motion-ring {
    border-radius: 50%;
    border: 1px solid currentColor;
}

:is(html[data-site-theme="jade"], [data-motion-theme="jade"]) .motion-ring-a {
    inset: 17px 26px;
    animation: motion-jade-ring 1.7s ease-out infinite;
}

:is(html[data-site-theme="jade"], [data-motion-theme="jade"]) .motion-ring-b {
    inset: 8px 17px;
    border-color: currentColor transparent transparent currentColor;
    animation: motion-jade-scan 1.35s linear infinite;
}

:is(html[data-site-theme="jade"], [data-motion-theme="jade"]) .motion-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: motion-jade-point 1.2s ease-in-out infinite alternate;
}

:is(html[data-site-theme="jade"], [data-motion-theme="jade"]) .motion-pulse-a { top: 16px; left: 29px; }
:is(html[data-site-theme="jade"], [data-motion-theme="jade"]) .motion-pulse-b { top: 49px; right: 25px; animation-delay: 0.3s; }
:is(html[data-site-theme="jade"], [data-motion-theme="jade"]) .motion-pulse-c { bottom: 9px; left: 44px; animation-delay: 0.6s; }

/* Ocean: three measured waves. */
:is(html[data-site-theme="ocean"], [data-motion-theme="ocean"]) .motion-core,
:is(html[data-site-theme="ocean"], [data-motion-theme="ocean"]) .motion-ring {
    display: none;
}

:is(html[data-site-theme="ocean"], [data-motion-theme="ocean"]) .motion-pulse {
    bottom: 15px;
    width: 13px;
    border-radius: 7px;
    background: currentColor;
    transform-origin: center bottom;
    animation: motion-ocean-wave 1.15s ease-in-out infinite;
}

:is(html[data-site-theme="ocean"], [data-motion-theme="ocean"]) .motion-pulse-a { left: 22px; height: 32px; }
:is(html[data-site-theme="ocean"], [data-motion-theme="ocean"]) .motion-pulse-b { left: 42px; height: 48px; animation-delay: 0.14s; }
:is(html[data-site-theme="ocean"], [data-motion-theme="ocean"]) .motion-pulse-c { left: 62px; height: 38px; animation-delay: 0.28s; }

/* Coral: soft pulses gather attention at the center. */
:is(html[data-site-theme="coral"], [data-motion-theme="coral"]) .motion-core {
    top: 31px;
    left: 40px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: currentColor;
    animation: motion-coral-core 1.45s ease-in-out infinite;
}

:is(html[data-site-theme="coral"], [data-motion-theme="coral"]) .motion-ring {
    top: 39px;
    left: 48px;
    width: 20px;
    height: 20px;
    border: 2px solid currentColor;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: motion-coral-pulse 1.45s ease-out infinite;
}

:is(html[data-site-theme="coral"], [data-motion-theme="coral"]) .motion-ring-b { animation-delay: 0.45s; }
:is(html[data-site-theme="coral"], [data-motion-theme="coral"]) .motion-pulse { display: none; }

/* Midnight: an orbiting point and quiet stars. */
:is(html[data-site-theme="midnight"], [data-motion-theme="midnight"]) .motion-core {
    top: 32px;
    left: 41px;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-radius: 50%;
    background: var(--site-surface);
}

:is(html[data-site-theme="midnight"], [data-motion-theme="midnight"]) .motion-ring-a {
    inset: 11px 20px;
    border: 1px dashed currentColor;
    border-radius: 50%;
    opacity: 0.52;
    animation: motion-night-ring 4s linear infinite;
}

:is(html[data-site-theme="midnight"], [data-motion-theme="midnight"]) .motion-ring-b { display: none; }

:is(html[data-site-theme="midnight"], [data-motion-theme="midnight"]) .motion-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

:is(html[data-site-theme="midnight"], [data-motion-theme="midnight"]) .motion-pulse-a {
    top: 6px;
    left: 45px;
    transform-origin: 3px 33px;
    animation: motion-night-orbit 1.8s linear infinite;
}

:is(html[data-site-theme="midnight"], [data-motion-theme="midnight"]) .motion-pulse-b {
    top: 19px;
    left: 16px;
    animation: motion-night-star 1.2s ease-in-out infinite alternate;
}

:is(html[data-site-theme="midnight"], [data-motion-theme="midnight"]) .motion-pulse-c {
    right: 14px;
    bottom: 13px;
    animation: motion-night-star 1.2s 0.5s ease-in-out infinite alternate;
}

/* Theme-specific page entrances. */
html[data-site-theme="cloud"] .site-motion-ready :is(.header, .nav-card, .tabs, .controls, .log-section, .province-section, .continent-map-panel, .theme-panel, .panel, .merge-panel),
html[data-site-theme="jade"] .site-motion-ready :is(.header, .nav-card, .tabs, .controls, .log-section, .province-section, .continent-map-panel, .theme-panel, .panel, .merge-panel),
html[data-site-theme="ocean"] .site-motion-ready :is(.header, .nav-card, .tabs, .controls, .log-section, .province-section, .continent-map-panel, .theme-panel, .panel, .merge-panel),
html[data-site-theme="coral"] .site-motion-ready :is(.header, .nav-card, .tabs, .controls, .log-section, .province-section, .continent-map-panel, .theme-panel, .panel, .merge-panel),
html[data-site-theme="midnight"] .site-motion-ready :is(.header, .nav-card, .tabs, .controls, .log-section, .province-section, .continent-map-panel, .theme-panel, .panel, .merge-panel) {
    animation-duration: 0.56s;
    animation-fill-mode: both;
    animation-timing-function: cubic-bezier(0.22, 0.7, 0.22, 1);
}

html[data-site-theme="cloud"] .site-motion-ready :is(.header, .nav-card, .tabs, .controls, .log-section, .province-section, .continent-map-panel, .theme-panel, .panel, .merge-panel) { animation-name: site-enter-cloud; }
html[data-site-theme="jade"] .site-motion-ready :is(.header, .nav-card, .tabs, .controls, .log-section, .province-section, .continent-map-panel, .theme-panel, .panel, .merge-panel) { animation-name: site-enter-jade; }
html[data-site-theme="ocean"] .site-motion-ready :is(.header, .nav-card, .tabs, .controls, .log-section, .province-section, .continent-map-panel, .theme-panel, .panel, .merge-panel) { animation-name: site-enter-ocean; }
html[data-site-theme="coral"] .site-motion-ready :is(.header, .nav-card, .tabs, .controls, .log-section, .province-section, .continent-map-panel, .theme-panel, .panel, .merge-panel) { animation-name: site-enter-coral; }
html[data-site-theme="midnight"] .site-motion-ready :is(.header, .nav-card, .tabs, .controls, .log-section, .province-section, .continent-map-panel, .theme-panel, .panel, .merge-panel) { animation-name: site-enter-midnight; }

/* Full-screen swipe gallery. */
.image-preview-overlay {
    z-index: 10100;
    display: grid !important;
    grid-template-columns: 64px minmax(0, 1fr) 64px;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 10px;
    padding: max(56px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)) !important;
    background: rgba(8, 10, 13, 0.94) !important;
    cursor: default !important;
    opacity: 1;
    transition: opacity 0.18s ease, visibility 0.18s ease;
    box-sizing: border-box;
}

.image-preview-stage {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    touch-action: pan-y;
    user-select: none;
}

.image-preview-overlay .image-preview-image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 6px;
    object-fit: contain;
    opacity: 1;
    box-shadow: 0 20px 64px rgba(0, 0, 0, 0.46);
    transition: opacity 0.16s ease;
}

.image-preview-image.is-loading { opacity: 0.35; }
.image-preview-image.is-forward { animation: gallery-forward 0.22s ease both; }
.image-preview-image.is-backward { animation: gallery-backward 0.22s ease both; }

.image-preview-nav,
.image-preview-close {
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    background: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
    box-shadow: none !important;
    cursor: pointer;
    backdrop-filter: blur(8px);
}

.image-preview-nav[hidden] { display: none !important; }

.image-preview-nav {
    align-self: center;
    width: 48px;
    height: 58px;
    padding: 0 !important;
    border-radius: 7px !important;
    font-size: 40px !important;
    font-weight: 300 !important;
    line-height: 1 !important;
}

.image-preview-previous { grid-column: 1; grid-row: 1; justify-self: center; }
.image-preview-next { grid-column: 3; grid-row: 1; justify-self: center; }

.image-preview-close {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
    z-index: 3002;
    width: 40px;
    height: 40px;
    padding: 0 !important;
    border-radius: 50% !important;
    font-size: 28px !important;
    font-weight: 300 !important;
    line-height: 1 !important;
}

.image-preview-nav:hover,
.image-preview-nav:focus-visible,
.image-preview-close:hover,
.image-preview-close:focus-visible {
    background: rgba(255, 255, 255, 0.22) !important;
    outline: 2px solid rgba(255, 255, 255, 0.72);
    outline-offset: 2px;
}

.image-preview-meta {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: 12px;
    line-height: 1.4;
}

.image-preview-caption {
    max-width: min(560px, 66vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-preview-counter {
    flex: 0 0 auto;
    padding: 3px 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

@keyframes site-loader-failsafe { to { opacity: 0; visibility: hidden; } }
@keyframes site-loader-track { 0% { transform: translateX(-110%); } 100% { transform: translateX(340%); } }
@keyframes motion-cloud-route { 0% { left: 8px; opacity: 0; } 16% { opacity: 1; } 84% { opacity: 1; } 100% { left: 76px; opacity: 0; } }
@keyframes motion-cloud-point { 0%, 100% { transform: scale(0.72); opacity: 0.18; } 50% { transform: scale(1); opacity: 0.48; } }
@keyframes motion-jade-ring { 0% { transform: scale(0.55); opacity: 0.8; } 100% { transform: scale(1.32); opacity: 0; } }
@keyframes motion-jade-scan { to { transform: rotate(360deg); } }
@keyframes motion-jade-point { to { transform: scale(1.55); opacity: 0.35; } }
@keyframes motion-ocean-wave { 0%, 100% { transform: scaleY(0.48); opacity: 0.42; } 50% { transform: scaleY(1); opacity: 1; } }
@keyframes motion-coral-core { 0%, 100% { transform: scale(0.82); } 50% { transform: scale(1.12); } }
@keyframes motion-coral-pulse { 0% { transform: translate(-50%, -50%) scale(0.35); opacity: 0.78; } 100% { transform: translate(-50%, -50%) scale(2.6); opacity: 0; } }
@keyframes motion-night-ring { to { transform: rotate(360deg); } }
@keyframes motion-night-orbit { to { transform: rotate(360deg); } }
@keyframes motion-night-star { to { transform: scale(0.5); opacity: 0.28; } }
@keyframes site-enter-cloud { from { opacity: 0; transform: translateY(9px); } }
@keyframes site-enter-jade { from { opacity: 0; transform: translateX(-10px); } }
@keyframes site-enter-ocean { from { opacity: 0; transform: translateY(16px); } }
@keyframes site-enter-coral { from { opacity: 0; transform: scale(0.975); } }
@keyframes site-enter-midnight { from { opacity: 0; filter: blur(5px); transform: translateY(6px); } }
@keyframes gallery-forward { from { opacity: 0.35; transform: translateX(28px); } }
@keyframes gallery-backward { from { opacity: 0.35; transform: translateX(-28px); } }

@media (max-width: 640px) {
    .image-preview-overlay {
        grid-template-columns: 46px minmax(0, 1fr) 46px;
        gap: 4px;
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    .image-preview-nav {
        width: 40px;
        height: 52px;
        font-size: 34px !important;
    }

    .image-preview-caption { max-width: 54vw; }
}

@media (prefers-reduced-motion: reduce) {
    .site-loader *,
    .priority-loading *,
    .theme-motion-preview *,
    .site-motion-ready :is(.header, .nav-card, .tabs, .controls, .log-section, .province-section, .continent-map-panel, .theme-panel, .panel, .merge-panel),
    .image-preview-image {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
}
.lounge-updated-at {
    margin-top: 7px;
    color: var(--theme-muted, #777);
    font-size: 12px;
    line-height: 1.5;
}

/* Personal lounge tools */
.personal-toolbar{display:flex;align-items:center;gap:8px;max-width:1200px;margin:0 auto 14px;padding:0 16px;overflow-x:auto;scrollbar-width:none}
.personal-toolbar::-webkit-scrollbar{display:none}.personal-toolbar button{flex:0 0 auto;min-height:38px;padding:0 14px;border:1px solid var(--line,#d8dfdc);border-radius:6px;background:var(--surface,#fff);color:var(--text,#24302c);font:inherit;cursor:pointer}
.personal-toolbar button.is-active{border-color:#286b57;background:#e9f3ee;color:#174c3d;font-weight:700}.personal-toolbar .personal-count{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;margin-left:5px;padding:0 5px;border-radius:10px;background:#edf0ef;color:#5f6965;font-size:11px}
.station-card{position:relative}.station-favorite{position:absolute;top:9px;right:9px;z-index:2;width:34px;height:34px;padding:0;border:1px solid #d8dfdc;border-radius:50%;background:rgba(255,255,255,.94);color:#7a8581;font-size:22px;line-height:30px;cursor:pointer}.station-favorite.is-active{border-color:#d9ad4a;color:#bc8616;background:#fff9e9}.station-name-row{padding-right:38px}
.lounge-actions{display:flex;align-items:center;justify-content:flex-end;gap:4px;margin-top:8px}.lounge-actions button{display:grid;place-items:center;flex:0 0 32px;width:32px;height:32px;min-height:0;padding:0;border:1px solid var(--site-border,#ccd7d2);border-radius:5px;background:var(--site-surface-soft,#f7f9f8);color:var(--site-muted,#5f6c67);cursor:pointer;transition:background .16s ease,border-color .16s ease,color .16s ease}.lounge-actions button.is-compare{display:inline-flex;flex:0 0 auto;width:auto;padding:0 9px;gap:5px;font:inherit;font-size:12px;font-weight:650}.lounge-actions button svg{width:15px;height:15px;pointer-events:none}.lounge-actions button:hover,.lounge-actions button.is-active{border-color:var(--site-accent,#397962);background:var(--site-accent-soft,#edf6f1);color:var(--site-accent-strong,#245c49)}
.compare-bar{position:fixed;left:50%;bottom:18px;z-index:10030;display:flex;align-items:center;justify-content:space-between;gap:18px;width:min(760px,calc(100% - 32px));padding:12px 14px;transform:translateX(-50%);border:1px solid #b9c9c2;border-radius:8px;background:rgba(255,255,255,.97);box-shadow:0 12px 36px rgba(20,47,39,.2);backdrop-filter:blur(12px)}.compare-bar[hidden]{display:none}.compare-bar>div:first-child{min-width:0}.compare-bar [data-compare-names]{display:block;max-width:480px;margin-top:2px;overflow:hidden;color:#65716c;font-size:12px;text-overflow:ellipsis;white-space:nowrap}.compare-bar>div:last-child{display:flex;gap:8px}.compare-bar button,.utility-modal button.primary{min-height:38px;padding:0 14px;border:1px solid #b9c9c2;border-radius:5px;background:#fff;color:#274239;font:inherit;cursor:pointer}.compare-bar button.primary,.utility-modal button.primary{border-color:#173d32;background:#173d32;color:#fff}
.utility-modal{position:fixed;inset:0;z-index:10040;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(12,24,20,.64)}.utility-modal[hidden]{display:none}.utility-modal>section{width:min(1040px,100%);max-height:min(86vh,900px);overflow:auto;border-radius:8px;background:#fff;box-shadow:0 22px 70px rgba(0,0,0,.28)}.utility-modal>section>header{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px 18px;border-bottom:1px solid #e1e6e3;background:#fff}.utility-modal h2{margin:0;font-size:20px}.utility-modal header p{margin:4px 0 0;color:#68736f;font-size:12px}.utility-modal header>button{width:38px;height:38px;padding:0;border:0;background:transparent;color:#55615d;font-size:28px;cursor:pointer}.utility-modal [data-utility-body]{padding:18px}.utility-modal-open{overflow:hidden}
.compare-table-wrap{max-width:100%;overflow-x:auto;border:1px solid var(--site-border,#dce3e0);border-radius:7px;background:var(--site-surface,#fff);overscroll-behavior-inline:contain}.compare-table{display:grid;grid-template-columns:96px repeat(var(--compare-columns),minmax(210px,1fr));min-width:var(--compare-min-width);color:var(--site-text,#24302c)}.compare-corner,.compare-column-head,.compare-row-label,.compare-value{min-width:0;padding:11px 13px;border-right:1px solid var(--site-border,#e2e8e5);border-bottom:1px solid var(--site-border,#e2e8e5);box-sizing:border-box}.compare-corner,.compare-column-head{position:sticky;top:0;z-index:2;background:var(--site-surface-soft,#f5f8f6)}.compare-corner{left:0;z-index:4;color:var(--site-muted,#69756f);font-size:11px;font-weight:700}.compare-column-head{font-size:14px;font-weight:750;line-height:1.4}.compare-column-head small{display:block;margin-top:4px;color:var(--site-muted,#69756f);font-size:11px;font-weight:500}.compare-row-label{position:sticky;left:0;z-index:1;display:flex;align-items:flex-start;justify-content:space-between;gap:5px;background:var(--site-surface-soft,#f8faf9);color:var(--site-muted,#65716c);font-size:12px;font-weight:700}.compare-row-label small{flex:0 0 auto;padding:2px 4px;border-radius:3px;background:#fff0cf;color:#8a5a00;font-size:9px;font-weight:750}.compare-value{position:relative;background:var(--site-surface,#fff);font-size:13px;font-weight:600;line-height:1.6;overflow-wrap:anywhere;white-space:pre-wrap}.compare-value.is-different{background:color-mix(in srgb,#fff3d6 72%,var(--site-surface,#fff));box-shadow:inset 3px 0 #d99a22}.compare-table .is-edge{border-right:0}.compare-table .is-last{border-bottom:0}
.compare-value.is-images{min-height:100px;white-space:normal}.compare-image-meta{margin-bottom:5px;color:var(--site-muted,#65716c);font-size:10px;font-weight:650}.compare-image-list{display:flex;gap:6px;max-width:100%;padding-bottom:3px;overflow-x:auto;scrollbar-width:thin}.compare-image-list img{flex:0 0 76px;width:76px;height:58px;border:1px solid var(--site-border,#dce3e0);border-radius:4px;object-fit:cover;cursor:zoom-in;box-sizing:border-box}.compare-no-image{display:grid;place-items:center;height:66px;color:var(--site-muted,#7b8581);font-size:11px;font-weight:500}
.feedback-panel{width:min(560px,100%)!important}.feedback-panel form{display:grid;gap:14px;padding:18px}.feedback-panel label{display:grid;gap:6px;color:#34443e;font-size:13px}.feedback-panel input,.feedback-panel select,.feedback-panel textarea{box-sizing:border-box;width:100%;min-height:44px;padding:10px;border:1px solid #cdd6d2;border-radius:5px;background:#fff;color:#1d2925;font:inherit}.feedback-panel textarea{resize:vertical}.feedback-panel form>button{justify-self:end}
.priority-toast{position:fixed;left:50%;bottom:92px;z-index:10060;max-width:min(460px,calc(100% - 32px));padding:11px 16px;transform:translateX(-50%);border-radius:6px;background:#183a30;color:#fff;box-shadow:0 8px 28px rgba(0,0,0,.22);font-size:13px;text-align:center}.priority-toast[hidden]{display:none}
@media(max-width:680px){.personal-toolbar{padding:0 10px;margin-bottom:10px}.personal-toolbar button{min-height:42px}.station-favorite{top:7px;right:7px;width:38px;height:38px}.lounge-actions{gap:3px;margin-top:6px}.lounge-actions button{flex:0 0 30px;width:30px;height:30px}.lounge-actions button.is-compare{flex:0 0 auto;width:auto;padding:0 8px}.compare-bar{bottom:8px;width:calc(100% - 16px);gap:8px;padding:9px}.compare-bar [data-compare-names]{max-width:145px}.compare-bar button{min-height:42px;padding:0 10px}.utility-modal{align-items:flex-end;padding:0}.utility-modal>section{max-height:92dvh;border-radius:8px 8px 0 0}.utility-modal [data-utility-body]{padding:10px}.compare-table{grid-template-columns:82px repeat(var(--compare-columns),minmax(190px,1fr));min-width:var(--compare-mobile-min-width)}.compare-corner,.compare-column-head,.compare-row-label,.compare-value{padding:9px 10px}.compare-row-label{display:block;font-size:11px}.compare-row-label small{display:table;margin-top:4px}.feedback-panel form>button{justify-self:stretch;min-height:46px}.priority-toast{bottom:78px}}

/* Shared title hierarchy */
body.site-airport .directory-header,
body.site-rail .directory-header {
    margin: 2px 0 22px;
    text-align: center;
}

html[data-site-theme] body.site-airport .directory-header h1,
html[data-site-theme] body.site-rail .directory-header h1 {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    margin: 0;
    padding: 0 0 14px;
    color: var(--site-text) !important;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.25;
}

body.site-airport .directory-header h1::after,
body.site-rail .directory-header h1::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 68px;
    height: 3px;
    transform: translateX(-50%);
    border-radius: 2px;
    background: var(--site-accent);
}

.directory-title-icon {
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border: 1px solid color-mix(in srgb, var(--site-accent) 34%, var(--site-border));
    border-radius: 7px;
    background: var(--site-accent-soft);
    color: var(--site-accent-strong);
    box-sizing: border-box;
}

.directory-title-icon svg {
    width: 21px;
    height: 21px;
}

html[data-site-theme] body.site-airport .province-title,
html[data-site-theme] body.site-rail .province-title {
    position: relative;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    min-height: 50px;
    padding: 0 15px !important;
    background: color-mix(in srgb, var(--site-surface-soft) 82%, var(--site-surface)) !important;
}

body.site-airport .province-title::before,
body.site-rail .province-title::before {
    content: "";
    flex: 0 0 3px;
    width: 3px;
    height: 20px;
    border-radius: 2px;
    background: var(--site-accent);
}

.province-heading-name {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 16px;
    font-weight: 780;
    line-height: 1.35;
}

.province-heading-count {
    flex: 0 0 auto;
    padding: 4px 8px;
    border: 1px solid var(--site-border);
    border-radius: 4px;
    background: var(--site-surface);
    color: var(--site-muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    line-height: 1.2;
}

html[data-site-theme] body.site-airport .station-name,
html[data-site-theme] body.site-rail .station-name {
    font-size: 16px;
    font-weight: 760;
    line-height: 1.4;
}

body.site-airport .station-card:hover .station-name,
body.site-rail .station-card:hover .station-name {
    color: var(--site-accent-strong) !important;
}

html[data-site-theme] body.site-airport .modal-header,
html[data-site-theme] body.site-rail .modal-header {
    min-height: 60px;
    padding: 14px 18px !important;
    background: var(--site-surface) !important;
    box-sizing: border-box;
}

html[data-site-theme] body.site-airport .modal-title,
html[data-site-theme] body.site-rail .modal-title,
html[data-site-theme] .utility-modal h2 {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    margin: 0;
    color: var(--site-text) !important;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

body.site-airport .modal-title::before,
body.site-rail .modal-title::before,
.utility-modal h2::before {
    content: "";
    flex: 0 0 3px;
    width: 3px;
    height: 21px;
    border-radius: 2px;
    background: var(--site-accent);
}

html[data-site-theme] body.site-airport .lounge-card,
html[data-site-theme] body.site-rail .lounge-card {
    border-left-color: var(--site-accent) !important;
}

html[data-site-theme] body.site-airport .lc-title > div:first-child,
html[data-site-theme] body.site-rail .lc-title > div:first-child {
    color: var(--site-text);
    font-size: 16px;
    font-weight: 780;
    line-height: 1.45;
}

html[data-site-theme] body.site-airport .detail-title,
html[data-site-theme] body.site-rail .detail-title {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-bottom: 8px;
    color: var(--site-accent-strong) !important;
    font-size: 13px;
    font-weight: 780;
    line-height: 1.4;
}

body.site-airport .detail-title::before,
body.site-rail .detail-title::before {
    content: "";
    flex: 0 0 3px;
    width: 3px;
    height: 15px;
    margin-top: 1px;
    border-radius: 2px;
    background: var(--site-accent);
}

html[data-site-theme] .overseas-summary {
    display: flex;
    align-items: center;
    min-height: 36px;
    margin-bottom: 11px;
    padding: 7px 11px;
    border-left: 3px solid var(--site-accent);
    border-radius: 0 4px 4px 0;
    background: var(--site-surface-soft);
    color: var(--site-text) !important;
    font-size: 13px;
    font-weight: 680;
    line-height: 1.45;
    box-sizing: border-box;
}

html[data-site-theme] .search-country h3 {
    align-items: center;
    padding: 11px 13px;
    border-bottom: 1px solid var(--site-border);
    border-left: 3px solid var(--site-accent);
    background: var(--site-surface-soft);
    color: var(--site-text);
    font-size: 17px;
    font-weight: 780;
}

html[data-site-theme] .continent-legend-name,
html[data-site-theme] .country-name,
html[data-site-theme] .airport-primary strong {
    color: var(--site-text) !important;
    font-weight: 760;
    line-height: 1.35;
}

html[data-site-theme] .continent-legend-name,
html[data-site-theme] .country-name {
    font-size: 16px;
}

html[data-site-theme] .airport-primary strong {
    font-size: 15px;
}

html[data-site-theme] .overseas-breadcrumb strong {
    font-size: 14px;
    font-weight: 760;
}

body.site-home .card-title {
    display: flex;
    align-items: center;
    gap: 9px;
}

body.site-home .card-title::before {
    content: "";
    flex: 0 0 3px;
    width: 3px;
    height: 19px;
    border-radius: 2px;
    background: var(--site-accent);
}

@media (max-width: 640px) {
    body.site-airport .directory-header,
    body.site-rail .directory-header {
        margin-bottom: 17px;
    }

    html[data-site-theme] body.site-airport .directory-header h1,
    html[data-site-theme] body.site-rail .directory-header h1 {
        gap: 9px;
        padding-bottom: 12px;
        font-size: 22px;
    }

    .directory-title-icon {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
    }

    .directory-title-icon svg {
        width: 19px;
        height: 19px;
    }

    html[data-site-theme] body.site-airport .province-title,
    html[data-site-theme] body.site-rail .province-title {
        min-height: 48px;
        padding: 0 12px !important;
    }

    .province-heading-name {
        font-size: 15px;
    }

    .province-heading-count {
        padding: 4px 7px;
        font-size: 11px;
    }

    html[data-site-theme] body.site-airport .modal-title,
    html[data-site-theme] body.site-rail .modal-title,
    html[data-site-theme] .utility-modal h2 {
        font-size: 17px;
    }
}
