@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Source+Sans+3:wght@400;500;600;700&display=swap');

:root{
  --sage: #6B7A5E;
  --sage-dark: #4E5B44;
  --sand: #F6F2E9;
  --sand-dark: #EBE3D1;
  --ink: #2E2A24;
  --ink-soft: #64604F;
  --adobe: #A85C32;
  --gold: #B8923E;
  --line: rgba(46,42,36,0.13);
  --confirmed: #4E5B44;
  --tentative: #A85C32;
}
*{box-sizing:border-box;}
body{
  margin:0;
  background:var(--sand);
  background-image:
    radial-gradient(ellipse at top left, rgba(107,122,94,0.10), transparent 55%),
    radial-gradient(ellipse at bottom right, rgba(184,146,62,0.08), transparent 55%);
  font-family:'Source Sans 3', sans-serif;
  color:var(--ink);
  -webkit-font-smoothing:antialiased;
}
.wrap{max-width:720px; margin:0 auto; padding:34px 20px 60px;}

header{margin-bottom:30px;}
.back-link{
  display:inline-block;
  font-size:13px;
  font-weight:600;
  color:var(--ink-soft);
  text-decoration:none;
  margin-bottom:14px;
}
.back-link:hover{color:var(--adobe);}
.eyebrow{
  font-size:12.5px;
  letter-spacing:0.16em;
  text-transform:uppercase;
  color:var(--sage);
  font-weight:700;
  margin-bottom:10px;
}
h1{
  font-family:'Fraunces', serif;
  font-weight:700;
  font-size:38px;
  line-height:1.08;
  margin:0 0 10px;
}
h1 em{font-style:italic; color:var(--adobe); font-weight:600;}
.sub{
  font-size:15.5px;
  color:var(--ink-soft);
  line-height:1.55;
  max-width:52ch;
}
.meta-row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:16px;
}
.pill{
  font-size:12px;
  font-weight:600;
  padding:6px 12px;
  border-radius:999px;
  background:var(--sage);
  color:#fff;
}
.pill.outline{
  background:transparent;
  border:1.5px solid var(--line);
  color:var(--ink-soft);
}

/* --- controls: search / status / tags --- */
.controls{margin:0 0 28px;}
.search-input{
  width:100%;
  padding:11px 14px;
  font-size:15px;
  font-family:inherit;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  color:var(--ink);
  margin-bottom:12px;
}
.filter-row{display:flex; flex-wrap:wrap; gap:8px; margin-bottom:8px;}
.status-toggle, .tag-chip{
  font-size:12.5px;
  font-weight:600;
  padding:6px 12px;
  border-radius:999px;
  border:1.5px solid var(--line);
  background:#fff;
  color:var(--ink-soft);
  cursor:pointer;
  font-family:inherit;
}
.status-toggle.active[data-status="confirmed"], .status-toggle.active{
  background:var(--sage); color:#fff; border-color:var(--sage);
}
.status-toggle.active[data-status="tentative"]{
  background:var(--adobe); border-color:var(--adobe);
}
.tag-chip.active{background:var(--sand-dark); border-color:var(--ink-soft); color:var(--ink);}

.loading, .empty{color:var(--ink-soft); text-align:center; margin-top:2rem;}

/* --- compact list cards --- */
.list-grid{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:14px;}
.list-card{
  display:flex;
  gap:14px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
  cursor:pointer;
  align-items:center;
}
.list-thumb{
  width:72px; height:72px; border-radius:10px; object-fit:cover; flex-shrink:0; background:var(--sand-dark);
}
.list-thumb.placeholder{display:flex; align-items:center; justify-content:center; color:var(--ink-soft); font-size:11px;}
.list-card-body{flex:1; min-width:0;}
.list-card-top{display:flex; justify-content:space-between; align-items:flex-start; gap:8px;}
.list-common-name{font-family:'Fraunces', serif; font-weight:700; font-size:17px; margin:0;}
.list-sci-name{font-style:italic; color:var(--ink-soft); font-size:13px;}
.list-meta{font-size:12px; color:var(--ink-soft); margin-top:4px;}

/* --- status badge (shared by list + detail) --- */
.status-badge{
  flex-shrink:0;
  font-size:11px;
  font-weight:700;
  letter-spacing:0.03em;
  padding:4px 10px;
  border-radius:999px;
  white-space:nowrap;
  text-transform:uppercase;
}
.status-badge.confirmed{background:rgba(78,91,68,0.12); color:var(--confirmed);}
.status-badge.tentative{background:rgba(168,92,50,0.12); color:var(--tentative);}

/* --- detail card (matches chat-generated field guide look) --- */
.back-btn{
  background:none; border:none; color:var(--ink-soft); font-size:13.5px; font-weight:600;
  cursor:pointer; padding:0; margin-bottom:16px; font-family:inherit;
}
.back-btn:hover{color:var(--adobe);}

.card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
  padding:0;
  margin-bottom:24px;
  overflow:hidden;
  scroll-margin-top:16px;
}
.card-header{padding:20px 22px 16px; border-bottom:1px solid var(--line);}
.status-row{display:flex; justify-content:space-between; align-items:flex-start; gap:10px; margin-bottom:8px;}
.common-name{font-family:'Fraunces', serif; font-weight:700; font-size:24px; line-height:1.2; margin:0 0 3px;}
.sci-name{font-style:italic; color:var(--ink-soft); font-size:14.5px;}
.family-tag{font-size:11.5px; color:var(--ink-soft); margin-top:6px; letter-spacing:0.02em;}

.photo-strip{display:flex; flex-wrap:wrap; gap:2px; background:var(--sand-dark);}
.photo-strip img{
  width:100%; height:210px; object-fit:cover; display:block; flex:1 1 45%; min-width:150px; cursor:pointer;
}

.card-body{padding:18px 22px 22px;}
.field-notes{font-size:14.5px; line-height:1.65; color:var(--ink); margin-bottom:14px;}
.field-notes strong{color:var(--ink);}

.tentative-box{
  background:rgba(168,92,50,0.07);
  border:1px solid rgba(168,92,50,0.22);
  border-radius:10px;
  padding:12px 14px;
  font-size:13.5px;
  line-height:1.55;
  color:var(--ink-soft);
  margin-top:12px;
}
.tentative-box.confirmed-note{
  background:rgba(78,91,68,0.06);
  border-color:rgba(78,91,68,0.2);
}
.tentative-box .tt-label{
  font-weight:700;
  color:var(--tentative);
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:0.03em;
  display:block;
  margin-bottom:4px;
}
.tentative-box.confirmed-note .tt-label{color:var(--confirmed);}

.detail-grid{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:6px 14px;
  font-size:13px;
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid var(--line);
}
.detail-grid dt{color:var(--ink-soft); font-weight:600; white-space:nowrap;}
.detail-grid dd{margin:0; color:var(--ink);}

.aliases{font-size:12.5px; color:var(--ink-soft); margin-top:10px;}
.location-line{font-size:12.5px; color:var(--ink-soft); margin-top:10px;}
.tag-list{display:flex; flex-wrap:wrap; gap:6px; margin-top:12px;}
.tag-list span{
  background:var(--sand-dark); color:var(--ink); font-size:11.5px; padding:3px 9px; border-radius:999px;
}

footer{margin-top:10px; padding-top:20px; border-top:1px solid var(--line); font-size:12.5px; color:var(--ink-soft); line-height:1.6; text-align:center;}

/* lightbox for tapping a photo to enlarge */
.lightbox{
  display:none; position:fixed; inset:0; background:rgba(20,18,14,0.92); z-index:100;
  align-items:center; justify-content:center; padding:20px;
}
.lightbox.open{display:flex;}
.lightbox img{max-width:100%; max-height:90vh; border-radius:8px;}

@media (max-width:480px){
  h1{font-size:30px;}
  .common-name{font-size:21px;}
  .photo-strip img{height:150px;}
}
