:root {
  --bg: #ffffff;
  --surface: #f6f5f2;
  --text: #1a1a1a;
  --muted: #8a8a85;
  --line: rgba(0, 0, 0, 0.1);
  --line-2: rgba(0, 0, 0, 0.18);
  --accent: #111111;
  --warn-bg: #fbf1e3;
  --warn: #9a6a1a;
  --info: #185fa5;
  --radius: 12px;
  --maxw: 480px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overscroll-behavior-y: none; } /* 위로 당겨 새로고침(pull-to-refresh) 방지 */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo",
    "Malgun Gothic", system-ui, sans-serif;
  color: var(--text);
  background: var(--surface);
  -webkit-tap-highlight-color: transparent;
}

/* 헤더 */
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.logo { font-size: 17px; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 12px; }
.icon-btn { border: none; background: none; font-size: 16px; cursor: pointer; padding: 2px; line-height: 1; }
.conn { width: 9px; height: 9px; border-radius: 50%; background: #d8d6cf; }
.fb-btn { position: relative; }
.fbdot { position: absolute; top: -2px; right: -2px; width: 8px; height: 8px; border-radius: 50%; background: #e24b4a; }
.fbdot.hidden { display: none; }

/* 개선요청함 */
.fb-compose { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 16px; background: var(--surface); }
.fb-compose .search { margin-bottom: 8px; }
.fb-compose .memo { width: 100%; box-sizing: border-box; margin-bottom: 8px; }
.fb-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; background: var(--bg); }
.fb-card.done { opacity: 0.7; background: var(--surface); }
.fb-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.fb-author { font-size: 12.5px; font-weight: 700; }
.fb-date { font-size: 10.5px; color: var(--muted); }
.fb-badge { margin-left: auto; font-size: 10px; font-weight: 700; color: #1f7a44; background: #eaf6ee; padding: 2px 7px; border-radius: 999px; }
.fb-body { font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; }
.fb-ai { margin-top: 8px; padding: 9px 11px; border-radius: 9px; background: var(--surface); font-size: 12px; line-height: 1.5; }
.fb-comments { margin-top: 8px; }
.fb-cmt { font-size: 12px; line-height: 1.6; padding: 3px 0; border-top: 1px dashed var(--line); }
.fb-cmt b { color: var(--accent); }
.fb-cmt-add { display: flex; gap: 6px; margin-top: 8px; }
.fb-cmt-add .search { flex: 1; margin: 0; }
.fb-cmt-add .btn { padding: 8px 12px; }
.fb-toggle { margin-top: 8px; border: none; background: none; color: var(--muted); font-size: 11px; cursor: pointer; text-decoration: underline; padding: 0; }
.trash-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.trash-actions { display: flex; gap: 6px; margin-top: 7px; }
.trash-actions .btn { flex: 1; height: 30px; font-size: 11px; padding: 0 6px; }
.conn.online { background: #38b000; }
.conn.offline { background: #e24b4a; }

/* 본문 */
#view {
  max-width: var(--maxw);
  margin: 0 auto;
  background: var(--bg);
  min-height: calc(100vh - 124px);
  padding-bottom: 80px;
}
.screen { padding: 16px 18px; }

/* 검색 */
.search {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 14px;
  outline: none;
  background: var(--bg);
}
.search:focus { border-color: var(--accent); }
.hint { font-size: 11px; color: var(--muted); margin: 6px 2px 12px; }
.hint.center { text-align: center; }

/* 칩 줄 (PC·모바일 모두 한눈에 보이도록 줄바꿈) */
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}
.chip {
  flex-shrink: 0;
  font-size: 12px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip.small { padding: 5px 11px; }

/* cat2: 세부 태그 — cat1과 명확히 구분 (들여쓰기 + 왼쪽 라인 + 각진 칩) */
.subtag-wrap { margin: 2px 0 12px; }
.subtag-label { font-size: 11px; color: var(--muted); margin: 0 0 6px 2px; }
/* 활성 필터 요약 바 (여러 분류 교차 AND) */
.filter-bar { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin:2px 0 12px; }
.fb-lbl { font-size:11px; font-weight:800; color:var(--muted); margin-right:2px; }
.afilter { border:none; background:var(--accent); color:#fff; font-size:11.5px; font-weight:700; padding:4px 9px; border-radius:999px; cursor:pointer; }
.afilter.clear { background:var(--surface); color:var(--muted); border:1px solid var(--line); }

/* 편집: 컬렉션 브랜드별 줄 (MB / SC) */
.coll-row { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin:6px 0; }
.coll-brand { font-size:12px; font-weight:800; min-width:26px; color:var(--text); }

.subtag-clear {
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 6px;
  cursor: pointer;
}
.subtag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0 8px 10px;
  border-left: 2px solid var(--line-2);
}
.subchip {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 7px;
  border: 0.5px solid var(--line-2);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.subchip.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.color-chip { font-weight: 500; border-width: 0.5px; }
.color-chip.on { outline: 2px solid var(--text); outline-offset: 2px; }
.chip.mini { padding: 3px 10px; font-size: 14px; }
.chip.dz { border-style: dashed; color: var(--text); }

/* 그리드 카드 */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
/* 그리드 칸 수 선택기 */
.cols-sel {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin: 4px 0 12px;
}
.cols-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 12px; }
.cols-row .cols-sel { margin: 0; }
.merge-enter { cursor: pointer; }
.cols-lbl { font-size: 12px; color: var(--muted); margin-right: 2px; }
.col-btn {
  min-width: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.col-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
/* 휴지통 자동삭제 안내 */
.trash-days { font-size: 11px; color: var(--muted); margin-bottom: 7px; }
.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg);
}
.card-img { aspect-ratio: 3 / 4; background-color: #f3f2ee; }
.card-del {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.38);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.55;
  transition: opacity 0.15s;
}
.card:hover .card-del { opacity: 1; }

/* 수동 크롭 */
.crop-wrap { max-width: 100%; margin-bottom: 4px; }
.crop-wrap img { display: block; max-width: 100%; max-height: 56vh; }
.crop-actions { display: flex; gap: 8px; margin-top: 12px; }
.crop-actions .btn { flex: 1; }

/* 여러 장 업로드 */
.bulk-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 8px 0 14px;
}
.bulk-cell { position: relative; }
.bulk-thumb {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.bulk-badge {
  position: absolute;
  left: 4px;
  bottom: 4px;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
}
.progress { height: 6px; background: var(--surface); border-radius: 999px; overflow: hidden; margin: 8px 0 4px; }
.progress .bar { height: 100%; background: var(--accent); transition: width 0.2s; }

/* 묶음 선택 (개별 셀 좌상단 ○) */
.sel-dot {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 3;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.sel-dot.on { background: var(--accent); border-color: var(--accent); }
.bulk-cell.sel .bulk-thumb { outline: 3px solid var(--accent); outline-offset: -1px; }
/* 선택 체크 표시(이미지 탭=선택) */
.sel-check {
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 3;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
/* 좌하단 자르기 버튼 */
.bulk-crop-btn {
  position: absolute;
  left: 5px;
  bottom: 5px;
  z-index: 3;
  border: none;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  cursor: pointer;
}

/* 선택 액션 바 */
.sel-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin: 4px 0 12px;
  border-radius: 12px;
  background: #eaf6ee;
  border: 1px solid #bfe3cb;
}
.sel-count { font-size: 13px; font-weight: 700; color: #1f7a44; margin-right: auto; }
.sel-bar .btn { padding: 8px 12px; }

/* 묶음 카드 (업로드 검토) */
.bundle-card {
  border: 1.5px solid var(--accent);
  border-radius: 12px;
  padding: 10px;
  margin: 0 0 12px;
  background: var(--surface);
}
.bundle-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.bundle-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.bundle-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid var(--line);
  cursor: pointer;
}
.bundle-thumb.rep { outline: 3px solid var(--accent); outline-offset: -1px; }
.rep-star {
  position: absolute;
  left: 3px;
  bottom: 3px;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
}

/* 보드 썸네일 묶음 배지 */
.bundle-badge {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 2;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
}

/* 보드에서 묶기 (선택 모드) */
.merge-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.merge-top b { font-size: 15px; }
.card.selecting .card-img { outline: 3px solid var(--accent); outline-offset: -2px; }
.card.selecting { opacity: 1; }
.sel-num {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 3;
  min-width: 24px;
  height: 24px;
  padding: 0 5px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.sel-num.on { background: var(--accent); border-color: var(--accent); }
.sel-num.rep { background: #e8a300; border-color: #fff; }
.rep-set {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 3;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
}
.merge-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(70px + env(safe-area-inset-bottom)); /* 하단 탭바 위로 확실히 띄우기 */
  z-index: 44; /* 탭바(45)보다 아래 → 메뉴 안 가림 */
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #1f2937;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.merge-bar .sel-count { color: #fff; font-weight: 700; font-size: 13px; margin-right: auto; }
.merge-bar .btn { padding: 9px 16px; }

/* 보드 썸네일: 태그 다는 중 표시 */
.analyzing-badge {
  position: absolute;
  left: 7px;
  bottom: 7px;
  z-index: 2;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
}
/* 편집: 저장된 묶음 사진 관리 */
.bundle-manage { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 4px 0 6px; }
.bm-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid var(--line);
  cursor: pointer;
}
.bm-thumb.rep { outline: 3px solid var(--accent); outline-offset: -1px; }
.bm-thumb.focus { outline: 3px solid var(--accent); outline-offset: -1px; }
.bm-thumb .rep-star {
  position: absolute; left: 3px; bottom: 3px;
  font-size: 9px; font-weight: 700; padding: 1px 5px;
  border-radius: 5px; background: var(--accent); color: #fff;
}
.bm-rep {
  position: absolute; left: 3px; bottom: 3px;
  font-size: 9px; font-weight: 700; padding: 2px 6px;
  border: none; border-radius: 5px; background: rgba(0, 0, 0, 0.6); color: #fff; cursor: pointer;
}
.bm-del {
  position: absolute; top: 3px; right: 3px;
  width: 20px; height: 20px; border: none; border-radius: 999px;
  background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 11px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.bm-sep {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border: none; border-radius: 999px;
  background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.bm-crop {
  position: absolute; top: 3px; right: 27px;
  width: 20px; height: 20px; border: none; border-radius: 999px;
  background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 11px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.bm-add {
  aspect-ratio: 1;
  border: 1.5px dashed var(--line);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  text-align: center; font-size: 11px; font-weight: 700; color: var(--muted);
  cursor: pointer;
}

/* 편집: 이번 수정 학습 제외 체크 */
.skip-learn {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
}
.skip-learn.on { border-color: var(--accent); background: var(--surface); }
.skip-box {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--muted);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.skip-learn.on .skip-box { background: var(--accent); border-color: var(--accent); }

/* 편집: 크롭 임시 적용 배지 */
.crop-staged {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 3;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
}

/* 상세 묶음 슬라이드 (인덱스 기반 — 한 번 스와이프=한 장) */
.sheet-carousel { position: relative; overflow: hidden; }
.carousel-track {
  display: flex;
  touch-action: pan-y; /* 세로(시트) 스크롤은 허용, 가로 스와이프는 직접 처리 */
  will-change: transform;
}
.carousel-slide {
  flex: 0 0 100%;
  aspect-ratio: 3 / 4;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}
.carousel-count {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
}
.carousel-hint {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
}
.card-body { padding: 9px 11px; }
.card-name { font-size: 12.5px; font-weight: 600; line-height: 1.35; margin-bottom: 7px; }
.pills { display: flex; flex-wrap: wrap; gap: 5px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}
.pill.muted { color: var(--muted); background: transparent; }
.pill .badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #e6f1fb;
  color: var(--info);
}
.pill.edit i, .pill.pending i, .pill.unc i {
  cursor: pointer;
  font-style: normal;
  font-size: 11px;
  opacity: 0.6;
}
.pill.pending {
  background: transparent;
  border: 1px dashed var(--line-2);
  color: var(--muted);
}
.pill.pending i.ok, .pill .ok { color: #38b000; opacity: 1; }
.pill.unc {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid #e7c98f;
  cursor: pointer;
}
.pill.unc.sel { outline: 2px solid var(--warn); outline-offset: 1px; }

.empty { font-size: 13px; color: var(--muted); text-align: center; padding: 30px 0; }
.muted { color: var(--muted); }
.small { font-size: 11px; }

/* 업로드 */
.filepick {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 200px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 12px;
}
.filepick:hover { border-color: var(--accent); color: var(--text); }
.filepick-ico { font-size: 32px; line-height: 1; }
.filepick .hint { margin: 0; }

.upload-photo {
  height: 170px;
  border-radius: var(--radius);
  display: flex;
  align-items: flex-end;
  padding: 10px;
  margin-bottom: 14px;
}
.upload-photo.small { height: 110px; }
.filename {
  font-size: 11px;
  color: #6b6453;
  background: rgba(255, 255, 255, 0.65);
  padding: 2px 8px;
  border-radius: 5px;
}
.sub { font-size: 12.5px; font-weight: 600; margin: 14px 0 8px; }
.tag-line { display: flex; gap: 8px; margin-bottom: 8px; }
.tag-cat { font-size: 11px; color: var(--muted); width: 40px; flex-shrink: 0; padding-top: 5px; }
.add-row { display: flex; gap: 7px; margin: 14px 0 4px; }
.add-row .search { flex: 1; }
.toast { font-size: 11px; color: var(--info); min-height: 16px; margin-bottom: 6px; animation: fade 2.4s ease; }
@keyframes fade { 0% { opacity: 0; } 12% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
.unc-box { background: var(--warn-bg); border-radius: 10px; padding: 11px 12px; margin: 12px 0; }
.unc-box .pills { margin-bottom: 4px; }
.unc-title { font-size: 12px; font-weight: 600; color: var(--warn); margin-bottom: 8px; }
.memo {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  resize: none;
  outline: none;
}

/* 버튼 */
.btn {
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--bg);
  font-size: 14px;
  cursor: pointer;
}
.btn.block { width: 100%; margin-top: 12px; }
.btn.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; background: var(--surface); color: var(--muted); border-color: var(--line); }
.btn.danger { border-color: #e7b4b4; color: #b3261e; }

/* 달력 */
.calendar { border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; margin-bottom: 14px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-title { font-size: 13px; font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-wd { font-size: 10px; color: var(--muted); text-align: center; padding: 2px 0; }
.cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border-radius: 7px;
  position: relative;
}
.cell.has { cursor: pointer; }
.cell.today { outline: 1px solid var(--info); }
.cell.sel { background: var(--accent); color: #fff; }
.dot { width: 4px; height: 4px; border-radius: 50%; background: var(--info); margin-top: 2px; }
.cell.sel .dot { background: #fff; }
.counter { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.date-group { margin-bottom: 16px; }
.date-head { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.date-row { display: flex; align-items: center; gap: 11px; margin-bottom: 9px; cursor: pointer; }
.thumb { width: 48px; height: 48px; border-radius: 8px; flex-shrink: 0; }

/* 상세 오버레이 */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  touch-action: none; /* 배경(백드롭) 스크롤 제스처 차단 */
}
.overlay.hidden { display: none; }
/* 상세/편집/라이트박스 열리면 뒤 배경(body) 스크롤 잠금 */
body.modal-open { overflow: hidden; }
.sheet {
  width: 100%;
  max-width: var(--maxw);
  background: var(--bg);
  border-radius: 16px 16px 0 0;
  max-height: 85vh;
  overflow-y: auto;
  overscroll-behavior: contain; /* 끝까지 스크롤해도 뒤 리스트로 안 넘어가게 */
  touch-action: pan-y; /* 시트 내부는 세로 스크롤 허용 */
}
.sheet-top { height: 300px; background-color: #f3f2ee; position: relative; }
.sheet-top.zoomable { cursor: zoom-in; touch-action: pan-y; } /* 이미지에서 시작해도 세로 스크롤 허용 */
.add-more { cursor: pointer; margin: 2px 0 4px; }
.crop-fab {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.75;
}
.crop-fab:hover { opacity: 1; }

/* 이미지 확대(라이트박스) */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}
.lightbox.hidden { display: none; }
.lightbox img {
  max-width: 100vw;
  max-height: 100vh;
  transform-origin: center center;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
}
.lb-close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}
.lb-hint {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}
.sheet-body { padding: 16px 18px 28px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.sheet-name { font-size: 15px; font-weight: 600; }
.memo-box {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.detail-actions .btn { flex: 1; }
.mini-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin: 4px 0 5px;
}

/* 하단 탭바 */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45; /* 하단 메뉴가 항상 위(묶기 바보다 우선) */
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1;
  border: none;
  background: none;
  padding: 9px 0 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}
.tab.on { color: var(--accent); font-weight: 600; }
.tab-ico { font-size: 17px; }
