/* Field Surveys — rich inventory popup (see field_survey_popup.js) */

.maplibregl-popup.fs-popup-wrap .maplibregl-popup-content {
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg, 0 16px 40px rgba(15, 31, 61, 0.12));
}
.maplibregl-popup.fs-popup-wrap .maplibregl-popup-close-button {
    font-size: 18px;
    padding: 2px 8px;
    color: var(--muted, #6b7689);
}

.fs-popup {
    width: min(400px, calc(100vw - 48px));
    font-size: 12.5px;
    color: var(--ink, #0f1f3d);
    line-height: 1.4;
}

.fs-head {
    padding: 12px 34px 10px 14px;
    background: var(--panel-soft, #f6f8fb);
    border-bottom: 1px solid var(--border, #e6ebf2);
}
.fs-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fs-title { font-size: 14px; letter-spacing: 0.01em; }
.fs-status {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 999px;
    border: 1px solid transparent;
}
.fs-status-good { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.fs-status-fair { background: #fef9c3; color: #854d0e; border-color: #fde68a; }
.fs-status-poor { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.fs-habitat { display: flex; align-items: flex-start; gap: 6px; margin-top: 6px; color: var(--ink-soft, #1f2a44); }
.fs-swatch { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; }
.fs-meta { margin-top: 4px; font-size: 11.5px; color: var(--muted, #6b7689); }

.fs-tabs {
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid var(--border, #e6ebf2);
    scrollbar-width: none;
}
.fs-tabs::-webkit-scrollbar { display: none; }
.fs-tab {
    flex: 0 0 auto;
    border: 0;
    background: none;
    padding: 8px 6px;
    font: inherit;
    font-size: 11.5px;
    color: var(--muted, #6b7689);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}
.fs-tab:hover { color: var(--ink, #0f1f3d); }
.fs-tab.active { color: var(--accent-strong, #0f7ae5); border-bottom-color: var(--accent-strong, #0f7ae5); font-weight: 600; }
.fs-tab:focus-visible { outline: 2px solid var(--accent, #0ea5e9); outline-offset: -2px; }

.fs-body { max-height: min(380px, 50vh); overflow-y: auto; padding: 10px 14px 12px; }
.fs-panel { display: none; }
.fs-panel.active { display: block; }

.fs-photo { margin: 0 0 10px; }
.fs-photo-slot {
    min-height: 60px;
    border-radius: 8px;
    background: var(--panel-softer, #f0f3f8);
    color: var(--muted, #6b7689);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px;
}
.fs-photo-slot.fs-photo-loaded { padding: 0; background: none; }
.fs-photo img { width: 100%; max-height: 170px; object-fit: cover; display: block; border-radius: 8px; cursor: zoom-in; }
.fs-photo figcaption { font-size: 11px; color: var(--muted, #6b7689); margin-top: 4px; }

.fs-observation {
    background: #fff7ed;
    border-left: 3px solid #f59e0b;
    padding: 6px 8px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.fs-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.fs-kpi {
    border: 1px solid var(--border, #e6ebf2);
    border-radius: 8px;
    padding: 6px 8px;
    cursor: help;
}
.fs-kpi-value { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fs-kpi-label { font-size: 11px; color: var(--muted, #6b7689); }

.fs-note { margin-top: 8px; font-size: 11px; color: var(--muted, #6b7689); }
.fs-empty { color: var(--muted, #6b7689); font-style: italic; }
.fs-subtitle { margin: 10px 0 4px; font-size: 12px; color: var(--ink-soft, #1f2a44); }
.fs-subtitle:first-child { margin-top: 0; }

.fs-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.fs-table th {
    text-align: left;
    font-weight: 600;
    color: var(--muted, #6b7689);
    border-bottom: 1px solid var(--border-strong, #d6dde8);
    padding: 3px 4px;
    white-space: nowrap;
}
.fs-table td { border-bottom: 1px solid var(--border, #e6ebf2); padding: 4px; vertical-align: middle; font-variant-numeric: tabular-nums; }
.fs-table .fs-num { text-align: right; }

.fs-pill { display: inline-block; font-size: 10.5px; padding: 0 6px; border-radius: 999px; white-space: nowrap; }
.fs-pill-char { background: #dcfce7; color: #166534; }
.fs-pill-undes { background: #fee2e2; color: #991b1b; }
.fs-pill-dist { background: #ede9fe; color: #5b21b6; }
.fs-pill-other { background: #f1f5f9; color: #475569; }

.fs-freq { display: flex; align-items: center; gap: 6px; min-width: 96px; }
.fs-freq-label { font-size: 11px; white-space: nowrap; }
.fs-bar { flex: 1 1 auto; height: 6px; min-width: 36px; border-radius: 3px; background: var(--panel-softer, #f0f3f8); overflow: hidden; }
.fs-bar-fill { height: 100%; background: var(--accent, #0ea5e9); }
.fs-bar-fill.fs-pill-char { background: #22c55e; }
.fs-bar-fill.fs-pill-undes { background: #ef4444; }
.fs-bar-fill.fs-pill-dist { background: #8b5cf6; }
.fs-bar-fill.fs-pill-other { background: #94a3b8; }
.fs-bar-fill.fs-bar-pressure { background: #f59e0b; }

.fs-dl { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; }
.fs-dl dt { color: var(--ink-soft, #1f2a44); }
.fs-dl dd { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }

.fs-pressures { display: flex; flex-direction: column; gap: 5px; }
.fs-pressure { display: grid; grid-template-columns: 1fr 64px 28px; align-items: center; gap: 6px; }
.fs-pressure-label { font-size: 11.5px; }
.fs-pressure-score { text-align: right; font-variant-numeric: tabular-nums; font-size: 11px; }

.fs-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 14px;
    border-top: 1px solid var(--border, #e6ebf2);
    background: var(--panel-soft, #f6f8fb);
}
.fs-source { font-size: 10.5px; color: var(--muted, #6b7689); }
.fs-download {
    flex: 0 0 auto;
    border: 1px solid var(--border-strong, #d6dde8);
    background: var(--panel, #fff);
    border-radius: 6px;
    padding: 4px 8px;
    font: inherit;
    font-size: 11.5px;
    cursor: pointer;
}
.fs-download:hover { border-color: var(--accent, #0ea5e9); color: var(--accent-strong, #0f7ae5); }
