/* ============================================================
   مقناص — Arabic RTL styles (mobile-first)
   Palette: Saudi green #006c35, desert tan #c9a876, deep sand #3b2f24
   ============================================================ */

:root {
    --green:       #006c35;
    --green-dark:  #004d25;
    --green-soft:  #e7f3eb;
    --tan:         #c9a876;
    --sand:        #f5efe3;
    --ink:         #2a2a2a;
    --ink-soft:    #555;
    --muted:       #8a8a8a;
    --line:        #e3ddd1;
    --bg:          #fbf9f4;
    --card:        #ffffff;
    --shadow:      0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
    --shadow-up:   0 -4px 16px rgba(0,0,0,0.12);
    --radius:      10px;
    --header-h:    56px;
    --mode-h:      52px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    direction: rtl;
    line-height: 1.5;
    overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0 0 .4rem; font-weight: 700; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); font-size: .88em; }

/* ============================================================
   Header — mobile-first compact
   ============================================================ */

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .55rem .85rem;
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: #fff;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 900;
    min-height: var(--header-h);
}

.brand { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.logo {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: #fff;
    color: var(--green);
    border-radius: 50%;
    font-size: 1.25rem;
    font-weight: 900;
    font-family: 'Amiri', serif;
    flex-shrink: 0;
    overflow: hidden;
}
.logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.brand-text { min-width: 0; overflow: hidden; }
.app-header h1 {
    font-size: 1.1rem;
    margin: 0;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.app-header p  {
    margin: 0;
    font-size: .72rem;
    opacity: .8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hide stats on narrow screens — they reappear at ≥ 720px */
.header-stats { display: none; gap: .5rem; flex-wrap: wrap; }
.stat {
    background: rgba(255,255,255,0.12);
    padding: .3rem .75rem;
    border-radius: var(--radius);
    display: flex; flex-direction: column; align-items: center;
    min-width: 78px;
}
.stat-label { font-size: .7rem; opacity: .85; }
.stat-value { font-size: 1.05rem; font-weight: 700; }

/* ============================================================
   Mode switcher (segmented control)
   ============================================================ */

.mode-switcher {
    display: flex;
    gap: .25rem;
    padding: .4rem .5rem;
    background: #fff;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    scrollbar-width: none;
    position: sticky;
    top: var(--header-h);
    z-index: 800;
    min-height: var(--mode-h);
    -webkit-overflow-scrolling: touch;
}
.mode-switcher::-webkit-scrollbar { display: none; }

.mode-switcher button {
    flex: 1 0 auto;
    white-space: nowrap;
    padding: .5rem .9rem;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-family: inherit;
    font-size: .85rem;
    font-weight: 600;
    color: var(--ink-soft);
    cursor: pointer;
    transition: background .12s, color .12s, border-color .12s;
}
.mode-switcher button.active {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
    box-shadow: 0 1px 4px rgba(0,108,53,.3);
}
.mode-switcher button:not(.active):active,
.mode-switcher button:not(.active):hover {
    background: var(--green-soft);
    color: var(--green-dark);
}

/* ============================================================
   Layout — map-first on mobile
   ============================================================ */

.layout {
    position: relative;
    display: block;
    padding: 0;
}

/* ---------- Sidebar as bottom-sheet drawer (mobile default) ---------- */

.sidebar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 950;
    max-height: 82vh;
    background: var(--bg);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: var(--shadow-up);
    transform: translateY(100%);
    transition: transform .22s cubic-bezier(.2,.8,.2,1);
    overflow-y: auto;
    padding: .25rem 1rem 1.5rem;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.sidebar.open { transform: translateY(0); }

.sidebar-handle {
    width: 44px; height: 5px;
    background: #d2ccc0;
    border-radius: 99px;
    margin: .35rem auto .25rem;
}
.sidebar-close {
    position: absolute;
    top: .4rem; left: .5rem;
    width: 34px; height: 34px;
    border: none;
    background: rgba(0,0,0,.06);
    color: var(--ink);
    border-radius: 50%;
    font-size: 1.4rem; line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-family: inherit;
}
.sidebar-close:active { background: rgba(0,0,0,.12); }

.sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 940;
    opacity: 0;
    transition: opacity .18s;
}
.sidebar-backdrop.visible { opacity: 1; }

/* ---------- Panels ---------- */

.panel {
    background: var(--card);
    border-radius: var(--radius);
    padding: .85rem 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
}
.panel h3 {
    font-size: 1rem;
    color: var(--green-dark);
    border-bottom: 2px solid var(--green-soft);
    padding-bottom: .35rem;
    margin-bottom: .7rem;
}

.field {
    display: flex; flex-direction: column;
    margin-bottom: .65rem;
    gap: .2rem;
}
.field span { font-size: .82rem; color: var(--ink-soft); font-weight: 600; }
.field select, .field input {
    padding: .65rem .75rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background: #fff;
    color: var(--ink);
    min-height: 44px; /* thumb target */
}
.field select:focus { outline: 2px solid var(--green); border-color: var(--green); }

.toggles { display: flex; flex-direction: column; gap: .55rem; margin-top: .4rem; }
.toggles label {
    cursor: pointer;
    display: flex; align-items: center;
    gap: .55rem;
    font-size: .95rem;
    padding: .35rem 0;
    min-height: 32px;
}
.toggles input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green); }

.suntimes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .4rem;
    font-size: .92rem;
}
.suntimes .s-row {
    display: flex; justify-content: space-between;
    padding: .35rem .6rem;
    background: var(--sand);
    border-radius: 6px;
}
.suntimes .s-row b { color: var(--green-dark); }

/* ============================================================
   Map — full-height on mobile
   ============================================================ */

.mapwrap {
    position: relative;
    width: 100%;
    /* On mobile: fixed fraction of the viewport so the timing section below
       is always partially visible. 60% leaves room for the chart header + peek
       after the browser's bottom chrome. */
    height: 60vh;
    min-height: 320px;
    max-height: 560px;
    background: #eef4f0;
    overflow: hidden;
}

#map { width: 100%; height: 100%; }

.map-legend {
    position: absolute;
    top: 10px; left: 10px;
    background: rgba(255,255,255,.95);
    padding: .5rem .7rem;
    border-radius: 8px;
    font-size: .82rem;
    box-shadow: var(--shadow);
    z-index: 500;
    max-width: 180px;
    max-height: 40vh;
    overflow-y: auto;
}
.map-legend .legend-row {
    display: flex; align-items: center; gap: .4rem; padding: .12rem 0;
}
.map-legend .dot {
    width: 11px; height: 11px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,.2);
}

.map-attribution {
    position: absolute;
    bottom: 4px; right: 8px;
    background: rgba(255,255,255,.88);
    padding: .2rem .5rem;
    font-size: .65rem;
    border-radius: 6px;
    z-index: 500;
    color: var(--ink-soft);
    max-width: calc(100% - 16px);
}

/* Leaflet overrides */
.leaflet-control-zoom { margin-top: 10px !important; margin-left: 10px !important; }
.leaflet-tooltip, .leaflet-popup-content { font-family: 'Cairo', sans-serif; direction: rtl; text-align: right; }
.leaflet-popup-content { font-size: .9rem; min-width: 200px; }
.leaflet-popup-content b { color: var(--green-dark); }
.leaflet-popup-content .src-tag {
    display: inline-block;
    padding: 1px 8px; font-size: .7rem;
    border-radius: 10px;
    background: var(--green-soft); color: var(--green-dark);
    margin-inline-start: 4px;
}

/* Wind arrow */
.wind-arrow {
    font-size: 26px;
    color: #0060a0;
    text-align: center;
    line-height: 1;
    text-shadow: 0 0 2px #fff, 0 0 4px #fff;
}
.wind-arrow small {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #333;
    text-shadow: none;
}

/* ============================================================
   Floating filter button (mobile FAB)
   ============================================================ */

.fab-filters {
    position: fixed;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    left: 1rem;
    z-index: 930;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .7rem 1rem;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 99px;
    font-family: inherit;
    font-size: .92rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
    transition: transform .15s, background .15s;
}
.fab-filters:active { transform: scale(.96); background: var(--green-dark); }
.fab-icon { font-size: 1.1rem; }
.drawer-open .fab-filters { opacity: 0; pointer-events: none; transform: translateY(20px); }

/* ============================================================
   Timing chart section
   ============================================================ */

.timing-section {
    margin: .75rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: .85rem 1rem;
    box-shadow: var(--shadow);
}
.timing-section h3 { color: var(--green-dark); margin: 0; font-size: 1rem; }
.timing-section .muted { margin: .25rem 0 .6rem; font-size: .8rem; }

.timing-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .3rem;
}

.timing-chart-wrap {
    position: relative;
    height: 220px;
}

.btn-expand {
    background: var(--green-soft);
    color: var(--green-dark);
    border: 1px solid var(--green);
    border-radius: 8px;
    padding: .35rem .8rem;
    font-family: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    white-space: nowrap;
    min-height: 36px;
}
.btn-expand:hover, .btn-expand:active { background: var(--green); color: #fff; }

/* ============================================================
   Modal (fullscreen chart)
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .78);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .5rem;
    animation: fadein .15s ease;
}
.modal-overlay[hidden] { display: none; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 1200px;
    height: 95vh;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
    overflow: hidden;
}
.modal-header {
    display: flex;
    align-items: center;
    padding: .7rem 1rem;
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: #fff;
    flex: 0 0 auto;
}
.modal-header h2 { margin: 0; font-size: 1.05rem; flex: 1; text-align: center; }
.modal-close {
    background: rgba(255, 255, 255, .18);
    color: #fff;
    border: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: 1.6rem; line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
    font-family: inherit;
}
.modal-close:hover, .modal-close:active { background: rgba(255, 255, 255, .35); }
.modal-body { flex: 1; padding: 1rem; min-height: 0; position: relative; }
.modal-body canvas { width: 100% !important; height: 100% !important; }

/* ============================================================
   Footer
   ============================================================ */

.app-footer {
    background: #2a2a2a;
    color: #ddd;
    padding: 1rem 1.25rem;
    font-size: .85rem;
    line-height: 1.55;
}
.app-footer a { color: var(--tan); }
.footer-inner { max-width: 1200px; margin: 0 auto; }

/* ============================================================
   ≥ 720px — bring stats back in header
   ============================================================ */

@media (min-width: 720px) {
    .header-stats { display: flex; }
    .app-header { padding: .75rem 1.25rem; }
    .app-header h1 { font-size: 1.3rem; }
    .app-header p { font-size: .82rem; }
    .logo { width: 44px; height: 44px; font-size: 1.5rem; }
}

/* ============================================================
   ≥ 901px — desktop: sidebar always visible, FAB hidden
   ============================================================ */

@media (min-width: 901px) {
    :root { --header-h: 68px; }

    .layout {
        display: grid;
        grid-template-columns: 320px 1fr;
        gap: 1rem;
        padding: 1rem;
        min-height: calc(100vh - var(--header-h) - var(--mode-h) - 160px);
    }

    .sidebar {
        position: static;
        transform: none !important;
        max-height: none;
        background: transparent;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        overflow: visible;
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    .sidebar-handle, .sidebar-close { display: none; }
    .sidebar-backdrop { display: none !important; }

    .fab-filters { display: none; }

    .mapwrap {
        height: auto;
        min-height: 620px;
        border-radius: var(--radius);
        border: 1px solid var(--line);
        box-shadow: var(--shadow);
    }

    .mode-switcher {
        padding: .5rem 1rem;
        gap: .4rem;
    }
    .mode-switcher button { flex: 0 0 auto; font-size: .92rem; padding: .55rem 1.2rem; }

    .timing-section { margin: 0 1rem 1rem; padding: 1rem 1.2rem; }
    .timing-chart-wrap { height: 200px; }
    .timing-section h3 { font-size: 1.1rem; }

    .timeline { margin: 0 1rem 1rem; padding: 1rem 1.2rem; }
    .timeline-title h3 { font-size: 1.1rem; }
}

/* ============================================================
   Header action buttons (submit shortcut)
   ============================================================ */

.btn-submit-header {
    background: rgba(255,255,255,.18);
    color: #fff;
    padding: .45rem .8rem;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .15s;
}
.btn-submit-header:hover, .btn-submit-header:active {
    background: rgba(255,255,255,.32);
    text-decoration: none;
}

/* Tighter on small screens so header doesn't wrap */
@media (max-width: 480px) {
    .btn-submit-header { padding: .4rem .6rem; font-size: .75rem; }
}

.btn-submit-sidebar {
    display: block;
    text-align: center;
    background: var(--green);
    color: #fff;
    padding: .75rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    margin-top: .6rem;
    transition: background .15s;
}
.btn-submit-sidebar:hover, .btn-submit-sidebar:active {
    background: var(--green-dark);
    text-decoration: none;
}

.btn-back {
    background: rgba(255,255,255,.18);
    color: #fff;
    padding: .45rem .85rem;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .15s;
}
.btn-back:hover, .btn-back:active {
    background: rgba(255,255,255,.32);
    text-decoration: none;
}

/* ============================================================
   Submission page
   ============================================================ */

.submit-wrap {
    max-width: 780px;
    margin: 0 auto;
    padding: 1rem .85rem 2rem;
}

.submit-form { display: flex; flex-direction: column; gap: 1rem; }

.submit-form .panel h3 em {
    color: #c0392b;
    font-style: normal;
    font-weight: 700;
    margin-inline-start: .15rem;
}

.submit-form .field span em {
    color: #c0392b;
    font-style: normal;
    font-weight: 700;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: .65rem;
}
@media (min-width: 560px) {
    .field-row { grid-template-columns: 1fr 1fr; }
}

.submit-form textarea {
    padding: .7rem .8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background: #fff;
    color: var(--ink);
    resize: vertical;
    min-height: 84px;
}
.submit-form textarea:focus { outline: 2px solid var(--green); border-color: var(--green); }

.submit-form input[type="file"] {
    padding: .55rem .7rem;
    background: #fff;
    border: 1px dashed var(--line);
    border-radius: 8px;
    min-height: 44px;
    font-family: inherit;
}

.pick-map {
    width: 100%;
    height: 320px;
    border-radius: 8px;
    border: 1px solid var(--line);
    overflow: hidden;
    margin: .35rem 0 .75rem;
    background: #eef4f0;
}

.coords-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
    align-items: end;
}
.coords-row .field { margin-bottom: 0; }
.coords-row input[readonly] {
    background: var(--sand);
    color: var(--ink-soft);
}

.btn-secondary {
    grid-column: 1 / -1;
    background: var(--green-soft);
    color: var(--green-dark);
    border: 1px solid var(--green);
    border-radius: 8px;
    padding: .65rem 1rem;
    font-family: inherit;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    min-height: 44px;
    transition: background .15s, color .15s;
}
.btn-secondary:hover, .btn-secondary:active {
    background: var(--green);
    color: #fff;
}

.btn-primary {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: .95rem 1.2rem;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    min-height: 52px;
    box-shadow: 0 2px 6px rgba(0,108,53,.3);
    transition: filter .15s, transform .1s;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.submit-msg {
    padding: .85rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
}
.submit-msg.ok  { background: #e7f6ea; color: #206b34; border: 1px solid #abd7b4; }
.submit-msg.err { background: #fdecea; color: #922018; border: 1px solid #f3b8b2; }

@media (min-width: 901px) {
    .pick-map { height: 420px; }
    .submit-wrap { padding: 1.5rem 1.25rem 2.5rem; }
}

/* ============================================================
   Species toggle cards (sidebar)
   ============================================================ */

.species-toggles {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.species-toggle {
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    column-gap: .55rem;
    row-gap: .1rem;
    padding: .55rem .7rem;
    background: #fff;
    border: 1px solid var(--line);
    border-inline-start: 4px solid var(--sp-color, var(--green));
    border-radius: 8px;
    cursor: pointer;
    transition: background .12s, box-shadow .12s, opacity .12s;
    min-height: 48px;
}
.species-toggle:hover { background: #fafaf6; }
.species-toggle input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--sp-color, var(--green));
    margin: 0;
}
.species-toggle .sp-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--sp-color, var(--green));
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0,0,0,.12);
}
.species-toggle .sp-name {
    font-weight: 700;
    font-size: .95rem;
    color: var(--ink);
}
.species-toggle .sp-sci {
    grid-column: 2 / -1;
    font-style: italic;
    font-size: .75rem;
    color: var(--muted);
    font-family: 'Amiri', serif;
    direction: ltr;
    text-align: start;
}
.species-toggle:has(input:not(:checked)) {
    opacity: .55;
    background: #f4f1ea;
}

/* ============================================================
   Timeline slider (below the map)
   ============================================================ */

.timeline {
    margin: .75rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: .85rem 1rem 1rem;
    box-shadow: var(--shadow);
}
.timeline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .5rem;
}
.timeline-title { display: flex; align-items: baseline; gap: .55rem; min-width: 0; }
.timeline-title h3 {
    margin: 0;
    color: var(--green-dark);
    font-size: 1rem;
}
.slider-date {
    font-weight: 700;
    color: var(--green);
    font-size: .92rem;
    background: var(--green-soft);
    padding: .15rem .55rem;
    border-radius: 999px;
    white-space: nowrap;
}

.btn-today {
    background: var(--green-soft);
    color: var(--green-dark);
    border: 1px solid var(--green);
    border-radius: 8px;
    padding: .35rem .8rem;
    font-family: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    min-height: 36px;
}
.btn-today:hover, .btn-today:active { background: var(--green); color: #fff; }

.date-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--green-soft), var(--tan), var(--green-soft));
    outline: none;
    margin: .25rem 0 .5rem;
    direction: ltr; /* slider thumb moves L→R chronologically Jan→Dec */
}
.date-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--green);
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0,108,53,.4);
    cursor: pointer;
}
.date-slider::-moz-range-thumb {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--green);
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0,108,53,.4);
    cursor: pointer;
}

.timeline-months {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2px;
    direction: ltr;
}
.timeline-months button {
    background: transparent;
    border: none;
    padding: .35rem .1rem;
    font-family: inherit;
    font-size: .7rem;
    color: var(--ink-soft);
    cursor: pointer;
    border-radius: 6px;
    min-height: 30px;
}
.timeline-months button:hover { background: var(--green-soft); color: var(--green-dark); }
.timeline-months button.active {
    background: var(--green);
    color: #fff;
    font-weight: 700;
}

/* ============================================================
   Animated bird dot on the map (uses --c per species)
   ============================================================ */

.bird-dot {
    position: relative;
    width: 22px; height: 22px;
    pointer-events: auto;
}
.bird-dot .bird-core {
    position: absolute;
    inset: 5px;
    background: var(--c, var(--green));
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,.4);
    z-index: 2;
}
.bird-dot .bird-ping {
    position: absolute;
    inset: 0;
    border: 2px solid var(--c, var(--green));
    border-radius: 50%;
    opacity: .85;
    animation: bird-ping 1.6s cubic-bezier(0,0,.2,1) infinite;
}
@keyframes bird-ping {
    0%   { transform: scale(.5); opacity: .9; }
    80%  { transform: scale(2.2); opacity: 0; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* ============================================================
   User submission pin (teardrop)
   ============================================================ */

.user-pin {
    position: relative;
    width: 18px; height: 18px;
}
.user-pin .pin-core {
    position: absolute;
    inset: 0;
    background: var(--c, var(--green));
    border: 2px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 4px rgba(0,0,0,.3);
}
.user-pin.fresh::after {
    content: "";
    position: absolute;
    inset: -4px;
    border: 2px solid var(--c, var(--green));
    border-radius: 50%;
    animation: bird-ping 1.8s cubic-bezier(0,0,.2,1) infinite;
}

/* ============================================================
   Map legend additions (route style swatches)
   ============================================================ */

.map-legend h4 {
    margin: .35rem 0 .25rem;
    font-size: .78rem;
    color: var(--green-dark);
    text-transform: none;
}
.map-legend h4:first-child { margin-top: 0; }
.legend-line {
    display: inline-block;
    width: 22px;
    height: 0;
    border-top: 3px solid var(--green);
    margin-inline-end: .35rem;
    vertical-align: middle;
}
.legend-line.dashed { border-top-style: dashed; }
.legend-line.dotted { border-top-style: dotted; }

/* ============================================================
   "Now" panel — current week + per-species phase
   ============================================================ */

#now-info {
    font-size: .9rem;
    color: var(--ink);
}
.now-date {
    font-weight: 700;
    color: var(--green-dark);
    margin-bottom: .35rem;
}
.now-date .wk {
    display: inline-block;
    margin-inline-start: .4rem;
    font-size: .75rem;
    color: var(--muted);
    font-weight: 500;
}
.now-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .55rem;
    border-radius: 6px;
    background: var(--sand);
    margin-top: .35rem;
    font-size: .85rem;
}
.now-row .dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0,0,0,.12);
}
.now-row span:nth-child(2) { flex: 1; }
.now-row em {
    font-style: normal;
    font-weight: 700;
    color: var(--green-dark);
    font-size: .8rem;
}
.now-row.inactive { opacity: .6; }
.now-row.inactive em { color: var(--muted); font-weight: 500; }

