/* Feeder Rater Web - App styles */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 4rem;
  scrollbar-gutter: stable;
}

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  padding: max(0.65rem, env(safe-area-inset-top)) 0 0.55rem;
  border-bottom: 1px solid var(--line);
  background: rgba(244,247,255,0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
@media (prefers-color-scheme: dark) { .site-header { background: rgba(9,13,26,0.92); } }
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--max); margin: 0 auto; padding: 0 1.5rem;
}
.brand-lockup {
  display: flex; align-items: center; gap: 0.5rem;
  text-decoration: none; color: var(--text); font-weight: 650;
}
.brand-lockup:hover { text-decoration: none; }
.brand-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
}
@media (prefers-color-scheme: dark) {
  .brand-logo { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14); }
}

.brand-name { font-size: 0.9375rem; letter-spacing: -0.02em; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.5rem 1rem; border-radius: 0.5rem; font: inherit;
  font-size: 0.875rem; font-weight: 600; cursor: pointer; border: none;
  transition: background 0.15s, opacity 0.15s; text-decoration: none;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; color: var(--on-accent); }
.btn-secondary {
  background: var(--control-bg); color: var(--text);
  border: 1px solid var(--line);
}
.btn-secondary:hover { background: var(--elevated-muted); text-decoration: none; color: var(--text); }
.btn-danger { background: var(--danger-solid); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8125rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: default; }

/* ── Auth panel ── */
#authPanel {
  display: flex; align-items: center; justify-content: center;
  padding: 2.5rem 1.25rem;
}
.auth-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 2rem;
  width: 100%; max-width: 22rem;
  box-shadow: var(--shadow);
}
.auth-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 0.25rem; }
.auth-subtitle { font-size: 0.875rem; color: var(--muted); margin-bottom: 1.5rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.8125rem; font-weight: 600; margin-bottom: 0.3rem; }
.field input {
  width: 100%; padding: 0.6rem 0.75rem;
  border: 1px solid var(--line); border-radius: 0.5rem;
  background: var(--input-bg); color: var(--text);
  font: inherit; font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.auth-error {
  background: var(--danger-bg); color: var(--danger-text);
  border: 1px solid var(--danger-border); border-radius: 0.5rem;
  padding: 0.5rem 0.75rem; font-size: 0.8125rem; margin-bottom: 1rem;
}
.auth-link-row { text-align: center; font-size: 0.8125rem; color: var(--muted); margin-top: 1rem; }
.auth-link-row a { color: var(--accent); font-weight: 600; }
.auth-divider { border: none; border-top: 1px solid var(--line); margin: 1.25rem 0; }

.analyze-btn-wrap { margin-top: 1rem; }
.analysis-results-wrap { margin-top: 1.5rem; }
.guest-rate-note {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: -0.35rem 0 1rem;
}
.guest-cta {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface);
}
.guest-cta-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  color: var(--text);
}
.guest-cta-body {
  margin: 0 0 0.9rem;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.45;
}
.guest-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.lb-filter-row { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; }
.lb-sub-btn.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.lb-sub-btn.active:hover { background: var(--accent-hover); color: var(--on-accent); }

/* ── App shell ── */
#appShell { display: flex; flex-direction: column; min-height: calc(100vh - 49px); }
.tab-content { display: none; flex: 1; }
.tab-content.active { display: block; }

/* Guest Rate: keep chrome like marketing pages — footer stays on-screen.
   Signed-in shell still fills the viewport above the tab bar; guest must not,
   or the shared footer is pushed below the fold. */
body:has(#appShell.guest-shell) {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
#appShell.guest-shell {
  min-height: 0;
  height: auto;
  flex: 1 0 auto;
  padding-bottom: 0;
}
#appShell.guest-shell .tab-content,
#appShell.guest-shell .tab-content.active {
  flex: none;
}
body:has(#appShell.guest-shell) .site-footer {
  margin-top: auto;
  flex-shrink: 0;
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
}
/* site.css combines `.wrap.section`: its `.section { padding: 2rem 0 }` (defined
   after `.wrap`) wipes the wrap's horizontal padding, and a bare `ul { padding-left }`
   indents app lists. These higher-specificity rules restore correct alignment.
   Unscoped (not #appShell-only) since app.css is only ever loaded on /app and the
   public /share/{id} page - both need this fix, and no other page loads app.css. */
.wrap.section { padding-left: 1.5rem; padding-right: 1.5rem; }
ul { padding-left: 0; margin-bottom: 0; }

/* ── Mobile: bottom tab bar ── */
.tab-bar {
  display: flex;
  background: var(--surface); border-top: 1px solid var(--line);
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab-bar .tab-btn {
  flex: 1; padding: 0.55rem 0.25rem 0.45rem;
  background: none; border: none; cursor: pointer; font: inherit;
  font-size: 0.65rem; font-weight: 500; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  transition: color 0.15s; min-width: 0; border-radius: 0;
}
.tab-bar .tab-btn i { font-size: 1.25rem; }
.tab-bar .tab-btn.active {
  color: var(--accent); font-weight: 650; background: transparent;
}
.tab-bar .tab-btn:hover:not(.active) { color: var(--text); background: transparent; }
#appShell { padding-bottom: 4rem; }

/* ── Desktop: top app nav (in sticky header) ── */
.app-nav { display: none; }
.app-nav .tab-btn {
  background: none; border: none; cursor: pointer; font: inherit;
  font-size: 0.9375rem; font-weight: 500; color: var(--muted);
  padding: 0.55rem 1.1rem; border-radius: 0.5rem;
  transition: color 0.15s, background 0.15s;
}
.app-nav .tab-btn.active {
  color: var(--accent); font-weight: 650;
  background: var(--accent-light);
}
.app-nav .tab-btn:hover:not(.active) { color: var(--text); background: var(--elevated-muted); }

@media (min-width: 641px) {
  .tab-bar { display: none; }
  #appShell { padding-bottom: 0; }

  .site-header:has(.app-nav:not([hidden])) { padding-bottom: 0; }
  .site-header:has(.app-nav:not([hidden])) .header-row { padding-bottom: 0.15rem; }
  .app-nav {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 0.5rem 1.25rem;
    max-width: var(--max); margin: 0 auto;
    padding: 0.45rem 1.5rem 0.65rem;
  }
}

/* ── Section wrappers ── */
.section { padding: 1rem 0; }
.section-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 0.15rem; }
.section-subtitle { font-size: 0.875rem; color: var(--muted); margin-bottom: 0.875rem; }
.rate-lead { font-size: 0.9375rem; margin-bottom: 1rem; }

/* ── Upload zone ── */
.upload-zone {
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 2.5rem 1.5rem; text-align: center; cursor: pointer;
  transition: border-color 0.2s, background 0.2s; position: relative;
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--accent); background: var(--accent-light); }
.upload-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.upload-icon { font-size: 2.5rem; color: var(--accent); margin-bottom: 0.5rem; }
.upload-label { font-size: 0.9375rem; font-weight: 600; margin-bottom: 0.25rem; }
.upload-hint { font-size: 0.8125rem; color: var(--muted); }
.upload-preview { max-width: 100%; border-radius: var(--radius); max-height: 240px; object-fit: contain; }

/* ── Analysis results ── */
.heart-icon-sm { color: #e05; font-size: 0.75rem; }
.icon-working { color: var(--score-high); }
.icon-improvement { color: var(--score-mid); }
.icon-accent { color: var(--accent); }
.score-high { color: var(--score-high); }
.score-mid { color: var(--score-mid); }
.score-low { color: var(--score-low); }

/* ── History list - mobile: row list ── */
.history-list { list-style: none; }
.history-date-header { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); padding: 0.875rem 0 0.3rem; }
.history-item { border-bottom: 1px solid var(--line); }
.history-item:last-child { border-bottom: none; }
.history-item:hover { background: var(--elevated-muted); }
.history-item details { margin: 0; padding: 0; }
.history-item details > summary { list-style: none; display: flex; align-items: flex-start; gap: 0.75rem; cursor: pointer; padding: 0.75rem 0; }
.history-item details summary::-webkit-details-marker { display: none; }
.history-item-row { display: contents; }
.history-img-frame { position: relative; flex-shrink: 0; padding-top: 0.1rem; display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }
.history-img-badge { display: flex; justify-content: center; }
.history-thumb { width: 56px; height: 56px; border-radius: 0.5rem; object-fit: cover; background: var(--control-bg); display: block; }
.share-hero-img { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius); background: var(--control-bg); display: block; margin-bottom: 1rem; }
.history-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.history-row-top { display: flex; align-items: center; justify-content: flex-start; gap: 0.5rem; }
.history-score { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; color: var(--accent); line-height: 1; }
.history-loves { font-size: 0.78rem; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }
.history-love-btn {
  background: none; border: none; padding: 0.2rem; margin: -0.2rem;
  font: inherit; font-size: 0.78rem; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.3rem; border-radius: 0.375rem;
}
.history-love-btn:hover { background: var(--elevated-muted); }
.history-right {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end;
  justify-content: space-between; align-self: stretch; padding: 0.15rem 0 0.1rem;
}

/* Row context menu (Promote / Share / Delete) */
.history-menu-wrap { position: relative; }
.history-menu-btn {
  background: none; border: none; padding: 0.25rem 0.35rem; margin: -0.25rem -0.35rem;
  color: var(--muted); font-size: 0.85rem; cursor: pointer; border-radius: 0.375rem;
}
.history-menu-btn:hover { background: var(--elevated-muted); color: var(--text); }
.history-menu-dropdown {
  position: absolute; right: 0; bottom: calc(100% + 0.3rem); z-index: 20;
  background: var(--surface); border: 1px solid var(--line); border-radius: 0.6rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.14); min-width: 11rem; padding: 0.3rem;
}
.history-menu-item {
  display: flex; align-items: center; gap: 0.6rem; width: 100%;
  background: none; border: none; padding: 0.5rem 0.6rem; border-radius: 0.4rem;
  font: inherit; font-size: 0.8125rem; color: var(--text); cursor: pointer; text-align: left;
}
.history-menu-item i { width: 1rem; text-align: center; color: var(--muted); }
.history-menu-item:hover { background: var(--elevated-muted); }
.history-menu-item-danger { color: var(--danger-text, #c0392b); }
.history-menu-item-danger i { color: inherit; }
.history-menu-item-label { flex: 1; }
.history-menu-item-locked { color: var(--muted); }
.history-menu-item-lock { width: auto; font-size: 0.7rem; flex-shrink: 0; }
.history-badges { display: flex; align-items: center; gap: 0.375rem; }
.history-rank-badge { font-size: 0.72rem; font-weight: 600; display: inline-flex; align-items: center; gap: 0.2rem; padding: 0.1rem 0.4rem; border-radius: 999px; }
.history-rank-badge.gold { color: #a07c10; background: rgba(201,162,39,0.12); }
.history-rank-badge.pink { color: #c0003a; background: rgba(220,0,60,0.08); }
.history-by-me {
  font-size: 0.68rem; font-weight: 700; color: var(--accent);
  background: var(--accent-light); border: 1px solid var(--accent-border);
  padding: 0.05rem 0.4rem; border-radius: 999px;
}
.history-snippet { font-size: 0.8125rem; color: var(--muted); line-height: 1.4; margin-top: 0.1rem; }
.history-snippet-desktop { display: none; }
@media (min-width: 641px) {
  .history-snippet-mobile { display: none; }
  .history-snippet-desktop { display: block; }
}
.history-birds-preview { margin-top: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.history-birds-preview-label {
  font-size: 0.7rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em; flex-shrink: 0;
}
.history-birds-preview-icon { color: #2f7fd1; font-size: 0.75rem; }
.history-birds-avatars { display: flex; align-items: center; }
.history-bird-avatar {
  width: 1.75rem; height: 1.75rem; border-radius: 50%; object-fit: cover;
  background: var(--control-bg); border: 2px solid var(--surface);
  margin-left: -0.5rem; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.history-bird-avatar:first-child { margin-left: 0; }
.history-bird-avatar-fallback { color: #2f7fd1; font-size: 0.7rem; }
.history-birds-more { margin-left: 0.375rem; font-size: 0.7rem; font-weight: 600; color: var(--muted); }
.history-time-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 0.1rem; }
.history-time { font-size: 0.72rem; color: var(--muted); display: inline-flex; align-items: center; gap: 0.3rem; }
.history-chevron { color: var(--muted); font-size: 0.75rem; line-height: 1; flex-shrink: 0; transition: transform 0.2s; }
details[open] .history-chevron { transform: rotate(180deg); }
/* expand-in-place detail panel */
.history-detail { padding: 0.875rem 1rem 1rem; border-top: 1px solid var(--line); }
.hd-view-photo-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 0.4rem 0.9rem; font: inherit; font-size: 0.8125rem; font-weight: 600;
  color: var(--accent); cursor: pointer; margin-bottom: 1rem;
}
.hd-view-photo-btn:hover { background: var(--accent-light); }

/* Lightbox */
.lightbox-backdrop {
  position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center; padding: 2rem;
  cursor: zoom-out;
}
.lightbox-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 0.5rem; cursor: default; }
.lightbox-close {
  position: fixed; top: 1.25rem; right: 1.25rem; z-index: 301;
  width: 2.5rem; height: 2.5rem; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.15); color: #fff; font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-close:hover { background: rgba(255,255,255,0.28); }
/* Aspect grid ("Detailed Breakdown") - mirrors iOS DetailedScoreView's ring rows */
.h-aspects { display: flex; flex-direction: column; }
.h-aspect-wrap { border-bottom: 1px solid var(--line); }
.h-aspect-wrap:last-child { border-bottom: none; }
.h-aspect-item-static { padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.h-aspects > .h-aspect-item-static:last-child { border-bottom: none; }
.h-aspect-item {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.75rem 0; cursor: default; list-style: none;
}
.h-aspect-wrap > .h-aspect-item { cursor: pointer; }
.h-aspect-wrap > .h-aspect-item::-webkit-details-marker { display: none; }
.h-aspect-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; flex: 1; }
.h-aspect-label { font-size: 0.8125rem; font-weight: 600; color: var(--text); }
.h-aspect-desc { font-size: 0.7rem; color: var(--muted); }
.h-aspect-ring {
  flex-shrink: 0; width: 2.25rem; height: 2.25rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; border: 3px solid currentColor;
}
.h-aspect-ring.score-high { color: var(--score-high); }
.h-aspect-ring.score-mid { color: var(--score-mid); }
.h-aspect-ring.score-low { color: var(--score-low); }
.h-aspect-chev { font-size: 0.7rem; color: var(--muted); flex-shrink: 0; transition: transform 0.2s; }
.h-aspect-chev-hidden { visibility: hidden; }
.h-aspect-wrap[open] .h-aspect-chev { transform: rotate(180deg); }
.h-aspect-tip {
  display: flex; align-items: flex-start; gap: 0.6rem;
  padding: 0 0 0.875rem 0; font-size: 0.8125rem; color: var(--muted);
}
.h-aspect-tip i { color: var(--accent); font-size: 0.8rem; margin-top: 0.15rem; flex-shrink: 0; }

/* Section headings + lists ("What's Working Well", "Areas for Improvement") */
.hd-section { margin-bottom: 1rem; }
.hd-section:last-child { margin-bottom: 0; }
.hd-heading { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; color: var(--text); margin-bottom: 0.5rem; }
.hd-breakdown { margin: 0; }
.hd-breakdown-summary {
  list-style: none; cursor: pointer; display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 0;
}
.hd-breakdown-summary::-webkit-details-marker { display: none; }
.hd-breakdown-chev { font-size: 0.8rem; color: var(--muted); transition: transform 0.2s; }
.hd-breakdown[open] .hd-breakdown-chev { transform: rotate(180deg); }
.hd-breakdown .h-aspects { margin-top: 0.75rem; }
.hd-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.hd-list li { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.875rem; color: var(--text); }
.hd-list li i { font-size: 0.8rem; margin-top: 0.2rem; flex-shrink: 0; }
.hd-birds-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.hd-bird-chip {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.25rem 0.7rem 0.25rem 0.25rem; border-radius: 999px;
  background: var(--elevated-muted); border: 1px solid var(--line);
  font-size: 0.8125rem; color: var(--text);
}
.hd-bird-avatar {
  width: 1.75rem; height: 1.75rem; border-radius: 50%; object-fit: cover;
  background: var(--control-bg); flex-shrink: 0; display: block;
}
.hd-bird-avatar-fallback { display: flex; align-items: center; justify-content: center; color: #2f7fd1; font-size: 0.75rem; }

/* ── Leaderboard (reuses .history-* row styles for consistency) ── */
.lb-rank-badge {
  display: inline-flex; align-items: center; gap: 0.2rem;
  font-size: 0.72rem; font-weight: 700; line-height: 1;
  padding: 0.15rem 0.45rem; border-radius: 999px;
  background: var(--elevated-muted); border: 1px solid var(--line); color: var(--muted);
  white-space: nowrap;
}
.lb-rank-badge.gold { color: #a07c10; background: rgba(201,162,39,0.12); border-color: rgba(201,162,39,0.4); }
.lb-rank-badge.pink { color: #c0003a; background: rgba(220,0,60,0.08); border-color: rgba(220,0,60,0.35); }
.lb-rank-badge.silver { color: #8a8a8a; border-color: rgba(158,158,158,0.4); }
.lb-rank-badge.bronze { color: #8b5e3c; border-color: rgba(139,94,60,0.4); }

/* ── Leaderboard podium (top 3) ── */
.lb-podium { gap: 0.625rem; margin-bottom: 0.5rem; }
.lb-podium .history-item {
  border: 1.5px solid var(--line); border-radius: calc(var(--radius) + 0.25rem);
  overflow: hidden;
}
.lb-podium .history-item details > summary { padding: 1rem; }
.lb-podium .history-thumb { width: 64px; height: 64px; }
.lb-podium .history-score { font-size: 1.45rem; }
.podium-1 {
  border-color: rgba(201,162,39,0.5) !important;
  background: linear-gradient(180deg, rgba(201,162,39,0.10), transparent 65%);
}
.podium-1 .history-thumb { width: 76px; height: 76px; }
.podium-1 .history-score { font-size: 1.75rem; }
.podium-2 { border-color: rgba(158,158,158,0.45) !important; background: linear-gradient(180deg, rgba(158,158,158,0.08), transparent 65%); }
.podium-3 { border-color: rgba(139,94,60,0.45) !important; background: linear-gradient(180deg, rgba(139,94,60,0.08), transparent 65%); }
.lb-rest-header {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--muted); padding: 0.75rem 0 0.4rem;
}

/* Profile collapsible (Saved, etc.) */
.profile-collapse { border-top: 1px solid var(--line); margin-bottom: 0.5rem; }
.profile-collapse-summary {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; list-style: none; padding: 0.875rem 0;
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; letter-spacing: -0.01em;
}
.profile-collapse-summary::-webkit-details-marker { display: none; }
.profile-collapse-chev { font-size: 0.85rem; color: var(--muted); transition: transform 0.2s; }
.profile-collapse[open] .profile-collapse-chev { transform: rotate(180deg); }
.profile-collapse-body { padding-bottom: 0.75rem; }

/* ── Profile ── */
.profile-section { margin-bottom: 1.5rem; }
.profile-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.875rem 0; border-bottom: 1px solid var(--line); font-size: 0.9375rem;
}
.profile-row:last-child { border-bottom: none; }
.profile-row-label { color: var(--muted); font-size: 0.875rem; }
.profile-row-val { font-weight: 600; }
.premium-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: #fff8e1; color: #7b5800; border: 1px solid #ffc107;
  border-radius: 999px; padding: 0.2rem 0.6rem; font-size: 0.75rem; font-weight: 700;
}
@media (prefers-color-scheme: dark) {
  .premium-badge { background: #2d2208; color: #d29922; }
}
.usage-bar-wrap { background: var(--control-bg); border-radius: 999px; height: 6px; margin-top: 0.25rem; }
.usage-bar { background: var(--accent); height: 6px; border-radius: 999px; transition: width 0.3s; }
.profile-reset-label { font-size: 0.8125rem; color: var(--muted); margin-top: 0.4rem; }
.profile-row-usage { border-bottom: none; padding-bottom: 0.3rem; }
.profile-row-usage .profile-row-val { font-weight: 500; font-size: 0.8125rem; color: var(--muted); }

/* Plan / premium collapse */
.profile-plan-collapse { border-bottom: 1px solid var(--line); }
.profile-plan-summary {
  cursor: pointer; list-style: none; border-bottom: none;
}
.profile-plan-summary::-webkit-details-marker { display: none; }
.profile-plan-right { display: flex; align-items: center; gap: 0.6rem; }
.profile-plan-details { padding: 0 0 0.875rem; }
.profile-plan-benefits { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.75rem; }
.profile-plan-benefits li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: var(--muted); }
.profile-plan-benefits li i { color: var(--score-high); font-size: 0.75rem; }
.profile-plan-note { font-size: 0.8125rem; color: var(--muted); }

.pb-sub-btn.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.pb-sub-btn.active:hover { background: var(--accent-hover); color: var(--on-accent); }

.profile-back-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: none; border: none; padding: 0; margin-bottom: 0.75rem;
  font: inherit; font-size: 0.8125rem; font-weight: 600; color: var(--accent); cursor: pointer;
}
.profile-back-link:hover { text-decoration: underline; }

.profile-row-desc { font-size: 0.8125rem; color: var(--muted); padding: 0 0 0.75rem; }

/* ── Spinner / loading ── */
.spinner {
  width: 1.25rem; height: 1.25rem; border-radius: 50%;
  border: 2px solid var(--accent-spinner); border-top-color: var(--accent);
  animation: spin 0.6s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row { display: flex; align-items: center; justify-content: center; padding: 3rem; gap: 0.75rem; color: var(--muted); }

/* ── Toast ── */
.toast {
  position: fixed; bottom: max(1.5rem, env(safe-area-inset-bottom)); left: 50%;
  transform: translateX(-50%); z-index: 300;
  background: var(--text); color: var(--bg);
  padding: 0.6rem 1.25rem; border-radius: 999px;
  font-size: 0.875rem; font-weight: 600;
  box-shadow: var(--shadow); pointer-events: none;
  animation: toast-in 0.2s ease, toast-out 0.3s ease 2.2s forwards;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(0.5rem); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(-50%) translateY(0.5rem); } }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state i { font-size: 2.5rem; margin-bottom: 0.75rem; display: block; color: var(--subtle); }
.empty-state p { font-size: 0.9375rem; }

/* ── Inline text button ── */
.btn-text-sm {
  background: none; border: none; cursor: pointer; font: inherit;
  font-size: 0.8125rem; font-weight: 500; color: var(--muted);
  padding: 0; transition: color 0.15s;
}
.btn-text-sm:hover { color: var(--text); }

/* ── Bird carousel ── */
.bird-carousel-wrap { margin-top: 1.75rem; }
.bird-carousel-wrap .hd-heading { margin-bottom: 0.75rem; }
.guest-birds-teaser {
  margin: 0.85rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.45;
}
.guest-birds-teaser-link {
  background: none; border: none; padding: 0; margin: 0;
  font: inherit; font-weight: 600; color: var(--accent); cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.guest-birds-teaser-link:hover { color: var(--accent-hover); }
.bird-carousel {
  display: flex; gap: 1.25rem; overflow-x: auto; padding: 0.5rem 0.25rem 1rem;
  scrollbar-width: none;
  scroll-snap-type: x proximity; scroll-padding-left: 0.25rem;
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 2.5rem), transparent 100%);
          mask-image: linear-gradient(to right, black calc(100% - 2.5rem), transparent 100%);
}
.bird-carousel::-webkit-scrollbar { display: none; }

/* Field-guide / polaroid card */
.bird-card {
  flex-shrink: 0; background: #fffdf8; border: 1px solid var(--line);
  border-radius: 0.375rem; width: 15.5rem; padding: 0.625rem 0.625rem 1rem;
  display: flex; flex-direction: column; scroll-snap-align: start;
  box-shadow: 0 6px 16px rgba(20,20,10,0.10), 0 1px 2px rgba(20,20,10,0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.bird-card:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(20,20,10,0.14), 0 2px 4px rgba(20,20,10,0.08); }
@media (prefers-color-scheme: dark) {
  .bird-card { background: var(--surface); box-shadow: 0 6px 16px rgba(0,0,0,0.35), 0 1px 2px rgba(0,0,0,0.25); }
  .bird-card:hover { box-shadow: 0 10px 22px rgba(0,0,0,0.45), 0 2px 4px rgba(0,0,0,0.3); }
}
:root[data-theme="dark"] .bird-card { background: var(--surface); box-shadow: 0 6px 16px rgba(0,0,0,0.35), 0 1px 2px rgba(0,0,0,0.25); }

.bird-card-img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top;
  background: var(--control-bg); display: block; border-radius: 0.2rem;
}
.bird-card-img-placeholder { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 1.75rem; aspect-ratio: 4/3; }
.bird-card-name {
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 600;
  color: var(--text); text-align: center; padding-top: 0.7rem; letter-spacing: -0.01em;
}
.bird-card-body { font-size: 0.8125rem; color: var(--muted); line-height: 1.45; text-align: center; padding-top: 0.25rem; }

@media (max-width: 640px) {
  .bird-carousel { gap: 0.75rem; }
  .bird-card { width: 9.75rem; padding: 0.4rem 0.4rem 0.65rem; border-radius: 0.3rem; }
  .bird-card-img { border-radius: 0.15rem; }
  .bird-card-img-placeholder { font-size: 1.25rem; }
  .bird-card-name { font-size: 0.8rem; padding-top: 0.45rem; }
  .bird-card-body { font-size: 0.7rem; padding-top: 0.15rem; }
}
