:root {
  color-scheme: light;
  --bg: #f6f8f4;
  --panel: #ffffff;
  --text: #16211c;
  --muted: #64736a;
  --line: #d8e0da;
  --accent: #16624f;
  --accent-strong: #0d493a;
  --warning: #9a5b16;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-page {
  min-height: 100vh;
}

.cover-page {
  min-height: 100svh;
  overflow-x: hidden;
  background: #111612;
}

.cover-shell {
  position: relative;
  min-height: 100svh;
  isolation: isolate;
}

.cover-image,
.cover-shade {
  position: absolute;
  inset: 0;
}

.cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.cover-shade {
  z-index: 1;
  background:
    linear-gradient(180deg, rgb(6 12 10 / 0.32), rgb(6 12 10 / 0.1) 36%, rgb(6 12 10 / 0.82) 100%),
    linear-gradient(90deg, rgb(6 12 10 / 0.56), rgb(6 12 10 / 0.08) 52%, rgb(6 12 10 / 0.38));
}

.cover-content {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 34px;
  color: #fffdf6;
}

.cover-title {
  max-width: 660px;
  text-shadow: 0 2px 18px rgb(0 0 0 / 0.32);
}

.cover-title h1 {
  font-size: 4rem;
  line-height: 0.95;
}

.cover-title p {
  margin-top: 10px;
  color: #f0dfc7;
  font-size: 1.05rem;
  font-weight: 700;
}

.login-form {
  display: grid;
  width: min(760px, 100%);
  gap: 10px;
  align-self: center;
  margin-bottom: 8px;
}

.login-form label {
  color: #f8ead4;
  text-shadow: 0 1px 10px rgb(0 0 0 / 0.42);
}

.login-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.login-row input {
  min-width: 0;
  border-color: rgb(255 250 241 / 0.72);
  background: rgb(255 250 241 / 0.9);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.18);
}

.login-row button {
  min-width: 112px;
  background: #c65f2a;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.18);
}

.login-row button:hover {
  background: #a94c1f;
}

.shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.shell.wide {
  width: min(1120px, calc(100% - 32px));
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 2rem;
  line-height: 1.1;
  font-weight: 720;
}

h2 {
  font-size: 1.2rem;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.muted {
  margin-top: 8px;
  color: var(--muted);
}

.panel,
.player-band {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgb(22 33 28 / 0.04);
}

.panel {
  padding: 20px;
}

.upload-form {
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

input {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--text);
  font: inherit;
  background: #fff;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button-link:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: wait;
  opacity: 0.78;
}

.button-secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent);
}

.button-secondary:hover {
  background: #eef5f1;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.logout-form {
  margin: 0;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  background: #fff;
}

.analysis-progress {
  display: grid;
  gap: 12px;
  overflow: hidden;
  border: 1px solid #cddbd3;
  border-radius: 8px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgb(22 98 79 / 0.08), rgb(198 95 42 / 0.11)),
    #fbfdf9;
}

.analysis-progress-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
}

.analysis-progress-copy strong {
  color: var(--accent-strong);
  font-size: 1rem;
}

.analysis-progress-copy span {
  color: var(--warning);
  font-size: 0.92rem;
  font-weight: 800;
}

.analysis-progress-track {
  position: relative;
  overflow: hidden;
  height: 32px;
  border: 1px solid rgb(13 73 58 / 0.24);
  border-radius: 999px;
  background: #e8efe9;
  box-shadow: inset 0 1px 5px rgb(22 33 28 / 0.12);
}

.analysis-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 48%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, #16624f, #c65f2a, #16624f),
    repeating-linear-gradient(45deg, rgb(255 255 255 / 0.2) 0 10px, transparent 10px 20px);
  box-shadow: 0 0 22px rgb(198 95 42 / 0.28);
  animation: analysis-sweep 1.35s ease-in-out infinite;
}

.analysis-progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.5), transparent);
  animation: analysis-shine 1.35s linear infinite;
}

.upload-form[aria-busy="true"] .analysis-progress {
  animation: analysis-pulse 1.8s ease-in-out infinite;
}

@keyframes analysis-sweep {
  0% {
    transform: translateX(-52%);
  }

  50% {
    transform: translateX(68%);
  }

  100% {
    transform: translateX(160%);
  }
}

@keyframes analysis-shine {
  0% {
    transform: translateX(-120%);
  }

  100% {
    transform: translateX(120%);
  }
}

@keyframes analysis-pulse {
  0%,
  100% {
    box-shadow: 0 1px 2px rgb(22 33 28 / 0.04);
  }

  50% {
    box-shadow: 0 14px 32px rgb(22 98 79 / 0.14);
  }
}

.player-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px) minmax(180px, 240px);
  gap: 16px;
  align-items: center;
  padding: 14px;
  margin-bottom: 18px;
}

.dashboard-controls {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
}

audio {
  width: 100%;
}

.search {
  min-height: 40px;
}

.confidence-filter {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 10px;
}

.confidence-filter input {
  grid-column: 1 / -1;
  min-height: 28px;
  padding: 0;
}

.confidence-filter span {
  min-width: 42px;
  color: var(--warning);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  text-align: right;
}

.notice {
  margin-bottom: 18px;
  border: 1px solid #b9d3c5;
  border-radius: 8px;
  padding: 12px 14px;
  background: #edf6ef;
  color: var(--accent-strong);
  font-weight: 750;
}

.summary-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.species-chip {
  min-height: 38px;
  gap: 10px;
  background: #eaf2ed;
  color: var(--accent-strong);
}

.species-chip:hover {
  background: #dbe9e1;
}

.species-chip span {
  min-width: 24px;
  border-radius: 999px;
  background: #fff;
  padding: 2px 7px;
}

.event-list {
  display: grid;
  gap: 8px;
}

.event-list.compact {
  gap: 6px;
}

.recording-stack {
  display: grid;
  gap: 16px;
}

.recording-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgb(22 33 28 / 0.04);
}

.recording-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 16px;
  align-items: center;
}

.recording-card h2 a {
  color: inherit;
  text-decoration: none;
}

.recording-card h2 a:hover {
  color: var(--accent);
}

.event-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 84px;
  gap: 16px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  text-align: left;
}

.event-row:hover {
  background: #f3f8f5;
}

.time {
  color: var(--warning);
  font-weight: 800;
}

.bird {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.bird strong,
.bird em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bird em {
  color: var(--muted);
  font-size: 0.9rem;
  font-style: normal;
}

.confidence {
  justify-self: end;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.empty-state {
  display: grid;
  gap: 8px;
  min-height: 160px;
  place-content: center;
  text-align: center;
}

.hidden {
  display: none;
}

@media (max-width: 720px) {
  .cover-content {
    padding: 24px 18px 20px;
  }

  .cover-title h1 {
    font-size: 2.7rem;
  }

  .cover-title p {
    font-size: 1rem;
  }

  .login-row {
    grid-template-columns: 1fr;
  }

  .analysis-progress {
    padding: 14px;
  }

  .analysis-progress-track {
    height: 28px;
  }

  .page-header,
  .player-band {
    grid-template-columns: 1fr;
    display: grid;
  }

  .recording-card-header {
    grid-template-columns: 1fr;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .event-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .confidence {
    justify-self: start;
  }
}

@media (max-width: 360px) {
  .cover-title h1 {
    font-size: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .analysis-progress-fill,
  .analysis-progress-fill::after,
  .upload-form[aria-busy="true"] .analysis-progress {
    animation: none;
  }

  .analysis-progress-fill {
    width: 100%;
  }
}

/* Birding journal */
:root {
  --paper: #f5f0e4;
  --paper-deep: #ebe2d0;
  --moss: #315b49;
  --moss-dark: #173f35;
  --fern: #7f9b72;
  --bark: #7a5137;
  --dawn: #d98556;
  --night: #172b36;
  --ink: #24352d;
  --journal-line: #d9cfbc;
}

.journal-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 3%, rgb(217 133 86 / 0.13), transparent 25rem),
    radial-gradient(circle at 93% 23%, rgb(127 155 114 / 0.18), transparent 28rem),
    var(--paper);
  color: var(--ink);
  padding-bottom: 48px;
}

.journal-topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  min-height: 72px;
  border-bottom: 1px solid rgb(49 91 73 / 0.16);
  padding: 10px max(24px, calc((100vw - 1180px) / 2));
  background: rgb(245 240 228 / 0.9);
  backdrop-filter: blur(16px);
}

.journal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--moss-dark);
  text-decoration: none;
}

.journal-brand > span:last-child {
  display: grid;
}

.journal-brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  line-height: 1;
}

.journal-brand small {
  margin-top: 3px;
  color: #6f776f;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  border-radius: 50% 50% 46% 54%;
  place-content: center;
  background: var(--moss-dark);
  color: #f7eac9;
  font-family: Georgia, serif;
  font-size: 1.2rem;
  font-style: italic;
  transform: rotate(-7deg);
}

.journal-nav {
  display: flex;
  justify-content: center;
  gap: 28px;
}

.journal-nav a,
.nav-logout {
  border: 0;
  padding: 8px 2px;
  background: transparent;
  color: #59665e;
  font-size: 0.88rem;
  font-weight: 750;
  text-decoration: none;
}

.journal-nav a:hover,
.nav-logout:hover {
  background: transparent;
  color: var(--moss-dark);
}

.journal-shell {
  width: min(1060px, calc(100% - 36px));
  margin: 0 auto;
  padding: 52px 0 80px;
}

.journal-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 36px;
  margin-bottom: 28px;
}

.journal-hero h1,
.capture-heading h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 6vw, 4.8rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.journal-hero p:last-child,
.capture-heading > p:last-child {
  max-width: 610px;
  margin-top: 13px;
  color: #6b716a;
  font-family: Georgia, serif;
  font-size: 1.08rem;
  line-height: 1.5;
}

.journal-kicker {
  margin-bottom: 10px;
  color: var(--dawn);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.add-encounter {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  border-radius: 999px;
  padding: 12px 21px;
  background: var(--moss-dark);
  box-shadow: 0 12px 30px rgb(23 63 53 / 0.2);
  color: #fffaf0;
  font-weight: 800;
  text-decoration: none;
}

.add-encounter span {
  font-size: 1.25rem;
}

.journal-tools {
  position: sticky;
  z-index: 10;
  top: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  border: 1px solid rgb(122 81 55 / 0.14);
  border-radius: 18px;
  padding: 10px 14px;
  background: rgb(251 247 238 / 0.92);
  box-shadow: 0 8px 24px rgb(52 62 52 / 0.06);
  backdrop-filter: blur(12px);
}

.filter-sheet {
  position: relative;
}

.filter-sheet summary {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  color: var(--moss-dark);
  font-weight: 800;
}

.filter-sheet summary::-webkit-details-marker { display: none; }

.filter-sheet summary b {
  display: grid;
  min-width: 21px;
  height: 21px;
  border-radius: 99px;
  place-content: center;
  background: var(--dawn);
  color: white;
  font-size: 0.72rem;
}

.filter-form {
  position: absolute;
  top: calc(100% + 18px);
  left: -14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  width: min(620px, calc(100vw - 36px));
  border: 1px solid var(--journal-line);
  border-radius: 20px;
  padding: 20px;
  background: #fffaf0;
  box-shadow: 0 24px 60px rgb(23 43 54 / 0.18);
}

.filter-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filter-actions a { color: var(--bark); }

.storage-note {
  color: #69766d;
  font-size: 0.8rem;
}

.storage-note span { color: var(--moss); }

.encounter-feed {
  display: grid;
  gap: 28px;
}

.encounter-card {
  overflow: hidden;
  border: 1px solid rgb(122 81 55 / 0.18);
  border-radius: 24px;
  background: #fffaf1;
  box-shadow: 0 14px 38px rgb(43 54 45 / 0.09);
}

.encounter-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 22px 24px 18px;
}

.date-medallion {
  display: grid;
  width: 52px;
  height: 58px;
  border: 1px solid #d8c9b2;
  border-radius: 50% 50% 46% 54%;
  place-content: center;
  background: var(--paper);
  color: var(--bark);
  text-align: center;
  transform: rotate(-3deg);
}

.date-medallion strong {
  font-family: Georgia, serif;
  font-size: 1.4rem;
  line-height: 1;
}

.date-medallion span { font-size: 0.6rem; font-weight: 800; }

.encounter-meta {
  color: #7a796f;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.encounter-title h2 {
  margin-top: 3px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 4vw, 2rem);
  font-weight: 500;
}

.scientific {
  margin-top: 2px;
  color: #6f776f;
  font-family: Georgia, serif;
  font-size: 0.84rem;
  font-style: italic;
}

.birding-badges { display: flex; flex-wrap: wrap; justify-content: end; gap: 6px; }

.seen-badge,
.heard-badge {
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 0.7rem;
  font-weight: 850;
}

.seen-badge { background: #e5eddf; color: #325a47; }
.heard-badge { background: #f5e3d4; color: #8c4e2d; }

.media-gallery {
  display: grid;
  gap: 2px;
  background: var(--night);
}

.media-gallery-multiple {
  grid-auto-columns: minmax(80%, 1fr);
  grid-auto-flow: column;
  grid-template-columns: unset;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}

.media-frame {
  position: relative;
  display: grid;
  min-width: 0;
  margin: 0;
  background: var(--night);
  scroll-snap-align: start;
}

.media-frame > a:first-child { display: block; min-height: 280px; }
.media-frame > a img,
.media-frame video {
  display: block;
  width: 100%;
  height: min(66vw, 650px);
  min-height: 280px;
  object-fit: cover;
  background: #14242d;
}

.proof-label {
  position: absolute;
  top: 14px;
  left: 14px;
  border-radius: 999px;
  padding: 7px 10px;
  background: rgb(23 43 54 / 0.83);
  color: #fff6e8;
  font-size: 0.7rem;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.sound-card {
  display: grid;
  gap: 14px;
  min-height: 360px;
  align-content: center;
  padding: clamp(22px, 5vw, 48px);
  background:
    radial-gradient(circle at 80% 15%, rgb(217 133 86 / 0.42), transparent 38%),
    linear-gradient(145deg, #193d39, #172b36 62%, #2d3c38);
  color: #fff7e8;
}

.sound-title { display: flex; align-items: center; gap: 12px; }
.sound-title > div { display: grid; gap: 3px; min-width: 0; }
.sound-title small { overflow: hidden; color: #bfcfc5; text-overflow: ellipsis; white-space: nowrap; }
.sound-icon { display: grid; width: 44px; height: 44px; border-radius: 50%; place-content: center; background: var(--dawn); font-size: 1.4rem; }
.waveform { width: 100%; height: 112px; }
.sound-card audio { filter: sepia(0.2) saturate(0.8); }
.spectrogram { width: 100%; max-height: 180px; border-radius: 10px; object-fit: cover; opacity: 0.85; }

.media-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  min-height: 44px;
  padding: 8px 14px;
  background: #f4efe3;
  color: #667067;
  font-size: 0.7rem;
}

.media-status a { color: var(--bark); font-weight: 750; }
.backup-ok { color: var(--moss); font-weight: 850; }
.processing-state { margin-left: auto; color: var(--dawn); font-weight: 750; }
.media-status form { margin: 0 0 0 auto; }
.retry-button { min-height: 30px; padding: 4px 9px; background: #944d34; font-size: 0.7rem; }

.field-notes {
  padding: 22px 24px 4px;
  font-family: Georgia, serif;
  font-size: 1rem;
  line-height: 1.65;
  white-space: pre-line;
}

.suggestion {
  margin: 18px 24px 0;
  border-left: 3px solid var(--dawn);
  padding: 9px 12px;
  background: #f8ecdd;
  color: #745644;
  font-size: 0.8rem;
}

.suggestion span { color: var(--dawn); font-weight: 850; }

.encounter-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  border-top: 1px solid #e8dece;
  padding: 13px 24px 16px;
  color: #7d8179;
  font-size: 0.72rem;
}

.encounter-footer a { color: var(--moss); font-weight: 750; }
.load-more { display: flex; width: max-content; margin: 28px auto; color: var(--moss); font-weight: 800; }

.journal-empty {
  display: grid;
  min-height: 390px;
  place-items: center;
  align-content: center;
  border: 1px dashed #cbbba1;
  border-radius: 28px;
  padding: 42px;
  background: rgb(255 250 241 / 0.55);
  text-align: center;
}

.journal-empty h2 { margin: 2px 0 8px; font-family: Georgia, serif; font-size: 2rem; font-weight: 500; }
.journal-empty > p:not(.journal-kicker) { max-width: 500px; margin-bottom: 22px; color: #777b74; line-height: 1.55; }
.empty-bird { color: var(--moss); font-family: Georgia, serif; font-size: 4rem; transform: rotate(-12deg); }

.capture-shell,
.editor-shell { width: min(760px, 100%); margin: 0 auto; }
.back-link { display: inline-block; margin-bottom: 30px; color: var(--moss); font-weight: 800; text-decoration: none; }
.capture-heading { margin-bottom: 28px; }

.journal-upload,
.encounter-form { display: grid; gap: 20px; }

.media-drop {
  display: grid;
  min-height: 280px;
  border: 1.5px dashed #9caa91;
  border-radius: 26px;
  place-content: center;
  padding: 30px;
  background: rgb(255 250 241 / 0.8);
  color: var(--ink);
  text-align: center;
  cursor: pointer;
}

.media-drop:hover { border-color: var(--moss); background: #fffaf1; }
.media-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-illustration { margin-bottom: 14px; color: var(--moss); font-family: Georgia, serif; font-size: 2.8rem; letter-spacing: 0.12em; }
.media-drop strong { font-family: Georgia, serif; font-size: 1.35rem; }
.media-drop small { margin-top: 7px; color: #788078; font-weight: 500; }

.selected-media { display: grid; gap: 8px; }
.selected-file { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 1px solid #dfd5c2; border-radius: 12px; padding: 10px 12px; background: #fffaf1; }
.selected-file span:first-child { color: var(--dawn); font-size: 1.2rem; }
.selected-file strong { overflow: hidden; font-size: 0.82rem; text-overflow: ellipsis; white-space: nowrap; }
.selected-file small { color: #777; font-size: 0.68rem; }

.backup-promise { display: flex; gap: 13px; border-radius: 16px; padding: 15px; background: #e6ede4; color: #506056; }
.backup-promise > span { color: var(--moss); font-size: 1.4rem; }
.backup-promise p { font-size: 0.78rem; line-height: 1.45; }
.backup-promise strong { color: var(--moss-dark); }

.primary-wide { width: 100%; min-height: 54px; border-radius: 999px; background: var(--moss-dark); }
.upload-progress { display: grid; gap: 9px; border-radius: 16px; padding: 16px; background: #f0e5d6; }
.upload-progress > div { display: flex; justify-content: space-between; color: var(--bark); font-size: 0.8rem; }
.upload-progress progress { width: 100%; accent-color: var(--moss); }
.cancel-upload { justify-self: start; min-height: 32px; padding: 5px 10px; background: transparent; color: var(--bark); font-size: 0.75rem; }

.date-warning { margin-bottom: 18px; border: 1px solid #e3c08c; border-radius: 14px; padding: 13px; background: #fff0d8; color: #815120; font-size: 0.82rem; }
.editor-media-strip { display: grid; grid-auto-columns: minmax(105px, 150px); grid-auto-flow: column; gap: 9px; overflow-x: auto; margin-bottom: 24px; }
.editor-media-strip > div { position: relative; display: grid; min-height: 112px; border-radius: 14px; place-content: center; overflow: hidden; background: var(--night); color: white; }
.editor-media-strip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.editor-media-strip > div > span { font-size: 2rem; }
.editor-media-strip small { position: absolute; right: 5px; bottom: 5px; border-radius: 99px; padding: 3px 6px; background: rgb(23 63 53 / 0.88); font-size: 0.58rem; }

.encounter-form fieldset,
.form-section { margin: 0; border: 1px solid #ded3c0; border-radius: 18px; padding: 18px; background: rgb(255 250 241 / 0.7); }
.encounter-form legend { padding: 0 8px; color: var(--moss-dark); font-family: Georgia, serif; font-size: 1.05rem; }
.sighting-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sighting-toggles label { cursor: pointer; }
.sighting-toggles input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sighting-toggles span { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 58px; border: 1px solid #d7cebc; border-radius: 14px; background: #fffaf1; color: #77796f; }
.sighting-toggles input:checked + span { border-color: var(--moss); background: #e2ebdf; color: var(--moss-dark); box-shadow: 0 0 0 2px rgb(49 91 73 / 0.1); }
.compact-toggles { grid-column: 1 / -1; }
.compact-toggles span { min-height: 42px; }

.form-section { display: grid; gap: 14px; }
.two-fields,
.date-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.date-fields label:nth-child(3),
.field-hint,
.full-field { grid-column: 1 / -1; }
label > span small,
label > small { color: #8a8b84; font-weight: 500; }
select,
textarea {
  width: 100%;
  border: 1px solid var(--journal-line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
select { min-height: 42px; }
textarea { resize: vertical; }
.field-hint { color: #7c7e76; font-size: 0.72rem; }
.publish-note { color: #647067; font-size: 0.78rem; text-align: center; }

.compact-hero { margin-bottom: 35px; }
.trips-layout { display: grid; grid-template-columns: minmax(270px, 0.75fr) minmax(0, 1.25fr); gap: 24px; align-items: start; }
.trip-form-card { position: sticky; top: 96px; border: 1px solid #dacdb9; border-radius: 22px; padding: 22px; background: #fffaf1; }
.trip-form-card h2 { margin-bottom: 18px; font-family: Georgia, serif; font-size: 1.5rem; font-weight: 500; }
.trip-list { display: grid; gap: 12px; }
.trip-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; border: 1px solid #dccfbb; border-radius: 18px; padding: 18px; background: rgb(255 250 241 / 0.78); }
.trip-card p { color: #88867c; font-size: 0.69rem; }
.trip-card h2 { margin: 3px 0; font-family: Georgia, serif; font-weight: 500; }
.trip-card span { color: #71766f; font-size: 0.76rem; }
.trip-card a { color: var(--moss); font-size: 0.74rem; font-weight: 800; white-space: nowrap; }
.trip-leaf { color: var(--fern); font-size: 2rem; }
.small-empty { min-height: 280px; }
.mobile-tabbar { display: none; }

@media (max-width: 720px) {
  .journal-page { padding-bottom: 90px; }
  .journal-topbar { position: static; grid-template-columns: 1fr auto; min-height: 62px; padding: 10px 18px; }
  .journal-nav { display: none; }
  .journal-shell { width: min(100% - 24px, 680px); padding-top: 30px; }
  .journal-hero { display: grid; gap: 20px; }
  .journal-hero h1, .capture-heading h1 { font-size: 2.65rem; }
  .journal-hero .add-encounter { display: none; }
  .journal-tools { top: 8px; border-radius: 15px; }
  .storage-note { max-width: 52%; text-align: right; }
  .filter-form { position: fixed; z-index: 30; inset: auto 12px 86px; top: auto; grid-template-columns: 1fr; max-height: calc(100vh - 115px); overflow-y: auto; border-radius: 24px; }
  .compact-toggles, .filter-actions { grid-column: 1; }
  .encounter-feed { gap: 18px; }
  .encounter-card { border-radius: 19px; }
  .encounter-heading { grid-template-columns: auto minmax(0, 1fr); padding: 16px 14px 13px; }
  .birding-badges { grid-column: 2; justify-content: start; }
  .date-medallion { width: 44px; height: 50px; }
  .media-frame > a:first-child { min-height: 240px; }
  .media-frame > a img, .media-frame video { height: 76vw; min-height: 240px; max-height: 520px; }
  .media-gallery-multiple { grid-auto-columns: 92%; }
  .sound-card { min-height: 330px; padding: 22px 16px; }
  .field-notes { padding: 17px 16px 0; }
  .encounter-footer { padding: 12px 16px 14px; }
  .media-status { padding-inline: 10px; }
  .processing-state { margin-left: 0; }
  .capture-shell, .editor-shell { padding-bottom: 16px; }
  .media-drop { min-height: 240px; }
  .two-fields, .date-fields { grid-template-columns: 1fr; }
  .date-fields label:nth-child(3), .field-hint, .full-field { grid-column: 1; }
  .trips-layout { grid-template-columns: 1fr; }
  .trip-form-card { position: static; }
  .trip-card { grid-template-columns: auto minmax(0, 1fr); }
  .trip-card a { grid-column: 2; }
  .mobile-tabbar {
    position: fixed;
    z-index: 25;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: end;
    min-height: 68px;
    border: 1px solid rgb(255 255 255 / 0.15);
    border-radius: 22px;
    padding: 7px 8px;
    background: rgb(23 43 54 / 0.94);
    box-shadow: 0 12px 35px rgb(23 43 54 / 0.3);
    backdrop-filter: blur(16px);
  }
  .mobile-tabbar a { display: grid; gap: 2px; place-items: center; color: #dbe4dc; font-size: 0.62rem; font-weight: 750; text-decoration: none; }
  .mobile-tabbar a span { font-size: 1.35rem; }
  .mobile-tabbar .mobile-add { width: 64px; height: 64px; justify-self: center; border-radius: 50%; background: var(--dawn); color: white; transform: translateY(-14px); box-shadow: 0 8px 20px rgb(0 0 0 / 0.23); }
  .mobile-tabbar .mobile-add span { font-size: 1.7rem; line-height: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  .encounter-card { animation: journal-card-in 0.42s ease-out both; }
  @keyframes journal-card-in { from { opacity: 0; transform: translateY(8px); } }
}

.hidden { display: none !important; }
