/* ═══════════════════════════════════════════════════════════════════
   Kika — Modern dashboard redesign
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,600;0,6..72,700;1,6..72,400&family=Hanken+Grotesk:wght@400;500;600;700&family=Spline+Sans+Mono:wght@400;500&display=swap');

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

/* ── Design tokens ──────────────────────────────────────────────────── */
:root {
  /* ── Palette (dark defaults) ─────────────────────────── */
  --bg:               #0d0d0f;
  --surface:          #16161b;
  --surface-2:        #1e1e25;
  --surface-3:        #26262f;

  --lavender:         #A98EF7;
  --lavender-muted:   #7860C8;
  --lavender-dim:     rgba(169,142,247,0.14);
  --lavender-glow:    0 0 20px rgba(169,142,247,0.35);
  --sage:             #6EAB74;
  --sage-dim:         rgba(110,171,116,0.14);
  --gold:             #C9A84C;
  --gold-dim:         rgba(201,168,76,0.14);

  --text:             #EEEEF3;
  --text-secondary:   #8E8EA8;
  --text-muted:       #55556A;
  --border:           #26262F;
  --border-subtle:    #1e1e25;
  --danger:           #E05C6A;

  /* ── Typography scale ────────────────────────────────── */
  --font-serif:       'Newsreader', Georgia, serif;
  --font-ui:          'Hanken Grotesk', system-ui, sans-serif;
  --font-mono:        'Spline Sans Mono', 'Fira Mono', monospace;

  /* ── Radius ──────────────────────────────────────────── */
  --radius-sm:        10px;
  --radius-md:        16px;
  --radius-lg:        20px;
  --radius-xl:        28px;

  /* ── Transitions ─────────────────────────────────────── */
  --transition:       150ms ease;

  /* ── Theme-sensitive ─────────────────────────────────── */
  --btn-hover-bg:     #22222c;
  --border-hover:     #36364a;
  --surface-hover:    #1e1e28;
  --shimmer-mid:      #2a2a36;
  --bird-seen-bg:     rgba(25, 50, 40, 0.30);
  --btn-edit-bg:      rgba(13, 13, 15, 0.80);
  --overlay-bg:       rgba(0,0,0,0.72);
  --shadow-card:      0 2px 10px rgba(0,0,0,0.35);
  --shadow-modal:     0 8px 40px rgba(0,0,0,0.55);
  --shadow-dropdown:  0 8px 24px rgba(0,0,0,0.50);
  --shadow-toast:     0 4px 16px rgba(0,0,0,0.4);
  --shadow-savebar:   0 -4px 16px rgba(0,0,0,0.3);
  --shadow-login:     0 4px 24px rgba(0,0,0,0.4);
  --shadow-fab:       0 4px 20px rgba(169,142,247,0.40);
  --rarity-5-text:    #e0d8ff;
  --btn-danger-hover: #c0394a;

  /* ── Backward-compat aliases ─────────────────────────── */
  --text-primary:     var(--text);
  --surface-raised:   var(--surface-2);
  --bg-card:          var(--surface);
  --bg-card-hover:    var(--surface-2);
  --bg-garden:        rgba(30, 65, 50, 0.30);
  --bg-pill-on:       var(--lavender-dim);
  --bg-milestone:     var(--lavender-dim);
  --bg-photo:         rgba(255, 255, 255, 0.04);
  --bg-raised:        var(--surface-2);
  --bg-modal:         var(--surface);
  --bg-nav:           var(--surface);
  --text-lavender:    var(--lavender);
  --text-pill-on:     var(--lavender);
  --text-pill-off:    var(--text-muted);
  --text-count:       var(--text);
  --text-count-sub:   var(--text-secondary);
  --text-section:     var(--text-secondary);
  --text-gtag:        var(--sage);
  --text-wordmark:    var(--text);
  --text-wordmark-k:  var(--lavender);
  --text-dim:         var(--text-muted);
  --accent:           var(--sage);
  --accent-err:       var(--danger);
  --border-seen:      rgba(110, 171, 116, 0.25);
}

/* ── Light theme ────────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:               #F2F1F7;
  --surface:          #FFFFFF;
  --surface-2:        #EAE8F4;
  --surface-3:        #DDD9EF;

  --lavender:         #6C4FE0;
  --lavender-muted:   #4F38B0;
  --lavender-dim:     rgba(108, 79, 224, 0.10);
  --lavender-glow:    0 0 20px rgba(108, 79, 224, 0.25);
  --sage:             #3E7E44;
  --sage-dim:         rgba(62, 126, 68, 0.10);
  --gold:             #A07820;
  --gold-dim:         rgba(160, 120, 32, 0.10);

  --text:             #17172A;
  --text-secondary:   #5A5A7A;
  --text-muted:       #8888A0;
  --border:           #D8D4EC;
  --border-subtle:    #EAE8F4;
  --danger:           #C0394A;

  /* theme-sensitive */
  --btn-hover-bg:     #E8E4F4;
  --border-hover:     #B8B4D0;
  --surface-hover:    #EAE8F4;
  --shimmer-mid:      #EDE8F8;
  --bird-seen-bg:     rgba(25, 50, 40, 0.08);
  --btn-edit-bg:      rgba(0, 0, 0, 0.55);
  --overlay-bg:       rgba(0,0,0,0.50);
  --shadow-card:      0 2px 8px rgba(0,0,0,0.08);
  --shadow-modal:     0 8px 32px rgba(0,0,0,0.15);
  --shadow-dropdown:  0 8px 24px rgba(0,0,0,0.12);
  --shadow-toast:     0 4px 16px rgba(0,0,0,0.10);
  --shadow-savebar:   0 -4px 16px rgba(0,0,0,0.08);
  --shadow-login:     0 4px 24px rgba(0,0,0,0.12);
  --shadow-fab:       0 4px 20px rgba(108, 79, 224, 0.30);
  --rarity-5-text:    #4F38B0;
  --btn-danger-hover: #a02838;

  /* backward-compat aliases (light overrides) */
  --text-primary:     var(--text);
  --surface-raised:   var(--surface-2);
  --bg-card:          var(--surface);
  --bg-card-hover:    var(--surface-2);
  --bg-garden:        rgba(30, 65, 50, 0.08);
  --bg-photo:         rgba(0, 0, 0, 0.04);
  --bg-raised:        var(--surface-2);
  --border-seen:      rgba(62, 126, 68, 0.28);
}

/* ── Base ───────────────────────────────────────────────────────────── */
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  padding-top: 56px;
}

a { color: var(--lavender); text-decoration: none; }
a:hover { opacity: 0.85; }
img { display: block; max-width: 100%; }

/* ── Ambient blobs — removed ────────────────────────────────────────── */
.blob { display: none; }

/* ── Page wrapper ───────────────────────────────────────────────────── */
.page-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  position: relative;
  z-index: 2;
}

/* ── Nav / Header ───────────────────────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 56px;
  background: var(--surface);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.header-brand {
  text-decoration: none;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.wordmark {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 5px;
}
.wordmark em    { color: var(--lavender); font-style: normal; font-weight: 400; }
.wordmark-bird  { font-size: 15px; }

.app-title      { font-size: 16px; font-weight: 600; color: var(--text-primary); letter-spacing: 0.02em; }
.header-logo    { font-size: 20px; }
.header-actions { display: flex; align-items: center; gap: 14px; }

.header-nav-links {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.nav-link {
  position: relative;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: color var(--transition);
  white-space: nowrap;
}
.nav-link:hover  { color: var(--text-primary); opacity: 1; }
.nav-link.active { color: var(--lavender); }
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 3px; left: 12px; right: 12px;
  height: 2px;
  background: var(--lavender);
  border-radius: 1px;
}

.header-nav-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.nav-cta { font-size: 12px; }

.nav-logout {
  font-size: 11px;
  color: var(--text-muted);
  padding: 8px 4px 8px 12px;
  text-decoration: none;
  margin-left: 4px;
  border-left: 1px solid var(--border);
  transition: color var(--transition);
  white-space: nowrap;
}
.nav-logout:hover { color: var(--text-secondary); opacity: 1; }

/* Hamburger — hidden everywhere (replaced by bottom nav on mobile) */
.hamburger { display: none; }

/* Old mobile dropdown — kept in DOM but never shown */
.mobile-menu { display: none !important; }

/* ── Mobile bottom navigation ───────────────────────────────────────── */
.mobile-bottom-nav {
  display: none;
}

/* Mobile-only logout stripe */
.mobile-top-stripe {
  display: none;
}

@media (max-width: 640px) {
  /* Hide desktop header entirely */
  .app-header { display: none; }

  /* Body: no top padding, bottom padding clears the nav bar */
  body {
    padding-top: 0;
    padding-bottom: 72px;
  }

  /* Mobile logout in top-right corner */
  .mobile-top-stripe {
    display: flex;
    position: fixed;
    top: 0; right: 0;
    z-index: 200;
    padding: 6px 14px;
    pointer-events: none;
  }
  .mobile-logout-link {
    font-size: 11px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    pointer-events: all;
    transition: color var(--transition);
  }
  .mobile-logout-link:hover { color: var(--text-secondary); opacity: 1; }

  /* Bottom nav bar */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 100;
    align-items: center;
    justify-content: space-around;
    padding: 0 4px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .mbn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    height: 100%;
    text-decoration: none;
    color: var(--text-muted);
    background: none;
    border: none;
    font-family: var(--font-ui);
    cursor: pointer;
    padding: 0;
    transition: color var(--transition);
    -webkit-tap-highlight-color: transparent;
  }
  .mbn-item:hover { opacity: 1; }

  .mbn-icon {
    font-size: 18px;
    line-height: 1;
    display: block;
  }
  .mbn-label {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1;
    white-space: nowrap;
  }

  .mbn-item.mbn-active {
    color: var(--lavender);
  }

  /* Center add button */
  .mbn-item.mbn-add {
    flex: 0 0 56px;
  }
  .mbn-add-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--lavender);
    border-radius: 50%;
    font-size: 22px;
    color: white;
    font-weight: 700;
    line-height: 1;
    box-shadow: var(--lavender-glow);
  }
}

/* ── Buttons ────────────────────────────────────────────────────────── */
button, .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 18px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
button:hover, .btn:hover {
  background: var(--btn-hover-bg);
  color: var(--text-primary);
}

.btn-primary {
  background: var(--lavender);
  color: #fff;
  border-radius: var(--radius-sm);
}
.btn-primary:hover { background: var(--lavender-muted); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.btn-ghost:hover { background: var(--surface-raised); color: var(--text-primary); }

.btn-green        { background: rgba(122, 158, 126, 0.15); color: var(--sage); }
.btn-green:hover  { background: rgba(122, 158, 126, 0.25); color: var(--sage); }
.btn-full         { width: 100%; justify-content: center; }

/* Danger button */
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: var(--btn-danger-hover); color: #fff; }

/* ── Forms ──────────────────────────────────────────────────────────── */
input[type="text"],
input[type="password"],
input[type="url"],
input[type="search"],
input[type="date"],
select,
textarea {
  width: 100%;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--transition);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--lavender);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
textarea { resize: vertical; min-height: 64px; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2355556a' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
input[type="checkbox"] {
  width: auto;
  accent-color: var(--lavender);
}
label {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}

.form-group   { display: flex; flex-direction: column; gap: 4px; }
.form-row     { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid    { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.form-actions { display: flex; gap: 8px; margin-top: 16px; }

@media (max-width: 480px) {
  .form-row, .form-grid { grid-template-columns: 1fr; }
}

/* ── Section labels ─────────────────────────────────────────────────── */
.section-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::after { display: none; }

/* ── Rarity tags ────────────────────────────────────────────────────── */
.rarity-badge, .rarity-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 10px;
  border-radius: 999px;
  border: none;
  white-space: nowrap;
}
/* Vanlig */
.rarity-1, .r1 { background: rgba(122, 158, 126, 0.15); color: var(--sage); }
/* Ovanlig */
.rarity-2, .r2 { background: var(--lavender-dim); color: var(--lavender); }
/* Sällsynt */
.rarity-3, .r3 { background: rgba(155, 135, 245, 0.20); color: var(--lavender); }
/* Mycket sällsynt */
.rarity-4, .r4 { background: rgba(155, 135, 245, 0.30); color: var(--lavender); }
/* Extremt sällsynt */
.rarity-5, .r5 { background: rgba(155, 135, 245, 0.45); color: var(--rarity-5-text); }

/* ── Garden tag (inline) ────────────────────────────────────────────── */
.gtag {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--sage);
  background: rgba(122, 158, 126, 0.12);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: none;
}

/* ── Pill toggles ───────────────────────────────────────────────────── */
.pill, .toggle-btn {
  font-size: 0.7rem;
  padding: 5px 13px;
  border-radius: 999px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-ui);
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.pill.active, .toggle-btn.active {
  background: var(--lavender-dim);
  color: var(--lavender);
}
.pill-group, .toggle-group {
  display: flex;
  align-items: center;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
  gap: 1px;
}
.pill-divider {
  width: 1px;
  background: var(--border);
  margin: 0 2px;
  align-self: stretch;
}
.toggle-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ── Entry cards (species list rows) ────────────────────────────────── */
.entry, .species-item {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 14px 12px 10px;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.2s;
  border: 1px solid var(--border);
}
.entry:hover, .species-item:hover { background: var(--surface-raised); }
.entry.garden { background: rgba(30, 65, 50, 0.25); border-color: rgba(122, 158, 126, 0.18); }

.entry-photo, .species-thumb {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: var(--surface-raised);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.entry-photo img, .species-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: opacity var(--transition);
}
.entry-photo img:hover, .species-thumb img:hover { opacity: 0.80; }
.species-thumb-placeholder { font-size: 18px; opacity: 0.20; user-select: none; }

.entry-sv, .species-sv   { font-size: 0.875rem; color: var(--text-primary); font-weight: 600; }
.entry-en, .species-en   { font-size: 11px; color: var(--text-secondary); font-style: italic; margin-top: 2px; }
.entry-date, .species-date { font-size: 10px; color: var(--text-muted); text-align: right; }

.species-names { flex: 1; min-width: 0; }
.species-rank  { font-size: 11px; color: var(--text-muted); min-width: 22px; text-align: right; flex-shrink: 0; }
.species-meta  { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.species-list  { display: flex; flex-direction: column; gap: 0; }

.prev-year-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

/* ── Count hero (lists page) ─────────────────────────────────────────── */
.count-hero    { margin: 1.5rem 0 1.25rem; }
.count-n       { font-size: 2.5rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em; line-height: 1; }
.count-u       { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.count-sub     { font-size: 10px; color: var(--text-secondary); letter-spacing: 0.10em; margin-top: 3px; }

.species-count  { margin: 1.5rem 0 1.25rem; display: flex; align-items: baseline; gap: 8px; }
.species-number { font-size: 2.5rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em; line-height: 1; }
.species-label  { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }

/* ── Milestone ──────────────────────────────────────────────────────── */
.milestone-banner, .milestone {
  background: var(--lavender-dim);
  border: 1px solid rgba(155, 135, 245, 0.20);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 18px;
}
.milestone-icon { font-size: 13px; opacity: 0.60; }
.milestone-main, .milestone-text {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 400;
}
.milestone-main strong, .milestone-text strong { color: var(--lavender); font-weight: 600; }
.milestone-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  padding: 4px 0 0;
  display: block;
  text-align: left;
  letter-spacing: 0.04em;
  font-family: var(--font-ui);
}
.milestone-toggle:hover { color: var(--lavender); }
.milestone-history {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(155, 135, 245, 0.15);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.milestone-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
}
.milestone-row strong { color: var(--lavender); }

.list-controls      { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.list-context-label { font-size: 0.7rem; color: var(--text-secondary); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; }
.list-loading, .list-empty { text-align: center; padding: 3rem 1rem; color: var(--text-muted); font-size: 14px; }
.garden-link { font-size: 11px; color: var(--text-muted); text-decoration: none; transition: color var(--transition); }
.garden-link:hover { color: var(--lavender); }

/* ── App container ──────────────────────────────────────────────────── */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  position: relative;
  z-index: 2;
}

/* ── Stats bar ──────────────────────────────────────────────────────── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 1.25rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition);
  border-left: 3px solid transparent;
}
.stat-card:hover {
  border-left-color: var(--lavender);
}
.stat-number { font-size: 2.5rem; font-weight: 700; color: var(--text-primary); line-height: 1.1; }
.stat-date   { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.stat-label  { font-size: 0.7rem; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; margin-top: 4px; }

@media (max-width: 480px) {
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .stat-number { font-size: 2rem; }
}

/* ── Filter bar ─────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.filter-pills { display: flex; gap: 4px; flex-shrink: 0; }
.filter-pill {
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: var(--font-ui);
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.filter-pill:hover  { background: var(--lavender-dim); color: var(--lavender); }
.filter-pill.active { background: var(--lavender-dim); color: var(--lavender); }

.filter-controls { display: flex; gap: 8px; flex: 1; min-width: 0; }
.filter-select   { max-width: 180px; flex-shrink: 0; }
.filter-search   { flex: 1; min-width: 0; }

@media (max-width: 600px) {
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-pills { justify-content: center; }
  .filter-controls { flex-direction: column; }
  .filter-select { max-width: 100%; }
}

/* ── Bird grid ──────────────────────────────────────────────────────── */
.bird-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
@media (max-width: 480px) {
  .bird-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
}

.empty-state, .loading-state {
  grid-column: 1 / -1;
  color: var(--text-muted);
  text-align: center;
  padding: 3rem 1rem;
  font-size: 14px;
}

/* ── Bird cards ─────────────────────────────────────────────────────── */
.bird-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, border-color 0.2s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  user-select: none;
}
.bird-card:hover { background: var(--surface-raised); transform: translateY(-1px); border-color: var(--border-hover); }
.bird-seen       { background: var(--bird-seen-bg); border-color: var(--border); }

.card-image {
  position: relative;
  background: var(--surface-raised);
  height: 120px;
  overflow: hidden;
  flex-shrink: 0;
}
.card-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s;
}
.img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  opacity: 0.10;
  background: transparent;
}

.btn-edit {
  position: absolute;
  top: 6px; right: 6px;
  background: var(--btn-edit-bg);
  border: none;
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 11px;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition);
  color: var(--text-secondary);
  line-height: 1;
  font-family: var(--font-ui);
}
.bird-card:hover .btn-edit { opacity: 1; }
.btn-edit:hover { background: var(--lavender); color: #fff; }

.seen-check {
  position: absolute;
  bottom: 6px; right: 6px;
  background: rgba(122, 158, 126, 0.25);
  border-radius: 50%;
  width: 22px; height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--sage);
  font-weight: 700;
  border: none;
}

.card-body {
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.card-meta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sighting-count { font-size: 10px; color: var(--text-muted); }

.bird-sv  { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.bird-en  { font-size: 11px; color: var(--text-secondary); font-style: italic; }
.bird-sci { font-size: 10px; font-style: italic; color: var(--text-muted); }
h1, h2    { font-weight: 700; color: var(--text-primary); }
h1        { font-size: 1rem; }
h2        { font-size: 1rem; }
.text-muted { color: var(--text-secondary); font-size: 13px; }

/* ── Modals ─────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 500;
  padding: 1rem;
  overflow-y: auto;
}
.modal-panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 540px;
  margin: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-modal);
}
.modal-close {
  position: absolute;
  top: 12px; right: 14px;
  background: var(--surface-raised);
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  border-radius: 50%;
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition), background var(--transition);
}
.modal-close:hover { color: var(--text-primary); background: var(--surface-hover); }
.modal-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); padding-right: 56px; }

.detail-image-wrap {
  position: relative;
  width: calc(100% + 3rem);
  margin: -1.5rem -1.5rem 0;
  background: var(--surface-raised);
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  height: 220px;
  flex-shrink: 0;
}
.detail-img { width: 100%; height: 100%; object-fit: cover; }
.detail-img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  opacity: 0.07;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.detail-names { flex: 1; }
.detail-sv    { font-size: 18px; font-weight: 700; color: var(--text-primary); }

.detail-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.info-row { display: flex; flex-direction: column; gap: 2px; }
.info-val { color: var(--text-primary); font-size: 13px; }

.detail-section {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sightings-list { display: flex; flex-direction: column; gap: 8px; }
.sighting-item {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sighting-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.sighting-date  { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.sighting-loc   { font-size: 12px; color: var(--text-secondary); flex: 1; }
.sighting-notes { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

.btn-del-sighting {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  margin-left: auto;
  line-height: 1;
  border-radius: 4px;
  transition: color var(--transition);
}
.btn-del-sighting:hover { color: var(--danger); background: transparent; }

.log-form { display: flex; flex-direction: column; gap: 10px; }

.garden-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-raised);
  transition: background var(--transition), border-color var(--transition);
  user-select: none;
}
.garden-checkbox-label:has(input:checked) {
  background: rgba(122, 158, 126, 0.12);
  border-color: rgba(122, 158, 126, 0.30);
}
.garden-checkbox-label input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--sage);
  cursor: pointer;
  flex-shrink: 0;
}
.garden-checkbox-text { font-size: 13px; color: var(--text-secondary); letter-spacing: normal; text-transform: none; font-weight: 400; }
.garden-checkbox-label:has(input:checked) .garden-checkbox-text { color: var(--sage); }

.modal-add-panel { max-width: 600px; }

/* ── Toast ──────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--sage);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
  pointer-events: none;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow-toast);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.toast-error { color: var(--danger); }
.toast.toast-badge { background: var(--gold); color: var(--bg); border-color: var(--gold); font-size: 13px; }
.toast.toast-bingo { background: var(--lavender); color: #fff; border-color: var(--lavender); font-size: 13px; }

@media (max-width: 640px) {
  /* Lift toast above bottom nav */
  .toast { bottom: 76px; }
}

/* ── Modal improvements ─────────────────────────────────────────────── */
.modal-close-large {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 18px;
  top: 8px;
  right: 8px;
  background: var(--surface-raised);
  border-radius: 50%;
  color: var(--text-secondary);
  width: 44px; height: 44px;
}
.modal-close-large:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.modal-footer {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* ── eBird autocomplete ─────────────────────────────────────────────── */
.autocomplete-wrap {
  position: relative;
}

.autocomplete-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  z-index: 600;
  max-height: 260px;
  overflow-y: auto;
  box-shadow: var(--shadow-dropdown);
}

.ac-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.ac-active { background: var(--lavender-dim); }

.ac-sv  { font-size: 13px; color: var(--text-primary); font-weight: 500; }
.ac-sci { font-size: 11px; color: var(--text-muted); font-style: italic; }

/* ── Rarities widget ────────────────────────────────────────────────── */
.rarities-widget {
  background: var(--lavender-dim);
  border: 1px solid rgba(155, 135, 245, 0.18);
  border-left: 3px solid var(--lavender);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.rarities-header {
  padding: 12px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.rarities-header::-webkit-details-marker { display: none; }
.rarities-header .section-label { margin-bottom: 0; }

.rarities-body {
  border-top: 1px solid rgba(155, 135, 245, 0.12);
}

.rarities-list {
  display: flex;
  flex-direction: column;
}

.rarities-empty {
  padding: 1.25rem 16px;
  color: var(--text-muted);
  font-size: 13px;
}

.rarities-error {
  padding: 0.75rem 16px;
  color: var(--danger);
  font-size: 12px;
  opacity: 0.9;
}

.skeleton-row {
  height: 52px;
  margin: 6px 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    var(--surface-raised) 25%,
    var(--shimmer-mid) 50%,
    var(--surface-raised) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.rarity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(155, 135, 245, 0.08);
  transition: background var(--transition);
}
.rarity-item:last-child { border-bottom: none; }
.rarity-item:hover { background: rgba(155, 135, 245, 0.06); }

.rarity-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rarity-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.rarity-loc  { font-size: 11px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rarity-item-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.rarity-date { font-size: 11px; color: var(--text-muted); }
.rarity-badge-sm {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(155, 135, 245, 0.20);
  color: var(--lavender);
}

.rarities-expand {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  border-top: 1px solid rgba(155, 135, 245, 0.10);
  color: var(--lavender);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-ui);
  letter-spacing: 0.04em;
  cursor: pointer;
  text-align: left;
  opacity: 0.75;
  transition: opacity var(--transition);
}
.rarities-expand:hover { opacity: 1; background: rgba(155, 135, 245, 0.06); }

/* ── Outings page ───────────────────────────────────────────────────── */
.outings-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.outings-page-title {
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

/* ── Outing cards ───────────────────────────────────────────────────── */
.outing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color var(--transition);
}
.outing-card:hover { border-color: var(--border-hover); }

.outing-card-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}
.outing-card-left { flex: 1; min-width: 0; }

.outing-date {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}
.outing-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
}
.outing-sep { color: var(--text-muted); }
.outing-loc { color: var(--text-secondary); }
.outing-dur { color: var(--text-muted); }
.outing-sc  { color: var(--text-muted); }

.outing-card-notes {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 5px;
  line-height: 1.5;
}

.outing-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.outing-action-btn {
  font-size: 11px;
  padding: 5px 10px;
}
.outing-del-btn { color: var(--text-muted); }
.outing-del-btn:hover { color: var(--danger); background: rgba(224, 92, 106, 0.10); }

.outing-expand-row {
  padding: 0 14px 10px;
}
.outing-expand-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
  padding: 0;
  letter-spacing: 0.04em;
  transition: color var(--transition);
}
.outing-expand-btn:hover { color: var(--lavender); }

.outing-sp-row {
  padding: 0 14px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.outing-bird-chip {
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--surface-raised);
  border-radius: 999px;
  padding: 3px 10px;
  border: 1px solid var(--border);
}
.outing-sp-loading { font-size: 12px; color: var(--text-muted); }

/* ── Heatmap ────────────────────────────────────────────────────────── */
.heatmap-section {
  margin-bottom: 2rem;
}
.heatmap-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
}
.heatmap-months {
  position: relative;
  height: 14px;
  margin-bottom: 3px;
  min-width: fit-content;
}
.hm-month-label {
  position: absolute;
  top: 0;
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.heatmap-grid {
  display: flex;
  gap: 2px;
  min-width: fit-content;
}
.heatmap-week {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.heatmap-day {
  width: 11px;
  height: 11px;
  border-radius: 2px;
}
.hm-empty    { background: var(--surface-2); }
.hm-sighting { background: var(--sage); opacity: 0.6; }
.hm-outing   { background: var(--lavender); opacity: 0.5; }
.hm-both     { background: var(--lavender); opacity: 0.9; }
.hm-future   { background: transparent; }
.hm-today    { box-shadow: 0 0 0 1.5px var(--lavender); border-radius: 2px; opacity: 1; }

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  font-size: 10px;
  color: var(--text-muted);
}
.hm-legend-cell {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}

/* ── Species picker in outing modal ────────────────────────────────── */
.species-picker { display: flex; flex-direction: column; gap: 8px; }

.picked-species {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 32px;
  padding: 4px 0;
}
.picked-empty {
  font-size: 12px;
  color: var(--text-muted);
  align-self: center;
}
.picked-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--lavender-dim);
  border-radius: 999px;
  padding: 4px 8px 4px 11px;
}
.picked-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color var(--transition);
  display: flex;
  align-items: center;
}
.picked-remove:hover { color: var(--danger); }

/* ── Location autocomplete ──────────────────────────────────────────── */
.loc-ac-wrap { position: relative; }
.loc-ac-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 3px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  z-index: 600;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: var(--shadow-dropdown);
}

.modal-outing-panel { max-width: 520px; }

/* ── Login page ─────────────────────────────────────────────────────── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
  position: relative;
  z-index: 2;
  padding-top: 1rem;
}
.login-wrap { width: 100%; max-width: 300px; position: relative; z-index: 2; }
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-login);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-logo    { font-size: 36px; text-align: center; opacity: 0.65; }
.login-title   { text-align: center; font-size: 22px; font-weight: 700; color: var(--text-primary); letter-spacing: 0.02em; }
.login-tagline { text-align: center; color: var(--text-muted); font-size: 12px; margin-top: -8px; margin-bottom: 4px; letter-spacing: 0.04em; }
.login-error   {
  background: rgba(224, 92, 106, 0.12);
  color: var(--danger);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  border: 1px solid rgba(224, 92, 106, 0.25);
}
.login-card .form-group { gap: 4px; }
.login-card input { margin-top: 2px; }
.login-card .section-label::after { display: none; }
.login-card label { margin-bottom: 4px; }

/* ── Lists container ────────────────────────────────────────────────── */
.lists-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 4rem;
  position: relative;
  z-index: 2;
}

/* ── Bulk garden ────────────────────────────────────────────────────── */
.bulk-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem 1.25rem 6rem;
  position: relative;
  z-index: 2;
}
.garden-summary       { font-size: 12px; color: var(--text-secondary); margin-bottom: 1.25rem; }
.garden-summary strong { color: var(--sage); font-weight: 600; }

.species-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  margin-bottom: 10px;
  overflow: hidden;
}
.species-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-raised);
  gap: 10px;
}
.species-group-name  { font-size: 14px; font-weight: 600; color: var(--text-primary); flex: 1; }
.species-group-count { font-size: 10px; color: var(--text-muted); white-space: nowrap; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600; }
.btn-mark-all {
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0.04em;
  font-family: var(--font-ui);
  transition: background 0.2s, color 0.2s;
}
.btn-mark-all:hover { background: var(--lavender-dim); color: var(--lavender); }

.sighting-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.sighting-row:last-child { border-bottom: none; }
.sighting-row.is-garden  { background: rgba(122, 158, 126, 0.06); }
.sighting-check { width: 16px; height: 16px; accent-color: var(--sage); cursor: pointer; flex-shrink: 0; }
.sighting-loc         { font-size: 12px; color: var(--text-secondary); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sighting-notes-text  { font-size: 11px; color: var(--text-muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.save-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 12px 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 200;
  box-shadow: var(--shadow-savebar);
}
.save-status     { font-size: 12px; color: var(--text-secondary); letter-spacing: 0.04em; }
.save-status.ok  { color: var(--sage); }
.save-status.err { color: var(--danger); }

.loading-full { text-align: center; padding: 4rem; color: var(--text-muted); font-size: 14px; }

@media (max-width: 480px) {
  .sighting-notes-text { display: none; }
  .species-number, .count-n { font-size: 2rem; }
  .entry, .species-item { padding: 9px 12px 9px 8px; gap: 9px; }
  .entry-date, .species-date { display: none; }
  .entry-photo, .species-thumb { width: 32px; height: 32px; }
}

/* ═══════════════════════════════════════════════════════════════════
   REDESIGN — Stage 1 components
   ═══════════════════════════════════════════════════════════════════ */

/* ── Rarity badge ──────────────────────────────────────────────────── */
.rb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px 3px 6px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1;
}
.rb-gem {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 2px;
  transform: rotate(45deg);
  flex-shrink: 0;
}
.rb-meter {
  display: inline-flex;
  gap: 2px;
  align-items: center;
}
.rb-seg {
  width: 3px; height: 8px;
  border-radius: 1.5px;
  background: currentColor;
  opacity: 0.25;
}
.rb-seg.on { opacity: 1; }

/* rarity 1 — mycket vanlig */
.rb-r1 { background: var(--surface-2); color: var(--text-secondary); border-color: var(--border); }
.rb-r1 .rb-gem { background: var(--text-muted); }
/* rarity 2 — vanlig */
.rb-r2 { background: var(--sage-dim); color: var(--sage); border-color: rgba(110,171,116,0.22); }
.rb-r2 .rb-gem { background: var(--sage); }
/* rarity 3 — ovanlig */
.rb-r3 { background: var(--lavender-dim); color: var(--lavender); border-color: rgba(169,142,247,0.22); }
.rb-r3 .rb-gem { background: var(--lavender); }
/* rarity 4 — sällsynt */
.rb-r4 { background: rgba(224,92,106,0.12); color: var(--danger); border-color: rgba(224,92,106,0.22); }
.rb-r4 .rb-gem { background: var(--danger); }
/* rarity 5 — mycket sällsynt (gold gradient) */
.rb-r5 { background: var(--gold-dim); color: var(--gold); border-color: rgba(201,168,76,0.25); }
.rb-r5 .rb-gem { background: linear-gradient(135deg, #E8C96A, #C9A84C); }

/* ── Species card B ────────────────────────────────────────────────── */
.bird-card-b {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.bird-card-b:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.bcb-photo {
  width: 100%; aspect-ratio: 4/3;
  background: var(--surface-2);
  position: relative;
  overflow: hidden;
}
.bcb-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.bcb-photo-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  background: var(--surface-2);
}
.bcb-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.bcb-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.bcb-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.bcb-sci {
  font-size: 11px;
  font-style: italic;
  color: var(--text-muted);
  font-family: var(--font-serif);
}
.bcb-footer {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.bcb-count {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.bcb-seen-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--sage);
}
.bcb-name-row-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.bcb-log-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--lavender-dim);
  color: var(--lavender);
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition);
  flex-shrink: 0;
}
.bcb-log-btn:hover { background: var(--lavender-muted); transform: scale(1.1); }

/* ── New nav / header ──────────────────────────────────────────────── */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 300;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}
@media (max-width: 767px) {
  .mobile-header { display: flex; }
  body { padding-top: 52px; }
  .app-header { display: none !important; }
  .mobile-top-stripe { display: none !important; }
}
.mobile-header-brand {
  flex: 1;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-ui);
}
.mobile-header-brand em { color: var(--lavender); font-style: normal; }
.mobile-header-brand .mh-bird { font-style: normal; }

/* ── Bottom sheet ──────────────────────────────────────────────────── */
.bsheet-scrim {
  display: none;
  position: fixed; inset: 0;
  background: var(--overlay-bg);
  z-index: 400;
  opacity: 0;
  transition: opacity 200ms ease;
}
.bsheet-scrim.open { display: block; opacity: 1; }
.bsheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 401;
  padding: 12px 0 calc(env(safe-area-inset-bottom) + 16px);
  transform: translateY(100%);
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.3);
}
.bsheet.open { transform: translateY(0); }
.bsheet-handle {
  width: 36px; height: 4px;
  background: var(--surface-3);
  border-radius: 999px;
  margin: 0 auto 16px;
}
.bsheet-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
}
.bsheet-row:hover { background: var(--surface-hover); }
.bsheet-row-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.bsheet-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 20px;
}
.bsheet-section-label {
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 20px 4px;
}

/* ── Updated mobile bottom nav FAB ─────────────────────────────────── */
.mbn-item.mbn-add .mbn-add-circle {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--lavender), var(--sage));
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 300;
  color: #fff;
  box-shadow: var(--shadow-fab);
  margin-top: -14px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.mbn-item.mbn-add:hover .mbn-add-circle,
.mbn-item.mbn-add:active .mbn-add-circle {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(169,142,247,0.55);
}

/* ── Dashboard — greeting block ────────────────────────────────────── */
.greeting-block {
  padding: 8px 0 20px;
}
.greeting-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.greeting-title {
  font-family: var(--font-serif);
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.greeting-title em {
  color: var(--lavender);
  font-style: italic;
}

/* ── Dashboard stat cards ───────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 1.25rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.stat-card-full { grid-column: 1 / -1; }

/* Hero stat card */
.stat-hero {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-hero-number {
  font-family: var(--font-serif);
  font-size: 62px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  letter-spacing: -2px;
}
.stat-hero-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.stat-sparkline {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: 6px;
  opacity: 0.75;
  pointer-events: none;
}

/* Progress ring stat card */
.stat-ring-card {
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-ring-svg { flex-shrink: 0; }
.stat-ring-track { fill: none; stroke: var(--surface-2); stroke-width: 4; }
.stat-ring-fill  { fill: none; stroke: var(--lavender); stroke-width: 4; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: var(--ring-offset, 30);
  transform: rotate(-90deg); transform-origin: center;
  transition: stroke-dashoffset 0.8s ease; }
.stat-ring-label { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.stat-ring-pct {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

/* Gem stat card (rare sightings) */
.stat-gem-card {
  display: flex;
  align-items: center;
  gap: 12px;
}
.stat-gem-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--gold-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.stat-gem-body { display: flex; flex-direction: column; gap: 2px; }
.stat-gem-number {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}
.stat-gem-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Last-seen stat card */
.stat-lastseen {
  display: block;
  position: relative;
  min-height: 140px;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-2);
  overflow: hidden;
  text-decoration: none;
  cursor: pointer;
  padding: 0 !important;
  transition: opacity .15s;
}
.stat-lastseen:hover { opacity: .9; }
.stat-lastseen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.18) 100%);
  border-radius: inherit;
  pointer-events: none;
}
.stat-lastseen-eyebrow {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 2;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.7);
}
.stat-lastseen-bottom {
  position: absolute;
  bottom: 10px;
  left: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}
.stat-lastseen-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.stat-lastseen-bird {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-lastseen-rarity {
  display: inline-block;
}
.stat-lastseen-date {
  font-size: 11px;
  color: rgba(255,255,255,.6);
  white-space: nowrap;
  flex-shrink: 0;
}
/* Fallback tint when no photo — rarity-based */
.stat-lastseen[data-rarity="1"] { background-color: #2a4030; }
.stat-lastseen[data-rarity="2"] { background-color: #2a2542; }
.stat-lastseen[data-rarity="3"] { background-color: #261f3e; }
.stat-lastseen[data-rarity="4"] { background-color: #231b3c; }
.stat-lastseen[data-rarity="5"] { background-color: #3a2e10; }
@media (min-width: 600px) {
  .stat-lastseen { min-height: 160px; }
}

/* ── Medallion ─────────────────────────────────────────────────────── */
.medallion {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px; height: 64px;
}
.medallion-ring {
  position: absolute; inset: 0;
}
.medallion-icon {
  font-size: 28px;
  line-height: 1;
  position: relative; z-index: 1;
}
.medallion-badge {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}

/* ── Bingo cell ────────────────────────────────────────────────────── */
.bingo-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  padding: 8px 4px;
  transition: background var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}
.bingo-cell.seen {
  background: var(--sage-dim);
  border-color: rgba(110,171,116,0.28);
}
.bingo-cell-icon { font-size: 20px; }
.bingo-cell-name { font-size: 10px; line-height: 1.2; }
.bingo-cell.seen::after {
  content: '✓';
  position: absolute;
  top: 4px; right: 6px;
  font-size: 10px;
  color: var(--sage);
  font-weight: 700;
}

/* ── Safe-area bottom padding for mobile nav ───────────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .mobile-bottom-nav {
    padding-bottom: calc(4px + env(safe-area-inset-bottom));
  }
}

/* ═══════════════════════════════════════════════════════════════════
   STAGE 2 — Listor (species grid)
   ═══════════════════════════════════════════════════════════════════ */

/* ── Lists page container ────────────────────────────────────────── */
.lists-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px 96px;
}
@media (min-width: 768px) {
  .lists-page { padding: 28px 24px 64px; }
}

/* ── Lists toolbar ───────────────────────────────────────────────── */
.lists-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}
.lists-toolbar-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Seen/unseen tabs */
.seen-tabs {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}
.seen-tab {
  background: transparent;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  min-height: 32px;
}
.seen-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* Search input */
.lists-search {
  flex: 1;
  min-width: 140px;
  position: relative;
}
.lists-search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 8px 12px 8px 34px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  height: 38px;
}
.lists-search-input::placeholder { color: var(--text-muted); }
.lists-search-input:focus {
  border-color: var(--lavender);
  box-shadow: 0 0 0 3px var(--lavender-dim);
}
.lists-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

/* Sort + filter button row */
.lists-toolbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.lists-btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 6px 12px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  height: 34px;
  font-family: var(--font-ui);
}
.lists-btn-icon:hover { background: var(--surface-hover); color: var(--text); }
.lists-btn-icon.active { background: var(--lavender-dim); color: var(--lavender); border-color: rgba(169,142,247,0.28); }

/* Type + location pill toggles */
.lists-pill-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ── Rarity filter chips ──────────────────────────────────────────── */
.rarity-filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  padding-bottom: 2px;
}
.rarity-filter-bar .rb {
  cursor: pointer;
  user-select: none;
  opacity: 0.55;
  transition: opacity var(--transition), transform var(--transition);
}
.rarity-filter-bar .rb:hover { opacity: 0.85; }
.rarity-filter-bar .rb.rb-active {
  opacity: 1;
  transform: scale(1.04);
}
.rb-all-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity var(--transition), background var(--transition), color var(--transition);
  user-select: none;
}
.rb-all-chip:hover { opacity: 0.85; }
.rb-all-chip.rb-active { opacity: 1; background: var(--surface-3); color: var(--text); border-color: var(--border-hover); }

/* ── Species card grid ───────────────────────────────────────────── */
.species-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 480px) {
  .species-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 720px) {
  .species-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
}
@media (min-width: 960px) {
  .species-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ── Loading skeleton ─────────────────────────────────────────────── */
.skel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.skel-photo {
  width: 100%; aspect-ratio: 4/3;
  background: var(--surface-2);
  animation: skel-pulse 1.4s ease-in-out infinite;
}
.skel-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.skel-line {
  height: 10px;
  border-radius: 5px;
  background: var(--surface-2);
  animation: skel-pulse 1.4s ease-in-out infinite;
}
.skel-line-short { width: 55%; }
.skel-line-xs    { width: 35%; height: 8px; }
@keyframes skel-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}

/* ── List empty states ───────────────────────────────────────────── */
.lists-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.lists-empty-icon { font-size: 40px; opacity: 0.3; }
.lists-empty-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); }

/* ── Count hero (lists) ──────────────────────────────────────────── */
.lists-count-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 16px;
}
.lists-count-n {
  font-family: var(--font-serif);
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}
.lists-count-unit {
  font-size: 14px;
  color: var(--text-secondary);
}
.lists-count-ctx {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-left: auto;
}

/* ── Sort / filter bottom sheet ─────────────────────────────────── */
.sort-sheet-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  cursor: pointer;
  transition: background var(--transition);
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
}
.sort-sheet-option:hover { background: var(--surface-hover); }
.sort-sheet-option.active { color: var(--lavender); }
.sort-sheet-option.active::after {
  content: '✓';
  margin-left: auto;
  font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════════════
   STAGE 2 — Artdetalj (bird.php)
   ═══════════════════════════════════════════════════════════════════ */

/* ── Hero ──────────────────────────────────────────────────────── */
.bd2-hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: var(--surface-2);
  min-height: 200px;
}
.bd2-hero-img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
}
@media (min-width: 600px) { .bd2-hero-img { height: 360px; } }
.bd2-hero-ph {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  opacity: 0.10;
}
.bd2-hero-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.35) 60%, transparent 100%);
  padding: 20px 20px 18px;
}
.bd2-hero-name {
  font-family: var(--font-serif);
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 3px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.4);
}
.bd2-hero-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.70);
  font-style: italic;
  font-family: var(--font-serif);
  margin-bottom: 10px;
}
.bd2-hero-ph-overlay {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bd2-hero-ph-name {
  font-family: var(--font-serif);
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 3px;
}
.bd2-hero-ph-sub {
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
  font-family: var(--font-serif);
  margin-bottom: 10px;
}

/* ── Stat row ──────────────────────────────────────────────────── */
.bd2-stat-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.bd2-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 12px;
  color: var(--text-secondary);
}
.bd2-stat-chip-val {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.bd2-stat-chip-icon { opacity: 0.7; }

/* ── Section title ─────────────────────────────────────────────── */
.bd2-section-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* ── Sighting timeline card ────────────────────────────────────── */
.bd2-sighting-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 8px;
  transition: border-color var(--transition);
}
.bd2-sighting-card:hover { border-color: var(--border-hover); }
.bd2-sighting-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 10px;
  flex-wrap: wrap;
}
.bd2-sighting-date {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.bd2-sighting-loc {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 3px;
}
.bd2-garden-badge {
  font-size: 13px;
  opacity: 0.8;
}
.bd2-outing-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--lavender);
  text-decoration: none;
  background: var(--lavender-dim);
  border-radius: 999px;
  padding: 2px 8px;
}
.bd2-outing-link:hover { opacity: 0.85; }
.bd2-sighting-photo {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}
.bd2-sighting-notes {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 8px 14px;
  border-top: 1px solid var(--border-subtle);
}
.bd2-sighting-actions {
  display: flex;
  gap: 6px;
  padding: 8px 14px 12px;
  border-top: 1px solid var(--border-subtle);
}

/* ── Empty / not-seen state ────────────────────────────────────── */
.bd2-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}
.bd2-empty-icon { font-size: 42px; opacity: 0.25; }
.bd2-empty-title { font-size: 15px; font-weight: 600; color: var(--text-secondary); }
.bd2-empty-sub { font-size: 13px; color: var(--text-muted); }

/* ── eBird panel ───────────────────────────────────────────────── */
.bd2-ebird-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.bd2-ebird-logo {
  font-size: 20px;
  opacity: 0.7;
}

/* ── Info rows ─────────────────────────────────────────────────── */
.bd2-info-row {
  margin-bottom: 12px;
}
.bd2-info-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.bd2-info-val {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Back button ───────────────────────────────────────────────── */
.bd2-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 16px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.bd2-back-btn:hover { color: var(--text); background: var(--surface-hover); opacity: 1; }

/* ── Add sighting CTA ──────────────────────────────────────────── */
.bd2-add-btn {
  width: 100%;
  margin-bottom: 12px;
  justify-content: center;
  font-size: 14px;
  padding: 12px 20px;
}

/* ── Photo upload area ─────────────────────────────────────────── */
.photo-upload-label { display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.photo-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--border);
  color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition);
  width: fit-content;
}
.photo-upload-label:has(input:focus) .photo-upload-btn,
.photo-upload-btn:hover { border-color: var(--lavender); color: var(--lavender); }
.bd2-photo-preview { max-width: 120px; border-radius: 8px; margin-top: 6px; }

/* ═══════════════════════════════════════════════════════════════════
   STAGE 3 — Utflykter (outings) + Utmaningar
   ═══════════════════════════════════════════════════════════════════ */

/* ── Outings page container ──────────────────────────────────────── */
.outings-page { max-width: 720px; margin: 0 auto; padding: 20px 16px 96px; }
@media (min-width: 768px) { .outings-page { padding: 28px 24px 64px; } }

/* ── Outings page header ─────────────────────────────────────────── */
.outings-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}
.outings-page-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Heatmap legend redesign ─────────────────────────────────────── */
.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.hm-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.hm-legend-cell {
  width: 10px; height: 10px;
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}

/* ── Day detail card (redesign) ──────────────────────────────────── */
.day-detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-card);
}
.day-detail-heading {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.day-detail-close {
  background: none; border: none;
  font-size: 16px; cursor: pointer;
  color: var(--text-muted); line-height: 1;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.day-detail-close:hover { color: var(--text); background: var(--surface-hover); }
.dd-species-list { display: flex; flex-direction: column; gap: 2px; }
.dd-species-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}
.dd-species-row:hover { background: var(--surface-hover); }
.dd-species-name { flex: 1; font-size: 13px; font-weight: 600; color: var(--text); }
.dd-species-loc  { font-size: 11px; color: var(--text-muted); }
.dd-count { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); margin-top: 8px; letter-spacing: 0.06em; text-transform: uppercase; }
.dd-empty { font-size: 13px; color: var(--text-muted); padding: 4px 0; }
.dd-outing-info {
  font-size: 13px; color: var(--text-secondary);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-top: 8px;
  line-height: 1.5;
}
.dd-divider { border: none; border-top: 1px solid var(--border); margin: 10px 0; }

/* ── Outings empty state ─────────────────────────────────────────── */
.outings-empty {
  text-align: center;
  padding: 3rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 14px;
}
.outings-empty-icon { font-size: 40px; opacity: 0.25; }
.outings-empty-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); }

/* ── Utmaningar page container ───────────────────────────────────── */
.utm-page { max-width: 720px; margin: 0 auto; padding: 20px 16px 96px; }
@media (min-width: 768px) { .utm-page { padding: 28px 24px 64px; } }

/* ── UTM section card ────────────────────────────────────────────── */
.utm-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-card);
}
.utm-section-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Badge grid ──────────────────────────────────────────────────── */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
}
@media (min-width: 600px) { .badges-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; } }

.badge-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 5px;
  padding: 14px 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.badge-card:hover { transform: translateY(-1px); }
.badge-card.badge-earned {
  border-color: rgba(201, 168, 76, 0.40);
  box-shadow: 0 0 12px rgba(201, 168, 76, 0.15);
}
.badge-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  background: var(--gold-dim);
  transition: filter var(--transition), opacity var(--transition);
}
.badge-card.badge-locked .badge-icon {
  background: var(--surface-3);
  filter: grayscale(1);
  opacity: 0.45;
}
.badge-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}
.badge-card.badge-locked .badge-name { color: var(--text-muted); font-weight: 500; }
.badge-date {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--gold);
  letter-spacing: 0.04em;
}
.badge-desc { font-size: 10px; color: var(--text-muted); line-height: 1.3; }
.badge-pop {
  position: absolute;
  bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 11px;
  color: var(--text);
  width: 180px;
  box-shadow: var(--shadow-dropdown);
  display: none;
  pointer-events: none;
  line-height: 1.5;
}
.badge-card.pop-open .badge-pop { display: block; }
.badge-card:nth-child(-n+4) .badge-pop { bottom: auto; top: calc(100% + 6px); }

/* ── Bingo grid redesign ─────────────────────────────────────────── */
.bingo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 6px;
}
.bingo-month-label {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.bingo-countdown {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.bingo-grid-wrap {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  max-width: 400px;
  margin: 0 auto;
}
@media (min-width: 600px) { .bingo-grid-wrap { max-width: 440px; } }

.bingo-sq {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2px;
  aspect-ratio: 1;
  min-width: 0;
  padding: 4px 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.6rem;
  line-height: 1.2;
  color: var(--text-secondary);
  overflow: hidden;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.bingo-sq-icon { font-size: 11px; }
@media (min-width: 600px) { .bingo-sq-icon { font-size: 13px; } .bingo-sq { font-size: 0.65rem; } }
.bingo-sq-busy { opacity: 0.5; pointer-events: none; }
.bingo-sq-label {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
}
.bingo-sq.done {
  background: var(--sage-dim);
  border-color: rgba(110, 171, 116, 0.40);
  color: var(--text-secondary);
}
.bingo-check { position: absolute; top: 2px; right: 4px; font-size: 9px; color: var(--sage); font-weight: 700; }
.bingo-sq.gratis {
  background: var(--gold-dim);
  border-color: rgba(201, 168, 76, 0.45);
  color: var(--gold);
  font-weight: 800;
  font-size: 0.7rem;
}
.bingo-sq.bingo-line {
  border-color: var(--lavender);
  box-shadow: 0 0 8px var(--lavender-dim);
}
.bingo-sq.just-done { animation: bingoPop 0.35s ease; }
@keyframes bingoPop {
  0%   { transform: scale(0.7); opacity: 0.3; }
  100% { transform: scale(1);   opacity: 1; }
}

.bingo-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}
.bingo-progress-bar-wrap {
  flex: 1;
  height: 4px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}
.bingo-progress-bar {
  height: 100%;
  background: var(--lavender);
  border-radius: 999px;
  transition: width 0.5s ease;
}
.bingo-progress-text {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* Bingo tooltip */
#bingo-tip {
  position: fixed;
  z-index: 200;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 7px 11px;
  font-size: 11px;
  color: var(--text);
  max-width: 200px;
  box-shadow: var(--shadow-dropdown);
  pointer-events: none;
  display: none;
  line-height: 1.5;
}
