
    :root {
        --primary-color: #b31b1b;
        --secondary-color: #2e261f;
        --button-color: #36824b;
        --plot-primary-color: #385B75;
    }
    /* Local fonts (Google Fonts subsets via Fontsource: Montserrat 9.000, Merriweather 2.002).
   The latin-ext files cover Czech and other Central European letters and are only
   downloaded when a page uses them. */
@font-face {
    font-family: 'Montserrat';
    src: url('/swamp/assets/external/fonts/Montserrat-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Montserrat';
    src: url('/swamp/assets/external/fonts/Montserrat-Light-LatinExt.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Montserrat';
    src: url('/swamp/assets/external/fonts/Montserrat-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Montserrat';
    src: url('/swamp/assets/external/fonts/Montserrat-Regular-LatinExt.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Montserrat';
    src: url('/swamp/assets/external/fonts/Montserrat-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Montserrat';
    src: url('/swamp/assets/external/fonts/Montserrat-Bold-LatinExt.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Merriweather';
    src: url('/swamp/assets/external/fonts/Merriweather-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Merriweather';
    src: url('/swamp/assets/external/fonts/Merriweather-Light-LatinExt.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Merriweather';
    src: url('/swamp/assets/external/fonts/Merriweather-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Merriweather';
    src: url('/swamp/assets/external/fonts/Merriweather-Regular-LatinExt.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Merriweather';
    src: url('/swamp/assets/external/fonts/Merriweather-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Merriweather';
    src: url('/swamp/assets/external/fonts/Merriweather-Bold-LatinExt.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Design tokens (project colors are injected by app.py) */
:root {
    --font-sans: 'Montserrat', 'Noto Sans', sans-serif;
    --font-serif: 'Merriweather', 'Noto Serif', serif;
    --radius-sm: 6px;
    --radius: 12px;
    --radius-pill: 999px;
    --border-subtle: rgba(0, 0, 0, 0.08);
    --surface-muted: #f6f7f8;
    --text-muted: #6c757d;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.18);
    --ease: 0.2s ease;
}

/* Custom CSS for the layout */
body {
    font-family: var(--font-sans); /* Set the default font */
    margin: 0 auto; /* Center the content */
    padding: 0 0px; /* Add some padding to the sides */
    letter-spacing: 0.02em; /* Adjust letter spacing for body text */
    background-color: #fff;
    color: #212529;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

::selection {
    background-color: var(--primary-color);
    color: #fff;
}

:focus-visible {
    outline: 2px solid var(--button-color);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}

/* Type hierarchy follows the Cornell Lab brand guide (Gibson / Suisse Works).
   Montserrat and Merriweather stand in; both run larger than the brand faces,
   so body and subhead sizes are scaled down slightly to match visually. */
h1, h2, h3, h4, h5 {
    font-family: var(--font-sans); /* Ensure Montserrat font is applied */
    letter-spacing: -.02em; /* Adjust letter spacing for headings */
}

h1 {
    font-weight: 300; /* Light */
    font-size: 4.625rem; /* Headline size */
}

h2 {
    font-weight: 300; /* Light */
    font-size: 2.5rem; /* Subhead size */
}

h3 {
    font-weight: 400; /* Book */
    font-size: 2rem; /* Title size */
}

h4 {
    font-weight: 400; /* Book */
    font-size: 1.5rem; /* Section tag size */
}

/* Player control icons are h4 elements */
h4.bi {
    font-size: 1.33em;
}

h5 {
    font-weight: 400; /* Regular */
    font-size: 1.15em; /* Section tag size */
}

h6 {
    font-weight: 400; /* Regular */
    font-size: 0.9em; /* Section tag size */
}

/* Paragraph copy: Suisse Works Regular 1.125rem in the guide */
p {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.75;
    letter-spacing: 0.01em;
}

/* Small paragraph copy: Suisse Works Regular .875rem in the guide */
p.small-text {
    font-size: 0.8rem;
}

a {
    text-decoration: none;
    transition: color var(--ease), opacity var(--ease);
}

.caption {
    font-family: var(--font-sans);
    font-weight: 400; /* Regular */
    font-size: .85rem; /* Caption size */
    letter-spacing: 0.01em; /* Adjust letter spacing for captions */
}

.large-text {
    font-size: 1.5em; 
}

.medium-text {
    font-size: 1.2em; 
}

.medium-small-text {
    font-size: 1.0em; 
}

.small-text {
    font-size: 0.8em; 
}

.very-small-text {
    font-size: 0.7em; 
}

.super-small-text {
    font-size: 0.6em; 
}

@media (max-width: 768px) {
    .super-small-text {
        font-size: 0.5em; 
    }
}

.bold-text {
    font-weight: 700; 
}

.full-width {
    width: 100%;
    margin: 0;
    padding: 0;
}

.centered-text {
    text-align: center;
}

/* Additional styles */
.header-logo {
    max-height: 25px;
    margin-top: 5px;
    margin-bottom: 5px;
}

.header-logo-short {
    display: none;
}

.header-logo-long {
    display: block;
}

@media (max-width: 768px) {
    .header-logo-short {
        display: block;
    }
    .header-logo-long {
        display: none;
    }
}

.divider {
    border-left: 1px solid rgb(46, 46, 46); 
    height: 25px; 
    margin: 0 0px;
}

nav .navbar-nav {
    margin-left: auto;
    align-items: center;
}

/* Frosted sticky navbar */
.navbar-border {
    border-top: 3px solid var(--primary-color);
    background-color: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    box-shadow: 0 1px 0 var(--border-subtle), 0 2px 12px rgba(0, 0, 0, 0.04);
}

.navbar-border .nav-link {
    color: #444;
    border-radius: var(--radius-sm);
    transition: color var(--ease), background-color var(--ease);
}

.navbar-border .nav-link:hover,
.navbar-border .nav-link:focus-visible {
    color: var(--primary-color);
}

.navbar-border .dropdown-menu {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 6px;
}

.navbar-border .dropdown-item {
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

/* Recorder items nest a NavLink inside the menu item */
.navbar-border .dropdown-item .dropdown-item {
    padding: 0;
    background: none;
    color: inherit;
}

.navbar-border .dropdown-item:hover,
.navbar-border .dropdown-item:focus {
    background-color: var(--surface-muted);
    color: var(--primary-color);
}

.navbar-toggler {
    border: none;
    border-radius: var(--radius-sm);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 2px var(--border-subtle);
}

.home-text {
    display: none;
}

@media (max-width: 768px) {
    .home-icon {
        display: none;
    }
    .home-text {
        display: inline;
    }
}

.nav-link.active-nav {
    position: relative;
}

.nav-link.active-nav {
    color: var(--primary-color) !important;
}

.nav-link.active-nav::after {
    content: '';
    position: absolute;
    bottom: -0.35rem;
    left: 0.5rem;
    right: 0.5rem;
    height: 3px;
    border-radius: var(--radius-pill);
    background-color: var(--primary-color);
}

@media (max-width: 768px) {
    .nav-link.active-nav::after {
        content: none;
    }
}

#nav-dashboard {
    display: none;
}

#nav-donate {
    color: white;
    background-color: var(--primary-color);
    border-radius: var(--radius-pill);
    padding: 0.4rem 1.25rem;
    margin-left: 12px;
    font-weight: 700;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: filter var(--ease), box-shadow var(--ease), transform var(--ease);
}

#nav-donate:hover {
    filter: brightness(1.1);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    #nav-donate {
        display: inline-block;
        margin: 8px 0;
    }
}

.header-graphic {
    width: 100%;
    max-height: 850px; /* Adjust the height as needed */
    object-fit: cover; /* Ensures the image covers the entire width */
    margin-bottom: 0; /* Remove bottom margin */
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 55%;
    max-width: 900px;
    height: 100%;
    background: linear-gradient(90deg, rgba(20, 17, 14, 0.75) 0%, rgba(20, 17, 14, 0.45) 65%, rgba(20, 17, 14, 0) 100%);
    color: white;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center items vertically */
    align-items: flex-start; /* Align items to the left */
    padding: 50px;
    box-sizing: border-box;
}

.header-overlay h1 {
    font-size: 3rem;
    line-height: 1.1;
    margin: 0;
    max-width: 14em;
}

.header-overlay h2 {
    font-size: 1.6rem;
    margin: 0.75rem 0 0;
    text-align: left;
    opacity: 0.9;
}

@media (max-width: 1024px) {
    .header-overlay {
        display: none;
    }

    .header-text {
        display: block !important;
        margin-bottom: 25px;
        text-align: center; /* Align text to the left */
        width: 100%; /* Full width */
        box-sizing: border-box; /* Include padding and border in the element's total width and height */
    }

    .header-text h1 {
        font-size: 2rem;
    }

    .header-text h2 {
        font-size: 1.5rem;
    }
}

.header-text {
    display: none;
}

.listen-live-button {
    position: absolute;
    bottom: 24px;
    right: 24px;
    background-color: var(--button-color);
    color: white;
    border: none;
    border-radius: var(--radius-pill);
    padding: 10px 22px;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: var(--shadow-lg);
    transition: filter var(--ease), transform var(--ease);
}

.listen-live-button i {
    margin-right: 6px; /* Space between icon and text */
}

.listen-live-button:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.listen-live-button:active {
    background-color: var(--button-color);
    transform: none;
}

.stat-row-container {
    max-width: 1150px;
    margin-left: auto;
    margin-right: auto;
}

.stat-row {
    background-color: var(--secondary-color);
    color: white;
    padding: 14px 15px;
    text-align: center;
    margin: 0;
    margin-left: auto;
    margin-right: auto;
}

.stat-column {
    padding: 6px 16px;
    text-align: left;
    font-size: 1rem;
    font-weight: 400;
}

@media (min-width: 768px) {
    .stat-column + .stat-column {
        border-left: 1px solid rgba(255, 255, 255, 0.15);
    }
}

.stat-column h4 {
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: -0.02em;
    margin: 2px 0 0;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 576px) {
    .stat-column h4 {
        font-size: 1.25rem;
    }
}

.stats-bar-headline {
    font-size: 0.7rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.75;
    margin-top: 0;
    margin-bottom: 0;
}

.h-spacer {
    margin: 0 10px; 
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 15px 15px;
}

/* Section headings use the guide's subhead (h2) style */
.divider-heading {
    margin-top: 0;
    margin-bottom: 0.4em;
    font-size: 2.25rem;
    font-weight: 300;
    text-align: center;
    position: relative;
}

/* Section header: the first line is dropped, the last becomes a short accent bar */
.divider-line {
    width: 48px;
    height: 3px;
    border-radius: var(--radius-pill);
    background-color: var(--primary-color);
    margin: 0 auto 1.5rem;
}

.divider-container .divider-line:first-child {
    display: none;
}

.divider-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 3.5rem;
}

@media (max-width: 576px) {
    .divider-heading {
        font-size: 1.5rem;
    }
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.text-justify {
    text-align: justify;
}

@media (max-width: 576px) {
    .text-justify {
        text-align: left;
    }
}

.btn-href {
    background-color: var(--button-color);
    color: white;
    border: none;
    border-radius: var(--radius-pill);
    padding: 8px 22px;
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: filter var(--ease), box-shadow var(--ease), transform var(--ease);
}

.btn-href:hover,
.btn-href:focus-visible {
    background-color: var(--button-color);
    color: white;
    filter: brightness(1.1);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    text-decoration: none;
}

.btn-href:active {
    background-color: var(--button-color);
    transform: none;
}

.spinner {
    height: 25px;
    padding: 0em;
}

.spinner-icon {
    animation: spin 1s linear infinite;
    display: inline-block;
}

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

.back-to-top-link {
    color: var(--button-color);
}

.species-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.species-image {
    max-height: 50px;
    max-width: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
    transition: transform var(--ease);
}

a:hover > .species-image {
    transform: scale(1.05);
}

@media screen and (max-width: 768px) {
    .species-image {
        max-height: 80px;
        margin-top: 5px;
    }
    
}

.total-detections-bar {
    width: 100%;
    height: 8px;
    background-color: #ebedef;
    border-radius: var(--radius-pill);
    overflow: hidden;
    margin-top: 3px;
}

.total-detections-bar-fill {
    height: 100%;
    border-radius: var(--radius-pill);
    background-color: var(--plot-primary-color);
}

.species-info {
    height: 35px;
}

.species-plot {
    height: 50px;
}

.play-icon-overlay {
    position: absolute;
    bottom: 10px; 
    left: 15px; 
    font-size: 3em; 
    color: white;
    pointer-events: auto; 
    cursor: pointer; 
    z-index: 10; 
    filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.5)) drop-shadow(0 1px 5px rgba(0, 0, 0, 0.5));
}

/* Dark disc behind the play triangle (a cut-out in the glyph) so it stays visible on light photos */
.play-icon-overlay .bi {
    display: inline-block;
    line-height: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.6) 0 45%, transparent 46%);
}

.chart-icon {
    vertical-align: middle;
    color: var(--plot-primary-color);
}

.chart-icon-overlay {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5em;
    color: white;
    pointer-events: auto;
    cursor: pointer;
    z-index: 10;
    filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.5)) drop-shadow(0 1px 4px rgba(0, 0, 0, 0.5));
}

.card-title {
    font-size: 1em;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.card-subtitle {
    font-size: 0.75em;
    font-style: italic;
}

/* Soft, borderless cards with a gentle hover lift */
.main-content .card,
.species-main-content .card {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--ease), transform var(--ease);
}

.main-content .card:hover,
.species-main-content .card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.main-content .card-header {
    background-color: var(--surface-muted);
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 700;
}

.card-img-top {
    position: relative;
    width: 100%; /* Ensure the image takes the full width of the card */
    height: auto; /* Maintain aspect ratio */
    transition: transform 0.4s ease;
}

.card a:hover .card-img-top {
    transform: scale(1.03);
}

.card > div:first-child {
    overflow: hidden;
}

.photo-author-overlay {
    position: absolute;
    bottom: 6px;
    right: 6px;
    font-size: 0.5rem;
    color: white;
    background-color: rgba(20, 17, 14, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 2px 6px;
    border-radius: var(--radius-pill);
    z-index: 10;
}

.confidence-score {
    font-size: 1rem; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.confidence-score-container {
    position: relative;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column; /* Stack the text and bar vertically */
}

.confidence-score-text {
    font-size: 1rem; 
    margin-bottom: 0; 
}

.confidence-score-bar {
    width: 100%;
    height: 5px;
    background-color: var(--color); /* Use the color based on the score */
    border-radius: 5px;
    margin-top: 5px;
    position: relative;
    overflow: hidden;
}

.confidence-score-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: calc(var(--value) * 1%);
    height: 100%;
    background-color: var(--color); /* Use the color based on the score */
}

.recorder-note {
    background-color: var(--plot-primary-color);
    border-radius: var(--radius);
    color: white;
    padding: 10px 15px;
    font-size: 0.85rem;
    font-weight: 500;
    width: 100%;
}

.chart-icon {
    font-size: 1.2em;
    margin-left: 10px;
}

.weather-row {
    display: flex;
    align-items: center;
    justify-content: center;
}

.weather-info {
    display: flex;
    align-items: center;
    justify-content: left;
    padding: 5px;
    padding-left: 10px;
    font-size: 0.7rem;
    background-color: var(--surface-muted);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    margin-top: 10px;
}

/* Rounded map frame */
.main-content .leaflet-container,
.species-main-content .leaflet-container {
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.footer-logo {
    max-height: 50px;
    max-width: 300px;
}

.footer {
    background-color: var(--secondary-color);
    padding: 40px 20px 20px;
    margin-top: 2rem;
    color: white;
    text-align: center;
    border-bottom: 3px solid var(--primary-color);
}

.footer h5 {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.9;
}

.footer li {
    margin-bottom: 0.25rem;
}

.footer .footer-content {
    padding: 20px;
    max-width: 1200px;
}

.footer p {
    margin-top: 20px;
    text-align: center;
    font-size: .875rem;
    letter-spacing: 0.02em; /* Adjust letter spacing for footer paragraphs */
}

.footer-bottom-logos {
    padding: 20px;
    max-width: 1200px;
}

.footer-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.footer .footer-logo {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 20px;
    max-width: 275px;
    max-height: 60px;
}

.footer-link {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
}

.footer-link:hover {
    color: white;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* SPECIES PAGE */

.species-page-content {
    max-width: 1200px; /* Adjust the maximum width as needed */
    margin: 0 auto; /* Center the container */
    padding: 0 0px; /* Add some padding to the sides */

}

.species-main-content {
    padding-left: 15px;
    padding-right: 15px;
}

.species-header {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.species-header-image {
    width: 100%;
    height: auto;
    max-height: 800px;
    object-fit: cover;
    display: block;
    margin: 0;
    padding: 0;
}

.species-overlay-row {
    width: 100%;
    margin: 0;
}

.species-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0)); /* Gradient background */
    color: white;
    padding: 20px;
    padding-left: 0px;
    padding-right: 0px;
    box-sizing: border-box;
}

.species-overlay-text {
    margin: 0;
    overflow-wrap: break-word;
    hyphens: auto;
}

#species-loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 320px;
}

#species-main-content {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

#species-main-content.visible {
    opacity: 1;
}

.species-info-row {
    margin-top: 0px;
    padding: 0px;
    padding-top: 20px;
    padding-bottom: 20px;
    border-radius: 5px;
}

.learn-more-btn {
    background-color: var(--button-color);
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    max-width: 200px;
}

.learn-more-btn:hover {
    background-color: var(--button-color);
    color: white;
    text-decoration: none;
}

.learn-more-btn:active {
    background-color: var(--button-color); 
}

.learn-more-btn:visited {
    background-color: var(--button-color); 
    color: white;
}

.species-daily-activity-plot {
    height: 90px;
    margin-top: 10px;
    margin-bottom: 25px;
}

.species-weekly-detections-plot {
    height: 175px;
    margin-top: 10px;
    margin-bottom: 25px;
}

@media (max-width: 576px) {
    .species-weekly-detections-plot {
        height: 200px;
    }
}

.recent-detections-heading {
    margin-top: 5px;
    margin-left: 0px;
}

/* Tables: no grid lines, rounded frame, light header */
.detections-table {
    margin-top: 20px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

.detections-table > :not(caption) > * > * {
    border-left-width: 0;
    border-right-width: 0;
    border-color: var(--border-subtle);
}

.detections-table > tbody > tr:last-child > * {
    border-bottom-width: 0;
}

.detections-table th {
    position: relative;
    text-align: center; /* Center the text in the header */
    cursor: pointer; /* Make the entire header clickable */
    background-color: var(--surface-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #555;
    transition: color var(--ease);
}

.detections-table th:hover {
    color: var(--primary-color);
}

.detections-table th .sortable-header {
    display: flex;
    align-items: center;
    justify-content: center;
}

.detections-table th .bi-arrow-down-up {
    font-size: 0.8em;
    margin-left: 5px; /* Add some space between the text and the icon */
}

.detections-table td {
    font-size: 0.85em;
    text-align: center;
    vertical-align: middle;
}

@media (max-width: 576px) {
    .detections-table th,
    .detections-table td {
        padding: 0.5rem 0.3rem;
    }

    .detections-table th {
        font-size: 0.85rem;
    }

    .detections-table td {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .truncate {
        white-space: pre-wrap;
        overflow-wrap: anywhere;
        hyphens: auto;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }
}

.play-button {
    color: var(--button-color);
    font-size: 1.5em;
}

.play-button:hover {
    color: var(--button-color);
    opacity: 0.75;
    text-decoration: none;
}

.play-button:active {
    color: var(--button-color);
}

.confidence-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
}

/* Recorder page styles - reusing species page classes where possible */
#recorder-loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 320px;
}

#recorder-main-content {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

#recorder-main-content.visible {
    opacity: 1;
}

.species-column-header {
    width: 40%;
}

.species-column {
    display: flex;
    align-items: center;
    text-align: left !important;
}

.species-thumbnail {
    height: 40px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-right: 10px;
    vertical-align: middle;
}

@media (max-width: 640px) {
    .hide-on-small-screens {
        display: none;
    }
}

.species-name {
    vertical-align: middle;
}

/* About page */
.about-link {
    color: var(--button-color);
    font-weight: 400;
}

.about-sidebar{
    height: 350px;
    margin-top: -16px;
    padding-top: 20px;
}

@media (max-width: 768px) {
    .about-sidebar {
        height: 300px;
    }
}

.clearfix::after {
    content: "";
    clear: both;
    display: table;
}

.team-image {
    width: 90%;
    max-width: 150px;
    height: auto;
    border-radius: 50%;
    margin-bottom: 10px;
}

.team-name {
    font-weight: bold;
    color: #333;
}

.partner-logo{
    width: 100%;
}

/* PLAYER WIDGET */
#popup-backdrop,
#livestream-popup-backdrop {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 990;
}

#close-livestream-popup-button:hover,
#close-popup-button:hover,
#popup-replay-button:hover {
    cursor: pointer;
}

#popup-next-button,
#popup-previous-button {
    color: inherit;
    cursor: pointer;
}

#popup-next-button.disabled,
#popup-previous-button.disabled {
    color: rgb(222, 222, 222);
}

#popup {
    ::part(canvases) {
        display: none;
    }
}

#popup,
#livestream-popup {
    position: fixed;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background: #fff;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    top: 100%;
    opacity: 0;
    display:none;
    transition:
      opacity 0.75s,
      top 0.75s,
      display 0.75s allow-discrete;
}

#livestream-popup-play-button {
    display: none;
}


@media only screen and (max-width: 599px) {
    #popup,
    #livestream-popup  {
        width: calc(100vw - 24px);
        max-width: 380px;
    }
}

@media only screen and (min-width: 600px) {
    #popup,
    #livestream-popup  {
        width: 500px;
    }
}

@media only screen and (min-width: 900px) {
    #popup,
    #livestream-popup  {
        width: 800px;
    }
}

#popup.visible,
#livestream-popup.visible  {
    display: block;
    top: 50%;
    opacity: 1;
}

.popup-button {
    background: none;
    border: none;
    font-size: 1.0rem;
    cursor: pointer;
    margin-left: 25px;
    color: #000;
}

.popup-button:hover {
    color: var(--button-color);
}

.popup-button:visited {
    color: #000;
}

/* Markdown pages (privacy policy): match site typography and link color */
.markdown-content {
    overflow-wrap: break-word;
    hyphens: auto;
}

.markdown-content a {
    color: var(--button-color);
}

.markdown-content li {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.75;
}

/* Maps use fractional zoom; overlap tiles by half a pixel to hide hairline seams */
.leaflet-container img.leaflet-tile {
    mix-blend-mode: normal;
    width: 256.5px !important;
    height: 256.5px !important;
}

/* About page anchors (#about-contact etc.): keep headings clear of the sticky navbar */
h4[id^="about-"] {
    scroll-margin-top: 80px;
}
