:root {
  --page: #f4f6f5; --surface: #fff; --text: #202a2d; --muted: #667477; --border: #dce3e1;
  --accent: #2d6970; --success: #4f7b62; --warning: #a8643e; --info: #7da4e3; --accent-soft: #e7f1f0;
  --success-soft: #e9f2eb; --warning-soft: #fbefe8; --radius: 10px;
  --shadow: 0 2px 10px rgba(32, 42, 45, .04); --content-width: 1240px;
}
:root[data-theme="dark"] {
  --page: #0f1320; --surface: #232735; --text: #f8f8fa; --muted: #c5c8d2; --border: #353b50;
  --accent: #6c8cff; --success: #7dff95; --warning: #ffbc5e; --info: #87d1ff; --accent-soft: #303957;
  --success-soft: #24452e; --warning-soft: #4c3824; --shadow: 0 2px 12px rgba(0, 0, 0, .24);
}
* { box-sizing: border-box; }
body { background: var(--page); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.5; }
a { color: var(--accent); } a:hover { color: #1e5056; }
.container { max-width: var(--content-width); }
.navbar { min-height: 64px; max-width: none; margin: 0 0 24px; padding: 0; border-bottom: 1px solid var(--border); }
.navbar-brand { color: var(--text) !important; font-weight: 750; letter-spacing: -.02em; }
.navbar-brand .brand-logo { display: inline-flex; align-items: center; gap: 7px; }
.brand-mark { color: var(--accent); display: flex; justify-content: center; gap: 5px; font-size: 15px; }
.navbar-nav { gap: 6px; } .navbar .nav-link { color: var(--muted) !important; border-radius: 7px; padding: 8px 11px; }
.navbar .nav-link:hover, .navbar .nav-link.active { color: var(--text) !important; background: #eaf0ef; } .navbar .nav-link.active { font-weight: 650; }
.navbar-toggler { border-color: var(--border); } .dropdown-menu { border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 8px; }
.dropdown-item { color: var(--text) !important; }
.dropdown-menu, .form-control, .form-select { background-color: var(--surface); color: var(--text); }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; }
.page-heading h1 { font-size: 30px; letter-spacing: -.03em; margin: 0; font-weight: 720; } .page-heading p { color: var(--muted); margin: 4px 0 0; }
.updated-label { color: var(--muted); font-size: 13px; text-align: right; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.metric-card, .section-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.metric-card { min-height: 100px; padding: 16px; display: flex; justify-content: space-between; gap: 12px; }
.metric-label { color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.metric-value { font-size: 25px; font-weight: 720; letter-spacing: -.03em; margin-top: 10px; } .metric-context { color: var(--muted); font-size: 13px; margin-top: 3px; }
.metric-icon { color: var(--accent); font-size: 18px; } .status-value { color: var(--success); } .status-icon { color: var(--success); }
.metric-value.status-bird { color: var(--species-color-2) !important; } .metric-value.status-cat { color: #a8643e !important; }
:root[data-theme="dark"] .metric-value.status-cat { color: #ffbc5e !important; }
.section-card { overflow: hidden; }
.section-header { padding: 18px 20px 0; } .section-header h2 { font-size: 18px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.section-header p { color: var(--muted); font-size: 13px; margin: 4px 0 0; } .section-body { padding: 20px; }
.latest-image { background: #e8edeb; height: auto; min-height: 280px; display: flex; align-items: center; justify-content: center; padding: 0; }
.latest-image video { display: block; width: 100%; height: auto; max-height: 560px; object-fit: contain; } .sighting-meta { color: var(--muted); font-size: 13px; margin: 0; }
.controls-grid { display: flex; flex-wrap: wrap; gap: 10px; } .btn { border-radius: 7px; font-weight: 650; padding: 9px 14px; }
.btn-primary { background: var(--accent) !important; border-color: var(--accent) !important; } .btn-primary:hover { background: #245a61 !important; }
.btn-outline-secondary { color: var(--text); border-color: var(--border); } .btn-outline-secondary:hover { color: var(--text); background: #eef2f1; border-color: #c7d3d0; }
.btn-outline-warning { color: var(--warning); border-color: #d7b6a3; } .btn-outline-warning:hover { color: #7f452b; background: var(--warning-soft); }
.cmd-btn:disabled { opacity: .55; }
.analytics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; } .chart-wrap { min-height: 300px; position: relative; }
.analytics-grid > .section-card { display: flex; flex-direction: column; }
.analytics-grid > .section-card > .chart-wrap { height: 360px; min-height: 360px; }
.analytics-table-card { grid-column: 1 / -1; }
.chart-wrap canvas { max-width: 100%; } .table-wrap { overflow-x: auto; }
.nav-tabs { border-bottom: 1px solid var(--border); gap: 18px; } .nav-tabs .nav-link { color: var(--muted) !important; border: 0; border-bottom: 2px solid transparent; padding: 10px 2px; }
.tab-icon { margin-right: 7px; font-size: 14px; }
.nav-tabs .nav-link.active { color: var(--text) !important; border-bottom-color: var(--accent); background: transparent; font-weight: 700; }
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: var(--border); color: var(--text); margin: 0; min-width: 560px; }
.table > :not(caption) > * > * { color: var(--text); padding: 13px 12px; border-bottom-color: var(--border); }
.table tbody tr:hover > *, .table-hover > tbody > tr:hover > * { background-color: transparent !important; box-shadow: none !important; color: var(--text); }
.table thead th { color: var(--muted); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; border-top: 0; }
.table a { font-weight: 650; text-decoration: none; } .table a:hover { text-decoration: underline; }
.settings-layout { max-width: 100%; } .settings-section { padding: 22px; } .settings-section + .settings-section { margin-top: 16px; }
.settings-section h2 { font-size: 18px; margin: 0 0 4px; } .settings-section > p { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.form-label { color: #405053; font-size: 13px; font-weight: 650; } .form-control { border-color: var(--border); border-radius: 7px; padding: 10px 12px; }
.form-control:focus, .form-check-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(45, 105, 112, .14); } .notification-grid { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.settings-preference-row { align-items: center; display: flex; justify-content: space-between; }
.settings-preference-row label { display: block; font-weight: 650; }
.settings-preference-row span { color: var(--muted); display: block; font-size: 13px; margin-top: 3px; }
.notification-row { display: grid; grid-template-columns: minmax(170px, 1fr) 100px 80px 70px; align-items: center; min-height: 54px; padding: 0 14px; border-top: 1px solid var(--border); }
.notification-row:first-child { border-top: 0; } .notification-row.header { background: #f6f8f7; color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; min-height: 42px; }
.notification-row label { margin: 0; } .notification-row:not(.header) > div:not(:first-child) { display: flex; justify-content: center; }
.form-check-input { border-color: #aebdb9; } .form-check-input:checked { background-color: var(--accent); border-color: var(--accent); } .form-switch .form-check-input { width: 2.1em; }
.settings-actions { display: flex; justify-content: flex-end; margin-top: 20px; } footer { color: var(--muted) !important; font-size: 13px; }
.field-study-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.field-study-overview-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
.field-study-overview-card > div { min-width: 0; }
.field-study-overview-card .metric-value { max-width: none; white-space: normal; overflow-wrap: anywhere; }
.field-study-filters { display: grid; grid-template-columns: 1.15fr repeat(3, 1fr); gap: 20px; margin-top: 20px; padding: 28px 20px; }
.field-study-filter { min-width: 0; } .field-study-filter > .metric-label { display: block; margin-bottom: 10px; }
.field-study-search { align-items: center; border: 1px solid var(--border); border-radius: 7px; display: flex; gap: 10px; padding: 0 12px; }
.field-study-search i { color: var(--muted); } .field-study-search input { background: transparent; border: 0; color: var(--text); min-height: 44px; outline: 0; width: 100%; }
.field-study-search input::placeholder { color: var(--muted); }
.field-study-filters .form-select { min-height: 44px; }
.field-study-grid { align-items: stretch; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.species-pagination { align-items: center; display: flex; gap: 14px; justify-content: center; margin-top: 24px; }
.species-pagination span { color: var(--muted); font-size: 13px; min-width: 90px; text-align: center; }
.species-pagination .btn:disabled { cursor: not-allowed; opacity: .45; }
.species-card { color: var(--text); display: flex; flex-direction: column; height: 100%; overflow: hidden; text-decoration: none; }
.species-card:hover { color: var(--text); border-color: #b8cfca; }
.species-card-image { align-items: center; background: #e8edeb; display: flex; flex: 0 0 210px; height: 210px; justify-content: center; overflow: hidden; }
.species-card-image img, .species-wiki-image img { height: 100%; object-fit: cover; width: 100%; }
.species-card-image img { object-fit: contain; }
.species-card-image-empty { color: var(--accent); font-size: 28px; }
.species-card-body { display: flex; flex: 1; flex-direction: column; padding: 20px; }
.species-card-body h2 { font-size: 21px; margin: 7px 0 8px; }
.species-card-body p { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.species-card-meta { border-top: 1px solid var(--border); color: var(--muted); display: flex; font-size: 12px; justify-content: space-between; margin-top: auto; padding-top: 13px; }
.back-link { display: inline-block; font-size: 13px; font-weight: 650; margin-bottom: 12px; text-decoration: none; }
.back-link i { margin-right: 6px; }
.species-wiki-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; }
.species-wiki-sidebar { display: grid; align-content: start; gap: 16px; }
.species-wiki-image { align-items: center; background: #e8edeb; display: flex; height: 280px; justify-content: center; overflow: hidden; }
.species-facts { display: grid; gap: 16px; padding: 20px; }
.species-facts div + div { border-top: 1px solid var(--border); padding-top: 16px; }
.species-facts strong { display: block; font-size: 19px; margin-top: 5px; }
.species-audio { padding: 20px; } .species-audio audio { display: block; margin-top: 10px; max-width: 100%; width: 100%; }
.species-wiki-content { display: grid; gap: 20px; }
.species-wiki-intro { align-items: center; display: flex; gap: 18px; padding: 22px; }
.species-wiki-intro p { font-size: 16px; font-weight: 600; line-height: 1.7; margin: 0; }
.wiki-initial { color: var(--accent); font-family: Georgia, serif; font-size: 68px; line-height: 1; }
.species-wiki-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.species-wiki-section { min-height: 160px; padding: 22px; }
.species-wiki-section h2 { font-size: 18px; margin: 0 0 18px; }
.species-wiki-section h2 i { color: var(--accent); font-size: 16px; margin-right: 9px; }
.species-wiki-section p { color: var(--muted); line-height: 1.75; margin: 0; }
.species-detail-label { border: 1px solid var(--warning); color: var(--warning); display: inline-block; font-size: 10px; font-weight: 750; letter-spacing: .08em; margin-bottom: 14px; padding: 6px 9px; text-transform: uppercase; }
.species-tag-label { display: block; margin-top: 18px; }
.species-tag-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.species-tag-list span { border: 1px solid var(--border); color: var(--muted); font-size: 11px; padding: 6px 8px; }
.journal-top-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .9fr); gap: 20px; }
.journal-top-grid > .section-card, .journal-detail-grid > .section-card, .species-wiki-columns > .section-card { height: 100%; }
.journal-section-header { align-items: center; display: flex; justify-content: space-between; }
.journal-section-header h2 { margin-top: 5px; }
.journal-calendar-controls { display: flex; gap: 7px; }
.journal-calendar-controls .btn { font-size: 20px; line-height: 1; padding: 5px 11px; }
.journal-year-select { border-color: var(--border); font-size: 13px; min-width: 88px; padding: 6px 28px 6px 9px; width: auto; }
.journal-weekdays, .journal-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.journal-weekdays { color: var(--muted); font-size: 11px; margin-bottom: 7px; text-align: center; text-transform: uppercase; }
.journal-day { align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text); display: flex; flex-direction: column; font-size: 12px; height: 58px; justify-content: space-between; padding: 8px; text-decoration: none; }
.journal-day:hover { background: var(--accent-soft); color: var(--text); }
.journal-day.future { background: var(--page); color: var(--muted); }
.journal-day.today .journal-day-number { color: var(--calendar-bird); font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
.journal-day:focus-visible { outline: 2px solid var(--calendar-bird); outline-offset: 2px; }
.journal-day.selected { background: var(--accent-soft); border-color: var(--calendar-bird); box-shadow: inset 0 0 0 1px var(--calendar-bird); color: var(--text); font-weight: 700; }
.journal-day-empty { background: transparent; border-color: transparent; }
.journal-day-icons { display: flex; gap: 5px; }
.journal-legend { color: var(--muted); display: flex; font-size: 11px; gap: 18px; margin-top: 18px; }
.journal-dot { border-radius: 50%; display: inline-block; height: 6px; margin-right: 5px; width: 6px; }
.bird-dot { background: var(--calendar-bird); } .cat-dot { background: var(--calendar-cat); }
.journal-selected-day { border-color: var(--accent); }
.journal-summary-list { display: grid; gap: 8px; }
.journal-summary-item { align-items: center; background: #fafcfb; border: 1px solid var(--border); border-radius: 7px; display: grid; grid-template-columns: 1fr auto 22px; padding: 12px; }
.journal-summary-item strong { font-size: 18px; margin-right: 10px; }
.journal-summary-item i { color: var(--accent); font-size: 14px; text-align: center; }
.journal-summary-item:last-child i { color: var(--warning); }
.journal-chart-card, .journal-timeline { margin-top: 20px; }
.journal-table-card { margin-top: 20px; }
.journal-table-card .table { min-width: 0; width: 100%; }
.journal-table-card th:last-child, .journal-table-card td:last-child:not([colspan]) { text-align: right; white-space: nowrap; width: 1%; }
.journal-table-card td:nth-child(2):not(:last-child) { overflow-wrap: anywhere; }
.journal-chart-wrap { height: 280px; }
.journal-detail-grid { align-items: stretch; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.journal-highlight h2 i { color: var(--accent); font-size: 15px; margin-right: 7px; }
.journal-highlight strong { display: block; font-size: 22px; margin: 12px 0 7px; }
.journal-highlight p { color: var(--muted); font-size: 13px; margin: 0; }
.journal-species-row { align-items: center; border-bottom: 1px solid var(--border); color: var(--text); display: flex; justify-content: space-between; padding: 10px 0; text-decoration: none; }
.journal-species-row:first-child { padding-top: 0; } .journal-species-row:last-child { border-bottom: 0; padding-bottom: 0; }
.journal-species-row i { color: var(--accent); margin-right: 8px; } .journal-species-row strong { font-size: 14px; }
.journal-distribution-body { align-items: center; display: flex; gap: 30px; }
.journal-donut { align-items: center; background: conic-gradient(var(--accent) 0 34%, var(--success) 34% 67%, var(--info) 67% 100%); border-radius: 50%; color: var(--text); display: flex; flex-direction: column; height: 140px; justify-content: center; position: relative; width: 140px; }
.journal-donut::before { background: var(--surface); border-radius: 50%; content: ""; height: 92px; position: absolute; width: 92px; }
.journal-donut span, .journal-donut small { position: relative; } .journal-donut span { font-size: 24px; font-weight: 700; } .journal-donut small { color: var(--muted); font-size: 11px; }
.journal-distribution-list { display: grid; gap: 14px; flex: 1; } .journal-distribution-list div { align-items: center; display: flex; justify-content: space-between; }
.journal-distribution-list span { color: var(--muted); font-size: 13px; } .journal-distribution-list i { background: var(--accent); border-radius: 50%; display: inline-block; height: 8px; margin-right: 8px; width: 8px; }
.journal-distribution-list div:nth-child(2) i { background: var(--success); } .journal-distribution-list div:nth-child(3) i { background: var(--info); }
.journal-timeline-item { display: grid; grid-template-columns: 55px 16px 1fr; gap: 10px; min-height: 105px; position: relative; }
.journal-timeline-item:not(:last-child)::before { background: var(--border); content: ""; left: 61px; position: absolute; top: 18px; bottom: -2px; width: 1px; }
.journal-timeline-item time { color: var(--muted); font-size: 12px; padding-top: 1px; text-align: right; }
.journal-timeline-marker { background: var(--accent); border: 3px solid var(--surface); border-radius: 50%; box-shadow: 0 0 0 1px var(--accent); height: 10px; margin-top: 3px; position: relative; width: 10px; z-index: 1; }
.journal-timeline-marker.cat { background: var(--warning); box-shadow: 0 0 0 1px var(--warning); }
.journal-timeline-item h3 { font-size: 15px; margin: 0; } .journal-timeline-item h3 span { background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 700; margin-left: 7px; padding: 3px 6px; text-transform: uppercase; }
.journal-timeline-item h3 span.cat { background: var(--warning-soft); color: var(--warning); }
.journal-timeline-item p { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }
.journal-clip { align-items: center; background: #f7f9f8; border: 1px solid var(--border); color: var(--muted); display: flex; font-size: 11px; justify-content: space-between; padding: 9px 11px; }
:root[data-theme="dark"] .navbar .nav-link:hover, :root[data-theme="dark"] .navbar .nav-link.active { background: #303752; }
:root[data-theme="dark"] .btn-outline-secondary:hover { background: #303752; border-color: #6c8cff; color: #f8f8fa; }
:root[data-theme="dark"] .btn-outline-warning:hover { background: #4a3522; border-color: #ffbc5e; color: #ffbc5e; }
:root[data-theme="dark"] .btn-primary:hover { background: #829cff !important; border-color: #829cff !important; color: #0f1320 !important; }
:root[data-theme="dark"] .toast .btn-close { filter: invert(1) grayscale(1) brightness(1.6); }
:root[data-theme="dark"] .dropdown-menu, :root[data-theme="dark"] .journal-summary-item, :root[data-theme="dark"] .journal-clip { background: #292e3e; }
:root[data-theme="dark"] .dropdown-item:hover, :root[data-theme="dark"] .dropdown-item:focus { background: #303752; color: #f8f8fa !important; }
:root[data-theme="dark"] .section-card, :root[data-theme="dark"] .metric-card { background: var(--surface); }
:root[data-theme="dark"] .latest-image, :root[data-theme="dark"] .species-card-image, :root[data-theme="dark"] .species-wiki-image { background: #292e3e; }
:root[data-theme="dark"] .notification-row.header { background: #292e3e; }
.text-primary, .text-muted, .text-warning, .text-danger, .text-info, .text-success { color: inherit !important; } .toast { background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: 0 8px 25px rgba(32,42,45,.12); } .toast-header { background: var(--surface); border-bottom-color: var(--border); color: var(--text); } .toast-body { color: var(--text); }
*:focus-visible { outline: 3px solid rgba(45, 105, 112, .35); outline-offset: 2px; }
@media (max-width: 800px) { .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .analytics-grid { grid-template-columns: 1fr; } .page-heading { align-items: start; } }
@media (max-width: 900px) { .field-study-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .species-wiki-layout { grid-template-columns: 220px minmax(0, 1fr); } }
@media (max-width: 576px) { .navbar { padding: 0 16px; margin-bottom: 20px; } .container { padding-left: 16px; padding-right: 16px; }
  .page-heading { display: block; } .page-heading h1 { font-size: 27px; } .updated-label { text-align: left; margin-top: 12px; }
  .metric-grid { gap: 8px; } .metric-card { min-height: 92px; padding: 13px; } .metric-value { font-size: 21px; }
  .field-study-overview, .field-study-filters { grid-template-columns: 1fr; } .field-study-filters { gap: 16px; }
  .field-study-grid, .species-wiki-columns, .species-wiki-layout { grid-template-columns: 1fr; } .species-wiki-image { height: 220px; }
  .journal-top-grid, .journal-detail-grid { grid-template-columns: 1fr; } .journal-weekdays, .journal-days { gap: 4px; } .journal-day { height: 48px; padding: 6px; } .journal-distribution-body { align-items: flex-start; flex-direction: column; }
  .section-header, .section-body { padding-left: 16px; padding-right: 16px; } .notification-row { grid-template-columns: minmax(130px, 1fr) 66px 54px 48px; padding: 0 9px; font-size: 13px; } .settings-section { padding: 16px; }
}

.insights-range > div { display: flex; gap: 8px; margin-top: 6px; }
.insights-period, .insights-caption { color: var(--muted); font-size: 13px; }
.insights-period { margin: -8px 0 20px; }
.insights-stack { display: grid; gap: 20px; }
.insights-chart { height: 290px; position: relative; }
.insights-species-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.insights-weekly { display: grid; gap: 16px; }
.insights-weekly > div { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 14px; align-items: center; font-size: 13px; color: var(--muted); }
.insights-weekly strong { text-align: right; color: var(--text); }
.insights-track { height: 8px; background: var(--accent-soft); border-radius: 4px; overflow: hidden; }
.insights-track > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.insights-species-row { display: flex; gap: 14px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--border); }
.insights-species-row:last-child { border: 0; }
.insights-species-row > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.insights-species-row small, .insights-cat-grid small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.insights-feather { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; background: var(--accent-soft); color: var(--accent); border-radius: 8px; }
.insights-donut { height: 350px; }
.insights-cat { color: var(--warning); }
.insights-cat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.insights-cat-grid > div { border: 1px solid var(--border); border-radius: 8px; padding: 18px; }
.insights-cat-grid strong { display: block; font-size: 25px; color: var(--warning); margin-top: 10px; }
.insights-subheading { font-size: 18px; font-weight: 700; margin: 28px 0 4px; }
.insights-empty { color: var(--muted); margin-bottom: 20px; }
@media (max-width: 700px) { .insights-species-grid, .insights-cat-grid { grid-template-columns: 1fr; } .insights-range { margin-top: 15px; } .insights-chart { height: 250px; } }

.archive-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; padding: 24px; margin-bottom: 24px; }
.archive-filters label { display: block; margin-bottom: 9px; }
.archive-filters .form-select, .archive-filters .form-control { min-height: 44px; border-color: var(--border); }
.archive-actions { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
.archive-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.archive-card { min-width: 0; }
.archive-media { position: relative; aspect-ratio: 5 / 3; background: var(--accent-soft); }
.archive-media img, .archive-media video { display: block; width: 100%; height: 100%; object-fit: contain; }
.archive-media .archive-image-link { display: block; height: 100%; }
.archive-media img { object-fit: cover; }
.archive-badge { position: absolute; top: 12px; left: 12px; z-index: 1; pointer-events: none; color: var(--accent); background: var(--surface); border: 1px solid var(--border); border-radius: 5px; padding: 5px 9px; font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.archive-badge-cat { color: var(--warning); }
.archive-badge i { margin-right: 4px; }
.archive-no-media { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; height: 100%; padding: 24px; color: var(--muted); text-align: center; font-size: 13px; }
.archive-no-media i { font-size: 28px; opacity: .6; }
.archive-card-body { padding: 20px; }
.archive-card-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: start; column-gap: 12px; min-height: 48px; }
.archive-card-heading > div { display: contents; }
.archive-card-heading h2, .archive-card-heading h3 { grid-column: 1; grid-row: 1; }
.archive-card-heading .feed-scientific, .archive-card-heading .metric-label { grid-column: 1 / -1; }
.archive-card-heading .archive-learn-more { grid-column: 2; grid-row: 1; white-space: nowrap; }
.archive-card-heading h2, .archive-card-heading h3 { font-size: 19px; font-weight: 700; margin: 0 0 4px; overflow-wrap: anywhere; }
.archive-open { color: var(--muted); font-size: 13px; }
.archive-meta { display: grid; grid-template-columns: 1.2fr .7fr 1fr; gap: 10px; border-top: 1px solid var(--border); margin: 18px 0 0; padding-top: 16px; }
.archive-meta dt { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.archive-meta dd { font-size: 12px; font-weight: 600; margin: 6px 0 0; }
.archive-meta > div:last-child dd { color: var(--accent); }
.archive-empty { grid-column: 1 / -1; text-align: center; padding: 50px 20px; color: var(--muted); }
.archive-empty h2 { font-size: 20px; color: var(--text); margin-top: 12px; }
.archive-footer { display: flex; justify-content: space-between; align-items: center; gap: 18px; border-top: 1px solid var(--border); margin-top: 28px; padding-top: 20px; }
.archive-footer p { color: var(--muted); font-size: 13px; margin: 0; }
.archive-pagination { display: flex; gap: 5px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.archive-pagination a, .archive-pagination span { display: grid; place-items: center; min-width: 34px; height: 36px; border: 1px solid var(--border); border-radius: 6px; color: var(--text); text-decoration: none; font-size: 13px; }
.archive-pagination .active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); font-weight: 750; }
.archive-pagination [aria-disabled] { opacity: .4; }
@media (max-width: 1000px) { .archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .archive-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 576px) { .archive-grid, .archive-filters { grid-template-columns: 1fr; } .archive-filters { padding: 16px; gap: 14px; } .archive-footer { flex-direction: column; align-items: start; } }


.feed-stack { display: grid; gap: 28px; }
.feed-hero-media { background: var(--accent-soft); }
.feed-hero-media img, .feed-hero-media video { display: block; width: 100%; height: clamp(200px, 32vw, 360px); object-fit: contain; }
.feed-latest-caption { display: flex; justify-content: space-between; gap: 24px; padding: 24px; }
.feed-latest-caption h2 { font-size: 28px; letter-spacing: -.02em; margin: 8px 0 3px; font-weight: 700; }
.feed-scientific { color: var(--muted); font-size: 14px; font-style: italic; margin: 0; }
.feed-field-link { display: inline-block; font-size: 13px; font-weight: 650; text-decoration: none; margin-top: 18px; }
.feed-field-link span { margin-left: 8px; }
.feed-latest-facts { display: flex; gap: 32px; text-align: right; margin: 0; }
.feed-latest-facts dd { font-size: 25px; color: var(--accent); font-weight: 700; margin: 8px 0 0; }
.feed-latest-facts small { color: var(--muted); font-size: 12px; }
.feed-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 0 0 16px; }
.feed-section-heading h2 { font-size: 18px; font-weight: 700; margin: 0; }
.feed-section-heading a { font-size: 13px; text-decoration: none; }
.feed-recent-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.feed-recent-card { min-width: 0; }
.feed-recent-media { aspect-ratio: 5 / 3; background: var(--accent-soft); }
.feed-recent-media img, .feed-recent-media video { display: block; width: 100%; height: 100%; object-fit: cover; }
.feed-recent-media video { object-fit: contain; }
.feed-recent-card p { color: var(--muted); font-size: 12px; margin: 0; }
.feed-activity-chart { height: 260px; }
.feed-timeline { position: relative; }
.feed-timeline::before { content: ''; display: var(--timeline-line-display, block); position: absolute; top: var(--timeline-line-top, 52px); bottom: var(--timeline-line-bottom, 52px); left: var(--timeline-line-left, 88px); width: 1px; background: var(--border); pointer-events: none; }
.feed-timeline-item { position: relative; }
.feed-timeline-item time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.feed-timeline-dot { height: 8px; width: 8px; border-radius: 50%; background: var(--calendar-bird); z-index: 1; }
.feed-timeline-dot.cat { background: var(--warning); }
.feed-timeline-toggle, .feed-timeline-missing { display: grid; grid-template-columns: 48px 12px minmax(0, 1fr) 14px; align-items: center; gap: 16px; min-height: 64px; padding: 12px 0; }
.feed-timeline-toggle { width: 100%; border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; border-radius: 4px; }
.feed-timeline-toggle:hover { background: color-mix(in srgb, var(--accent-soft) 35%, transparent); }
.feed-timeline-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.feed-timeline-expanded { position: relative; margin-left: 92px; background: var(--surface); }
.feed-timeline-title { min-width: 0; overflow-wrap: anywhere; font-size: 16px; font-weight: 650; }
.feed-expand-label { color: var(--muted); font-size: 12px; justify-self: end; }
.feed-expand-label i { transition: transform .15s; }
.feed-timeline-toggle[aria-expanded="true"] .feed-expand-label i { transform: rotate(90deg); }
.feed-timeline-missing { grid-template-columns: 48px 12px minmax(0, 1fr) auto; }
.feed-expanded-media { background: var(--accent-soft); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.feed-expanded-media img, .feed-expanded-media video { display: block; width: 100%; height: auto; max-height: 480px; object-fit: contain; }
.feed-timeline-expanded { padding-bottom: 18px; }
.feed-timeline-missing > span:last-child { color: var(--muted); font-size: 12px; }
.feed-no-media { display: grid; place-items: center; color: var(--muted); height: 100%; min-height: 180px; }
.feed-command-status { color: var(--muted); font-size: 13px; margin: 0; padding: 0 20px 18px; }
.feed-empty { color: var(--muted); } .feed-empty h2 { font-size: 22px; }
@media (max-width: 700px) { .feed-recent-grid { grid-template-columns: 1fr; } .feed-recent-media { max-height: 280px; } .feed-latest-caption { flex-direction: column; } .feed-latest-facts { text-align: left; } .feed-timeline-toggle, .feed-timeline-missing { gap: 9px; grid-template-columns: 40px 10px minmax(0,1fr) 14px; min-height: 56px; padding: 10px 0; } .feed-timeline-missing > span:last-child { grid-column: 3 / -1; } .feed-timeline-expanded { margin-left: 0; } }

.species-entry-back { font-size: 12px; margin-bottom: 24px; }
.species-entry-back i { margin-right: 9px; }
.species-entry-heading { border-top: 1px solid var(--border); padding-top: 26px; margin-bottom: 30px; }
.species-entry-heading h1 { font-size: 36px; }
.species-entry-heading p { margin-top: 10px; }
.species-entry-layout { grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); gap: 28px; align-items: start; }
.species-entry-layout .species-wiki-sidebar { gap: 24px; }
.species-entry-layout .species-wiki-content { gap: 24px; align-content: start; }
.species-entry-portrait { padding: 16px; background: var(--surface); }
.species-entry-portrait img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; border: 1px solid var(--border); }
.species-entry-portrait.species-card-image-empty { display: grid; place-items: center; min-height: 220px; }
.species-entry-intro { border-left: 3px solid var(--accent); align-items: start; padding: 26px; }
.species-entry-intro .wiki-initial { font-size: 60px; }
.species-entry-intro p { font-weight: 500; }
.species-observation-log h2 i { color: var(--accent); margin-right: 7px; font-size: 15px; }
.species-observation-facts { margin: 0; }
.species-observation-facts > div { border-bottom: 1px solid var(--border); padding-bottom: 20px; margin-bottom: 20px; }
.species-observation-facts dd { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 23px; font-weight: 650; margin: 9px 0 0; }
.species-observation-facts > div:first-child dd { color: var(--accent); font-size: 29px; }
.species-observation-facts dd i { color: var(--muted); font-size: 13px; }
.species-recent-captures h3 { margin: 0 0 16px; }
.species-recent-captures h3 i { color: var(--accent); margin-right: 6px; }
.species-capture { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; margin-bottom: 14px; }
.species-capture-media img, .species-capture-media video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--accent-soft); }
.species-capture figcaption { padding: 9px 11px; color: var(--muted); font-size: 11px; }
.species-capture-link { font-size: 12px; font-weight: 650; text-decoration: none; }
.species-entry-empty { color: var(--muted); font-size: 13px; }
.species-behaviour-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.species-behaviour-grid > div { border: 1px solid var(--border); border-radius: 7px; padding: 18px; }
.species-behaviour-grid h3 { color: var(--accent); margin: 0 0 10px; }
.species-entry-layout .species-wiki-section { min-height: auto; }
@media (max-width: 1000px) { .species-entry-layout { grid-template-columns: minmax(220px, 1fr) minmax(0, 1.7fr); gap: 20px; } .species-entry-layout .species-wiki-columns { grid-template-columns: 1fr; } }
@media (max-width: 650px) { .species-entry-layout, .species-behaviour-grid { grid-template-columns: 1fr; } .species-entry-heading h1 { font-size: 30px; } }

.distribution-chart { display: flex; align-items: center; justify-content: center; min-width: 0; }
.species-distribution-svg { display: block; width: 100%; height: auto; overflow: visible; }
.distribution-name { fill: var(--text); font-size: 16px; font-weight: 650; font-family: inherit; }
.distribution-percent { fill: var(--muted); font-size: 15px; font-weight: 500; font-family: inherit; }
.journal-distribution .distribution-chart { padding-left: 8px; padding-right: 8px; }
@media (min-width: 901px) { .journal-detail-grid { grid-template-columns: minmax(0, .85fr) minmax(0, .85fr) minmax(0, 1.3fr); } }
@media (min-width: 577px) and (max-width: 900px) { .journal-detail-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .journal-distribution { grid-column: 1 / -1; } }

.feed-latest-caption { flex-wrap: wrap; }
.feed-latest-caption > .feed-field-link { flex: 0 0 100%; text-align: right; margin-top: 0; }

/* Shared distribution and calendar colours follow the existing theme. */
:root {
  --species-color-1: #4565c8; --species-color-2: #27834d;
  --species-color-3: #ae701d; --species-color-4: #8654b2;
  --species-color-5: #bb5364; --species-color-6: #23858c;
  --species-color-7: #928522; --species-color-8: #686eb5;
  --species-color-9: #b56330; --species-color-10: #507c56;
  --species-color-11: #a7528a; --species-color-12: #527b98;
  --species-saturation: 55%; --species-lightness: 40%;
  --calendar-bird: var(--accent); --calendar-cat: var(--warning);
}
:root[data-theme="dark"] {
  --species-color-1: #6c89f7; --species-color-2: #69dc9a;
  --species-color-3: #f4b860; --species-color-4: #c18df0;
  --species-color-5: #f18d99; --species-color-6: #55c8cf;
  --species-color-7: #e6d76c; --species-color-8: #a5a9f2;
  --species-color-9: #ed9b66; --species-color-10: #86c99a;
  --species-color-11: #d48cbf; --species-color-12: #8daec8;
  --species-saturation: 65%; --species-lightness: 70%;
  --calendar-bird: var(--accent); --calendar-cat: var(--warning);
}
.journal-day-icons { align-items: center; }
.journal-day-icons i { font-size: 11px; }
.journal-bird-icon { color: var(--calendar-bird); }
.journal-cat-icon { color: var(--calendar-cat); }
.journal-legend i { margin-right: 5px; }
.journal-section-header { flex-wrap: wrap; gap: 12px; }
.journal-calendar-controls { flex-wrap: wrap; }
.distribution-chart { container-type: inline-size; }
.distribution-figure { width: 100%; min-width: 0; }
.distribution-separator { stroke: var(--surface); stroke-width: 1.5; pointer-events: none; }
.species-distribution-svg circle:hover { filter: brightness(1.1); }


.species-identity { display: flex; align-items: center; gap: 9px; min-width: 0; }
.species-thumbnail { display: block; width: 40px; height: 40px; flex-shrink: 0; object-fit: contain; border-radius: 6px; background: var(--accent-soft); }
.insights-species-row .species-thumbnail, .journal-highlight-identity .species-thumbnail, .journal-species-row .species-thumbnail { object-fit: cover; }
.journal-highlight-identity { display: flex; align-items: center; gap: 12px; margin: 12px 0 7px; }
.journal-highlight-identity strong { margin: 0; }
.journal-highlight-identity .species-thumbnail { width: 56px; height: 56px; }

.archive-learn-more { align-self: center; flex-shrink: 0; font-size: 12px; font-weight: 650; text-decoration: none; }


@media (prefers-reduced-motion: reduce) { .feed-expand-label i { transition: none; } }

.archive-media { max-height: 280px; }
.archive-card-heading .feed-scientific { font-size: 12px; line-height: 1.5; margin: 0; }
.archive-media, .feed-recent-media { height: clamp(160px, 18vw, 220px); aspect-ratio: auto; }
@media (max-width: 700px) { .archive-grid { grid-template-columns: 1fr; } }

.journal-sighting-row { cursor: pointer; }
.journal-table-card .journal-sighting-row > td:last-child { padding-top: 0; padding-bottom: 0; }
.journal-media-toggle { display: inline-grid; place-items: center; width: 44px; min-height: 44px; padding: 0; background: transparent; color: var(--muted); border: 0; border-radius: 4px; }
.journal-media-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.journal-media-toggle[aria-expanded="true"] i { transform: rotate(90deg); }
.journal-table-card .journal-media-row > td { padding: 0 12px 16px; }

.theme-switch-controls { display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin-left: 12px; }
.settings-preference-row .theme-switch-controls span { margin-top: 0; }
.theme-switch-controls .form-check { margin-bottom: 0; }
:root:not([data-theme="dark"]) .theme-mode-light, :root[data-theme="dark"] .theme-mode-dark { color: var(--text); font-weight: 650; }
.archive-filters {
  --archive-select-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23667477' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
  --archive-calendar-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cg fill='none' stroke='%23667477' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5'%3E%3Crect x='2' y='3.5' width='12' height='10.5' rx='1.5'/%3E%3Cpath d='M5 2v3M11 2v3M2 7h12'/%3E%3C/g%3E%3C/svg%3E");
}
:root[data-theme="dark"] .archive-filters {
  --archive-select-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23c5c8d2' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
  --archive-calendar-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cg fill='none' stroke='%23c5c8d2' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5'%3E%3Crect x='2' y='3.5' width='12' height='10.5' rx='1.5'/%3E%3Cpath d='M5 2v3M11 2v3M2 7h12'/%3E%3C/g%3E%3C/svg%3E");
}
.archive-filters .form-select { background-image: var(--archive-select-icon); }
#archive-date { background-image: var(--archive-calendar-icon); background-repeat: no-repeat; background-position: right .75rem center; background-size: 16px 16px; }
#archive-date::-webkit-calendar-picker-indicator { opacity: 0; cursor: pointer; }

.feed-timeline-toggle, .feed-timeline-missing { padding-left: 12px; padding-right: 12px; }
.feed-timeline-expanded { margin-left: 104px; }
@media (max-width: 700px) { .feed-timeline-expanded { margin-left: 0; } }
.journal-table-card .journal-sighting-row:hover > td {
  background-color: color-mix(in srgb, var(--accent-soft) 35%, transparent) !important;
}

.feed-sighting-confidence { display: inline-block; margin-left: 8px; color: var(--muted); font-size: 12px; font-weight: 500; }
.navbar-toggler { color: var(--muted); }
:root[data-theme="dark"] .navbar-toggler-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='%23c5c8d2' stroke-linecap='round' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E"); }

.journal-table-card a[href="#journal-birds"] .tab-icon { color: var(--calendar-bird); }
.journal-table-card a[href="#journal-cats"] .tab-icon { color: var(--calendar-cat); }
@media (min-width: 577px) and (max-width: 1100px) { .field-study-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.app-sidebar.navbar { padding: 0; }
.app-sidebar .sidebar-inner { padding: 0; }
.sidebar-brand-row { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 64px; }
.app-sidebar .navbar-brand { margin-right: 0; }
.app-sidebar .nav-link { display: flex; align-items: center; gap: 12px; min-height: 46px; }
.app-sidebar .nav-link > i { width: 20px; text-align: center; color: var(--accent); font-size: 18px; flex-shrink: 0; }
.app-sidebar .sidebar-settings { margin-top: 16px; margin-bottom: 12px; }
.app-sidebar .sidebar-navigation { padding-bottom: 8px; }
@media (min-width: 992px) {
  .app-sidebar.navbar { position: fixed; inset: 0 auto 0 0; z-index: 1030; display: flex; flex-direction: column; align-items: stretch; width: 224px; height: 100dvh; margin: 0; padding: 12px 16px 20px; background: var(--page); border-right: 1px solid var(--border); border-bottom: 0; }
  .app-sidebar .sidebar-inner { display: flex; flex-direction: column; align-items: stretch; height: 100%; min-height: 0; }
  .app-sidebar .sidebar-brand-row { flex-shrink: 0; margin-bottom: 22px; padding: 0 8px; }
  .app-sidebar .sidebar-navigation { display: flex !important; flex-direction: column; align-items: stretch; flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 0; }
  .app-sidebar .sidebar-links { flex-direction: column; gap: 8px; }
  .app-sidebar .sidebar-settings { margin-top: auto; margin-bottom: 0; }
  .app-shell:has(.app-sidebar) { padding-left: 248px; padding-right: 24px; }
  .app-shell:has(.app-sidebar) > .container { padding-top: 28px; }
}
