* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

#notification-bar {
    background-color: rgba(33, 33, 33, 0.9);
    color: white;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2000;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    padding: 0 10px;
}

#notification-bar a {
    color: #90CAF9;
    font-weight: bold;
    text-decoration: none;
}

#notification-bar a:hover {
    text-decoration: underline;
    color: #BBDEFB;
}

.notification-dismiss {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    line-height: 1;
    padding: 2px 8px;
    cursor: pointer;
    border-radius: 3px;
}

.notification-dismiss:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

/* Banner hidden: the map reclaims its height */
body.notification-hidden #notification-bar {
    display: none;
}

#map {
    width: 100%;
    height: calc(100vh - 32px);
}

body.notification-hidden #map {
    height: 100vh;
}

/* Controls sit below the banner; move them up when it is dismissed */
body.notification-hidden .info-panel,
body.notification-hidden .toolbar,
body.notification-hidden .mobile-legend-btn {
    top: 10px;
}

@media (max-width: 600px) {
    body.notification-hidden .info-panel {
        top: 58px;
    }
}

@media (max-width: 600px) {
    .notification-content {
        padding-right: 30px;
    }
}

/* SSSI pane: pane itself is pointer-events:none (set in JS),
   but SVG path elements inside must be clickable.
   Note: Leaflet strips "Pane" from pane names, so createPane('sssiPane')
   produces the class .leaflet-sssi-pane */
.leaflet-sssi-pane svg {
    pointer-events: none;
}
.leaflet-sssi-pane svg path {
    pointer-events: auto;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #228B22;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 18px;
    color: #333;
}

.error-message {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: #f44336;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    z-index: 1000;
    display: none;
}

.error-message.show {
    display: block;
}

/* Note on automatically derived (Wales) classifications */
.sssi-popup .derived-note {
    font-size: 10px;
    color: #777;
    font-style: italic;
    margin: 8px 0 0 0;
    line-height: 1.4;
}

/* Data loading warning banner */
.data-warning {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: #FF6F00;
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    z-index: 1500;
    display: none;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    font-size: 14px;
    max-width: 90%;
}

.data-warning.show {
    display: flex;
}

.data-warning .warning-icon {
    font-size: 18px;
}

.data-warning .warning-text {
    flex: 1;
}

.data-warning .warning-dismiss {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.8;
}

.data-warning .warning-dismiss:hover {
    opacity: 1;
}

.leaflet-popup-content {
    min-width: 280px;
    max-width: 350px;
}

.popup-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 40px;
}

.popup-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e0e0e0;
    border-top-color: #228B22;
    border-radius: 50%;
    animation: popup-spin 0.8s linear infinite;
}

@keyframes popup-spin {
    to { transform: rotate(360deg); }
}

.sssi-popup h3 {
    margin: 0 0 8px 0;
    color: #228B22;
    font-size: 16px;
}

.sssi-popup p {
    margin: 4px 0;
    font-size: 14px;
    color: #333;
}

.sssi-popup .reference {
    color: #666;
    font-family: monospace;
}

.sssi-popup a {
    display: inline-block;
    margin-top: 8px;
    color: #1976D2;
    text-decoration: none;
}

.sssi-popup a:hover {
    text-decoration: underline;
}

.sssi-popup .pdf-links {
    margin: 8px 0;
    display: flex;
    gap: 12px;
}

.sssi-popup .pdf-links a {
    margin: 0;
    padding: 4px 8px;
    background: #f5f5f5;
    border-radius: 3px;
    font-size: 12px;
    color: #333;
}

.sssi-popup .pdf-links a:hover {
    background: #e0e0e0;
}

.sssi-popup .features-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.sssi-popup .features-section h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #333;
}

.sssi-popup .features-list {
    max-height: 200px;
    overflow-y: auto;
    font-size: 12px;
}

.sssi-popup .feature-item {
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
}

.sssi-popup .feature-item:last-child {
    border-bottom: none;
}

.sssi-popup .feature-name {
    font-weight: 500;
    color: #333;
}

.sssi-popup .feature-condition {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    margin-left: 4px;
}

.sssi-popup .condition-favourable {
    background: #c8e6c9;
    color: #2e7d32;
}

.sssi-popup .condition-unfavourable {
    background: #ffcdd2;
    color: #c62828;
}

.sssi-popup .condition-recovering {
    background: #fff3e0;
    color: #ef6c00;
}

.sssi-popup .condition-unknown {
    background: #e0e0e0;
    color: #616161;
}

.sssi-popup .no-data {
    color: #999;
    font-style: italic;
    font-size: 12px;
}

.sssi-popup .wildlife-warning {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #FFF8E1;
    border: 1px solid #FFB300;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 8px 0;
}

.sssi-popup .wildlife-warning .icon {
    font-size: 20px;
    line-height: 1;
}

.sssi-popup .wildlife-warning .text {
    flex: 1;
}

.sssi-popup .wildlife-warning .title {
    font-weight: 600;
    color: #E65100;
    font-size: 12px;
    margin-bottom: 2px;
}

.sssi-popup .wildlife-warning .detail {
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
}

.sssi-popup .wildlife-warning .advice {
    font-size: 11px;
    color: #BF360C;
    font-weight: 500;
}

.sssi-popup .drone-ok {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #E3F2FD;
    border: 1px solid #64B5F6;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 8px 0;
}

.sssi-popup .drone-ok .icon {
    font-size: 20px;
}

.sssi-popup .drone-ok .text {
    font-size: 12px;
    color: #1565C0;
}

.sssi-popup .feature-wildlife {
    display: inline-block;
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 9px;
    margin-left: 4px;
    background: #FFCDD2;
    color: #C62828;
}

.sssi-popup .feature-insect {
    display: inline-block;
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 9px;
    margin-left: 4px;
    background: #E1BEE7;
    color: #7B1FA2;
}

.sssi-popup .insect-warning {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #F3E5F5;
    border: 1px solid #CE93D8;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 8px 0;
}

.sssi-popup .insect-warning .icon {
    font-size: 20px;
    line-height: 1;
}

.sssi-popup .insect-warning .text {
    flex: 1;
}

.sssi-popup .insect-warning .title {
    font-weight: 600;
    color: #7B1FA2;
    font-size: 12px;
    margin-bottom: 2px;
}

.sssi-popup .insect-warning .detail {
    font-size: 11px;
    color: #666;
}

.sssi-popup .wales-warning {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #FFEBEE;
    border: 1px solid #EF5350;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 8px 0;
}

.sssi-popup .wales-warning .icon {
    font-size: 20px;
    line-height: 1;
}

.sssi-popup .wales-warning .text {
    flex: 1;
}

.sssi-popup .wales-warning .title {
    font-weight: 600;
    color: #C62828;
    font-size: 12px;
    margin-bottom: 2px;
}

.sssi-popup .wales-warning .detail {
    font-size: 11px;
    color: #666;
}

.info-panel {
    position: fixed;
    top: 42px;
    right: 10px;
    background: white;
    padding: 12px 16px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    z-index: 500;
    max-width: 250px;
}

.info-panel h1 {
    font-size: 14px;
    margin: 0 0 8px 0;
    padding-right: 20px;
    color: #333;
}

/* Collapse chevron - desktop/tablet only; mobile uses the ☰ button instead */
.panel-collapse-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 14px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 3px;
}

.panel-collapse-btn:hover {
    background: #f0f0f0;
    color: #333;
}

@media (min-width: 601px) {
    .info-panel.collapsed > *:not(h1):not(.panel-collapse-btn) {
        display: none;
    }

    .info-panel.collapsed {
        padding: 8px 34px 8px 14px;
    }

    .info-panel.collapsed h1 {
        margin: 0;
        cursor: pointer;
    }
}

@media (max-width: 600px) {
    .panel-collapse-btn {
        display: none;
    }
}

.info-panel p {
    font-size: 12px;
    color: #666;
    margin: 0;
}

.site-count {
    font-weight: bold;
    color: #1565C0;
}

.layer-toggles {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
}

.layer-toggles h3 {
    font-size: 11px;
    color: #666;
    margin: 0 0 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.layer-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 0;
}

.layer-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.toggle-label {
    flex: 1;
}

.toggle-info {
    color: #999;
    font-size: 12px;
    cursor: help;
}

.legend {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
}

.legend h3 {
    font-size: 11px;
    color: #666;
    margin: 0 0 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legend.hidden {
    display: none;
}

.legend-note {
    font-size: 10px;
    color: #999;
    margin-top: 8px;
}

.legend-desc {
    font-size: 10px;
    color: #666;
    margin: -2px 0 6px 24px;
    font-style: italic;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    margin: 4px 0;
}

.legend-item.filter-checkbox {
    cursor: pointer;
    padding: 2px 4px;
    margin: 2px -4px;
    border-radius: 3px;
    transition: background 0.15s;
}

.legend-item.filter-checkbox:hover {
    background: #f0f0f0;
}

.legend-item.filter-checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    flex-shrink: 0;
}

.legend-item.filter-checkbox.disabled {
    opacity: 0.4;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 2px solid;
}

.legend-grey {
    background: #BDBDBD;
    border-color: #757575;
}

.legend-blue {
    background: #64B5F6;
    border-color: #1565C0;
}

.legend-amber {
    background: #FFB74D;
    border-color: #E65100;
}

.legend-purple {
    background: #CE93D8;
    border-color: #7B1FA2;
}

.legend-red {
    background: #EF5350;
    border-color: #C62828;
}

.legend-orange {
    background: #FFA726;
    border-color: #E65100;
}

.legend-yellow {
    background: #FFEE58;
    border-color: #F9A825;
}

/* UAS Airspace Popup */
.uas-popup h3 {
    margin: 0 0 8px 0;
    font-size: 15px;
}

.uas-popup h3.frz {
    color: #C62828;
}

.uas-popup h3.danger {
    color: #C62828;
}

.uas-popup h3.restricted {
    color: #F9A825;
}

.uas-popup .category-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.uas-popup .category-badge.frz {
    background: #FFCDD2;
    color: #C62828;
}

.uas-popup .category-badge.danger {
    background: #FFCDD2;
    color: #C62828;
}

.uas-popup .category-badge.prohibited {
    background: #FFCDD2;
    color: #C62828;
}

.uas-popup .category-badge.restricted {
    background: #FFF9C4;
    color: #F57F17;
}

.uas-popup .altitude-info {
    background: #F5F5F5;
    padding: 8px;
    border-radius: 4px;
    margin: 8px 0;
    font-size: 12px;
}

.uas-popup .altitude-info strong {
    color: #333;
}

.uas-popup .activity {
    font-size: 12px;
    color: #666;
    margin: 8px 0;
}

.uas-popup .contact {
    font-size: 11px;
    color: #999;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
}

/* UAS List Popup (for overlapping features) */
.uas-popup-container .leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
}

.uas-popup-container .leaflet-popup-content {
    margin: 0;
    min-width: 320px;
    max-width: 400px;
}

/* SSSI popup inside unified popup container needs padding */
.uas-popup-container .uas-popup > .sssi-popup {
    padding: 16px;
}

.uas-popup-container .leaflet-popup-tip {
    background: #fff;
}

.uas-list-popup {
    padding: 0;
}

/* Single feature popup */
.uas-popup:not(.uas-list-popup) {
    padding: 0;
}

.uas-list-header {
    padding: 12px 16px;
    background: #F5F5F5;
    border-bottom: 1px solid #E0E0E0;
}

.uas-list-header strong {
    font-size: 14px;
    color: #333;
}

.uas-list-hint {
    font-size: 11px;
    color: #666;
    margin: 4px 0 0 0;
}

.uas-features-list {
    max-height: 380px;
    overflow-y: auto;
}

/* Individual feature item in list */
.uas-feature-item {
    border-bottom: 1px solid #E0E0E0;
}

.uas-feature-item:last-child {
    border-bottom: none;
}

.uas-feature-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    background: #FAFAFA;
    transition: background 0.15s;
}

.uas-feature-header:hover {
    background: #F0F0F0;
}

.uas-feature-header .category-badge {
    flex-shrink: 0;
}

.uas-feature-header .feature-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.uas-feature-header .feature-name.frz {
    color: #C62828;
}

.uas-feature-header .feature-name.danger {
    color: #C62828;
}

.uas-feature-header .feature-name.restricted {
    color: #F57F17;
}

.uas-feature-header .feature-name.sssi {
    color: #228B22;
}

/* SSSI badges in combined popup */
.category-badge.sssi {
    background: #E8F5E9;
    color: #2E7D32;
}

.category-badge.sssi-wildlife {
    background: #FFF3E0;
    color: #E65100;
}

.category-badge.sssi-insects {
    background: #F3E5F5;
    color: #7B1FA2;
}

/* SSSI item styling in list */
.sssi-item .uas-feature-details {
    padding: 0;
}

.sssi-item .uas-feature-details .sssi-popup {
    padding: 12px;
}

.sssi-item.expanded .uas-feature-header {
    background: #E8F5E9;
}

.uas-feature-header .expand-icon {
    color: #999;
    font-size: 10px;
    flex-shrink: 0;
}

/* Standalone popup (single feature, no accordion) */
.uas-standalone-item {
    padding: 12px;
}

.uas-standalone-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid #E0E0E0;
    margin-bottom: 12px;
}

.uas-standalone-header .category-badge {
    flex-shrink: 0;
}

.uas-standalone-header .feature-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
}

.uas-standalone-header .feature-name.frz {
    color: #C62828;
}

.uas-standalone-header .feature-name.danger {
    color: #C62828;
}

.uas-standalone-header .feature-name.restricted {
    color: #F57F17;
}

.uas-standalone-item .uas-feature-details {
    display: block;
    padding: 0;
    border-top: none;
    background: transparent;
}

/* Feature details (collapsible) */
.uas-feature-details {
    display: none;
    padding: 12px;
    background: #fff;
    border-top: 1px solid #E8E8E8;
}

.uas-feature-item.expanded .uas-feature-details {
    display: block;
}

.uas-feature-item.expanded .uas-feature-header {
    background: #E3F2FD;
}

/* FRZ warning in details */
.uas-feature-details .frz-warning {
    color: #C62828;
    background: #FFEBEE;
    padding: 8px;
    border-radius: 4px;
    margin: 8px 0;
}

/* Danger area warning in details */
.uas-feature-details .danger-warning {
    color: #C62828;
    background: #FFEBEE;
    padding: 8px;
    border-radius: 4px;
    margin: 8px 0;
}

/* Restricted area warning in details */
.uas-feature-details .restricted-warning {
    color: #F57F17;
    background: #FFFDE7;
    padding: 8px;
    border-radius: 4px;
    margin: 8px 0;
}

/* Raw source data section */
.raw-data-section {
    margin-top: 12px;
    border-top: 1px solid #E0E0E0;
    padding-top: 8px;
}

.raw-data-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 6px 8px;
    background: #F5F5F5;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
    transition: background 0.15s;
}

.raw-data-header:hover {
    background: #EEEEEE;
}

.raw-data-content {
    display: none;
    margin-top: 8px;
}

.raw-data-content pre {
    font-size: 10px;
    font-family: 'Consolas', 'Monaco', monospace;
    background: #F9F9F9;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    padding: 10px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 200px;
    overflow-y: auto;
    color: #555;
    line-height: 1.4;
}

.toolbar {
    position: fixed;
    top: 42px;
    left: 60px;
    z-index: 500;
    display: flex;
    gap: 8px;
}

.toolbar-btn {
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: background 0.2s;
}

.toolbar-btn:hover {
    background: #f5f5f5;
}

.toolbar-btn:active {
    background: #e0e0e0;
}

.toolbar-btn.locating {
    animation: pulse 1s infinite;
}

/* Live location tracking is active */
.toolbar-btn.tracking {
    background: #E3F2FD;
    color: #1a73e8;
    box-shadow: 0 2px 6px rgba(26, 115, 232, 0.4);
}

@keyframes pulse {
    0%, 100% { background: white; }
    50% { background: #E3F2FD; }
}

.toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(33, 33, 33, 0.9);
    color: #fff;
    padding: 8px 220px 8px 16px;
    font-size: 12px;
    z-index: 400;
}

.status-bar a {
    color: #90CAF9;
    text-decoration: none;
}

.status-bar a:hover {
    text-decoration: underline;
}

.status-line {
    text-align: center;
}

.status-divider {
    color: #666;
    margin: 0 8px;
}

.sssi-popup .collected-date {
    font-size: 11px;
    color: #9e9e9e;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
}

/* Mobile legend toggle button - hidden on desktop */
.mobile-legend-btn {
    display: none;
    position: fixed;
    top: 42px;
    right: 10px;
    z-index: 500;
}

@media (max-width: 600px) {
    .mobile-legend-btn {
        display: flex;
    }

    .info-panel {
        display: none !important;
        position: fixed;
        top: 90px;
        right: 10px;
        left: 10px;
        max-width: none;
        max-height: calc(100vh - 180px);
        overflow-y: auto;
        z-index: 600;
    }

    .info-panel.visible {
        display: block !important;
    }

    .toolbar {
        top: 42px;
        left: 50px;
    }

    .status-bar {
        padding: 8px 12px 28px 12px;
        font-size: 11px;
    }

    .status-divider {
        display: none;
    }

    .status-line {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .leaflet-popup-content {
        min-width: 200px;
        max-width: 280px;
    }

    .sssi-popup h3 {
        font-size: 14px;
    }

    .sssi-popup .features-list {
        max-height: 150px;
    }

    .sssi-popup .feature-item {
        font-size: 11px;
    }

    .leaflet-control-attribution {
        position: fixed !important;
        /* Sits above the status bar, which changes height when a take-off
           verdict appears - main.js keeps the variable in step. */
        bottom: calc(var(--status-bar-height, 85px) + 4px) !important;
        right: 0 !important;
        background: rgba(255,255,255,0.8) !important;
        padding: 2px 8px !important;
        font-size: 10px !important;
    }
}

/* ==========================================================================
   Beta overlay layers, flight conditions and the take-off verdict
   ========================================================================== */

/* Collapsible legend sections - the panel got long once the beta layers landed */
.legend h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.legend h3:hover {
    color: #333;
}

.legend-chevron {
    color: #bbb;
    font-size: 10px;
    line-height: 1;
}

.legend.section-collapsed > *:not(h3) {
    display: none;
}

.beta-tag {
    display: inline-block;
    background: #ECEFF1;
    color: #546E7A;
    border: 1px solid #CFD8DC;
    border-radius: 3px;
    font-size: 9px;
    line-height: 1;
    padding: 2px 4px;
    margin-left: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    vertical-align: 1px;
}

.layer-group-note {
    font-size: 10px;
    color: #999;
    font-style: italic;
    margin: 8px 0 2px 0;
}

.toggle-status {
    font-size: 10px;
    color: #999;
    white-space: nowrap;
}

.legend-teal {
    background: #4DB6AC;
    border-color: #00695C;
}

.legend-cyan {
    background: #4DD0E1;
    border-color: #00838F;
}

.legend-brown {
    background: #8D6E63;
    border-color: #3E2723;
}

/* --- Flight conditions panel --- */

.weather-panel {
    margin-top: 10px;
    padding: 8px 10px;
    background: #F5F7F8;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    font-size: 11px;
}

.weather-panel.hidden {
    display: none;
}

.weather-loading {
    margin: 0;
    color: #888;
    font-style: italic;
}

/* A refresh dims the previous reading in place instead of clearing it, so the
   panel keeps its height and nothing below it jumps */
.weather-panel.weather-refreshing {
    opacity: 0.55;
    transition: opacity 0.2s;
}

.weather-verdict {
    margin: 0 0 6px 0;
    font-weight: 600;
    line-height: 1.35;
}

.weather-ok { color: #2E7D32; }
.weather-caution { color: #EF6C00; }
.weather-no { color: #C62828; }

.weather-grid {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr;
    gap: 3px 8px;
    color: #555;
}

.weather-grid span:nth-child(odd) {
    color: #999;
}

.weather-source {
    margin: 6px 0 0 0;
    font-size: 10px;
    color: #aaa;
}

/* --- Take-off verdict line in the status bar --- */

.takeoff-verdict {
    display: none;
}

.takeoff-verdict.show {
    display: flex;
    align-items: baseline;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: -2px 0 6px 0;
    padding: 6px 12px;
    border-radius: 4px;
    line-height: 1.35;
    text-align: center;
}

.takeoff-verdict strong {
    font-size: 13px;
}

.takeoff-verdict span {
    opacity: 0.85;
}

/* The "which point is this about?" switch, shared by the verdict and the
   conditions panel. Styled per context: light on the dark status bar, muted on
   the pale conditions panel. */
.location-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font: inherit;
    cursor: pointer;
    border-radius: 3px;
    white-space: nowrap;
}

.location-mode-swap {
    opacity: 0.7;
    font-size: 0.9em;
}

.takeoff-verdict .location-mode-btn {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: inherit;
    font-size: 11px;
    padding: 3px 7px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.takeoff-verdict .location-mode-btn:hover {
    background: rgba(255, 255, 255, 0.26);
}

.takeoff-verdict .location-mode-static {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    opacity: 0.75;
}

.weather-source .location-mode-btn {
    background: none;
    border: none;
    border-bottom: 1px dotted #bbb;
    color: #888;
    font-size: 10px;
    padding: 0 0 1px 0;
}

.weather-source .location-mode-btn:hover {
    color: #555;
    border-bottom-color: #888;
}

.takeoff-verdict.verdict-unknown {
    background: rgba(97, 97, 97, 0.35);
    color: #E0E0E0;
}

.takeoff-verdict.verdict-ok {
    background: rgba(46, 125, 50, 0.25);
    color: #C8E6C9;
}

.takeoff-verdict.verdict-caution {
    background: rgba(239, 108, 0, 0.3);
    color: #FFE0B2;
}

.takeoff-verdict.verdict-no {
    background: rgba(198, 40, 40, 0.35);
    color: #FFCDD2;
}

/* --- Overlay popup blocks --- */

.overlay-block {
    border-left: 3px solid #ccc;
    padding: 6px 0 6px 10px;
    margin: 0 0 10px 0;
}

.overlay-block:last-child {
    margin-bottom: 0;
}

.overlay-bird { border-left-color: #00838F; }
.overlay-access { border-left-color: #4E342E; }

.overlay-head {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 3px;
}

.overlay-head strong {
    font-size: 13px;
}

.overlay-chip {
    display: inline-block;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 2px 5px;
    border-radius: 3px;
    color: #fff;
    white-space: nowrap;
}

.chip-bird { background: #00838F; }
.chip-access { background: #4E342E; }

.overlay-meta {
    margin: 0 0 4px 0;
    font-size: 11px;
    color: #777;
}

.overlay-note {
    margin: 0 0 4px 0;
    font-size: 11px;
    line-height: 1.4;
    color: #444;
}

.overlay-note-quiet {
    color: #777;
    font-style: italic;
}

@media (max-width: 600px) {
    .takeoff-verdict.show {
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 6px 8px;
    }

    .takeoff-verdict strong {
        font-size: 12px;
    }

    .weather-grid {
        grid-template-columns: auto 1fr;
    }
}
