:root {
    --bfsp-bg: #ffffff;
    --bfsp-text: #111827;
    --bfsp-card-bg: #f9fafb;
    --bfsp-border: #e5e7eb;
}

.bfsp-dark {
    --bfsp-bg: #111827;
    --bfsp-text: #e5e7eb;
    --bfsp-card-bg: #1f2937;
    --bfsp-border: #374151;
}

.bfsp-root {
    background: var(--bfsp-bg);
    color: var(--bfsp-text);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--bfsp-border);
    margin-bottom: 1.5rem;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.bfsp-dark-toggle {
    float: right;
    margin: 0 0 0.5rem 0.5rem;
}

.bfsp-submit-form label,
.bfsp-alert-form label {
    display: block;
    margin-bottom: 0.75rem;
}
.bfsp-submit-form input[type="text"],
.bfsp-submit-form input[type="email"],
.bfsp-submit-form input[type="date"],
.bfsp-submit-form input[type="number"],
.bfsp-submit-form select,
.bfsp-submit-form textarea,
.bfsp-alert-form input {
    width: 100%;
    max-width: 400px;
    padding: 0.3rem 0.4rem;
    border-radius: 4px;
    border: 1px solid var(--bfsp-border);
    background: var(--bfsp-bg);
    color: var(--bfsp-text);
}

.bfsp-steps-indicator {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.bfsp-step-circle {
    flex: 1;
    text-align: center;
    border-radius: 999px;
    border: 1px solid var(--bfsp-border);
    padding: 0.4rem;
    font-size: 0.8rem;
    background: var(--bfsp-card-bg);
}
.bfsp-step-circle.bfsp-step-active {
    border-color: #2563eb;
    font-weight: 600;
}

.bfsp-step {
    display: none;
}
.bfsp-step-active {
    display: block;
}

.bfsp-step-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

.bfsp-field-error {
    display: block;
    color: #b91c1c;
    font-size: 0.8rem;
}

.bfsp-errors {
    border-left: 4px solid #b91c1c;
    background: #fef2f2;
    padding: 0.5rem 0.75rem;
    margin-bottom: 1rem;
}

.bfsp-directory-toolbar,
.bfsp-map-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.bfsp-directory-toolbar label,
.bfsp-map-toolbar label {
    font-size: 0.85rem;
}
.bfsp-directory-toolbar input,
.bfsp-directory-toolbar select,
.bfsp-map-toolbar input,
.bfsp-map-toolbar select {
    margin-left: 0.25rem;
}

.bfsp-directory {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
}
.bfsp-view-list .bfsp-card {
    grid-column: 1 / -1;
}
.bfsp-card {
    background: var(--bfsp-card-bg);
    border-radius: 8px;
    border: 1px solid var(--bfsp-border);
    padding: 0.75rem;
}
.bfsp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.bfsp-card-id {
    font-size: 0.75rem;
    opacity: 0.8;
}
.bfsp-card-meta {
    margin: 0.5rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}
.bfsp-chip {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
    border: 1px solid var(--bfsp-border);
    font-size: 0.75rem;
}
.bfsp-chip-class {
    font-weight: 600;
}
.bfsp-chip-photo {
    border-color: #10b981;
}
.bfsp-card-excerpt {
    font-size: 0.9rem;
}
.bfsp-card-actions {
    margin-top: 0.5rem;
}
.bfsp-details-panel {
    margin-top: 0.5rem;
}

.bfsp-details-panel-inner {
    background: var(--bfsp-bg);
    border-radius: 8px;
    border: 1px solid var(--bfsp-border);
    padding: 0.75rem;
}
.bfsp-details-close {
    float: right;
    border: none;
    background: transparent;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}
.bfsp-details-photo img {
    max-width: 100%;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}
.bfsp-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}
.bfsp-details-mini-map {
    height: 200px;
    margin-top: 0.5rem;
}

.bfsp-map-details-panel {
    margin-top: 0.75rem;
}

.bfsp-stat {
    display: inline-block;
    margin-right: 1rem;
}
.bfsp-stat-label {
    font-size: 0.8rem;
    opacity: 0.8;
}
.bfsp-stat-value {
    font-size: 1.4rem;
    font-weight: 600;
}

.bfsp-hotspot-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}
.bfsp-hotspot-table th,
.bfsp-hotspot-table td {
    border: 1px solid var(--bfsp-border);
    padding: 0.3rem 0.4rem;
    font-size: 0.9rem;
}

.bfsp-alert-message {
    margin-bottom: 0.75rem;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
}
.bfsp-alert-success {
    background: #ecfdf5;
    border-left: 4px solid #10b981;
}
.bfsp-alert-error {
    background: #fef2f2;
    border-left: 4px solid #b91c1c;
}


.bfsp-details-row {
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
}


.bfsp-directory-toolbar,
.bfsp-map-toolbar {
    align-items: flex-start;
}

.bfsp-view-toggle-wrap {
    display: inline-flex;
    gap: 0.25rem;
}

.bfsp-card {
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.bfsp-card:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.bfsp-view-list .bfsp-card {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.75rem;
}
.bfsp-view-list .bfsp-card-header {
    flex-direction: column;
    align-items: flex-start;
}
.bfsp-view-list .bfsp-card-excerpt {
    flex: 1 1 auto;
}

.bfsp-details-panel {
    overflow: hidden;
}

.bfsp-stat-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.bfsp-stat-group canvas {
    width: 100%;
    height: 180px;
}

.bfsp-details-row {
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
}

/* Gallery for single sighting */
.bfsp-single-gallery {
    margin-top: 0.75rem;
}
.bfsp-single-gallery-main img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}
.bfsp-single-gallery-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 0.5rem;
}
.bfsp-single-gallery-thumbs img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 3px;
    display: block;
}


.bfsp-details-gallery {
    margin-bottom: 0.75rem;
}
.bfsp-details-gallery-main img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}
.bfsp-details-gallery-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 0.5rem;
}
.bfsp-details-gallery-thumbs img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 3px;
    display: block;
}


/* Multi-photo galleries */
.bfsp-details-gallery,
.bfsp-single-gallery {
    margin: 1rem 0;
}
.bfsp-details-gallery-main img,
.bfsp-single-gallery-main img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}
.bfsp-details-gallery-thumbs,
.bfsp-single-gallery-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}
.bfsp-details-gallery-thumbs img,
.bfsp-single-gallery-thumbs img {
    display: block;
    max-width: 80px;
    max-height: 80px;
    border-radius: 3px;
}

/* Lightbox */
.bfsp-lightbox {
    position: fixed;
    top:0; left:0; right:0; bottom:0;
    background: rgba(0,0,0,0.85);
    display:flex;
    align-items:center;
    justify-content:center;
    z-index:99999;
}
.bfsp-lightbox-inner img {
    max-width:90vw;
    max-height:90vh;
    border-radius:4px;
}
.bfsp-lightbox-close {
    position:absolute;
    top:20px;
    right:30px;
    font-size:3rem;
    color:#fff;
    cursor:pointer;
}


/* Gallery arrows */
.bfsp-details-gallery-main,
.bfsp-single-gallery-main {
    position: relative;
}
.bfsp-gallery-prev,
.bfsp-gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: rgba(0,0,0,0.45);
    color: #fff;
    width: 28px;
    height: 44px;
    line-height: 44px;
    text-align: center;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1.4rem;
}
.bfsp-gallery-prev {
    left: 8px;
}
.bfsp-gallery-next {
    right: 8px;
}


/* Quick filter chip-style button */
.bfsp-chip-button {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.15);
    background: #f3f4f6;
    font-size: 0.85rem;
    cursor: pointer;
}
.bfsp-chip-button.is-active {
    background: #1f2937;
    color: #fff;
    border-color: #1f2937;
}


/* Card hover polish */
.bfsp-card {
    transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.bfsp-card:hover {
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.45);
}


/* Card media with photo overlay */
.bfsp-card-media {
    position: relative;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.bfsp-card-media img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}
.bfsp-card-photo-overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: 0.25rem 0.5rem;
    background: linear-gradient(to top, rgba(15,23,42,0.9), transparent);
    color: #fff;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.15s ease;
    text-align: right;
}
.bfsp-card:hover .bfsp-card-photo-overlay {
    opacity: 1;
}

/* Directory load-more */
.bfsp-directory-more {
    text-align: center;
    margin: 1.5rem 0 0.5rem;
}
.bfsp-button-more {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    border-radius: 999px;
    border: 1px solid rgba(15,23,42,0.25);
    background: #f3f4f6;
    cursor: pointer;
    font-size: 0.9rem;
}


.bfsp-details-chips {
    margin: 0 0 0.5rem;
}
