:root{
  --bg:#0f1c15; --bg-2:#16281e; --card:#1b3226; --line:#2a4735;
  --ink:#eaf3ec; --ink-2:#9fb8a8; --ink-3:#6d8b79;
  --accent:#7fd6a0; --accent-ink:#0f1c15;
  --warn:#e8b04b; --danger:#e0705f; --kakao:#fee500;
  --tab-h:64px;
  font-family:system-ui,-apple-system,"Segoe UI","Malgun Gothic",sans-serif;
}
*{box-sizing:border-box;margin:0;padding:0}

/* hidden 속성은 항상 이겨야 한다.
   클래스에 display 를 지정하면(예: .cam-fallback{display:grid}) 작성자 스타일이
   브라우저 기본 [hidden]{display:none} 을 눌러버려서, JS 로 el.hidden=true 를 해도
   요소가 그대로 보인다. 실제로 카메라 미리보기가 안내창에 가려지는 버그가 있었다. */
[hidden]{display:none !important}
html,body{height:100%}
body{
  background:var(--bg); color:var(--ink);
  -webkit-font-smoothing:antialiased;
  overscroll-behavior-y:none;
}
button,input,select{font:inherit;color:inherit}
button{cursor:pointer;border:none;background:none}

#app{max-width:520px;margin:0 auto;min-height:100%;position:relative}

.view{display:none;padding-bottom:calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px)}
.view.on{display:block}

/* ── 상단바 ─────────────────────────────────────────── */
.topbar{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:14px 16px 10px; position:sticky; top:0; z-index:20;
  background:linear-gradient(var(--bg) 70%, transparent);
}
.topbar h2{font-size:19px;font-weight:650;letter-spacing:-.01em}
.icon-btn{
  width:38px;height:38px;border-radius:12px;font-size:18px;
  background:var(--card);color:var(--ink);display:grid;place-items:center;
}
.icon-btn.ghost{background:none;visibility:hidden}
.badge{
  font-size:12px;padding:4px 10px;border-radius:999px;
  background:var(--card);color:var(--ink-2);white-space:nowrap;
}
.badge-ok{background:#1e4130;color:var(--accent)}
.badge-warn{background:#3b3115;color:var(--warn)}
.badge-empty{background:#3d2320;color:var(--danger)}
.badge-row{display:flex;gap:6px;align-items:center}
/* 배지 자리에 들어가는 행동 버튼 (앱으로 설치) */
.badge-cta{
  background:var(--accent);color:var(--accent-ink);font-weight:650;
  border:none;cursor:pointer;
}
.badge-cta:active{opacity:.75}

/* min-width:0 이 없으면 그리드 칸 안에서 줄어들지 못해 화면 밖으로 넘친다 */
.row-inline{display:flex;gap:8px;align-items:center;min-width:0}
.row-inline input{
  flex:1;min-width:0;padding:12px;border-radius:14px;
  border:1px solid var(--line);background:var(--bg-2);
}
.row-inline input:focus{outline:2px solid var(--accent);outline-offset:-1px}
/* .btn 의 width:100% 를 이겨야 한다 — 이 규칙이 파일에서 .btn 보다 앞에 있으므로
   클래스 두 개로 특정성을 올린다. */
.btn.btn-inline{width:auto;flex:0 0 auto;padding:12px 16px;white-space:nowrap}

.reasons{display:flex;flex-wrap:wrap;gap:8px}
.reasons .chip{cursor:pointer}

/* 지도 시트 안의 작성자 줄 */
.sheet-user{
  display:flex;align-items:center;gap:8px;margin-top:12px;
  padding-top:12px;border-top:1px solid var(--line);
}
.sheet-user .who{flex:1;min-width:0;font-size:14px}
.icon-btn.small{width:32px;height:32px;font-size:14px;border-radius:10px}
.select{background:var(--card);border:none;border-radius:10px;padding:7px 10px;font-size:13px}

.hint{color:var(--ink-3);font-size:13px;line-height:1.55}
.hint.center{text-align:center;padding:0 24px 8px}
.section-h{font-size:14px;color:var(--ink-3);padding:22px 16px 10px;font-weight:600}

/* ── 버튼 ───────────────────────────────────────────── */
.btn{
  display:block;width:100%;padding:14px;border-radius:14px;
  font-size:15px;font-weight:600;transition:opacity .15s;
}
.btn:active{opacity:.7}
.btn-primary{background:var(--accent);color:var(--accent-ink)}
.btn-ghost{background:var(--card);color:var(--ink)}
.btn-kakao{background:var(--kakao);color:#191600}
.btn.wide{margin:16px}

/* ── 로그인 ─────────────────────────────────────────── */
#view-auth,#view-setup{display:none;padding:0}
#view-auth.on,#view-setup.on{
  display:flex;flex-direction:column;justify-content:center;min-height:100vh;
}
#view-setup .auth-box input{
  width:100%;padding:13px;border-radius:14px;border:1px solid var(--line);
  background:var(--bg-2);font-size:14px;
}
#view-setup .auth-box input:focus{outline:2px solid var(--accent);outline-offset:-1px}
.linkish{
  background:none;color:var(--ink-3);font-size:13px;
  text-decoration:underline;padding:4px;justify-self:start;
}
.auth-hero{text-align:center;padding:0 24px 34px}
.leaf-mark{font-size:52px;line-height:1}
.auth-hero h1{font-size:31px;letter-spacing:-.02em;margin:10px 0 8px}
.tag{color:var(--ink-2);font-size:15px;line-height:1.6}
.auth-box{padding:0 24px;display:grid;gap:10px}
.divider{display:flex;align-items:center;gap:12px;color:var(--ink-3);font-size:12px;margin:6px 0}
.divider::before,.divider::after{content:"";flex:1;height:1px;background:var(--line)}
#form-magic{display:grid;gap:10px}
#email{
  width:100%;padding:14px;border-radius:14px;border:1px solid var(--line);
  background:var(--bg-2);
}
#email:focus{outline:2px solid var(--accent);outline-offset:-1px}

/* ── 카메라 ─────────────────────────────────────────── */
/* 촬영 화면은 스크롤 없이 한 화면에 들어와야 한다. 카메라가 남는 공간을 먹고,
   셔터 버튼은 항상 보이게. (고정 aspect-ratio 를 쓰면 작은 폰에서 셔터가 밀려난다.) */
#view-capture.on{
  display:flex;flex-direction:column;
  height:100vh;height:100dvh;
  padding-bottom:calc(var(--tab-h) + env(safe-area-inset-bottom));
}
.camera-stage{
  position:relative;margin:0 16px;border-radius:20px;
  background:#000;flex:1;min-height:140px;
  /* overflow:hidden 을 쓰지 않는다. 안드로이드 계열 브라우저에서 하드웨어 합성된
     <video> 레이어가 부모의 라운딩 클리핑에 걸려 아예 그려지지 않는 사례가 있다
     (캡처는 캔버스 경로라 멀쩡해서, 미리보기만 검게 보인다).
     대신 자식 요소에 각자 라운딩을 준다. */
  isolation:isolate;
}
#cam{
  width:100%;height:100%;object-fit:cover;display:block;
  border-radius:20px;background:#000;
}
.cam-fallback{
  position:absolute;inset:0;display:grid;place-content:center;gap:8px;
  text-align:center;padding:24px;background:var(--card);border-radius:20px;
}
.frame-guide{
  position:absolute;inset:14%;border:2px dashed rgba(127,214,160,.45);
  border-radius:16px;pointer-events:none;
}
.cam-diag{
  position:absolute;left:8px;right:8px;top:8px;z-index:5;
  margin:0;padding:8px;border-radius:10px;
  background:rgba(0,0,0,.72);color:#7fd6a0;
  font:11px/1.5 ui-monospace,Menlo,Consolas,monospace;
  white-space:pre-wrap;pointer-events:none;
}
.organ-row{display:flex;gap:8px;overflow-x:auto;padding:14px 16px 4px;scrollbar-width:none}
.organ-row::-webkit-scrollbar{display:none}
.chip{
  padding:8px 15px;border-radius:999px;background:var(--card);
  color:var(--ink-2);font-size:14px;white-space:nowrap;
}
.chip-on{background:var(--accent);color:var(--accent-ink);font-weight:600}
.shutter-row{display:flex;align-items:center;justify-content:space-between;padding:14px 40px 8px}
.shutter{
  width:72px;height:72px;border-radius:50%;background:var(--accent);
  box-shadow:0 0 0 5px var(--bg), 0 0 0 8px var(--accent);
}
.shutter:active{transform:scale(.93)}
.shutter:disabled{background:var(--ink-3);box-shadow:0 0 0 5px var(--bg),0 0 0 8px var(--ink-3)}

/* 찍은 장면이 분석 띠로 날아가는 복제본과 셔터 번쩍임 (app.js flyToBanner) */
.shot-fly,.shot-flash{position:fixed;z-index:70;pointer-events:none;border-radius:20px}
.shot-fly{transform-origin:center;box-shadow:0 10px 30px rgba(0,0,0,.55)}
.shot-flash{background:#fff;z-index:71}

/* ── 판별 결과 ──────────────────────────────────────── */
.result-photo{margin:0 16px;border-radius:18px;overflow:hidden;background:var(--card)}
/* 방금 찍은 사진을 검토하는 화면이므로 자르지 않는다 — 찍은 그대로 보여야 한다.
   (도감 그리드·썸네일은 격자 정렬을 위해 잘라도 되지만 여기는 아니다.) */
.result-photo img{width:100%;height:auto;display:block;max-height:62vh;object-fit:contain}
.status{padding:16px;text-align:center;color:var(--ink-2);font-size:14px}
.cand-list{list-style:none;padding:0 16px;display:grid;gap:10px}
.cand{
  display:flex;align-items:center;gap:12px;width:100%;text-align:left;
  padding:14px;border-radius:16px;background:var(--card);border:1px solid transparent;
}
.cand:active{border-color:var(--accent)}
.cand-main{flex:1;min-width:0}
.cand-kor{font-size:16px;font-weight:650}
.cand-sci{font-size:12.5px;color:var(--ink-3);font-style:italic;margin-top:2px}
.cand-sum{font-size:13px;color:var(--ink-2);margin-top:5px;line-height:1.5}
.cand-score{
  font-size:13px;font-weight:700;padding:6px 10px;border-radius:10px;
  background:#1e4130;color:var(--accent);white-space:nowrap;
}
.cand-score.low{background:#3b3115;color:var(--warn)}
.result-meta{padding:14px 16px;display:grid;gap:6px;color:var(--ink-3);font-size:13px}

/* ── 종 상세 ────────────────────────────────────────── */
.species-body{padding:0 16px;display:grid;gap:16px}
.species-hero{width:100%;border-radius:18px;aspect-ratio:1;object-fit:cover;background:var(--card)}
.species-sci{font-style:italic;color:var(--ink-3);font-size:14px}
.species-desc{line-height:1.75;font-size:15px;color:var(--ink)}
.kv{display:grid;grid-template-columns:78px 1fr;gap:8px 12px;font-size:14px}
.kv dt{color:var(--ink-3)}
.shots{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.shots img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:10px}

/* 남이 찍은 사진 — 누가 찍었는지와 신고 버튼이 함께 붙는다 */
.others{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.other-shot{position:relative;border-radius:10px;overflow:hidden}
.other-shot img{width:100%;aspect-ratio:1;object-fit:cover;display:block;cursor:pointer}
.other-who{
  position:absolute;left:0;right:0;bottom:0;padding:14px 6px 5px;
  font-size:11px;line-height:1.2;cursor:pointer;
  background:linear-gradient(transparent,rgba(0,0,0,.82));
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.other-flag{
  position:absolute;top:4px;right:4px;width:26px;height:26px;border-radius:8px;
  background:rgba(0,0,0,.55);color:var(--ink-2);font-size:13px;line-height:26px;
  text-align:center;padding:0;
}
.other-flag:active{background:var(--danger);color:#fff}

/* ── 도감 그리드 ────────────────────────────────────── */
.dex-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;padding:0 16px}
.dex-cell{
  border-radius:16px;overflow:hidden;background:var(--card);
  aspect-ratio:3/4;position:relative;display:block;text-align:left;
}
.dex-cell img{width:100%;height:100%;object-fit:cover;display:block}
.dex-name{
  position:absolute;left:0;right:0;bottom:0;padding:16px 8px 7px;
  font-size:12px;font-weight:600;line-height:1.3;
  background:linear-gradient(transparent,rgba(0,0,0,.82));
}
.dex-grid.locked .dex-cell{
  display:grid;place-content:center;background:var(--bg-2);
  border:1px dashed var(--line);
  /* 칸 너비는 이름 길이가 정한다. .dex-cell 이 text-align:left 라서, 이걸
     덮지 않으면 아이콘이 그 넓은 칸 안에서 왼쪽에 붙어 이름마다 위치가 달라진다. */
  justify-items:center;text-align:center;
}
.dex-lock-mark{font-size:26px;filter:grayscale(1) brightness(.5)}
.dex-lock-name{font-size:11px;color:var(--ink-3);text-align:center;padding:6px 6px 0}
.empty{padding:40px 24px;text-align:center;color:var(--ink-3);font-size:14px;line-height:1.7}

/* ── 지도 ───────────────────────────────────────────── */
.view-map.on{
  display:flex;flex-direction:column;
  height:100vh;height:100dvh;           /* dvh: 모바일 주소창 접힘 대응 */
  /* 탭바가 fixed 라 그만큼 비워두지 않으면 지도 아래쪽이 가려진다 */
  padding-bottom:calc(var(--tab-h) + env(safe-area-inset-bottom));
}
#map{
  flex:1;min-height:0;background:var(--bg-2);
  /* Leaflet 은 내부 pane 에 z-index 200~1000 을 쓴다. #map 이 자체 쌓임 맥락을
     만들지 않으면 그 값들이 탭바(z-index:40)와 같은 층에서 경쟁해 탭바를 덮는다. */
  position:relative;z-index:0;
}
/* absolute 로 두면 문서 기준이라 긴 페이지에서는 화면 밖에 열린다.
   fixed 여야 어디서 열든 화면 아래에 붙는다. */
.map-sheet{
  position:fixed;left:0;right:0;bottom:0;
  background:var(--card);border-radius:20px 20px 0 0;
  padding:16px 16px calc(16px + env(safe-area-inset-bottom));
  box-shadow:0 -8px 28px rgba(0,0,0,.45);z-index:50;
  max-height:88vh;overflow-y:auto;
  animation:sheet-up .16s ease-out;
}
@keyframes sheet-up{from{transform:translateY(14px);opacity:.6}to{transform:none;opacity:1}}
.sheet-veil{position:fixed;inset:0;z-index:45;background:rgba(0,0,0,.55)}
.chip.tiny{font-size:12px;padding:4px 9px}
.map-sheet .row{display:flex;gap:12px;align-items:center}
.map-sheet img{width:64px;height:64px;border-radius:12px;object-fit:cover}
/* 시트 안의 큰 사진들은 위 썸네일 규칙(64px)에 눌리지 않게 한 단계 더 구체적으로 쓴다 */
.map-sheet .card-preview{width:100%;height:auto;object-fit:contain}
.map-sheet .shared-photo{width:100%;height:auto;max-height:52vh;object-fit:cover}
.map-sheet .treasure-photo{width:100%;height:220px;object-fit:cover}

/* Leaflet 다크 보정 */
.leaflet-container{background:var(--bg-2);font:inherit}
.leaflet-control-attribution{
  background:rgba(15,28,21,.82) !important;color:var(--ink-3) !important;font-size:10px;
}
.leaflet-control-attribution a{color:var(--ink-2)}
.leaflet-bar a{background:var(--card);color:var(--ink);border-bottom-color:var(--line)}
.leaflet-bar a:hover{background:var(--line);color:var(--ink)}

/* ── 나 ─────────────────────────────────────────────── */
.me-box{padding:8px 16px;display:grid;gap:14px}
.me-nick{font-size:20px;font-weight:650}
.field{display:grid;gap:6px}
.select.wide{width:100%;padding:13px;border-radius:14px}

/* ── 탭바 ───────────────────────────────────────────── */
.tabbar{
  position:fixed;left:0;right:0;bottom:0;z-index:40;
  max-width:520px;margin:0 auto;
  display:grid;grid-template-columns:repeat(4,1fr);
  height:calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom:env(safe-area-inset-bottom);
  background:var(--bg-2);border-top:1px solid var(--line);
}
.tab{
  display:grid;place-items:center;align-content:center;gap:3px;
  font-size:11px;color:var(--ink-3);padding:0 2px;
}
.tab span{font-size:20px;line-height:1}
.tab em{font-style:normal;line-height:1.1;text-align:center}
.tab-on{color:var(--accent)}
.tabbar[hidden]{display:none}

/* ── 토스트 ─────────────────────────────────────────── */
.toast{
  position:fixed;left:50%;transform:translateX(-50%);
  bottom:calc(var(--tab-h) + 24px);z-index:60;
  background:var(--card);border:1px solid var(--line);
  padding:12px 18px;border-radius:14px;font-size:14px;max-width:88vw;
  box-shadow:0 8px 24px rgba(0,0,0,.5);
}

/* ── 스피너 ─────────────────────────────────────────── */
.spin{
  width:18px;height:18px;border-radius:50%;display:inline-block;vertical-align:-3px;
  border:2px solid var(--line);border-top-color:var(--accent);
  animation:spin .8s linear infinite;margin-right:8px;
}
@keyframes spin{to{transform:rotate(360deg)}}

@media (prefers-reduced-motion:reduce){
  *{animation-duration:.01ms !important;transition-duration:.01ms !important}
}

/* ── 관리자 검토 목록 ─────────────────────────────────── */
.admin-list{display:grid;gap:10px}
.admin-row{
  display:flex;gap:10px;align-items:flex-start;
  background:var(--card);border:1px solid var(--line);
  border-radius:14px;padding:10px;
}
.admin-row img{
  width:64px;height:64px;flex:0 0 64px;
  object-fit:cover;border-radius:10px;background:var(--bg-2);
}
.admin-info{flex:1;min-width:0;display:grid;gap:2px}
.admin-info strong{font-size:14px;overflow-wrap:anywhere}
.admin-acts{display:grid;gap:6px;flex:0 0 auto}
.admin-acts .btn{padding:8px 12px;font-size:13px}

/* ── 이름 제안 ────────────────────────────────────────── */
.name-ask{
  display:grid;gap:8px;padding:12px;border-radius:14px;
  background:var(--bg-2);border:1px solid var(--line);
}
.name-chips{display:flex;flex-wrap:wrap;gap:6px}
.name-chips:empty{display:none}

/* ── 안내 띠 ──────────────────────────────────────────── */
.ticker{
  overflow:hidden;margin:0 16px 8px;padding:7px 0;
  border-top:1px solid var(--line);border-bottom:1px solid var(--line);
  /* 양 끝을 흐리게 해서 글자가 잘리는 대신 사라지도록 */
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 20px,#000 calc(100% - 20px),transparent);
          mask-image:linear-gradient(90deg,transparent,#000 20px,#000 calc(100% - 20px),transparent);
}
.ticker-track{
  display:flex;width:max-content;
  animation:ticker-roll var(--ticker-dur,40s) linear infinite;
}
.ticker-track span{white-space:pre;font-size:13px;color:var(--ink-2)}
.ticker:active .ticker-track{animation-play-state:paused}
@keyframes ticker-roll{from{transform:translateX(0)}to{transform:translateX(-50%)}}

/* 움직임을 줄이라는 설정이면 흐르는 대신 한 문장씩 바꿔 보여준다 (app.js) */
@media (prefers-reduced-motion: reduce){
  .ticker-track{animation:none;width:100%}
  .ticker-track span{white-space:normal}
}

/* ── 지도 상태 표시 ───────────────────────────────────── */
.map-wrap{position:relative;flex:1;min-height:0;display:flex}
.map-wrap #map{flex:1;min-height:0}
.map-status{
  position:absolute;left:12px;right:12px;top:12px;z-index:500;
  background:rgba(15,28,21,.88);border:1px solid var(--line);
  border-radius:12px;padding:8px 12px;font-size:13px;color:var(--ink-2);
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
  pointer-events:none;
}
.map-here{
  position:absolute;right:12px;bottom:16px;z-index:500;
  background:var(--card);border:1px solid var(--line);color:var(--ink);
  border-radius:999px;padding:9px 14px;font-size:13px;font-weight:600;
}
#exit-sheet .row{display:flex}
#exit-sheet .btn{flex:1}

/* ── 사진 시트 (좋아요·댓글) ─────────────────────────── */
.photo-full{
  width:100%;max-height:46vh;object-fit:contain;
  border-radius:14px;background:var(--bg-2);
}
.photo-bar{display:flex;align-items:center;gap:8px;margin:10px 0;flex-wrap:wrap}
.photo-bar .hint{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.comment-list{
  display:grid;gap:8px;max-height:32vh;overflow-y:auto;
  margin-bottom:10px;padding-right:2px;
}
.comment{display:flex;gap:8px;align-items:flex-start}
.comment-body{flex:1;min-width:0;font-size:14px;line-height:1.5;overflow-wrap:anywhere}
.comment-who{color:var(--ink-3);font-size:13px;margin-right:6px}
.map-wrap{isolation:isolate}

/* ── 종 사진첩 ────────────────────────────────────────── */
.gallery{
  display:flex;overflow-x:auto;scroll-snap-type:x mandatory;
  gap:0;border-radius:14px;background:var(--bg-2);
  scrollbar-width:none;-webkit-overflow-scrolling:touch;
}
.gallery::-webkit-scrollbar{display:none}
/* 사진과 한 줄 평이 한 칸(58vh)을 나눠 쓴다. 가로 사진이면 원래 비던 아래쪽에 글이 들어간다. */
.slide{position:relative;flex:0 0 100%;scroll-snap-align:center;
  height:58vh;display:flex;flex-direction:column}
.slide img{width:100%;flex:1;min-height:0;object-fit:contain;display:block}
/* 한 줄 평이 있으면 사진은 제 비율 높이만 차지하고(세로 사진은 줄어든다), 글이 남는 칸 가운데에 온다 */
.slide:has(.slide-note:not([hidden])) img{flex:0 1 auto;height:auto;max-height:100%}
.slide-note{flex:1;min-height:3.2em;margin:0;padding:10px 18px;display:flex;align-items:center;
  justify-content:center;text-align:center;font-size:15px;font-style:italic;line-height:1.5;color:var(--ink)}
.slide-badge,.slide-who{
  position:absolute;top:10px;font-size:12px;font-weight:600;
  padding:5px 10px;border-radius:999px;
  background:rgba(15,28,21,.78);color:var(--ink);
  max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.slide-badge{left:10px;color:#f4d67a}
.slide-who{right:10px}
.gallery-dots{display:flex;justify-content:center;gap:6px;padding:8px 0 2px;flex-wrap:wrap}
.gallery-dots i{
  width:6px;height:6px;border-radius:999px;background:var(--line);
  transition:background .15s, width .15s;
}
.gallery-dots i.on{background:var(--accent);width:18px}

/* ── 겹친 핀 목록 ─────────────────────────────────────── */
.pick-list{display:grid;gap:8px;max-height:52vh;overflow-y:auto}
.pick-row{display:flex;gap:10px;align-items:center;text-align:left;width:100%}
.pick-row img{
  width:52px;height:52px;flex:0 0 52px;
  object-fit:cover;border-radius:10px;background:var(--bg-2);
}
.pick-info{flex:1;min-width:0;display:grid;gap:2px}
.pick-name{font-weight:600;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Leaflet 축척 막대 다크 보정 */
.leaflet-control-scale-line{
  background:rgba(15,28,21,.82);border-color:var(--line);
  color:var(--ink-2);font-size:11px;
}
.leaflet-control-scale-line:not(:first-child){border-top-color:var(--line)}

/* ── 카메라 줌 ────────────────────────────────────────── */
.zoom-row{display:flex;align-items:center;gap:10px;padding:10px 16px 0}
.zoom-row input[type=range]{flex:1;min-width:0;accent-color:var(--accent)}
.zoom-btn{
  width:34px;height:34px;border-radius:12px;background:var(--card);
  color:var(--ink);font-size:18px;font-weight:700;line-height:1;
}
/* 확대 중에만 잘라낸다 — 평소에 라운딩 클리핑을 걸지 않기 위해서다
   (camera.js 의 applyDigital 주석 참고). */
.camera-stage.zooming{overflow:hidden}

/* ── 동의 · 문서 ──────────────────────────────────────── */
.consent-facts{display:grid;gap:8px;margin-bottom:6px;padding-left:18px}
.consent-facts li{font-size:13px;line-height:1.6;color:var(--ink-2)}
.consent-row{display:flex;gap:10px;align-items:flex-start;font-size:14px;line-height:1.5}
.consent-row input{width:20px;height:20px;flex:0 0 20px;margin-top:1px;accent-color:var(--accent)}
.doc-body{
  white-space:pre-wrap;word-break:break-word;font-size:12px;line-height:1.7;
  color:var(--ink-2);max-height:62vh;overflow-y:auto;margin:0;
  font-family:inherit;
}

/* ── 친구 ─────────────────────────────────────────────── */
.rank-list{display:grid;gap:6px}
.rank-list:empty{display:none}
.rank-row{
  display:flex;align-items:center;gap:10px;padding:8px 10px;
  border-radius:12px;background:var(--bg-2);font-size:14px;
}
.rank-row.me{background:var(--card);outline:1px solid var(--accent)}
.rank-no{
  width:22px;height:22px;flex:0 0 22px;border-radius:999px;
  background:var(--card);color:var(--ink-2);
  display:grid;place-items:center;font-size:12px;font-weight:700;
}
.rank-who{flex:1;min-width:0;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.profile-friend{display:flex;align-items:center;gap:10px;padding:0 16px 14px}
.profile-friend .btn{width:auto}
#friend-results:empty,#friend-requests:empty{display:none}
.slide-badge.hot{color:#f2a15c}

/* ── 백그라운드 판별 ──────────────────────────────────── */
.job-banner{
  display:flex;align-items:center;justify-content:center;gap:6px;flex-wrap:wrap;
  margin:0 16px 8px;padding:8px 12px;border-radius:12px;
  background:var(--card);border:1px solid var(--line);
  color:var(--ink);font-size:13px;font-weight:600;
}
.job-sep{color:var(--ink-3);padding:0 2px}
.tab-ico{position:relative;display:inline-block}
.tab-dot{
  position:absolute;top:-4px;right:-10px;min-width:16px;height:16px;padding:0 4px;
  border-radius:999px;background:#e8604c;color:#fff;
  font-size:10px;font-weight:700;line-height:16px;text-align:center;font-style:normal;
}
.pick-cards{display:grid;gap:10px;padding:0 16px}
.pick-cards:empty{display:none}
.pick-card{
  display:flex;gap:12px;align-items:flex-start;padding:10px;
  border-radius:14px;background:var(--card);border:1px solid var(--line);
}
.pick-card > img{
  width:84px;height:112px;flex:0 0 84px;object-fit:cover;
  border-radius:10px;background:var(--bg-2);
}
.pick-body{flex:1;min-width:0;display:grid;gap:8px;align-content:start}
.pick-body .linkish{justify-self:start}

/* ── 공유 링크로 들어온 기록 ─────────────────────────── */
.shared-sheet{max-height:92vh}
#shared-body{display:grid;gap:4px}
.shared-photo{display:block;width:100%;max-height:52vh;object-fit:cover;border-radius:14px;
  background:#000;margin-bottom:8px}
.shared-name{font-size:21px;font-weight:700}
.shared-actions{display:grid;gap:8px;margin-top:12px}
.shared-sci{font-style:italic;color:var(--ink-2);font-size:14px}
.shared-join{margin-top:8px;color:var(--accent);font-size:14px;font-weight:600}

/* AI 가 추정한 이름 후보 칩 — 사람이 고른 제안과 구별되게 점선 테두리 */
.chip-ai{border:1px dashed var(--accent);color:var(--accent)}

/* ── 보물찾기 ──────────────────────────────────────────── */
.treasure-pin span{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;
  background:#f4d67a;border:2px solid #0f1c15;font-size:18px;box-shadow:0 2px 8px rgba(0,0,0,.45);
  animation:treasure-bob 2.4s ease-in-out infinite}
@keyframes treasure-bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}
.chip-treasure.chip-on{background:#f4d67a;color:#0f1c15}
.treasure-pin{position:relative}
.treasure-pin em{position:absolute;top:-6px;right:-8px;min-width:18px;height:18px;padding:0 5px;
  border-radius:999px;background:#e8604c;color:#fff;font:700 11px/18px system-ui,sans-serif;
  font-style:normal;text-align:center;border:2px solid #0f1c15}
.map-me{position:absolute;right:12px;bottom:64px;z-index:500;width:44px;height:44px;border-radius:50%;
  background:var(--card);border:1px solid var(--line);font-size:20px;box-shadow:0 4px 12px rgba(0,0,0,.35)}
.treasure-item{padding:10px 0;border-top:1px solid var(--line)}
.treasure-item:first-of-type{border-top:0}
/* 이름만 숨기고 사진은 그대로 — 수배 전단처럼 보고 찾으러 간다 */
.treasure-photo{width:100%;height:220px;object-fit:cover;border-radius:12px}
.treasure-photo-wrap{overflow:hidden;border-radius:12px;margin-bottom:10px;background:#000}
.treasure-hints{display:grid;gap:4px;margin-bottom:12px}

/* ── 퀘스트 · 배지 ─────────────────────────────────────── */
.quest-box{margin:0 16px 14px;padding:14px;border-radius:16px;background:var(--card);border:1px solid var(--line)}
.quest-box[hidden]{display:none}
.quest-head{display:flex;align-items:center;gap:8px;font-weight:700}
.quest-period{font-size:12px;color:var(--ink-3);margin:2px 0 10px}
.quest-row{display:grid;grid-template-columns:28px 1fr auto;gap:4px 10px;align-items:center;padding:6px 0}
.quest-ico{font-size:20px;grid-row:span 2;text-align:center}
.quest-title{font-size:14px;font-weight:600}
.quest-count{font-size:13px;color:var(--ink-2);grid-row:span 2}
.quest-bar{height:6px;border-radius:999px;background:var(--bg);overflow:hidden}
.quest-bar i{display:block;height:100%;background:var(--accent);border-radius:999px;transition:width .4s}
.quest-row.done .quest-bar i{background:#f4d67a}
.badge-shelf{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px;padding-top:10px;border-top:1px solid var(--line)}
/* 메달: 시즌마다 테두리 색이 다르고, 완주는 금색 */
.medal{--c:var(--accent);display:grid;justify-items:center;gap:2px;width:52px;padding:6px 0 5px;
  border-radius:14px;background:var(--bg);border:2px solid var(--c);cursor:pointer}
.medal b{font-size:20px;line-height:1}
.medal small{font-size:10px;font-weight:700;color:var(--c);letter-spacing:.02em}
.medal.s1{--c:#8ab4f8}.medal.s2{--c:#7fd6a0}.medal.s3{--c:#f4b26a}.medal.s4{--c:#c9a0f0}
.medal.legacy{--c:var(--ink-3)}
.medal.gold{--c:#f4d67a;background:rgba(244,214,122,.12)}

/* ── 도감: 식물 / 배지 전환 ─────────────────────────────── */
.seg{display:grid;grid-template-columns:1fr 1fr;gap:4px;margin:0 16px 14px;padding:4px;
  border-radius:14px;background:var(--card)}
.seg button{padding:9px 6px;border-radius:10px;color:var(--ink-2);font-size:14px;font-weight:600}
.seg button em{font-style:normal;font-weight:500;opacity:.8}
.seg button.on{background:var(--accent);color:var(--accent-ink)}
.quest-more{display:block;margin-top:8px;font-size:13px;color:var(--accent);text-align:right}

/* 배지 수집판: 연도 → 시즌, 시즌마다 칸 4개 */
#dex-badges{padding:0 16px 20px}
.board-year{font-size:18px;font-weight:700;margin:6px 0 4px}
.board-season{display:grid;grid-template-columns:78px 1fr;align-items:center;gap:10px;
  padding:10px 0;border-bottom:1px solid var(--line)}
.board-season .when{font-size:13px;font-weight:700;line-height:1.3}
.board-season .when small{display:block;font-weight:500;color:var(--ink-3)}
.board-slots{display:flex;flex-wrap:wrap;gap:8px}
.medal.open{--c:var(--ink-3);border-style:dashed;background:transparent}
.medal.open b{filter:grayscale(1);opacity:.45}
.medal.miss{--c:var(--line);background:transparent;opacity:.45}
.medal.miss b{filter:grayscale(1);opacity:.5}
.board-empty{color:var(--ink-3);font-size:14px;padding:12px 0}

/* ── 새 주소 안내 띠 ─────────────────────────────────── */
.move-banner{position:fixed;left:12px;right:12px;top:calc(8px + env(safe-area-inset-top));z-index:70;
  display:flex;align-items:center;gap:8px;padding:10px 12px;border-radius:14px;
  background:#f4d67a;color:#0f1c15;box-shadow:0 6px 18px rgba(0,0,0,.4);font-size:14px;font-weight:600}
.move-banner[hidden]{display:none}
.move-banner a{flex:1;color:inherit;text-decoration:none}
.move-banner .icon-btn{color:#0f1c15;background:transparent}

/* ── 발견 장소 ─────────────────────────────────────────── */
.place-line{display:flex;align-items:center;gap:8px;margin:4px 2px 8px;font-size:14px;color:var(--ink-2)}
.place-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ── 기록 카드 ─────────────────────────────────────────── */
.card-preview{display:block;width:100%;max-width:360px;margin:6px auto 12px;border-radius:12px;
  box-shadow:0 6px 20px rgba(0,0,0,.4)}
.card-actions{display:grid;gap:8px;margin:10px 0 8px}
.card-actions-row{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.card-caption{width:100%;margin-top:4px;padding:10px 12px;border-radius:12px;resize:vertical;
  background:var(--bg);border:1px solid var(--line);color:var(--ink);font:inherit;font-size:14px;line-height:1.5}
#card-format{margin-bottom:6px}

/* ── 한 줄 평 · 이름 물어보기 ─────────────────────────── */
.photo-note{margin:6px 2px 8px;font-size:14px;color:var(--ink);font-style:italic;line-height:1.45}
.pick-note{width:100%;margin:8px 0 4px;padding:8px 10px;border-radius:10px;
  background:var(--bg);border:1px solid var(--line);color:var(--ink);font-size:14px}
