:root {
  color-scheme: light;
  --paper: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #76767c;
  --green: #007aff;
  --dark: #0063d1;
  --line: #e5e5ea;
  --white: #fff;
  --light-green: #eaf3ff;
  --wanted: #a3a3aa;
  --seen: #34a370;
  --radius: 20px;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, summary, select { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: wait; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #81baff; outline-offset: 3px; }
input:focus, textarea:focus, select:focus { outline: 2px solid #81baff; outline-offset: 1px; }
a { color: var(--green); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.primary, .secondary { border: 0; border-radius: 10px; padding: 11px 18px; font-size: 13px; font-weight: 500; }
.primary { background: var(--green); color: white; box-shadow: 0 2px 4px #007aff14; }
.primary:hover { background: var(--dark); }
.secondary { background: #ededf2; }
.small { padding: 8px 13px; font-size: 12px; }
.quiet-button, .icon-button { background: none; border: 0; color: var(--green); padding: 8px; font-size: 12px; }
.icon-button { font-size: 24px; line-height: 1; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 216px; background: #ededf2bd; border-right: 1px solid #dedee5; padding: 34px 18px 22px; display: flex; flex-direction: column; z-index: 20; backdrop-filter: blur(30px); }
.brand { display: flex; align-items: center; gap: 10px; margin: 0 12px 46px; color: var(--ink); text-decoration: none; }
.brand img { width: 37px; height: 37px; }
.brand>span { font-size: 23px; font-weight: 650; letter-spacing: .06em; }
.brand small { display: block; color: var(--muted); font-size: 10px; font-weight: 400; letter-spacing: .04em; margin-top: 2px; }
.side-nav { display: grid; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 11px 13px; border-radius: 9px; font-size: 14px; text-align: left; }
.nav-symbol { width: 19px; font-size: 24px; line-height: 1; color: var(--green); }
.side-nav .nav-item.active { background: #dcdce3; font-weight: 600; }
.nav-count { margin-left: auto; color: #82828b; font-size: 12px; font-weight: 400; }
.sidebar-bottom { margin-top: auto; }
.sidebar-bottom p { padding: 16px 13px 0; margin: 13px 0 0; border-top: 1px solid #dcdce3; color: #8a8a91; font-size: 11px; line-height: 1.9; }
.app-shell { margin-left: 216px; padding: 0 48px 60px; }
.topbar { height: 84px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); }
.topbar-actions { display: flex; gap: 14px; align-items: center; }
main { max-width: 1240px; margin: auto; }
.page-heading { margin: 40px 0 32px; display: flex; justify-content: space-between; align-items: center; gap: 22px; }
.eyebrow { font-size: 11px; color: var(--muted); letter-spacing: .05em; margin: 0 0 12px; }
h1 { font-size: clamp(26px, 2.5vw, 36px); letter-spacing: -.045em; line-height: 1.3; margin: 0; font-weight: 650; }
.intro { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
.collection-stats { display: flex; gap: 28px; flex-shrink: 0; align-items: flex-end; }
.collection-stats>div { display: flex; flex-direction: column; gap: 4px; }
.collection-stats strong { font-size: 27px; font-weight: 550; line-height: 1.2; letter-spacing: -.04em; }
.collection-stats span { color: var(--muted); font-size: 11px; }
.collection-stats .observed-species-stat strong {
  font-size: 48px;
  font-weight: 650;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.collection-stats .observed-species-stat span { white-space: nowrap; }
@media (min-width: 761px) {
  .collection-stats .observed-species-stat { order: 1; align-items: flex-start; }
}
.collection-tools { display: flex; gap: 20px; align-items: center; margin-bottom: 24px; }
.search-box { border-radius: 11px; background: #e9e9ee; padding: 0 13px; display: flex; align-items: center; gap: 9px; flex: 1; }
.search-box>span { font-size: 24px; color: #85858d; line-height: 1; }
.search-box input { background: none; border: 0; width: 100%; padding: 11px 0; font-size: 13px; outline: none; min-width: 0; }
.search-box input::placeholder { color: #8a8a94; }
.search-box:focus-within { box-shadow: 0 0 0 3px #007aff32; }
.sort-label select { border: 0; font-size: 12px; color: #686870; background: transparent; max-width: 110px; }
.filter-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.filter-bar nav { display: flex; flex-wrap: wrap; gap: 4px; }
.filter { border: 0; background: none; padding: 7px 13px; font-size: 12px; color: #787880; border-radius: 8px; white-space: nowrap; }
.filter.active { background: #fff; box-shadow: 0 1px 4px #00000012; color: var(--ink); font-weight: 600; }
.filter span { font-size: 10px; color: #8e8e96; margin-left: 4px; font-weight: 400; }
.result-line { display: flex; justify-content: space-between; margin: 18px 0; font-size: 10px; color: #909098; gap: 12px; }
.bird-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 22px; }
.bird-card { min-width: 0; position: relative; background: #fff; border-radius: 16px; box-shadow: 0 3px 14px #1d1d1f06; padding: 5px 5px 0; border: 1px solid #e8e8ee; }
.card-flip { display: block; position: relative; width: 100%; aspect-ratio: .93; perspective: 1000px; border: 0; background: none; padding: 0; border-radius: 12px; touch-action: pan-y pinch-zoom; -webkit-touch-callout: none; user-select: none; }
.card-inner { display: block; width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform .45s ease; }
.bird-card.flipped .card-inner { transform: rotateY(180deg); }
.card-face { position: absolute; inset: 0; overflow: hidden; border-radius: 12px; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: #e5e5ea; }
.card-face.back { transform: rotateY(180deg); }
.card-face img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; }
.card-status { position: absolute; top: 10px; left: 10px; font-size: 10px; color: #fff; background: #22252b75; border: 1px solid #ffffff25; padding: 3px 8px; border-radius: 6px; backdrop-filter: blur(12px); }
.card-info { padding: 13px 9px 14px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.card-info>div { min-width: 0; }
.card-info h3 { font-size: 15px; font-weight: 600; margin: 0 0 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card-info p { font-size: 10px; color: #92929b; margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-style: italic; }
.card-more { background: none; border: 0; color: #84848c; padding: 6px; font-size: 20px; }
.card-favorite { position: absolute; top: 14px; right: 14px; z-index: 2; background: #ffffffcf; backdrop-filter: blur(10px); border: 0; border-radius: 50%; width: 32px; height: 32px; font-size: 22px; color: #60606a; display: grid; place-items: center; padding: 0; }
.card-favorite.selected, .favorite-detail.selected { color: #e7a300; }
.photo-badge { position: absolute; right: 11px; bottom: 11px; border-radius: 6px; padding: 3px 7px; color: white; font-size: 10px; background: #22252b75; backdrop-filter: blur(10px); }
.uncertain-badge { position: absolute; bottom: 11px; left: 10px; font-size: 10px; padding: 3px 7px; border-radius: 6px; background: #fff3cfef; color: #946400; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.status-dot.wanted { background: var(--wanted); }
.status-dot.seen { background: var(--seen); }
.empty-state { text-align: center; padding: 70px 16px; }
.empty-art img { width: 90px; height: 90px; opacity: .7; margin: 0 0 22px; }
.empty-state h2 { font-size: 23px; font-weight: 600; margin: 0 0 14px; }
.empty-state p { color: var(--muted); font-size: 13px; line-height: 1.9; margin-bottom: 25px; }
.grid-hint { display: none; }
.bottom-nav { display: none; }
.segmented { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: #e4e4ea; flex-shrink: 0; }
.segmented button { border: 0; padding: 6px 15px; border-radius: 7px; background: none; font-size: 12px; color: #72727c; }
.segmented button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px #0001; }
.directory-search { margin-bottom: 18px; }
.alphabet-bar { display: flex; gap: 3px; flex-wrap: wrap; margin-bottom: 26px; }
.alphabet-bar button { background: none; border: 0; border-radius: 6px; padding: 5px 8px; font-size: 11px; color: #75757f; }
.alphabet-bar button.active { background: var(--green); color: #fff; }
.alphabet-bar button:disabled { opacity: .25; cursor: default; }
.directory-group h2 { font-size: 16px; margin: 26px 0 11px 3px; color: var(--muted); }
.directory-rows { border: 1px solid var(--line); border-radius: 15px; overflow: hidden; background: #fff; }
.bird-row { display: flex; gap: 14px; align-items: center; padding: 13px 17px; border: 0; border-bottom: 1px solid #eeeef2; background: #fff; width: 100%; text-align: left; }
.bird-row:last-child { border-bottom: 0; }
.bird-row:hover { background: #fafaff; }
.bird-row img { width: 48px; height: 48px; object-fit: cover; border-radius: 9px; flex-shrink: 0; }
.bird-row strong { font-size: 13px; font-weight: 550; }
.bird-row small { display: block; margin-top: 4px; font-size: 10px; color: var(--muted); }
.row-meta { margin-left: auto; color: var(--muted); font-size: 11px; text-align: right; flex-shrink: 0; }
.row-arrow { color: #b6b6bf; margin-left: 4px; }
.taxonomy-node { margin: 12px 0; }
.taxonomy-node>summary { padding: 13px 15px; border-radius: 10px; background: #e9e9ef; cursor: pointer; font-weight: 550; font-size: 13px; }
.taxonomy-node>summary small { color: var(--muted); font-size: 10px; font-weight: 400; margin-left: 8px; }
.taxonomy-children { padding-left: 18px; }
.taxonomy-children .taxonomy-node>summary { background: #eeeef2; }
.calendar-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(250px, 1fr); gap: 24px; align-items: start; }
.calendar-panel, .day-panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.calendar-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 8px; }
.calendar-toolbar h2, .day-panel h2 { font-size: 18px; margin: 0; font-weight: 600; }
.calendar-toolbar>div { display: flex; align-items: center; }
.calendar-toolbar input { width: 123px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: #f8f8fb; padding: 3px; font-size: 11px; margin-left: 5px; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); text-align: center; }
.calendar-weekdays { font-size: 11px; color: var(--muted); margin-bottom: 12px; }
.calendar-grid { gap: 6px 3px; }
.calendar-day { border: 0; background: none; border-radius: 12px; min-height: 57px; padding: 7px 2px; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 13px; }
.calendar-day.today { color: var(--green); font-weight: 700; }
.calendar-day.selected { background: var(--green); color: #fff; }
.calendar-day small { font-size: 8px; color: var(--muted); white-space: nowrap; }
.calendar-day.selected small { color: #eaf3ff; }
.calendar-day i, .calendar-legend i { background: var(--green); width: 4px; height: 4px; border-radius: 50%; }
.calendar-day.selected i { background: white; }
.calendar-legend { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); padding-top: 19px; border-top: 1px solid var(--line); margin: 18px 0 0; flex-wrap: wrap; }
.calendar-legend span { margin-left: auto; }
.day-stats { display: flex; gap: 20px; margin: 23px 0; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.day-stats strong { display: block; font-size: 23px; font-weight: 600; margin-bottom: 3px; }
.day-stats span { font-size: 10px; color: var(--muted); }
.day-panel .bird-row { padding: 13px 0; }
.day-empty, .directory-empty { padding: 35px 14px; color: var(--muted); text-align: center; font-size: 12px; }
.new-label { color: var(--green); font-size: 10px; background: #eaf3ff; border-radius: 4px; padding: 2px 4px; margin-left: 5px; }
.settings-card { background: #fff; border: 1px solid var(--line); padding: 26px; border-radius: 18px; margin: 20px 0; }
.settings-card h2 { font-size: 17px; font-weight: 600; margin: 0 0 12px; }
.settings-card p { font-size: 12px; line-height: 1.9; color: var(--muted); }
.settings-heading { display: flex; justify-content: space-between; gap: 12px; }
.profile-numbers { display: flex; gap: 50px; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 20px; }
.profile-numbers strong { display: block; font-size: 26px; color: var(--ink); font-weight: 550; }
.profile-numbers span { font-size: 11px; color: var(--muted); }
.pill { background: var(--light-green); color: var(--green); border-radius: 6px; padding: 3px 7px; font-size: 10px; height: fit-content; }
.button-row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); font-size: 11px; line-height: 1.8; }
.form-message { color: #a66b16; font-size: 12px; line-height: 1.8; margin: 12px 0; min-height: 1em; }
.toast { position: fixed; bottom: 35px; left: calc(50% + 108px); transform: translate(-50%, 12px); padding: 12px 20px; background: #28282def; color: #fff; border-radius: 13px; font-size: 12px; line-height: 1.7; z-index: 100; opacity: 0; pointer-events: none; width: max-content; max-width: min(90vw, 480px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

dialog{
  border:0;
  border-radius:25px;
  padding:28px;
  max-height:calc(100dvh - 44px);
  color:var(--ink);
  background:var(--white);
  box-shadow:0 15px 80px #24351e33;
  overflow:auto;
  overscroll-behavior:contain}
dialog::backdrop{
  background:#1c281b77;
  backdrop-filter:blur(4px)}
body:has(dialog[open]){
  overflow:hidden}
.editor-dialog{
  width:min(640px,calc(100vw - 28px))}
.dialog-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  margin-bottom:22px}
.dialog-heading h2{
  font-size:25px;
  font-family:"Songti SC",serif;
  font-weight:500;
  letter-spacing:.03em;
  margin:0}
.close-button{
  border:0;
  border-radius:50%;
  width:34px;
  height:34px;
  background:#eeefe5;
  font-size:25px;
  display:grid;
  place-items:center;
  line-height:1;
  flex-shrink:0}
.photo-upload{
  position:relative;
  display:flex;
  align-items:center;
  flex-direction:column;
  justify-content:center;
  background:#f0f2e7;
  border:1px dashed #bbc5a6;
  border-radius:17px;
  padding:22px;
  gap:8px;
  cursor:pointer;
  min-height:142px}
.photo-upload.dragging{
  outline:3px solid #9aaa80;
  background:#e4ebd4}
.photo-upload input{
  position:absolute;
  inset:0;
  opacity:0;
  cursor:pointer;
  width:100%;
  height:100%}
.photo-upload:focus-within{
  outline:3px solid #9aaa80}
.upload-symbol{
  font-size:28px;
  color:#a0b086}
.photo-upload strong{
  font-size:13px;
  font-weight:500;
  color:var(--green)}
.photo-upload small{
  font-size:10px;
  color:#969f86}
.staged-photos{
  display:flex;
  gap:9px;
  overflow:auto;
  margin:12px 0 22px;
  padding:2px}
.staged-photo{
  position:relative;
  flex:0 0 77px}
.staged-photo img{
  width:77px;
  height:92px;
  object-fit:cover;
  border-radius:10px}
.staged-photo button{
  position:absolute;
  right:3px;
  top:3px;
  border:0;
  border-radius:50%;
  background:#fcfff0dd;
  width:22px;
  height:22px;
  padding:0}
.staged-photo span{
  position:absolute;
  bottom:8px;
  left:5px;
  font-size:9px;
  color:white;
  text-shadow:0 1px 5px #000;
  background:#3b4c3977;
  border-radius:3px;
  padding:2px 4px}
.form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px 15px}
.form-grid label{
  font-size:12px;
  color:#61705a;
  display:flex;
  flex-direction:column;
  gap:8px}
.form-grid label.full-width,.full-width{
  grid-column:1/-1}
.form-grid input:not([type=checkbox]),.form-grid select,.form-grid textarea{
  width:100%;
  border:1px solid var(--line);
  background:#fcfcf7;
  border-radius:10px;
  padding:11px 12px;
  font-size:12px;
  color:var(--ink);
  min-width:0;
  line-height:1.7}
.form-grid textarea{
  resize:vertical}
.form-grid input::placeholder,.form-grid textarea::placeholder{
  color:#b0b3a4}
.required{
  font-size:9px;
  color:#aaa88a;
  position:absolute;
  margin-left:32px;
  margin-top:1px}
.lookup-box{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  justify-content:space-between;
  background:#eff2e7;
  border:1px solid #e4e9d9;
  border-radius:12px;
  padding:14px;
  gap:8px}
.lookup-box .lookup-toggle{
  flex-direction:row;
  align-items:center;
  gap:7px;
  font-size:11px}
.lookup-toggle input{
  accent-color:var(--green)}
.lookup-box p{
  flex-basis:100%;
  font-size:10px;
  color:#8b967c;
  line-height:1.7;
  margin:1px 0 0;
  white-space:pre-line}
.lookup-box .secondary{
  font-size:10px;
  padding:8px 11px}
.taxon-candidates{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  flex-basis:100%}
.taxon-candidates button{
  border:1px solid #bbc9a6;
  background:white;
  color:var(--green);
  border-radius:8px;
  text-align:left;
  font-size:11px;
  padding:8px;
  line-height:1.7}
.taxon-candidates small{
  display:block;
  font-size:10px;
  color:var(--muted)}
.observation-fields{
  border-top:1px solid var(--line);
  padding-top:18px}
.observation-fields>span{
  display:block;
  font-size:12px;
  margin-bottom:16px;
  color:var(--green)}
.observation-fields small{
  color:#a3aa95;
  font-size:10px;
  margin-left:6px}
.sticky-actions{
  position:sticky;
  bottom:-28px;
  background:#fffefaed;
  backdrop-filter:blur(8px);
  display:flex;
  justify-content:flex-end;
  gap:9px;
  padding:15px 0 8px;
  border-top:1px solid var(--line);
  z-index:1;
  margin-top:22px}
.storage-note{
  font-size:9px;
  color:#9da48d;
  text-align:center;
  line-height:1.8;
  margin:14px 0 0}
.source-box{
  margin:20px 0 10px;
  padding:13px 15px;
  border:1px solid var(--line);
  border-radius:11px;
  font-size:10px;
  color:#7d8970;
  line-height:1.8;
  overflow-wrap:anywhere}
.source-box h3{
  font-size:11px;
  margin:0 0 7px;
  font-weight:500}
.source-box a{
  margin-right:9px;
  display:inline-block}
.source-box p{
  margin:5px 0;
  white-space:pre-line}
.detail-dialog{
  position:relative;
  width:min(750px,calc(100vw - 28px));
  padding:0}
.detail-close{
  position:absolute;
  right:14px;
  top:14px;
  z-index:5;
  background:#fffff4e6}
.detail-gallery{
  height:min(53vh,440px);
  position:relative;
  background:#e8ebdf}
.gallery-image-button{
  width:100%;
  height:100%;
  border:0;
  background:none;
  padding:0;
  display:block;
  overflow:hidden;
  cursor:zoom-in}
.gallery-image-button img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block}
.gallery-arrow{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  background:#f9fcf0df;
  border:0;
  border-radius:50%;
  width:33px;
  height:33px;
  font-size:25px;
  line-height:1}
.gallery-arrow.previous{
  left:14px}
.gallery-arrow.next{
  right:14px}
.gallery-count{
  position:absolute;
  bottom:14px;
  right:16px;
  border-radius:8px;
  background:#29382ecc;
  color:white;
  font-size:10px;
  padding:5px 9px}
.detail-body{
  padding:26px 30px}
.detail-heading{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px}
.detail-heading h2{
  font-family:"Songti SC",serif;
  font-size:29px;
  font-weight:500;
  margin:7px 0}
.latin-name{
  font-family:Georgia,serif;
  font-size:12px;
  font-style:italic;
  color:#929a84;
  margin:0;
  overflow-wrap:anywhere}
.detail-group{
  display:flex;
  gap:8px;
  margin:21px 0}
.detail-group button{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  border:1px solid var(--line);
  background:transparent;
  border-radius:10px;
  padding:9px 21px;
  font-size:12px}
.detail-group button.selected{
  border-color:#c4d1b2;
  background:#edf2e4;
  color:var(--green)}
.photo-tools{
  display:flex;
  justify-content:space-between;
  border-bottom:1px solid var(--line);
  padding-bottom:12px}
.photo-manager{
  border:1px solid #e2e8d8;
  padding:12px;
  border-radius:10px;
  margin-top:10px;
  background:#f4f6ed}
.photo-manager p{
  font-size:10px;
  color:#939d82;
  margin:0 0 9px}
.danger-text{
  border:0;
  background:none;
  color:#b87660;
  padding:8px 0;
  font-size:11px}
.detail-facts{
  margin:8px 0 0}
.detail-facts>div{
  display:grid;
  grid-template-columns:80px minmax(0,1fr);
  gap:14px;
  border-bottom:1px solid #eceee4;
  padding:15px 0}
.detail-facts dt{
  font-size:11px;
  color:#98a087;
  line-height:1.9}
.detail-facts dd{
  margin:0;
  font-size:12px;
  line-height:1.9;
  color:#57634e;
  white-space:pre-line;
  overflow-wrap:anywhere}
.detail-bottom{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:18px;
  margin-top:18px}
.detail-bottom .muted{
  font-size:9px}
.image-dialog{
  width:min(920px,calc(100vw - 24px));
  padding:23px}
.original-image{
  display:block;
  max-height:62vh;
  max-width:100%;
  object-fit:contain;
  margin:auto;
  background:#eef0e6;
  min-height:80px}
.image-dialog details{
  margin-top:20px;
  border-top:1px solid var(--line);
  padding-top:16px}
.image-dialog summary{
  font-size:12px;
  color:var(--green);
  cursor:pointer}
.crop-layout{
  display:flex;
  gap:24px;
  align-items:center;
  margin-top:18px}
.crop-viewport{
  width:154px;
  aspect-ratio:.79;
  overflow:hidden;
  border-radius:12px;
  flex-shrink:0;
  touch-action:none;
  cursor:move;
  border:1px solid #9dab85}
.crop-viewport img{
  width:100%;
  height:100%;
  object-fit:cover;
  user-select:none;
  pointer-events:none}
.crop-sliders{
  flex:1}
.crop-sliders p{
  font-size:10px;
  color:var(--muted);
  line-height:1.8}
.crop-sliders label{
  display:flex;
  font-size:11px;
  color:var(--green);
  gap:12px;
  margin:15px 0}
.crop-sliders input{
  width:100%;
  accent-color:var(--green)}
.confirm-dialog{
  width:min(380px,calc(100vw - 34px));
  padding:25px}
.confirm-dialog h2{
  font-size:18px;
  font-weight:500;
  margin:0 0 13px}
.confirm-dialog p{
  font-size:12px;
  color:var(--muted);
  line-height:1.9;
  white-space:pre-line;
  margin-bottom:24px}
.confirm-dialog .button-row{
  justify-content:flex-end}
/* Shared sheets and photo controls */
dialog { background: #fff; box-shadow: 0 24px 100px #0003; }
dialog::backdrop { background: #20202755; backdrop-filter: blur(8px); }
.dialog-heading h2, .detail-heading h2 { font-family: inherit; font-weight: 600; letter-spacing: -.03em; }
.close-button { background: #eeeef3; color: #82828b; }
.photo-upload, .lookup-box { background: #f5f7fb; border-color: #e1e5ee; }
.photo-upload small, .lookup-box p { color: #777782; }
.form-grid label, .observation-fields>span, .detail-facts dd { color: #4e4e58; }
.form-grid input:not([type=checkbox]), .form-grid select, .form-grid textarea { background: #fafafa; border-color: #dddde5; font-size: 13px; }
.form-grid input::placeholder, .form-grid textarea::placeholder { color: #a0a0a9; }
.sticky-actions { background: #fffffff0; }
.source-box, .detail-facts dt { color: #86868f; }
.source-box { background: #fafafa; }
.detail-gallery { background: #ededf2; }
.detail-heading { flex-wrap: wrap; }
.detail-heading>div { flex: 1; }
.detail-group button.selected { background: #eaf3ff; border-color: #bedcff; }
.photo-manager { background: #f7f7fa; border-color: var(--line); }
.danger-text { color: #e04d45; }
.favorite-detail { border: 0; background: #f5f5f7; border-radius: 10px; font-size: 26px; width: 40px; height: 36px; line-height: 1; }
.photo-thumbnails { display: flex; gap: 8px; overflow: auto; margin: 22px 0 17px; padding: 3px; }
.photo-thumb { border: 2px solid transparent; padding: 2px; border-radius: 10px; background: none; position: relative; flex-shrink: 0; }
.photo-thumb.selected { border-color: var(--green); }
.photo-thumb img { width: 62px; height: 62px; object-fit: cover; border-radius: 6px; display: block; }
.photo-thumb span { position: absolute; right: 5px; bottom: 5px; border-radius: 4px; background: #ffedba; color: #946400; font-size: 9px; padding: 0 4px; }
.photo-annotation { background: #f6f6f9; padding: 14px; border-radius: 12px; margin: 14px 0; }
.check-label { display: flex; gap: 8px; align-items: center; font-size: 12px; }
.check-label input { accent-color: #eba800; width: 16px; height: 16px; }
.annotation-row { display: flex; gap: 8px; margin-top: 12px; }
.annotation-row input { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: white; font-size: 12px; }
.annotation-row button { white-space: nowrap; }
.photo-annotation p { margin: 9px 0 0; font-size: 9px; }
.crop-viewport { aspect-ratio: .93; }
@media (min-width: 1600px) { .bird-grid { grid-template-columns: repeat(4,minmax(0,1fr)); } }
@media (max-width: 1100px) {
  .sidebar { width: 185px; padding-left: 12px; padding-right: 12px; }
  .app-shell { margin-left: 185px; padding-left: 28px; padding-right: 28px; }
  .collection-stats { gap: 19px; }
  .page-heading { gap: 18px; }
  .calendar-layout { grid-template-columns: 1fr; }
  .toast { left: calc(50% + 92px); }
}
@media (max-width: 760px) {
  .sidebar { display: none; }
  .app-shell { margin-left: 0; padding: 0 20px 115px; }
  .topbar { height: 72px; }
  .topbar-actions { gap: 5px; }
  .page-heading { margin: 29px 0 26px; flex-wrap: wrap; }
  h1 { font-size: 28px; }
  .collection-stats { width: 100%; padding-top: 19px; border-top: 1px solid var(--line); gap: 0; }
  .collection-stats>div { flex: 1; }
  .collection-stats strong { font-size: 25px; }
  .collection-stats .observed-species-stat strong { font-size: clamp(28px, 8vw, 36px); }
  .eyebrow { font-size: 10px; }
  .intro { font-size: 12px; }
  .bird-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px 12px; }
  .bird-card { border-radius: 14px; padding: 4px 4px 0; }
  .card-info { padding: 10px 6px 12px; }
  .card-info h3 { font-size: 13px; }
  .card-info p { font-size: 9px; }
  .card-favorite { width: 29px; height: 29px; top: 11px; right: 11px; font-size: 20px; }
  .card-status { left: 8px; top: 9px; font-size: 9px; padding: 3px 6px; }
  .photo-badge, .uncertain-badge { font-size: 8px; }
  .collection-tools { gap: 8px; margin-bottom: 18px; }
  .search-box input { font-size: 12px; }
  .sort-label select { max-width: 90px; font-size: 11px; }
  .filter-bar { gap: 0; }
  .filter { padding: 6px 9px; font-size: 11px; }
  .filter span { margin-left: 2px; font-size: 9px; }
  #flipAll { font-size: 0; padding: 6px; }
  #flipAll::after { content: '↻'; font-size: 18px; }
  .result-line { font-size: 9px; }
  .bottom-nav { position: fixed; bottom: calc(13px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: 266px; height: 64px; background: #fdfdffdb; backdrop-filter: blur(24px); border: 1px solid #fff; border-radius: 23px; box-shadow: 0 5px 30px #24243415; display: flex; align-items: center; padding: 6px; z-index: 20; }
  .bottom-nav .nav-item { flex: 1; flex-direction: column; gap: 2px; padding: 5px 10px; font-size: 10px; color: #93939c; text-align: center; }
  .bottom-nav .nav-item span { font-size: 24px; line-height: 1.1; }
  .bottom-nav .nav-item.active { color: var(--green); }
  .toast { left: 50%; bottom: 100px; }
  .empty-state { padding-top: 42px; }
  .calendar-panel, .day-panel { padding: 19px 15px; }
  .calendar-toolbar h2 { font-size: 17px; }
  .calendar-day { min-height: 54px; }
  .calendar-grid { gap: 4px 1px; }
  .calendar-day small { font-size: 7px; }
  .calendar-layout { gap: 18px; }
  .editor-dialog { padding: 24px 18px; }
  .form-grid { gap: 17px 11px; }
  .form-grid input:not([type=checkbox]), .form-grid select, .form-grid textarea { padding: 10px; font-size: 16px; }
  .dialog-heading h2 { font-size: 23px; }
  .sticky-actions { bottom: -24px; }
  .detail-body { padding: 22px 19px; }
  .detail-heading h2 { font-size: 27px; }
  .detail-facts>div { grid-template-columns: 65px minmax(0,1fr); gap: 9px; }
  .detail-bottom { align-items: flex-start; }
  .crop-layout { gap: 14px; }
  .crop-viewport { width: 118px; }
  .crop-sliders label { margin: 11px 0; }
  .image-dialog { padding: 18px 15px; }
  .profile-numbers { gap: 36px; }
  .bird-row { padding: 12px; gap: 10px; }
  .row-meta { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .card-inner { transform-style: flat; }
  .bird-card.flipped .card-inner { transform: none; }
  .card-face.back { transform: none; display: none; }
  .bird-card.flipped .card-face.front { display: none; }
  .bird-card.flipped .card-face.back { display: block; }
}

.nav-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; color: var(--green); }
.bottom-nav .nav-icon { width: 23px; height: 23px; color: inherit; }

.photo-filter { margin-top: 20px; width: fit-content; }
.photo-filter + .photo-thumbnails { margin-top: 10px; }

.day-panel { scroll-margin-top: 20px; }

.photo-placeholder {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  background: #eef0f5;
  color: #9295a1;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .02em;
}
.photo-placeholder img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  opacity: .45;
}
.gallery-image-button.empty-gallery { cursor: pointer; }
.gallery-image-button.empty-gallery .photo-placeholder { gap: 18px; font-size: 14px; }
.gallery-image-button.empty-gallery .photo-placeholder img { width: 88px; height: 88px; }
.bird-row .row-photo-placeholder { background: #eef0f5; padding: 11px; opacity: .6; }
@media (max-width: 760px) {
  .card-face .photo-placeholder { gap: 11px; font-size: 10px; }
  .card-face .photo-placeholder img { width: 50px; height: 50px; }
}

.creator-credit { text-align: right; }
