﻿
body {
    margin: 0px;
}

/* Keep the add-note and photo-import controls spaced like the other map controls. */
.fpns-field-notes-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fpns-photo-upload-icon {
    display: block;
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#map {
    height: 100vh;
    padding: 0px;
    margin: 0px;
    z-index: 50;
}

#panel {
    position: fixed;
    bottom: 0px;
    box-sizing: border-box;
    padding: 2px;
    background-color: purple;
    color: white;
    opacity: 0.6;
    z-index: 100;
    width: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: x-small;
}

#location-info {
    display: flex;
    gap: 20px;
    align-items: center;
    white-space: nowrap;
}

#location-info span {
    display: inline-block;
}

/* Keep Leaflet attribution above the bottom information panel on smaller screens, even when the panel is only one line high. */
@media (max-width: 900px) {
    #map .leaflet-bottom.leaflet-right {
        bottom: calc(var(--fpns-bottom-panel-height, 0px) + 4px);
    }
}

/* Keep the bottom information panel readable on narrow screens. */
@media (max-width: 600px) {
    #panel {
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
        font-size: 11px;
    }

    #location-info {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 4px 10px;
        white-space: normal;
    }

    #location-info span {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    #location {
        flex: 1 1 100%;
    }

}
/* Keep popup content within the usable viewport, including the bottom information panel. */
.leaflet-popup-content-wrapper {
    max-width: calc(100vw - 24px);
}

.leaflet-popup-content {
    box-sizing: border-box;
    max-width: calc(100vw - 64px);
    max-height: calc(100vh - var(--fpns-bottom-panel-height, 0px) - 40px);
    overflow-y: auto;
    overflow-wrap: anywhere;
}

@supports (height: 100dvh) {
    .leaflet-popup-content {
        max-height: calc(100dvh - var(--fpns-bottom-panel-height, 0px) - 40px);
    }
}

/* HUD container */
#hud {
    position: absolute;
    bottom: 12px;
    left: 12px;
    transform: translateY(-50%);
    background: rgba(20, 20, 20, 0.35);
    color: #fff;
    padding: 3px 3px;
    border-radius: 5px;
    min-width: 180px;
    font-size: 12px;
    z-index: 1000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* row layout */
.hud-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}



.popup-title {
    margin: 0 0 4px 0;
    font-size: 1.2em;
    line-height: 1.2;
}

.popup-score {
    margin: 0 0 4px 0;
    font-size: 0.8em;
    line-height: 1.2;
}

.intersection-distance-label {
    border: none;
    box-shadow: none;
    padding: 1px 4px;
    font-size: 10px;
    line-height: 1;
    border-radius: 3px;
    margin: 0;
}

    .intersection-distance-label.best {
        background: rgba(255, 0, 255, 0.25);
        color: #ff00ff;
        font-weight: bold;
    }

.leaflet-top.leaflet-left {
    width: 100%;
    pointer-events: none;
}

.weather-summary-label {
    z-index: 1000;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font: 500 13px/1.2 Arial, sans-serif;
    white-space: pre-line;
    pointer-events: none;
}

    .weather-summary-label::before {
        content: 'Weather: ';
    }

/*.other-device-markerx {
    color: magenta;
    font-size: 30px;
    line-height: 30px;
    text-align: center;
    text-shadow: 0px 0px 24px magenta, 0 0 28px magenta;
}*/

.other-device-marker div {
    width: 24px;
    height: 24px;
    background: cyan;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255,255,255,0.8);
}

.weather-warning {
    color: orange;
    font-weight: bold;
}

#hint-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 30px;
    width: 100%;
    max-height: 40vh;
    background: rgba(50, 0, 50, 0.5);
    color: white;
    border-radius: 8px;
    z-index: 1100;
    overflow-y: auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: none;
    z-index: 9999;
    padding: 0.5rem 1rem;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.4);
    box-sizing: border-box;
}



/* Optional: hint items styling */
#hint-list .hint-item {
    margin-bottom: 0.5rem;
}

#hint-list .hint-title {
    font-weight: bold;
}

#hint-list .hint-description {
    font-size: 0.9rem;
}

#hint-list .hint-technique {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

#hint-list .hint-technique-item {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.78rem;
    line-height: 1.25;
}

.hint-indicator {
    width: 14px;
    height: 14px;
    background: #00ffff;
    border: 2px solid white;
    border-radius: 2px;
    transform: rotate(45deg);
    box-shadow: 0 0 4px rgba(0, 200, 200, 0.6);
}

.hint-marker {
    position: relative;
    pointer-events: none;
}

.hint-diamond {
    width: 14px;
    height: 14px;
    background: #00ffff;
    border: 2px solid white;
    border-radius: 2px;
    transform: rotate(45deg);
    position: absolute;
    left: 0;
    top: 0;
    box-shadow: 0 0 5px rgba(0,200,200,0.7);
}
/*
.hint-title {
    position: absolute;
    left: 24px;
    top: -4px;
    white-space: nowrap;
    background: rgba(20,20,20,0.75);
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Segoe UI', sans-serif;
}*/
.hint-label {
    white-space: nowrap;
    background: rgba(20,20,20,.8);
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Segoe UI', sans-serif;
}
/* Modern panel styling */
#layers-panel {
    position: absolute;
    top: 70px;
    left: -300px;
    width: 280px;
    height: calc(100% - 80px);
    /* Modern look */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #000;
    padding: 0;
    border-radius: 12px;
    /* Soft elevation */
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    /* Smooth motion */
    transition: left 0.35s cubic-bezier(0.25, 0.1, 0.25, 1), opacity 0.25s ease-out;
    opacity: 0;
    z-index: 9999;
    overflow: hidden;
    box-sizing: border-box;
}

    /* Slide-in + fade-in */
    #layers-panel.visible {
        left: 10px;
        opacity: 1;
    }

    /* Content area */
    #layers-panel .content {
        padding: 20px;
        height: 100%;
        overflow-y: auto;
        box-sizing: border-box;
    }

#layers-panel {
    transition: left 0.35s cubic-bezier(0.25, 0.1, 0.25, 1), opacity 0.25s ease-out, transform 0.2s ease-out;
}



/* Layer buttons */
.layer-toggle {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 18px;
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
    /* Prevent size changes */
    box-sizing: border-box;
    border: 2px solid transparent;
    /* Modern hover */
    transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}

    .layer-toggle:hover {
        background: rgba(0,0,0,0.05);
        transform: translateX(2px);
    }

    /* Active state */
    .layer-toggle.active {
        background: rgba(74, 111, 165, 0.15);
        border-color: #4a6fa5;
        box-shadow: inset 0 0 8px rgba(0,0,80,0.25);
    }

    /* Bigger icons */
    .layer-toggle .icon svg {
        width: 48px;
        height: 48px;
        stroke-width: 2.5;
    }

/* Label */
.layer-label {
    font-size: 18px;
    font-weight: 500;
}


/* Modern close button */
#layers-panel .close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 44px; /* mobile-friendly */
    height: 44px; /* mobile-friendly */
    border-radius: 12px; /* modern rounded shape */

    background: rgba(0,0,0,0.08);
    border: none;
    font-size: 28px; /* readable */
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

    /* Hover / tap effect */
    #layers-panel .close-btn:hover {
        background: rgba(0,0,0,0.15);
        transform: scale(1.05);
    }

    /* Active press effect */
    #layers-panel .close-btn:active {
        background: rgba(0,0,0,0.25);
        transform: scale(0.95);
    }


#layers-edge-handle {
    position: fixed;
    top: 0;
    left: 0;
    width: 24px; /* touch zone */
    height: 100vh;
    z-index: 9997; /* below panel, above map */
    background: transparent;
}



/* -------- Geo / generic dialog styles -------- */

/* -------- Geo / generic dialog styles (full animated, Safari-safe) -------- */

.ux-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    pointer-events: auto;
    opacity: 0;
    transition: opacity 280ms ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

    .ux-dialog-overlay.visible {
        opacity: 1;
    }

    .ux-dialog-overlay.exiting {
        opacity: 0;
    }

.ux-dialog-card {
    position: relative;
    overflow: hidden;
    border-radius: 999px;
    padding: 18px 16px 16px;
    max-width: 92vw;
    width: 340px;
    text-align: center;
    box-sizing: border-box;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45), 0 10px 25px rgba(0, 0, 0, 0.25);
    background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(240,248,255,0.88));
    color: #0b1220;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(20px) scale(0.96);
    transition: transform 420ms cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 280ms ease;
}

    .ux-dialog-card.visible {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    .ux-dialog-card.exiting {
        opacity: 0;
        transform: translateY(20px) scale(0.94);
    }

.ux-dialog-halo {
    position: absolute;
    inset: -2px;
    border-radius: 999px;
    background: conic-gradient(from 0deg, #22d3ee, #3b82f6, #a78bfa, #f472b6, #22d3ee);
    filter: blur(10px);
    opacity: 0.8;
    pointer-events: none;
    z-index: 0;
    animation: ux-halo-spin 4s linear infinite;
}

@keyframes ux-halo-spin {
    to {
        transform: rotate(360deg);
    }
}

.ux-dialog-inner {
    position: relative;
    z-index: 1;
    border-radius: 999px;
    padding: 18px 14px 14px;
    box-shadow: inset 0 0 22px rgba(255,255,255,0.7);
    background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.9));
}

.ux-dialog-title {
    font-weight: 800;
    font-size: 15px;
    line-height: 1.3;
    margin-bottom: 6px;
    letter-spacing: 0.4px;
    color: #0b1220;
    text-transform: uppercase;
}

.ux-dialog-text {
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 12px;
    color: #334155;
}

.ux-dialog-instructions {
    margin: 0 0 12px 16px;
    padding: 0;
    font-size: 12px;
    line-height: 1.4;
    color: #334155;
    list-style: none;
    text-align: left;
    display: inline-block;
}

    .ux-dialog-instructions li {
        margin-bottom: 4px;
    }

.ux-dialog-button {
    border: none;
    background: linear-gradient(135deg, #22d3ee 0%, #3b82f6 100%);
    color: #ffffff;
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(34, 211, 238, 0.45), 0 4px 10px rgba(59, 130, 246, 0.35);
    letter-spacing: 0.5px;
    margin-top: 4px;
    -webkit-tap-highlight-color: transparent;
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
    width: auto;
    display: inline-block;
    float: right;
}

    .ux-dialog-button:hover,
    .ux-dialog-button:focus-visible {
        transform: translateY(-2px) scale(1.02);
        filter: brightness(1.05);
    }

    .ux-dialog-button:active {
        transform: translateY(0) scale(1);
        filter: brightness(1);
    }

#active-user-count:before {
    content: 'Online : ';
}

#data-usage {
    display: inline-block;
    opacity: 0.9;
}

/* Other devices: magenta circle */
.other-device-marker div {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: magenta;
}

/* User marker container (no background/border) */
.user-marker-icon {
    background: transparent;
    border: none;
}

/* Your device: teal circle with initials */
.user-marker {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: teal;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    position: relative;
}

    /* Optional: small triangle at top to show direction (teal) */
    .user-marker::after {
        content: "";
        position: absolute;
        top: -4px;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        height: 0;
        border-left: 4px solid transparent;
        border-right: 4px solid transparent;
        border-bottom: 6px solid teal;
    }
.user-heading-marker {
    background: transparent;
    border: none;
}

.user-heading-marker-inner {
    position: relative;
    width: 52px;
    height: 52px;
    transform-origin: 50% 50%;
}

.user-heading-arrow {
    position: absolute;
    left: 50%;
    top: 2px;
    width: 0;
    height: 0;
    transform: translateX(-50%);
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-bottom: 34px solid #00a7a7;
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.6));
}

.user-heading-center {
    position: absolute;
    left: 50%;
    top: 22px;
    width: 14px;
    height: 14px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #006b6b;
    box-shadow: 0 0 0 2px rgba(0, 167, 167, 0.35);
}

.device-label-icon {
    /* no special styles required here */
}

.device-label-badge {
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    border-radius: 12px;
    padding: 3px 7px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
    text-align: center;
    line-height: 1;
}

.device-label-line {
    /*vector-effect: non-scaling-stroke;*/ /* SVG-only styles – safe to ignore linter warnings about vector-effect */
    stroke: #000;
    stroke-width: 2.5; /* thicker */
    stroke-opacity: 0.95; /* almost fully opaque */
    pointer-events: none;
}

/*.leaflet-labelLines-pane .device-label-line {
    stroke: #ffffff;
    stroke-width: 2.5;
    stroke-opacity: 0.95;
    opacity: 1;
}*/

.field-note-marker-container {
    background: transparent;
    border: none;
}

.field-note-marker {
    display: flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #333;
    color: #fff;
    line-height: 1;
    box-shadow: 0 1px 5px rgba(0,0,0,0.65);
    box-sizing: border-box;
}

.field-note-marker-icon {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.field-note-marker.selected {
    width: 40px;
    height: 40px;
    margin: -3px;
    border-color: #ffd400;
    box-shadow: 0 0 0 3px rgba(255,212,0,0.45), 0 2px 8px rgba(0,0,0,0.75);
}

.field-note-marker.selected .field-note-marker-icon {
    width: 24px;
    height: 24px;
}


.field-note-popup-metadata {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 18px;
    margin-bottom: 9px;
    font-size: 12px;
    color: #555;
}

.field-note-popup-metadata-item {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    line-height: 1.35;
}

.field-note-popup-metadata-label {
    color: #777;
    font-size: 11px;
}

.field-note-popup-metadata-item strong {
    color: #333;
    font-weight: 600;
}

.field-note-popup-weather {
    align-items: center;
}

.field-note-popup-weather-icons {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex: 0 0 auto;
}

.field-note-popup-weather-icon {
    font-size: 25px;
    line-height: 1;
}

.field-note-popup-weather-text {
    color: #333;
}

.field-note-popup-heading {
    display: none;
}

.field-note-popup-actions {
    display: flex;
    gap: 8px;
    margin: 8px 0 12px;
}

.field-note-popup-edit,
.field-note-popup-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 36px;
    height: 36px;
    padding: 7px 12px;
    margin: 0;
    border-radius: 7px;
    font: inherit;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}

.field-note-popup-edit {
    border: 1px solid #aaa;
    background: #fff;
    color: #222;
}

.field-note-popup-edit:hover {
    background: #f2f2f2;
}

.field-note-popup-delete {
    gap: 7px;
    border: 1px solid #d5a7a7;
    background: #fff;
    color: #8b3f3f;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.field-note-popup-delete svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.field-note-popup-delete:hover {
    background: #fff4f4;
    border-color: #bd7d7d;
    color: #742d2d;
}

.field-note-form-overlay,
.field-note-photo-lightbox {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.65);
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
}

.field-note-form {
    width: min(520px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
    padding: 20px;
    border-radius: 10px;
    background: #fff;
    color: #222;
    box-shadow: 0 12px 40px rgba(0,0,0,0.45);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.field-note-form h2 {
    margin: 0 0 4px;
    font-size: 22px;
}

.field-note-form-location {
    margin-bottom: 18px;
    color: #68727d;
    font-size: 12px;
}

.field-note-form textarea:focus,
.field-note-photo-picker:focus-visible,
.field-note-rating-star:focus-visible,
.field-note-form-actions button:focus-visible,
.field-note-photo-remove:focus-visible {
    outline: 3px solid rgba(51, 51, 51, 0.2);
    outline-offset: 2px;
}

.field-note-form label {
    display: block;
    margin: 12px 0 6px;
    font-weight: 600;
}

.field-note-rating-input {
    display: flex;
    gap: 2px;
    margin-bottom: 4px;
}

.field-note-rating-star {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 8px;
    background: transparent;
    padding: 0;
    color: #e0a800;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.field-note-rating-star:hover {
    background: #f6f6f6;
}

.field-note-form textarea {
    width: 100%;
    min-height: 140px;
    box-sizing: border-box;
    resize: vertical;
    padding: 11px 12px;
    border: 1px solid #aaa;
    border-radius: 7px;
    font: inherit;
    line-height: 1.45;
}

.field-note-photo-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.field-note-photo-picker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    min-height: 78px;
    padding: 12px 18px;
    border: 1px solid #c7cdd4;
    border-radius: 12px;
    background: linear-gradient(180deg, #fbfcfd 0%, #f4f6f8 100%);
    color: #26323d;
    cursor: pointer;
    box-sizing: border-box;
    text-align: left;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
    -webkit-tap-highlight-color: transparent;
}

.field-note-photo-picker svg {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    padding: 7px;
    border-radius: 9px;
    background: #e8ebef;
    color: #4a5560;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    box-sizing: content-box;
}

.field-note-photo-picker-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.field-note-photo-picker-text strong {
    font-size: 15px;
    line-height: 1.2;
    font-weight: 650;
}

.field-note-photo-picker-text small {
    font-size: 12px;
    line-height: 1.3;
    font-weight: 400;
    color: #68727d;
}

.field-note-photo-picker:hover,
.field-note-photo-picker:focus-visible {
    background: #f7f9fb;
    border-color: #aeb7c1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.09);
    transform: translateY(-1px);
}

.field-note-photo-picker:focus-visible {
    outline: 3px solid rgba(51, 51, 51, 0.2);
    outline-offset: 2px;
}

.field-note-photo-picker:active {
    background: #eef1f4;
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.field-note-photo-picker.has-selection {
    border-color: #9ea8b2;
    background: #f6f8fa;
}

.field-note-photo-picker.has-selection svg {
    background: #dde2e7;
    color: #35414d;
}


.field-note-form-message {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 7px;
    font-size: 13px;
    line-height: 1.4;
}

.field-note-form-message-error {
    border: 1px solid #e8c98b;
    background: #fff8e8;
    color: #765016;
}

.field-note-form-message[hidden] {
    display: none;
}

.field-note-photo-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 8px;
    margin-top: 9px;
}

.field-note-photo-preview-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    background: #e9ecef;
    border: 1px solid rgba(0,0,0,0.12);
}

.field-note-photo-preview-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.field-note-photo-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(0,0,0,0.25);
    border-radius: 50%;
    background: rgba(255,255,255,0.94);
    color: #222;
    font-size: 20px;
    line-height: 24px;
    padding: 0 0 2px;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.field-note-photo-remove:hover {
    background: #fff;
}

.field-note-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}

.field-note-form-actions button {
    min-height: 44px;
    padding: 9px 18px;
    border-radius: 6px;
    border: 1px solid #999;
    cursor: pointer;
    font: inherit;
}

.field-note-form-cancel {
    background: #eee;
    color: #222;
}

.field-note-form-save {
    background: #333;
    color: #fff;
}

.field-note-form-save:disabled {
    opacity: 0.6;
    cursor: wait;
}

.field-note-photo-lightbox-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
}

.field-note-photo-lightbox-image {
    display: block;
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
}

.field-note-photo-lightbox-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #222;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 1;
}


.field-note-photo-lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 64px;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 8px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 44px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    padding: 0 0 5px;
    transition: background 120ms ease, transform 120ms ease;
}

.field-note-photo-lightbox-nav:hover {
    background: rgba(0,0,0,0.75);
}

.field-note-photo-lightbox-nav:active {
    transform: translateY(-50%) scale(0.96);
}

.field-note-photo-lightbox-nav[hidden] {
    display: none;
}

.field-note-photo-lightbox-previous {
    left: 20px;
}

.field-note-photo-lightbox-next {
    right: 20px;
}

.field-note-photo-lightbox-position {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    color: #fff;
    background: rgba(0,0,0,0.55);
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.2;
    z-index: 2;
    pointer-events: none;
}

@media (max-width: 600px) {
    .field-note-form-overlay,
    .field-note-photo-lightbox {
        align-items: flex-start;
        padding: 10px;
    }

    .field-note-form {
        width: 100%;
        max-height: calc(100vh - 20px);
        padding: 16px;
        border-radius: 9px;
    }

    .field-note-form-actions {
        position: sticky;
        bottom: -16px;
        margin: 18px -16px -16px;
        padding: 12px 16px 16px;
        background: rgba(255,255,255,0.96);
        border-top: 1px solid #e1e4e7;
    }

    .field-note-form-actions button {
        flex: 1;
    }

    .field-note-photo-picker {
        min-height: 72px;
    }

    .field-note-photo-lightbox-nav {
        width: 42px;
        height: 56px;
        font-size: 38px;
    }

    .field-note-photo-lightbox-previous {
        left: 8px;
    }

    .field-note-photo-lightbox-next {
        right: 8px;
    }
}

/* Field-note photo context overrides */
.field-note-photo-lightbox-content {
    max-height: 80vh;
}

.field-note-photo-lightbox-image {
    max-height: 78vh;
}

.field-note-photo-lightbox-details {
    position: fixed;
    left: 50%;
    bottom: 52px;
    transform: translateX(-50%);
    width: min(760px, calc(100vw - 110px));
    max-height: 20vh;
    overflow-y: auto;
    box-sizing: border-box;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(0,0,0,0.72);
    color: #fff;
    z-index: 2;
    text-align: left;
}

.field-note-photo-lightbox-note {
    white-space: pre-wrap;
    font-size: 15px;
    line-height: 1.4;
    margin-bottom: 7px;
}

.field-note-photo-lightbox-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: rgba(255,255,255,0.88);
    font-size: 12px;
    line-height: 1.3;
}

@media (max-width: 600px) {
    .field-note-photo-lightbox-details {
        bottom: 46px;
        width: calc(100vw - 76px);
        max-height: 25vh;
        padding: 8px 10px;
    }

    .field-note-photo-lightbox-note {
        font-size: 14px;
    }
}


/* Field-note popup compact layout */
.field-note-popup-metadata {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 14px;
    margin-bottom: 8px;
}

.field-note-popup-metadata-item {
    gap: 0;
}

.field-note-popup-weather-icons {
    gap: 4px;
}

.field-note-popup-weather-icon {
    font-size: 34px;
    line-height: 1;
}

.field-note-popup-creator strong {
    font-size: 12px;
}

.field-note-popup-date {
    justify-content: flex-start;
    color: #555;
    font-size: 12px;
}

.field-note-popup-light {
    justify-content: flex-start;
    color: #555;
    font-size: 12px;
}

.field-note-popup-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 7px;
}

.field-note-popup-photo {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
}

.field-note-popup-actions {
    align-items: center;
    margin: 8px 0 0;
}

.field-note-popup-navigation {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: auto;
}

.field-note-popup-nav {
    width: 30px;
    height: 36px;
    min-width: 30px;
    padding: 0;
    border: 1px solid #bbb;
    border-radius: 7px;
    background: #fff;
    color: #333;
    font: inherit;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.field-note-popup-nav:hover {
    background: #f2f2f2;
}

.field-note-popup-position {
    min-width: 42px;
    text-align: center;
    color: #666;
    font-size: 11px;
    line-height: 1;
}

.field-note-photo-lightbox-weather {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 28px;
    line-height: 1;
}

.field-note-photo-lightbox-light {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
}

.field-note-photo-lightbox-light-icon {
    width: 48px;
    height: 36px;
}

@media (max-width: 600px) {
    .field-note-popup-weather-icon {
        font-size: 30px;
    }

    .field-note-popup-photo {
        width: 114px;
        height: 114px;
    }

    .field-note-popup-metadata {
        gap: 5px 12px;
    }
}


/* Final field-note popup action styling */
.field-note-popup-edit {
    gap: 7px;
}

.field-note-popup-edit svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.field-note-popup-navigation {
    flex: 0 0 auto;
}

.field-note-popup-actions .field-note-popup-navigation {
    margin-left: 0;
}

.field-note-popup-actions .field-note-popup-edit {
    margin-left: auto;
}


/* Compact, label-free solar phase icons in field-note metadata. */
.field-note-popup-light {
    justify-content: flex-start;
    min-height: 32px;
}

.field-note-light-icon {
    display: block;
    width: 48px;
    height: 36px;
    overflow: visible;
    color: #263b52;
}

.field-note-light-icon path,
.field-note-light-icon circle {
    vector-effect: non-scaling-stroke;
}

.field-note-light-icon .light-rays {
    fill: none;
    stroke: currentColor;
    stroke-width: 2.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.field-note-light-icon .light-sun {
    fill: currentColor;
    stroke: currentColor;
    stroke-width: 1;
}

.field-note-light-icon .light-horizon {
    fill: none;
    stroke: #263b52;
    stroke-width: 2.6;
    stroke-linecap: round;
}

.field-note-light-icon .light-dash {
    fill: none;
    stroke: #263b52;
    stroke-width: 2;
    stroke-dasharray: 2 3;
    stroke-linecap: round;
}

.field-note-light-icon .light-halo {
    fill: currentColor;
    opacity: 0.12;
    stroke: none;
}

.field-note-light-icon-golden {
    color: #e9a126;
}

.field-note-light-icon-golden .light-horizon {
    stroke: #263b52;
}

.field-note-light-icon-blue {
    color: #3b8ed8;
}

.field-note-light-icon-blue .light-halo {
    opacity: 0.16;
}

.field-note-light-icon-night {
    color: #263b52;
}

.field-note-light-icon-night .light-moon,
.field-note-light-icon-night .light-star {
    fill: currentColor;
    stroke: none;
}


.field-note-cluster-container {
    background: transparent;
    border: none;
}

.field-note-cluster {
    display: flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #333;
    color: #fff;
    font: 700 14px/1 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: 0 1px 6px rgba(0,0,0,0.7);
}


/* Accessible modal used for photo-import results and troubleshooting. */
.fpns-photo-import-dialog {
    width: min(640px, calc(100% - 32px));
    max-width: 640px;
    max-height: min(82vh, 760px);
    padding: 0;
    border: 0;
    border-radius: 12px;
    color: #222;
    background: #fff;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
    overflow: auto;
}

.fpns-photo-import-dialog::backdrop {
    background: rgba(0, 0, 0, 0.62);
}

.fpns-photo-import-dialog-panel {
    position: relative;
    padding: 28px;
    font: 16px/1.5 "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.fpns-photo-import-dialog-panel h2 {
    margin: 0 90px 18px 0;
    font-size: 23px;
    line-height: 1.25;
}

.fpns-photo-import-dialog-panel h3 {
    margin: 22px 0 8px;
    font-size: 18px;
}

.fpns-photo-import-dialog-panel h4 {
    margin: 16px 0 6px;
    font-size: 16px;
}

.fpns-photo-import-dialog-panel p {
    margin: 8px 0;
}

.fpns-photo-import-dialog-panel ul {
    margin: 6px 0 14px;
    padding-left: 24px;
}

.fpns-photo-import-dialog-panel li {
    margin: 0 0 10px;
}

.fpns-photo-import-dialog-panel .fpns-photo-import-errors li p {
    margin: 3px 0 0;
}

.fpns-photo-import-summary {
    font-weight: 600;
}

.fpns-photo-import-dialog-close {
    position: absolute;
    top: 20px;
    right: 22px;
    min-width: 72px;
    padding: 8px 13px;
    border: 1px solid #777;
    border-radius: 6px;
    background: #f4f4f4;
    color: #222;
    font: inherit;
    cursor: pointer;
}

.fpns-photo-import-dialog-close:hover {
    background: #e7e7e7;
}

.fpns-photo-import-dialog-close:focus-visible {
    outline: 3px solid #2374d8;
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .fpns-photo-import-dialog-panel {
        padding: 22px 18px;
        font-size: 15px;
    }

    .fpns-photo-import-dialog-panel h2 {
        font-size: 20px;
    }

    .fpns-photo-import-dialog-close {
        top: 14px;
        right: 14px;
    }
}
