/* ============================================================
   Lens — NASA Photography Analytics
   Design System & Complete Stylesheet
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: #ffffff;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 11px;
  color: #1a1a1a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

/* ---------- Utility ---------- */
.hidden { display: none !important; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: #0a0a0a;
  display: flex;
  align-items: center;
  height: 54px;
  padding: 0 28px;
  position: relative;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.brand-name {
  font-family: 'Audiowide', sans-serif;
  font-size: 22px;
  color: #fc3d21;
  letter-spacing: 2px;
  text-transform: lowercase;
}

/* ---------- Nav Strip ---------- */
.nav-strip {
  display: flex;
  align-items: stretch;
  margin-left: 32px;
  height: 54px;
}

.nav-item {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #555;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.nav-item:hover {
  color: #888;
}

.nav-item.active {
  color: #fc3d21;
  border-bottom-color: #fc3d21;
}

a.nav-item, a.nav-item:visited { color: #555; }
a.nav-item.active, a.nav-item.active:visited { color: #fc3d21; }

.nav-icon {
  flex-shrink: 0;
  display: none;
  color: inherit;
}

.nav-label {
  /* shown by default */
}

/* ---------- Header Right / Mission Toggle ---------- */
.header-right {
  margin-left: auto;
  position: relative;
}

.mission-toggle {
  background: #1a1a1a;
  border: 1px solid #333;
  color: #aaa;
  font-size: 9px;
  font-family: 'Inter', sans-serif;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.mission-toggle:hover {
  border-color: #555;
}

.mission-toggle .arrow {
  font-size: 7px;
  color: #fc3d21;
}

.arrow {
  font-size: 7px;
  color: #fc3d21;
}

/* ---------- Mission Dropdown ---------- */
.mission-dropdown {
  position: absolute;
  top: 42px;
  right: 0;
  background: #0f0f0f;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  padding: 12px 16px;
  min-width: 240px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.tree-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #fc3d21;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #222;
}

.tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 11px;
  color: #ccc;
  cursor: pointer;
}

.tree-item:hover {
  color: #fff;
}

.tree-item.i1 { padding-left: 20px; }
.tree-item.i2 { padding-left: 40px; }

.chk {
  width: 14px;
  height: 14px;
  border: 1.5px solid #444;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chk.on {
  background: #fc3d21;
  border-color: #fc3d21;
}

.chk.on::after {
  content: '\2713';
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.chk.partial {
  border-color: #fc3d21;
}

.chk.partial::after {
  content: '\2014';
  color: #fc3d21;
  font-size: 10px;
  font-weight: 700;
}

.tree-ct {
  margin-left: auto;
  font-size: 9px;
  color: #555;
}

.tree-ct.red {
  color: #fc3d21;
}

.tree-div {
  height: 1px;
  background: #222;
  margin: 6px 0;
}

/* ============================================================
   HEADER RULE — Red stripe beneath header
   ============================================================ */
.header-rule {
  height: 5px;
  background: #fc3d21;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  padding: 28px 32px;
  border-bottom: 2px solid #e8e4df;
}

.hero-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: #fc3d21;
  margin-bottom: 4px;
}

.hero-sub {
  font-size: 11px;
  color: #999;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 24px;
}

/* ---------- Stat Row ---------- */
.stat-row {
  display: flex;
}

.stat-cell {
  flex: 1;
  padding-right: 28px;
  border-right: 2px solid #e0ddd8;
  margin-right: 28px;
}

.stat-cell:last-child {
  border-right: none;
  margin-right: 0;
  padding-right: 0;
}

.stat-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #fc3d21;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 48px;
  font-weight: 100;
  color: #1a1a1a;
  line-height: 1;
}

.stat-sub-text {
  font-size: 10px;
  color: #999;
  margin-top: 6px;
  letter-spacing: 1px;
}

/* ============================================================
   CHART GRIDS
   ============================================================ */
.chart-grid {
  display: grid;
  grid-template-columns: 5fr 3fr;
  border-bottom: 2px solid #e8e4df;
}

.chart-grid-2 {
  display: grid;
  grid-template-columns: 3fr 5fr;
  border-bottom: 2px solid #e8e4df;
}

.chart-panel {
  padding: 28px 32px;
}

.chart-panel + .chart-panel {
  border-left: 2px solid #e8e4df;
}

.chart-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #fc3d21;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #fc3d21;
}

/* ---------- Histogram ---------- */
.histogram {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 110px;
}

.histogram .bar {
  flex: 1;
  background: #fc3d21;
  min-width: 8px;
  border-radius: 0;
  transition: opacity 0.15s;
}

.histogram .bar:hover {
  opacity: 0.75;
}

.hist-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 8px;
  color: #aaa;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ---------- Camera Bar Chart ---------- */
.cam-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cam-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cam-name {
  width: 100px;
  font-size: 10px;
  font-weight: 500;
  color: #333;
  text-align: right;
  flex-shrink: 0;
}

.cam-bar-bg {
  flex: 1;
  height: 20px;
  background: #f0ece6;
}

.cam-bar {
  height: 100%;
  background: #fc3d21;
}

.cam-ct {
  width: 35px;
  font-size: 10px;
  color: #999;
  font-weight: 500;
  flex-shrink: 0;
}

/* ---------- Scatter Plot ---------- */
.scatter {
  position: relative;
  height: 120px;
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 19.5%,
      #f0ece6 19.5%,
      #f0ece6 20%
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 24%,
      #f0ece6 24%,
      #f0ece6 25%
    );
}

.dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fc3d21;
  opacity: 0.6;
}

.dot:hover {
  opacity: 1;
  transform: scale(1.5);
}

/* ---------- Photographer Table ---------- */
.ptable {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.ptable th {
  text-align: left;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #999;
  padding: 0 0 8px;
  border-bottom: 2px solid #e8e4df;
}

.ptable td {
  padding: 8px 0;
  border-bottom: 1px solid #f0ece6;
  color: #333;
}

.ptable td:first-child {
  font-weight: 500;
}

.cam-tag {
  display: inline-block;
  background: #fef0ed;
  color: #fc3d21;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 2px;
  font-weight: 600;
}

.drill-browse-link:hover {
  background: #fc3d21 !important;
  color: #fff !important;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: #0a0a0a;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #444;
  margin-top: auto;
}

.footer-brand {
  font-family: 'Audiowide', sans-serif;
  color: #fc3d21;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: lowercase;
}

.disclaimer {
  font-size: 8px;
  color: #333;
  letter-spacing: 1px;
}

.data-note {
  font-size: 9px;
  color: #555;
}

/* ============================================================
   LOADING & ERROR STATES
   ============================================================ */
.loading {
  text-align: center;
  padding: 80px 32px;
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #999;
}

.error {
  text-align: center;
  padding: 80px 32px;
  font-size: 12px;
  font-weight: 400;
  color: #fc3d21;
  letter-spacing: 1px;
}

/* ============================================================
   BROWSE PAGE — Photo Grid
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px;
  border-bottom: 2px solid #e8e4df;
  flex-wrap: wrap;
}

.filter-select {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #333;
  border: 1px solid #e8e4df;
  border-radius: 3px;
  padding: 6px 12px;
  background: #fff;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath fill='%23999' d='M0 0l4 5 4-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.filter-select:focus {
  outline: none;
  border-color: #fc3d21;
}

.filter-input {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 1px;
  color: #333;
  border: 1px solid #e8e4df;
  border-radius: 3px;
  padding: 6px 12px;
  background: #fff;
  min-width: 180px;
}

.filter-input:focus {
  outline: none;
  border-color: #fc3d21;
}

.filter-input::placeholder {
  color: #bbb;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 9px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2px;
  padding: 2px;
}

.photo-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  background: #f0ece6;
}

.photo-card:hover .photo-overlay {
  opacity: 1;
}

.photo-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.photo-card.portrait {
  background: #1a1a1a;
}

.photo-card.portrait .photo-thumb {
  object-fit: contain;
}

.photo-card.portrait .photo-overlay {
  background: linear-gradient(transparent 40%, rgba(10, 10, 10, 0.9));
}

.photo-card:hover .photo-thumb {
  transform: scale(1.03);
}

.photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 40%, rgba(10, 10, 10, 0.8));
  opacity: 0;
  transition: opacity 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
}

.photo-overlay .overlay-title {
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.photo-overlay .overlay-meta {
  font-size: 8px;
  color: #aaa;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.load-more-btn {
  display: block;
  margin: 24px auto;
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #fc3d21;
  background: transparent;
  border: 2px solid #fc3d21;
  border-radius: 3px;
  padding: 10px 28px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.load-more-btn:hover {
  background: #fc3d21;
  color: #fff;
}

/* ============================================================
   DETAIL PANEL / MODAL
   ============================================================ */
.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 480px;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 200;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.25s ease-out;
}

.detail-panel .detail-image {
  width: 100%;
  max-height: 50vh;
  object-fit: contain;
  background: #1a1a1a;
}

.detail-panel .detail-body {
  padding: 24px 28px;
}

.detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  background: rgba(10, 10, 10, 0.6);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 201;
  transition: background 0.15s;
}

.detail-close:hover {
  background: rgba(10, 10, 10, 0.85);
}

.exif-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.exif-table th {
  text-align: left;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #999;
  padding: 6px 0;
  border-bottom: 1px solid #e8e4df;
  width: 35%;
}

.exif-table td {
  padding: 6px 0;
  border-bottom: 1px solid #f0ece6;
  color: #333;
}

/* --- Secondary EXIF (collapsible) --- */
.secondary-exif {
  margin-top: 16px;
  border-top: 1px solid #e8e4df;
  padding-top: 12px;
}
.secondary-exif summary {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #999;
  cursor: pointer;
  margin-bottom: 8px;
  list-style: none;
}
.secondary-exif summary::-webkit-details-marker { display: none; }
.secondary-exif summary::before {
  content: '+ ';
  color: #0B3D91;
}
.secondary-exif[open] summary::before {
  content: '- ';
}
.secondary-exif summary:hover { color: #0B3D91; }
.exif-table.secondary th { color: #bbb; }
.keyword-tag {
  display: inline-block;
  background: #f0ece6;
  color: #666;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 2px;
  margin: 1px;
}

/* Detail panel backdrop */
.detail-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.3);
  z-index: 199;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* ============================================================
   CHART.JS CANVAS OVERRIDES
   ============================================================ */
.chart-panel canvas {
  max-width: 100%;
}

/* ============================================================
   MAIN CONTENT — ensures footer stays at bottom
   ============================================================ */
#main-content {
  flex: 1;
}

/* ============================================================
   SECTION TITLE — generic reusable
   ============================================================ */
.section-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #fc3d21;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #fc3d21;
}

/* ============================================================
   RESPONSIVE — < 768px
   ============================================================ */
/* ============================================================
   BROWSE PAGE — Sidebar Layout
   ============================================================ */
.browse-container {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 0;
  position: relative;
}

#main-content {
  display: flex;
  flex-direction: column;
}

/* --- Sidebar --- */
.browse-sidebar {
  width: 260px;
  background: #faf9f7;
  border-right: 2px solid #e8e4df;
  padding: 20px;
  flex-shrink: 0;
  align-self: stretch;
}

.sidebar-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #fc3d21;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #fc3d21;
}

.filter-group {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e8e4df;
}
.filter-group:last-of-type {
  border-bottom: none;
}

.filter-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 8px;
}

.browse-sidebar .filter-select {
  width: 100%;
  padding: 7px 10px;
  font-size: 11px;
  padding-right: 28px;
}

/* --- Range Inputs (legacy, kept for compat) --- */
.range-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.range-input {
  flex: 1;
  padding: 6px 8px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #fff;
  color: #333;
  text-align: center;
  width: 0;
}

.range-input:focus {
  outline: none;
  border-color: #0B3D91;
}

.range-dash {
  font-size: 11px;
  color: #ccc;
  flex-shrink: 0;
}

.range-unit {
  font-size: 9px;
  color: #aaa;
  flex-shrink: 0;
  width: 28px;
}

/* --- Dual-Range Slider Widget --- */
.range-slider-widget {
  margin-top: 4px;
}

.range-values {
  display: flex;
  justify-content: space-between;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 500;
  color: #333;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.range-values .range-val-min,
.range-values .range-val-max {
  min-width: 0;
}

.range-values .range-val-min {
  color: #0B3D91;
}

.range-values .range-val-max {
  color: #0B3D91;
  text-align: right;
}

.range-slider-track {
  position: relative;
  height: 16px;
  display: flex;
  align-items: center;
  user-select: none;
}

.range-slider-track .track-bg {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: #e8e4df;
  border-radius: 2px;
  pointer-events: none;
}

.range-slider-track .track-fill {
  position: absolute;
  height: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: #0B3D91;
  border-radius: 2px;
  pointer-events: none;
}

.range-slider-track input[type="range"] {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  z-index: 2;
}

.range-slider-track input[type="range"].range-min {
  z-index: 2;
}

.range-slider-track input[type="range"].range-max {
  z-index: 3;
}

.range-slider-track input[type="range"].z-top {
  z-index: 4;
}

/* Webkit thumb — margin-top centers the 16px thumb on the 16px track */
.range-slider-track input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #0B3D91;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  pointer-events: all;
  margin-top: 0;
}

.range-slider-track input[type="range"]::-webkit-slider-thumb:hover {
  background: #0d4aad;
  box-shadow: 0 1px 5px rgba(11, 61, 145, 0.4);
}

.range-slider-track input[type="range"]::-webkit-slider-thumb:active {
  background: #093275;
  box-shadow: 0 0 0 3px rgba(11, 61, 145, 0.2);
}

/* Firefox thumb */
.range-slider-track input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #0B3D91;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  pointer-events: all;
}

.range-slider-track input[type="range"]::-moz-range-thumb:hover {
  background: #0d4aad;
  box-shadow: 0 1px 5px rgba(11, 61, 145, 0.4);
}

.range-slider-track input[type="range"]::-moz-range-thumb:active {
  background: #093275;
  box-shadow: 0 0 0 3px rgba(11, 61, 145, 0.2);
}

/* Firefox track — full height so thumb centers on container midline */
.range-slider-track input[type="range"]::-moz-range-track {
  background: transparent;
  border: none;
  height: 16px;
}

/* Webkit track — full height so thumb centers on container midline */
.range-slider-track input[type="range"]::-webkit-slider-runnable-track {
  background: transparent;
  border: none;
  height: 16px;
}

/* --- Preset Chips --- */
.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.preset-chip {
  font-size: 9px;
  padding: 3px 8px;
  border-radius: 2px;
  border: 1px solid #ddd;
  background: #fff;
  color: #666;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  letter-spacing: 1px;
}

.preset-chip:hover {
  border-color: #0B3D91;
  color: #0B3D91;
}

.preset-chip.active {
  background: #0B3D91;
  color: #fff;
  border-color: #0B3D91;
}

/* --- Sparkline Histogram --- */
.sidebar-hist {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 30px;
  margin-top: 6px;
  margin-bottom: 4px;
}

.sidebar-hist div {
  flex: 1;
  background: #fc3d21;
  opacity: 0.3;
  min-width: 2px;
  border-radius: 1px 1px 0 0;
  transition: opacity 0.2s;
}

.sidebar-hist div.in-range {
  opacity: 1.0;
}

/* --- Divider --- */
.filter-divider {
  height: 1px;
  background: #e8e4df;
  margin: 16px 0;
}

/* --- Result Count --- */
.result-count {
  font-size: 10px;
  color: #999;
  letter-spacing: 1px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e8e4df;
}

.result-count strong {
  color: #fc3d21;
  font-weight: 700;
}

/* --- Clear All Filters --- */
.clear-filters {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fc3d21;
  cursor: pointer;
  margin-top: 8px;
  display: inline-block;
  transition: opacity 0.15s;
}

.clear-filters:hover {
  opacity: 0.7;
}

/* --- Browse Main --- */
.browse-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* --- Browse Topbar (sort + count) --- */
.browse-topbar {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 2px solid #e8e4df;
  gap: 12px;
}

.topbar-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #999;
}

.browse-topbar .filter-select {
  width: auto;
  padding: 5px 10px;
  padding-right: 28px;
}

.browse-topbar-count {
  font-size: 10px;
  color: #999;
  letter-spacing: 1px;
  white-space: nowrap;
}

/* --- Search --- */
.search-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  color: #999;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 8px 32px 8px 30px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #f5f3f0;
  color: #333;
  transition: border-color 0.15s;
}

.search-input:focus {
  outline: none;
  border-color: #0B3D91;
  box-shadow: 0 0 0 2px rgba(11, 61, 145, 0.1);
}

.search-input::placeholder {
  color: #bbb;
  font-size: 10px;
  letter-spacing: 0.3px;
}

.search-clear {
  position: absolute;
  right: 6px;
  width: 20px;
  height: 20px;
  border: none;
  background: #e8e4df;
  color: #666;
  border-radius: 50%;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.search-clear:hover {
  background: #fc3d21;
  color: #fff;
}

.search-clear.hidden {
  display: none;
}

/* --- FAB (Floating Action Button) — mobile only --- */
.filter-fab {
  display: none; /* hidden on desktop */
  position: fixed;
  bottom: 20px;
  right: 16px;
  background: #fc3d21;
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(252, 61, 33, 0.4);
  z-index: 150;
  cursor: pointer;
  border: none;
}

.filter-fab svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

.filter-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #0a0a0a;
  color: #fc3d21;
  font-size: 9px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fc3d21;
}

/* --- Mobile Panel Header (hidden on desktop) --- */
.browse-panel-header {
  display: none;
}

/* --- Mobile Panel Backdrop (hidden on desktop) --- */
.browse-panel-backdrop {
  display: none;
}

/* --- Mobile Apply Button (hidden on desktop) --- */
.mobile-apply-btn {
  display: none;
}

/* --- Slide-in animation --- */
@keyframes slideInLeft {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

/* ============================================================
   RESPONSIVE — < 768px
   ============================================================ */
@media (max-width: 768px) {
  .site-header {
    padding: 0 16px;
    height: 48px;
  }

  .nav-strip {
    margin-left: 16px;
    height: 48px;
  }

  .nav-item {
    padding: 0 10px;
    font-size: 8px;
    letter-spacing: 1px;
  }

  .nav-icon {
    display: block;
  }

  .nav-label {
    display: none;
  }

  .hero {
    padding: 20px;
  }

  .stat-row {
    flex-wrap: wrap;
    gap: 20px;
  }

  .stat-cell {
    flex: none;
    width: calc(50% - 10px);
    border-right: none;
    margin-right: 0;
    padding-right: 0;
    padding-bottom: 16px;
    border-bottom: 1px solid #e8e4df;
  }

  .stat-cell:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .chart-grid,
  .chart-grid-2 {
    grid-template-columns: 1fr;
  }

  .chart-panel + .chart-panel {
    border-left: none;
    border-top: 2px solid #e8e4df;
  }

  .chart-panel {
    padding: 20px;
  }

  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .detail-panel {
    width: 100%;
  }

  .filter-bar {
    padding: 12px 16px;
  }

  .site-footer {
    padding: 12px 16px;
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  /* --- Browse Sidebar: slide-out panel on mobile --- */
  .browse-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    max-height: 100vh;
    z-index: 160;
    transform: translateX(-100%);
    transition: transform 0.25s ease-out;
    box-shadow: none;
    border-right: none;
    padding: 16px;
  }

  .browse-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  }

  /* Hide the static sidebar title on mobile — use panel header instead */
  .browse-sidebar .sidebar-title {
    display: none;
  }

  /* Panel header visible on mobile */
  .browse-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #fc3d21;
  }

  .panel-title {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #fc3d21;
  }

  .panel-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e8e4df;
    border: none;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
  }

  .panel-close:hover {
    background: #ddd;
  }

  /* Mobile backdrop */
  .browse-panel-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.5);
    z-index: 155;
  }

  .browse-panel-backdrop.open {
    display: block;
    animation: fadeIn 0.2s ease-out;
  }

  /* Show FAB on mobile */
  .filter-fab {
    display: flex;
  }

  /* Show mobile Apply button */
  .mobile-apply-btn {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 12px;
    background: #fc3d21;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity 0.15s;
  }

  .mobile-apply-btn:hover {
    opacity: 0.85;
  }

  /* Browse topbar adjustments */
  .browse-topbar {
    padding: 10px 16px;
    gap: 8px;
  }

  .topbar-label {
    font-size: 8px;
  }
}

/* ============================================================
   MULTI-SELECT DROPDOWNS
   ============================================================ */
.multi-select-container { position: relative; }

.multi-select-toggle {
  width: 100%; padding: 6px 8px;
  font-family: 'Inter', sans-serif; font-size: 11px;
  border: 1px solid #ddd; border-radius: 3px;
  background: #fff; color: #333; cursor: pointer;
  min-height: 32px; display: flex; align-items: center;
  flex-wrap: wrap; gap: 4px; position: relative;
}

.multi-select-toggle::after {
  display: none;
}

.multi-select-chip {
  display: inline-flex; align-items: center; gap: 3px;
  background: #0B3D91; color: #fff; font-size: 9px;
  font-weight: 600; padding: 2px 6px; border-radius: 2px;
}

.multi-select-chip .chip-x {
  cursor: pointer; font-size: 11px; opacity: 0.7; line-height: 1;
}

.multi-select-chip .chip-x:hover { opacity: 1; }

.multi-select-placeholder { color: #999; font-size: 11px; }

.multi-select-dropdown {
  position: absolute; top: 100%; left: 0; right: 0;
  background: #fff; border: 1px solid #ddd; border-top: none;
  border-radius: 0 0 3px 3px; max-height: 200px; overflow-y: auto;
  z-index: 50; box-shadow: 0 4px 12px rgba(0,0,0,0.1); display: none;
}

.multi-select-dropdown.open { display: block; }

.multi-select-option {
  padding: 6px 10px; font-size: 11px; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
}

.multi-select-option:hover { background: #f5f3f0; }

.multi-select-option .chk {
  width: 12px; height: 12px; border: 1.5px solid #ccc;
  border-radius: 2px; flex-shrink: 0; display: flex;
  align-items: center; justify-content: center;
}

.multi-select-option .chk.on { background: #0B3D91; border-color: #0B3D91; }

.multi-select-option .chk.on::after {
  content: '\2713'; color: #fff; font-size: 8px; font-weight: 700;
}

.multi-select-option .opt-count {
  margin-left: auto; font-size: 9px; color: #999;
}

/* Grouped multi-select (camera brands) */
.multi-select-group {
  padding: 6px 10px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #faf9f7;
  border-top: 1px solid #f0ece6;
}

.multi-select-group:first-child {
  border-top: none;
}

.multi-select-group:hover {
  background: #f0ece6;
}

.multi-select-group .chk {
  width: 12px;
  height: 12px;
  border: 1.5px solid #ccc;
  border-radius: 2px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.multi-select-group .chk.on {
  background: #0B3D91;
  border-color: #0B3D91;
}

.multi-select-group .chk.on::after {
  content: '✓';
  color: #fff;
  font-size: 8px;
  font-weight: 700;
}

.multi-select-group .chk.partial {
  border-color: #0B3D91;
}

.multi-select-group .chk.partial::after {
  content: '–';
  color: #0B3D91;
  font-size: 10px;
  font-weight: 700;
}

.multi-select-group .opt-count {
  margin-left: auto;
  font-size: 9px;
  color: #999;
}

.multi-select-option.ms-indent {
  padding-left: 28px;
}

/* These rules moved near other nav styles — see above */

/* ============================================================
   RESPONSIVE — < 540px (narrow / icon-only nav)
   ============================================================ */
@media (max-width: 540px) {
  .site-header {
    padding: 0 10px;
    height: 44px;
  }

  .brand-name {
    font-size: 18px;
    letter-spacing: 1px;
  }

  .nav-strip {
    margin-left: 8px;
    height: 44px;
    gap: 0;
  }

  .nav-item {
    padding: 0 10px;
    gap: 0;
  }

  .nav-icon {
    display: block;
  }

  .nav-label {
    display: none;
  }

  .header-right {
    margin-left: auto;
  }

  .mission-toggle {
    font-size: 8px;
    padding: 4px 8px;
    letter-spacing: 1px;
  }

  .mission-dropdown {
    right: -10px;
    min-width: 220px;
  }
}
